Regridding Restarts for Fortuna 2.4: Difference between revisions

 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
Here are basic instructions on how to regrid restart (initial condition) files, based on a README by Larry Takacs.
Here are basic instructions on how to regrid restart (initial condition) files, based on a README by Larry Takacs.


== Using restarts from earlier versions of Fortuna ==
'''Back to [[GEOS-5 Documentation for Fortuna 2.4]]'''
 
== 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 restarts from scratch ==
== 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 14: Line 16:
  /archive/g_proj5/production/GEOSdas-2_1_4/d5_merra_jan98/rs/
  /archive/g_proj5/production/GEOSdas-2_1_4/d5_merra_jan98/rs/


Restarts are in subdirectories according to their respective year and month.  The are in the form (as an example) <code>d5_merra_jan79.catch_internal_rst.19910128_21z.bin</code>, which you would otherwise know as <code>catch_internal_rst</code> (with the appropriate <code>cap_restart</code>).  Be aware that a <code>cp</code> from  <code>/archive</code> may appear to hang initially -- sometimes for hours -- while the appropriate tape is queued for mounting.  Alternatively, run <code>dmget</code> on the files before copying them: this will retrieve the files and have them accessible once the command returns.
Restarts are in subdirectories according to their respective year and month.  The are in the form (as an example) <code>d5_merra_jan79.catch_internal_rst.19910128_21z.bin</code>, which you would otherwise know as <code>catch_internal_rst</code> (with the appropriate <code>cap_restart</code>).  Be aware that a <code>cp</code> from  <code>/archive</code> may appear to hang initially -- sometimes for hours -- while the appropriate tape is queued for mounting.  Alternatively, run <code>dmget</code> on the files before copying them: this will retrieve the files and have them ready for copying once the command returns.


== Required Restarts ==
== Required Restarts ==
Line 37: Line 39:
*<code>gocart_internal_rst</code>
*<code>gocart_internal_rst</code>
*<code>solar_internal_rst</code>
*<code>solar_internal_rst</code>
*<code>irrad_internal_rst</code>
*<code>turb_internal_rst</code>
*<code>turb_internal_rst</code>
*<code>saltwater_import_rst</code>
*<code>saltwater_import_rst</code>
Line 46: Line 47:
For DAS runs, you may also interpolate:
For DAS runs, you may also interpolate:
*<code>agcm_import_rst</code>
*<code>agcm_import_rst</code>
The restart <code>irrad_internal_rst</code> should ''not'' be regridded for Fortuna 2.4, as it must be bootstrapped.


Note: if the grid dimensions are the same SOME restarts from earlier model versions may be used , while other may not.
Note: if the grid dimensions are the same SOME restarts from earlier model versions may be used , while other may not.
Line 58: Line 61:
   src/GMAO_Shared/GEOS_Util/post
   src/GMAO_Shared/GEOS_Util/post


Running <code>make rs_hinterp.x</code> using the same environment for building the model (that is, after running <code>source g5_modules</code>) should produce the executable:
Set up the build environment by running <code>source g5_modules</code> and setting the evironment variable <code>ESMADIR</code> to the directory path above the <code>src</code> directory.  Then run <code>make rs_hinterp.x</code> to produce the executable:


  rs_hinterp.x
  rs_hinterp.x
Line 92: Line 95:


<pre>
<pre>
rs_hinterp_$ARCH.x -dyn     fvcore_internal_rst
> rs_hinterp.x -dyn fvcore_internal_rst -moist moist_internal_rst -other pchem_internal_rst  gocart_internal_rst -topo_old TOPO_OLD  
                    -moist   moist_internal_rst
-topo_new TOPO_NEW -im 288 -jm 181
                    -other   pchem_internal_rst  gocart_internal_rst
                    -topo_old TOPO_OLD
                    -topo_new TOPO_NEW
                    -im       288
                    -jm       181
 
</pre>
</pre>


Line 110: Line 107:
  /discover/nobackup/ltakacs/bcs/Fortuna-2_1/288x181/topo_DYN_ave_288x181_DC.data
  /discover/nobackup/ltakacs/bcs/Fortuna-2_1/288x181/topo_DYN_ave_288x181_DC.data


Topography files for different Fortuna versions can be found under <code>/discover/nobackup/ltakacs/bcs/</code>.  Fortuna 2.1 topography files are used regridding restarts for Fortuna 2.2, and Fortuna 1.4 540x361 topography files are used for regridding <i>from</i> MERRA.  
Topography files for different Fortuna versions can be found under <code>/discover/nobackup/ltakacs/bcs/</code>.  For regridding <i>from</i> MERRA use Fortuna 1.4 540x361 topography files.  


Running the above will produce:
Running the above will produce:
Line 141: Line 138:


The basic idea is:
The basic idea is:
#Put your existing land-related restarts in the <code>InData</code> directory
#Put your existing land-related restarts (catch_internal_rst, vegdyn_internal_rst, landice_internal_rst, lake_internal_rst, and saltwater_internal_rst)  in the <code>InData</code> directory
#Put the appropriate tile file for your current resolution in the <code>InData</code> directory
#Put the appropriate tile file for your current resolution in the <code>InData</code> directory
#Put your target resolution tile file and appropriate <code>clsm</code> directory in the <code>OutData</code> directory
#Put your target resolution tile file and appropriate <code>clsm</code> directory in the <code>OutData</code> directory


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 174: Line 171:
  /discover/nobackup/ltakacs/bcs/Fortuna-2_1/1152x721/FV_1152x721_DC_360x180_DE.til
  /discover/nobackup/ltakacs/bcs/Fortuna-2_1/1152x721/FV_1152x721_DC_360x180_DE.til


(These work for Fortuna 2.2 as well, and are identical to those in  <code>/discover/nobackup/ltakacs/bcs/Fortuna-2_1</code>
(These work for Fortuna 2.4 as well.)


Depending on which tile file you are regridding to, there are two procedures:
Depending on which tile file you are regridding to, there are two procedures:
Line 205: 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 ==


The above procedure produces all the necessary restart files for the model to run, but others are needed for proper function.  The model can produce them starting from the minimal set created by the regridding procedure; this requires some modification of the <code>AGCM.rc</code> file in your experiment home directory (probably under your account home directory).   
The above procedure produces all the necessary restart files for the model to run, but others are needed for proper function.  The model can produce them starting from the minimal set created by the regridding procedure; this requires some modification of the <code>AGCM.rc</code> file in your experiment home directory.   


In <code>AGCM.rc</code> -- you probably want to keep a copy of the default version for normal runs -- and using <code>turb_import_rst</code> as an example, comment out the lines referring to <code>RESTART</code>:
In <code>AGCM.rc</code>, using <code>turb_import_rst</code> as an example, add a "-" to the beginning of the filename of the restarts to be bootstrapped:


  TURBULENCE_IMPORT_RESTART_FILE:        turb_import_rst
  TURBULENCE_IMPORT_RESTART_FILE:        turb_import_rst
Line 217: Line 242:
  TURBULENCE_IMPORT_CHECKPOINT_TYPE:      binary
  TURBULENCE_IMPORT_CHECKPOINT_TYPE:      binary


  #TURBULENCE_IMPORT_RESTART_FILE:        turb_import_rst
  TURBULENCE_IMPORT_RESTART_FILE:        -turb_import_rst
  #TURBULENCE_IMPORT_RESTART_TYPE:        binary
  TURBULENCE_IMPORT_RESTART_TYPE:        binary
  TURBULENCE_IMPORT_CHECKPOINT_FILE:      turb_import_checkpoint
  TURBULENCE_IMPORT_CHECKPOINT_FILE:      turb_import_checkpoint
  TURBULENCE_IMPORT_CHECKPOINT_TYPE:      binary
  TURBULENCE_IMPORT_CHECKPOINT_TYPE:      binary


Running the model for a model day using this modified <code>AGCM.rc</code> will produce a full set of restart files, which can be used with the default model configuration.
This will have the effect that when the model starts, it will look for that restart file and use it if it finds it, and will otherwise bootstrap the restart file.  Running the model for a model day using this modified <code>AGCM.rc</code> will produce a full set of restart files, which can be used with the default model configuration.
 
'''Back to [[GEOS-5 Documentation for Fortuna 2.4]]'''