mom_ale_sponge module reference

This module contains the routines used to apply sponge layers when using the ALE mode.

More…

Data Types

ale_sponge_cs

ALE sponge control structure.

p2d

A structure for creating arrays of pointers to 2D arrays with extra gridding information.

p3d

A structure for creating arrays of pointers to 3D arrays with extra gridding information.

Functions/Subroutines

initialize_ale_sponge_fixed()

This subroutine determines the number of points which are within sponges in this computational domain.

get_ale_sponge_nz_data()

Return the number of layers in the data with a fixed ALE sponge, or 0 if there are no sponge columns on this PE.

get_ale_sponge_thicknesses()

Return the thicknesses used for the data with a fixed ALE sponge.

initialize_ale_sponge_varying()

This subroutine determines the number of points which are to be restoref in the computational domain.

init_ale_sponge_diags()

Initialize diagnostics for the ALE_sponge module.

set_up_ale_sponge_field_fixed()

This subroutine stores the reference profile at h points for the variable whose address is given by f_ptr.

set_up_ale_sponge_field_varying()

This subroutine stores the reference profile at h points for the variable whose address is given by filename and fieldname.

set_up_ale_sponge_vel_field_fixed()

This subroutine stores the reference profile at u and v points for the variable whose address is given by u_ptr and v_ptr.

set_up_ale_sponge_vel_field_varying()

This subroutine stores the reference profile at uand v points for the variable whose address is given by u_ptr and v_ptr.

apply_ale_sponge()

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

rotate_ale_sponge()

Rotate the ALE sponge fields from the input to the model index map.

update_ale_sponge_field()

Scan the ALE sponge variables and replace a prescribed pointer to a new value.

ale_sponge_end()

This subroutine deallocates any memory associated with the ALE_sponge module.

Detailed Description

Applying sponges requires the following:

  1. initialize_ALE_sponge

  2. set_up_ALE_sponge_field (tracers) and set_up_ALE_sponge_vel_field (vel)

  3. apply_ALE_sponge

  4. init_ALE_sponge_diags (not being used for now)

  5. ALE_sponge_end (not being used for now)

Type Documentation

type mom_ale_sponge/ale_sponge_cs

ALE sponge control structure.

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

  • % nz_data [integer] :: The total number of arbritary layers (used by older code).

  • % 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.

  • % iscb [integer] :: The starting I-index of the computational domain at u/v.

  • % iecb [integer] :: The ending I-index of the computational domain at u/v.

  • % jscb [integer] :: The starting J-index of the computational domain at u/v.

  • % jecb [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 tracer points within the computational domain.

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

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

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

  • % sponge_uv [logical] :: Control whether u and v are included in sponge.

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

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

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

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

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

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

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

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

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

  • % 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.

  • % ref_val_u [type( p2d )] :: The values to which the u-velocities are damped.

  • % ref_val_v [type( p2d )] :: The values to which the v-velocities are damped.

  • % var_u [type( p3d )] :: Pointer to the u velocities. that are being damped.

  • % var_v [type( p3d )] :: Pointer to the v velocities. that are being damped.

  • % ref_h [type( p2d )] :: Grid on which reference data is provided (older code).

  • % ref_hu [type( p2d )] :: u-point grid on which reference data is provided (older code).

  • % ref_hv [type( p2d )] :: v-point grid on which reference data is provided (older code).

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

  • % remap_cs [type(remapping_cs)] :: Remapping parameters and work arrays.

  • % remap_answers_2018 [logical] :: If true, use the order of arithmetic and expressions that recover the answers for remapping from the end of 2018. Otherwise, use more robust forms of the same expressions.

  • % hor_regrid_answers_2018 [logical] :: If true, use the order of arithmetic for horizonal regridding that recovers the answers from the end of 2018. Otherwise, use rotationally symmetric forms of the same expressions.

  • % time_varying_sponges [logical] :: True if using newer sponge code.

  • % spongedataongrid [logical] :: True if the sponge data are on the model horizontal grid.

type mom_ale_sponge/p2d

A structure for creating arrays of pointers to 2D arrays with extra gridding information.

Type fields
  • % id [integer,private] :: id for FMS external time interpolator

  • % nz_data [integer,private] :: The number of vertical levels in the input field.

  • % num_tlevs [integer,private] :: The number of time records contained in the file.

  • % mask_in [real(:,:),pointer, private] :: pointer to the data mask.

  • % p [real(:,:),pointer, private] :: pointer the data.

  • % h [real(:,:),pointer, private] :: pointer the data grid.

type mom_ale_sponge/p3d

A structure for creating arrays of pointers to 3D arrays with extra gridding information.

Type fields
  • % id [integer,private] :: id for FMS external time interpolator

  • % nz_data [integer,private] :: The number of vertical levels in the input field.

  • % num_tlevs [integer,private] :: The number of time records contained in the file.

  • % mask_in [real(:,:,:),pointer, private] :: pointer to the data mask.

  • % p [real(:,:,:),pointer, private] :: pointer to the data.

  • % h [real(:,:,:),pointer, private] :: pointer to the data grid.

Function/Subroutine Documentation

subroutine mom_ale_sponge/initialize_ale_sponge_fixed(Iresttime, G, param_file, CS, data_h, nz_data)

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.

  • nz_data :: [in] The total number of sponge input layers.

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

  • param_file :: [in] A structure indicating the open file to parse for model parameter values.

  • cs :: A pointer that is set to point to the control structure for this module (in/out).

  • data_h :: [in] The thicknesses of the sponge input layers [H ~> m or kg m-2].

Call to

mom_remapping::initialize_remapping mom_error_handler::mom_error

Called from

rotate_ale_sponge

function mom_ale_sponge/get_ale_sponge_nz_data(CS) [integer]

Return the number of layers in the data with a fixed ALE sponge, or 0 if there are no sponge columns on this PE.

Parameters

cs :: A pointer that is set to point to the control structure for the ALE_sponge module.

Return

undefined :: The number of layers in the fixed sponge data.

Called from

rgc_tracer::initialize_rgc_tracer

subroutine mom_ale_sponge/get_ale_sponge_thicknesses(G, data_h, sponge_mask, CS)

Return the thicknesses used for the data with a fixed ALE sponge.

Parameters
  • g :: [in] The ocean’s grid structure (in).

  • data_h :: [inout] The thicknesses of the sponge input layers [H ~> m or kg m-2].

  • sponge_mask :: [out] A logical mask that is true where

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

Call to

mom_error_handler::mom_error

subroutine mom_ale_sponge/initialize_ale_sponge_varying(Iresttime, G, param_file, CS)

This subroutine determines the number of points which are to be restoref in the computational domain. Only points that have positive values of Iresttime and which mask2dT indicates are ocean points are included in the sponges.

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

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

  • param_file :: [in] A structure indicating the open file to parse for model parameter values.

  • cs :: A pointer that is set to point to the control structure for this module (in/out).

Call to

mom_remapping::initialize_remapping mom_error_handler::mom_error

Called from

rotate_ale_sponge

subroutine mom_ale_sponge/init_ale_sponge_diags(Time, G, diag, CS)

Initialize diagnostics for the ALE_sponge module.

Parameters
  • time :: [in] The current model time

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

  • diag :: [inout] A structure that is used to regulate diagnostic output.

  • cs :: ALE sponge control structure

subroutine mom_ale_sponge/set_up_ale_sponge_field_fixed(sp_val, G, f_ptr, CS)

This subroutine stores the reference profile at h points for the variable whose address is given by f_ptr.

Parameters
  • g :: [in] Grid structure

  • cs :: ALE sponge control structure (in/out).

  • sp_val :: [in] Field to be used in the sponge, it has arbitrary number of layers.

  • f_ptr :: [in] Pointer to the field to be damped

Call to

mom_error_handler::mom_error

subroutine mom_ale_sponge/set_up_ale_sponge_field_varying(filename, fieldname, Time, G, GV, US, f_ptr, CS)

This subroutine stores the reference profile at h points for the variable whose address is given by filename and fieldname.

Parameters
  • filename :: [in] The name of the file with the time varying field data

  • fieldname :: [in] The name of the field in the file with the time varying field data

  • time :: [in] The current model time

  • g :: [in] Grid structure (in).

  • gv :: [in] ocean vertical grid structure

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

  • f_ptr :: [in] Pointer to the field to be damped (in).

  • cs :: Sponge control structure (in/out).

Call to

mom_error_handler::mom_error

subroutine mom_ale_sponge/set_up_ale_sponge_vel_field_fixed(u_val, v_val, G, u_ptr, v_ptr, CS)

This subroutine stores the reference profile at u and v points for the variable whose address is given by u_ptr and v_ptr.

Parameters
  • g :: [in] Grid structure (in).

  • cs :: Sponge structure (in/out).

  • u_val :: [in] u field to be used in the sponge, it has arbritary number of layers.

  • v_val :: [in] v field to be used in the sponge, it has arbritary number of layers.

  • u_ptr :: [in] u pointer to the field to be damped

  • v_ptr :: [in] v pointer to the field to be damped

subroutine mom_ale_sponge/set_up_ale_sponge_vel_field_varying(filename_u, fieldname_u, filename_v, fieldname_v, Time, G, US, CS, u_ptr, v_ptr)

This subroutine stores the reference profile at uand v points for the variable whose address is given by u_ptr and v_ptr.

Parameters
  • filename_u :: [in] File name for u field

  • fieldname_u :: [in] Name of u variable in file

  • filename_v :: [in] File name for v field

  • fieldname_v :: [in] Name of v variable in file

  • time :: [in] Model time

  • g :: [inout] Ocean grid (in)

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

  • cs :: Sponge structure (in/out).

  • u_ptr :: [in] u pointer to the field to be damped (in).

  • v_ptr :: [in] v pointer to the field to be damped (in).

subroutine mom_ale_sponge/apply_ale_sponge(h, dt, G, GV, US, CS, Time)

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

Parameters
  • g :: [inout] The ocean’s grid structure (in).

  • gv :: [in] ocean vertical grid structure

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

  • h :: [inout] Layer thickness [H ~> m or kg m-2] (in)

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

  • cs :: A pointer to the control structure for this module that is set by a previous call to initialize_ALE_sponge (in).

  • time :: [in] The current model date

Call to

mom_error_handler::mom_error mom_remapping::remapping_core_h

Called from

mom_diabatic_driver::diabatic_ale mom_diabatic_driver::diabatic_ale_legacy

subroutine mom_ale_sponge/rotate_ale_sponge(sponge_in, G_in, sponge, G, turns, param_file)

Rotate the ALE sponge fields from the input to the model index map.

Parameters
  • sponge_in :: [in] The control structure for this module with the original grid rotation

  • g_in :: [in] The ocean’s grid structure with the original rotation.

  • sponge :: A pointer to the control that will be set up with the new grid rotation

  • g :: [in] The ocean’s grid structure with the new rotation.

  • turns :: [in] The number of 90-degree turns between grids

  • param_file :: [in] A structure indicating the open file to parse for model parameter values.

Call to

initialize_ale_sponge_fixed initialize_ale_sponge_varying mom_error_handler::mom_error

subroutine mom_ale_sponge/update_ale_sponge_field(sponge, p_old, G, GV, p_new)

Scan the ALE sponge variables and replace a prescribed pointer to a new value.

Parameters
  • sponge :: A pointer to the control structure for this module that is set by a previous call to initialize_ALE_sponge.

  • p_old :: [in] The previous array of target values

  • g :: [in] The updated ocean grid structure

  • gv :: [in] ocean vertical grid structure

  • p_new :: [in] The new array of target values

subroutine mom_ale_sponge/ale_sponge_end(CS)

This subroutine deallocates any memory associated with the ALE_sponge module.

Parameters

cs :: A pointer to the control structure that is set by a previous call to initialize_ALE_sponge.