Port Validation for CAM with the cam4 physics package

NOTE: The validation technique discussed here is only applicable to the cam4 physics package. The CAM-5 model can be configured to run with the cam4 physics package via the "-phys cam4" argument to CAM's configure command. The cam5 physics package does not pass this test.


Below we outline an inexpensive procedure based on a perturbation growth test that can establish port validity of the cam4 physics package and other simple CAM configurations (e.g., adiabatic or ideal physics) with reasonable confidence. While it is highly likely that a successful perturbation growth test indicates a valid port, the ultimate assurance that ported code is running correctly comes from running a full climate simulation and comparing it to a control simulation produced by the trusted model. For the cam5 physics package a full climate simulation is the only way to validate the port. For full climate validation see the CAM diagnostic package webpage .

Although the results of the perturbation growth test do not provide definitive port validity, we find the test to be extremely useful because it fails reliably, indicating that there is a problem with the port that needs to be fixed before incurring the expense of a full climate simulation.

Perturbation simulation controls

Each model configuration listed below is linked to a tar file that contains:

CAM-5.0 (CESM-1.0), Finite-Volume dycore, 1.9x2.5-L26, IBM Power6.    [details]
CAM-5.1 (CESM-1.0.6), Finite-Volume dycore, 1.9x2.5-L26, IBM iDataPlex.    [details]
CAM-5.2 (CESM-1.1.1), Finite-Volume dycore, 1.9x2.5-L26, IBM iDataPlex.    [details]
CAM-5.3 (CESM-1.2.2), Finite-Volume dycore, 1.9x2.5-L26, IBM iDataPlex.    [details]

Example: Validate port of CAM-5.0 to a Linux cluster

The example below assumes that the validation will be done for the Finite-Volume dycore at 1.9x2.5-L26 resolution, and that the control simulation from the NCAR run has been downloaded.

  1. Configure CAM - To build CAM for perturbation growth testing the configure command must be invoked with the -pergro option. The default dycore/resolution is Finite-Volume, 1.9x2.5, but it can be explicitly set for clarity. The parameter supplied for the ocn is to ensure the model runs in "aqua-planet" mode. Also, suppose the Linux cluster being evaluated has the Lahey Fortran compiler installed. Since PGI compilers are the default assumed in the CAM Makefile the compiler must also be explicitly declared (-fc lf95). And finally, the default parallelization on Linux platforms is none (i.e., serial). We wish to use MPI and this must also be explicitly specified with the number of mpi tasks being used, in this example we used 8 (-ntasks 8).
    % configure -dyn fv -hgrid 1.9x2.5 -fc lf95 -ntasks 8 -phys cam4 -ocn aquaplanet -pergro

    NOTE: This configure command assumes that the netCDF and MPI include/library directories are specified in your environment. If not then add the appropriate locations to the configure command-line, or set the locations using the environment variables.

  2. Run CAM - The namelist for a two day run with no perturbation applied to the initial temperature field is set up as follows:
    % build-namelist -s -case cam5.0_port -runtype startup \
     -namelist "&camexp stop_option='ndays', stop_n=2 nhtfrq=1 ndens=1 \
       mfilt=97 hfilename_spec='h%t.nc' empty_htapes=.true. \
       fincl1='T:I','PS:I' /"

    This specifies a two-day initial run with real*8 precision output of just the T and PS fields at every timestep. Additional variables specify writing history output every timestep, writing all timesteps to one output file, and renaming the history file to 'h0.nc'. Note that output of the PS field is required for computing the difference statistic which is a mass weighted RMS value.

  3. Compute RMS temperature differences - The temperature difference of interest is between the run just completed (in file h0.nc), and the downloaded control run (in file f1.9ph_ibm_5.0.nc). Using the perl script cprncdf this difference will be calculated for each timesample in the file with the command:
    % cprncdf f1.9ph_ibm_5.0.nc h0.nc > RMST_f1.9_cmp_ibm_5.0

    Note that when cprncdf is invoked this way it will run cprnc on the history files before striping out the RMS T values. So the cprnc utility must already be built and in your path. cprnc comes with the CAM distribution (in the models/atm/cam/tools/cprnc directory).

  4. Plot RMS temperature differences - Finally we need to plot the difference growth curve produced in the previous step (in file RMST_f1.9_cmp_ibm_5.0) against the perturbation growth curve for the control run (downloaded with the control history file, in file RMST_f1.9ph_ibm_aqpgro_5.0). This can be done with the perl script cprncplt via the following command:
    % cprncplt -b -t -pltitle "cam5.0, FV-1.9x2.5, port validation" \
      -l "perturbation: cam5.0(ibm)","difference: cam5.0(ibm) - cam5.0(pc/lf95)" \
      RMST_f1.9ph_ibm_aqpgro_5.0 RMST_f1.9_cmp_ibm_5.0

    The script cprncplt assumes that the yorick utility is installed and in your path. The arguments tell the script to run in batch mode (-b), plot time in days rather than timestep number (-t, this option assumes there is two days worth of data in the file), add a title (-pltitle "string"), and add line legends (-l "line1","line2"). In batch mode the plot output is written to the postscript file pertGrowth.ps. Here is the plot from a linux cluster at NCAR:

    At this point in the validation process these curves are sufficiently alike to warrent moving to the next step which is doing a full climate simulation to compare with the controls.