Regridding Restarts for Jason 2.2

Here are basic instructions on how to create restart files for Jason 2.2. Due to changes in the tiling it is not possible to use restarts from older versions of GEOS-5 without converting them with the regrid.pl script.

Back to GEOS-5 Documentation for Jason 2.2

Using the regrid.pl Script

Restarts can be easily created from MERRA2 data or other model-generated sources using the regrid.pl script in Linux/bin/ (above src/) -- this script is different from, and is specifically a wrapper for, the regrid script used in earlier versions. The regrid.pl script is created when make install is run. The same script can regrid restarts between different versions of Fortuna 1.4 to Jason 2.2 at any resolution.

Running regrid.pl -h (after running source g5_modules) -- with the -h for help -- tells the story:

NAME
    regrid.pl

PURPOSE
    Wrapper script for programs which regrid GCM restarts

SYNOPSIS

    regrid.pl yyyymmdd hr gridID outdir [options]

REQUIRED INPUTS
   -----------------------------
   as ordered runtime parameters
   -----------------------------
   yyyymmdd          8-digit date of the restarts being regridded
   hr                2-digit hour of the restarts being regridded
   grOUT             grid ID of the output restarts (see GRID IDENTIFIERS below)
   outdir            directory location for output restarts

   --------------------
   or as flagged values
   --------------------
   -ymd      yyyymmdd
   -hr       hr
   -grout    grOUT
   -outdir   outdir

REQUIRED OPTION FOR MERRA INPUTS
   -merra             (same as -merra1)
   -merra1            get input restarts from OPS MERRA-1 data archives
   -merra2            get input restarts from OPS MERRA-2 data archives

REQUIRED OPTIONS FOR NON-MERRA INPUTS
   -d        rstdir   location of input restart files
   -expid    expid    experiment ID of input restart files

INTERACTIVE OPTION
   -i                 prompt for inputs that are not supplied
                      (this is the default if no inputs are supplied)
   -np                no prompt; take defaults for all prompts;
                      note: the -np flag takes precedence over the -i flag

OTHER OPTIONS
   -levsout  levsout  number of atmosphere levels in output
   -oceanin  oceanIN  ocean horizontal grid of inputs
                      =c : 1-deg (360x180); e.g. Reynolds
                      =e : 1/4-deg (1440x720); e.g. MERRA-2
                      =f : 1/8-deg (2880x1440); e.g. OSTIA
                      defaults to 'c'
   -oceanout oceanOUT ocean horizontal grid of outputs (see -oceanIN)
   -esmabin  ESMABIN  location of build's scripts and programs; defaults to location
                      of regrid.pl script
   -iceDT     dtime   datetime for alternate landice rst input if regridding to
                      'Ganymed-2_0' from earlier tag; dtime should have the
                      following format: -iceDT yyyymmdd_hh
                      if dtime is not provided or if no restarts can be found to
                      match dtime, then script will prompt user from list of
                      available datetimes.
                      if dtime eq '0', then alternate landice rst will not be used
   -newid    newid    label to replace expid in output restart names;
                      defaults to 'n-expid' where n is OUTPUT atmosphere grid ID
   -tagin    tagIN    GCM or DAS tag associated with inputs (see TAGS below);
                      defaults to Ganymed-4_0
   -tagout   tagOUT   GCM or DAS tag associated with outputs (see TAGS below);
                      defaults to Ganymed-4_0
   -rs       flag     flag indicating which restarts to regrid
                      =1 for upper-air restarts only
                      =2 for land-surface restarts only
                      =3 for both upper-air and land-surface restarts (default)
   -catchcn           Create a version of the catch restart which contains carbon values;
                      Not valid for tags prior to Heracles; Note: This option will add
                      10-20 minutes to the regrid process.
   -route             write the route_internal_rst

   -[no]bkg           copy and rename input bkg + satbang/bias files
   -[no]lbl           label final restarts with 'tagID.gridID' extension
   -[no]lcv           create rst.lcv file for final restarts
   -gcm               gcm mode; equivalent to -nobkg, -lbl, and -nolcv flags

   -grpid             group id; sponsor code to use for batch job charge
   -qos debug         use SBATCH --qos=debug directive for batch jobs,
                      if job meets --qos=debug requirements
   -db                (debug mode) Do not clean work directory after running programs;
   -dbh               (debug hash) Show contents of hashes: %IN and %OUT
   -v                 verbose mode
   -h[elp]            print usage message

