MOM_io module reference

This module contains I/O framework code

Data Types

axis_info

Type that stores information that can be used to create a non-decomposed axis.

vardesc

Type for describing a 3-d variable for output

attribute_info

Type that stores for a global file attribute

Generic Interfaces

MOM_read_data

Read a field from file using the infrastructure I/O.

MOM_read_vector

Read a vector from file using the infrastructure I/O.

read_netCDF_data

Read a field using native netCDF I/O

MOM_write_field

Write a registered field to an output file, potentially with rotation

read_variable

Read an entire named variable from a named netCDF file using netCDF calls directly, rather than any infrastructure routines and broadcast it from the root PE to the other PEs.

read_attribute

Read a global or variable attribute from a named netCDF file using netCDF calls directly, in some cases reading from the root PE before broadcasting to the other PEs.

Functions/Subroutines

create_file

create_MOM_file wrapper for the legacy file handle, file_type. NOTE: This function may be removed in a future release.

create_MOM_file

Create a new netCDF file and register the MOM_fields to be written.

reopen_file

reopen_MOM_file wrapper for the legacy file handle, file_type. NOTE: This function may be removed in a future release.

reopen_MOM_file

This routine opens an existing NetCDF file for output. If it does not find the file, a new file is created. It also sets up structures that describe this file and the variables that will later be written to this file.

stdout_if_root

Return the index of sdtout if called from the root PE, or 0 for other PEs.

num_timelevels

This function determines how many time levels a variable has in a file.

get_var_sizes

get_var_sizes returns the number and size of dimensions associate with a variable in a file. Usually only the root PE does the read, and then the information is broadcast

read_var_sizes

read_var_sizes returns the number and size of dimensions associated with a variable in a file. If the variable is not in the file the returned sizes are all 0 and ndims is -1. Every processor for which this is called does the reading.

read_variable_0d

Read a real scalar variable from a netCDF file with the root PE, and broadcast the results to all the other PEs.

read_variable_1d

Read a 1-d real variable from a netCDF file with the root PE, and broadcast the results to all the other PEs.

read_variable_0d_int

Read a integer scalar variable from a netCDF file with the root PE, and broadcast the results to all the other PEs.

read_variable_1d_int

Read a 1-d integer variable from a netCDF file with the root PE, and broadcast the results to all the other PEs.

read_variable_2d

Read a 2d array from a netCDF input file and save to a variable.

read_variable_3d

read_attribute_str

Read a character-string global or variable attribute

read_attribute_int32

Read a 32-bit integer global or variable attribute

read_attribute_int64

Read a 64-bit integer global or variable attribute

read_attribute_real

Read a real global or variable attribute

open_file_to_read

Open a netcdf file for reading, with error handling

close_file_to_read

Close a netcdf file that had been opened for reading, with error handling

get_varid

get_varid finds the netcdf handle for the potentially case-insensitive variable name in a file

verify_variable_units

Verify that a file contains a named variable with the expected units.

var_desc

Returns a vardesc type whose elements have been filled with the provided fields. The argument name is required, while the others are optional and have default values that are empty strings or are appropriate for a 3-d tracer field at the tracer cell centers.

modify_vardesc

This routine modifies the named elements of a vardesc type. All arguments are optional, except the vardesc type to be modified.

position_from_horgrid

set_axis_info

Store information that can be used to create an axis in a subsequent call to create_file.

delete_axis_info

Delete the information in an array of axis_info types and deallocate memory in them.

get_axis_info

Retrieve the information from an axis_info type.

set_attribute_info

Store information that can be used to create an attribute in a subsequent call to create_file.

delete_attribute_info

Delete the information in an array of attribute_info types and deallocate memory in them.

cmor_long_std

This function returns the CMOR standard name given a CMOR longname, based on the standard pattern of character conversions.

query_vardesc

This routine queries vardesc

MOM_read_data_0d

Read a scalar from file using infrastructure I/O.

MOM_read_data_0d_int

Read a scalar integer from file using infrastructure I/O.

MOM_read_data_1d

Read a 1d array from file using infrastructure I/O.

MOM_read_data_1d_int

Read a 1d integer array from file using infrastructure I/O.

MOM_read_data_2d

Read a 2d array from file using infrastructure I/O.

read_netCDF_data_2d

Read a 2d array (which might have halos) from a file using native netCDF I/O.

MOM_read_data_2d_region

Read a 2d region array from file using infrastructure I/O.

MOM_read_data_3d

Read a 3d array from file using infrastructure I/O.

MOM_read_data_3d_region

Read a 3d region array from file using infrastructure I/O.

MOM_read_data_4d

Read a 4d array from file using infrastructure I/O.

MOM_read_vector_2d

Read a 2d vector tuple from file using infrastructure I/O.

MOM_read_vector_3d

Read a 3d vector tuple from file using infrastructure I/O.

MOM_write_field_legacy_4d

Write a 4d field to an output file, potentially with rotation

MOM_write_field_legacy_3d

Write a 3d field to an output file, potentially with rotation

MOM_write_field_legacy_2d

Write a 2d field to an output file, potentially with rotation

MOM_write_field_legacy_1d

Write a 1d field to an output file

MOM_write_field_legacy_0d

Write a 0d field to an output file

MOM_write_field_4d

Write a 4d field to an output file, potentially with rotation

MOM_write_field_3d

Write a 3d field to an output file, potentially with rotation

MOM_write_field_2d

Write a 2d field to an output file, potentially with rotation

MOM_write_field_1d

Write a 1d field to an output file

MOM_write_field_0d

Write a 0d field to an output file

insert_ensemble_appendix

Insert the ensemble appendix into a filename. If provided, the appendix is inserted after the last occurrence of the insert_after substring in the filename.

field_size

Given filename and fieldname, this subroutine returns the size of the field in the file

safe_string_copy

Copies a string

ensembler

Returns a name with "%#E" or "%E" replaced with the ensemble member number.

get_filename_appendix

Provide a string to append to filenames, to differentiate ensemble members, for example.

write_version_number

Write a file version number to the log file or other output file

open_namelist_file

Open a single namelist file that is potentially readable by all PEs.

check_nml_error

Checks the iostat argument that is returned after reading a namelist variable and writes a message if there is an error.

MOM_io_init

Initialize the MOM_io module

get_var_axes_info

Returns the dimension variable information for a netCDF variable

Detailed Description

This file contains a number of subroutines that manipulate NetCDF files and handle input and output of fields. These subroutines, along with their purpose, are:

  • create_file: create a new file and set up structures that are needed for subsequent output and write out the coordinates.

  • reopen_file: reopen an existing file for writing and set up structures that are needed for subsequent output.

  • open_input_file: open the indicated file for reading only.

  • close_file: close an open file.

  • synch_file: flush the buffers, completing all pending output.

  • write_field: write a field to an open file.

  • write_time: write a value of the time axis to an open file.

  • read_data: read a variable from an open file.

  • read_time: read a time from an open file.

  • name_output_file: provide a name for an output file based on a name root and the time of the output.

  • find_input_file: find a file that has been previously written by MOM and named by name_output_file and open it for reading.

  • handle_error: write an error code and quit.

Type Documentation

type :: axis_info

Type that stores information that can be used to create a non-decomposed axis.

Parameters
  • name

    The name of this axis for use in files

  • longname

    A longer name describing this axis

  • units

    The units of the axis labels

  • cartesian

    A variable indicating which direction this axis corresponds with. Valid values include 'X', 'Y', 'Z', 'T', and 'N' for none.

  • sense

    This is 1 for axes whose values increase upward, or -1 if they increase downward. The default, 0, is ignored.

  • ax_size

    The number of elements in this axis

  • ax_data

    The values of the data on the axis [arbitrary]

type, public :: vardesc

Type for describing a 3-d variable for output

Parameters
  • name

    Variable name in a NetCDF file

  • units

    Physical dimensions of the variable

  • longname

    Long name of the variable

  • hor_grid

    Horizontal grid: u, v, h, q, Cu, Cv, T, Bu, or 1

  • z_grid

    Vertical grid: L, i, or 1

  • t_grid

    Time description: s, p, or 1

  • cmor_field_name

    CMOR name

  • cmor_units

    CMOR physical dimensions of the variable

  • cmor_longname

    CMOR long name of the variable

  • conversion

    for unit conversions, such as needed to convert from intensive to extensive [various] or [a A-1 ~> 1] to undo internal dimensional rescaling

  • dim_names

    The names in the file of the axes for this variable

  • position

    An integer encoding the horizontal position, it may CENTER, CORNER, EAST_FACE, NORTH_FACE, or 0.

  • extra_axes

    dimensions other than space-time

type :: attribute_info

Type that stores for a global file attribute

Parameters
  • name

    The name of this attribute

  • att_val

    The values of this attribute

Generic Interface Documentation

interface MOM_read_data

Read a field from file using the infrastructure I/O.

Callers call graph
Callers of mom_io::interface::mom_read_data calls cluster_dome_tracer DOME_tracer cluster_dyed_obc_tracer dyed_obc_tracer cluster_ideal_age_example ideal_age_example cluster_isomip_initialization ISOMIP_initialization cluster_isomip_tracer ISOMIP_tracer cluster_marbl_tracers MARBL_tracers cluster_meso_surface_forcing MESO_surface_forcing cluster_mom_ann MOM_ANN cluster_mom_barotropic MOM_barotropic cluster_mom_cfc_cap MOM_CFC_cap cluster_mom_coord_initialization MOM_coord_initialization cluster_mom_geothermal MOM_geothermal cluster_mom_grid_initialize MOM_grid_initialize cluster_mom_hor_visc MOM_hor_visc cluster_mom_horizontal_regridding MOM_horizontal_regridding cluster_mom_hybgen_regrid MOM_hybgen_regrid cluster_mom_ice_shelf MOM_ice_shelf cluster_mom_ice_shelf_dynamics MOM_ice_shelf_dynamics cluster_mom_ice_shelf_initialize MOM_ice_shelf_initialize cluster_mom_int_tide_input MOM_int_tide_input cluster_mom_internal_tides MOM_internal_tides cluster_mom_io MOM_io cluster_mom_mixed_layer_restrat MOM_mixed_layer_restrat cluster_mom_ocmip2_cfc MOM_OCMIP2_CFC cluster_mom_oda_driver_mod MOM_oda_driver_mod cluster_mom_offline_aux MOM_offline_aux cluster_mom_offline_main MOM_offline_main cluster_mom_regridding MOM_regridding cluster_mom_restart MOM_restart cluster_mom_self_attr_load MOM_self_attr_load cluster_mom_set_visc MOM_set_visc cluster_mom_shared_initialization MOM_shared_initialization cluster_mom_state_initialization MOM_state_initialization cluster_mom_surface_forcing MOM_surface_forcing cluster_mom_thickness_diffuse MOM_thickness_diffuse cluster_mom_tidal_forcing MOM_tidal_forcing cluster_mom_tidal_mixing MOM_tidal_mixing cluster_mom_tracer_z_init MOM_tracer_Z_init cluster_mom_vert_friction MOM_vert_friction cluster_mom_wave_drag MOM_wave_drag cluster_oil_tracer oil_tracer cluster_rgc_initialization RGC_initialization cluster_rgc_tracer RGC_tracer cluster_user_tracer_example USER_tracer_example dome_tracer::initialize_dome_tracer initialize_DOME_tracer mom_io::interface::mom_read_data MOM_read_data (interface) dome_tracer::initialize_dome_tracer->mom_io::interface::mom_read_data dyed_obc_tracer::initialize_dyed_obc_tracer initialize_dyed_obc_tracer dyed_obc_tracer::initialize_dyed_obc_tracer->mom_io::interface::mom_read_data ideal_age_example::initialize_ideal_age_tracer initialize_ideal_age_tracer ideal_age_example::initialize_ideal_age_tracer->mom_io::interface::mom_read_data isomip_initialization::isomip_initialize_sponges ISOMIP_initialize_sponges isomip_initialization::isomip_initialize_sponges->mom_io::interface::mom_read_data isomip_tracer::initialize_isomip_tracer initialize_ISOMIP_tracer isomip_tracer::initialize_isomip_tracer->mom_io::interface::mom_read_data marbl_tracers::initialize_marbl_tracers initialize_MARBL_tracers marbl_tracers::initialize_marbl_tracers->mom_io::interface::mom_read_data meso_surface_forcing::meso_buoyancy_forcing MESO_buoyancy_forcing meso_surface_forcing::meso_buoyancy_forcing->mom_io::interface::mom_read_data mom_ann::ann_init ANN_init mom_ann::ann_init->mom_io::interface::mom_read_data mom_ann::ann_test ANN_test [private/internal] mom_ann::ann_test->mom_io::interface::mom_read_data mom_barotropic::barotropic_init barotropic_init mom_barotropic::barotropic_init->mom_io::interface::mom_read_data mom_cfc_cap::init_tracer_cfc init_tracer_CFC [private/internal] mom_cfc_cap::init_tracer_cfc->mom_io::interface::mom_read_data mom_coord_initialization::set_coord_from_file set_coord_from_file [private/internal] mom_coord_initialization::set_coord_from_file->mom_io::interface::mom_read_data mom_coord_initialization::set_coord_from_ts_profile set_coord_from_TS_profile [private/internal] mom_coord_initialization::set_coord_from_ts_profile->mom_io::interface::mom_read_data mom_geothermal::geothermal_init geothermal_init mom_geothermal::geothermal_init->mom_io::interface::mom_read_data mom_grid_initialize::set_grid_metrics_from_mosaic set_grid_metrics_from_mosaic [private/internal] mom_grid_initialize::set_grid_metrics_from_mosaic->mom_io::interface::mom_read_data mom_hor_visc::hor_visc_init hor_visc_init mom_hor_visc::hor_visc_init->mom_io::interface::mom_read_data mom_horizontal_regridding::horiz_interp_and_extrap_tracer_record horiz_interp_and_extrap_tracer_record [private/internal] mom_horizontal_regridding::horiz_interp_and_extrap_tracer_record->mom_io::interface::mom_read_data mom_hybgen_regrid::init_hybgen_regrid init_hybgen_regrid mom_hybgen_regrid::init_hybgen_regrid->mom_io::interface::mom_read_data mom_ice_shelf::initialize_ice_shelf initialize_ice_shelf mom_ice_shelf::initialize_ice_shelf->mom_io::interface::mom_read_data mom_ice_shelf::initialize_ice_smb initialize_ice_SMB mom_ice_shelf::initialize_ice_smb->mom_io::interface::mom_read_data mom_ice_shelf_dynamics::initialize_ice_shelf_dyn initialize_ice_shelf_dyn mom_ice_shelf_dynamics::initialize_ice_shelf_dyn->mom_io::interface::mom_read_data mom_ice_shelf_initialize::initialize_ice_aglen initialize_ice_AGlen mom_ice_shelf_initialize::initialize_ice_aglen->mom_io::interface::mom_read_data mom_ice_shelf_initialize::initialize_ice_c_basal_friction initialize_ice_C_basal_friction mom_ice_shelf_initialize::initialize_ice_c_basal_friction->mom_io::interface::mom_read_data mom_ice_shelf_initialize::initialize_ice_flow_from_file initialize_ice_flow_from_file mom_ice_shelf_initialize::initialize_ice_flow_from_file->mom_io::interface::mom_read_data mom_ice_shelf_initialize::initialize_ice_shelf_boundary_from_file initialize_ice_shelf_boundary_from_file mom_ice_shelf_initialize::initialize_ice_shelf_boundary_from_file->mom_io::interface::mom_read_data mom_ice_shelf_initialize::initialize_ice_thickness_from_file initialize_ice_thickness_from_file [private/internal] mom_ice_shelf_initialize::initialize_ice_thickness_from_file->mom_io::interface::mom_read_data mom_int_tide_input::int_tide_input_init int_tide_input_init mom_int_tide_input::int_tide_input_init->mom_io::interface::mom_read_data mom_internal_tides::internal_tides_init internal_tides_init mom_internal_tides::internal_tides_init->mom_io::interface::mom_read_data mom_mixed_layer_restrat::mixedlayer_restrat_init mixedlayer_restrat_init mom_mixed_layer_restrat::mixedlayer_restrat_init->mom_io::interface::mom_read_data mom_ocmip2_cfc::init_tracer_cfc init_tracer_CFC [private/internal] mom_ocmip2_cfc::init_tracer_cfc->mom_io::interface::mom_read_data mom_oda_driver_mod::init_oda init_oda mom_oda_driver_mod::init_oda->mom_io::interface::mom_read_data mom_offline_aux::update_offline_from_files update_offline_from_files mom_offline_aux::update_offline_from_files->mom_io::interface::mom_read_data mom_offline_main::read_all_input read_all_input [private/internal] mom_offline_main::read_all_input->mom_io::interface::mom_read_data mom_regridding::initialize_regridding initialize_regridding mom_regridding::initialize_regridding->mom_io::interface::mom_read_data mom_restart::only_read_restart_field_2d only_read_restart_field_2d [private/internal] mom_restart::only_read_restart_field_2d->mom_io::interface::mom_read_data mom_restart::only_read_restart_field_3d only_read_restart_field_3d [private/internal] mom_restart::only_read_restart_field_3d->mom_io::interface::mom_read_data mom_restart::only_read_restart_field_4d only_read_restart_field_4d [private/internal] mom_restart::only_read_restart_field_4d->mom_io::interface::mom_read_data mom_restart::only_read_restart_pair_3d only_read_restart_pair_3d [private/internal] mom_restart::only_read_restart_pair_3d->mom_io::interface::mom_read_data mom_restart::restore_state restore_state mom_restart::restore_state->mom_io::interface::mom_read_data mom_self_attr_load::sal_init SAL_init mom_self_attr_load::sal_init->mom_io::interface::mom_read_data mom_set_visc::set_visc_init set_visc_init mom_set_visc::set_visc_init->mom_io::interface::mom_read_data mom_shared_initialization::initialize_topography_from_file initialize_topography_from_file mom_shared_initialization::initialize_topography_from_file->mom_io::interface::mom_read_data mom_shared_initialization::set_meansl_from_file set_meanSL_from_file mom_shared_initialization::set_meansl_from_file->mom_io::interface::mom_read_data mom_state_initialization::depress_surface depress_surface [private/internal] mom_state_initialization::depress_surface->mom_io::interface::mom_read_data mom_state_initialization::initialize_oda_incupd_file initialize_oda_incupd_file [private/internal] mom_state_initialization::initialize_oda_incupd_file->mom_io::interface::mom_read_data mom_state_initialization::initialize_sponges_file initialize_sponges_file [private/internal] mom_state_initialization::initialize_sponges_file->mom_io::interface::mom_read_data mom_state_initialization::initialize_temp_salt_from_file initialize_temp_salt_from_file [private/internal] mom_state_initialization::initialize_temp_salt_from_file->mom_io::interface::mom_read_data mom_state_initialization::initialize_temp_salt_from_profile initialize_temp_salt_from_profile [private/internal] mom_state_initialization::initialize_temp_salt_from_profile->mom_io::interface::mom_read_data mom_state_initialization::initialize_thickness_from_file initialize_thickness_from_file [private/internal] mom_state_initialization::initialize_thickness_from_file->mom_io::interface::mom_read_data mom_state_initialization::initialize_thickness_list initialize_thickness_list [private/internal] mom_state_initialization::initialize_thickness_list->mom_io::interface::mom_read_data mom_state_initialization::trim_for_ice trim_for_ice [private/internal] mom_state_initialization::trim_for_ice->mom_io::interface::mom_read_data mom_surface_forcing::buoyancy_forcing_from_files buoyancy_forcing_from_files [private/internal] mom_surface_forcing::buoyancy_forcing_from_files->mom_io::interface::mom_read_data mom_surface_forcing::wind_forcing_from_file wind_forcing_from_file [private/internal] mom_surface_forcing::wind_forcing_from_file->mom_io::interface::mom_read_data mom_thickness_diffuse::thickness_diffuse_init thickness_diffuse_init mom_thickness_diffuse::thickness_diffuse_init->mom_io::interface::mom_read_data mom_tidal_forcing::find_in_files find_in_files [private/internal] mom_tidal_forcing::find_in_files->mom_io::interface::mom_read_data mom_tidal_mixing::read_tidal_constituents read_tidal_constituents [private/internal] mom_tidal_mixing::read_tidal_constituents->mom_io::interface::mom_read_data mom_tidal_mixing::read_tidal_energy read_tidal_energy [private/internal] mom_tidal_mixing::read_tidal_energy->mom_io::interface::mom_read_data mom_tidal_mixing::tidal_mixing_init tidal_mixing_init mom_tidal_mixing::tidal_mixing_init->mom_io::interface::mom_read_data mom_tracer_z_init::tracer_z_init tracer_Z_init mom_tracer_z_init::tracer_z_init->mom_io::interface::mom_read_data mom_vert_friction::vertvisc_init vertvisc_init mom_vert_friction::vertvisc_init->mom_io::interface::mom_read_data mom_wave_drag::wave_drag_init wave_drag_init mom_wave_drag::wave_drag_init->mom_io::interface::mom_read_data oil_tracer::initialize_oil_tracer initialize_oil_tracer oil_tracer::initialize_oil_tracer->mom_io::interface::mom_read_data rgc_initialization::rgc_initialize_sponges RGC_initialize_sponges rgc_initialization::rgc_initialize_sponges->mom_io::interface::mom_read_data rgc_tracer::initialize_rgc_tracer initialize_RGC_tracer rgc_tracer::initialize_rgc_tracer->mom_io::interface::mom_read_data user_tracer_example::user_initialize_tracer USER_initialize_tracer user_tracer_example::user_initialize_tracer->mom_io::interface::mom_read_data
Text view
interface MOM_read_vector

