The CLM can be built to run in one of three modes. In offline mode, it runs as a stand alone executable periodically reading stored atmospheric forcing data. In cam mode, CLM is compiled and run as a part of the Community Atmosphere Model (CAM). Communication between the atmosphere and land models occurs via variables passed in subroutine calls. In csm mode, CLM is run as a component in a group of climate system models making up the Community Climate System Model (CCSM). In this mode, all component models--including CLM--are compiled as separate executables, but run simultaneously communicating state and flux information via the flux coupler.
The routine program_off (Section A.82) provides the program interface for running CLM in offline mode. This routine initializes timers, MPI communications, and the land model. As a part of model initialization, it calls shr_orb_params to determine planetary orbital parameters. Next, the time stepping loop of the model is executed. Inside this loop, the atmospheric forcing data is read, the driver (Section A.53) routine is called, and the time step is advanced. After the time stepping loop is completed, the timers and MPI communications are finalized and the program ends.
The module atm_lndMod (Section A.40) contains the subroutine interfaces necessary to run CLM in cam mode. CLM is initialized by a call to atmlnd_ini (Section A.40.1). At every time step in the atmosphere model, CLM is run by calling atmlnd_drv (Section A.40.2). These routines handle the exchange of flux and state variables between the atmosphere and the land by communicating blocks of data using a mapping between parallel processes constructed during initialization.
The routine program_csm (Section A.81) provides the program interface for running CLM in csm mode. This routine initializes timers, MPI communications, and the land model. In csm mode, orbital parameters are obtained from the flux coupler during initialization. Next, the time stepping loop of the model is executed; however, flux and state variable exchanges for each time step occur with the flux coupler instead of directly with the atmosphere model. After the time stepping loop is completed, the timers and MPI communications are finalized and the program ends.