PGI Guide to CESM

This guide is intended to help build the CESM package for Linux using PGI 2012 compilers.

Version Information

This guide was created for CESM release 1.0.4 compiled using the PGI 2012 compilers. This information is for both x64 processors running 64-bit Linux and x86 processors running 32 bit Linux.

Application Notes

Information about CESM can be found on the CESM website. From the CEMS home page:

"The Community Earth System Model (CESM) is a coupled climate model for simulating Earth's climate system. Composed of five separate models simultaneously simulating the Earth's atmosphere, ocean, land, land-ice, and sea-ice, plus one central coupler component, CESM allows researchers to conduct fundamental research into the Earth's past, present, and future climate states. "

Obtaining the Source Code

Access to CESM is through SVN and requires the user have an account and password.

To get a list of all CESM releases available for download:

svn list

To check out a specific release (e.g. CESM1.0.4) enter:

svn co

Note that the source code should now be downloaded to your system. The particular dataset you wish to run will be downloaded by the build scripts as a part of the build process.


Before building CESM, the user will need to build and install MPI vesions of NetCDF and HDF5

Building, Testing and Installing CESM

  1. Enter the download directory

      cd cesm1_0_4
  2. Set environment variables:

      export COMPSET="X"
      export RES="f45_g37"
      export MACH="generic_linux_pgi"
      export CCSMROOT=`pwd`
      export CASE=case2
      export CASEROOT=${CCSMROOT}/${CASE}
      export EXEROOT=${CCSMROOT}/${CASE}_exe
      export RUNDIR=${EXEROOT}/run
      export SCRATCHROOT=/tmp/${USER}
      export DIN_LOC_ROOT_CSMDATA=/cam_data   #CCSM input data root directory - best 
                                              #if accessible by all CCSM users
      export MAX_TASK_NODE=16  #Maximum mpi tasks per machine node  
                               #(i.e. number of cores on a node)
      sudo mkdir $DIN_LOC_ROOT_CSMDATA
      sudo chmod 777 $DIN_LOC_ROOT_CSMDATA
  3. Build the code:

      cd $CCSMROOT/scripts
      ./create_newcase -list
      ./create_newcase -case $CASEROOT -mach $MACH -compset $COMPSET -res $RES -scratchroot 
    $SCRATCHROOT -din_loc_root_csmdata $DIN_LOC_ROOT_CSMDATA -max_tasks_per_node $MAX_TASK_NODE
      cd $CASEROOT
      ./configure -case
  4. If something goes wrong in the build process, do a clean and then build again.


Known Issues and Limitations


Click me