Read a vector from file using the infrastructure I/O.

Callers call graph
Callers of mom_io::interface::mom_read_vector calls cluster_mom_io MOM_io cluster_mom_offline_aux MOM_offline_aux cluster_mom_offline_main MOM_offline_main cluster_mom_shared_initialization MOM_shared_initialization cluster_mom_state_initialization MOM_state_initialization cluster_mom_surface_forcing MOM_surface_forcing mom_io::interface::mom_read_vector MOM_read_vector (interface) mom_offline_aux::update_offline_from_files update_offline_from_files mom_offline_aux::update_offline_from_files->mom_io::interface::mom_read_vector mom_offline_main::read_all_input read_all_input [private/internal] mom_offline_main::read_all_input->mom_io::interface::mom_read_vector mom_shared_initialization::reset_face_lengths_file reset_face_lengths_file mom_shared_initialization::reset_face_lengths_file->mom_io::interface::mom_read_vector mom_shared_initialization::set_subgrid_topo_at_vel_from_file set_subgrid_topo_at_vel_from_file mom_shared_initialization::set_subgrid_topo_at_vel_from_file->mom_io::interface::mom_read_vector mom_state_initialization::initialize_oda_incupd_file initialize_oda_incupd_file [private/internal] mom_state_initialization::initialize_oda_incupd_file->mom_io::interface::mom_read_vector mom_state_initialization::initialize_sponges_file initialize_sponges_file [private/internal] mom_state_initialization::initialize_sponges_file->mom_io::interface::mom_read_vector mom_state_initialization::initialize_velocity_from_file initialize_velocity_from_file [private/internal] mom_state_initialization::initialize_velocity_from_file->mom_io::interface::mom_read_vector mom_surface_forcing::wind_forcing_from_file wind_forcing_from_file [private/internal] mom_surface_forcing::wind_forcing_from_file->mom_io::interface::mom_read_vector
Text view
interface read_netCDF_data

Read a field using native netCDF I/O

This function is primarily used for unstructured data which may contain content that cannot be parsed by infrastructure I/O.

Callers call graph
Callers of mom_io::interface::read_netcdf_data calls cluster_mom_io MOM_io cluster_mom_surface_forcing MOM_surface_forcing cluster_mom_tidal_mixing MOM_tidal_mixing mom_io::interface::read_netcdf_data read_netCDF_data (interface) mom_surface_forcing::surface_forcing_init surface_forcing_init mom_surface_forcing::surface_forcing_init->mom_io::interface::read_netcdf_data mom_tidal_mixing::tidal_mixing_init tidal_mixing_init mom_tidal_mixing::tidal_mixing_init->mom_io::interface::read_netcdf_data
Text view
interface MOM_write_field

Write a registered field to an output file, potentially with rotation

Callers call graph
Callers of mom_io::interface::mom_write_field calls cluster_mom_coord_initialization MOM_coord_initialization cluster_mom_harmonic_analysis MOM_harmonic_analysis cluster_mom_hybgen_regrid MOM_hybgen_regrid cluster_mom_io MOM_io cluster_mom_regridding MOM_regridding cluster_mom_restart MOM_restart cluster_mom_self_attr_load MOM_self_attr_load cluster_mom_shared_initialization MOM_shared_initialization cluster_mom_sum_output MOM_sum_output mom_coord_initialization::write_vertgrid_file write_vertgrid_file mom_io::interface::mom_write_field MOM_write_field (interface) mom_coord_initialization::write_vertgrid_file->mom_io::interface::mom_write_field mom_harmonic_analysis::ha_write HA_write [private/internal] mom_harmonic_analysis::ha_write->mom_io::interface::mom_write_field mom_hybgen_regrid::write_hybgen_coord_file write_Hybgen_coord_file mom_hybgen_regrid::write_hybgen_coord_file->mom_io::interface::mom_write_field mom_regridding::write_regrid_file write_regrid_file mom_regridding::write_regrid_file->mom_io::interface::mom_write_field mom_restart::save_restart save_restart mom_restart::save_restart->mom_io::interface::mom_write_field mom_self_attr_load::sal_init SAL_init mom_self_attr_load::sal_init->mom_io::interface::mom_write_field mom_shared_initialization::write_ocean_geometry_file write_ocean_geometry_file mom_shared_initialization::write_ocean_geometry_file->mom_io::interface::mom_write_field mom_sum_output::write_depth_list write_depth_list [private/internal] mom_sum_output::write_depth_list->mom_io::interface::mom_write_field
Text view
interface read_variable

Read an entire named variable from a named netCDF file using netCDF calls directly, rather than any infrastructure routines and broadcast it from the root PE to the other PEs.

Callers call graph
Callers of mom_io::interface::read_variable calls cluster_mom_horizontal_regridding MOM_horizontal_regridding cluster_mom_io MOM_io cluster_mom_regridding MOM_regridding cluster_mom_shared_initialization MOM_shared_initialization cluster_mom_sum_output MOM_sum_output cluster_mom_tracer_z_init MOM_tracer_Z_init cluster_mom_wave_interface MOM_wave_interface mom_horizontal_regridding::horiz_interp_and_extrap_tracer_record horiz_interp_and_extrap_tracer_record [private/internal] mom_io::interface::read_variable read_variable (interface) mom_horizontal_regridding::horiz_interp_and_extrap_tracer_record->mom_io::interface::read_variable mom_regridding::initialize_regridding initialize_regridding mom_regridding::initialize_regridding->mom_io::interface::read_variable mom_shared_initialization::apply_topography_edits_from_file apply_topography_edits_from_file mom_shared_initialization::apply_topography_edits_from_file->mom_io::interface::read_variable mom_sum_output::read_depth_list read_depth_list [private/internal] mom_sum_output::read_depth_list->mom_io::interface::read_variable mom_tracer_z_init::read_z_edges read_Z_edges mom_tracer_z_init::read_z_edges->mom_io::interface::read_variable mom_wave_interface::surface_bands_by_data_override Surface_Bands_by_data_override [private/internal] mom_wave_interface::surface_bands_by_data_override->mom_io::interface::read_variable
Text view
interface read_attribute

Read a global or variable attribute from a named netCDF file using netCDF calls directly, in some cases reading from the root PE before broadcasting to the other PEs.

Callers call graph
Callers of mom_io::interface::read_attribute calls cluster_mom_horizontal_regridding MOM_horizontal_regridding cluster_mom_io MOM_io cluster_mom_sum_output MOM_sum_output cluster_mom_tracer_z_init MOM_tracer_Z_init mom_horizontal_regridding::horiz_interp_and_extrap_tracer_record horiz_interp_and_extrap_tracer_record [private/internal] mom_io::interface::read_attribute read_attribute (interface) mom_horizontal_regridding::horiz_interp_and_extrap_tracer_record->mom_io::interface::read_attribute mom_sum_output::read_depth_list read_depth_list [private/internal] mom_sum_output::read_depth_list->mom_io::interface::read_attribute mom_tracer_z_init::read_z_edges read_Z_edges mom_tracer_z_init::read_z_edges->mom_io::interface::read_attribute
Text view

Functions/Subroutine Documentation

subroutine create_file(IO_handle, filename, vars, novars, fields, threading, timeunit, G, dG, GV, checksums, extra_axes, global_atts)

create_MOM_file wrapper for the legacy file handle, file_type. NOTE: This function may be removed in a future release.

Parameters
  • IO_handle [inout]

    Handle for a files or fileset that is to be opened or reopened for writing

  • filename [in]

    full path to the file to create

  • vars [in]

    structures describing fields written to filename

  • novars [in]

    number of fields written to filename

  • fields [inout]

    array of fieldtypes for each variable

  • threading [in]

    SINGLE_FILE or MULTIPLE

  • timeunit [in]

    length of the units for time [s]. The default value is 86400.0, for 1 day.

  • G [in]

    ocean horizontal grid structure; G or dG is required if the new file uses any horizontal grid axes.

  • dG [in]

    dynamic horizontal grid structure; G or dG is required if the new file uses any horizontal grid axes.

  • GV [in]

    ocean vertical grid structure, which is ! required if the new file uses any vertical grid axes.

  • checksums [in]

    checksums of vars

  • extra_axes [in]

    Types with information about some axes that might be used in this file

  • global_atts [in]

    Global attributes to write to this file

Callees call graph
Callees of mom_io::create_file calls cluster_mom_io MOM_io mom_io::create_file create_file mom_io::create_mom_file create_MOM_file mom_io::create_file->mom_io::create_mom_file
Text view
subroutine create_MOM_file(IO_handle, filename, vars, novars, fields, threading, timeunit, G, dG, GV, checksums, extra_axes, global_atts)

Create a new netCDF file and register the MOM_fields to be written.

Parameters
  • IO_handle [inout]

    Handle for a files or fileset that is to be opened or reopened for writing

  • filename [in]

    full path to the file to create

  • vars [in]

    structures describing fields written to filename

  • novars [in]

    number of fields written to filename

  • fields [inout]

    array of fieldtypes for each variable

  • threading [in]

    SINGLE_FILE or MULTIPLE

  • timeunit [in]

    length of the units for time [s]. The default value is 86400.0, for 1 day.

  • G [in]

    ocean horizontal grid structure; G or dG is required if the new file uses any horizontal grid axes.

  • dG [in]

    dynamic horizontal grid structure; G or dG is required if the new file uses any horizontal grid axes.

  • GV [in]

    ocean vertical grid structure, which is required if the new file uses any vertical grid axes.

  • checksums [in]

    checksums of vars

  • extra_axes [in]

    Types with information about some axes that might be used in this file

  • global_atts [in]

    Global attributes to write to this file

Callees call graph
Callees of mom_io::create_mom_file calls cluster_mom_domain_infra MOM_domain_infra cluster_mom_error_handler MOM_error_handler cluster_mom_io MOM_io cluster_mom_string_functions MOM_string_functions mom_domain_infra::interface::get_domain_components get_domain_components (interface) mom_error_handler::mom_error MOM_error mom_io::create_mom_file create_MOM_file mom_io::create_mom_file->mom_domain_infra::interface::get_domain_components mom_io::create_mom_file->mom_error_handler::mom_error mom_io::position_from_horgrid position_from_horgrid mom_io::create_mom_file->mom_io::position_from_horgrid mom_string_functions::lowercase lowercase mom_io::create_mom_file->mom_string_functions::lowercase
Text view
Callers call graph
Callers of mom_io::create_mom_file calls cluster_mom_coord_initialization MOM_coord_initialization cluster_mom_harmonic_analysis MOM_harmonic_analysis cluster_mom_hybgen_regrid MOM_hybgen_regrid cluster_mom_io MOM_io cluster_mom_regridding MOM_regridding cluster_mom_restart MOM_restart cluster_mom_self_attr_load MOM_self_attr_load cluster_mom_shared_initialization MOM_shared_initialization cluster_mom_sum_output MOM_sum_output mom_coord_initialization::write_vertgrid_file write_vertgrid_file mom_io::create_mom_file create_MOM_file mom_coord_initialization::write_vertgrid_file->mom_io::create_mom_file mom_harmonic_analysis::ha_write HA_write [private/internal] mom_harmonic_analysis::ha_write->mom_io::create_mom_file mom_hybgen_regrid::write_hybgen_coord_file write_Hybgen_coord_file mom_hybgen_regrid::write_hybgen_coord_file->mom_io::create_mom_file mom_io::create_file create_file mom_io::create_file->mom_io::create_mom_file mom_io::reopen_mom_file reopen_MOM_file mom_io::reopen_mom_file->mom_io::create_mom_file mom_regridding::write_regrid_file write_regrid_file mom_regridding::write_regrid_file->mom_io::create_mom_file mom_restart::save_restart save_restart mom_restart::save_restart->mom_io::create_mom_file mom_self_attr_load::sal_init SAL_init mom_self_attr_load::sal_init->mom_io::create_mom_file mom_shared_initialization::write_ocean_geometry_file write_ocean_geometry_file mom_shared_initialization::write_ocean_geometry_file->mom_io::create_mom_file mom_sum_output::write_depth_list write_depth_list [private/internal] mom_sum_output::write_depth_list->mom_io::create_mom_file mom_sum_output::write_energy write_energy mom_sum_output::write_energy->mom_io::create_mom_file
Text view
subroutine reopen_file(IO_handle, filename, vars, novars, fields, threading, timeunit, G, dG, GV, extra_axes, global_atts)

