Creating mapping files that mksurfdata_map will use

shared/mkmapdata to create SCRIP mapping data file from SCRIP grid files (uses ESMF). The bash shell script models/lnd/clm/tools/shared/mkmapgrids/mkmapdata.sh uses ESMF_RegridWeightGen to create a list of maps from the raw datasets that are input to mksurfdata_map. Each dataset that has a different grid, or land-mask needs a different mapping file for it, but many different raw datasets share the same grid/land-mask as other files. Hence, there doesn't need to be a different mapping file for EACH raw dataset -- just for each DIFFERENT raw dataset. See Figure 2-3 for a visual representation of how this works. The bash script figures out which mapping files it needs to create and then runs ESMF_RegridWeightGen for each one. You can then either enter the datasets into the XML database (see Chapter 3 or leave the files in place, and use the "-res usrspec -usr_gname -usr_gdate" options to mksurfdata_map (see the Section called Running mksurfdata.pl below). Use the "-phys" option to specify if you are creating mapping files for clm4_0 or clm4_5 (the list of raw datafiles is somewhat different between the two). mkmapdata.sh has a help option with the following


../../tools/shared/mkmapdata/mkmapdata.sh

**********************
usage on yellowstone:
./mkmapdata.sh

valid arguments: 
[-f|--gridfile <gridname>] 
     Full pathname of model SCRIP grid file to use 
     This variable should be set if this is not a supported grid
     This variable will override the automatic generation of the
     filename generated from the -res argument 
     the filename is generated ASSUMING that this is a supported 
     grid that has entries in the file namelist_defaults_clm.xml
     the -r|--res argument MUST be specied if this argument is specified
[-r|--res <res>]
     Model output resolution (default is 10x15)
[-t|--gridtype <type>]
     Model output grid type
     supported values are [regional,global], (default is global)
[-p|--phys <CLM-version>]
     Whether to generate mapping files for clm4_0 or clm4_5
     supported values are [clm4_0,clm4_5], (default is clm4_5)
[-b|--batch]
     Toggles batch mode usage. If you want to run in batch mode
     you need to have a separate batch script for a supported machine
     that calls this script interactively - you cannot submit this
     script directory to the batch system
[-l|--list]
     List mapping files required (use check_input_data to get them)
     also writes data to clm.input_data_list
[-d|--debug]
     Toggles debug-only (don't actually run mkmapdata just echo what would happen)
[-h|--help]  
     Displays this help message
[-v|--verbose]
     Toggle verbose usage -- log more information on what is happening 

 You can also set the following env variables:
  ESMFBIN_PATH - Path to ESMF binaries 
                 (default is /contrib/esmf-5.3.0-64-O/bin)
  CSMDATA ------ Path to CESM input data
                 (default is /glade/p/cesm/cseg/inputdata)
  MPIEXEC ------ Name of mpirun executable
                 (default is mpirun.lsf)
  REGRID_PROC -- Number of MPI processors to use
                 (default is 8)

**pass environment variables by preceding above commands 
  with 'env var1=setting var2=setting '
**********************

Caution

Make sure you specify with the "-phys" option if you are creating files for CLM4.0! The default is CLM4.5.

Figure 2-3. Details of running mkmapdata.sh

Each of the raw datasets for mksurfdata_map needs a mapping file to map from the output grid you are running on to the grid and land-mask for that dataset. This is what mkmapdata.sh does. To create the mapping files you need a SCRIP grid file to correspond with each resolution and land mask that you have a raw data file in mksurfdata_map. Some raw datasets share the same grid and land mask -- hence they can share the same SCRIP grid file. The output maps created here go into mksurfdata_map see Figure 2-6.