Skip to content
Snippets Groups Projects

CM1

CM1 r10.10 repo, build scripts, test scripts.

List of files:

 README.md - this file
 CM1-build-prereqs.sh - script to build pre-requisit libraries (netCDF, HDF, 
 CM1-build-prereqs2.sh - script to build pre-requisit libraries (netCDF, HDF, 
 CM1-build-prereqs-pgi.sh - script to build pre-requisit libraries (netCDF,
                            HDF, zlib) using the PGI compiler
 CM1-build.sh - script to build CM1 for the Intel compiler
 CM1-Run-Tests.sh - script to run the tests
 Makefile.intel  - Makefile used for cm1 v19.10 with the Intel compiler 
 Makefile.gnu    - Makefile used for cm1 v19.10 with the gnu compiler 
 Makefile.pgi    - Makefile used for cm1 v19.10 with the PGI compiler
 Makefile.pgi.openmp    - Makefile used for cm1 v19.10 with the PGI compiler
                          and for OpenMP (not MPI)
 cm1r19.10.tar.gz - tarball containing the CM1 source
 cm1r19.10_Terrain.tar.gz - tarball containing the CM1 source, with terrain
 tests.tar.gz - tarball of directory with test files and scripts

To run, first select a blank directory. All scripts expect to be in a PBS of faked PBS environment. You can "fake" PBS by setting the variables PBS_NP to a number of cores (4 minimum) and PBS_NODEFILE to the corresponding hosts.

The PBS batch environment can be interactive or batch.

4 cores minimum are required to run the basic test. The test script will run 8 or 16 core jobs if available.

Notes:

The build and build-req scripts may need to be modified to reflect system requirements. These scripts were originally written for RHEL6 but the modules are different for RHEL7. Additionally, when using the PGI compiler for RHEL6 there is a PGI version requirement for use with openmpi.

The build and build-req scripts are also configured to compile using multiple cores if they are available. The number core of core available is determined from the $PBS_NP environment variable. You may need to explicitly set this to one in the scripts as sometimes (but not always) parallel builds end with strange errors. The scripts do error checking so if anything fails in the build process the first thing you might want to do is set edit the scripts to set NCORES=1 and try again.

The prerequisite script pulls all the required libraries from a GitLab repo located at https://git.psu.edu/nucci/meteolibs.git

Automated Build and Test:

An automated BuildRun script is available in repo git@git.psu.edu:icds-os-upgrade-tests/scripts-nucci.git

This automated script will build CM1 required libraries, CM1, and a test suite using the Intel compiler. It is set up for RHEL6. The build and build pre-req scripts will need to be modified for other systems as the required modules will be different.

To use this automated build, clone this repo, and copy the script BuildRunCM1.sh to the empty directory you selected. Run this script.

If all tests pass the script will exit with a 0 return code (upon conclusion check with "echo $?".

For CM1 a direct comparison of output cannot be performed as random numbers used in the calculation will cause small differences in run to run output.

The script checks to make sure a required output file is produced and the run is considered a success if it is. For a detailed check, a python script in the tests directory, check_output.py, extracts the output of file cm1out_000009.nc and creates a JPEG file testplot.jpg. View this file and compare it to the image in plot_control.jpg.

check_output.py needs python from a well configured anaconda installation.

Manual Build and Test:

Follow the outline in the automated build/run/test script.

Basics:

Set TOPDIR variable If TOPDIR doesn't already exist from a prior use, run pre-req build script Run the build script

For testing, guntar the test file tests.tar.gz. cd to the directory. The
script cleanup.sh cleans up results from prior so that each test can start from scratch. Copy the appropriate namelist input file to namelist.input and run cm1. The checkit script does a simple test comparison and check_output.py generates a plot you can compare to plot_control.jpg.