Commit f1831e4c authored by SemjonSchimanke's avatar SemjonSchimanke
Browse files

Bugfix radiation.

parent 93005601
......@@ -170,12 +170,7 @@ def radiation(yearStart, monthStart, yearEnd, monthEnd, workdir, downdir, finald
input=" -setgridtype,curvilinear -selname,ssrd,strd "+infile2,
output=outfile2, options = '-f nc')
# Make sure it is really only one year.
yearfile=workdir+"UERRA_exact_one_year_%04d.nc" % (year)
cdo.selyear(year, input=outfile2, output=yearfile, options = '-O')
cdo.splithour(input=yearfile, output=workdir+"hour_")
cdo.splithour(input=outfile2, output=workdir+"hour_")
cdo.sub(input=workdir+"hour_02.nc"+" "+workdir+"hour_01.nc", output=workdir+"hourly_02.nc")
cdo.sub(input=workdir+"hour_03.nc"+" "+workdir+"hour_02.nc", output=workdir+"hourly_03.nc")
......@@ -215,10 +210,15 @@ def radiation(yearStart, monthStart, yearEnd, monthEnd, workdir, downdir, finald
infile=workdir+"hourly_%04d??.nc" % (year)
allrad=cdo.mergetime(input=infile)
# Make sure it is really only one year.
yearfile=workdir+"UERRA_exact_one_year_%04d.nc" % (year)
cdo.selyear(year, input=allrad, output=yearfile, options = '-O')
solfile =workdir+"solrad_y"+str(year)+".nc"
lonfile =workdir+"lwdrad_y"+str(year)+".nc"
cdo.setname("SOLRAD", input=" -divc,3600 -selname,ssrd "+allrad, output=solfile)
cdo.setname("LWRAD_DN", input=" -divc,3600 -selname,strd "+allrad, output=lonfile)
cdo.setname("SOLRAD", input=" -divc,3600 -selname,ssrd "+yearfile, output=solfile)
cdo.setname("LWRAD_DN", input=" -divc,3600 -selname,strd "+yearfile, output=lonfile)
shutil.copy(solfile, finaldir+"Radiation/")
shutil.copy(lonfile, finaldir+"Radiation/")
......
......@@ -112,7 +112,7 @@ sys.stdout.flush()
# Use the bash script with NCO commands to remove the height dimension
script=os.getcwd()+"/remove_height.sh"
print "If you want to remove the height dimension you can use the bash-script remove_height.sh."
print "You can call it is follows..."
print "You can call it as follows..."
print "sbatch ", script, finaldir, str(YYYY1), str(YYYY2)
#subprocess.check_call(["sbatch ", script, finaldir, str(YYYY1), str(YYYY2)])
......@@ -15,3 +15,7 @@ Modify the time, parameters, levels etc. to match your specific needs.
The folder ["mars_retrieve_total"](mars_retrieve_total/) contains python scripts for retrieving all datasets from the Copernicus Climate Change Service regional reanalysis for Europe reanalysis via the ECMWF MARS system.<br />
The scripts are provided as a complete base showing all available data. Please note that this means a lot of data. Modify the time, parameters, levels etc. to match your specific needs.
## Create forcing data for NEMO-Nordic
Here, you can find a script system, which can be used to prepare forcing data for NEMO-Nordic (a regional ocean model). The scripts retrieve hourly data from MARS and mix analyses and forecasts. Then, the data is post-processed for the usage with NEMO-Nordic. For instance, relative humidity is transferred to specific humidity. At the end, the data is stored in netcdf-format as needed by NEMO.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment