Skip to content
Snippets Groups Projects
Commit 80c33d59 authored by lkugler's avatar lkugler
Browse files

.

parent 1ce11e11
Branches
Tags
No related merge requests found
...@@ -206,7 +206,7 @@ id = None ...@@ -206,7 +206,7 @@ id = None
id = prepare_wrfinput() # create initial conditions id = prepare_wrfinput() # create initial conditions
begin = dt.datetime(2008, 7, 30, 6, 0) begin = dt.datetime(2008, 7, 30, 6, 0)
end = dt.datetime(2008, 7, 30, 20, 0) end = dt.datetime(2008, 7, 30, 21, 0)
# whole forecast timespan # whole forecast timespan
hist_interval = 5 hist_interval = 5
......
...@@ -18,7 +18,8 @@ for iens in range(1, exp.n_ens+1): ...@@ -18,7 +18,8 @@ for iens in range(1, exp.n_ens+1):
# time not important, but general settings # time not important, but general settings
prepare_namelist.run(iens, begin=dt.datetime(2008, 7, 30, 6, 0), prepare_namelist.run(iens, begin=dt.datetime(2008, 7, 30, 6, 0),
end=dt.datetime(2008, 7, 30, 6, 30)) end=dt.datetime(2008, 7, 30, 6, 30),
archive=False)
symlink(input_prof, rundir+'/input_sounding') symlink(input_prof, rundir+'/input_sounding')
print('finished.') print('finished.')
...@@ -36,11 +36,16 @@ def clean_wrfdir(dir): ...@@ -36,11 +36,16 @@ def clean_wrfdir(dir):
os.remove(f) os.remove(f)
def symlink(src, dst): def symlink(src, dst):
# Create a symbolic link pointing to src named dst.
try: try:
os.symlink(src, dst) os.symlink(src, dst)
except FileExistsError: except FileExistsError:
os.remove(dst) # print('file exists')
os.symlink(src, dst) if os.path.realpath(dst) == src:
pass # print('link is correct')
else:
os.remove(dst)
os.symlink(src, dst)
except Exception as e: except Exception as e:
raise e raise e
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment