Skip to content

Using interp_restarts.x and interp_restarts_bin.x

Ben Auer edited this page Jun 10, 2022 · 20 revisions

Overview

The FV3 GridComp repository contains two executables that are used to regrid GEOS restarts on the cubed-sphere to a different cubed-sphere resolution. The first, interp_restarts.x regrids GEOS NetCDF restarts, and the second, interp_restarts_bin.x regrids GEOS binary restarts. In addition in one, interp_restart_bin.x also supports regridding restarts on a lat-lon grid to the cubed-sphere. The are usually invoked as part of a larger driving script but can be run outside these scripts following the directions below.

These are specialized tools that's sole purpose is to regrid GEOS restarts. They are not meant to be a general purpose tool nor should any attempt be made to use them as such. They must must be used with a minimum set of restarts, namely an fvcore_interanal_rst and a moist_internal_rst which are treated specially. As an example the winds are regridded as vectors. In addition because the binary restarts have no metadata there are additional restrictions, for example, any additional restarts supplied must only contain 3D variables and they must all be on center locations.

The horizontal regridding is now done with ESMF regridding and a bilinear interpolation scheme.

Both of these can regrid both horizontally as well as to a different number of atmospheric levels where these are defined by m_set_eta in GMAO_Shared. In addition they require the topography of the input and output grids. This is necessary as even if the number of levels does not change, they are still vertically remapped to take into account topography changes. 3D variables that are on the pressure level centers are remapped with the mappm routines of fv3. Note that interpolation of variables on edge pressures is handled specially outside of this and really should not be done at all other than for special cases. The only reason this was even allowed is because of the agcm_import restart which as pressure tendencies. The regridding done for the pressure_tendanices really only makes sense for that particular variable and really should not be done for anything else.

Finally the code can apply an optional dry mass correction

Using interp_restarts.x

The programs uses a combination of assumed file names and command line options. The input resolution is detected from the input fvcore restart file. The program assumes the following files are in the directory you are executing this from or linked there:

  • fvcore_internal_restart fvcore internal restart file in netcdf format
  • moist_internal_restart moist internal restart file in netcdf format
  • topo_dynave.data binary file containing the topography for the output resolution
  • topo_DYN_ave_imxim.data binary file containing the topography for the input resolution where im is the input cubed-sphere resolution

Both the input and output binary topography files have units of meters and the binary data follows the stacked convention where the 6 faces were flattened to a single im x (6 x im) array that was written to file.

Here are the command line options, note that only -im and -lm are required, the others have defaults:

  • -im integer output cubed-sphere size where this is the number of cells along the face
  • -lm integer output number of vertical levels
  • -do_hydro integer, if 0, make_nh = .true. else if 1 make_nh = .false.
  • -input_files space separated list of extra restarts beyond moist and fvcore in netcdf format
  • -output_files space separated list the names of the output files for each extra restart specified on the input file list
  • -nreader number of readers MPI processes to use, this code uses the same IO layer as MAPL to read the restarts, defaults to 1
  • -nwriters number of writer MPI processes to use, defaults to 1
  • -scalers if "T", this applies the dry mass scaling else if "F" does not do this
  • -stretched_grid 3 real numbers, if the out is a stretched grid, supply the stretch parameters as target_lon target_lat stretch_factor

Using interp_restarts_bin.x

The instructions for this are the same as above. The only difference is that all the input restarts must be binary and other than the fvcore_internal_rst must only contain 3D variables on the center horizontal location, no variables on pressure edges and 2D variables!

Clone this wiki locally