reopen_MOM_file wrapper for the legacy file handle, file_type. NOTE: This function may be removed in a future release.

Parameters
  • IO_handle [inout]

    Handle for a file or fileset that is to be opened or reopened for writing

  • filename [in]

    full path to the file to create

  • vars [in]

    structures describing fields written to filename

  • novars [in]

    number of fields written to filename

  • fields [inout]

    array of fieldtypes for each variable

  • threading [in]

    SINGLE_FILE or MULTIPLE

  • timeunit [in]

    length of the units for time [s]. The default value is 86400.0, for 1 day.

  • G [in]

    ocean horizontal grid structure; G or dG is required if a new file uses any horizontal grid axes.

  • dG [in]

    dynamic horizontal grid structure; G or dG is required if a new file uses any horizontal grid axes.

  • GV [in]

    ocean vertical grid structure, which is required if a new file uses any vertical grid axes.

  • extra_axes [in]

    Types with information about some axes that might be used in this file

  • global_atts [in]

    Global attributes to write to this file

  • mfile

    Wrapper to MOM file

  • mfields

    Wrapper to MOM fields

Callees call graph
Callees of mom_io::reopen_file calls cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_io::reopen_file reopen_file mom_io::reopen_mom_file reopen_MOM_file mom_io::reopen_file->mom_io::reopen_mom_file mom_io_infra::get_file_fields get_file_fields mom_io::reopen_file->mom_io_infra::get_file_fields
Text view
subroutine reopen_MOM_file(IO_handle, filename, vars, novars, fields, threading, timeunit, G, dG, GV, extra_axes, global_atts)

This routine opens an existing NetCDF file for output. If it does not find the file, a new file is created. It also sets up structures that describe this file and the variables that will later be written to this file.

Parameters
  • IO_handle [inout]

    Handle for a file or fileset that is to be opened or reopened for writing

  • filename [in]

    full path to the file to create

  • vars [in]

    structures describing fields written to filename

  • novars [in]

    number of fields written to filename

  • fields [inout]

    array of fieldtypes for each variable

  • threading [in]

    SINGLE_FILE or MULTIPLE

  • timeunit [in]

    length of the units for time [s]. The default value is 86400.0, for 1 day.

  • G [in]

    ocean horizontal grid structure; G or dG is required if a new file uses any horizontal grid axes.

  • dG [in]

    dynamic horizontal grid structure; G or dG is required if a new file uses any horizontal grid axes.

  • GV [in]

    ocean vertical grid structure, which is required if a new file uses any vertical grid axes.

  • extra_axes [in]

    Types with information about some axes that might be used in this file

  • global_atts [in]

    Global attributes to write to this file

Callees call graph
Callees of mom_io::reopen_mom_file calls cluster_mom_error_handler MOM_error_handler cluster_mom_error_infra MOM_error_infra cluster_mom_io MOM_io mom_error_handler::mom_error MOM_error mom_error_infra::is_root_pe is_root_pe mom_io::create_mom_file create_MOM_file mom_io::reopen_mom_file reopen_MOM_file mom_io::reopen_mom_file->mom_error_handler::mom_error mom_io::reopen_mom_file->mom_error_infra::is_root_pe mom_io::reopen_mom_file->mom_io::create_mom_file
Text view
Callers call graph
Callers of mom_io::reopen_mom_file calls cluster_mom_io MOM_io cluster_mom_sum_output MOM_sum_output mom_io::reopen_file reopen_file mom_io::reopen_mom_file reopen_MOM_file mom_io::reopen_file->mom_io::reopen_mom_file mom_sum_output::write_energy write_energy mom_sum_output::write_energy->mom_io::reopen_mom_file
Text view
integer function stdout_if_root()

Return the index of sdtout if called from the root PE, or 0 for other PEs.

Callees call graph
Callees of mom_io::stdout_if_root calls cluster_mom_error_infra MOM_error_infra cluster_mom_io MOM_io mom_error_infra::is_root_pe is_root_pe mom_io::stdout_if_root stdout_if_root mom_io::stdout_if_root->mom_error_infra::is_root_pe
Text view
function num_timelevels(filename, varname, min_dims) result(n_time)

This function determines how many time levels a variable has in a file.

Parameters
  • filename [in]

    name of the file to read

  • varname [in]

    variable whose number of time levels are to be returned

  • min_dims [in]

    The minimum number of dimensions a variable must have if it has a time dimension. If the variable has 1 less dimension than this, then 0 is returned.

  • n_time

    number of time levels varname has in filename

Callees call graph
Callees of mom_io::num_timelevels calls cluster_mom_error_handler MOM_error_handler cluster_mom_io MOM_io mom_error_handler::mom_error MOM_error mom_io::get_var_sizes get_var_sizes mom_io::num_timelevels num_timelevels mom_io::num_timelevels->mom_error_handler::mom_error mom_io::num_timelevels->mom_io::get_var_sizes
Text view
Callers call graph
Callers of mom_io::num_timelevels calls cluster_mom_io MOM_io cluster_mom_surface_forcing MOM_surface_forcing mom_io::num_timelevels num_timelevels mom_surface_forcing::surface_forcing_init surface_forcing_init mom_surface_forcing::surface_forcing_init->mom_io::num_timelevels
Text view
subroutine get_var_sizes(filename, varname, ndims, sizes, match_case, caller, all_read, dim_names, ncid_in)

get_var_sizes returns the number and size of dimensions associate with a variable in a file. Usually only the root PE does the read, and then the information is broadcast

Parameters
  • filename [in]

    Name of the file to read, used here in messages

  • varname [in]

    The variable name, used here for messages

  • ndims [out]

    The number of dimensions to the variable

  • sizes [out]

    The dimension sizes, or 0 for extra values

  • match_case [in]

    If false, allow for variables name matches to be case insensitive, but take a perfect match if found. The default is true.

  • caller [in]

    The name of a calling routine for use in error messages

  • all_read [in]

    If present and true, all PEs that call this routine actually do the read, otherwise only root PE reads and then it broadcasts the results.

  • dim_names [out]

    The names of the dimensions for this variable

  • ncid_in [in]

    The netCDF ID of an open file. If absent, the file is opened and closed within this routine.

Callees call graph
Callees of mom_io::get_var_sizes calls cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_infra MOM_error_infra cluster_mom_io MOM_io mom_coms_infra::interface::broadcast broadcast (interface) mom_error_infra::is_root_pe is_root_pe mom_io::get_var_sizes get_var_sizes mom_io::get_var_sizes->mom_coms_infra::interface::broadcast mom_io::get_var_sizes->mom_error_infra::is_root_pe mom_io::read_var_sizes read_var_sizes [private/internal] mom_io::get_var_sizes->mom_io::read_var_sizes
Text view
Callers call graph
Callers of mom_io::get_var_sizes calls cluster_mom_io MOM_io cluster_mom_tracer_z_init MOM_tracer_Z_init cluster_mom_wave_interface MOM_wave_interface mom_io::field_size field_size mom_io::get_var_sizes get_var_sizes mom_io::field_size->mom_io::get_var_sizes mom_io::num_timelevels num_timelevels mom_io::num_timelevels->mom_io::get_var_sizes mom_tracer_z_init::read_z_edges read_Z_edges mom_tracer_z_init::read_z_edges->mom_io::get_var_sizes mom_wave_interface::surface_bands_by_data_override Surface_Bands_by_data_override [private/internal] mom_wave_interface::surface_bands_by_data_override->mom_io::get_var_sizes
Text view
subroutine read_var_sizes(filename, varname, ndims, sizes, match_case, caller, dim_names, ncid_in)

read_var_sizes returns the number and size of dimensions associated with a variable in a file. If the variable is not in the file the returned sizes are all 0 and ndims is -1. Every processor for which this is called does the reading.

Parameters
  • filename [in]

    Name of the file to read, used here in messages

  • varname [in]

    The variable name, used here for messages

  • ndims [out]

    The number of dimensions to the variable

  • sizes [out]

    The dimension sizes, or 0 for extra values

  • match_case [in]

    If false, allow for variables name matches to be case insensitive, but take a perfect match if found. The default is true.

  • caller [in]

    The name of a calling routine for use in error messages

  • dim_names [out]

    The names of the dimensions for this variable

  • ncid_in [in]

    The netCDF ID of an open file. If absent, the file is opened and closed within this routine.

Callees call graph
Callees of mom_io::read_var_sizes calls cluster_mom_error_handler MOM_error_handler cluster_mom_io MOM_io mom_error_handler::mom_error MOM_error mom_io::close_file_to_read close_file_to_read mom_io::get_varid get_varid [private/internal] mom_io::open_file_to_read open_file_to_read mom_io::read_var_sizes read_var_sizes [private/internal] mom_io::read_var_sizes->mom_error_handler::mom_error mom_io::read_var_sizes->mom_io::close_file_to_read mom_io::read_var_sizes->mom_io::get_varid mom_io::read_var_sizes->mom_io::open_file_to_read
Text view
Callers call graph
Callers of mom_io::read_var_sizes calls cluster_mom_io MOM_io mom_io::get_var_sizes get_var_sizes mom_io::read_var_sizes read_var_sizes [private/internal] mom_io::get_var_sizes->mom_io::read_var_sizes
Text view

External calls

netcdf
  • NF90_Inquire_Dimension (netcdf::nf90_inquire_dimension)

  • NF90_STRERROR (netcdf::nf90_strerror)

  • NF90_inquire_variable (netcdf::nf90_inquire_variable)

subroutine read_variable_0d(filename, varname, var, ncid_in, scale)

Read a real scalar variable from a netCDF file with the root PE, and broadcast the results to all the other PEs.

Parameters
  • filename [in]

    The name of the file to read

  • varname [in]

    The variable name of the data in the file

  • var [inout]

    The scalar into which to read the data in arbitrary units [A ~> a]

  • ncid_in [in]

    The netCDF ID of an open file. If absent, the file is opened and closed within this routine

  • scale [in]

    A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]

Callees call graph
Callees of mom_io::read_variable_0d calls cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_handler MOM_error_handler cluster_mom_error_infra MOM_error_infra cluster_mom_io MOM_io mom_coms_infra::interface::broadcast broadcast (interface) mom_error_handler::mom_error MOM_error mom_error_infra::is_root_pe is_root_pe mom_io::close_file_to_read close_file_to_read mom_io::get_varid get_varid [private/internal] mom_io::open_file_to_read open_file_to_read mom_io::read_variable_0d read_variable_0d [private/internal] mom_io::read_variable_0d->mom_coms_infra::interface::broadcast mom_io::read_variable_0d->mom_error_handler::mom_error mom_io::read_variable_0d->mom_error_infra::is_root_pe mom_io::read_variable_0d->mom_io::close_file_to_read mom_io::read_variable_0d->mom_io::get_varid mom_io::read_variable_0d->mom_io::open_file_to_read
Text view

External calls

netcdf
  • NF90_STRERROR (netcdf::nf90_strerror)

  • NF90_get_var (netcdf::nf90_get_var)

subroutine read_variable_1d(filename, varname, var, ncid_in, scale)

Read a 1-d real variable from a netCDF file with the root PE, and broadcast the results to all the other PEs.

Parameters
  • filename [in]

    The name of the file to read

  • varname [in]

    The variable name of the data in the file

  • var [inout]

    The 1-d array into which to read the data in arbitrary units [A ~> a]

  • ncid_in [in]

    The netCDF ID of an open file. If absent, the file is opened and closed within this routine

  • scale [in]

    A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]

Callees call graph
Callees of mom_io::read_variable_1d calls cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_handler MOM_error_handler cluster_mom_error_infra MOM_error_infra cluster_mom_io MOM_io mom_coms_infra::interface::broadcast broadcast (interface) mom_error_handler::mom_error MOM_error mom_error_infra::is_root_pe is_root_pe mom_io::close_file_to_read close_file_to_read mom_io::get_varid get_varid [private/internal] mom_io::open_file_to_read open_file_to_read mom_io::read_variable_1d read_variable_1d [private/internal] mom_io::read_variable_1d->mom_coms_infra::interface::broadcast mom_io::read_variable_1d->mom_error_handler::mom_error mom_io::read_variable_1d->mom_error_infra::is_root_pe mom_io::read_variable_1d->mom_io::close_file_to_read mom_io::read_variable_1d->mom_io::get_varid mom_io::read_variable_1d->mom_io::open_file_to_read
Text view

External calls

netcdf
  • NF90_STRERROR (netcdf::nf90_strerror)

  • NF90_get_var (netcdf::nf90_get_var)

subroutine read_variable_0d_int(filename, varname, var, ncid_in)

Read a integer scalar variable from a netCDF file with the root PE, and broadcast the results to all the other PEs.

Parameters
  • filename [in]

    The name of the file to read

  • varname [in]

    The variable name of the data in the file

  • var [inout]

    The scalar into which to read the data

  • ncid_in [in]

    The netCDF ID of an open file. If absent, the file is opened and closed within this routine.

Callees call graph
Callees of mom_io::read_variable_0d_int calls cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_handler MOM_error_handler cluster_mom_error_infra MOM_error_infra cluster_mom_io MOM_io mom_coms_infra::interface::broadcast broadcast (interface) mom_error_handler::mom_error MOM_error mom_error_infra::is_root_pe is_root_pe mom_io::close_file_to_read close_file_to_read mom_io::get_varid get_varid [private/internal] mom_io::open_file_to_read open_file_to_read mom_io::read_variable_0d_int read_variable_0d_int [private/internal] mom_io::read_variable_0d_int->mom_coms_infra::interface::broadcast mom_io::read_variable_0d_int->mom_error_handler::mom_error mom_io::read_variable_0d_int->mom_error_infra::is_root_pe mom_io::read_variable_0d_int->mom_io::close_file_to_read mom_io::read_variable_0d_int->mom_io::get_varid mom_io::read_variable_0d_int->mom_io::open_file_to_read
Text view

External calls

netcdf
  • NF90_STRERROR (netcdf::nf90_strerror)

  • NF90_get_var (netcdf::nf90_get_var)

subroutine read_variable_1d_int(filename, varname, var, ncid_in)

Read a 1-d integer variable from a netCDF file with the root PE, and broadcast the results to all the other PEs.

Parameters
  • filename [in]

    The name of the file to read

  • varname [in]

    The variable name of the data in the file

  • var [inout]

    The 1-d array into which to read the data

  • ncid_in [in]

    The netCDF ID of an open file. If absent, the file is opened and closed within this routine.

Callees call graph
Callees of mom_io::read_variable_1d_int calls cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_handler MOM_error_handler cluster_mom_error_infra MOM_error_infra cluster_mom_io MOM_io mom_coms_infra::interface::broadcast broadcast (interface) mom_error_handler::mom_error MOM_error mom_error_infra::is_root_pe is_root_pe mom_io::close_file_to_read close_file_to_read mom_io::get_varid get_varid [private/internal] mom_io::open_file_to_read open_file_to_read mom_io::read_variable_1d_int read_variable_1d_int [private/internal] mom_io::read_variable_1d_int->mom_coms_infra::interface::broadcast mom_io::read_variable_1d_int->mom_error_handler::mom_error mom_io::read_variable_1d_int->mom_error_infra::is_root_pe mom_io::read_variable_1d_int->mom_io::close_file_to_read mom_io::read_variable_1d_int->mom_io::get_varid mom_io::read_variable_1d_int->mom_io::open_file_to_read
Text view

External calls

netcdf
  • NF90_STRERROR (netcdf::nf90_strerror)

  • NF90_get_var (netcdf::nf90_get_var)

subroutine read_variable_2d(filename, varname, var, start, nread, ncid_in)

Read a 2d array from a netCDF input file and save to a variable.

Start and nread lenths may exceed var rank. This allows for reading slices of larger arrays.

Previous versions of the model required a time axis on IO fields. This constraint was dropped in later versions. As a result, versions both with and without a time axis now exist. In order to support all such versions, we use a reshaped version of start and nread in order to read the variable as it exists in the file.

Certain constraints are still applied to start and nread in order to ensure that varname is a valid 2d array, or contains valid 2d slices.

I/O occurs only on the root PE, and data is broadcast to other ranks. Due to potentially large memory communication and storage, this subroutine should only be used when domain-decomposition is unavaialable.

Parameters
  • filename [in]

    Name of file to be read

  • varname [in]

    Name of variable to be read

  • var [out]

    Output array of variable [arbitrary]

  • start [in]

    Starting index on each axis.

  • nread [in]

    Number of values to be read along each axis

  • ncid_in [in]

    netCDF ID of an opened file. If absent, the file is opened and closed within this routine.

Callees call graph
Callees of mom_io::read_variable_2d calls cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_handler MOM_error_handler cluster_mom_error_infra MOM_error_infra cluster_mom_io MOM_io mom_coms_infra::interface::broadcast broadcast (interface) mom_error_handler::mom_error MOM_error mom_error_infra::is_root_pe is_root_pe mom_io::close_file_to_read close_file_to_read mom_io::get_varid get_varid [private/internal] mom_io::open_file_to_read open_file_to_read mom_io::read_variable_2d read_variable_2d [private/internal] mom_io::read_variable_2d->mom_coms_infra::interface::broadcast mom_io::read_variable_2d->mom_error_handler::mom_error mom_io::read_variable_2d->mom_error_infra::is_root_pe mom_io::read_variable_2d->mom_io::close_file_to_read mom_io::read_variable_2d->mom_io::get_varid mom_io::read_variable_2d->mom_io::open_file_to_read
Text view

