# mom_sponge module reference¶

Implements sponge regions in isopycnal mode.

More…

## Data Types¶

 p2d A structure for creating arrays of pointers to 2D arrays. p3d A structure for creating arrays of pointers to 3D arrays. sponge_cs This control structure holds memory and parameters for the MOM_sponge module.

## Functions/Subroutines¶

 initialize_sponge() This subroutine determines the number of points which are within sponges in this computational domain. init_sponge_diags() This subroutine sets up diagnostics for the sponges. set_up_sponge_field() This subroutine stores the reference profile for the variable whose address is given by f_ptr. set_up_sponge_ml_density() This subroutine stores the reference value for mixed layer density. apply_sponge() This subroutine applies damping to the layers thicknesses, mixed layer buoyancy, and a variety of tracers for every column where there is damping. sponge_end() This call deallocates any memory in the sponge control structure.

## Detailed Description¶

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.

## Type Documentation¶

type mom_sponge/p2d

A structure for creating arrays of pointers to 2D arrays.

Type fields
• % p [real(:,:),pointer] :: A pointer to a 2D array.

type mom_sponge/p3d

A structure for creating arrays of pointers to 3D arrays.

Type fields
• % p [real(:,:,:),pointer] :: A pointer to a 3D array.

type mom_sponge/sponge_cs

This control structure holds memory and parameters for the MOM_sponge module.

Type fields
• % bulkmixedlayer [logical] :: If true, a refined bulk mixed layer is used with nkml sublayers and nkbl buffer layer.

• % nz [integer] :: The total number of layers.

• % isc [integer] :: The starting i-index of the computational domain at h.

• % iec [integer] :: The ending i-index of the computational domain at h.

• % jsc [integer] :: The starting j-index of the computational domain at h.

• % jec [integer] :: The ending j-index of the computational domain at h.

• % isd [integer] :: The starting i-index of the data domain at h.

• % ied [integer] :: The ending i-index of the data domain at h.

• % jsd [integer] :: The starting j-index of the data domain at h.

• % jed [integer] :: The ending j-index of the data domain at h.

• % num_col [integer] :: The number of sponge points within the computational domain.

• % fldno [integer] :: The number of fields which have already been registered by calls to set_up_sponge_field.

• % col_i [integer(:),pointer] :: Array of the i-indicies of each of the columns being damped.

• % col_j [integer(:),pointer] :: Array of the j-indicies of each of the columns being damped.

• % iresttime_col [real(:),pointer] :: The inverse restoring time of each column [T-1 ~> s-1].

• % rcv_ml_ref [real(:),pointer] :: The value toward which the mixed layer coordinate-density is being damped [R ~> kg m-3].

• % ref_eta [real(:,:),pointer] :: The value toward which the interface heights are being damped [Z ~> m].

• % var [type( p3d )(50)] :: Pointers to the fields that are being damped.

• % ref_val [type( p2d )(50)] :: The values to which the fields are damped.

• % do_i_mean_sponge [logical] :: If true, apply sponges to the i-mean fields.

• % iresttime_im [real(:),pointer] :: The inverse restoring time of each row for i-mean sponges [T-1 ~> s-1].

• % rcv_ml_ref_im [real(:),pointer] :: mixed layer coordinate-density is being damped [R ~> kg m-3].

• % ref_eta_im [real(:,:),pointer] :: The value toward which the i-mean interface heights are being damped [Z ~> m].

• % ref_val_im [type( p2d )(50)] :: The values toward which the i-means of fields are damped.

• % diag [type(diag_ctrl),pointer] :: A structure that is used to regulate the timing of diagnostic output.

• % id_w_sponge [integer] :: A diagnostic ID.

## Function/Subroutine Documentation¶

subroutine mom_sponge/initialize_sponge(Iresttime, int_height, G, param_file, CS, GV, Iresttime_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 :: [in] The ocean’s grid structure

• gv :: [in] The ocean’s vertical grid structure

• iresttime :: [in] The inverse of the restoring time [T-1 ~> s-1].

• int_height :: [in] The interface heights to damp back toward [Z ~> m].

• param_file :: [in] A structure to parse for run-time parameters

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

• iresttime_i_mean :: [in] The inverse of the restoring time for

• int_height_i_mean :: [in] The interface heights toward which to

Call to

mom_error_handler::mom_error

Called from
subroutine mom_sponge/init_sponge_diags(Time, G, GV, US, diag, 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 :: [in] The current model time

• g :: [in] The ocean’s grid structure

• gv :: [in] The ocean’s vertical grid structure

• us :: [in] A dimensional unit scaling type

• diag :: [inout] 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 mom_sponge/set_up_sponge_field(sp_val, f_ptr, G, GV, nlay, CS, 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 :: [in] The ocean’s grid structure

• gv :: [in] The ocean’s vertical grid structure

• sp_val :: [in] The reference profiles of the quantity being registered.

• f_ptr :: [in] a pointer to the field which will be damped

• nlay :: [in] 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 :: [in] The i-mean reference value for

Call to

mom_error_handler::mom_error

Called from
subroutine mom_sponge/set_up_sponge_ml_density(sp_val, G, CS, 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 :: [in] The ocean’s grid structure

• sp_val :: [in] The reference values of the mixed layer density [R ~> 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 :: [in] the reference values of the zonal mean mixed

Call to

mom_error_handler::mom_error

Called from

rgc_initialization::rgc_initialize_sponges

subroutine mom_sponge/apply_sponge(h, dt, G, GV, US, ea, eb, CS, 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 :: [inout] The ocean’s grid structure

• gv :: [in] The ocean’s vertical grid structure

• us :: [in] A dimensional unit scaling type

• h :: [inout] Layer thicknesses [H ~> m or kg m-2]

• dt :: [in] The amount of time covered by this call [T ~> s].

• ea :: [inout] An array to which the amount of fluid entrained

• eb :: [inout] 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 :: [inout] The coordinate density of the mixed layer [R ~> kg m-3].

Call to
Called from

mom_diabatic_driver::layered_diabatic

subroutine mom_sponge/sponge_end(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.