Los Alamos
Modelling
POP Model
User's Guide
SCRIP Home
NCAR Links
POP Home
Grids
Weights
Run SCRIP
Graphics

CCSM-POP


Running SCRIP at NCAR


Example of running SCRIP to produce a mapping file

This example maps between gx3 and T42 grids using conservative area-averaging and the "destarea" normalization convention (see the SCRIP user's guide for explanation of these two choices). For the sake of presentation it is assumed that the T42 grid file which is to be read in by SCRIP is pre-existing while the gx3 file must be created.



Setup

Copy SCRIP from most recent scrip directory, under the soft link /fs/cgd/csm/mapping/SCRIP (or get it from the Los Alamos web site).

In subdirectory grids/ modify file convertPOPT.f in order to generate gx3 grid file for input to SCRIP.

This will entail editing nx, ny, grid_name, grid_file_in, grid_topo_in and grid_file_out.

prompt% make

In source/

prompt% make scrip

Creating a Grid File

In grids/

prompt% convertPOPT
(this would produce gx3.nc, assuming grid_file_out = 'gx3.nc')

Creating the Mapping File

In /fs/cgd/csm/mapping/SCRIP:

Create an input namelist file for the scrip program, named scrip_in. For this present case the contents would be

&remap_inputs
    num_maps      = 2,
    grid1_file    = 'grids/gx3.nc'
    grid2_file    = '/fs/cgd/csm/mapping/grids/T42.nc',
    interp_file1  = 'map_gx3_to_T42_aave_da.nc'
    interp_file2  = 'map_T42_to_gx3_aave_da.nc'
    map1_name     = 'gx3 to T42 Mapping',
    map2_name     = 'T42 to gx3 Mapping',
    map_method    = 'conservative',
    normalize_opt = 'destarea'
    output_opt    = 'ncar-csm'
    restrict_type = 'latlon'
    num_srch_bins = 10

Notice that the path to the gx3 grid file is local, as this grid file was just created in the previous step, whereas the path to the pre-existing T42 grid file points to the CCSM grid repository.

Also notice that these 3 options are mandatory for use in flux-coupling of CCSM:

    map_method    = 'conservative'
    normalize_opt = 'destarea'
    output_opt    = 'ncar-csm'

Now run scrip:

prompt% scrip > map_gx3_and_T42_aave_da.out

Testing of Weights

In the SCRIP directory:

create an input file for the scrip_test program, named scrip_test_in. For the present case, in order to test the mapping from T42 to gx3 grids the contents would be:

&remap_inputs
    field_choice = 2
    interp_file = 'map_T42_to_gx3_aave_da.nc'
    output_file = 'out_T42_to_gx3_aave_da.nc'

Now run scrip_test:

prompt% scrip_test > ! test_T42_to_gx3_aave_da.out

At this point the netcdf output from scrip_test should be examined with care, using your favorite netcdf-reading visualization tool. In particular one should see that the dst_array fields, which contain the interpolated result of the input test field, look reasonable (very much like the input test field "src_array", but on the target grid). The dst_error fields should be examined in order to verify that the error field is indeed small (with max values on the order of 1e-2, for the first-order accurate mapping of dst_array1/dst_error1, and on the order of 1e-4 for the second-order accurate mapping of dst_array2/dst_error2).

Now repeat the test, but for the reverse mapping (from gx3 to T42).

Caution

Some test code exists in the coupler which:

  • checks that array elements are in [0,1]
  • checks that array rows add up to one (or zero for masked out regions)
  • checks what percent of array rows add up to one (eg. a->o should be about 70%)
  • checks that SCRIP domain info is compatible with info sent to coupler at run time.

For now, this information must be inspected the first time a map is used by the coupler. In the future we may have stand-alone code to do this.