-
Notifications
You must be signed in to change notification settings - Fork 13
Converting Cubed Sphere Data to Lat Lon inside NASA HPC ecosystem
The GEOSgcm model can output data directly on the Cubed-Sphere grid via the MAPL History component. Users have multiple options to convert this data to a lat-lon grid if they prefer to interact with the data in that manner. This will lay out all available options to users both on NASA HPC clusters.
As part of the build of the GEOSgcm fixture, the MAPL library is built which contains a utility to convert GEOS Cubed-Sphere data to Lat-Lon. This does require MPI so it must be run on a compute node at NCCS or NAS if you are at those centers. The directions for use can be found in the Regrid_Util.x User Guide.
The Cubed-Sphere output can also be regridded using python, ESMF and the NCO utilities.
If you are at NCCS or NAS a python with the proper modules installed and the needed utilities can be found in several ways. If you have built GEOS, then sourcing g5_modules
will be sufficient to load a python that will work and get the ESMF and NCO in your path. From there you can run the python utilities described below.
If you do have not have a checkout of GEOS or do not want to checkout GEOS, you can directly use Baselibs by checking out the GEOS_env
repository that is part of the GEOS-ESM repository. This will put you on the main branch and there should a g5_modules
file there you can source that will load the necessary modules at either NCCS or NAS.
For either of the two methods above you will need to run this on a compute node given the way Baselibs is built.
Once you have sourced a g5_modules and have the tools needed in your path, we have created some python utilities to convert a GEOS Cubed-Sphere file to a lat-lon gridded file. In brief these utilities automate the following steps:
- creating the scrip representation of the Cubed-Sphere grid from the input file
- converting the input file to the scrip format
- creating a descriptor file for the lat-lon grid
- running ESMF_RegridWeightGen to generate the regridding weights based on the previous two files
- using the weights to run ncremap to do the regridding with the converted input file
- running ncks to clean up unnecessary variables in the output.
- cleaning up temporary files
These Python utilities can be obtained here by cloning the following repository:
git clone https://github.com/GMAO-SI-Team/regridding-tools.git
Once you have cloned this you will find multiple Python utilities, but the one you should use is convert_tool.py
which given an input file will perform the required steps to obtain a lat-lon version of the file.
The tool has the following options:
-
-n
,--input_file
The input Cubed-Sphere file -
-o
,--output_file
The output lat-lon file name -
-i
,--im_world
The number of longitudinal points in the output lat-lon grid -
-j
,--jm_world
The number of latitudinal points in the output lat-lon grid -
-d
,--dateline
Either DC or DE, this controls whether the center or edge of the grid is on the dateline -
-p
,--pole
Either PC or PE, this controls either the center of the pole point is at the pole or half a delta below the pole -
-m
,--method
optional, defaultbilinear
, other options areconserve
,patch
,conserve2nd
,neareststod
, this is the regrid method used by ESMF_RegridWeightGen and information about them can be found in the ESMF documentation. -
--grid_dir
optional, specify a path where the cubed-sphere grid descriptor and weights will be generated and stored. If the files are already found will not recompute. Recommended to save time when regridding multiple files. If this argument is not present, the files will be created and then deleted in the current directory -
--num_tasks
optional, default 1, if on a platform that allows it (i.e. a compute node as NCCS or NAS) use more than 1 mpi task when generating the weights. -
-v
,--vars
optional, comma separated list of variables to regrid if you do not with to regrid all of the variables in the input file, no spaces in the list