Support for specific components (ie. cam, pop, cice, clm, datm, etc) is hardwired into the CESM scripts. To add a new component model, specifically a new atmosphere, land, ocean, or sea ice component, several things need to be done. This section only summarizes the tasks to complete without providing details. This is an advanced exercise, and CESM may be able to provide addition assistance if resources are available. In the directions below, the model "cxyz" is a new land model that is going to be added to CESM. There are two major parts. First, the component needs to be supported in the CESM scripts. Second, the component needs to be able to run under the CESM driver.
Add the new model under the appropriate models/"component" directory. For instance add the cxyz model under models/lnd/cxyz.
Add a template file to the new model under the bld directory. For instance, models/lnd/cxyz/bld/cxyz.cpl7.template. Use another models' template file as a starting point. The template file should be able to produce buildnml, buildexe, and input_data_list files in the Buildconf directory.
Edit scripts/create_newcase. Add support for the new model under the definition of "my @comps". Also add a pointer to the template file under the variable "my %templates".
Add the new model as a valid option in the scripts/ccsm_utils/Case.template/config_definition.xml file for the specific component. For instance, for COMP_LND, add cxyz as a valid option. Add any new env variables that are needed specifically for that component and create a new group for them called, for instance, "conf_cxyz". Add the new model to the list of components in scripts/ccsm_utils/Case.template/ConfigCase.pm if any component specific env variables are added to the config_definition.xml file.
Add a new compset that supports the new component to scripts/ccsm_utils/Case.template/config_compsets.xml. For instance, add a new compset called IZ that is based on the I_2000 compset but has cxyz instead of clm as the land component.
Review the Macros files in scripts/ccsm_utils/Machines to provide any compiler modifications specifically for the new component. This might be a step that is done after further testing.
Add support for output files for the new component in the scripts/ccsm_utils/Tools/st_archive.sh script. This might be done after the new component is in "production".
For the new component to run under the CESM driver, a new top level *_comp_mct.F90 file needs to be added to the component. For instance, a lnd_comp_mct.F90 file should exist in the cxyz model source code. This file will provide the init, run, and final interfaces that the CESM driver require. To generate one of these for the new component, copy an existing one from another component and modify it to run with the new component. There are several inherent requirements that make this work such as
the driver provides the mpi communicator for the component at initialization. The component must save and use this mpi communicator internally.
The top level "program" file for the new component should be disabled.
the component must set various parameters at initialization such as the present and prognostic flags, and the nx and ny size values.
the component must pass the grid and decomposition to the driver at initialization in the particular format required.
the component must unpack and pack data from the coupling datatype at initialization and during runtime. the fields used must be set in the seq_flds_mod.F90 module in the driver.
the component must stay synchronized in time with the provided driver time and should abort if time coordination is incorrect. the component must advance the correct amount of time whenever the run method is called. the time is provided to the component by the driver.