External calls

netcdf
  • nf90_get_var (netcdf::nf90_get_var)

  • nf90_inquire_dimension (netcdf::nf90_inquire_dimension)

  • nf90_inquire_variable (netcdf::nf90_inquire_variable)

  • nf90_strerror (netcdf::nf90_strerror)

subroutine read_variable_3d(filename, varname, var, start, nread, ncid_in)

Parameters
  • filename [in]

    Name of file to be read

  • varname [in]

    Name of variable to be read

  • var [out]

    Output array of variable [arbitrary]

  • start [in]

    Starting index on each axis.

  • nread [in]

    Number of values to be read along each axis

  • ncid_in [in]

    netCDF ID of an opened file. If absent, the file is opened and closed within this routine.

Callees call graph
Callees of mom_io::read_variable_3d calls cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_handler MOM_error_handler cluster_mom_error_infra MOM_error_infra cluster_mom_io MOM_io mom_coms_infra::interface::broadcast broadcast (interface) mom_error_handler::mom_error MOM_error mom_error_infra::is_root_pe is_root_pe mom_io::close_file_to_read close_file_to_read mom_io::get_varid get_varid [private/internal] mom_io::open_file_to_read open_file_to_read mom_io::read_variable_3d read_variable_3d [private/internal] mom_io::read_variable_3d->mom_coms_infra::interface::broadcast mom_io::read_variable_3d->mom_error_handler::mom_error mom_io::read_variable_3d->mom_error_infra::is_root_pe mom_io::read_variable_3d->mom_io::close_file_to_read mom_io::read_variable_3d->mom_io::get_varid mom_io::read_variable_3d->mom_io::open_file_to_read
Text view

External calls

netcdf
  • nf90_get_var (netcdf::nf90_get_var)

  • nf90_inquire_dimension (netcdf::nf90_inquire_dimension)

  • nf90_inquire_variable (netcdf::nf90_inquire_variable)

  • nf90_strerror (netcdf::nf90_strerror)

subroutine read_attribute_str(filename, attname, att_val, varname, found, all_read, ncid_in)

Read a character-string global or variable attribute

Parameters
  • filename [in]

    Name of the file to read

  • attname [in]

    Name of the attribute to read

  • att_val [out]

    The value of the attribute

  • varname [in]

    The name of the variable whose attribute will be read. If missing, read a global attribute.

  • found [out]

    Returns true if the attribute is found

  • all_read [in]

    If present and true, all PEs that call this routine actually do the read, otherwise only root PE reads and then broadcasts the results.

  • ncid_in [in]

    The netCDF ID of an open file. If absent, the file is opened and closed within this routine.

Callees call graph
Callees of mom_io::read_attribute_str calls cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_handler MOM_error_handler cluster_mom_error_infra MOM_error_infra cluster_mom_io MOM_io mom_coms_infra::interface::broadcast broadcast (interface) mom_error_handler::mom_error MOM_error mom_error_infra::is_root_pe is_root_pe mom_io::close_file_to_read close_file_to_read mom_io::get_varid get_varid [private/internal] mom_io::open_file_to_read open_file_to_read mom_io::read_attribute_str read_attribute_str [private/internal] mom_io::read_attribute_str->mom_coms_infra::interface::broadcast mom_io::read_attribute_str->mom_error_handler::mom_error mom_io::read_attribute_str->mom_error_infra::is_root_pe mom_io::read_attribute_str->mom_io::close_file_to_read mom_io::read_attribute_str->mom_io::get_varid mom_io::read_attribute_str->mom_io::open_file_to_read
Text view

External calls

netcdf
  • NF90_STRERROR (netcdf::nf90_strerror)

  • NF90_get_att (netcdf::nf90_get_att)

  • NF90_inquire_attribute (netcdf::nf90_inquire_attribute)

subroutine read_attribute_int32(filename, attname, att_val, varname, found, all_read, ncid_in)

Read a 32-bit integer global or variable attribute

Parameters
  • filename [in]

    Name of the file to read

  • attname [in]

    Name of the attribute to read

  • att_val [out]

    The value of the attribute

  • varname [in]

    The name of the variable whose attribute will be read. If missing, read a global attribute.

  • found [out]

    Returns true if the attribute is found

  • all_read [in]

    If present and true, all PEs that call this routine actually do the read, otherwise only root PE reads and then broadcasts the results.

  • ncid_in [in]

    The netCDF ID of an open file. If absent, the file is opened and closed within this routine.

Callees call graph
Callees of mom_io::read_attribute_int32 calls cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_handler MOM_error_handler cluster_mom_error_infra MOM_error_infra cluster_mom_io MOM_io mom_coms_infra::interface::broadcast broadcast (interface) mom_error_handler::mom_error MOM_error mom_error_infra::is_root_pe is_root_pe mom_io::close_file_to_read close_file_to_read mom_io::get_varid get_varid [private/internal] mom_io::open_file_to_read open_file_to_read mom_io::read_attribute_int32 read_attribute_int32 [private/internal] mom_io::read_attribute_int32->mom_coms_infra::interface::broadcast mom_io::read_attribute_int32->mom_error_handler::mom_error mom_io::read_attribute_int32->mom_error_infra::is_root_pe mom_io::read_attribute_int32->mom_io::close_file_to_read mom_io::read_attribute_int32->mom_io::get_varid mom_io::read_attribute_int32->mom_io::open_file_to_read
Text view

External calls

netcdf
  • NF90_STRERROR (netcdf::nf90_strerror)

  • NF90_get_att (netcdf::nf90_get_att)

subroutine read_attribute_int64(filename, attname, att_val, varname, found, all_read, ncid_in)

Read a 64-bit integer global or variable attribute

Parameters
  • filename [in]

    Name of the file to read

  • attname [in]

    Name of the attribute to read

  • att_val [out]

    The value of the attribute

  • varname [in]

    The name of the variable whose attribute will be read. If missing, read a global attribute.

  • found [out]

    Returns true if the attribute is found

  • all_read [in]

    If present and true, all PEs that call this routine actually do the read, otherwise only root PE reads and then broadcasts the results.

  • ncid_in [in]

    The netCDF ID of an open file. If absent, the file is opened and closed within this routine.

Callees call graph
Callees of mom_io::read_attribute_int64 calls cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_handler MOM_error_handler cluster_mom_error_infra MOM_error_infra cluster_mom_io MOM_io mom_coms_infra::interface::broadcast broadcast (interface) mom_error_handler::mom_error MOM_error mom_error_infra::is_root_pe is_root_pe mom_io::get_varid get_varid [private/internal] mom_io::open_file_to_read open_file_to_read mom_io::read_attribute_int64 read_attribute_int64 [private/internal] mom_io::read_attribute_int64->mom_coms_infra::interface::broadcast mom_io::read_attribute_int64->mom_error_handler::mom_error mom_io::read_attribute_int64->mom_error_infra::is_root_pe mom_io::read_attribute_int64->mom_io::get_varid mom_io::read_attribute_int64->mom_io::open_file_to_read
Text view

External calls

netcdf
  • NF90_STRERROR (netcdf::nf90_strerror)

  • NF90_close (netcdf::nf90_close)

  • NF90_get_att (netcdf::nf90_get_att)

subroutine read_attribute_real(filename, attname, att_val, varname, found, all_read, ncid_in)

Read a real global or variable attribute

Parameters
  • filename [in]

    Name of the file to read

  • attname [in]

    Name of the attribute to read

  • att_val [out]

    The value of the attribute [arbitrary]

  • varname [in]

    The name of the variable whose attribute will be read. If missing, read a global attribute.

  • found [out]

    Returns true if the attribute is found

  • all_read [in]

    If present and true, all PEs that call this routine actually do the read, otherwise only root PE reads and then broadcasts the results.

  • ncid_in [in]

    The netCDF ID of an open file. If absent, the file is opened and closed within this routine.

Callees call graph
Callees of mom_io::read_attribute_real calls cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_handler MOM_error_handler cluster_mom_error_infra MOM_error_infra cluster_mom_io MOM_io mom_coms_infra::interface::broadcast broadcast (interface) mom_error_handler::mom_error MOM_error mom_error_infra::is_root_pe is_root_pe mom_io::close_file_to_read close_file_to_read mom_io::get_varid get_varid [private/internal] mom_io::open_file_to_read open_file_to_read mom_io::read_attribute_real read_attribute_real [private/internal] mom_io::read_attribute_real->mom_coms_infra::interface::broadcast mom_io::read_attribute_real->mom_error_handler::mom_error mom_io::read_attribute_real->mom_error_infra::is_root_pe mom_io::read_attribute_real->mom_io::close_file_to_read mom_io::read_attribute_real->mom_io::get_varid mom_io::read_attribute_real->mom_io::open_file_to_read
Text view

External calls

netcdf
  • NF90_STRERROR (netcdf::nf90_strerror)

  • NF90_get_att (netcdf::nf90_get_att)

subroutine open_file_to_read(filename, ncid, success)

Open a netcdf file for reading, with error handling

Parameters
  • filename [in]

    path and name of the file to open for reading

  • ncid [out]

    The netcdf handle for the file

  • success [out]

    Returns true if the file was opened, or if this argument is not present, failure is fatal error.

Callees call graph
Callees of mom_io::open_file_to_read calls cluster_mom_error_handler MOM_error_handler cluster_mom_io MOM_io mom_error_handler::mom_error MOM_error mom_io::open_file_to_read open_file_to_read mom_io::open_file_to_read->mom_error_handler::mom_error
Text view
Callers call graph
Callers of mom_io::open_file_to_read calls cluster_mom_io MOM_io cluster_mom_shared_initialization MOM_shared_initialization cluster_mom_tracer_z_init MOM_tracer_Z_init mom_io::get_var_axes_info get_var_axes_info mom_io::open_file_to_read open_file_to_read mom_io::get_var_axes_info->mom_io::open_file_to_read mom_io::read_attribute_int32 read_attribute_int32 [private/internal] mom_io::read_attribute_int32->mom_io::open_file_to_read mom_io::read_attribute_int64 read_attribute_int64 [private/internal] mom_io::read_attribute_int64->mom_io::open_file_to_read mom_io::read_attribute_real read_attribute_real [private/internal] mom_io::read_attribute_real->mom_io::open_file_to_read mom_io::read_attribute_str read_attribute_str [private/internal] mom_io::read_attribute_str->mom_io::open_file_to_read mom_io::read_var_sizes read_var_sizes [private/internal] mom_io::read_var_sizes->mom_io::open_file_to_read mom_io::read_variable_0d read_variable_0d [private/internal] mom_io::read_variable_0d->mom_io::open_file_to_read mom_io::read_variable_0d_int read_variable_0d_int [private/internal] mom_io::read_variable_0d_int->mom_io::open_file_to_read mom_io::read_variable_1d read_variable_1d [private/internal] mom_io::read_variable_1d->mom_io::open_file_to_read mom_io::read_variable_1d_int read_variable_1d_int [private/internal] mom_io::read_variable_1d_int->mom_io::open_file_to_read mom_io::read_variable_2d read_variable_2d [private/internal] mom_io::read_variable_2d->mom_io::open_file_to_read mom_io::read_variable_3d read_variable_3d [private/internal] mom_io::read_variable_3d->mom_io::open_file_to_read mom_io::verify_variable_units verify_variable_units mom_io::verify_variable_units->mom_io::open_file_to_read mom_shared_initialization::apply_topography_edits_from_file apply_topography_edits_from_file mom_shared_initialization::apply_topography_edits_from_file->mom_io::open_file_to_read mom_tracer_z_init::read_z_edges read_Z_edges mom_tracer_z_init::read_z_edges->mom_io::open_file_to_read
Text view

External calls

netcdf
  • NF90_STRERROR (netcdf::nf90_strerror)

  • NF90_open (netcdf::nf90_open)

subroutine close_file_to_read(ncid, filename)

Close a netcdf file that had been opened for reading, with error handling

Parameters
  • ncid [inout]

    The netcdf handle for the file to close

  • filename [in]

    path and name of the file to close

Callees call graph
Callees of mom_io::close_file_to_read calls cluster_mom_error_handler MOM_error_handler cluster_mom_io MOM_io mom_error_handler::mom_error MOM_error mom_io::close_file_to_read close_file_to_read mom_io::close_file_to_read->mom_error_handler::mom_error
Text view
Callers call graph
Callers of mom_io::close_file_to_read calls cluster_mom_io MOM_io cluster_mom_shared_initialization MOM_shared_initialization cluster_mom_tracer_z_init MOM_tracer_Z_init mom_io::close_file_to_read close_file_to_read mom_io::get_var_axes_info get_var_axes_info mom_io::get_var_axes_info->mom_io::close_file_to_read mom_io::read_attribute_int32 read_attribute_int32 [private/internal] mom_io::read_attribute_int32->mom_io::close_file_to_read mom_io::read_attribute_real read_attribute_real [private/internal] mom_io::read_attribute_real->mom_io::close_file_to_read mom_io::read_attribute_str read_attribute_str [private/internal] mom_io::read_attribute_str->mom_io::close_file_to_read mom_io::read_var_sizes read_var_sizes [private/internal] mom_io::read_var_sizes->mom_io::close_file_to_read mom_io::read_variable_0d read_variable_0d [private/internal] mom_io::read_variable_0d->mom_io::close_file_to_read mom_io::read_variable_0d_int read_variable_0d_int [private/internal] mom_io::read_variable_0d_int->mom_io::close_file_to_read mom_io::read_variable_1d read_variable_1d [private/internal] mom_io::read_variable_1d->mom_io::close_file_to_read mom_io::read_variable_1d_int read_variable_1d_int [private/internal] mom_io::read_variable_1d_int->mom_io::close_file_to_read mom_io::read_variable_2d read_variable_2d [private/internal] mom_io::read_variable_2d->mom_io::close_file_to_read mom_io::read_variable_3d read_variable_3d [private/internal] mom_io::read_variable_3d->mom_io::close_file_to_read mom_shared_initialization::apply_topography_edits_from_file apply_topography_edits_from_file mom_shared_initialization::apply_topography_edits_from_file->mom_io::close_file_to_read mom_tracer_z_init::read_z_edges read_Z_edges mom_tracer_z_init::read_z_edges->mom_io::close_file_to_read
Text view

External calls

netcdf
  • NF90_STRERROR (netcdf::nf90_strerror)

  • NF90_close (netcdf::nf90_close)

subroutine get_varid(varname, ncid, filename, varid, match_case, found)

get_varid finds the netcdf handle for the potentially case-insensitive variable name in a file

Parameters
  • varname [in]

    The name of the variable that is being sought

  • ncid [in]

    The open netcdf handle for the file

  • filename [in]

    name of the file to read, used here in messages

  • varid [out]

    The netcdf handle for the variable

  • match_case [in]

    If false, allow for variables name matches to be case insensitive, but take a perfect match if found. The default is true.

  • found [out]

    Returns true if the attribute is found

Callees call graph
Callees of mom_io::get_varid calls cluster_mom_error_handler MOM_error_handler cluster_mom_io MOM_io cluster_mom_string_functions MOM_string_functions mom_error_handler::mom_error MOM_error mom_io::get_varid get_varid [private/internal] mom_io::get_varid->mom_error_handler::mom_error mom_string_functions::lowercase lowercase mom_io::get_varid->mom_string_functions::lowercase
Text view
Callers call graph
Callers of mom_io::get_varid calls cluster_mom_io MOM_io mom_io::get_varid get_varid [private/internal] mom_io::read_attribute_int32 read_attribute_int32 [private/internal] mom_io::read_attribute_int32->mom_io::get_varid mom_io::read_attribute_int64 read_attribute_int64 [private/internal] mom_io::read_attribute_int64->mom_io::get_varid mom_io::read_attribute_real read_attribute_real [private/internal] mom_io::read_attribute_real->mom_io::get_varid mom_io::read_attribute_str read_attribute_str [private/internal] mom_io::read_attribute_str->mom_io::get_varid mom_io::read_var_sizes read_var_sizes [private/internal] mom_io::read_var_sizes->mom_io::get_varid mom_io::read_variable_0d read_variable_0d [private/internal] mom_io::read_variable_0d->mom_io::get_varid mom_io::read_variable_0d_int read_variable_0d_int [private/internal] mom_io::read_variable_0d_int->mom_io::get_varid mom_io::read_variable_1d read_variable_1d [private/internal] mom_io::read_variable_1d->mom_io::get_varid mom_io::read_variable_1d_int read_variable_1d_int [private/internal] mom_io::read_variable_1d_int->mom_io::get_varid mom_io::read_variable_2d read_variable_2d [private/internal] mom_io::read_variable_2d->mom_io::get_varid mom_io::read_variable_3d read_variable_3d [private/internal] mom_io::read_variable_3d->mom_io::get_varid
Text view

