Regridding Restarts for Fortuna 2.4: Difference between revisions
(3 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
'''Back to [[GEOS-5 Documentation for Fortuna 2.4]]''' | '''Back to [[GEOS-5 Documentation for Fortuna 2.4]]''' | ||
== Using | == Using Restarts from Earlier Versions of Fortuna == | ||
Restart files from Fortuna 2.3 may be used for Fortuna 2.4 with the exception of irrad_internal, which must be bootstrapped. See the section below for instructions. Restarts from versions earlier than Fortuna 2.3 must be regridded to use with Fortuna 2.4. | Restart files from Fortuna 2.3 may be used for Fortuna 2.4 with the exception of irrad_internal, which must be bootstrapped. See the section below for instructions. Restarts from versions earlier than Fortuna 2.3 must be regridded to use with Fortuna 2.4. | ||
== Creating | == Creating Restarts from Scratch == | ||
If you lack a set of restarts for the appropriate date, you can derive yours from MERRA. | If you lack a set of restarts for the appropriate date, you can derive yours from MERRA. | ||
Line 144: | Line 144: | ||
Consider soft linking files instead of copying, as they can be large. Where to find the appropriate tile file depends on the Fortuna versions you are regridding ''from'' and ''to'', and is detailed below. | Consider soft linking files instead of copying, as they can be large. Where to find the appropriate tile file depends on the Fortuna versions you are regridding ''from'' and ''to'', and is detailed below. | ||
Run <code>mk_Restarts</code>. This will create the executables (if needed; remember to source <code>g5_modules</code>) and run them. If the executables are run without the proper setup, they will crash and create a zero-length file in <code>OutData</code> with the name <code>*.til</code>; you will need to delete it before running again. | Run <code>mk_Restarts</code>. This will create the executables (if needed; remember to source <code>g5_modules</code>) and run them. If the executables are run without the proper setup, they will crash and create a zero-length file in <code>OutData</code> with the name <code>*.til</code> (with the asterisk in the filename); you will need to delete it before running again. | ||
Your regridded restarts will be produced in the <code>OutData</code> directory. | Your regridded restarts will be produced in the <code>OutData</code> directory. | ||
Line 202: | Line 202: | ||
Therefore you do not have link in the old <code>nirdf.dat</code>, <code>visdf.dat</code>, and | Therefore you do not have link in the old <code>nirdf.dat</code>, <code>visdf.dat</code>, and | ||
<code>lai_grn_clim</code> datasets. For Fortuna 2.2 you do have to copy or link the <code>clsm</code> directory in directory with the appropriately-dimensioned tile files. | <code>lai_grn_clim</code> datasets. For Fortuna 2.2 you do have to copy or link the <code>clsm</code> directory in directory with the appropriately-dimensioned tile files. | ||
== Renaming Restart Files == | |||
At this point you will have restart files with a fair bit of cruft in the filenames. As described above, they will have to be renamed for the model to recognize them. There are a number of scripts with different techniques for completing this tedious chore; here is one example: | |||
<pre> | |||
#!/usr/bin/env python | |||
import re | |||
import os | |||
# Open file for reading | |||
dirlist = os.listdir(".") | |||
for file in dirlist: | |||
if( re.search(".*rst.*",file) ): | |||
print file | |||
# the concept is to match ??????.something_rst.??????? OR something_rst.???????? | |||
# and extract "something_rst" | |||
newfile = re.sub(r'(^.+\.|^)([a-z_]+rst)\..+$',r'\2',file) | |||
print newfile | |||
if cmp(newfile,file): | |||
os.symlink(file,newfile) | |||
</pre> | |||
It will grab anything in the current working directory resembling the common forms of restart filename generated by the regridding scripts and other utilities and create symbolic links to them in the same directory with the superfluous parts of the filenames stripped. In an experiment directory the links will be overwritten by the model with "fresh" restart files at the end of a run segment. Alternatively, you can easily copy the restart files with <code>cp *rst</code> | |||
== Bootstrapping for a Complete Set of Restarts == | == Bootstrapping for a Complete Set of Restarts == |