namespace ocean_model_mod

Overview

Top-level module for the MOM6 ocean model in coupled mode. More…

namespace ocean_model_mod {

// interfaces

interface ocean_model_data_get;

// global functions

subroutine, public ocean_model_init(
    Ocean_sfc Ocean_sfc,
    OS OS,
    Time_init Time_init,
    Time_in Time_in,
    gas_fields_ocn gas_fields_ocn
    );

subroutine, public update_ocean_model(
    Ice_ocean_boundary Ice_ocean_boundary,
    OS OS,
    Ocean_sfc Ocean_sfc,
    time_start_update time_start_update,
    Ocean_coupling_time_step Ocean_coupling_time_step,
    update_dyn update_dyn,
    update_thermo update_thermo,
    Ocn_fluxes_used Ocn_fluxes_used,
    start_cycle start_cycle,
    end_cycle end_cycle,
    cycle_length cycle_length
    );

subroutine, public ocean_model_restart(OS OS, timestamp timestamp);
subroutine, public ocean_model_end(Ocean_sfc Ocean_sfc, Ocean_state Ocean_state, Time Time);

subroutine, public ocean_model_save_restart(
    OS OS,
    Time Time,
    directory directory,
    filename_suffix filename_suffix
    );

subroutine, public ocean_model_init_sfc(OS OS, Ocean_sfc Ocean_sfc);
subroutine, public ocean_model_flux_init(OS OS, verbosity verbosity);
subroutine, public ocean_stock_pe(OS OS, index index, value value, time_index time_index);
subroutine ocean_model_data2d_get(OS OS, Ocean Ocean, name name, array2D array2D, isc isc, jsc jsc);
subroutine ocean_model_data1d_get(OS OS, Ocean Ocean, name name, value value);
subroutine, public ocean_public_type_chksum(id id, timestep timestep, ocn ocn);

} // namespace ocean_model_mod

Detailed Documentation

Top-level module for the MOM6 ocean model in coupled mode.

Global Functions

subroutine, public ocean_model_init(
    Ocean_sfc Ocean_sfc,
    OS OS,
    Time_init Time_init,
    Time_in Time_in,
    gas_fields_ocn gas_fields_ocn
    )

ocean_model_init initializes the ocean model, including registering fields for restarts and reading restart files if appropriate.

This subroutine initializes both the ocean state and the ocean surface type. Because of the way that indicies and domains are handled, Ocean_sfc must have been used in a previous call to initialize_ocean_type.

Parameters:

ocean_sfc

A structure containing various publicly

os

A structure whose internal contents are private to ocean_model_mod that may be used to contain all information about the ocean’s interior state.

time_init

The start time for the coupled model’s calendar

time_in

The time at which to initialize the ocean model.

gas_fields_ocn

If present, this type describes the

subroutine, public update_ocean_model(
    Ice_ocean_boundary Ice_ocean_boundary,
    OS OS,
    Ocean_sfc Ocean_sfc,
    time_start_update time_start_update,
    Ocean_coupling_time_step Ocean_coupling_time_step,
    update_dyn update_dyn,
    update_thermo update_thermo,
    Ocn_fluxes_used Ocn_fluxes_used,
    start_cycle start_cycle,
    end_cycle end_cycle,
    cycle_length cycle_length
    )

update_ocean_model uses the forcing in Ice_ocean_boundary to advance the ocean model’s state from the input value of Ocean_state (which must be for time time_start_update) for a time interval of Ocean_coupling_time_step, returning the publicly visible ocean surface properties in Ocean_sfc and storing the new ocean properties in Ocean_state.

Parameters:

ice_ocean_boundary

A structure containing the various

os

A pointer to a private structure containing the

ocean_sfc

A structure containing all the publicly visible

time_start_update

The time at the beginning of the update step.

ocean_coupling_time_step

The amount of time over which to advance the ocean.

update_dyn

If present and false, do not do updates due to the ocean dynamics.

update_thermo

If present and false, do not do updates due to the ocean thermodynamics or remapping.

ocn_fluxes_used

If present, this indicates whether the cumulative thermodynamic fluxes from the ocean, like frazil, have been used and should be reset.

start_cycle

This indicates whether this call is to be treated as the first call to step_MOM in a time-stepping cycle; missing is like true.

end_cycle

This indicates whether this call is to be treated as the last call to step_MOM in a time-stepping cycle; missing is like true.

cycle_length

The duration of a coupled time stepping cycle [s].

subroutine, public ocean_model_restart(OS OS, timestamp timestamp)

This subroutine writes out the ocean model restart file.

Parameters:

os

A pointer to the structure containing the internal ocean state being saved to a restart file

timestamp

An optional timestamp string that should be prepended to the file name. (Currently this is unused.)

subroutine, public ocean_model_end(
    Ocean_sfc Ocean_sfc,
    Ocean_state Ocean_state,
    Time Time
    )

ocean_model_end terminates the model run, saving the ocean state in a restart and deallocating any data associated with the ocean.

Parameters:

ocean_sfc

An ocean_public_type structure that is to be deallocated upon termination.

ocean_state

A pointer to the structure containing the internal ocean state to be deallocated upon termination.

time

The model time, used for writing restarts.

subroutine, public ocean_model_save_restart(
    OS OS,
    Time Time,
    directory directory,
    filename_suffix filename_suffix
    )

ocean_model_save_restart causes restart files associated with the ocean to be written out.

Parameters:

os

A pointer to the structure containing the internal ocean state (in).

time

The model time at this call, needed for mpp_write calls.

directory

An optional directory into which to write these restart files.

filename_suffix

An optional suffix (e.g., a time-stamp) to append to the restart file names.

subroutine, public ocean_model_init_sfc(OS OS, Ocean_sfc Ocean_sfc)

This subroutine extracts the surface properties from the ocean’s internal state and stores them in the ocean type returned to the calling ice model. It has to be separate from the ocean_initialization call because the coupler module allocates the space for some of these variables.

Parameters:

os

The structure with the complete ocean state

ocean_sfc

A structure containing various publicly visible ocean surface properties after initialization, whose elements have their data set here.

subroutine, public ocean_model_flux_init(OS OS, verbosity verbosity)

ocean_model_flux_init is used to initialize properties of the air-sea fluxes as determined by various run-time parameters. It can be called from non-ocean PEs, or PEs that have not yet been initialzed, and it can safely be called multiple times.

Parameters:

os

An optional pointer to the ocean state, used to figure out if this is an ocean PE that has already been initialized.

verbosity

A 0-9 integer indicating a level of verbosity.

subroutine, public ocean_stock_pe(
    OS OS,
    index index,
    value value,
    time_index time_index
    )

Ocean_stock_pe - returns the integrated stocks of heat, water, etc. for conservation checks. Because of the way FMS is coded, only the root PE has the integrated amount, while all other PEs get 0.

Parameters:

os

A structure containing the internal ocean state. The data in OS is intent in.

index

The stock index for the quantity of interest.

value

Sum returned for the conservation quantity of interest.

time_index

An unused optional argument, present only for interfacial compatibility with other models.

subroutine ocean_model_data2d_get(
    OS OS,
    Ocean Ocean,
    name name,
    array2D array2D,
    isc isc,
    jsc jsc
    )

This subroutine extracts a named 2-D field from the ocean surface or public type.

Parameters:

os

A pointer to the structure containing the internal ocean state (intent in).

ocean

A structure containing various publicly visible ocean surface fields.

name

The name of the field to extract

array2d

The values of the named field, it must cover only the computational domain

isc

The starting i-index of array2D

jsc

The starting j-index of array2D

subroutine ocean_model_data1d_get(OS OS, Ocean Ocean, name name, value value)

This subroutine extracts a named scalar field from the ocean surface or public type.

Parameters:

os

A pointer to the structure containing the internal ocean state (intent in).

ocean

A structure containing various publicly visible ocean surface fields.

name

The name of the field to extract

value

The value of the named field

subroutine, public ocean_public_type_chksum(id id, timestep timestep, ocn ocn)

Write out FMS-format checsums on fields from the ocean surface state.

Parameters:

id

An identifying string for this call

timestep

The number of elapsed timesteps

ocn

A structure containing various publicly visible ocean surface fields.