External calls

netcdf
  • NF90_INQ_VARID (netcdf::nf90_inq_varid)

  • NF90_STRERROR (netcdf::nf90_strerror)

  • NF90_inquire (netcdf::nf90_inquire)

  • nf90_inq_varids (netcdf::nf90_inq_varids)

  • nf90_inquire_variable (netcdf::nf90_inquire_variable)

subroutine verify_variable_units(filename, varname, expected_units, msg, ierr, alt_units)

Verify that a file contains a named variable with the expected units.

Parameters
  • filename [in]

    File name

  • varname [in]

    Variable name

  • expected_units [in]

    Expected units of variable

  • msg [inout]

    Message to use for errors

  • ierr [out]

    True if an error occurs

  • alt_units [in]

    Alterate acceptable units of variable

Callees call graph
Callees of mom_io::verify_variable_units calls cluster_mom_error_infra MOM_error_infra cluster_mom_io MOM_io mom_error_infra::is_root_pe is_root_pe mom_io::open_file_to_read open_file_to_read mom_io::verify_variable_units verify_variable_units mom_io::verify_variable_units->mom_error_infra::is_root_pe mom_io::verify_variable_units->mom_io::open_file_to_read
Text view
Callers call graph
Callers of mom_io::verify_variable_units calls cluster_mom_io MOM_io cluster_mom_regridding MOM_regridding mom_io::verify_variable_units verify_variable_units mom_regridding::initialize_regridding initialize_regridding mom_regridding::initialize_regridding->mom_io::verify_variable_units
Text view

External calls

netcdf
  • NF90_GET_ATT (netcdf::nf90_get_att)

  • NF90_INQ_VARID (netcdf::nf90_inq_varid)

  • NF90_close (netcdf::nf90_close)

function var_desc(name, units, longname, hor_grid, z_grid, t_grid, cmor_field_name, cmor_units, cmor_longname, conversion, caller, position, dim_names, extra_axes, fixed) result(vd)

Returns a vardesc type whose elements have been filled with the provided fields. The argument name is required, while the others are optional and have default values that are empty strings or are appropriate for a 3-d tracer field at the tracer cell centers.

Parameters
  • name [in]

    variable name

  • units [in]

    variable units

  • longname [in]

    variable long name

  • hor_grid [in]

    A character string indicating the horizontal position of this variable

  • z_grid [in]

    variable vertical staggering

  • t_grid [in]

    time description: s, p, or 1

  • cmor_field_name [in]

    CMOR name

  • cmor_units [in]

    CMOR physical dimensions of variable

  • cmor_longname [in]

    CMOR long name

  • conversion [in]

    for unit conversions, such as needed to convert from intensive to extensive [various] or [a A-1 ~> 1]

  • caller [in]

    The calling routine for error messages

  • position [in]

    A coded integer indicating the horizontal position of this variable if it has such dimensions. Valid values include CORNER, CENTER, EAST_FACE NORTH_FACE, and 0 for no horizontal dimensions.

  • dim_names [in]

    The names of the dimensions of this variable

  • extra_axes [in]

    dimensions other than space-time

  • fixed [in]

    If true, this does not evolve with time

  • vd

    vardesc type that is created

Callees call graph
Callees of mom_io::var_desc calls cluster_mom_io MOM_io mom_io::modify_vardesc modify_vardesc mom_io::safe_string_copy safe_string_copy [private/internal] mom_io::var_desc var_desc mom_io::var_desc->mom_io::modify_vardesc mom_io::var_desc->mom_io::safe_string_copy
Text view
Callers call graph
Callers of mom_io::var_desc calls cluster_advection_test_tracer advection_test_tracer cluster_boundary_impulse_tracer boundary_impulse_tracer cluster_dome_tracer DOME_tracer cluster_dyed_obc_tracer dyed_obc_tracer cluster_ideal_age_example ideal_age_example cluster_isomip_tracer ISOMIP_tracer cluster_marbl_tracers MARBL_tracers cluster_mom MOM cluster_mom_barotropic MOM_barotropic cluster_mom_cfc_cap MOM_CFC_cap cluster_mom_coord_initialization MOM_coord_initialization cluster_mom_dynamics_split_rk2 MOM_dynamics_split_RK2 cluster_mom_dynamics_split_rk2b MOM_dynamics_split_RK2b cluster_mom_harmonic_analysis MOM_harmonic_analysis cluster_mom_hybgen_regrid MOM_hybgen_regrid cluster_mom_ice_shelf MOM_ice_shelf cluster_mom_io MOM_io cluster_mom_ocmip2_cfc MOM_OCMIP2_CFC cluster_mom_oda_incupd MOM_oda_incupd cluster_mom_open_boundary MOM_open_boundary cluster_mom_regridding MOM_regridding cluster_mom_restart MOM_restart cluster_mom_self_attr_load MOM_self_attr_load cluster_mom_set_visc MOM_set_visc cluster_mom_shared_initialization MOM_shared_initialization cluster_mom_sum_output MOM_sum_output cluster_mom_wave_interface MOM_wave_interface cluster_nw2_tracers nw2_tracers cluster_oil_tracer oil_tracer cluster_pseudo_salt_tracer pseudo_salt_tracer cluster_regional_dyes regional_dyes cluster_rgc_tracer RGC_tracer cluster_user_tracer_example USER_tracer_example advection_test_tracer::register_advection_test_tracer register_advection_test_tracer mom_io::var_desc var_desc advection_test_tracer::register_advection_test_tracer->mom_io::var_desc boundary_impulse_tracer::register_boundary_impulse_tracer register_boundary_impulse_tracer boundary_impulse_tracer::register_boundary_impulse_tracer->mom_io::var_desc dome_tracer::register_dome_tracer register_DOME_tracer dome_tracer::register_dome_tracer->mom_io::var_desc dyed_obc_tracer::register_dyed_obc_tracer register_dyed_obc_tracer dyed_obc_tracer::register_dyed_obc_tracer->mom_io::var_desc ideal_age_example::register_ideal_age_tracer register_ideal_age_tracer ideal_age_example::register_ideal_age_tracer->mom_io::var_desc isomip_tracer::register_isomip_tracer register_ISOMIP_tracer isomip_tracer::register_isomip_tracer->mom_io::var_desc marbl_tracers::register_marbl_tracers register_MARBL_tracers marbl_tracers::register_marbl_tracers->mom_io::var_desc mom::initialize_mom initialize_MOM mom::initialize_mom->mom_io::var_desc mom::set_restart_fields set_restart_fields [private/internal] mom::set_restart_fields->mom_io::var_desc mom_barotropic::register_barotropic_restarts register_barotropic_restarts mom_barotropic::register_barotropic_restarts->mom_io::var_desc mom_cfc_cap::register_cfc_cap register_CFC_cap mom_cfc_cap::register_cfc_cap->mom_io::var_desc mom_coord_initialization::write_vertgrid_file write_vertgrid_file mom_coord_initialization::write_vertgrid_file->mom_io::var_desc mom_dynamics_split_rk2::register_restarts_dyn_split_rk2 register_restarts_dyn_split_RK2 mom_dynamics_split_rk2::register_restarts_dyn_split_rk2->mom_io::var_desc mom_dynamics_split_rk2b::register_restarts_dyn_split_rk2b register_restarts_dyn_split_RK2b mom_dynamics_split_rk2b::register_restarts_dyn_split_rk2b->mom_io::var_desc mom_harmonic_analysis::ha_write HA_write [private/internal] mom_harmonic_analysis::ha_write->mom_io::var_desc mom_hybgen_regrid::write_hybgen_coord_file write_Hybgen_coord_file mom_hybgen_regrid::write_hybgen_coord_file->mom_io::var_desc mom_ice_shelf::initialize_ice_shelf initialize_ice_shelf mom_ice_shelf::initialize_ice_shelf->mom_io::var_desc mom_ocmip2_cfc::register_ocmip2_cfc register_OCMIP2_CFC mom_ocmip2_cfc::register_ocmip2_cfc->mom_io::var_desc mom_oda_incupd::output_oda_incupd_inc output_oda_incupd_inc mom_oda_incupd::output_oda_incupd_inc->mom_io::var_desc mom_open_boundary::open_boundary_register_restarts open_boundary_register_restarts mom_open_boundary::open_boundary_register_restarts->mom_io::var_desc mom_regridding::write_regrid_file write_regrid_file mom_regridding::write_regrid_file->mom_io::var_desc mom_restart::register_restart_field_0d register_restart_field_0d [private/internal] mom_restart::register_restart_field_0d->mom_io::var_desc mom_restart::register_restart_field_1d register_restart_field_1d [private/internal] mom_restart::register_restart_field_1d->mom_io::var_desc mom_restart::register_restart_field_2d register_restart_field_2d [private/internal] mom_restart::register_restart_field_2d->mom_io::var_desc mom_restart::register_restart_field_3d register_restart_field_3d [private/internal] mom_restart::register_restart_field_3d->mom_io::var_desc mom_restart::register_restart_field_4d register_restart_field_4d [private/internal] mom_restart::register_restart_field_4d->mom_io::var_desc mom_self_attr_load::sal_init SAL_init mom_self_attr_load::sal_init->mom_io::var_desc mom_set_visc::set_visc_register_restarts set_visc_register_restarts mom_set_visc::set_visc_register_restarts->mom_io::var_desc mom_shared_initialization::write_ocean_geometry_file write_ocean_geometry_file mom_shared_initialization::write_ocean_geometry_file->mom_io::var_desc mom_sum_output::write_depth_list write_depth_list [private/internal] mom_sum_output::write_depth_list->mom_io::var_desc mom_sum_output::write_energy write_energy mom_sum_output::write_energy->mom_io::var_desc mom_wave_interface::waves_register_restarts waves_register_restarts mom_wave_interface::waves_register_restarts->mom_io::var_desc nw2_tracers::register_nw2_tracers register_nw2_tracers nw2_tracers::register_nw2_tracers->mom_io::var_desc oil_tracer::register_oil_tracer register_oil_tracer oil_tracer::register_oil_tracer->mom_io::var_desc pseudo_salt_tracer::register_pseudo_salt_tracer register_pseudo_salt_tracer pseudo_salt_tracer::register_pseudo_salt_tracer->mom_io::var_desc regional_dyes::register_dye_tracer register_dye_tracer regional_dyes::register_dye_tracer->mom_io::var_desc rgc_tracer::register_rgc_tracer register_RGC_tracer rgc_tracer::register_rgc_tracer->mom_io::var_desc user_tracer_example::user_register_tracer_example USER_register_tracer_example user_tracer_example::user_register_tracer_example->mom_io::var_desc
Text view
subroutine modify_vardesc(vd, name, units, longname, hor_grid, z_grid, t_grid, cmor_field_name, cmor_units, cmor_longname, conversion, caller, position, dim_names, extra_axes)

This routine modifies the named elements of a vardesc type. All arguments are optional, except the vardesc type to be modified.

Parameters
  • vd [inout]

    vardesc type that is modified

  • name [in]

    name of variable

  • units [in]

    units of variable

  • longname [in]

    long name of variable

  • hor_grid [in]

    horizontal staggering of variable

  • z_grid [in]

    vertical staggering of variable

  • t_grid [in]

    time description: s, p, or 1

  • cmor_field_name [in]

    CMOR name

  • cmor_units [in]

    CMOR physical dimensions of variable

  • cmor_longname [in]

    CMOR long name

  • conversion [in]

    A multiplicative factor for unit conversions, such as needed to convert from intensive to extensive or dimensional consistency testing [various] or [a A-1 ~> 1]

  • caller [in]

    The calling routine for error messages

  • position [in]

    A coded integer indicating the horizontal position of this variable if it has such dimensions. Valid values include CORNER, CENTER, EAST_FACE NORTH_FACE, and 0 for no horizontal dimensions.

  • dim_names [in]

    The names of the dimensions of this variable

  • extra_axes [in]

    dimensions other than space-time

Callees call graph
Callees of mom_io::modify_vardesc calls cluster_mom_error_handler MOM_error_handler cluster_mom_io MOM_io mom_error_handler::mom_error MOM_error mom_io::modify_vardesc modify_vardesc mom_io::modify_vardesc->mom_error_handler::mom_error mom_io::position_from_horgrid position_from_horgrid mom_io::modify_vardesc->mom_io::position_from_horgrid mom_io::safe_string_copy safe_string_copy [private/internal] mom_io::modify_vardesc->mom_io::safe_string_copy
Text view
Callers call graph
Callers of mom_io::modify_vardesc calls cluster_mom_io MOM_io cluster_mom_restart MOM_restart mom_io::modify_vardesc modify_vardesc mom_io::var_desc var_desc mom_io::var_desc->mom_io::modify_vardesc mom_restart::save_restart save_restart mom_restart::save_restart->mom_io::modify_vardesc
Text view

integer function position_from_horgrid(hor_grid)

Parameters
  • hor_grid [in]

    horizontal staggering of variable

Callers call graph
Callers of mom_io::position_from_horgrid calls cluster_mom_io MOM_io mom_io::create_mom_file create_MOM_file mom_io::position_from_horgrid position_from_horgrid mom_io::create_mom_file->mom_io::position_from_horgrid mom_io::modify_vardesc modify_vardesc mom_io::modify_vardesc->mom_io::position_from_horgrid mom_io::query_vardesc query_vardesc mom_io::query_vardesc->mom_io::position_from_horgrid
Text view
subroutine set_axis_info(axis, name, units, longname, ax_size, ax_data, cartesian, sense)

Store information that can be used to create an axis in a subsequent call to create_file.

Parameters
  • axis [inout]

    A type with information about a named axis

  • name [in]

    The name of this axis for use in files

  • units [in]

    The units of the axis labels

  • longname [in]

    Long name of the axis variable

  • ax_size [in]

    The number of elements in this axis

  • ax_data [in]

    The values of the data on the axis [arbitrary]

  • cartesian [in]

    A variable indicating which direction this axis axis corresponds with. Valid values include 'X', 'Y', 'Z', 'T', and 'N' (the default) for none.

  • sense [in]

    This is 1 for axes whose values increase upward, or -1 if they increase downward. The default, 0, is ignored.

Callees call graph
Callees of mom_io::set_axis_info calls cluster_mom_error_handler MOM_error_handler cluster_mom_io MOM_io mom_error_handler::mom_error MOM_error mom_io::safe_string_copy safe_string_copy [private/internal] mom_io::set_axis_info set_axis_info mom_io::set_axis_info->mom_error_handler::mom_error mom_io::set_axis_info->mom_io::safe_string_copy
Text view
Callers call graph
Callers of mom_io::set_axis_info calls cluster_mom_internal_tides MOM_internal_tides cluster_mom_interpolate MOM_interpolate cluster_mom_io MOM_io cluster_mom_streaming_filter MOM_streaming_filter cluster_mom_sum_output MOM_sum_output mom_internal_tides::register_int_tide_restarts register_int_tide_restarts mom_io::set_axis_info set_axis_info mom_internal_tides::register_int_tide_restarts->mom_io::set_axis_info mom_interpolate::get_external_field_info get_external_field_info mom_interpolate::get_external_field_info->mom_io::set_axis_info mom_io::get_var_axes_info get_var_axes_info mom_io::get_var_axes_info->mom_io::set_axis_info mom_io::query_vardesc query_vardesc mom_io::query_vardesc->mom_io::set_axis_info mom_streaming_filter::filt_register Filt_register mom_streaming_filter::filt_register->mom_io::set_axis_info mom_sum_output::write_depth_list write_depth_list [private/internal] mom_sum_output::write_depth_list->mom_io::set_axis_info
Text view
subroutine delete_axis_info(axes)

Delete the information in an array of axis_info types and deallocate memory in them.

Parameters
  • axes [inout]

    An array with information about named axes

Callers call graph
Callers of mom_io::delete_axis_info calls cluster_mom_io MOM_io cluster_mom_sum_output MOM_sum_output mom_io::delete_axis_info delete_axis_info mom_sum_output::write_depth_list write_depth_list [private/internal] mom_sum_output::write_depth_list->mom_io::delete_axis_info
Text view
subroutine get_axis_info(axis, name, longname, units, cartesian, ax_size, ax_data)

Retrieve the information from an axis_info type.

Parameters
  • axis [in]

    An axis type

  • name [out]

    The axis name.

  • longname [out]

    The axis longname.

  • units [out]

    The axis units.

  • cartesian [out]

    The cartesian attribute of the axis [X,Y,Z,T].

  • ax_size [out]

    The size of the axis.

  • ax_data [out]

    The axis label data [arbitrary]

Callers call graph
Callers of mom_io::get_axis_info calls cluster_mom_horizontal_regridding MOM_horizontal_regridding cluster_mom_io MOM_io mom_horizontal_regridding::horiz_interp_and_extrap_tracer_fms_id horiz_interp_and_extrap_tracer_fms_id [private/internal] mom_io::get_axis_info get_axis_info mom_horizontal_regridding::horiz_interp_and_extrap_tracer_fms_id->mom_io::get_axis_info mom_horizontal_regridding::horiz_interp_and_extrap_tracer_record horiz_interp_and_extrap_tracer_record [private/internal] mom_horizontal_regridding::horiz_interp_and_extrap_tracer_record->mom_io::get_axis_info
Text view
subroutine set_attribute_info(attribute, name, str_value)

Store information that can be used to create an attribute in a subsequent call to create_file.

Parameters
  • attribute [inout]

    A type with information about a named attribute

  • name [in]

    The name of this attribute for use in files

  • str_value [in]

    The value of this attribute

Callers call graph
Callers of mom_io::set_attribute_info calls cluster_mom_io MOM_io cluster_mom_sum_output MOM_sum_output mom_io::set_attribute_info set_attribute_info mom_sum_output::write_depth_list write_depth_list [private/internal] mom_sum_output::write_depth_list->mom_io::set_attribute_info
Text view
subroutine delete_attribute_info(atts)

Delete the information in an array of attribute_info types and deallocate memory in them.

Parameters
  • atts [inout]

    An array of global attributes

Callers call graph
Callers of mom_io::delete_attribute_info calls cluster_mom_io MOM_io cluster_mom_sum_output MOM_sum_output mom_io::delete_attribute_info delete_attribute_info mom_sum_output::write_depth_list write_depth_list [private/internal] mom_sum_output::write_depth_list->mom_io::delete_attribute_info
Text view
function cmor_long_std(longname) result(std_name)

This function returns the CMOR standard name given a CMOR longname, based on the standard pattern of character conversions.

Parameters
  • longname [in]

    The CMOR longname being converted

  • std_name

    The CMOR standard name generated from longname

Callees call graph
Callees of mom_io::cmor_long_std calls cluster_mom_io MOM_io cluster_mom_string_functions MOM_string_functions mom_io::cmor_long_std cmor_long_std mom_string_functions::lowercase lowercase mom_io::cmor_long_std->mom_string_functions::lowercase
Text view
Callers call graph
Callers of mom_io::cmor_long_std calls cluster_mom_io MOM_io cluster_mom_tracer_registry MOM_tracer_registry mom_io::cmor_long_std cmor_long_std mom_tracer_registry::register_tracer_diagnostics register_tracer_diagnostics mom_tracer_registry::register_tracer_diagnostics->mom_io::cmor_long_std
Text view
subroutine query_vardesc(vd, name, units, longname, hor_grid, z_grid, t_grid, cmor_field_name, cmor_units, cmor_longname, conversion, caller, extra_axes, position, dim_names)

This routine queries vardesc

Parameters
  • vd [in]

    vardesc type that is queried

  • name [out]

    name of variable

  • units [out]

    units of variable

  • longname [out]

    long name of variable

  • hor_grid [out]

    horizontal staggering of variable

  • z_grid [out]

    verticle staggering of variable

  • t_grid [out]

    time description: s, p, or 1

  • cmor_field_name [out]

    CMOR name

  • cmor_units [out]

    CMOR physical dimensions of variable

  • cmor_longname [out]

    CMOR long name

  • conversion [out]

    for unit conversions, such as needed to convert from intensive to extensive [various] or [a A-1 ~> 1]

  • caller [in]

    calling routine?

  • extra_axes [out]

    dimensions other than space-time

  • position [out]

    A coded integer indicating the horizontal position of this variable if it has such dimensions. Valid values include CORNER, CENTER, EAST_FACE NORTH_FACE, and 0 for no horizontal dimensions.

  • dim_names [out]

    The names of the dimensions of this variable

Callees call graph
Callees of mom_io::query_vardesc calls cluster_mom_io MOM_io mom_io::position_from_horgrid position_from_horgrid mom_io::query_vardesc query_vardesc mom_io::query_vardesc->mom_io::position_from_horgrid mom_io::safe_string_copy safe_string_copy [private/internal] mom_io::query_vardesc->mom_io::safe_string_copy mom_io::set_axis_info set_axis_info mom_io::query_vardesc->mom_io::set_axis_info
Text view
Callers call graph
Callers of mom_io::query_vardesc calls cluster_advection_test_tracer advection_test_tracer cluster_boundary_impulse_tracer boundary_impulse_tracer cluster_dome_tracer DOME_tracer cluster_dyed_obc_tracer dyed_obc_tracer cluster_ideal_age_example ideal_age_example cluster_isomip_tracer ISOMIP_tracer cluster_marbl_tracers MARBL_tracers cluster_mom_cfc_cap MOM_CFC_cap cluster_mom_diag_mediator MOM_diag_mediator cluster_mom_io MOM_io cluster_mom_ocmip2_cfc MOM_OCMIP2_CFC cluster_mom_restart MOM_restart cluster_mom_tracer_registry MOM_tracer_registry cluster_oil_tracer oil_tracer cluster_pseudo_salt_tracer pseudo_salt_tracer cluster_regional_dyes regional_dyes cluster_rgc_tracer RGC_tracer cluster_user_tracer_example USER_tracer_example advection_test_tracer::advection_test_stock advection_test_stock mom_io::query_vardesc query_vardesc advection_test_tracer::advection_test_stock->mom_io::query_vardesc advection_test_tracer::initialize_advection_test_tracer initialize_advection_test_tracer advection_test_tracer::initialize_advection_test_tracer->mom_io::query_vardesc boundary_impulse_tracer::boundary_impulse_stock boundary_impulse_stock boundary_impulse_tracer::boundary_impulse_stock->mom_io::query_vardesc boundary_impulse_tracer::initialize_boundary_impulse_tracer initialize_boundary_impulse_tracer boundary_impulse_tracer::initialize_boundary_impulse_tracer->mom_io::query_vardesc boundary_impulse_tracer::register_boundary_impulse_tracer register_boundary_impulse_tracer boundary_impulse_tracer::register_boundary_impulse_tracer->mom_io::query_vardesc dome_tracer::initialize_dome_tracer initialize_DOME_tracer dome_tracer::initialize_dome_tracer->mom_io::query_vardesc dyed_obc_tracer::initialize_dyed_obc_tracer initialize_dyed_obc_tracer dyed_obc_tracer::initialize_dyed_obc_tracer->mom_io::query_vardesc ideal_age_example::ideal_age_stock ideal_age_stock ideal_age_example::ideal_age_stock->mom_io::query_vardesc ideal_age_example::initialize_ideal_age_tracer initialize_ideal_age_tracer ideal_age_example::initialize_ideal_age_tracer->mom_io::query_vardesc ideal_age_example::register_ideal_age_tracer register_ideal_age_tracer ideal_age_example::register_ideal_age_tracer->mom_io::query_vardesc isomip_tracer::initialize_isomip_tracer initialize_ISOMIP_tracer isomip_tracer::initialize_isomip_tracer->mom_io::query_vardesc marbl_tracers::initialize_marbl_tracers initialize_MARBL_tracers marbl_tracers::initialize_marbl_tracers->mom_io::query_vardesc marbl_tracers::marbl_tracers_stock MARBL_tracers_stock marbl_tracers::marbl_tracers_stock->mom_io::query_vardesc marbl_tracers::register_marbl_tracers register_MARBL_tracers marbl_tracers::register_marbl_tracers->mom_io::query_vardesc mom_cfc_cap::cfc_cap_stock CFC_cap_stock mom_cfc_cap::cfc_cap_stock->mom_io::query_vardesc mom_diag_mediator::ocean_register_diag ocean_register_diag mom_diag_mediator::ocean_register_diag->mom_io::query_vardesc mom_ocmip2_cfc::ocmip2_cfc_stock OCMIP2_CFC_stock mom_ocmip2_cfc::ocmip2_cfc_stock->mom_io::query_vardesc mom_restart::lock_check lock_check mom_restart::lock_check->mom_io::query_vardesc mom_restart::register_restart_field_ptr0d register_restart_field_ptr0d [private/internal] mom_restart::register_restart_field_ptr0d->mom_io::query_vardesc mom_restart::register_restart_field_ptr1d register_restart_field_ptr1d [private/internal] mom_restart::register_restart_field_ptr1d->mom_io::query_vardesc mom_restart::register_restart_field_ptr2d register_restart_field_ptr2d [private/internal] mom_restart::register_restart_field_ptr2d->mom_io::query_vardesc mom_restart::register_restart_field_ptr3d register_restart_field_ptr3d [private/internal] mom_restart::register_restart_field_ptr3d->mom_io::query_vardesc mom_restart::register_restart_field_ptr4d register_restart_field_ptr4d [private/internal] mom_restart::register_restart_field_ptr4d->mom_io::query_vardesc mom_restart::restore_state restore_state mom_restart::restore_state->mom_io::query_vardesc mom_restart::save_restart save_restart mom_restart::save_restart->mom_io::query_vardesc mom_tracer_registry::register_tracer register_tracer mom_tracer_registry::register_tracer->mom_io::query_vardesc oil_tracer::initialize_oil_tracer initialize_oil_tracer oil_tracer::initialize_oil_tracer->mom_io::query_vardesc oil_tracer::oil_stock oil_stock oil_tracer::oil_stock->mom_io::query_vardesc oil_tracer::register_oil_tracer register_oil_tracer oil_tracer::register_oil_tracer->mom_io::query_vardesc pseudo_salt_tracer::initialize_pseudo_salt_tracer initialize_pseudo_salt_tracer pseudo_salt_tracer::initialize_pseudo_salt_tracer->mom_io::query_vardesc pseudo_salt_tracer::pseudo_salt_stock pseudo_salt_stock pseudo_salt_tracer::pseudo_salt_stock->mom_io::query_vardesc pseudo_salt_tracer::register_pseudo_salt_tracer register_pseudo_salt_tracer pseudo_salt_tracer::register_pseudo_salt_tracer->mom_io::query_vardesc regional_dyes::dye_stock dye_stock regional_dyes::dye_stock->mom_io::query_vardesc regional_dyes::register_dye_tracer register_dye_tracer regional_dyes::register_dye_tracer->mom_io::query_vardesc rgc_tracer::initialize_rgc_tracer initialize_RGC_tracer rgc_tracer::initialize_rgc_tracer->mom_io::query_vardesc user_tracer_example::user_initialize_tracer USER_initialize_tracer user_tracer_example::user_initialize_tracer->mom_io::query_vardesc user_tracer_example::user_tracer_stock USER_tracer_stock user_tracer_example::user_tracer_stock->mom_io::query_vardesc
Text view
subroutine MOM_read_data_0d(filename, fieldname, data, timelevel, scale, MOM_Domain, global_file, file_may_be_4d)

Read a scalar from file using infrastructure I/O.

Parameters
  • filename [in]

    Input filename

  • fieldname [in]

    Field variable name

  • data [inout]

    Field value in arbitrary units [A ~> a]

  • timelevel [in]

    Time level to read in file

  • scale [in]

    A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]

  • MOM_Domain [in]

    Model domain decomposition

  • global_file [in]

    If true, read from a single file

  • file_may_be_4d [in]

    If true, fields may be stored as 4d arrays in the file.

Callees call graph
Callees of mom_io::mom_read_data_0d calls cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_io::mom_read_data_0d MOM_read_data_0d [private/internal] mom_io_infra::interface::read_field read_field (interface) mom_io::mom_read_data_0d->mom_io_infra::interface::read_field
Text view
subroutine MOM_read_data_0d_int(filename, fieldname, data, timelevel)

Read a scalar integer from file using infrastructure I/O.

Parameters
  • filename [in]

    Input filename

  • fieldname [in]

    Field variable name

  • data [inout]

    Field value

  • timelevel [in]

    Time level to read in file

Callees call graph
Callees of mom_io::mom_read_data_0d_int calls cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_io::mom_read_data_0d_int MOM_read_data_0d_int [private/internal] mom_io_infra::interface::read_field read_field (interface) mom_io::mom_read_data_0d_int->mom_io_infra::interface::read_field
Text view
subroutine MOM_read_data_1d(filename, fieldname, data, timelevel, scale, MOM_Domain, global_file, file_may_be_4d)

Read a 1d array from file using infrastructure I/O.

Parameters
  • filename [in]

    Input filename

  • fieldname [in]

    Field variable name

  • data [inout]

    Field value in arbitrary units [A ~> a]

  • timelevel [in]

    Time level to read in file

  • scale [in]

    A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]

  • MOM_Domain [in]

    Model domain decomposition

  • global_file [in]

    If true, read from a single file

  • file_may_be_4d [in]

    If true, fields may be stored as 4d arrays in the file.

Callees call graph
Callees of mom_io::mom_read_data_1d calls cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_io::mom_read_data_1d MOM_read_data_1d [private/internal] mom_io_infra::interface::read_field read_field (interface) mom_io::mom_read_data_1d->mom_io_infra::interface::read_field
Text view
subroutine MOM_read_data_1d_int(filename, fieldname, data, timelevel)

Read a 1d integer array from file using infrastructure I/O.

Parameters
  • filename [in]

    Input filename

  • fieldname [in]

    Field variable name

  • data [inout]

    Field value

  • timelevel [in]

    Time level to read in file

Callees call graph
Callees of mom_io::mom_read_data_1d_int calls cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_io::mom_read_data_1d_int MOM_read_data_1d_int [private/internal] mom_io_infra::interface::read_field read_field (interface) mom_io::mom_read_data_1d_int->mom_io_infra::interface::read_field
Text view
subroutine MOM_read_data_2d(filename, fieldname, data, MOM_Domain, timelevel, position, scale, global_file, file_may_be_4d, turns)

Read a 2d array from file using infrastructure I/O.

Parameters
  • filename [in]

    Input filename

  • fieldname [in]

    Field variable name

  • data [inout]

    Field value in arbitrary units [A ~> a]

  • MOM_Domain [in]

    Model domain decomposition

  • timelevel [in]

    Time level to read in file

  • position [in]

    Grid positioning flag

  • scale [in]

    A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]

  • global_file [in]

    If true, read from a single file

  • file_may_be_4d [in]

    If true, fields may be stored as 4d arrays in the file.

  • turns [in]

    Number of quarter-turns to rotate the data. If absent the number of turns is taken from MOM_Domain.

Callees call graph
Callees of mom_io::mom_read_data_2d calls cluster_mom_array_transform MOM_array_transform cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_array_transform::interface::allocate_rotated_array allocate_rotated_array (interface) mom_array_transform::interface::rotate_array rotate_array (interface) mom_io::mom_read_data_2d MOM_read_data_2d [private/internal] mom_io::mom_read_data_2d->mom_array_transform::interface::allocate_rotated_array mom_io::mom_read_data_2d->mom_array_transform::interface::rotate_array mom_io_infra::interface::read_field read_field (interface) mom_io::mom_read_data_2d->mom_io_infra::interface::read_field
Text view
subroutine read_netCDF_data_2d(filename, fieldname, values, MOM_Domain, timelevel, position, rescale, turns)

Read a 2d array (which might have halos) from a file using native netCDF I/O.

Parameters
  • filename [in]

    Input filename

  • fieldname [in]

    Field variable name

  • values [inout]

    Field values read from the file. It would be intent(out) but for the need to preserve any initialized values in the halo regions.

  • MOM_Domain [in]

    Model domain decomposition

  • timelevel [in]

    Time level to read in file

  • position [in]

    Grid positioning flag

  • rescale [in]

    Rescale factor, omitting this is the same as setting it to 1.

  • turns [in]

    Number of quarter-turns to rotate the data. If absent the number of turns is taken from MOM_Domain.

Callees call graph
Callees of mom_io::read_netcdf_data_2d calls cluster_mom_array_transform MOM_array_transform cluster_mom_error_handler MOM_error_handler cluster_mom_io MOM_io mom_array_transform::interface::allocate_rotated_array allocate_rotated_array (interface) mom_array_transform::interface::rotate_array rotate_array (interface) mom_error_handler::mom_error MOM_error mom_io::read_netcdf_data_2d read_netCDF_data_2d [private/internal] mom_io::read_netcdf_data_2d->mom_array_transform::interface::allocate_rotated_array mom_io::read_netcdf_data_2d->mom_array_transform::interface::rotate_array mom_io::read_netcdf_data_2d->mom_error_handler::mom_error
Text view
subroutine MOM_read_data_2d_region(filename, fieldname, data, start, nread, MOM_domain, no_domain, scale, turns)

Read a 2d region array from file using infrastructure I/O.

Parameters
  • filename [in]

    Input filename

  • fieldname [in]

    Field variable name

  • data [inout]

    Field value in arbitrary units [A ~> a]

  • start [in]

    Starting index for each axis. In 2d, start(3:4) must be 1.

  • nread [in]

    Number of values to read along each axis. In 2d, nread(3:4) must be 1.

  • MOM_Domain [in]

    Model domain decomposition

  • no_domain [in]

    If true, field does not use domain decomposion.

  • scale [in]

    A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]

  • turns [in]

    Number of quarter turns from input to model grid

Callees call graph
Callees of mom_io::mom_read_data_2d_region calls cluster_mom_array_transform MOM_array_transform cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_array_transform::interface::allocate_rotated_array allocate_rotated_array (interface) mom_array_transform::interface::rotate_array rotate_array (interface) mom_io::mom_read_data_2d_region MOM_read_data_2d_region [private/internal] mom_io::mom_read_data_2d_region->mom_array_transform::interface::allocate_rotated_array mom_io::mom_read_data_2d_region->mom_array_transform::interface::rotate_array mom_io_infra::interface::read_field read_field (interface) mom_io::mom_read_data_2d_region->mom_io_infra::interface::read_field
Text view
subroutine MOM_read_data_3d(filename, fieldname, data, MOM_Domain, timelevel, position, scale, global_file, file_may_be_4d, turns)

Read a 3d array from file using infrastructure I/O.

Parameters
  • filename [in]

    Input filename

  • fieldname [in]

    Field variable name

  • data [inout]

    Field value in arbitrary units [A ~> a]

  • MOM_Domain [in]

    Model domain decomposition

  • timelevel [in]

    Time level to read in file

  • position [in]

    Grid positioning flag

  • scale [in]

    A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]

  • global_file [in]

    If true, read from a single file

  • file_may_be_4d [in]

    If true, fields may be stored as 4d arrays in the file.

  • turns [in]

    Number of quarter-turns to rotate the data. If absent the number of turns is taken from MOM_Domain.

Callees call graph
Callees of mom_io::mom_read_data_3d calls cluster_mom_array_transform MOM_array_transform cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_array_transform::interface::allocate_rotated_array allocate_rotated_array (interface) mom_array_transform::interface::rotate_array rotate_array (interface) mom_io::mom_read_data_3d MOM_read_data_3d [private/internal] mom_io::mom_read_data_3d->mom_array_transform::interface::allocate_rotated_array mom_io::mom_read_data_3d->mom_array_transform::interface::rotate_array mom_io_infra::interface::read_field read_field (interface) mom_io::mom_read_data_3d->mom_io_infra::interface::read_field
Text view
subroutine MOM_read_data_3d_region(filename, fieldname, data, start, nread, MOM_domain, no_domain, scale, turns)

Read a 3d region array from file using infrastructure I/O.

Parameters
  • filename [in]

    Input filename

  • fieldname [in]

    Field variable name

  • data [inout]

    Field value in arbitrary units [A ~> a]

  • start [in]

    Starting index for each axis.

  • nread [in]

    Number of values to read along each axis.

  • MOM_Domain [in]

    Model domain decomposition

  • no_domain [in]

    If true, field does not use domain decomposion.

  • scale [in]

    A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]

  • turns [in]

    Number of quarter turns from input to model grid

Callees call graph
Callees of mom_io::mom_read_data_3d_region calls cluster_mom_array_transform MOM_array_transform cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_array_transform::interface::allocate_rotated_array allocate_rotated_array (interface) mom_array_transform::interface::rotate_array rotate_array (interface) mom_io::mom_read_data_3d_region MOM_read_data_3d_region [private/internal] mom_io::mom_read_data_3d_region->mom_array_transform::interface::allocate_rotated_array mom_io::mom_read_data_3d_region->mom_array_transform::interface::rotate_array mom_io_infra::interface::read_field read_field (interface) mom_io::mom_read_data_3d_region->mom_io_infra::interface::read_field
Text view
subroutine MOM_read_data_4d(filename, fieldname, data, MOM_Domain, timelevel, position, scale, global_file, turns)

Read a 4d array from file using infrastructure I/O.

Parameters
  • filename [in]

    Input filename

  • fieldname [in]

    Field variable name

  • data [inout]

    Field value in arbitrary units [A ~> a]

  • MOM_Domain [in]

    Model domain decomposition

  • timelevel [in]

    Time level to read in file

  • position [in]

    Grid positioning flag

  • scale [in]

    A scaling factor that the variable is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]

  • global_file [in]

    If true, read from a single file

  • turns [in]

    Number of quarter-turns to rotate the data. If absent the number of turns is taken from MOM_Domain.

Callees call graph
Callees of mom_io::mom_read_data_4d calls cluster_mom_array_transform MOM_array_transform cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_array_transform::interface::allocate_rotated_array allocate_rotated_array (interface) mom_array_transform::interface::rotate_array rotate_array (interface) mom_io::mom_read_data_4d MOM_read_data_4d [private/internal] mom_io::mom_read_data_4d->mom_array_transform::interface::allocate_rotated_array mom_io::mom_read_data_4d->mom_array_transform::interface::rotate_array mom_io_infra::interface::read_field read_field (interface) mom_io::mom_read_data_4d->mom_io_infra::interface::read_field
Text view
subroutine MOM_read_vector_2d(filename, u_fieldname, v_fieldname, u_data, v_data, MOM_Domain, timelevel, stagger, scalar_pair, scale, turns)

Read a 2d vector tuple from file using infrastructure I/O.

Parameters
  • filename [in]

    Input filename

  • u_fieldname [in]

    Field variable name in u

  • v_fieldname [in]

    Field variable name in v

  • u_data [inout]

    Field value at u points in arbitrary units [A ~> a]

  • v_data [inout]

    Field value at v points in arbitrary units [A ~> a]

  • MOM_Domain [in]

    Model domain decomposition

  • timelevel [in]

    Time level to read in file

  • stagger [in]

    Grid staggering flag

  • scalar_pair [in]

    True if tuple is not a vector

  • scale [in]

    A scaling factor that the vector is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]

  • turns [in]

    Number of quarter-turns to rotate the data. If absent the number of turns is taken from MOM_Domain.

Callees call graph
Callees of mom_io::mom_read_vector_2d calls cluster_mom_array_transform MOM_array_transform cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_array_transform::interface::allocate_rotated_array allocate_rotated_array (interface) mom_array_transform::interface::rotate_array_pair rotate_array_pair (interface) mom_array_transform::interface::rotate_vector rotate_vector (interface) mom_io::mom_read_vector_2d MOM_read_vector_2d [private/internal] mom_io::mom_read_vector_2d->mom_array_transform::interface::allocate_rotated_array mom_io::mom_read_vector_2d->mom_array_transform::interface::rotate_array_pair mom_io::mom_read_vector_2d->mom_array_transform::interface::rotate_vector mom_io_infra::interface::read_vector read_vector (interface) mom_io::mom_read_vector_2d->mom_io_infra::interface::read_vector
Text view
subroutine MOM_read_vector_3d(filename, u_fieldname, v_fieldname, u_data, v_data, MOM_Domain, timelevel, stagger, scalar_pair, scale, turns)

Read a 3d vector tuple from file using infrastructure I/O.

Parameters
  • filename [in]

    Input filename

  • u_fieldname [in]

    Field variable name in u

  • v_fieldname [in]

    Field variable name in v

  • u_data [inout]

    Field value in u in arbitrary units [A ~> a]

  • v_data [inout]

    Field value in v in arbitrary units [A ~> a]

  • MOM_Domain [in]

    Model domain decomposition

  • timelevel [in]

    Time level to read in file

  • stagger [in]

    Grid staggering flag

  • scalar_pair [in]

    True if tuple is not a vector

  • scale [in]

    A scaling factor that the vector is multiplied by before it is returned to convert from the units in the file to the internal units for this variable [A a-1 ~> 1]

  • turns [in]

    Number of quarter-turns to rotate the data. If absent the number of turns is taken from MOM_Domain.

Callees call graph
Callees of mom_io::mom_read_vector_3d calls cluster_mom_array_transform MOM_array_transform cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_array_transform::interface::allocate_rotated_array allocate_rotated_array (interface) mom_array_transform::interface::rotate_array_pair rotate_array_pair (interface) mom_array_transform::interface::rotate_vector rotate_vector (interface) mom_io::mom_read_vector_3d MOM_read_vector_3d [private/internal] mom_io::mom_read_vector_3d->mom_array_transform::interface::allocate_rotated_array mom_io::mom_read_vector_3d->mom_array_transform::interface::rotate_array_pair mom_io::mom_read_vector_3d->mom_array_transform::interface::rotate_vector mom_io_infra::interface::read_vector read_vector (interface) mom_io::mom_read_vector_3d->mom_io_infra::interface::read_vector
Text view
subroutine MOM_write_field_legacy_4d(IO_handle, field_md, MOM_domain, field, tstamp, tile_count, fill_value, turns, scale, unscale, zero_zeros)

Write a 4d field to an output file, potentially with rotation

Parameters
  • IO_handle [inout]

    Handle for a file that is open for writing

  • field_md [in]

    Field type with metadata

  • MOM_domain [in]

    The MOM_Domain that describes the decomposition

  • field [inout]

    Unrotated field to write in arbitrary units [A ~> a]

  • tstamp [in]

    Model timestamp, often in [days]

  • tile_count [in]

    PEs per tile (default: 1)

  • fill_value [in]

    Missing data fill value in the units used in the file [a]

  • turns [in]

    Number of quarter-turns to rotate the data

  • scale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output

  • unscale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.

  • zero_zeros [in]

    If present and true, convert negative zeros into ordinary signless zeros.

Callees call graph
Callees of mom_io::mom_write_field_legacy_4d calls cluster_mom_array_transform MOM_array_transform cluster_mom_domain_infra MOM_domain_infra cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_array_transform::interface::allocate_rotated_array allocate_rotated_array (interface) mom_array_transform::interface::rotate_array rotate_array (interface) mom_domain_infra::interface::rescale_comp_data rescale_comp_data (interface) mom_io::mom_write_field_legacy_4d MOM_write_field_legacy_4d [private/internal] mom_io::mom_write_field_legacy_4d->mom_array_transform::interface::allocate_rotated_array mom_io::mom_write_field_legacy_4d->mom_array_transform::interface::rotate_array mom_io::mom_write_field_legacy_4d->mom_domain_infra::interface::rescale_comp_data mom_io_infra::interface::write_field write_field (interface) mom_io::mom_write_field_legacy_4d->mom_io_infra::interface::write_field
Text view
subroutine MOM_write_field_legacy_3d(IO_handle, field_md, MOM_domain, field, tstamp, tile_count, fill_value, turns, scale, unscale, zero_zeros)

Write a 3d field to an output file, potentially with rotation

Parameters
  • IO_handle [inout]

    Handle for a file that is open for writing

  • field_md [in]

    Field type with metadata

  • MOM_domain [in]

    The MOM_Domain that describes the decomposition

  • field [inout]

    Unrotated field to write in arbitrary units [A ~> a]

  • tstamp [in]

    Model timestamp, often in [days]

  • tile_count [in]

    PEs per tile (default: 1)

  • fill_value [in]

    Missing data fill value in the units used in the file [a]

  • turns [in]

    Number of quarter-turns to rotate the data

  • scale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output

  • unscale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.

  • zero_zeros [in]

    If present and true, convert negative zeros into ordinary signless zeros.

Callees call graph
Callees of mom_io::mom_write_field_legacy_3d calls cluster_mom_array_transform MOM_array_transform cluster_mom_domain_infra MOM_domain_infra cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_array_transform::interface::allocate_rotated_array allocate_rotated_array (interface) mom_array_transform::interface::rotate_array rotate_array (interface) mom_domain_infra::interface::rescale_comp_data rescale_comp_data (interface) mom_io::mom_write_field_legacy_3d MOM_write_field_legacy_3d [private/internal] mom_io::mom_write_field_legacy_3d->mom_array_transform::interface::allocate_rotated_array mom_io::mom_write_field_legacy_3d->mom_array_transform::interface::rotate_array mom_io::mom_write_field_legacy_3d->mom_domain_infra::interface::rescale_comp_data mom_io_infra::interface::write_field write_field (interface) mom_io::mom_write_field_legacy_3d->mom_io_infra::interface::write_field
Text view
subroutine MOM_write_field_legacy_2d(IO_handle, field_md, MOM_domain, field, tstamp, tile_count, fill_value, turns, scale, unscale, zero_zeros)

Write a 2d field to an output file, potentially with rotation

Parameters
  • IO_handle [inout]

    Handle for a file that is open for writing

  • field_md [in]

    Field type with metadata

  • MOM_domain [in]

    The MOM_Domain that describes the decomposition

  • field [inout]

    Unrotated field to write in arbitrary units [A ~> a]

  • tstamp [in]

    Model timestamp, often in [days]

  • tile_count [in]

    PEs per tile (default: 1)

  • fill_value [in]

    Missing data fill value

  • turns [in]

    Number of quarter-turns to rotate the data

  • scale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output

  • unscale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.

  • zero_zeros [in]

    If present and true, convert negative zeros into ordinary signless zeros.

Callees call graph
Callees of mom_io::mom_write_field_legacy_2d calls cluster_mom_array_transform MOM_array_transform cluster_mom_domain_infra MOM_domain_infra cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_array_transform::interface::allocate_rotated_array allocate_rotated_array (interface) mom_array_transform::interface::rotate_array rotate_array (interface) mom_domain_infra::interface::rescale_comp_data rescale_comp_data (interface) mom_io::mom_write_field_legacy_2d MOM_write_field_legacy_2d [private/internal] mom_io::mom_write_field_legacy_2d->mom_array_transform::interface::allocate_rotated_array mom_io::mom_write_field_legacy_2d->mom_array_transform::interface::rotate_array mom_io::mom_write_field_legacy_2d->mom_domain_infra::interface::rescale_comp_data mom_io_infra::interface::write_field write_field (interface) mom_io::mom_write_field_legacy_2d->mom_io_infra::interface::write_field
Text view
subroutine MOM_write_field_legacy_1d(IO_handle, field_md, field, tstamp, fill_value, scale, unscale, zero_zeros)

Write a 1d field to an output file

Parameters
  • IO_handle [inout]

    Handle for a file that is open for writing

  • field_md [in]

    Field type with metadata

  • field [in]

    Field to write in arbitrary units [A ~> a]

  • tstamp [in]

    Model timestamp, often in [days]

  • fill_value [in]

    Missing data fill value [a]

  • scale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output

  • unscale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.

  • zero_zeros [in]

    If present and true, convert negative zeros into ordinary signless zeros.

Callees call graph
Callees of mom_io::mom_write_field_legacy_1d calls cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_io::mom_write_field_legacy_1d MOM_write_field_legacy_1d [private/internal] mom_io_infra::interface::write_field write_field (interface) mom_io::mom_write_field_legacy_1d->mom_io_infra::interface::write_field
Text view
subroutine MOM_write_field_legacy_0d(IO_handle, field_md, field, tstamp, fill_value, scale, unscale, zero_zeros)

Write a 0d field to an output file

Parameters
  • IO_handle [inout]

    Handle for a file that is open for writing

  • field_md [in]

    Field type with metadata

  • field [in]

    Field to write in arbitrary units [A ~> a]

  • tstamp [in]

    Model timestamp, often in [days]

  • fill_value [in]

    Missing data fill value [a]

  • scale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output

  • unscale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.

  • zero_zeros [in]

    If present and true, convert negative zeros into ordinary signless zeros.

Callees call graph
Callees of mom_io::mom_write_field_legacy_0d calls cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_io::mom_write_field_legacy_0d MOM_write_field_legacy_0d [private/internal] mom_io_infra::interface::write_field write_field (interface) mom_io::mom_write_field_legacy_0d->mom_io_infra::interface::write_field
Text view
subroutine MOM_write_field_4d(IO_handle, field_md, MOM_domain, field, tstamp, tile_count, fill_value, turns, scale, unscale, zero_zeros)

Write a 4d field to an output file, potentially with rotation

Parameters
  • IO_handle [inout]

    Handle for a file that is open for writing

  • field_md [in]

    Field type with metadata

  • MOM_domain [in]

    The MOM_Domain that describes the decomposition

  • field [inout]

    Unrotated field to write in arbitrary units [A ~> a]

  • tstamp [in]

    Model timestamp, often in [days]

  • tile_count [in]

    PEs per tile (default: 1)

  • fill_value [in]

    Missing data fill value [a]

  • turns [in]

    Number of quarter-turns to rotate the data

  • scale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output

  • unscale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.

  • zero_zeros [in]

    If present and true, convert negative zeros into ordinary signless zeros.

Callees call graph
Callees of mom_io::mom_write_field_4d calls cluster_mom_array_transform MOM_array_transform cluster_mom_domain_infra MOM_domain_infra cluster_mom_io MOM_io mom_array_transform::interface::allocate_rotated_array allocate_rotated_array (interface) mom_array_transform::interface::rotate_array rotate_array (interface) mom_domain_infra::interface::rescale_comp_data rescale_comp_data (interface) mom_io::mom_write_field_4d MOM_write_field_4d [private/internal] mom_io::mom_write_field_4d->mom_array_transform::interface::allocate_rotated_array mom_io::mom_write_field_4d->mom_array_transform::interface::rotate_array mom_io::mom_write_field_4d->mom_domain_infra::interface::rescale_comp_data
Text view
subroutine MOM_write_field_3d(IO_handle, field_md, MOM_domain, field, tstamp, tile_count, fill_value, turns, scale, unscale, zero_zeros)

Write a 3d field to an output file, potentially with rotation

