namespace mom_sponge

Overview

Implements sponge regions in isopycnal mode. More…

namespace mom_sponge {

// global functions

subroutine, public initialize_sponge(
    Iresttime Iresttime,
    int_height int_height,
    G G,
    param_file param_file,
    CS CS,
    GV GV,
    Iresttime_i_mean Iresttime_i_mean,
    int_height_i_mean int_height_i_mean
    );

subroutine, public init_sponge_diags(Time Time, G G, diag diag, CS CS);

subroutine, public set_up_sponge_field(
    sp_val sp_val,
    f_ptr f_ptr,
    G G,
    nlay nlay,
    CS CS,
    sp_val_i_mean sp_val_i_mean
    );

subroutine, public set_up_sponge_ml_density(sp_val sp_val, G G, CS CS, sp_val_i_mean sp_val_i_mean);
subroutine, public apply_sponge(h h, dt dt, G G, GV GV, ea ea, eb eb, CS CS, Rcv_ml Rcv_ml);
subroutine, public sponge_end(CS CS);

} // namespace mom_sponge

Detailed Documentation

Implements sponge regions in isopycnal mode.

By Robert Hallberg, March 1999-June 2000

This program contains the subroutines that implement sponge regions, in which the stratification and water mass properties are damped toward some profiles. There are three externally callable subroutines in this file.

initialize_sponge determines the mapping from the model variables into the arrays of damped columns. This remapping is done for efficiency and to conserve memory. Only columns which have positive inverse damping times and which are deeper than a supplied depth are placed in sponges. The inverse damping time is also stored in this subroutine, and memory is allocated for all of the reference profiles which will subsequently be provided through calls to set_up_sponge_field. The first two arguments are a two-dimensional array containing the damping rates, and the interface heights to damp towards.

set_up_sponge_field is called to provide a reference profile and the location of the field that will be damped back toward that reference profile. A third argument, the number of layers in the field is also provided, but this should always be nz.

Apply_sponge damps all of the fields that have been registered with set_up_sponge_field toward their reference profiles. The four arguments are the thickness to be damped, the amount of time over which the damping occurs, and arrays to which the movement of fluid into a layer from above and below will be added. The effect on momentum of the sponge may be accounted for later using the movement of water recorded in these later arrays.

Global Functions

subroutine, public initialize_sponge(
    Iresttime Iresttime,
    int_height int_height,
    G G,
    param_file param_file,
    CS CS,
    GV GV,
    Iresttime_i_mean Iresttime_i_mean,
    int_height_i_mean int_height_i_mean
    )

This subroutine determines the number of points which are within sponges in this computational domain. Only points that have positive values of Iresttime and which mask2dT indicates are ocean points are included in the sponges. It also stores the target interface heights.

Parameters:

g

The ocean’s grid structure

iresttime

The inverse of the restoring time [s-1].

int_height

The interface heights to damp back toward [Z ~> m].

param_file

A structure to parse for run-time parameters

cs

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

gv

The ocean’s vertical grid structure

iresttime_i_mean

The inverse of the restoring time for

int_height_i_mean

The interface heights toward which to

subroutine, public init_sponge_diags(Time Time, G G, diag diag, CS CS)

This subroutine sets up diagnostics for the sponges. It is separate from initialize_sponge because it requires fields that are not readily available where initialize_sponge is called.

Parameters:

time

The current model time

g

The ocean’s grid structure

diag

A structure that is used to regulate diagnostic output

cs

A pointer to the control structure for this module that is set by a previous call to initialize_sponge.

subroutine, public set_up_sponge_field(
    sp_val sp_val,
    f_ptr f_ptr,
    G G,
    nlay nlay,
    CS CS,
    sp_val_i_mean sp_val_i_mean
    )

This subroutine stores the reference profile for the variable whose address is given by f_ptr. nlay is the number of layers in this variable.

Parameters:

g

The ocean’s grid structure

sp_val

The reference profiles of the quantity being registered.

f_ptr

a pointer to the field which will be damped

nlay

the number of layers in this quantity

cs

A pointer to the control structure for this module that is set by a previous call to initialize_sponge.

sp_val_i_mean

The i-mean reference value for

subroutine, public set_up_sponge_ml_density(
    sp_val sp_val,
    G G,
    CS CS,
    sp_val_i_mean sp_val_i_mean
    )

This subroutine stores the reference value for mixed layer density. It is handled differently from other values because it is only used in determining which layers can be inflated.

Parameters:

g

The ocean’s grid structure

sp_val

The reference values of the mixed layer density [kg m-3]

cs

A pointer to the control structure for this module that is set by a previous call to initialize_sponge.

sp_val_i_mean

the reference values of the zonal mean mixed

subroutine, public apply_sponge(
    h h,
    dt dt,
    G G,
    GV GV,
    ea ea,
    eb eb,
    CS CS,
    Rcv_ml Rcv_ml
    )

This subroutine applies damping to the layers thicknesses, mixed layer buoyancy, and a variety of tracers for every column where there is damping.

Parameters:

g

The ocean’s grid structure

gv

The ocean’s vertical grid structure

h

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

dt

The amount of time covered by this call [s].

ea

An array to which the amount of fluid entrained

eb

An array to which the amount of fluid entrained

cs

A pointer to the control structure for this module that is set by a previous call to initialize_sponge.

rcv_ml

The coordinate density of the mixed layer [kg m-3].

subroutine, public sponge_end(CS CS)

This call deallocates any memory in the sponge control structure.

Parameters:

cs

A pointer to the control structure for this module that is set by a previous call to initialize_sponge.