Skip to content
Snippets Groups Projects
Commit 5e4af094 authored by lkugler's avatar lkugler
Browse files

small things

parent 80c33d59
No related branches found
No related tags found
No related merge requests found
import os, sys, glob import os, sys, glob
def listdir_dirs(path):
return [a for a in os.listdir(path) if os.path.isdir(os.path.join(path, a))]
#sys.path.append('')
from config.cfg import exp, cluster from config.cfg import exp, cluster
import run_obs_diag as rod import run_obs_diag as rod
#sys.path.append('/home/fs71386/lkugler/DART-WRF/scripts') def listdir_dirs(path):
#from obs import read_dartobs as rdo return [a for a in os.listdir(path) if os.path.isdir(os.path.join(path, a))]
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -17,7 +17,7 @@ def run(iens, begin, end, hist_interval=5, radt=5, archive=True): ...@@ -17,7 +17,7 @@ def run(iens, begin, end, hist_interval=5, radt=5, archive=True):
copy(cluster.namelist, rundir+'/namelist.input') copy(cluster.namelist, rundir+'/namelist.input')
sed_inplace(rundir+'/namelist.input', '<dx>', str(int(exp.model_dx))) sed_inplace(rundir+'/namelist.input', '<dx>', str(int(exp.model_dx)))
sed_inplace(rundir+'/namelist.input', '<timestep>', str(int(exp.timestep))) #sed_inplace(rundir+'/namelist.input', '<timestep>', str(int(exp.timestep)))
sed_inplace(rundir+'/namelist.input', '<hist_interval>', str(int(hist_interval))) sed_inplace(rundir+'/namelist.input', '<hist_interval>', str(int(hist_interval)))
sed_inplace(rundir+'/namelist.input', '<radt>', str(int(radt))) sed_inplace(rundir+'/namelist.input', '<radt>', str(int(radt)))
...@@ -40,13 +40,16 @@ def run(iens, begin, end, hist_interval=5, radt=5, archive=True): ...@@ -40,13 +40,16 @@ def run(iens, begin, end, hist_interval=5, radt=5, archive=True):
######################### #########################
if archive: if archive:
init_dir = cluster.archivedir()+begin.strftime('/%Y-%m-%d_%H:%M/')+str(iens)
os.makedirs(init_dir, exist_ok=True)
try: try:
print('copy wrfinput of this run to archive') print('copy wrfinput of this run to archive')
wrfin_old = rundir+'/wrfinput_d01' wrfin_old = rundir+'/wrfinput_d01'
init_dir = cluster.archivedir()+begin.strftime('/%Y-%m-%d_%H:%M/')+str(iens)
os.makedirs(init_dir, exist_ok=True)
wrfin_arch = init_dir+'/wrfinput_d01' wrfin_arch = init_dir+'/wrfinput_d01'
copy(wrfin_old, wrfin_arch) copy(wrfin_old, wrfin_arch)
print('copy namelist to archive')
copy(rundir+'/namelist.input', init_dir+'/namelist.input')
except Exception as e: except Exception as e:
warnings.warn(str(e)) warnings.warn(str(e))
......
import os, sys, shutil, glob import os, sys, shutil, glob
from config.cfg import exp, cluster from config.cfg import exp, cluster
from .utils import symlink, copy, sed_inplace, append_file from utils import symlink, copy, sed_inplace, append_file
rundir_program = '/home/fs71386/lkugler/data/DART-WRF/rundir/' rundir_program = '/home/fs71386/lkugler/data/DART-WRF/rundir/'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment