Skip to content
Snippets Groups Projects
Commit 87b8695b authored by Lukas Kugler's avatar Lukas Kugler
Browse files

small fix

parent de26359e
Branches
Tags
No related merge requests found
...@@ -2,39 +2,45 @@ import os, sys, shutil, glob ...@@ -2,39 +2,45 @@ 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
folder_obs_seq_final = '/home/fs71386/lkugler/data/sim_archive/exp_v1.11_LMU_filter/obs_seq_final/' def run(folder_obs_seq_final):
files = sorted(glob.glob(folder_obs_seq_final+'/*.final')) # input for obs_diag program rundir_program = '/home/fs71386/lkugler/data/DART-WRF/rundir/'
rundir_program = '/home/fs71386/lkugler/data/DART-WRF/rundir/' files = sorted(glob.glob(folder_obs_seq_final+'/*.final')) # input for obs_diag program
fpath = rundir_program+'/obsdiag_inputlist.txt' fpath = rundir_program+'/obsdiag_inputlist.txt'
print('writing', fpath) print('writing', fpath)
if os.path.exists(fpath): if os.path.exists(fpath):
os.remove(fpath) os.remove(fpath)
with open(fpath, 'w') as f: with open(fpath, 'w') as f:
for fin in files: for fin in files:
f.write(fin) f.write(fin)
f.write('\n') f.write('\n')
print('ensure correct input.nml') print('ensure correct input.nml')
copy(cluster.scriptsdir+'/../templates/input.nml', copy(cluster.scriptsdir+'/../templates/input.nml',
rundir_program+'/input.nml') #cluster.dartrundir+'/input.nml') rundir_program+'/input.nml') #cluster.dartrundir+'/input.nml')
sed_inplace(rundir_program+'/input.nml', '<n_ens>', str(int(exp.n_ens))) sed_inplace(rundir_program+'/input.nml', '<n_ens>', str(int(exp.n_ens)))
append_file(rundir_program+'/input.nml', cluster.scriptsdir+'/../templates/obs_def_rttov.VIS.nml') append_file(rundir_program+'/input.nml', cluster.scriptsdir+'/../templates/obs_def_rttov.VIS.nml')
# run obs_diag # run obs_diag
print('running obs_diag program') print('running obs_diag program')
os.chdir(rundir_program) os.chdir(rundir_program)
symlink(cluster.dart_srcdir+'/obs_diag', rundir_program+'/obs_diag') symlink(cluster.dart_srcdir+'/obs_diag', rundir_program+'/obs_diag')
os.system('./obs_diag >& obs_diag.log') os.system('./obs_diag >& obs_diag.log')
print('moving output to', cluster.archivedir()+'/obs_diag_output.nc') outdir = '/'.join(folder_obs_seq_final.split('/')[:-1])
copy(rundir_program+'/obs_diag_output.nc', cluster.archivedir()+'/obs_diag_output.nc') print('moving output to', outdir+'/obs_diag_output.nc')
copy(rundir_program+'/obs_diag_output.nc', outdir+'/obs_diag_output.nc')
print('running obs_seq_to_netcdf program')
symlink(cluster.dart_srcdir+'/obs_seq_to_netcdf', rundir_program+'/obs_diag_output.nc') print('running obs_seq_to_netcdf program')
os.system('./obs_seq_to_netcdf >& obs_seq_to_netcdf.log') symlink(cluster.dart_srcdir+'/obs_seq_to_netcdf', rundir_program+'/obs_seq_to_netcdf')
print('moving output to', cluster.archivedir()+'/obs_seq_output.nc') os.system('./obs_seq_to_netcdf >& obs_seq_to_netcdf.log')
copy(rundir_program+'/obs_diag_output.nc', cluster.archivedir()+'/obs_seq_output.nc') print('moving output to', outdir+'/obs_seq_output.nc')
copy(rundir_program+'/obs_diag_output.nc', outdir+'/obs_seq_output.nc')
if __name__ == '__main__':
folder_obs_seq_final = '/home/fs71386/lkugler/data/sim_archive/exp_v1.11_LMU_filter_domainobs/obs_seq_final/'
run(folder_obs_seq_final)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment