Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
autoicon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
w2w
autoicon
Commits
0092eaec
Commit
0092eaec
authored
1 year ago
by
Oriol Tintó
Browse files
Options
Downloads
Patches
Plain Diff
Fix prepare_date_local.sh and prepare_date_remote.sh
parent
a9da0e06
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
templates/real-from-dwd-ana/prepare_date_local.sh
+16
-3
16 additions, 3 deletions
templates/real-from-dwd-ana/prepare_date_local.sh
templates/real-from-dwd-ana/prepare_date_remote.sh
+16
-35
16 additions, 35 deletions
templates/real-from-dwd-ana/prepare_date_remote.sh
with
32 additions
and
38 deletions
templates/real-from-dwd-ana/prepare_date_local.sh
+
16
−
3
View file @
0092eaec
#!/bin/bash -l
IS_LOCAL
=
%SIMULATION.INITIAL_CONDITIONS.LOCAL%
# This script is executed on the machine at which autosubmit is executed.
# and will be used if the initial conditions are in this same system.
if
[
"
${
IS_LOCAL
}
"
==
"True"
]
;
then
# Because it can happen that the initial conditions as well and the execution happens in the local
# system we need to define these two variables:
DATA_IS_LOCAL
=
%SIMULATION.INITIAL_CONDITIONS.LOCAL%
if
[
"x%HPCARCH%"
==
"xlocal"
]
;
then
RUN_MACHINE_IS_LOCAL
=
"True"
else
RUN_MACHINE_IS_LOCAL
=
"False"
fi
if
[
"
${
DATA_IS_LOCAL
}
"
==
"True"
]
;
then
# Get some variables provided by autosubmit.
WORKDIR
=
%HPCROOTDIR%
STARTDATE
=
%SDATE%
...
...
@@ -35,7 +48,7 @@ if [ "${IS_LOCAL}" == "True" ]; then
# Check if we copy the initial conditions from the local system or the remote one
if
[
"
${
IS_LOCAL
}
"
!=
"True"
]
;
then
if
[
"
${
RUN_MACHINE_
IS_LOCAL
}
"
!=
"True"
]
;
then
# Create member folder
ssh
"
${
HPCUSER
}
@
${
HPCHOST
}
"
mkdir
-p
${
COMMON_DATE_FOLDER
}
...
...
This diff is collapsed.
Click to expand it.
templates/real-from-dwd-ana/prepare_date_remote.sh
+
16
−
35
View file @
0092eaec
#!/bin/bash -l
IS_LOCAL
=
%SIMULATION.INITIAL_CONDITIONS.LOCAL%
# This script is executed on the remote system at which the simulation will happen
# and will be used if the initial conditions are in this same remote system.
DATA_IS_LOCAL
=
%SIMULATION.INITIAL_CONDITIONS.LOCAL%
if
[
"
${
IS_LOCAL
}
"
==
"0"
]
;
then
if
[
"
${
DATA_IS_LOCAL
}
"
!=
"True"
]
;
then
# Get some variables provided by autosubmit.
WORKDIR
=
%HPCROOTDIR%
STARTDATE
=
%SDATE%
...
...
@@ -34,40 +37,18 @@ if [ "${IS_LOCAL}" == "0" ]; then
# Check if we copy the initial conditions from the local system or the remote one
if
[
"
${
IS_LOCAL
}
"
==
"True"
]
;
then
# Create member folder
ssh
"
${
HPCUSER
}
@
${
HPCHOST
}
"
mkdir
-p
${
COMMON_DATE_FOLDER
}
# Save filenames to be used later by other scripts.
echo
"
${
AN_FILE
}
"
>
an_file.txt
echo
"
${
FG_FILE
}
"
>
fg_file.txt
rsync
-v
an_file.txt
"
${
HPCUSER
}
@
${
HPCHOST
}
"
:
"
${
COMMON_DATE_FOLDER
}
/an_file.txt"
rsync
-v
fg_file.txt
"
${
HPCUSER
}
@
${
HPCHOST
}
"
:
"
${
COMMON_DATE_FOLDER
}
/fg_file.txt"
# Remove temporary files.
rm
an_file.txt
rm
fg_file.txt
# Create member folder and go there
mkdir
-p
${
COMMON_DATE_FOLDER
}
cd
${
COMMON_DATE_FOLDER
}
||
exit
#
Copy the first-guess and analysis file
s.
rsync
-v
"
${
FG_SOURCE
}
"
"
${
HPCUSER
}
@
${
HPCHOST
}
"
:
"
${
COMMON_DATE_FOLDER
}
/
${
FG_FILE
}
"
rsync
-v
"
${
AN_SOURCE
}
"
"
${
HPCUSER
}
@
${
HPCHOST
}
"
:
"
${
COMMON_DATE_FOLDER
}
/
${
AN_FILE
}
"
#
Save filenames to be used later by other script
s.
echo
"
${
AN_FILE
}
"
>
an_file.txt
echo
"
${
FG_FILE
}
"
>
fg_file.txt
# Change permissions to read only.
ssh
"
${
HPCUSER
}
@
${
HPCHOST
}
"
chmod
440
"
${
COMMON_DATE_FOLDER
}
/*"
else
# Create member folder and go there
mkdir
-p
${
COMMON_DATE_FOLDER
}
cd
${
COMMON_DATE_FOLDER
}
||
exit
# Copy the first-guess and analysis files.
cp
"
${
FG_SOURCE
}
"
"
${
FG_FILE
}
"
cp
"
${
AN_SOURCE
}
"
"
${
AN_FILE
}
"
# Save filenames to be used later by other scripts.
echo
"
${
AN_FILE
}
"
>
an_file.txt
echo
"
${
FG_FILE
}
"
>
fg_file.txt
# Copy the first-guess and analysis files.
cp
"
${
FG_SOURCE
}
"
"
${
FG_FILE
}
"
cp
"
${
AN_SOURCE
}
"
"
${
AN_FILE
}
"
# Change permissions to read only.
chmod
440 ./
*
fi
# Change permissions to read only.
chmod
440 ./
*
fi
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment