Regridding with ESMF and the stand alone utility

Revision as of 08:03, 2 February 2018 by Bmauer (talk | contribs)

I have created a simple utility that can regrid from Lat-Lon to Cubed-Sphere and vise versa using the ESMF integrated regridding. The utility supports both bilinear, conservative, and 2nd order conservative regridding. It should be able to read any Lat-Lon or Cubed-Sphere file produced by GEOS-5 and regrid to another Lat-Lon or Cubed-Sphere grid and requires no tile files to do the conservative regridding for example and should scale well to handle very large grids.

Because this uses some new develops that are not in the CVS repository for the time being I will keep a git repository with the executable you can run or clone your self. Building it is straightforward.

My executable will be located here:

/discover/swdev/bmauer/packages/Regridding/stable/GEOSagcm/build_dir/bin/Regrid_Util.x

To build it yourself on discover, make a directory for the source, so there, then:

module load other/git
git clone /discover/swdev/bmauer/packages/Regridding/stable/GEOSagcm

A GEOSagcm directory will appear in the location you did the clone

cd GEOSagcm
source src/g5_modules
mkdir build_dir
cmake ../src -DBASEDIR=$BASEDIR/Linux -DCMAKE_BUILD_TYPE=Release
make -j3 Regrid_Util.x

now in the build_dir under GMAO_Shared/MAPL_Base you will have a Regrid_Util.x you can run, copy, etc ...

To run: This program does require at least 6 cores (and uses that by default), so you will need to get an interactive job or run via a batch job but that is the price for a generic program that can regrid to a 1.5 km cube-sphere grid if you want without any external tile files.

the run command is

mpirun -np 6 Regrid_Util.x command_line_options

In your interactive job or in your batch script you must source the g5_modules you (or I if using my executable) built is with before running.

The program uses command line options:

-i input_file
-o output_file
-ogrid output_grid_name (for cubed-sphere name is PE360x2160-CF for c360 grid for example, LL example PC360x181-DC is a 360x181 dateline center pole center grid, if you want a pole edge, dateline edge grid do PE360x181-DE for example)
The rest are optional
The nx and ny you need to change for larger grids, then next step up would be nx=2,ny=12, then nx=4,ny=24, then, nx=6,ny=216, the number of proccessors for the mpirun command must be nx*ny
-nx nx (default is 1)
-ny ny (default is 6)
-vars var1,var2 (comma separated list of variables to regrid from file if you do not want them all)
-t date time (date and time to select from file if you don't want them all for exmaple 20000415 210000)
-method regrid_method ("bilinear", "conservative", "conservative2" are the choices, bilinear is the default, and conservative 2 is 2nd order conservative
-cubeFormat cube_format (options are "old" or "new", the default is new, this is whether you want the new or old cube-sphere file format