MOM_sum_output module reference

Reports integrated quantities for monitoring the model state

Data Types

Depth_List

Checksum attribute of name of G%mask2dT * G%areaT over the compute domain

sum_output_CS

The control structure for the MOM_sum_output module

Functions/Subroutines

MOM_sum_output_init

MOM_sum_output_init initializes the parameters and settings for the MOM_sum_output module.

MOM_sum_output_end

MOM_sum_output_end deallocates memory used by the MOM_sum_output module.

write_energy

This subroutine calculates and writes the total model energy, the energy and mass of each layer, and other globally integrated physical quantities.

accumulate_net_input

This subroutine accumulates the net input of volume, salt and heat, through the ocean surface for use in diagnosing conservation.

depth_list_setup

This subroutine sets up an ordered list of depths, along with the cross sectional areas at each depth and the volume of fluid deeper than each depth. This might be read from a previously created file or it might be created anew. (For now only new creation occurs.

create_depth_list

create_depth_list makes an ordered list of depths, along with the cross sectional areas at each depth and the volume of fluid deeper than each depth.

write_depth_list

This subroutine writes out the depth list to the specified file.

read_depth_list

This subroutine reads in the depth list from the specified file and allocates the memory within and sets up DL.

get_depth_list_checksums

Return the checksums required to verify DEPTH_LIST_FILE contents.

Detailed Description

By Robert Hallberg, April 1994 - June 2002

This file contains the subroutine (write_energy) that writes horizontally integrated quantities, such as energies and layer volumes, and other summary information to an output file. Some of these quantities (APE or resting interface height) are defined relative to the global histogram of topography. The subroutine that compiles that histogram (depth_list_setup) is also included in this file.

In addition, if the number of velocity truncations since the previous call to write_energy exceeds maxtrunc or the total energy exceeds a very large threshold, a fatal termination is triggered.

Type Documentation

type :: Depth_List

Checksum attribute of name of G%mask2dT * G%areaT over the compute domain

A list of depths and corresponding globally integrated ocean area at each depth and the ocean volume below each depth.

Parameters
  • listsize

    length of the list <= niglobal*njglobal + 1

  • depth

    A list of depths [Z ~> m]

  • area

    The cross-sectional area of the ocean at that depth [L2 ~> m2]

  • vol_below

    The ocean volume below that depth [Z L2 ~> m3]

type, public :: sum_output_CS

The control structure for the MOM_sum_output module

Parameters
  • initialized

    True if this control structure has been initialized.

  • DL

    The sorted depth list.

  • lH

    This saves the entry in DL with a volume just less than the volume of fluid below the interface.

  • do_APE_calc

    If true, calculate the available potential energy of the interfaces. Disabling this reduces the memory footprint of high-PE-count models dramatically.

  • read_depth_list

    Read the depth list from a file if it exists and write it if it doesn't.

  • depth_list_file

    The name of the depth list file.

  • D_list_min_inc

    The minimum increment [Z ~> m], between the depths of the entries in the depth-list file, 0 by default.

  • require_depth_list_chksum

    Require matching checksums in Depth_list.nc when reading the file.

  • update_depth_list_chksum

    Automatically update the Depth_list.nc file if the checksums are missing or do not match current values.

  • use_temperature

    If true, temperature and salinity are state variables.

  • fresh_water_in_EFP

    The total mass of fresh water added by surface fluxes on this PE since the last time that write_energy was called [kg].

  • net_salt_in_EFP

    The total salt added by surface fluxes on this PE since the last time that write_energy was called [ppt kg].

  • net_heat_in_EFP

    The total heat added by surface fluxes on this PE since the last time that write_energy was called [J].

  • heat_prev_EFP

    The total amount of heat in the ocean the last time that write_energy was called [J].

  • salt_prev_EFP

    The total amount of salt in the ocean the last time that write_energy was called [ppt kg].

  • mass_prev_EFP

    The total ocean mass the last time that write_energy was called [kg].

  • dt_in_T

    The baroclinic dynamics time step [T ~> s].

  • energysavedays

    The interval between writing the energies and other integral quantities of the run.

  • energysavedays_geometric

    The starting interval for computing a geometric progression of time deltas between calls to write_energy. This interval will increase by a factor of 2. after each call to write_energy.

  • energysave_geometric

    Logical to control whether calls to write_energy should follow a geometric progression

  • write_energy_time

    The next time to write to the energy file.

  • geometric_end_time

    Time at which to stop the geometric progression of calls to write_energy and revert to the standard energysavedays interval

  • timeunit

    The length of the units for the time axis and certain input parameters including ENERGYSAVEDAYS [s].

  • date_stamped_output

    If true, use dates (not times) in messages to stdout.

  • ISO_date_stamped_output

    If true, use ISO formatted dates in messages to stdout.

  • Start_time

    The start time of the simulation.

  • ntrunc

    The number of times the velocity has been truncated since the last call to write_energy.

  • max_Energy

    The maximum permitted energy per unit mass. If there is more energy than this, the model should stop [L2 T-2 ~> m2 s-2].

  • maxtrunc

    The number of truncations per energy save interval at which the run is stopped.

  • write_stocks

    If true, write the integrated tracer amounts to stdout when the energy files are written.

  • write_min_max

    If true, write the maximum and minimum values of temperature, salinity and some tracer concentrations to stdout when the energy files are written.

  • write_min_max_loc

    If true, write the locations of the maximum and minimum values of temperature, salinity and some tracer concentrations to stdout when the energy files are written.

  • previous_calls

    The number of times write_energy has been called.

  • prev_n

    The value of n from the last call.

  • fileenergy_nc

    The file handle for the netCDF version of the energy file.

  • fileenergy_ascii

    The unit number of the ascii version of the energy file.

  • fields

    fieldtype variables for the output fields.

  • energyfile

    The name of the energy file with path.

Functions/Subroutine Documentation

subroutine MOM_sum_output_init(G, GV, US, param_file, directory, ntrnc, Input_start_time, CS)

MOM_sum_output_init initializes the parameters and settings for the MOM_sum_output module.

Parameters
  • G [in]

    The ocean's grid structure.

  • GV [in]

    The ocean's vertical grid structure.

  • US [in]

    A dimensional unit scaling type

  • param_file [in]

    A structure to parse for run-time parameters.

  • directory [in]

    The directory where the energy file goes.

  • ntrnc [inout]

    The integer that stores the number of times the velocity has been truncated since the last call to write_energy.

  • Input_start_time [in]

    The start time of the simulation.

  • CS

    A pointer that is set to point to the control structure for this module.

Callees call graph
Callees of mom_sum_output::mom_sum_output_init calls cluster_mom_error_handler MOM_error_handler cluster_mom_file_parser MOM_file_parser cluster_mom_io MOM_io cluster_mom_string_functions MOM_string_functions cluster_mom_sum_output MOM_sum_output mom_error_handler::mom_error MOM_error mom_file_parser::interface::get_param get_param (interface) mom_file_parser::interface::log_param log_param (interface) mom_file_parser::interface::log_version log_version (interface) mom_io::get_filename_appendix get_filename_appendix mom_string_functions::slasher slasher mom_sum_output::depth_list_setup depth_list_setup [private/internal] mom_sum_output::mom_sum_output_init MOM_sum_output_init mom_sum_output::mom_sum_output_init->mom_error_handler::mom_error mom_sum_output::mom_sum_output_init->mom_file_parser::interface::get_param mom_sum_output::mom_sum_output_init->mom_file_parser::interface::log_param mom_sum_output::mom_sum_output_init->mom_file_parser::interface::log_version mom_sum_output::mom_sum_output_init->mom_io::get_filename_appendix mom_sum_output::mom_sum_output_init->mom_string_functions::slasher mom_sum_output::mom_sum_output_init->mom_sum_output::depth_list_setup
Text view
Callers call graph
Callers of mom_sum_output::mom_sum_output_init calls cluster_mom MOM cluster_mom_sum_output MOM_sum_output mom::initialize_mom initialize_MOM mom_sum_output::mom_sum_output_init MOM_sum_output_init mom::initialize_mom->mom_sum_output::mom_sum_output_init
Text view

External calls

time_manager_mod
  • set_time (time_manager_mod::set_time)

  • time_type_to_real (time_manager_mod::time_type_to_real)

subroutine MOM_sum_output_end(CS)

MOM_sum_output_end deallocates memory used by the MOM_sum_output module.

Parameters
  • CS

    Control structure returned by a previous call to MOM_sum_output_init.

Callees call graph
Callees of mom_sum_output::mom_sum_output_end calls cluster_mom_error_infra MOM_error_infra cluster_mom_io_infra MOM_io_infra cluster_mom_sum_output MOM_sum_output mom_error_infra::is_root_pe is_root_pe mom_io_infra::interface::close_file close_file (interface) mom_sum_output::mom_sum_output_end MOM_sum_output_end mom_sum_output::mom_sum_output_end->mom_error_infra::is_root_pe mom_sum_output::mom_sum_output_end->mom_io_infra::interface::close_file
Text view
Callers call graph
Callers of mom_sum_output::mom_sum_output_end calls cluster_mom MOM cluster_mom_sum_output MOM_sum_output mom::mom_end MOM_end mom_sum_output::mom_sum_output_end MOM_sum_output_end mom::mom_end->mom_sum_output::mom_sum_output_end
Text view
subroutine write_energy(u, v, h, tv, day, n, G, GV, US, CS, tracer_CSp, dt_forcing)

This subroutine calculates and writes the total model energy, the energy and mass of each layer, and other globally integrated physical quantities.

Parameters
  • G [in]

    The ocean's grid structure.

  • GV [in]

    The ocean's vertical grid structure.

  • US [in]

    A dimensional unit scaling type

  • u [in]

    The zonal velocity [L T-1 ~> m s-1].

  • v [in]

    The meridional velocity [L T-1 ~> m s-1].

  • h [in]

    Layer thicknesses [H ~> m or kg m-2].

  • tv [in]

    A structure pointing to various thermodynamic variables.

  • day [in]

    The current model time.

  • n [in]

    The time step number of the current execution.

  • CS

    The control structure returned by a previous call to MOM_sum_output_init.

  • tracer_CSp

    Control structure with the tree of all registered tracer packages

  • dt_forcing [in]

    The forcing time step

Callees call graph
Callees of mom_sum_output::write_energy calls cluster_mom_checksums MOM_checksums cluster_mom_coms MOM_coms cluster_mom_coms_infra MOM_coms_infra cluster_mom_error_handler MOM_error_handler cluster_mom_error_infra MOM_error_infra cluster_mom_interface_heights MOM_interface_heights cluster_mom_io MOM_io cluster_mom_io_infra MOM_io_infra cluster_mom_spatial_means MOM_spatial_means cluster_mom_sum_output MOM_sum_output cluster_mom_tracer_flow_control MOM_tracer_flow_control mom_checksums::interface::is_nan is_NaN (interface) mom_coms::efp_to_real EFP_to_real mom_coms::interface::efp_sum_across_pes EFP_sum_across_PEs (interface) mom_coms::interface::reproducing_sum reproducing_sum (interface) mom_coms::interface::reproducing_sum_efp reproducing_sum_EFP (interface) mom_coms::real_to_efp real_to_EFP mom_coms_infra::interface::max_across_pes max_across_PEs (interface) mom_coms_infra::interface::sum_across_pes sum_across_PEs (interface) mom_error_handler::mom_error MOM_error mom_error_infra::is_root_pe is_root_pe mom_interface_heights::interface::find_eta find_eta (interface) mom_io::create_mom_file create_MOM_file mom_io::reopen_mom_file reopen_MOM_file mom_io::var_desc var_desc mom_io_infra::open_ascii_file open_ASCII_file mom_spatial_means::array_global_min_max array_global_min_max mom_sum_output::write_energy write_energy mom_sum_output::write_energy->mom_checksums::interface::is_nan mom_sum_output::write_energy->mom_coms::efp_to_real mom_sum_output::write_energy->mom_coms::interface::efp_sum_across_pes mom_sum_output::write_energy->mom_coms::interface::reproducing_sum mom_sum_output::write_energy->mom_coms::interface::reproducing_sum_efp mom_sum_output::write_energy->mom_coms::real_to_efp mom_sum_output::write_energy->mom_coms_infra::interface::max_across_pes mom_sum_output::write_energy->mom_coms_infra::interface::sum_across_pes mom_sum_output::write_energy->mom_error_handler::mom_error mom_sum_output::write_energy->mom_error_infra::is_root_pe mom_sum_output::write_energy->mom_interface_heights::interface::find_eta mom_sum_output::write_energy->mom_io::create_mom_file mom_sum_output::write_energy->mom_io::reopen_mom_file mom_sum_output::write_energy->mom_io::var_desc mom_sum_output::write_energy->mom_io_infra::open_ascii_file mom_sum_output::write_energy->mom_spatial_means::array_global_min_max mom_tracer_flow_control::call_tracer_stocks call_tracer_stocks mom_sum_output::write_energy->mom_tracer_flow_control::call_tracer_stocks
Text view
Callers call graph
Callers of mom_sum_output::write_energy calls cluster_mom MOM cluster_mom_sum_output MOM_sum_output mom::finish_mom_initialization finish_MOM_initialization mom_sum_output::write_energy write_energy mom::finish_mom_initialization->mom_sum_output::write_energy mom::step_mom step_MOM mom::step_mom->mom_sum_output::write_energy
Text view

External calls

time_manager_mod
  • get_calendar_type (time_manager_mod::get_calendar_type)

  • get_date (time_manager_mod::get_date)

  • get_time (time_manager_mod::get_time)

  • set_time (time_manager_mod::set_time)

subroutine accumulate_net_input(fluxes, sfc_state, tv, dt, G, US, CS)

This subroutine accumulates the net input of volume, salt and heat, through the ocean surface for use in diagnosing conservation.

Parameters
  • fluxes [in]

    A structure containing pointers to any possible forcing fields. Unused fields are unallocated.

  • sfc_state [in]

    A structure containing fields that describe the surface state of the ocean.

  • tv [in]

    A structure pointing to various thermodynamic variables.

  • dt [in]

    The amount of time over which to average [T ~> s].

  • G [in]

    The ocean's grid structure.

  • US [in]

    A dimensional unit scaling type

  • CS

    The control structure returned by a previous call to MOM_sum_output_init.

Callees call graph
Callees of mom_sum_output::accumulate_net_input calls cluster_mom_coms MOM_coms cluster_mom_error_handler MOM_error_handler cluster_mom_sum_output MOM_sum_output mom_coms::interface::reproducing_sum_efp reproducing_sum_EFP (interface) mom_error_handler::mom_error MOM_error mom_sum_output::accumulate_net_input accumulate_net_input mom_sum_output::accumulate_net_input->mom_coms::interface::reproducing_sum_efp mom_sum_output::accumulate_net_input->mom_error_handler::mom_error
Text view
Callers call graph
Callers of mom_sum_output::accumulate_net_input calls cluster_mom MOM cluster_mom_sum_output MOM_sum_output mom::step_mom step_MOM mom_sum_output::accumulate_net_input accumulate_net_input mom::step_mom->mom_sum_output::accumulate_net_input
Text view
subroutine depth_list_setup(G, GV, US, DL, CS)

This subroutine sets up an ordered list of depths, along with the cross sectional areas at each depth and the volume of fluid deeper than each depth. This might be read from a previously created file or it might be created anew. (For now only new creation occurs.

Parameters
  • G [in]

    The ocean's grid structure

  • GV [in]

    The ocean's vertical grid structure.

  • US [in]

    A dimensional unit scaling type

  • DL [inout]

    The list of depths, areas and volumes to set up

  • CS

    The control structure returned by a previous call to MOM_sum_output_init.

Callees call graph
Callees of mom_sum_output::depth_list_setup calls cluster_mom_error_handler MOM_error_handler cluster_mom_error_infra MOM_error_infra cluster_mom_io_infra MOM_io_infra cluster_mom_sum_output MOM_sum_output mom_error_handler::mom_error MOM_error mom_error_infra::is_root_pe is_root_pe mom_io_infra::interface::file_exists file_exists (interface) mom_sum_output::create_depth_list create_depth_list [private/internal] mom_sum_output::depth_list_setup depth_list_setup [private/internal] mom_sum_output::depth_list_setup->mom_error_handler::mom_error mom_sum_output::depth_list_setup->mom_error_infra::is_root_pe mom_sum_output::depth_list_setup->mom_io_infra::interface::file_exists mom_sum_output::depth_list_setup->mom_sum_output::create_depth_list mom_sum_output::read_depth_list read_depth_list [private/internal] mom_sum_output::depth_list_setup->mom_sum_output::read_depth_list mom_sum_output::write_depth_list write_depth_list [private/internal] mom_sum_output::depth_list_setup->mom_sum_output::write_depth_list
Text view
Callers call graph
Callers of mom_sum_output::depth_list_setup calls cluster_mom_sum_output MOM_sum_output mom_sum_output::depth_list_setup depth_list_setup [private/internal] mom_sum_output::mom_sum_output_init MOM_sum_output_init mom_sum_output::mom_sum_output_init->mom_sum_output::depth_list_setup
Text view
subroutine create_depth_list(G, DL, min_depth_inc)

create_depth_list makes an ordered list of depths, along with the cross sectional areas at each depth and the volume of fluid deeper than each depth.

Parameters
  • G [in]

    The ocean's grid structure.

  • DL [inout]

    The list of depths, areas and volumes to create

  • min_depth_inc [in]

    The minimum increment between depths in the list [Z ~> m]

  • Dlist

    The global list of bottom depths [Z ~> m].

  • AreaList

    The global list of cell areas [L2 ~> m2].

  • indx2

    The position of an element in the original unsorted list.

  • Dnow

    The depth now being considered for sorting [Z ~> m].

  • Dprev

    The most recent depth that was considered [Z ~> m].

  • vol

    The running sum of open volume below a depth [Z L2 ~> m3].

  • area

    The open area at the current depth [L2 ~> m2].

  • D_list_prev

    The most recent depth added to the list [Z ~> m].

  • add_to_list

    This depth should be included as an entry on the list.

Callees call graph
Callees of mom_sum_output::create_depth_list calls cluster_mom_coms_infra MOM_coms_infra cluster_mom_sum_output MOM_sum_output mom_coms_infra::interface::sum_across_pes sum_across_PEs (interface) mom_sum_output::create_depth_list create_depth_list [private/internal] mom_sum_output::create_depth_list->mom_coms_infra::interface::sum_across_pes
Text view
Callers call graph
Callers of mom_sum_output::create_depth_list calls cluster_mom_sum_output MOM_sum_output mom_sum_output::create_depth_list create_depth_list [private/internal] mom_sum_output::depth_list_setup depth_list_setup [private/internal] mom_sum_output::depth_list_setup->mom_sum_output::create_depth_list
Text view
subroutine write_depth_list(G, US, DL, filename)

This subroutine writes out the depth list to the specified file.

Parameters
  • G [in]

    The ocean's grid structure.

  • US [in]

    A dimensional unit scaling type

  • DL [in]

    The list of depths, areas and volumes to write

  • filename [in]

    The path to the depth list file to write.

Callees call graph
Callees of mom_sum_output::write_depth_list calls cluster_mom_error_infra MOM_error_infra cluster_mom_io MOM_io cluster_mom_sum_output MOM_sum_output mom_error_infra::is_root_pe is_root_pe mom_io::create_mom_file create_MOM_file mom_io::delete_attribute_info delete_attribute_info mom_io::delete_axis_info delete_axis_info mom_io::interface::mom_write_field MOM_write_field (interface) mom_io::set_attribute_info set_attribute_info mom_io::set_axis_info set_axis_info mom_io::var_desc var_desc mom_sum_output::get_depth_list_checksums get_depth_list_checksums [private/internal] mom_sum_output::write_depth_list write_depth_list [private/internal] mom_sum_output::write_depth_list->mom_error_infra::is_root_pe mom_sum_output::write_depth_list->mom_io::create_mom_file mom_sum_output::write_depth_list->mom_io::delete_attribute_info mom_sum_output::write_depth_list->mom_io::delete_axis_info mom_sum_output::write_depth_list->mom_io::interface::mom_write_field mom_sum_output::write_depth_list->mom_io::set_attribute_info mom_sum_output::write_depth_list->mom_io::set_axis_info mom_sum_output::write_depth_list->mom_io::var_desc mom_sum_output::write_depth_list->mom_sum_output::get_depth_list_checksums
Text view
Callers call graph
Callers of mom_sum_output::write_depth_list calls cluster_mom_sum_output MOM_sum_output mom_sum_output::depth_list_setup depth_list_setup [private/internal] mom_sum_output::write_depth_list write_depth_list [private/internal] mom_sum_output::depth_list_setup->mom_sum_output::write_depth_list
Text view
subroutine read_depth_list(G, US, DL, filename, require_chksum, file_matches)

This subroutine reads in the depth list from the specified file and allocates the memory within and sets up DL.

Parameters
  • G [in]

    The ocean's grid structure

  • US [in]

    A dimensional unit scaling type

  • DL [inout]

    The list of depths, areas and volumes

  • filename [in]

    The path to the depth list file to read.

  • require_chksum [in]

    If true, missing or mismatched depth and area checksums result in a fatal error.

  • file_matches [out]

    If present, this indicates whether the file has been read with matching depth and area checksums

Callees call graph
Callees of mom_sum_output::read_depth_list calls cluster_mom_error_handler MOM_error_handler cluster_mom_io MOM_io cluster_mom_sum_output MOM_sum_output mom_error_handler::mom_error MOM_error mom_io::field_size field_size mom_io::interface::read_attribute read_attribute (interface) mom_io::interface::read_variable read_variable (interface) mom_sum_output::get_depth_list_checksums get_depth_list_checksums [private/internal] mom_sum_output::read_depth_list read_depth_list [private/internal] mom_sum_output::read_depth_list->mom_error_handler::mom_error mom_sum_output::read_depth_list->mom_io::field_size mom_sum_output::read_depth_list->mom_io::interface::read_attribute mom_sum_output::read_depth_list->mom_io::interface::read_variable mom_sum_output::read_depth_list->mom_sum_output::get_depth_list_checksums
Text view
Callers call graph
Callers of mom_sum_output::read_depth_list calls cluster_mom_sum_output MOM_sum_output mom_sum_output::depth_list_setup depth_list_setup [private/internal] mom_sum_output::read_depth_list read_depth_list [private/internal] mom_sum_output::depth_list_setup->mom_sum_output::read_depth_list
Text view
subroutine get_depth_list_checksums(G, US, depth_chksum, area_chksum)

Return the checksums required to verify DEPTH_LIST_FILE contents.

This function computes checksums for the bathymetry (G%bathyT) and masked area (mask2dT * areaT) fields of the model grid G, which are used to compute the depth list. A difference in checksum indicates that a different method was used to compute the grid data, and that any results using the depth list, such as APE, will not be reproducible.

Checksums are saved as hexadecimal strings, in order to avoid potential datatype issues with netCDF attributes.

Parameters
  • G [in]

    Ocean grid structure

  • US [in]

    A dimensional unit scaling type

  • depth_chksum [out]

    Depth checksum hexstring

  • area_chksum [out]

    Area checksum hexstring

Callees call graph
Callees of mom_sum_output::get_depth_list_checksums calls cluster_mom_checksums MOM_checksums cluster_mom_sum_output MOM_sum_output mom_checksums::interface::field_checksum field_checksum (interface) mom_sum_output::get_depth_list_checksums get_depth_list_checksums [private/internal] mom_sum_output::get_depth_list_checksums->mom_checksums::interface::field_checksum
Text view
Callers call graph
Callers of mom_sum_output::get_depth_list_checksums calls cluster_mom_sum_output MOM_sum_output mom_sum_output::get_depth_list_checksums get_depth_list_checksums [private/internal] mom_sum_output::read_depth_list read_depth_list [private/internal] mom_sum_output::read_depth_list->mom_sum_output::get_depth_list_checksums mom_sum_output::write_depth_list write_depth_list [private/internal] mom_sum_output::write_depth_list->mom_sum_output::get_depth_list_checksums
Text view
API generated with Flint · Rendered from reStructuredText