Regridding with ESMF and the stand alone utility

Revision as of 12:33, 15 February 2018 by Bmauer (talk | contribs)

I have created a simple utility that can regrid between cubed-sphere, latlon, and a tripolar grid using the ESMF integrated regridding. The utility supports both bilinear, conservative, higher order patch, and 2nd order conservative regridding. It should be able to read any Lat-Lon, tripolar, 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. For example I was able to regrid a 1 degree lat-lon file to a c3000 cube in about 25 seconds on 216 processors. Just to generate the tile file for the old regridding layer would take hours. Note that to use the tripolar grid you must supply the corresponding grid_spec file

Limitations:

Can not regrid vectors properly, i.e. the U and V components of the wind must be done as scalars.

Because this uses some new developments 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 and build yourself. 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, go 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 if you are going to or from a cubed-sphere grid(and uses that by default), so you will need to get an interactive job or run via a batch job.

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, tripolar grid PE720x410-TM 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=36, the number of processors 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", "patch" are the choices, bilinear is the default, and conservative2 is 2nd order conservative, patch is the higher order patch method from ESMF to get smoother gradients
-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 is you are regridding to a cubed-sphere grid)
-tp_in input grid spec file if input grid is tri-polar
-tp_out output grid spec file if output grid is tri-polar