Parameters
  • IO_handle [inout]

    Handle for a file that is open for writing

  • field_md [in]

    Field type with metadata

  • MOM_domain [in]

    The MOM_Domain that describes the decomposition

  • field [inout]

    Unrotated field to write in arbitrary units [A ~> a]

  • tstamp [in]

    Model timestamp, often in [days]

  • tile_count [in]

    PEs per tile (default: 1)

  • fill_value [in]

    Missing data fill value [a]

  • turns [in]

    Number of quarter-turns to rotate the data

  • scale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output

  • unscale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.

  • zero_zeros [in]

    If present and true, convert negative zeros into ordinary signless zeros.

Callees call graph
Callees of mom_io::mom_write_field_3d calls cluster_mom_array_transform MOM_array_transform cluster_mom_domain_infra MOM_domain_infra cluster_mom_io MOM_io mom_array_transform::interface::allocate_rotated_array allocate_rotated_array (interface) mom_array_transform::interface::rotate_array rotate_array (interface) mom_domain_infra::interface::rescale_comp_data rescale_comp_data (interface) mom_io::mom_write_field_3d MOM_write_field_3d [private/internal] mom_io::mom_write_field_3d->mom_array_transform::interface::allocate_rotated_array mom_io::mom_write_field_3d->mom_array_transform::interface::rotate_array mom_io::mom_write_field_3d->mom_domain_infra::interface::rescale_comp_data
Text view
subroutine MOM_write_field_2d(IO_handle, field_md, MOM_domain, field, tstamp, tile_count, fill_value, turns, scale, unscale, zero_zeros)

Write a 2d field to an output file, potentially with rotation

Parameters
  • IO_handle [inout]

    Handle for a file that is open for writing

  • field_md [in]

    Field type with metadata

  • MOM_domain [in]

    The MOM_Domain that describes the decomposition

  • field [inout]

    Unrotated field to write in arbitrary units [A ~> a]

  • tstamp [in]

    Model timestamp, often in [days]

  • tile_count [in]

    PEs per tile (default: 1)

  • fill_value [in]

    Missing data fill value [a]

  • turns [in]

    Number of quarter-turns to rotate the data

  • scale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output

  • unscale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.

  • zero_zeros [in]

    If present and true, convert negative zeros into ordinary signless zeros.

Callees call graph
Callees of mom_io::mom_write_field_2d calls cluster_mom_array_transform MOM_array_transform cluster_mom_domain_infra MOM_domain_infra cluster_mom_io MOM_io mom_array_transform::interface::allocate_rotated_array allocate_rotated_array (interface) mom_array_transform::interface::rotate_array rotate_array (interface) mom_domain_infra::interface::rescale_comp_data rescale_comp_data (interface) mom_io::mom_write_field_2d MOM_write_field_2d [private/internal] mom_io::mom_write_field_2d->mom_array_transform::interface::allocate_rotated_array mom_io::mom_write_field_2d->mom_array_transform::interface::rotate_array mom_io::mom_write_field_2d->mom_domain_infra::interface::rescale_comp_data
Text view
subroutine MOM_write_field_1d(IO_handle, field_md, field, tstamp, fill_value, scale, unscale, zero_zeros)

Write a 1d field to an output file

Parameters
  • IO_handle [inout]

    Handle for a file that is open for writing

  • field_md [in]

    Field type with metadata

  • field [in]

    Field to write in arbitrary units [A ~> a]

  • tstamp [in]

    Model timestamp, often in [days]

  • fill_value [in]

    Missing data fill value [a]

  • scale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output

  • unscale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.

  • zero_zeros [in]

    If present and true, convert negative zeros into ordinary signless zeros.

subroutine MOM_write_field_0d(IO_handle, field_md, field, tstamp, fill_value, scale, unscale, zero_zeros)

Write a 0d field to an output file

Parameters
  • IO_handle [inout]

    Handle for a file that is open for writing

  • field_md [in]

    Field type with metadata

  • field [in]

    Field to write in arbitrary units [A ~> a]

  • tstamp [in]

    Model timestamp, often in [days]

  • fill_value [in]

    Missing data fill value [a]

  • scale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output

  • unscale [in]

    A scaling factor that the field is multiplied by before it is written [a A-1 ~> 1], for example to convert it from its internal units to the desired units for output. Here scale and unscale are synonymous, but unscale takes precedence if both are present.

  • zero_zeros [in]

    If present and true, convert negative zeros into ordinary signless zeros.

subroutine insert_ensemble_appendix(filename, insert_after)

Insert the ensemble appendix into a filename. If provided, the appendix is inserted after the last occurrence of the insert_after substring in the filename.

Parameters
  • filename [inout]

    The filename to which the appendix is inserted

  • insert_after [in]

    The string after which the appendix is inserted. If not provided or found, the appendix is inserted at the end of the filename.

Callees call graph
Callees of mom_io::insert_ensemble_appendix calls cluster_mom_error_handler MOM_error_handler cluster_mom_io MOM_io mom_error_handler::mom_error MOM_error mom_io::get_filename_appendix get_filename_appendix mom_io::insert_ensemble_appendix insert_ensemble_appendix mom_io::insert_ensemble_appendix->mom_error_handler::mom_error mom_io::insert_ensemble_appendix->mom_io::get_filename_appendix
Text view
Callers call graph
Callers of mom_io::insert_ensemble_appendix calls cluster_mom_io MOM_io cluster_mom_restart MOM_restart cluster_mom_shared_initialization MOM_shared_initialization mom_io::insert_ensemble_appendix insert_ensemble_appendix mom_restart::open_restart_units open_restart_units [private/internal] mom_restart::open_restart_units->mom_io::insert_ensemble_appendix mom_restart::save_restart save_restart mom_restart::save_restart->mom_io::insert_ensemble_appendix mom_shared_initialization::write_ocean_geometry_file write_ocean_geometry_file mom_shared_initialization::write_ocean_geometry_file->mom_io::insert_ensemble_appendix
Text view
subroutine field_size(filename, fieldname, sizes, field_found, no_domain, ndims, ncid_in)

Given filename and fieldname, this subroutine returns the size of the field in the file

Parameters
  • filename [in]

    The name of the file to read

  • fieldname [in]

    The name of the variable whose sizes are returned

  • sizes [inout]

    The sizes of the variable in each dimension

  • field_found [out]

    This indicates whether the field was found in the input file. Without this argument, there is a fatal error if the field is not found.

  • no_domain [in]

    If present and true, do not check for file names with an appended tile number. If ndims is present, the default changes to true.

  • ndims [out]

    The number of dimensions to the variable

  • ncid_in [in]

    The netCDF ID of an open file. If absent, the file is opened and closed within this routine.

Callees call graph
Callees of mom_io::field_size calls cluster_mom_error_handler MOM_error_handler cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_error_handler::mom_error MOM_error mom_io::field_size field_size mom_io::field_size->mom_error_handler::mom_error mom_io::get_var_sizes get_var_sizes mom_io::field_size->mom_io::get_var_sizes mom_io_infra::get_field_size get_field_size mom_io::field_size->mom_io_infra::get_field_size
Text view
Callers call graph
Callers of mom_io::field_size calls cluster_mom_io MOM_io cluster_mom_open_boundary MOM_open_boundary cluster_mom_regridding MOM_regridding cluster_mom_shared_initialization MOM_shared_initialization cluster_mom_state_initialization MOM_state_initialization cluster_mom_sum_output MOM_sum_output cluster_mom_tidal_mixing MOM_tidal_mixing mom_io::field_size field_size mom_open_boundary::allocate_segment_field_data allocate_segment_field_data [private/internal] mom_open_boundary::allocate_segment_field_data->mom_io::field_size mom_regridding::initialize_regridding initialize_regridding mom_regridding::initialize_regridding->mom_io::field_size mom_shared_initialization::apply_topography_edits_from_file apply_topography_edits_from_file mom_shared_initialization::apply_topography_edits_from_file->mom_io::field_size mom_state_initialization::initialize_oda_incupd_file initialize_oda_incupd_file [private/internal] mom_state_initialization::initialize_oda_incupd_file->mom_io::field_size mom_state_initialization::initialize_sponges_file initialize_sponges_file [private/internal] mom_state_initialization::initialize_sponges_file->mom_io::field_size mom_sum_output::read_depth_list read_depth_list [private/internal] mom_sum_output::read_depth_list->mom_io::field_size mom_tidal_mixing::read_tidal_constituents read_tidal_constituents [private/internal] mom_tidal_mixing::read_tidal_constituents->mom_io::field_size
Text view
subroutine safe_string_copy(str1, str2, fieldnm, caller)

Copies a string

Parameters
  • str1 [in]

    The string being copied

  • str2 [out]

    The string being copied into

  • fieldnm [in]

    The name of the field for error messages

  • caller [in]

    The calling routine for error messages

Callees call graph
Callees of mom_io::safe_string_copy calls cluster_mom_error_handler MOM_error_handler cluster_mom_io MOM_io mom_error_handler::mom_error MOM_error mom_io::safe_string_copy safe_string_copy [private/internal] mom_io::safe_string_copy->mom_error_handler::mom_error
Text view
Callers call graph
Callers of mom_io::safe_string_copy calls cluster_mom_io MOM_io mom_io::modify_vardesc modify_vardesc mom_io::safe_string_copy safe_string_copy [private/internal] mom_io::modify_vardesc->mom_io::safe_string_copy mom_io::query_vardesc query_vardesc mom_io::query_vardesc->mom_io::safe_string_copy mom_io::set_axis_info set_axis_info mom_io::set_axis_info->mom_io::safe_string_copy mom_io::var_desc var_desc mom_io::var_desc->mom_io::safe_string_copy
Text view
function ensembler(name, ens_no_in) result(en_nm)

Returns a name with "%#E" or "%E" replaced with the ensemble member number.

Parameters
  • name [in]

    The name to be modified

  • ens_no_in [in]

    The number of the current ensemble member

  • en_nm

    The name encoded with the ensemble number

Callees call graph
Callees of mom_io::ensembler calls cluster_mom_ensemble_manager_infra MOM_ensemble_manager_infra cluster_mom_error_handler MOM_error_handler cluster_mom_io MOM_io mom_ensemble_manager_infra::get_ensemble_id get_ensemble_id mom_error_handler::mom_error MOM_error mom_io::ensembler ensembler mom_io::ensembler->mom_ensemble_manager_infra::get_ensemble_id mom_io::ensembler->mom_error_handler::mom_error
Text view
Callers call graph
Callers of mom_io::ensembler calls cluster_mom_get_input MOM_get_input cluster_mom_io MOM_io mom_get_input::get_mom_input get_MOM_input mom_io::ensembler ensembler mom_get_input::get_mom_input->mom_io::ensembler
Text view
subroutine get_filename_appendix(suffix)

Provide a string to append to filenames, to differentiate ensemble members, for example.

Parameters
  • suffix [out]

    A string to append to filenames

Callees call graph
Callees of mom_io::get_filename_appendix calls cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_io::get_filename_appendix get_filename_appendix mom_io_infra::get_filename_suffix get_filename_suffix mom_io::get_filename_appendix->mom_io_infra::get_filename_suffix
Text view
Callers call graph
Callers of mom_io::get_filename_appendix calls cluster_mom_diag_mediator MOM_diag_mediator cluster_mom_ice_shelf_dynamics MOM_ice_shelf_dynamics cluster_mom_io MOM_io cluster_mom_is_diag_mediator MOM_IS_diag_mediator cluster_mom_sum_output MOM_sum_output mom_diag_mediator::diag_mediator_init diag_mediator_init mom_io::get_filename_appendix get_filename_appendix mom_diag_mediator::diag_mediator_init->mom_io::get_filename_appendix mom_ice_shelf_dynamics::initialize_ice_shelf_dyn initialize_ice_shelf_dyn mom_ice_shelf_dynamics::initialize_ice_shelf_dyn->mom_io::get_filename_appendix mom_io::insert_ensemble_appendix insert_ensemble_appendix mom_io::insert_ensemble_appendix->mom_io::get_filename_appendix mom_is_diag_mediator::mom_is_diag_mediator_init MOM_IS_diag_mediator_init mom_is_diag_mediator::mom_is_diag_mediator_init->mom_io::get_filename_appendix mom_sum_output::mom_sum_output_init MOM_sum_output_init mom_sum_output::mom_sum_output_init->mom_io::get_filename_appendix
Text view
subroutine write_version_number(version, tag, unit)

Write a file version number to the log file or other output file

Parameters
  • version [in]

    A string that contains the routine name and version

  • tag [in]

    A tag name to add to the message

  • unit [in]

    An alternate unit number for output

Callees call graph
Callees of mom_io::write_version_number calls cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_io::write_version_number write_version_number mom_io_infra::write_version write_version mom_io::write_version_number->mom_io_infra::write_version
Text view
function open_namelist_file(file) result(unit)

Open a single namelist file that is potentially readable by all PEs.

Parameters
  • file [in]

    The file to open, by default "input.nml"

  • unit

    The opened unit number of the namelist file

Callees call graph
Callees of mom_io::open_namelist_file calls cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_io::open_namelist_file open_namelist_file mom_io_infra::mom_namelist_file MOM_namelist_file mom_io::open_namelist_file->mom_io_infra::mom_namelist_file
Text view
Callers call graph
Callers of mom_io::open_namelist_file calls cluster_mom_get_input MOM_get_input cluster_mom_io MOM_io mom_get_input::get_mom_input get_MOM_input mom_io::open_namelist_file open_namelist_file mom_get_input::get_mom_input->mom_io::open_namelist_file
Text view
function check_nml_error(IOstat, nml_name) result(ierr)

Checks the iostat argument that is returned after reading a namelist variable and writes a message if there is an error.

Parameters
  • IOstat [in]

    An I/O status field from a namelist read call

  • nml_name [in]

    The name of the namelist

  • ierr

    A copy of IOstat that is returned to preserve legacy function behavior

Callees call graph
Callees of mom_io::check_nml_error calls cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra mom_io::check_nml_error check_nml_error mom_io_infra::check_namelist_error check_namelist_error mom_io::check_nml_error->mom_io_infra::check_namelist_error
Text view
Callers call graph
Callers of mom_io::check_nml_error calls cluster_External External cluster_mom_get_input MOM_get_input cluster_mom_io MOM_io External::mom6 MOM6 mom_io::check_nml_error check_nml_error External::mom6->mom_io::check_nml_error mom_get_input::get_mom_input get_MOM_input mom_get_input::get_mom_input->mom_io::check_nml_error
Text view
subroutine MOM_io_init(param_file)

Initialize the MOM_io module

Parameters
  • param_file [in]

    structure indicating the open file to parse for model parameter values.

Callees call graph
Callees of mom_io::mom_io_init calls cluster_mom_file_parser MOM_file_parser cluster_mom_io MOM_io mom_file_parser::interface::log_version log_version (interface) mom_io::mom_io_init MOM_io_init mom_io::mom_io_init->mom_file_parser::interface::log_version
Text view
Callers call graph
Callers of mom_io::mom_io_init calls cluster_mom MOM cluster_mom_io MOM_io mom::initialize_mom initialize_MOM mom_io::mom_io_init MOM_io_init mom::initialize_mom->mom_io::mom_io_init
Text view
subroutine get_var_axes_info(filename, fieldname, axes_info)

Returns the dimension variable information for a netCDF variable

Parameters
  • filename [in]

    A filename from which to read

  • fieldname [in]

    The name of the field to read

  • axes_info [inout]

    A returned array of field axis information

    local variables

  • start

    cartesian axis data

  • count

    cartesian axis data

Callees call graph
Callees of mom_io::get_var_axes_info calls cluster_mom_error_handler MOM_error_handler cluster_mom_io MOM_io mom_error_handler::mom_error MOM_error mom_io::close_file_to_read close_file_to_read mom_io::get_var_axes_info get_var_axes_info mom_io::get_var_axes_info->mom_error_handler::mom_error mom_io::get_var_axes_info->mom_io::close_file_to_read mom_io::open_file_to_read open_file_to_read mom_io::get_var_axes_info->mom_io::open_file_to_read mom_io::set_axis_info set_axis_info mom_io::get_var_axes_info->mom_io::set_axis_info
Text view
Callers call graph
Callers of mom_io::get_var_axes_info calls cluster_mom_horizontal_regridding MOM_horizontal_regridding cluster_mom_io MOM_io mom_horizontal_regridding::horiz_interp_and_extrap_tracer_record horiz_interp_and_extrap_tracer_record [private/internal] mom_io::get_var_axes_info get_var_axes_info mom_horizontal_regridding::horiz_interp_and_extrap_tracer_record->mom_io::get_var_axes_info
Text view

External calls

netcdf
  • NF90_GET_VAR (netcdf::nf90_get_var)

  • NF90_INQUIRE_DIMENSION (netcdf::nf90_inquire_dimension)

  • NF90_INQUIRE_VARIABLE (netcdf::nf90_inquire_variable)

  • NF90_INQ_VARID (netcdf::nf90_inq_varid)

API generated with Flint · Rendered from reStructuredText