Table of Contents
The Modular Ocean Model (MOM) is a numerical representation of the ocean's hydrostatic primitive equations, and it is designed primarily as a tool for studying the global ocean climate system. MOM4 is the latest version of the GFDL ocean model whose origins date back to the pioneering work of Kirk Bryan and Mike Cox in the 1960s-1980s. It is developed and supported by researchers at NOAA's Geophysical Fluid Dynamics Laboratory (GFDL), with contributions also provided by researchers worldwide.
The first release of MOM4 took place January of 2004. There have been four releases of this code: MOM4p0a (Jan 2004), MOM4p0b (March 2004), MOM4p0c (August 2004), and MOM4p0d (May 2005). The developers welcome feedback, both positive and negative, on the code's integrity and portability as well as documentation. It is through such feedback that the code and documentation evolves and becomes more robust and user friendly.
The purpose of this web guide is to provide general information about MOM4 and particular information for how to download and run the code.
MOM4 users can acquire the source code and associated datasets from GForge, and are required to register at the GFDL GForge location. Therefore, users need to register only once to get both the source code and datasets of MOM4. More details can be found in the quickstart_guide.html.
Email concerning MOM4 should be directed to the
mom4-email list located at oar.gfdl.mom4p0noaa.gov. All
questions, comments, and suggestions are to be referred
to this list. An archive of all emails is maintained at
the mom4 email archive. A subject-organized archive of
the emails is available at mom4p0_email.html. Note that by
registering at GForge to access the code, you are
automatically subscribed to the email list.
There have been four releases of MOM4p0: (1) MOM4p0a was released January 2004, (2) MOM4p0b was released March 2004, and (3) MOM4p0c was released August 2004, and (4) MOM4p0d released May 2005. Each release is documented on this web page.
There are two major algorithm issues that are being addressed by GFDL developers. (1) Generalized quasi-Eulerian vertical coordinates are being implemented in MOM4. It is anticipated that MOM4p1a will have this capability, with a release date hopefully late 2005. (2) Two-way nesting is being considered for MOM. It is hoped that nesting will be available also late 2005 or early 2006.
There remains two general ways to compile mom4: with static allocation of arrays or dynamic allocation. Recent work on the SGI machines at GFDL has reduced the difference in efficiency between these two compilations. We understand that on some platforms, the dynamic allocation actually is better than static. Such remains an ongoing issue, as do other elements of code efficiency. Our general goal is to provide code that is efficient across a broad range of computer platforms, but not at the cost of sacrificing portability. Those who know they will be working with one particular platform for a period of time should readily find better ways of coding some parts of mom4 and the associated FMS code. If you feel your efficiency improvements are of a general nature and wish to have them distributed in future MOM4 releases, we would be happy for you to contribute the modified code.
Since its release in January 2004, there have been nearly 300 registrations with the mom4 distribution, with each registration generally representing more than one user. This is a sizable user community. For various purposes, it is useful to tabulate these users. Click here to download an updated table of users.
In addition to this user guide, documentation for MOM4 is provided by two LaTeX generated postscript documents:
A Technical Guide to MOM4
GFDL Ocean Group Technical Report No. 5
S.M. Griffies, M.J. Harrison, R.C. Pacanowski, and A. Rosati
NOAA/Geophysical Fluid Dynamics Laboratory
Available on-line at http://www.gfdl.noaa.gov/~fms.
Although MOM4 shares much in common with earlier versions of MOM, it possesses a number of computational, numerical, and physical characteristics that are noteworthy. The following provides an overview of the main characteristics of MOM4 (please refer to A Technical Guide to MOM4 for references).
Computational characteristics of MOM4 include the following.
Numerical and kinematic/dynamic characteristics of MOM4 include the following.
Physical parameterizations available in MOM4 include the following.
Miscellaneous features of the code released with MOM4 include the following.
MOM4 has been coded within GFDL's Flexible Modeling System (FMS). Doing so allows for MOM4 developers to use numerous FMS infrastructure and superstructure modules that are shared amongst various atmospheric, ocean, sea ice, land, vegetative, etc. models. Common standards and shared software tools facilitate the development of high-end earth system models, which necessarily involves a wide variety of researchers working on different computational platforms. Such standards also foster efficient input from computational scientists and engineers as they can more readily focus on common computational issues.
The following list represents a sample of the FMS shared modules used by MOM4.
The FMS infrastructure (the "Lima version") has been released to the public on GForge, with further releases every few months.
The Flexible Modeling System ( FMS) is free software; you can redistribute it and/or modify it and are expected to follow the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
FMS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with MOM4; if not, write to:
Free Software Foundation, Inc.
59 Temple Place, Suite 330
Boston, MA 02111-1307
USA
or see: http://www.gnu.org/licenses/gpl.html
MOM4 is distributed with a set of test cases located in mom4/exp/. These tests are taken from models used at GFDL for testing the numerical and computational integrity of the code.
![]() |
Warning |
---|---|
These experiments are NOT sanctioned for their physical relevance. They are instead provided for the user to learn how to run MOM4, and to verify the numerical and/or computational integrity of the code. PLEASE do not assume that the experiments will run for more than the short time selected in the sample runscripts. |
mom4_test1: This experiment consists of a flat bottom sector domain and uses very simple physics. This experiment is very small and can be easily run on a single workstation. It should provide the user with a basic experience of running mom4.
mom4_test2: This experiment consists of a flat bottom sector domain and it uses more realistic physics options. This experiment has the same grid as test1, but it more thoroughly exercises the model's various physics packages. Since the domain is small, it should be accessible to those with single workstations, though it will be slower than mom4_test1 due to the use of more realistic physical parameterizations.
mom4_test3A: This experiment consists of an east-west channel using open boundary conditions at the western end of the channel. This experiment provides an illustration of the open boundary condition capability of MOM4. Tracers include potential temperature and salinity.
mom4_test3B: This experiment consists of an solid wall on all four sides and with a domain twice as long as the open boundary condition test3A. This experiment is used to verify the relevance of the open boundary solution from test3A solution at early times. That is, for early times, the solution from test3A should closely (though not bitwise) agree with that from test3B. Tracers include potential temperature and salinity.
mom4_test4: This model uses a global tripolar grid with roughly "3-degree" resolution and 28 vertical levels. The ocean is coupled to the GFDL sea ice model. Tracers include temperature and salinity, as well as the age, OCMIP biotic, and cfc tracer packages. This model is aimed to test the capabilities of the multipe tracers available with mom4. Note that the Sweby advection scheme is used here for all tracers, as is recommended by GFDL researchers.
mom4_test5: This model uses a global tripolar grid with roughly "1-degree" resolution and 50 vertical levels. The ocean is coupled to the GFDL sea ice model. The configuration is forced with the German OMIP dataset. Ocean tracers include potential temperature and salinity as well as the age tracer package. This is a large model, and it is similar (though not the same) to the ocean and ice configuration used for the GFDL IPCC simulations.
mom4_iom: This is Indian Ocean Community Model version 1.0 developed for Intensive Course on Ocean Modeling held at CMMACS, India, October 4-14, 2004.
As with previous MOMs, the GFDL-MOM4 developers aim to provide the international climate research community with a repository for robust and well documented methods to simulate the ocean climate system. Consequently, we encourage researchers to support various modules that are presently absent from MOM4, yet may arguably enhance the simulation integrity (e.g., a new physical parameterization or new advection scheme) or increase the model's functionality.
Depending on the level of code contributions, we envision a directory where "contributed MOM4 code" will reside. Maintenance and ownership of this code will remain with the contributor. As a practical matter, prior to spending time developing a new module, it is recommended that the developer query the MOM4 mailing list to see what efforts in the community may have already been availed.
Requirements that contributed code must meet include the following:
The FMS development team uses a local implementation of GForge to serve FMS software, located at http://fms.gfdl.noaa.gov. In order to obtain the source code and data sets, you must register as an FMS user on our software server. After submitting the registration form on the software server, you should receive an automatically generated confirmation email within a few minutes. Clicking on the link in the email confirms the creation of your account.
After your account has been created, you should log in and request access to the Flexible Modeling System project. Once the FMS project administrator grants you access, you will receive a second email notification. This email requires action on the part of the project administrator and thus may take longer to arrive. The email will contain a software access password along with instructions for obtaining the release package, which are described below.
To check out the release package containing source code, scripts, and documentation via CVS, type the following commands into a shell window. You might wish to first create a directory called fms in which to run these commands. You should enter the software access password when prompted by the cvs login command. At cvs login, the file ~/.cvspass is read. If this file does not already exist, an error message may display and the cvs login may fail. In this event, you should first create this file via touch ~/.cvspass.
cvs -z3 -d:pserver:cvs@fms.gfdl.noaa.gov:/cvsroot/mom4 login (Enter the password you receive in the welcome email here) cvs -z3 -d:pserver:cvs@fms.gfdl.noaa.gov:/cvsroot/mom4 co -r mom4p0d mom4
This will create a directory called mom4 in your current working directory containing the release package.
If you have already checked out this CVS tag previously and some files have been modified since your last checkout you may wish to update your code as follows:
cvs -z3 -d:pserver:cvs@fms.gfdl.noaa.gov:/cvsroot/mom4 login (Enter the password you receive in the welcome email here) cvs -z3 -d:pserver:cvs@fms.gfdl.noaa.gov:/cvsroot/mom4 update -r mom4p0d mom4
If you prefer not to use CVS, you may download the tar file from https://fms.gfdl.noaa.gov/projects/mom4/. Sample output is also available there for download. See Section 8.1, “Sample model output” for more information on the sample output.
All data sets that are needed to run MOM4 test cases are available for download from the same place in GForge where users get the source code. Therefore, users need to register only once to get both the source code and data sets of MOM4. More details can be found in the quickstart_guide.html.
The topography data set for test4, and test5 is a coarsened version of that kindly provided by Andrew Coward and David Webb at the Southampton Oceanography Centre. Their topography is a montage of that developed by Smith and Sandwell (1997) by satellite data in the region of 72°S to 72°N, the NOAA (1988) 5-minute global topography ETOPO5, and the International Bathymetric Chart of the Arctic Ocean (IBCAO). The chlorophyll-a density data set was compiled by Colm Sweeney, using data from James A. Yoder and Maureen A. Kennelly at the Graduate School of Oceanography, University of Rhode Island. This data set contains monthly chlorophyll concentrations from the SeaWiFS satellite for the period 1999-2001. Monthly wind stress is based on Hellerman and Rosenstein (1983). Temperature and salinity initial and boundary conditions are provided by the NOAA National Oceanographic Data Center (NODC) World Ocean Atlas (WOA).
All datasets of MOM4 are in NetCDF format since this format is widely used in the community. A number of useful tools are available here that allow the user to perform some necessary operations (editting attributes, merging, etc.) on a NetCDF file.
MOM4 is distributed with code used to generate model grids, initial conditions, and boundary conditions. Each step must be performed prior to running the ocean model. The steps used during this experimental setup stage are generally termed "preprocessing", and the code used for these purposes is under the /preprocessing directory in the mom4 distribution. The purpose of this section of the User Guide is to outline this code and its usage. Further details of usage and algorithms can be found in the internal documentation within the various preprocessing code modules.
We start this section with some general comments regarding the setup of a model experiment.
--Setting up an experiment is critical part to the success of a research or development project with mom4. It is important that the user take some time to understand each of the many steps, and scrutinize the output from this code.
We have endeavoured over the years to provide tools facilitating the ready setup of a new experiment. However, we remain unable to provide code that does everything possible under the sun. Additionally, all features that are provided here may not be fully tested. For these reasons, the preprocessing code continues to evolve as use and functionality evolve. We sincerely appreciate ALL comments about code and documentation, especially comments regarding clarity, completeness, and correctness. Your input is essential for the improvement of the code and documentation.
--Many steps in idealized experiments that were formerly performed while running earlier MOM versions have been extracted from mom4 and placed into preprocessing. Hence, even if you are running an idealized experiment, it is likely that you will need to perform some if not all of the preprocessing steps discussed here.
--In addition to this section discussing how to set up an experiment, the online USER GUIDE has a Frequently Asked Questions (FAQ) section devoted to these issues. If you have a problem that is not addressed either here or the FAQ, then please feel free to query the mom4 email list. No question is too silly, so please ask!
--All code used to setup an experiment with mom4 is written in Fortran 90/95 except make_xgrids, which is written in C. Most code is dependent on FMS shared code for the purpose of parallization and interpolation. In addition to the documentation provided here and FAQs, there are comments within the code to help users debug and to make modifications to suit their purpose.
--Some users make nontrivial changes of general use. With your support, assistance, and maintenance, we will endeavour to include your changes in future releases.
The grid_spec.nc file is generated by executing the make_xgrids utility. make_xgrids generates the two exchange grids used by the FMS coupler, one for surface fluxes and the other for runoff, when the simulation requires an atmospheric grid different from the sample exchange grids provided by FMS. make_xgrids is created by compiling its C source, for example:
cc -O -o make_xgrids make_xgrids.c -L/usr/local/lib -lnetcdf -lm
creates the make_xgrids executable from C-source and the netCDF and standard math libraries and is executed with the command:
make_xgrids -o LON2.5LAT2LONLAT.nc -a N45.nc -l N45.nc
which makes a grid_spec.nc file (input files containing grid information for the ocean/sea-ice, atmosphere and land component models are indicated by the -o, -a and -l flags, respectively). make_xgrids expect a netCDF format input specification for the ice/ocean grid ( LON2.5LAT2LONLAT.nc in the above example). Three fields are required to be in this file:
make_xgrids also expects a netCDF format input specification for the atmosphere and land grid (N45.nc in the above example). x_vert_T and y_vert_t are required in the atmosphere/land grid file (N45.nc). make_xgrids copies all fields of the ice/ocean grid specification file to its output file, grid_spec.nc, and then appends fields that specify the atmosphere and land model grids and the surface and runoff exchange grids.
make_xgrids
takes care that the land and ocean grids perfectly tile
the sphere. The land model's domain is defined as the
part of the sphere not covered by ocean (where wet = 0 on
the ocean grid). To accomplish this, the land cells must
be modified to remove the ocean parts. This is done in
make_xgrids by first
taking the intersections of atmosphere and land cells.
The overlap area between these cells and active ocean
cells are then subtracted. Finally, the modified
atmosphere/land intersections are aggregated into land
cell areas and atmosphere/land exchange cell areas.
Model cell intersections are calculated using the Sutherland-Hodgeman polygon clipping algorithm (Sutherland, I. E. and G. W. Hodgeman, 1974: Reentrant polygon clipping, CACM, 17(1), 32-42.). This algorithm finds the intersection of a convex and arbitrary polygon by successively removing the portion of the latter that is "outside" each boundary of the former. It can be found in many computer graphics text books (e.g., Foley, J. D., A. van Dam, S. K. Feiner, and J. F. Hughes, 1990: Computer graphics: principles and practice, second edition. Addison Wesley, 1174 pp.). The implementation in make_xgrids is particularly simple because the clipping polygon is always a rectangle in longitude/latitude space. For the purpose of finding the line intersections in the clipping operations, the cell boundaries are assumed to be straight lines in longitude/latitude space. This treatment is only perfectly accurate for cells bounded by lines of longitude and latitude.
Spherical areas are calculated by taking the integral of the negative sine of latitude around the boundary of a polygon (Jones, P. W., 1999: First- and second-order conservative remapping schemes for grids in spherical coordinates. Monthly Weather Review, 127, 2204-2210.). The integration pathways are again straight lines in longitude/latitude space. make_xgrids checks that the sphere and the individual cells of the atmosphere and ocean grids are tiled by the surface exchange cells. The fractional tiling errors are reported.
After generating the model grid, it is time to generate the initial and boundary conditions (ICs and BCs). These conditions are specific to the details of the model grid, so it is necessary to have the grid specificiation file in hand before moving to the IC and BC generation.
There are two options for ICs and BCs.
--Idealized Conditions. These conditions are based on subroutines that design idealized setups for either initial conditions (e.g., exponential temperature profile) or boundary conditions (e.g., cosine zonal wind stress). Code for these purposes is found in the idealized_ic and idealized_bc directories in the mom4 distribution. Details of available namelist choices are in the documentation file idealized_ic.html as well as the comments within the source code itself. Users can readily incorporate their favorite idealized IC or BC into the mom4 idealized preprocessing step by emulating the code provided.
--Realistic Conditions. These ICs and BCs generally result from a regridding routine to bring, say, the Levitus analysis onto the model grid for initializing a model, or for mapping surface fluxes onto the grid for boundary conditions. Code enabling the regridding functions is found in the preprocessing/regrid_2d, preprocessing/regrid_3d and preprocessing/regrid directories in the mom4 distribution.
In the remainder of this section, we detail code to generate the ICs and BCs of use for mom4.
It is typical for air-sea fluxes of momentum, heat, and mosture to live on a grid distinct from the ocean model grid. In particular, most analyses are placed on a spherical latitude-longitude grid, whereas most global ocean models configured from mom4 are run with tripolar grids.
When running an ocean or ocean-ice model, it is useful to map the boundary fluxes onto the ocean model grid prior to the experiment. This preprocessing step saves computational time that would otherwise be needed if the fluxes were mapped each time step of a running experiment. To enable this regridding, one should access code in the preprocessing/regrid_2d directory. The original data must be on a latitude-longitude grid to use regrid_2d. The target/destination grid can be either latitude-longitude with arbitrary resolution, or tripolar with arbitrary resolution.
In some cases, one may wish to take a set of forcing fields from one tripolar mom4 experiment and regrid them onto another tripolar mom4 experiment with different grid resolution. In this case, it is necessary to regrid before running the experiment.
As of the mom4p0d distribution, there is a regridding tool within the preprocessing/regrid directory that enables one to regrid fields on one tripolar grid to another tripolar grid. Indeed, one can regrid source data from any logically rectangular grid (e.g., latitude-longitude grid or tripolar grid) to a target/destination grid that is any logically rectangular grid.
Note that this is new code, and so has been tested only for particular cases. So the user should be extra careful to scrutinize the results.
The "on_grid" logical in the data_table indicates whether an input file is on the grid of the model or not.
on_grid=.true. means that the input file is on the same grid as the ocean model. This is the recommended setting for models running with specified atmospheric forcing from data or an analysis product.
on_grid=.false. means the input file has data on a grid differing from the ocean model. This feature is allowed ONLY if the input data lives on a spherical grid. This is a relevant setting if one wishes to keep the input data on their native spherical grid. If the input data is non-spherical, then on_grid=.false. is NOT supported. Instead, it is necessary to preprocess the data onto the ocean model grid.
The tool preprocessing/runoff_regrid is of use to grid river runoff data onto the ocean model grid. In this case, runoff is moved to a nearest ocean/land boundary point on the new grid. Note that the source runoff dataset must be on a spherical latitude-longitude grid, whereas the target/destination grid can be spherical or tripolar. The regridding algorithm is conservative.
The conservative regridding scheme used in runoff_regrid is an area average scheme, which is similiar to the algorithm used in coupler flux exchange. If any land point has runoff data, after remapping runoff data onto destination grid, the runoff value of that land point will be moved to the nearest ocean point. Before using this tool, you must use make_xgrids to generate exchange grid information between the source grid and destination grid. The complete descritpion can be found in runoff_regrid.html.
There are two ways to specify surface boundary fluxes when using the coupler feature of FMS. One is through flux exchange, and this employs a conservative algorithm as appropriate for running a coupled ocean-atmosphere model. It is assumed that the atmospheric model grid is spherical with arbitrary resolution. The other method is through data override, and this uses a non-conservative scheme. Data override is of use to selectively remove, say, one of the fluxes coming from an atmospheric model and replace this flux with that from data. GFDL modelers have found this feature to be very useful in diagnosing problems with a coupled model.
When generating realistic initial conditions for an ocean experiment, one generally requires the gridding of temperature and salinity, such as from the Levitus analysis product, onto the model's grid. For this purpose, we are in need of vertical grid information in addition to horizontal 2d information required for the surface boundary conditions. Hence, we use the preprocessing/regrid_3d. A similar procedure is required to develop sponge data.
The original data must be on a spherical grid in order to use regrid_3d. If the original data is on a tripolar grid, we should use preprocessing/regrid, which can map data from any logical rectangular grid onto any logical rectangular grid.
For preprocessing/regrid_3d, preprocessing/regrid_2d and preprocessing/regrid, regridding is accomplished non-conservatively using a nearest neighbor distance weighting algorithm, or bilinear interpolation. The interpolation algorithm is controlled through the namelist option "interp_method".
Bilinear interpolation is recommanded for most cases since it provides a smooth interpolation when regridding from coarse grid to fine grid (the usual situation with model destination grids typically having resolution more refined than source data products), and it is more efficient. Efficiency can become a particularly important issue when developing initial and boundary conditions for a refined resolution model.
If the original data is on a tripolar grid, nearest neighbor distance weighting interpolation found in preprocessing/regrid must be used, since bilinear interpolation assumes the original data is on a latitude-longitude grid. For preprocessing/regrid_2d, preprocessing/regrid_3d and preprocessing/regrid using the nearest neighbor distance weighting algorithm, a maximum distance (in radians) can be selected using the namelist value max_dist. Namelist option "num_nbrs" can be adjusted for speed, although for most applications this refinement is not necessary.
The complete namelist description for these algorithms can be found in regrid_2d.html, regrid_3d.html and regrid.html.
When the input data is on a latitude-longitude grid, preprocessing/regrid_2d and preprocessing/regrid_3d can be used.
When the input data is on a tripolar grid or a latitude-longitude grid, postprocessing/regrid can be used.
For sponge generation, acceptable input data sets must have NetCDF format with COARDS-compliance.
For technical reasons, the code used to create idealized boundary conditions in the preprocessing directory does not specify a calendar attribute. It is therefore up to the user to do so via a netcdf utility applied to the resulting netcdf file. For example, when creating idealized cosine wind stress, one needs to specify a calendar, such as a 365 day (noleap) year, using the following command
ncatted -h -a calendar_type,TIME,c,c,'NOLEAP' tau.ncIn future versions of the preprocessing code, we will provide namelist options for adding the calendar. For now, the user must provide this information using the above method with netcdf commands.
For many analysis applications, it is sufficient, and often preferable, to have output on the model's native grid (i.e., the grid used to run the simulation). Accurate computation of budgets, for example, must be done on the model's native grid, preferably online during integration. MOM4 provides numerous online diagnostics for this purpose.
Many applications, such as model comparison projects, require results on a common latitude-longitude spherical grid. Such facilitates the development of difference maps. For this purpose, we have developed a tool to regrid scalar and vector fields from a tripolar grid to a spherical grid. In principle, this tool can be used to regrid any logically rectangular gridded field onto a spherical grid. However, applications at GFDL have been limited to the tripolar to spherical regrid case.
In general, regridding is a difficult task to perform accurately and without producing noise or spurious results. The user should carefully examine regridding results for their physical integrity. Problems occur, in particular, with fields near mom4's partial bottom step topography in the presence of realistic topography and land/sea geometry. Indeed, we were unable to find a simple algorithm to handle regridding in the vertical that did not produce egregious levels of noise. Hence, the regridding tool provided with mom4 only handles horizontal regridding. The regridded data will thus be on the source vertical grid.
Model comparisons should ideally be performed only after regridding output using the same regridding algorithm. Unfortunately, such is not generally the case since there is no standard regridding algorithm used in the modeling community.
Please note that the regridding code is relatively new at GFDL. We greatly appreciate user's feedback.
The regridding algorithm provided with the mom4 distribution is located in the directory postprocessing/regrid
The algorithm accepts data from any logically rectangular grid (e.g., tripolar or latitude-longitude) and regrids to a spherical latitude-longitude grid. When the data is on the tracer cell (T-cell), the regridding interpolation is conservative. Thus, total heat, salt, and passive tracer remain the same on the two grids. However, when data is located at another position:
then regridding is accomplished non-conservatively using a nearest neighbor distance weighting algorithm. It is for this reason that compuationally accurate results are only available when working on the model's native grids.
The regridding tool reads grids information from a netcdf file, specified by the namelist "grid_spec_file". "grid_spec_file" contains source grid, destination grid and exchange grid information.
To create the exchange grid, execute the command
make_xgrids -o src_grid.nc -a dst_grid.nc
The exchange grid creates a file grid_spec.nc. It has new fields with names:
AREA_ATMxOCN, DI_ATMxOCN, DJ_ATMxOCN, I_ATM_ATMxOCN, J_ATM_ATMxOCN, I_OCN_ATMxOCN, J_OCN_ATMxOCN, AREA_ATMxLND, DI_ATMxLND, DJ_ATMxLND, I_ATM_ATMxLND, J_ATM_ATMxLND, I_LND_ATMxLND, J_LND_ATMxLND, AREA_LNDxOCN, DI_LNDxOCN, DJ_LNDxOCN, I_LND_LNDxOCN, J_LND_LNDxOCN, I_OCN_LNDxOCN, J_OCN_LNDxOCN, xba, yba, xta, yta, AREA_ATM, xbl, ybl, xtl, ytl, AREA_LND, AREA_LND_CELL, xto, yto, AREA_OCN
It is critical that src_grid.nc DO NOT already have any of the above new exchange grid fields. If they do, then these fields should be removed using netcdf tools such as ncks.
After the grid_spec.nc file is generated, it is passed into the regrid program through the nml option "grid_spec_file".
The regrid program reads model data from a netcdf file, which is specfied by the namelist variable "src_data". Again, src_data fields are gridded according to src_grid.nc. The number of fields to be regridded is specified by num_flds. The name of the fields (e.g., temp, salt) to be regridded is specified by the namelist variable "fld_name". Each field can be a scalar or vector. If a vector, then specify by vector_fld. Vector fields should always be paired together (e.g., u,v components to the horizontal current). The output file is a netcdf file specified by the namelist variable "dst_data".
The complete namelist option description is available in regrid.html or the code itself.
A runscript is provided in each test case directory (mom4/exp/$test_case ) for each test case. Details can be found in quickstart_guide.html.
Incorporated in the FMS infrastructure is MPP (Massively Parallel Processing), which provides a uniform message-passing API interface to the different message-passing libraries. If MPICH is installed, the user can compile the MOM4 source code with MPI. If the user does not have MPICH or the communications library, the MOM4 source code can be compiled without MPI by omitting the CPPFLAGS value -Duse_libMPI in the example runscript.
The diagnostics table allows users to specify the sampling rates and choose the output fields prior to executing the MOM4 source code. It is included in the input directory for each test case (mom4/exp/$test_case/input). A portion of a sample MOM4 diagnostic table is displayed below. Reference diag_manager.html for detailed information on the use of diag_manager.
"Diagnostics for MOM4 test case" 1980 1 1 0 0 0 #output files "ocean_month",1,"months",1,"hours","Time" "ocean_snap",1,"days",1,"hours","Time" #####diagnostic field entries#### #=============================================================== # ocean model grid quantities (static fields and so not time averaged)) "ocean_model","geolon_t","geolon_t","ocean_month" "all",.false.,"none",2 "ocean_model","geolat_t","geolat_t","ocean_month","all",.false.,"none",2 #================================================================ # prognostic fields "ocean_model","temp","temp","ocean_month","all", "max", "none",2 "ocean_model","age_global","age_global","ocean_month","all","min","none",2 #================================================================ # diagnosing tracer transport "ocean_model","temp_xflux_sigma","temp_xflux_sigma","ocean_month","all",.true.,"none",2 "ocean_model","temp_yflux_sigma","temp_yflux_sigma","ocean_month","all",.true.,"none",2 #================================================================ # surface forcing "ocean_model","sfc_hflux","sfc_hflux","ocean_month","all",.true.,"none",2 "ocean_model","sfc_hflux_adj","sfc_hflux_adj","ocean_month","all",.true.,"none",2 #================================================================ # ice model fields "ice_model", "FRAZIL", "FRAZIL", "ice_month", "all", .true., "none", 2, "ice_model", "HI", "HI", "ice_month", "all", .true., "none", 2 #-----------------------------------------------------------------
The diagnostics manager module, diag_manager_mod, is a set of simple calls for parallel diagnostics on distributed systems. It provides a convenient set of interfaces for writing data to disk in NetCDF format. The diagnostics manager is packaged with the MOM4 source code. The FMS diagnostic manager can handle scalar fields as well as arrays. For more information on the diagnostics manager, reference diag_manager.html.
The MOM4 field table is used to specify tracers and their advection schemes, cross-land tracer mixing, cross-land insertion, and other options. The field table is included in the runscript as a namelist and is written to an output file upon execution of the runscript.
"diag_tracers","ocean_mod","frazil" file_in = INPUT/ocean_frazil.res.nc file_out = RESTART/ocean_frazil.res.nc /
"prog_tracers","ocean_mod","temp" horizontal-advection-scheme = quicker vertical-advection-scheme = quicker file_in = INPUT/ocean_temp_salt.res.nc file_out = RESTART/ocean_temp_salt.res.nc /
"prog_tracers","ocean_mod","salt" horizontal-advection-scheme = mdfl_sweby vertical-advection-scheme = mdfl_sweby file_in = INPUT/ocean_temp_salt.res.nc file_out = RESTART/ocean_temp_salt.res.nc /
"tracer_packages","ocean_mod","ocean_age_tracer" names = global horizontal-advection-scheme = mdfl_sweby vertical-advection-scheme = mdfl_sweby file_in = INPUT/ocean_age.res.nc file_out = RESTART/ocean_age.res.nc min_tracer_limit=0.0 /
"namelists","ocean_mod","ocean_age_tracer/global" slat = -90.0 nlat = 90.0 wlon = 0.0 elon = 360.0 /
"xland_mix","ocean_mod","xland_mix" "xland","Gibraltar","ixland_1=274,ixland_2=276,jxland_1=146,jxland_2=146,kxland_1=1,kxland_2=28,vxland=0.55e6" "xland","Gibraltar","ixland_1=274,ixland_2=276,jxland_1=147,jxland_2=147,kxland_1=1,kxland_2=28,vxland=0.55e6" "xland","Black-Med","ixland_1=305,ixland_2=309,jxland_1=151,jxland_2=152,kxland_1=1,kxland_2=6,vxland=0.01e6" "xland","Black-Med","ixland_1=306,ixland_2=309,jxland_1=151,jxland_2=153,kxland_1=1,kxland_2=6,vxland=0.01e6"/ "xland_insert","ocean_mod","xland_insert" "xland","Gibraltar","ixland_1=274,ixland_2=276,jxland_1=146,jxland_2=146,kxland_1=1,kxland_2=18,tauxland=86400.0" "xland","Gibraltar","ixland_1=274,ixland_2=276,jxland_1=147,jxland_2=147,kxland_1=1,kxland_2=18,tauxland=86400.0" "xland","Black-Med","ixland_1=305,ixland_2=309,jxland_1=151,jxland_2=152,kxland_1=1,kxland_2=6,tauxland=86400.0" "xland","Black-Med","ixland_1=306,ixland_2=309,jxland_1=151,jxland_2=153,kxland_1=1,kxland_2=6,tauxland=86400.0"/ "diff_cbt_enhance","ocean_mod","diff_cbt_enhance" "diffcbt","Gibraltar","itable=274,jtable=146,ktable_1=1,ktable_2=18,diff_cbt_table=0.01" "diffcbt","Gibraltar","itable=276,jtable=146,ktable_1=1,ktable_2=18,diff_cbt_table=0.01" "diffcbt","Gibraltar","itable=274,jtable=147,ktable_1=1,ktable_2=18,diff_cbt_table=0.01" "diffcbt","Gibraltar","itable=276,jtable=147,ktable_1=1,ktable_2=18,diff_cbt_table=0.01" "diffcbt","Black-Med","itable=305,jtable=151,ktable_1=1,ktable_2=6,diff_cbt_table=0.01" "diffcbt","Black-Med","itable=309,jtable=152,ktable_1=1,ktable_2=6,diff_cbt_table=0.01" "diffcbt","Black-Med","itable=306,jtable=151,ktable_1=1,ktable_2=6,diff_cbt_table=0.01" "diffcbt","Black-Med","itable=309,jtable=153,ktable_1=1,ktable_2=6,diff_cbt_table=0.01"/
In the first section of the field table, the user can specify tracers to be used in the simulation. Although there is no limit to the number of tracers specified, temperature (temp) and salinity (salt) must be included. The user may also define the horizontal and vertical tracer advection schemes. For more information on the field manager, reference field_manager.html.
In climate modeling, it is often necessary to allow water masses that are separated by land to exchange tracer and surface height properties. This situation arises in models when the grid mesh is too coarse to resolve narrow passageways that in reality provide crucial connections between water masses. The cross-land mixing and cross-land insertion establishes communication between bodies of water separated by land. The communication consists of mixing tracers and volume between non-adjacent water columns. Momentum is not mixed. The scheme conserves total tracer content, total volume, and maintains compatibility between the tracer and volume budgets. The grid points where this exchange takes place, and the rates of the exchange, are specified in the field table.
For some cases, it is necessary to set a large vertical tracer diffusivity at a specified point in the model, say next to a river mouth to ensure fresh water is mixed vertically. These diffusivities are specified in the field table.
For a technical description of cross-land tracer mixing and insertion, please reference A Technical Guide to MOM4.
Running the MOM4 source code in a parallel processing environment will produce one output NetCDF diagnostic file per processor. mppnccombine joins together an arbitrary number of data files containing chunks of a decomposed domain into a unified NetCDF file. If the user is running the source code on one processor, the domain is not decomposed and there is only one data file. mppnccombine will still copy the full contents of the data file, but this is inefficient and mppnccombine should not be used in this case. Executing mppnccombine is automated through the runscripts. The data files are NetCDF format for now, but IEEE binary may be supported in the future.
mppnccombine requires decomposed dimensions in each file to have a domain_decomposition attribute. This attribute contains four integer values: starting value of the entire non-decomposed dimension range (usually 1), ending value of the entire non-decomposed dimension range, starting value of the current chunk's dimension range and ending value of the current chunk's dimension range. mppnccombine also requires that each file have a NumFilesInSet global attribute which contains a single integer value representing the total number of chunks (i.e., files) to combine.
The syntax of mppnccombine is:
mppnccombine [-v] [-a] [-r] output.nc [input ...]
Table 1. mppnccombine arguments
-v | print some progress information |
-a | append to an existing NetCDF file |
-r | remove the '.####' decomposed files after a successful\ run |
An output file must be specified and it is assumed to be the first filename argument. If the output file already exists, then it will not be modified unless the option is chosen to append to it. If no input files are specified, their names will be based on the name of the output file plus the extensions '.0000', '.0001', etc. If input files are specified, they are assumed to be absolute filenames. A value of 0 is returned if execution is completed successfully and a value of 1 indicates otherwise.
The source of mppnccombine is packaged with the MOM4 module in the postprocessing directory. mppnccombine.c should be compiled on the platform where the user intends to run the FMS MOM4 source code so the runscript can call it. A C compiler and NetCDF library are required for compiling mppnccombine.c:
cc -O -o mppnccombine -I/usr/local/include -L/usr/local/lib mppnccombine.c -lnetcdf
Sample MOM4 model output data files are available to registered MOM4 users on GFDL's NOMADS server. The output data are organized into directories that bear the same names as the test cases . For example, output for test case test5 can be found in directory test5. Output files are classified into three subdirectories:
Note that these output files are compressed using tar. All .tar files should be decompressed for viewing. The decompress command is:
tar -xvf filename.tar
There are several graphical packages available to display the model output. These packages vary widely depending on factors, such as the number of dimensions, the amount and complexity of options available and the output data format. The data will first have to be put into a common format that all the packages can read. FMS requires the data to be stored in NetCDF format since it is so widely supported for scientific visualization. The graphical package is also dependent upon the computing environment. For ocean modeling, ncview, Ferret and GrADS are most commonly used.
An often frustrating aspect of numerical modeling is getting the computational environment set up so the model compiles, executes, completes, and saves data in a smooth and dependable manner. There are numerous platform configurations, compiler variations, data storage capabilities, and experimental designs that make it likely that each user will encounter unique issues.
At GFDL, we try to develop code that is portable and readily usable on many platforms. Nonetheless, given the multitude of configurations, we cannot anticipate all problems. So users should expect to spend some time setting up the model's computational environment when downloading the code for the first time.
We rely on users within the mom4 community to provide feedback regarding how they got the model to run on their respective platforms. We greatly appreciate when users send their "progress report" to the mom4 email list. We solicit information on issues that may make future releases less problematic. We also appreciate your detailed documentation that may approach "hand holding" to better allow new users to successfully run the model. Indeed, imagine being a fresh graduate student or postdoc, only just recently learning Unix and Fortran, aiming to download and run mom4 on their PC! The more experienced users share knowledge in a digested and organized manner, the easier it will be for others to realize success with the code.
The purpose of this section is to organize some of the many emails that have been sent to the mom4 email list that focus on computational platform issues. Given limited resources and limited access to platforms outside GFDL, we have not edited these emails. Users who wish to update or edit information provided in an earlier email please feel free to do so.
NOTE: Some platform related problems may have already been solved in the latest release. Please check the section "Code Updates" for release note of each release.
Compiler warning in mpp_domains_comm.F90 https://fms.gfdl.noaa.gov/mail/majordomo/archive.php?group_id=5&list_id=7&message_id=00673 https://fms.gfdl.noaa.gov/mail/majordomo/archive.php?group_id=5&list_id=7&message_id=00675 https://fms.gfdl.noaa.gov/mail/majordomo/archive.php?group_id=5&list_id=7&message_id=00676 https://fms.gfdl.noaa.gov/mail/majordomo/archive.php?group_id=5&list_id=7&message_id=00678 https://fms.gfdl.noaa.gov/mail/majordomo/archive.php?group_id=5&list_id=7&message_id=00705 https://fms.gfdl.noaa.gov/mail/majordomo/archive.php?group_id=5&list_id=7&message_id=00706
Mom4p0c run on PGI5.2-4 https://fms.gfdl.noaa.gov/mail/majordomo/archive.php?group_id=5&list_id=7&message_id=00619 https://fms.gfdl.noaa.gov/mail/majordomo/archive.php?group_id=5&list_id=7&message_id=00633
Running mom4 on a Sun v60x (intel Xeon) cluster https://fms.gfdl.noaa.gov/mail/majordomo/archive.php?group_id=5&list_id=7&message_id=00604
MOM4p0 Length of error messages on NEC SX platforms https://fms.gfdl.noaa.gov/mail/majordomo/archive.php?group_id=5&list_id=7&message_id=00668
MOM4 is an evolving code. As features are added or removed, bugs are resolved, and documentation clarified, we aim to provide the user community with access to our latest code used in-house at GFDL. The purpose of this section is to summarize the main features of each model version.
For new users, please download the most recent release. For those having used mom4 for sometime, your need to update should be based on a balance between accessing new features or bug fixes versus the overhead needed to update your respective model experiments. It is recommended that you access new versions of mom4 only after completion of a particular line of research, rather than updating in the middle. Notably, we do not ensure that each update is fully backwards compatible.
This is a list of files modified in March/April 2004 for the MOM4p0b release of MOM4.
shared/exchange/xgrid.f90: | Minor edits to make the code compliant with IFC version 8. |
ice_param/ocean_albedo.f90: | Minor edits to make the code compliant with IFC version 8. |
shared/column_diagnostics/column_diagnostics.f90: | Minor edits to make the code compliant with IFC version 8. |
shared/horiz_interp/horiz_interp.f90: | Change the step size of radial search from 1 to 100. This will improve the efficiency and a workaround to fix a bug. |
preprocessing/generate_grids/ocean/topog.f90: | Modify io format to fix one error message. |
preprocessing/generate_grids/ocean/ocean_grid_generator.csh: | Minor comments update |
shared/mpp/mpp_io.F90: | Added optional argument "time_method" to write_meta_field subroutine. This is used by diag_manager to document how a diagnostic is manipulated along the time axis, e.g. averaging, max, min. The metadata used are compliant with CF1.0 metadata standard. |
shared/mpp/mpp_read_2Ddecomp.h: | Bug fix for lenx and leny variables |
shared/diag_manager: | In addition to time average now users can have min, max in the same time period. |
coupler/coupler_main.f90: | Replace constant number 2 with parameter variable FATAL in error message. |
drivers/ocean_solo.F90: | Remove redundant mpp_clock for Ocean. |
postprocessing/regrid: | using netcdf library to read and write data, instead of using mpp_io_mod. Added vertical interpolation. Add namelist do_laplace_extrap to improve efficiency when doing vertical interpolation. |
ocean_core/ocean_domains.F90: | Added (len=*) for variable name in subroutine set_ocean_domain. |
ocean_core/ocean_velocity_advect.F90: | Corrected bug identified by Pacanowski. For bottom partial cells with k=nk, the vertical advection of horizontal velocity was a factor of 2 too large. A mask has been added to correct this bug. |
ocean_core/ocean_grids.F90: | Send to diagnostics for area_u had id_area_t in send_data, trivial bug. |
ocean_core/ocean_topog.F90: | Added nml for flat_bottom for use in helping to debug problems related to bottom topography. |
ocean_core/ocean_freesurf.F90: | Added nml option to have eta_t = 0.0 at the initial condition. This is useful when have restart files that have nonzero eta, and wish to debug without changing the restart files. Added nml option check_volume_conserve for debugging purposes. |
ocean_param/mixing/vert/kpp/ocean_vert_mix_coeff.F90: | Removed the tidal_mix option as this remains a topic of research. |
ocean_param/mixing/neutral/ocean_neutral_physics.F90: | Unified the calculation of the surface boundary layer. Now include information about the KPP boundary layer in the computation of the "neutral physics boundary layer". |
ocean_tracers/ocmip2_biotic.F90: | Corrected bug identified by John Dunne. Bug fix necessary to keep model from bombing. |
ocean_param/sources/sponge/ocean_sponges.F90: | Removed code that inverted the input sponge coefficients. The input sponge_coeff NetCDF file should now give these coefficients in inverse seconds, rather than in seconds. Reasoning: (1) matches the documentation; (2) more intuitively linked to the name "sponge_coeff," with a large coeff implying a strong sponge; and (3) allows tapering of sponge coefficients to exactly zero. |
shared/mpp_domains.F90: | Bug fix for C grid case, does not affect MOM4 since MOM4 runs on B grid. |
shared/mpp_update_domains2D.h: | Bug fix for C grid case, does not affect MOM4 since MOM4 runs on B grid. |
The following lists some new features of the MOM4p0c release in August 2004.
![]() |
Warning |
---|---|
|
New or modified algorithms available in MOM4p0c
Corrected algorithms in MOM4p0c
New features of the FMS infrastructure
The following lists some new features of the MOM4p0d release in May 2005.
mom4 code
ocean_param/mixing/horz/velocity/bih/general/ocean_bih_friction.F90
- bug fix for biharmonic general friction in computation of the viscosity will CHANGE answer in test2ocean_core/ocean_obc.f90
- OBC now runs with static memory allocationocean_core/ocean_freesurf.F90
- always initialize the tidal forcing, as tidal_forcing_init allocates some arrays which are used with the dynamical allocation model.mom4/ocean_core/ocean_grids.F90
- add namelist option beta_plane and f_plane in ocean_grids_nml. With default value false.- fix bug that some diagnostics data axis is not in correct location.
mom4/ocean_core/ocean_tracer.F90
- fix the +0 and -0 restart reproducing problem for frazil in SGI/Irix.ocean_diag/ocean_tracer_diag.F90
ocean_diag/ocean_velocity_diag.F90
mom4/ocean_param/sources/overflow/ocean_overflow.F90
- add namelist do_bitwise_exact_sum to the diagnostic module. Set true to do bitwise exact global sum. When it is false, the global sum will be non-bitwise-exact, but will significantly increase efficiency. The default value is false.
ocean_core/ocean_types.F90
- convert pointer to allocatable array components in data type to improve effieciency on Altix machine when running in dynamic case.ocean_param/mixing/neutral/ocean_neutral_physics.F90
- removed unnecessary memory allocation when neutral physics is not used.- fixed incorrect index.
- corrected update_domain for ustar and vstar, will not change answer, only affect diagnosticsocean_diag/ocean_tracer_util.F90
ocean_diag/ocean_adv_vel_diag.F90
- added Fortran intrinsic functions "maxloc" and "minloc" in a new algorithm for computing tracer_min_max and/or maximum CFL number. These intrinsic functions allow for more vectorized algorithms, so should see some efficiency improvement especially on vector machines.-added "if(nspread==0) return" in spread_river_horz routine. Change the interface of spread_river_horz routine to avoid a possible aliasing.
Compatible with the interface change of routine spread_river_horz in ocean_riverspread.f90.
mom4/ocean_param/sources/shortwave/ocean_shortwave_pen.F90 mom4/ocean_param/sources/xlandinsert/ocean_xlandinsert.f90 mom4/ocean_param/sources/xlandmix/ocean_xlandmix.f90 mom4/ocean_param/mixing/polarfilter/ocean_polar_filter.f90 mom4/ocean_param/mixing/sigma/ocean_sigma_diffuse.F90 mom4/ocean_param/mixing/horz/tracer/bih/ocean_horz_diffuse.f90 mom4/ocean_param/mixing/horz/tracer/lap/ocean_horz_diffuse.f90 mom4/ocean_param/mixing/horz/velocity/bih/const/ocean_bih_friction.f90 mom4/ocean_param/mixing/horz/velocity/bih/general/ocean_bih_friction.F90 mom4/ocean_param/mixing/horz/velocity/lap/const/ocean_lap_friction.f90 mom4/ocean_param/mixing/horz/velocity/lap/general/ocean_lap_friction.F90 mom4/ocean_param/mixing/vert/ocean_vert_mix.f90 mom4/ocean_param/mixing/vert/kpp/ocean_vert_mix_coeff.F90- removed unnecessary memory allocation if the corresponding module's namelist is false
shared code
shared/diag_manager/diag_manager.f90
- add standard_name to output fields.
- eliminate the need to pass Time to send_data for static fields
- add code that writes the meta data associated with register fields to an ascii file called "diag_field_log.out".
shared/mpp/mpp_parameter.F90 and shared/mpp/mpp_domains_comm.F90
-use Z instead of X for hexadecimal datashared/axis_utils/axis_utils.F90
add a test program test_axis_utils. Remove unnecessary input grid to avoid bad data in the input data. It shouldn't change solution for any present experiments.shared/time_interp/time_interp_external.F90
Include filename/fieldname in error message of init_external_field.shared/mpp/mpp_io_util.F90
bugfix in subroutine mpp_get_axes().shared/horiz_interp/horiz_interp_spherical.f90
add a namelist "search_method" to horiz_interp_spherical_nml. The reason is that the radial search may be not quite accurate in some cases. In this situation, you can always set search_method to "full_search", which will be always accurate but less efficiency comparing to "radial_search". "radial_search" is the default value. In most cases, "radial_search" and "full_search" will produce same results other than order of operation. With "radial_search", it is important to choose suitable max_dist (an optional argument in horiz_interp_spherical_init).shared/mpp/mpp_io_read.F90
change to fix some possible +0/-0 restart problem.bin/mkmf, bin/mkmf.template.ibm
update for IBM platform
coupler/flux_exchange.f90
- By default, the global exchange grid u_star will not be interpolated from atmospheric grid. This is different from mom4p0c behavior and will change answers. To reproduce old answers, use
&flux_exchange_nml ex_u_star_smooth_bug = .true.
preprocessing
preprocessing/mom4_prep/idealized_ic/idealized_ic.f90
-change the attribute cartesian_axis of zt from "z" to "Z".preprocessing/mom4_prep/idealized_bc/idealized_bc.f90
-fix the bug that variable yu1 is not initialized for option cosine_winds.preprocessing/generate_grids/make_xgrids/make_xgrids.c
- remove the hardwired path to netcdf.h and update the compiling command- change the default value of nml interp_method from "spherical" to "bilinear". Some code clean-up.
This tools is based on postprocessing/regrid. It can regrid data from 2-D/3-D logical rectangular grid onto logical rectangular grid. The interpolation will be non-conservative. Some tests shown that both forcing data sets of mom4 test case restart files from mom4 test run and can be used as input source data for regridding. There is , however, no guarantee for all the situations.
Some adjustments e.g. laplacian extrapolation will be done only when it is needed.
Replace nanmelist do_vertical_interp with use_source_vertical_grid. When use_source_vertical_grid is true, no vertical interpolation will be done. Otherwise vertical interpolation will be done if the source and destination grid have different vertical grid. Replace apply_dest_mask with apply_mask to add the option to allow source data mask to determine destination data mask. Redesign the code to decrease the memory usage.
Redesign this regrid tool. Change the interpolation algorithm for tracer field. Tracer field will be remapped using conservative scheme. The regridding will be limited from any logical rectangular grid (tripolar of latitude-longitude grid) to any latitude-longitude grid. Removed namelist do_vertical_interp. This tool will not do vertical interpolation. The reason is that the linear vertical interpolation will create some unwanted noises.