Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DART-WRF
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DataAssimilation
DART-WRF
Commits
1b551cca
Commit
1b551cca
authored
10 months ago
by
lkugler
Browse files
Options
Downloads
Patches
Plain Diff
less printing
parent
6ba58a3e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dartwrf/prepare_namelist.py
+2
-2
2 additions, 2 deletions
dartwrf/prepare_namelist.py
dartwrf/prepare_wrfrundir.py
+3
-3
3 additions, 3 deletions
dartwrf/prepare_wrfrundir.py
dartwrf/workflows.py
+17
-14
17 additions, 14 deletions
dartwrf/workflows.py
with
22 additions
and
19 deletions
dartwrf/prepare_namelist.py
+
2
−
2
View file @
1b551cca
...
...
@@ -57,8 +57,8 @@ def run(iens, begin, end, hist_interval_s=5*60, radt=5, archive=True,
'
<HH2>
'
:
'
%H
'
,
'
<MM2>
'
:
'
%M
'
,
'
<SS2>
'
:
'
%S
'
}.
items
():
sed_inplace
(
rundir
+
'
/namelist.input
'
,
k
,
end
.
strftime
(
v
))
print
(
rundir
+
'
/namelist.input created
'
)
print
(
'
WRF namelist begin:
'
,
begin
,
'
end:
'
,
end
,
'
output to
'
,
archdir
)
#
print(rundir+'/namelist.input created')
#
print('WRF namelist begin:', begin, 'end:', end, 'output to', archdir)
#########################
if
archive
:
...
...
This diff is collapsed.
Click to expand it.
dartwrf/prepare_wrfrundir.py
+
3
−
3
View file @
1b551cca
...
...
@@ -24,12 +24,12 @@ if __name__ == '__main__':
init_time
=
dt
.
datetime
.
strptime
(
sys
.
argv
[
1
],
'
%Y-%m-%d_%H:%M
'
)
for
iens
in
range
(
1
,
exp
.
n_ens
+
1
):
print
(
'
preparing ens
'
,
iens
)
#
print('preparing ens', iens)
rundir
=
cluster
.
wrf_rundir
(
iens
)
os
.
makedirs
(
rundir
,
exist_ok
=
True
)
link_contents
(
cluster
.
srcdir
,
rundir
)
print
(
'
linking ideal and wrf.exe:
'
)
#
print('linking ideal and wrf.exe:')
symlink
(
cluster
.
ideal
,
rundir
+
'
/ideal.exe
'
)
symlink
(
cluster
.
wrfexe
,
rundir
+
'
/wrf.exe
'
)
...
...
@@ -41,4 +41,4 @@ if __name__ == '__main__':
input_prof
=
(
exp
.
input_profile
).
replace
(
'
<iens>
'
,
str
(
iens
).
zfill
(
3
))
symlink
(
input_prof
,
rundir
+
'
/input_sounding
'
)
print
(
'
finished
.
'
)
print
(
'
All run_WRF directories have been set up
.
'
)
This diff is collapsed.
Click to expand it.
dartwrf/workflows.py
+
17
−
14
View file @
1b551cca
...
...
@@ -35,7 +35,7 @@ class WorkFlows(object):
try
:
shutil
.
copytree
(
self
.
cluster
.
dartwrf_dir
,
self
.
cluster
.
archivedir
+
'
/DART-WRF/
'
,
ignore
=
shutil
.
ignore_patterns
(
'
*.git
'
,))
# don't copy the git repo
print
(
'
DART-WRF
has been copied to
'
,
self
.
cluster
.
archivedir
)
print
(
'
>>>
DART-WRF
scripts:
"'
+
self
.
cluster
.
archivedir
+
'
/DART-WRF/
"'
)
except
FileExistsError
as
e
:
warnings
.
warn
(
str
(
e
))
if
input
(
'
The experiment name already exists! Scripts will not be overwritten. Continue? (Y/n)
'
)
in
[
'
Y
'
,
'
y
'
]:
...
...
@@ -91,8 +91,8 @@ class WorkFlows(object):
print
(
'
------------------------------------------------------
'
)
print
(
'
>>> Starting experiment ...
'
)
print
(
'
>>> Experiment configuration:
"
./config/
'
+
exp_config
+
'"
'
)
print
(
'
>>> Server configuration:
"
./config/
'
+
server_config
+
'"'
)
print
(
'
>>> Experiment configuration:
"
./config/
'
+
exp_config
+
'"
'
)
print
(
'
>>> Server configuration:
"
./config/
'
+
server_config
+
'"'
)
#### 1
# copy the selected config files (arguments to Workflows(...)) to the scripts directory
...
...
@@ -116,7 +116,19 @@ class WorkFlows(object):
from
exp_config
import
exp
self
.
exp
=
exp
print
(
'
>>> Main data folder:
"'
+
self
.
cluster
.
archivedir
+
'"'
)
print
(
'
>>> Temporary DART run folder:
"'
+
self
.
cluster
.
dart_rundir
+
'"'
)
print
(
'
>>> Temporary WRF run folder:
"'
+
self
.
cluster
.
wrf_rundir_base
+
'"'
)
#### 3
# Set paths and backup scripts
self
.
cluster
.
log_dir
=
self
.
cluster
.
archivedir
+
'
/logs/
'
print
(
'
>>> In case of error, check logs at:
"'
+
self
.
cluster
.
log_dir
+
'"'
)
if
self
.
cluster
.
use_slurm
:
self
.
cluster
.
slurm_scripts_dir
=
self
.
cluster
.
archivedir
+
'
/slurm-scripts/
'
print
(
'
>>> SLURM scripts stored in:
"'
,
self
.
cluster
.
slurm_scripts_dir
+
'"'
)
#### 4
# to be able to generate obs_seq.in files, we need a dictionary to convert obs kinds to numbers
# a) we read the obs kind definitions (obs_kind_mod.f90 from DART code)
# b) we generate a python file with this dictionary
...
...
@@ -124,23 +136,14 @@ class WorkFlows(object):
# (so the documentation generator SPHINX can read it)
_dict_to_py
(
_obskind_read
(),
original_scripts_dir
+
'
/obs/obskind.py
'
)
####
4
####
5
# Copy scripts and config files to `self.cluster.archivedir` folder
_copy_dartwrf_to_archive
()
####
5
####
6
# we set the path from where python should import dartwrf modules
# every python command then imports DART-WRF from self.cluster.archivedir+'/DART-WRF/dartwrf/'
self
.
cluster
.
python
=
'
export PYTHONPATH=
'
+
self
.
cluster
.
scripts_rundir
+
'
/../;
'
+
self
.
cluster
.
python
#### 6
# Set paths and backup scripts
self
.
cluster
.
log_dir
=
self
.
cluster
.
archivedir
+
'
/logs/
'
print
(
'
>>> Logging to:
"'
+
self
.
cluster
.
log_dir
+
'"'
)
if
self
.
cluster
.
use_slurm
:
self
.
cluster
.
slurm_scripts_dir
=
self
.
cluster
.
archivedir
+
'
/slurm-scripts/
'
print
(
'
>>> SLURM scripts stored in:
"'
,
self
.
cluster
.
slurm_scripts_dir
+
'"'
)
print
(
'
>>> DART-WRF experiment initialized.
'
)
print
(
'
------------------------------------------------------
'
)
...
...
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