CAM File structure

From Aerosol
Jump to: navigation, search

This page describes the organization of CAM's folder and file structure (CAM 3.1). Hopefully this will help a new user become familiar with CAM. Note: see NCAR models for instructions how to run a simulation.

Contents

CAM Folder Overview

Go to http://subversion/projects/ncar_models/, Open CAM, then trunk. The file structure looks like:

data
  atm
    CAM2
      ggas
      inic
      ozone
      rad
      scam
      scyc
      sst
      topo
  lnd
    clm2
      inidata2.1
      pftdata
      rawdata
      srfdata
scripts
  make-cam.csh
  run-cam.csh
source
  cam1
    models
      atm
        cam
          bld
          src
          test
          tools
      ice 
      lnd
        clm2
          src
            biogeochem
            biogeophys
            main
            mksrfdata
            riverroute

Level 1: CAM/WACCM/MOZART/CARMA/etc

The first level in http://subversion/projects/ncar_models/ includes links to different types of models. Open CAM.

Level 2: Trunk/Branches

There are two key folders here: Trunk and Branches.

Trunk - Contains all of the files which are directly a part of CAM.

Branches - Contains all the folders which represent add-ons to CAM, such as CARMA.

Level 3: Build/Data/Run/Scripts/Source

Open trunk. There are three subfolders - Data, Scripts, and Source. Additionally, after CAM is built on a user's machines, the folders Build and Run are created. (See how to run the NCAR models).

Build - Contains the necessary files for instructing CAM how to run a simulation. A noteworthy file, Namelist, is in this directory. The Namelist file includes specific instructions for CAM to run a simulation. The Namelist file can be modified to easily change the settings of a CAM simulation. There is a comprehensive list of Namelist commands in the CAM user manual.

Data - Contains all the necessary datasets for CAM simulations, such as greenhouse gas concentrations since 1870, sulfur emissions, etc. Most of the datasets have separate files for each model resolution. All of the files should be netcdf format (have a .nc extension).

Scripts - Contains two key scripts for Toon group users: make-cam.csh and run-cam.csh. Chuck Bardeen created these files to automate the process of building and running CAM.

Source - Contains the source code for the CAM dynamical core calculations as well as the other subroutines that are involved in a climate simulation. These are coded in FORTRAN and have a .f90 extension. It is helpful to look through these files to better understand how CAM works behind the scenes. Also, if a simulation fails, look at the RUN.out file in the simulation folder and it might point you to a file that is in this folder. For more information on these files, see the "Source Files" section on this page.

Level 4: Atm/Lnd/Ice

These are subfolders within each of the Level 3 folders; the files are organized into Atm (Atmosphere), Lnd (Land), and Ice components.

Noteworthy Source Files

Atmospheric Source Code: Open CAM/trunk/source/cam1/models/atm/CAM/src. This is the set of folders containing atmospheric source code. There are six folders.

advection
control
dynamics
ocnsice
physics
utils 

CAM.f90

(control folder). This is the first subroutine called when a CAM run is started. It calls appropriate initialization, time-stepping, and finalization routines, including runtime_opts (the namelist file).

filenames.f90

(control folder). This module handles filenames needed for the model, including input filenames, and most output filenames that the model uses. All filenames that the model uses will use methods or data constructed by this module. In some cases (such as the history module) other modules or routines will store the actual filenames used, but this module is used to determine the names.

Personal tools