Regridding with ESMF and the stand alone utility
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.
Output files should end in .nc4, if not seems to break the cube-sphere output
This is now built with the model. A standard build from GitHub of the model will produce the Regrid_Util.x. You should see it in your install/bin directory.
the run command is
RUNCMD -np 6 Regrid_Util.x command_line_options
RUNCMD depends on the MPI stack used. If it is Intel MPI
RUNCMD = mpirun
If it is MPT in an interactive job
RUNCMD = mpiexec_mpt.nccs
If it is MPT in a batch job
RUNCMD = mpiexec_mpt
Or just use the "esma_mpirun" script that is in the install/bin directory. That should pick the right mpirun command. If you want to know what MPI stack you built with, source g5_modules, do a module list and identify the MPI module.
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