Skip to content

Detailed Instructions

Alper Altuntas edited this page Mar 13, 2020 · 26 revisions

Contents:

1. Downloading CESM with MOM6

2. Creating a MOM6 case

3. Running a MOM6 case

4. Customizing MOM6 cases


1. Downloading CESM with MOM6

Prerequisite: Make sure that CESM 2.0+ is already ported to your machine.

MOM6 is an optional ocean component in CESM 2.2, along with the primary ocean component POP2. The following instructions describe how to download CESM2.2 with MOM6.

  • Clone the CESM Github repository as follows. The specified tag below (cesm2_2_alpha04d_mom6) includes MOM6 as an optional component.

    git clone -b cesm2_2_alpha04d_mom6 https://github.com/ESCOMP/CESM.git
    
  • After having cloned CESM, run the checkout_externals script to download all the individual components. Note that -o flag instructs checkout_externals to download also the optional components including MOM6.

    (cd CESM/; ./manage_externals/checkout_externals -o)
    

See the following instructions for more information on how to download CESM: https://escomp.github.io/CESM/release-cesm2/downloading_cesm.html

2. Creating and running a MOM6 case in CESM:

  • Run CESM's create_newcase script to create a MOM6 case instance. The script expects the following three required arguments: --compset, --res, and --case. As the names suggest, --compset and --res arguments are to specify the component set and the model resolution, respectively. (See Table: Available compsets and resolutions below for a full list of available MOM6 compsets and resolutions.) The third argument, --case, specifies the name of the case to be created. In the below example, we happen to name our case c.e22.CMOM.T62_t061.001, Although any case name is acceptable, users are advised to adhere to CESM naming conventions. Additionally, for MOM6 cases, users need to provide the --run-unsupported flag since MOM6 compsets are currently experimental.

    CESM/cime/scripts/create_newcase --res T62_t061 --compset CMOM --case c.e22.CMOM.T62_t061.001 --run-unsupported
    

    Some of the other useful create_newcase options when creating a MOM6 case:

    • --walltime: Set the wallclock limit, e.g., --walltime 01:00:00
    • --driver: e.g., --driver mct or --driver nuopc
    • --project: Specify a project id for the case
    • --compiler, e.g., --compiler gnu

    Table: Available compsets and resolutions

    Compset Active Components Forcing Compatible Resolutions
    CMOM MOM6 only CORE2 NYF T62_t061, T62_g16, T62_t025
    CMOM_IAF MOM6 only CORE2 IAF T62_t061, T62_g16, T62_t025
    CMOM_JRA MOM6 only JRA-55 TL319_t061, TL319_g16
    GMOM MOM6 and CICE only CORE2 NYF T62_t061, T62_g16, T62_t025
    GMOM_IAF MOM6 and CICE only CORE2 IAF T62_t061, T62_g16, T62_t025
    GMOM_JRA MOM6 and CICE only JRA-55 TL319_t061, TL319_g16
    BMOM Fully Coupled n/a f09_t061

    For more information on MOM6 grids, check out Grids.

3. Running MOM6 cases:

  • After having initialized the case, cd into the case root and run ./case.setup to prepare the case for the compilation: (The above command will create user_nl_mom text file, which is to be used for customizing the case. More on that later...)

    c.e22.CMOM.T62_t061.001
    ./case.setup
    
  • Within the case root, run /case.build to compile MOM6+CESM executable. Depending on the compset and the compiler of your choice, this step may take 5 to 10 minutes.

    ./case.build
    

    Note: cheyenne users need to run this command on a compute node, as follows:

    qcmd -- ./case.build
    
  • Finally, submit the job to the batch queue using the case.submit script:

    ./case.submit
    
  • Once the run finishes, you can access the output files in the short term archive directory if short term archiving is turned on. To find out whether short term archiving is on, run the following command in your case root.

    ./xmlquery DOUT_S
    

    To query your short term archive directory (DOUT_S_ROOT), run the following command:

    ./xmlquery DOUT_S_ROOT
    

    If the short term archiver is turned off, the output files are located in your case run directory (RUNDIR) along with the input files. Query your run directory as follows:

    ./xmlquery RUNDIR
    

    Note: Check out the following section to get more information on MOM6 input and output files: Understanding files located in the run directory

4. Customizing MOM6 cases:

The available mechanisms for customizing MOM6 cases within CESM are:

  1. xmlchange
  2. user_nl_mom
  3. SourceMods

4.1 xmlchange

  • Users can control some general case variables defined in case *.xml files using the xmlchange tool in the case root. This variables usually define general, model-agnostic settings. Some examples:

    ./xmlchange DOUT_S=FALSE       # Turn off short term archiving
    ./xmlchange STOP_OPTION=nmonth 
    ./xmlchange STOP_N=3           # set run length to 3 months
    ./xmlchange NCPL_OCN=48        # set ocn coupling frequency to 48 (a day)
    
  • Additionally, users can change the following two xml variables that control MOM6 diagnostics on a high level.

    • OCN_DIAG_MODE: This variable is used to choose from a set of predefined ocean diagnostics configurations. Each configuration corresponds to a different combination of frequency, precision, and field lists. Predefined onfigurations ordered in increasing scope/frequency: "spinup", "production", "development". Further customization of diagnostics may be done by copying an edited version of diag_table file in SourceMods/src.mom/
    • OCN_DIAG_SECTIONS: Flag to turn on/off the MOM6 sections diagnostics.

    Examples:

    ./xmlchange OCN_DIAG_MODE="spinup"
    ./xmlchange OCN_DIAG_SECTIONS=FALSE
    

4.2 user_nl_mom

Modifying run-time parameters and adding new available diagnostics:

Go to the CASEROOT and create file SourceMods/src.mom/MOM_override. Add the following line to this file:

#override KH = 800.0 ! set background Laplacian horizontal viscosity to 800.0 m^2/s

Copy diag_table from RUNDIR into SourceMods/src.mom/. Edit this file by adding the following line to the list of monthly mean variables outputted in the native grid (i.e., below line # ocean_month, native grid):

"ocean_model","Khh","Khh","CASE.mom6.hm%4yr-%2mo","all","mean","none",2 Don't forget to replace CASE by your case name.

Rerun the model (./case.submit). Now go to RUNDIR and verify that the above changes have been made by visualizing the variable that you just added (Khh) from file *.mom6.hm_0001_01.nc

Clone this wiki locally