GRID IDENTIFIERS

   Atmosphere Horizontal Grids
   ===========================
   latlon grids         im        jm
   ------------         --        --
   a = 4x5              72        46
   b = 2x2.5           144        91
   c = 1x1.25          288       181
   D = 0.5x0.666       540       361
   d = 0.5x0.625       572       361
   E = 0.25x0.3330    1080       721
   e = 0.25x0.3125    1152       721

   cubed-sphere grids
   ------------------
   Cn, where n = {24, 48, 90, 180, 360, 500, 720, 1000, 1440, 2000, 2880}

   Ocean Horizontal Grids
   ======================
   c = 1-deg   (360x180);   e.g. Reynolds
   e = 1/4-deg (1440x720) ; e.g. MERRA-2
   f = 1/8-deg (2880x1440); e.g. OSTIA

TAGS
   Use GCM or DAS tag names with -tagin and -tagout flags

      Sample GCM tags
      ---------------
      F14  : Fortuna-1_4  ............  Fortuna-1_4_p1
      F21  : Fortuna-2_1  ............  Fortuna-2_5_pp2
      G10  : Ganymed-1_0  ............  Ganymed-1_0_BETA4
      G10p : Ganymed-1_0_p1  .........  Ganymed-1_0_p6
      G20  : Ganymed-2_0  ............  Ganymed-2_1_p6
      G30  : Ganymed-3_0  ............  Ganymed-3_0_p1
      G40  : Ganymed-4_0  ............  Heracles-5_4_p3
      HNL  : Heracles-NL  ............  Heracles-NL

      Sample DAS tags
      ---------------
      214  : GEOSdas-2_1_4  ..........  GEOSdas-2_1_4-m4
      540  : GEOSadas-5_4_0  .........  GEOSadas-5_5_3
      561  : GEOSadas-5_6_1  .........  GEOSadas-5_7_3_p2
      580  : GEOSadas-5_8_0  .........  GEOSadas-5_9_1
      591p : GEOSadas-5_9_1_p1  ......  GEOSadas-5_9_1_p9
      5A0  : GEOSadas-5_10_0  ........  GEOSadas-5_10_0_p1
      5B0  : GEOSadas-5_10_0_p2  .....  GEOSadas-5_11_0
      512  : GEOSadas-5_12_2  ........  GEOSadas-5_16_5


So the following will create restarts in C180 (roughly equivalent to ½-degree lat-lon) resolution, on the ¼-degree ocean from MERRA2 on the first day of 2012 and put them in /discover/nobackup/mathomp4/Regrid:

./regrid.pl -ymd 20120101 -hr 21 -grout C180 -outdir /discover/nobackup/mathomp4/Regrid -merra -tagout Icarus -oceanout e

The above presents the minimum options to get a working set of restarts -- anything lacking will be requested interactively. Your selections will be presented for your review before the script does any heavy lifting. The script may appear to stall while it waits for the relevant MERRA or MERRA-2 files to be retrieved from the /archive filesystem.

For sources other than MERRA/MERRA-2, you will have to specify the location of a regrid resource file that contains the model version, resolution and location of the source restarts, and the resolution of the output restarts. A sample regrid resource file is regrid.rc in the same directory as the regrid script. Note that regrid only works for creating restarts for its model tag, and does not work at all for making restarts for tags before Jason 2.2. Restarts for earlier model tags have to be created "manually".

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:

#!/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)

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 cp *rst


Required Restarts

A few of the restart files are critical and need to be present for the model to function, while others can be "bootstrapped": the model is started without them and then it generates the restarts in order to save state for the next restart.

The following restart files are critical and need to be regridded:

  • fvcore_internal_rst (atmosphere)
  • moist_internal_rst (atmosphere)
  • catch_internal_rst (surface)

The following surface restarts should be regridded, but can be bootstrapped:

  • vegdyn_internal_rst
  • landice_internal_rst
  • lake_internal_rst
  • saltwater_internal_rst

Optional (boot-strappable) restarts:

  • pchem_internal_rst
  • gocart_internal_rst
  • turb_internal_rst
  • saltwater_import_rst
  • surf_import_rst
  • turb_import_rst
  • moist_import_rst

For DAS runs, you may also interpolate:

  • agcm_import_rst

The restarts irrad_internal_rst and solar_internal_rst should not be regridded from versions earlier than Fortuna 2.5, as they must be bootstrapped.

Note: if the grid dimensions are the same SOME restarts from earlier model versions may be used , while other may not.

  • fvcore_internal_rst and moist_internal_rst may be used directly from earlier versions.
  • catch_internal_rst, lake_internal_rst, landice_internal_rst, and saltwater_internal_rst must be re-gridded due to new land surface tile data
  • All other restarts from earlier versions should be boot-strapped.


Back to GEOS-5 Documentation for Jason 2.2