Chapter 5. Porting and Validating CESM on a new platform

Table of Contents
Porting Overview
Step 1: Use create_newcase with a userdefined machine name
Step 2: Enabling out-of-the box capability for your machine
Step 3: Port Validation

Porting Overview

One of the first steps many users will have to address is getting the CESM1 model running on their local machine. This section will describe the process of going about that. In short, you should first call create_newcase using a "userdefined" machine name and get that case running. Second, you should take the results of the previous step and introduce your machine in the $CCSMROOT/scripts/ccsm_utils/Machines/ directory so that your local machine is supported out-of-the-box. This greatly eases setting up cases and benefits groups of users by requiring the port be done only once. Third you should validate the model on your machine.

It is usually very helpful to assure that you can run a basic mpi parallel program on your machine prior to attempting a CESM port. Understanding how to compile and run the program fhello_world_mpi.F90 shown here could potentially save many hours of frustration.

program fhello_world_mpi.F90
  use mpi
  implicit none
  integer ( kind = 4 ) error
  integer ( kind = 4 ) id
  integer p
  character(len=MPI_MAX_PROCESSOR_NAME) :: name
  integer clen
  integer, allocatable :: mype(:)
  real ( kind = 8 ) wtime

  call MPI_Init ( error )
  call MPI_Comm_size ( MPI_COMM_WORLD, p, error )
  call MPI_Comm_rank ( MPI_COMM_WORLD, id, error )
  if ( id == 0 ) then

    wtime = MPI_Wtime ( )

    write ( *, '(a)' ) ' '
    write ( *, '(a)' ) 'HELLO_MPI - Master process:'
    write ( *, '(a)' ) '  FORTRAN90/MPI version'
    write ( *, '(a)' ) ' '
    write ( *, '(a)' ) '  An MPI test program.'
    write ( *, '(a)' ) ' '
    write ( *, '(a,i8)' ) '  The number of processes is ', p
    write ( *, '(a)' ) ' '

  end if


  write ( *, '(a)' ) ' '
  write ( *, '(a,i8,a,a)' ) '  Process ', id, ' says "Hello, world!" ',name(1:clen)

  call MPI_Finalize ( error )

end program

You will want to start with an X (i.e. commonly referred to as dead) compset running at a low resolution. So you could, for instance, start with an X compset at resolution f45_g37. This will allow you to determine whether all prerequisite software is in place and working for a simple parallel CESM configuration that requires minimal input data. Once that is working move to an A compset with resolution f45_g37. Once that's working, run a B compset at resolution f45_g37. Finally when all the previous steps have run correctly, run your target compset and resolution.