MOM6
|
Reports integrated quantities for monitoring the model state.
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.
Data Types | |
type | depth_list |
A list of depths and corresponding globally integrated ocean area at each depth and the ocean volume below each depth. More... | |
type | sum_output_cs |
The control structure for the MOM_sum_output module. More... | |
Functions/Subroutines | |
subroutine, public | mom_sum_output_init (G, US, param_file, directory, ntrnc, Input_start_time, CS) |
MOM_sum_output_init initializes the parameters and settings for the MOM_sum_output module. More... | |
subroutine | mom_sum_output_end (CS) |
MOM_sum_output_end deallocates memory used by the MOM_sum_output module. More... | |
subroutine, public | write_energy (u, v, h, tv, day, n, G, GV, US, CS, tracer_CSp, OBC, dt_forcing) |
This subroutine calculates and writes the total model energy, the energy and mass of each layer, and other globally integrated physical quantities. More... | |
subroutine, public | accumulate_net_input (fluxes, sfc_state, tv, dt, G, US, CS) |
This subroutine accumates the net input of volume, salt and heat, through the ocean surface for use in diagnosing conservation. More... | |
subroutine | depth_list_setup (G, US, 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. More... | |
subroutine | create_depth_list (G, CS) |
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. More... | |
subroutine | write_depth_list (G, US, CS, filename, list_size) |
This subroutine writes out the depth list to the specified file. More... | |
subroutine | read_depth_list (G, US, CS, filename) |
This subroutine reads in the depth list to the specified file and allocates and sets up CSDL and CSlist_size . More... | |
subroutine | get_depth_list_checksums (G, depth_chksum, area_chksum) |
Return the checksums required to verify DEPTH_LIST_FILE contents. More... | |
Variables | |
integer, parameter | num_fields = 17 |
Number of diagnostic fields. More... | |
character(*), parameter | depth_chksum_attr = "bathyT_checksum" |
Checksum attribute name of GbathyT over the compute domain. More... | |
character(*), parameter | area_chksum_attr = "mask2dT_areaT_checksum" |
Checksum attribute of name of Gmask2dT * GareaT over the compute domain. More... | |
subroutine, public mom_sum_output::accumulate_net_input | ( | type(forcing), intent(in) | fluxes, |
type(surface), intent(in) | sfc_state, | ||
type(thermo_var_ptrs), intent(in) | tv, | ||
real, intent(in) | dt, | ||
type(ocean_grid_type), intent(in) | G, | ||
type(unit_scale_type), intent(in) | US, | ||
type(sum_output_cs), pointer | CS | ||
) |
This subroutine accumates the net input of volume, salt and heat, through the ocean surface for use in diagnosing conservation.
[in] | fluxes | A structure containing pointers to any possible forcing fields. Unused fields are unallocated. |
[in] | sfc_state | A structure containing fields that describe the surface state of the ocean. |
[in] | tv | A structure pointing to various thermodynamic variables. |
[in] | dt | The amount of time over which to average [T ~> s]. |
[in] | g | The ocean's grid structure. |
[in] | us | A dimensional unit scaling type |
cs | The control structure returned by a previous call to MOM_sum_output_init. |
Definition at line 941 of file MOM_sum_output.F90.
References mom_error_handler::mom_error().
|
private |
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.
[in] | g | The ocean's grid structure. |
cs | The control structure set up in MOM_sum_output_init, in which the ordered depth list is stored. |
Definition at line 1109 of file MOM_sum_output.F90.
Referenced by depth_list_setup(), and read_depth_list().
|
private |
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.
[in] | g | The ocean's grid structure |
[in] | us | A dimensional unit scaling type |
cs | The control structure returned by a previous call to MOM_sum_output_init. |
Definition at line 1079 of file MOM_sum_output.F90.
References create_depth_list(), mom_error_handler::is_root_pe(), mom_error_handler::mom_error(), read_depth_list(), and write_depth_list().
Referenced by mom_sum_output_init().
|
private |
Return the checksums required to verify DEPTH_LIST_FILE contents.
This function computes checksums for the bathymetry (GbathyT) 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.
[in] | g | Ocean grid structure |
[out] | depth_chksum | Depth checksum hexstring |
[out] | area_chksum | Area checksum hexstring |
Definition at line 1485 of file MOM_sum_output.F90.
Referenced by read_depth_list(), and write_depth_list().
|
private |
MOM_sum_output_end deallocates memory used by the MOM_sum_output module.
cs | The control structure returned by a previous call to MOM_sum_output_init. |
Definition at line 290 of file MOM_sum_output.F90.
subroutine, public mom_sum_output::mom_sum_output_init | ( | type(ocean_grid_type), intent(in) | G, |
type(unit_scale_type), intent(in) | US, | ||
type(param_file_type), intent(in) | param_file, | ||
character(len=*), intent(in) | directory, | ||
integer, intent(inout), target | ntrnc, | ||
type(time_type), intent(in) | Input_start_time, | ||
type(sum_output_cs), pointer | CS | ||
) |
MOM_sum_output_init initializes the parameters and settings for the MOM_sum_output module.
[in] | g | The ocean's grid structure. |
[in] | us | A dimensional unit scaling type |
[in] | param_file | A structure to parse for run-time parameters. |
[in] | directory | The directory where the energy file goes. |
[in,out] | ntrnc | The integer that stores the number of times the velocity has been truncated since the last call to write_energy. |
[in] | input_start_time | The start time of the simulation. |
cs | A pointer that is set to point to the control structure for this module. |
Definition at line 142 of file MOM_sum_output.F90.
References depth_list_setup(), and mom_error_handler::mom_error().
Referenced by mom::initialize_mom().
|
private |
This subroutine reads in the depth list to the specified file and allocates and sets up CSDL and CSlist_size .
[in] | g | The ocean's grid structure |
[in] | us | A dimensional unit scaling type |
cs | The control structure returned by a previous call to MOM_sum_output_init. | |
[in] | filename | The path to the depth list file to read. |
Definition at line 1329 of file MOM_sum_output.F90.
References area_chksum_attr, create_depth_list(), depth_chksum_attr, get_depth_list_checksums(), mom_error_handler::mom_error(), and write_depth_list().
Referenced by depth_list_setup().
|
private |
This subroutine writes out the depth list to the specified file.
[in] | g | The ocean's grid structure. |
[in] | us | A dimensional unit scaling type |
cs | The control structure returned by a previous call to MOM_sum_output_init. | |
[in] | filename | The path to the depth list file to write. |
[in] | list_size | The size of the depth list. |
Definition at line 1234 of file MOM_sum_output.F90.
References area_chksum_attr, depth_chksum_attr, get_depth_list_checksums(), mom_error_handler::is_root_pe(), and mom_error_handler::mom_error().
Referenced by depth_list_setup(), and read_depth_list().
subroutine, public mom_sum_output::write_energy | ( | real, dimension(szib_(g),szj_(g),szk_(g)), intent(in) | u, |
real, dimension(szi_(g),szjb_(g),szk_(g)), intent(in) | v, | ||
real, dimension(szi_(g),szj_(g),szk_(g)), intent(in) | h, | ||
type(thermo_var_ptrs), intent(in) | tv, | ||
type(time_type), intent(in) | day, | ||
integer, intent(in) | n, | ||
type(ocean_grid_type), intent(in) | G, | ||
type(verticalgrid_type), intent(in) | GV, | ||
type(unit_scale_type), intent(in) | US, | ||
type(sum_output_cs), pointer | CS, | ||
type(tracer_flow_control_cs), optional, pointer | tracer_CSp, | ||
type(ocean_obc_type), optional, pointer | OBC, | ||
type(time_type), intent(in), optional | dt_forcing | ||
) |
This subroutine calculates and writes the total model energy, the energy and mass of each layer, and other globally integrated physical quantities.
[in] | g | The ocean's grid structure. |
[in] | gv | The ocean's vertical grid structure. |
[in] | us | A dimensional unit scaling type |
[in] | u | The zonal velocity [L T-1 ~> m s-1]. |
[in] | v | The meridional velocity [L T-1 ~> m s-1]. |
[in] | h | Layer thicknesses [H ~> m or kg m-2]. |
[in] | tv | A structure pointing to various thermodynamic variables. |
[in] | day | The current model time. |
[in] | n | The time step number of the current execution. |
cs | The control structure returned by a previous call to MOM_sum_output_init. | |
tracer_csp | tracer control structure. | |
obc | Open boundaries control structure. | |
[in] | dt_forcing | The forcing time step |
Definition at line 304 of file MOM_sum_output.F90.
References mom_tracer_flow_control::call_tracer_stocks(), mom_error_handler::is_root_pe(), mom_error_handler::mom_error(), mom_open_boundary::obc_direction_e, mom_open_boundary::obc_direction_n, mom_open_boundary::obc_direction_s, and mom_open_boundary::obc_direction_w.
|
private |
Checksum attribute of name of Gmask2dT * GareaT over the compute domain.
Definition at line 47 of file MOM_sum_output.F90.
Referenced by read_depth_list(), and write_depth_list().
|
private |
Checksum attribute name of GbathyT over the compute domain.
Definition at line 44 of file MOM_sum_output.F90.
Referenced by read_depth_list(), and write_depth_list().
|
private |
Number of diagnostic fields.
Definition at line 43 of file MOM_sum_output.F90.