How to Regrid / Remap Data
A page describing what we want in regridders for ACME is at: /wiki/spaces/ATM/pages/20809870. Based on analysis described on /wiki/spaces/ATM/pages/25231711, NCO and UV-CDAT regridders both satisfy these requirements and are suitable for use. The purpose of this page is to describe how to use these regridders. Regridding occurs in 3 steps: first, files containing the grid for the original and target grids are acquired. Second, these grids are used to create a mapping file is obtained which contains the matrix which, when multiplied by an array of input data for some variable, yields the regridded array for that variable.Third, the "acme regridders" create output on the target grid by combining native-grid data and mapping files. These steps are explained in more detail below.
Getting GRID FILES in SCRIP format (if mapping files for your input and target grids already exist, you can ignore this section)
Grid files for the resolutions ACME runs and for the target resolutions we think are appropriate are available at: https://acme-svn2.ornl.gov/acme-repo/acme/mapping/grids/ If you need a login for the ACME inputdata repo, check these instructions: ACME Input Data Repository. Here are the grids we currently support:
ne30np4_091226_pentagons.nc (1 degree CAM-SE grid)
ne120np4_pentagons_100310.nc (1/4 degree CAM-SE grid)
- 129x256_SCRIP.20150901.nc Similar to T85, but equally spaced (1.4 degrees) points in both latitude/longitude, including points at both poles.
- 257x512_SCRIP.20150901.nc Equi-angle lat/lon grid (.70 degrees)
- 801x1600_SCRIP.20150901.nc Equi-angle lat/lon grid (0.225 degrees)
NOTE: Many gridfiles were updated on 20150901 for reasons explained at Why and how to migrate to updated grids and mapfiles
Getting MAPPING FILES:
Mapping files for the above grids are available from the ACME inputdata server https://acme-svn2.ornl.gov/acme-repo/acme/mapping/maps/. If you can't find these files on the machine you want to use for regridding, cd to the place you want to store the mapping files and type: "svn export https://acme-svn2.ornl.gov/acme-repo/acme/mapping/maps/<mapfilename>". You will be asked for the password on the machine you're using. If this isn't the same name as used for your xcams account, just hit enter and it will prompt for your username and xcams password. If you need an xcams account, check these instructions: ACME Input Data Repository. Here are the maps we currently support:
- map_ne30np4_to_fv129x256_aave.20150901.nc area averaged (ESMF algorithm) for downsampling
- map_ne30np4_to_fv257x512_bilin.20150901.nc bilinear to a finer grid, to preserve all scales
- map_ne120np4_to_fv257x512_aave.20150901.nc area averaged (ESMF algorithm) for downsampling
- map_ne120np4_to_fv801x1600_bilin.20150901.nc bilinear to a finer grid, to preserve all scales
If you need to make your own mapping file, see /wiki/spaces/WORKFLOW/pages/25789319
NOTE: All mapfiles were updated on 20150901 for reasons explained at Why and how to migrate to updated grids and mapfiles
See Known locations of inputdata directory for clues to the possible locations of the mapping files on your machine. In a hurry? Many of the most commonly needed ACME mapping files are in the directory ~zender/data/maps at the major DOE compute centers.
Regridding using UV-CDAT:
see:/wiki/spaces/WORKFLOW/pages/12419798
Note that the 'latest' version of UV-CDAT on Rhea is recent enough to include needed bugfixes, but other machines probably aren't. Contact the workflow group to clarify whether the version of UV-CDAT is appropriate on the machine you want to use.
Regridding using NCO:
The NCO climo generation script ncclimo will automatically regrid climo files (use the -r switch to specify the desired mapfile). See Generate, Regrid, and Split Climatologies (climo files) with ncclimo for instructions and examples. To regrid other (e.g., non-climo) files, see NCO ncremap instructions. ncremap automates gridfile and mapfile generation (you must have data files on the source and destination grids). Up-to-date versions of NCO are available on Aims4, Cooley, Cori, Edison, Pileus, Rhea, and Yellowstone, usually in ~zender/[bin,lib]. Follow these instructions to build or install NCO on your own.
Regridding using NCL:
Regridding using NCL refers to using a NCL script extracted from the AMWG diagnostics package and further tweaked into a general regridder by Mark Taylor. This ACME NCL-script is much slower than either of the above regridders and its metadata is worse, so we don't recommend its use. However, we did create a confluence page documenting how to use it so I'm including it here for posterity: /wiki/spaces/WORKFLOW/pages/16253082... But in general, don't use this code!