Skip to content
Snippets Groups Projects
Commit 75a38678 authored by lkugler's avatar lkugler
Browse files

imports

parent 28652c87
Branches
Tags
No related merge requests found
...@@ -2,7 +2,7 @@ import os, sys, glob, warnings ...@@ -2,7 +2,7 @@ import os, sys, glob, warnings
from config.cfg import exp from config.cfg import exp
from config.cluster import cluster from config.cluster import cluster
import run_obs_diag as rod import dartwrf.run_obs_diag as rod
def listdir_dirs(path): def listdir_dirs(path):
return [a for a in os.listdir(path) if os.path.isdir(os.path.join(path, a))] return [a for a in os.listdir(path) if os.path.isdir(os.path.join(path, a))]
......
...@@ -18,13 +18,16 @@ from dartwrf.utils import sed_inplace, copy, symlink, mkdir ...@@ -18,13 +18,16 @@ from dartwrf.utils import sed_inplace, copy, symlink, mkdir
def run(iens, begin, end, hist_interval=5, radt=5, archive=True, def run(iens, begin, end, hist_interval=5, radt=5, archive=True,
restart=False, restart_interval=720): restart=False, restart_interval=720):
"""Create namelist.input files """Create a namelist.input file for each ensemble member
Args: Args:
archive (bool): if True, write to archivedir of experiment archive (bool): if True, write to archivedir of experiment
if False, write to WRF run directory if False, write to WRF run directory
restart (str): fortran bool whether to use wrfinput or wrfrst restart (str): fortran bool whether to use wrfinput or wrfrst
restart_interval (int): output frequency of wrfrst (minutes) restart_interval (int): output frequency of wrfrst (minutes)
Returns
None
""" """
rundir = cluster.wrf_rundir(iens) rundir = cluster.wrf_rundir(iens)
copy(cluster.namelist, rundir+'/namelist.input') copy(cluster.namelist, rundir+'/namelist.input')
...@@ -73,6 +76,7 @@ def run(iens, begin, end, hist_interval=5, radt=5, archive=True, ...@@ -73,6 +76,7 @@ def run(iens, begin, end, hist_interval=5, radt=5, archive=True,
if __name__ == '__main__': if __name__ == '__main__':
args = docopt(__doc__) args = docopt(__doc__)
begin = dt.datetime.strptime(args['<begin>'], '%Y-%m-%d_%H:%M') begin = dt.datetime.strptime(args['<begin>'], '%Y-%m-%d_%H:%M')
end = dt.datetime.strptime(args['<end>'], '%Y-%m-%d_%H:%M') end = dt.datetime.strptime(args['<end>'], '%Y-%m-%d_%H:%M')
......
"""Prepare WRF run directories, to use wrf.exe then
Args:
init_time (str): YYYY-MM-DD_HH:MM
Returns:
None
"""
import os, sys, shutil import os, sys, shutil
import datetime as dt import datetime as dt
from config.cfg import exp from config.cfg import exp
from config.cluster import cluster from config.cluster import cluster
from dartwrf.utils import symlink, copy, link_contents from dartwrf.utils import symlink, copy, link_contents
import prepare_namelist from dartwrf import prepare_namelist
if __name__ == '__main__': if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment