namespace mom_offline_aux

Overview

Contains routines related to offline transport of tracers. These routines are likely to be called from the MOM_offline_main module. More…

namespace mom_offline_aux {

// global functions

subroutine, public update_h_horizontal_flux(G G, GV GV, uhtr uhtr, vhtr vhtr, h_pre h_pre, h_new h_new);
subroutine, public update_h_vertical_flux(G G, GV GV, ea ea, eb eb, h_pre h_pre, h_new h_new);
subroutine, public limit_mass_flux_3d(G G, GV GV, uh uh, vh vh, ea ea, eb eb, h_pre h_pre);
subroutine, public distribute_residual_uh_barotropic(G G, GV GV, hvol hvol, uh uh);
subroutine, public distribute_residual_vh_barotropic(G G, GV GV, hvol hvol, vh vh);
subroutine, public distribute_residual_uh_upwards(G G, GV GV, hvol hvol, uh uh);
subroutine, public distribute_residual_vh_upwards(G G, GV GV, hvol hvol, vh vh);

subroutine, public offline_add_diurnal_sw(
    fluxes fluxes,
    G G,
    Time_start Time_start,
    Time_end Time_end
    );

subroutine, public update_offline_from_files(
    G G,
    GV GV,
    nk_input nk_input,
    mean_file mean_file,
    sum_file sum_file,
    snap_file snap_file,
    surf_file surf_file,
    h_end h_end,
    uhtr uhtr,
    vhtr vhtr,
    temp_mean temp_mean,
    salt_mean salt_mean,
    mld mld,
    Kd Kd,
    fluxes fluxes,
    ridx_sum ridx_sum,
    ridx_snap ridx_snap,
    read_mld read_mld,
    read_sw read_sw,
    read_ts_uvh read_ts_uvh,
    do_ale_in do_ale_in
    );

subroutine, public update_offline_from_arrays(
    G G,
    GV GV,
    nk_input nk_input,
    ridx_sum ridx_sum,
    mean_file mean_file,
    sum_file sum_file,
    snap_file snap_file,
    uhtr uhtr,
    vhtr vhtr,
    hend hend,
    uhtr_all uhtr_all,
    vhtr_all vhtr_all,
    hend_all hend_all,
    temp temp,
    salt salt,
    temp_all temp_all,
    salt_all salt_all
    );

integer function, public next_modulo_time(inidx inidx, numtime numtime);

} // namespace mom_offline_aux

Detailed Documentation

Contains routines related to offline transport of tracers. These routines are likely to be called from the MOM_offline_main module.

Global Functions

subroutine, public update_h_horizontal_flux(
    G G,
    GV GV,
    uhtr uhtr,
    vhtr vhtr,
    h_pre h_pre,
    h_new h_new
    )

This updates thickness based on the convergence of horizontal mass fluxes NOTE: Only used in non-ALE mode.

Parameters:

g

ocean grid structure

gv

ocean vertical grid structure

uhtr

Accumulated mass flux through zonal face [kg]

vhtr

Accumulated mass flux through meridional face [kg]

h_pre

Previous layer thicknesses [kg m-2].

h_new

Updated layer thicknesses [kg m-2].

subroutine, public update_h_vertical_flux(
    G G,
    GV GV,
    ea ea,
    eb eb,
    h_pre h_pre,
    h_new h_new
    )

Updates layer thicknesses due to vertical mass transports NOTE: Only used in non-ALE configuration.

Parameters:

g

ocean grid structure

gv

ocean vertical grid structure

ea

Mass of fluid entrained from the layer

eb

Mass of fluid entrained from the layer

h_pre

Layer thicknesses at the end of the previous

h_new

Updated layer thicknesses [kg m-2].

subroutine, public limit_mass_flux_3d(
    G G,
    GV GV,
    uh uh,
    vh vh,
    ea ea,
    eb eb,
    h_pre h_pre
    )

This routine limits the mass fluxes so that the a layer cannot be completely depleted. NOTE: Only used in non-ALE mode.

Parameters:

g

ocean grid structure

gv

ocean vertical grid structure

uh

Mass flux through zonal face [kg]

vh

Mass flux through meridional face [kg]

ea

Mass of fluid entrained from the layer

eb

Mass of fluid entrained from the layer

h_pre

Layer thicknesses at the end of the previous

subroutine, public distribute_residual_uh_barotropic(
    G G,
    GV GV,
    hvol hvol,
    uh uh
    )

In the case where offline advection has failed to converge, redistribute the u-flux into remainder of the water column as a barotropic equivalent.

Parameters:

g

ocean grid structure

gv

ocean vertical grid structure

hvol

Mass of water in the cells at the end

uh

Zonal mass transport within a timestep [kg]

subroutine, public distribute_residual_vh_barotropic(
    G G,
    GV GV,
    hvol hvol,
    vh vh
    )

Redistribute the v-flux as a barotropic equivalent.

Parameters:

g

ocean grid structure

gv

ocean vertical grid structure

hvol

Mass of water in the cells at the end

vh

Meridional mass transport within a timestep [kg]

subroutine, public distribute_residual_uh_upwards(G G, GV GV, hvol hvol, uh uh)

In the case where offline advection has failed to converge, redistribute the u-flux into layers above.

Parameters:

g

ocean grid structure

gv

ocean vertical grid structure

hvol

Mass of water in the cells at the end

uh

Zonal mass transport within a timestep [kg]

subroutine, public distribute_residual_vh_upwards(G G, GV GV, hvol hvol, vh vh)

In the case where offline advection has failed to converge, redistribute the u-flux into layers above.

Parameters:

g

ocean grid structure

gv

ocean vertical grid structure

hvol

Mass of water in the cells at the end

vh

Meridional mass transport within a timestep [kg]

subroutine, public offline_add_diurnal_sw(
    fluxes fluxes,
    G G,
    Time_start Time_start,
    Time_end Time_end
    )

add_diurnal_SW adjusts the shortwave fluxes in an forcying_type variable to add a synthetic diurnal cycle. Adapted from SIS2

Parameters:

fluxes

The type with atmospheric fluxes to be adjusted.

g

The ocean lateral grid type.

time_start

The start time for this step.

time_end

The ending time for this step.

subroutine, public update_offline_from_files(
    G G,
    GV GV,
    nk_input nk_input,
    mean_file mean_file,
    sum_file sum_file,
    snap_file snap_file,
    surf_file surf_file,
    h_end h_end,
    uhtr uhtr,
    vhtr vhtr,
    temp_mean temp_mean,
    salt_mean salt_mean,
    mld mld,
    Kd Kd,
    fluxes fluxes,
    ridx_sum ridx_sum,
    ridx_snap ridx_snap,
    read_mld read_mld,
    read_sw read_sw,
    read_ts_uvh read_ts_uvh,
    do_ale_in do_ale_in
    )

Controls the reading in 3d mass fluxes, diffusive fluxes, and other fields stored in a previous integration of the online model.

Parameters:

g

Horizontal grid type

gv

Vertical grid type

nk_input

Number of levels in input file

mean_file

Name of file with averages fields

sum_file

Name of file with summed fields

snap_file

Name of file with snapshot fields

surf_file

Name of file with surface fields

uhtr

Zonal mass fluxes [kg]

vhtr

Meridional mass fluxes [kg]

h_end

End of timestep layer thickness

temp_mean

Averaged temperature

salt_mean

Averaged salinity

mld

Averaged mixed layer depth

kd

Diapycnal diffusivities at interfaces

fluxes

Fields with surface fluxes

ridx_sum

Read index for sum, mean, and surf files

ridx_snap

Read index for snapshot file

read_mld

True if reading in MLD

read_sw

True if reading in radiative fluxes

read_ts_uvh

True if reading in uh, vh, and h

do_ale_in

True if using ALE algorithms

subroutine, public update_offline_from_arrays(
    G G,
    GV GV,
    nk_input nk_input,
    ridx_sum ridx_sum,
    mean_file mean_file,
    sum_file sum_file,
    snap_file snap_file,
    uhtr uhtr,
    vhtr vhtr,
    hend hend,
    uhtr_all uhtr_all,
    vhtr_all vhtr_all,
    hend_all hend_all,
    temp temp,
    salt salt,
    temp_all temp_all,
    salt_all salt_all
    )

Fields for offline transport are copied from the stored arrays read during initialization.

Parameters:

g

Horizontal grid type

gv

Vertical grid type

nk_input

Number of levels in input file

ridx_sum

Index to read from

mean_file

Name of file with averages fields

sum_file

Name of file with summed fields

snap_file

Name of file with snapshot fields

uhtr

Zonal mass fluxes [kg]

vhtr

Meridional mass fluxes [kg]

hend

End of timestep layer thickness [kg m-2]

uhtr_all

Zonal mass fluxes [kg]

vhtr_all

Meridional mass fluxes [kg]

hend_all

End of timestep layer thickness [kg m-2]

temp

Temperature array

salt

Salinity array

temp_all

Temperature array

salt_all

Salinity array

integer function, public next_modulo_time(inidx inidx, numtime numtime)

Calculates the next timelevel to read from the input fields. This allows the ‘looping’ of the fields.