# user_change_diffusivity module reference¶

Increments the diapycnal diffusivity in a specified band of latitudes and densities.

More…

## Data Types¶

 user_change_diff_cs Control structure for user_change_diffusivity().

## Functions/Subroutines¶

 user_change_diff() This subroutine provides an interface for a user to use to modify the main code to alter the diffusivities as needed. range_ok() This subroutine checks whether the 4 values of range are in ascending order. val_weights() This subroutine returns a value that goes smoothly from 0 to 1, stays at 1, and then goes smoothly back to 0 at the four values of range. user_change_diff_init() Set up the module control structure. user_change_diff_end() Clean up the module control structure.

## Detailed Description¶

Increments the diapycnal diffusivity in a specified band of latitudes and densities.

## Type Documentation¶

type user_change_diffusivity/user_change_diff_cs

Control structure for user_change_diffusivity(). .

Type fields
• % kd_add [real] :: The scale of a diffusivity that is added everywhere without any filtering or scaling [Z2 T-1 ~> m2 s-1].

• % lat_range [real(4)] :: 4 values that define the latitude range over which a diffusivity scaled by Kd_add is added [degLat].

• % rho_range [real(4)] :: 4 values that define the coordinate potential density range over which a diffusivity scaled by Kd_add is added [R ~> kg m-3].

• % use_abs_lat [logical] :: If true, use the absolute value of latitude when setting lat_range.

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

## Function/Subroutine Documentation¶

subroutine user_change_diffusivity/user_change_diff(h, tv, G, GV, US, CS, Kd_lay, Kd_int, T_f, S_f, Kd_int_add)

This subroutine provides an interface for a user to use to modify the main code to alter the diffusivities as needed. The specific example implemented here augments the diffusivity for a specified range of latitude and coordinate potential density.

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

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

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

• tv :: [in] A structure containing pointers to any available thermodynamic fields. Absent fields have NULL ptrs.

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

• cs :: This module’s control structure.

• kd_lay :: [inout] The diapycnal diffusivity of each layer [Z2 T-1 ~> m2 s-1].

• kd_int :: [inout] The diapycnal diffusivity at each interface [Z2 T-1 ~> m2 s-1].

• t_f :: [in] Temperature with massless layers filled in vertically [degC].

• s_f :: [in] Salinity with massless layers filled in vertically [ppt].

• kd_int_add :: The diapycnal diffusivity that is being added at each interface [Z2 T-1 ~> m2 s-1].

Call to
function user_change_diffusivity/range_ok(range) [logical]

This subroutine checks whether the 4 values of range are in ascending order.

Parameters

range :: [in] Four values to check.

Return

undefined :: Return value.

Called from
function user_change_diffusivity/val_weights(val, range) [real]

This subroutine returns a value that goes smoothly from 0 to 1, stays at 1, and then goes smoothly back to 0 at the four values of range. The transitions are cubic, and have zero first derivatives where the curves hit 0 and 1. The values in range must be in ascending order, as can be checked by calling range_OK.

Parameters
• val :: [in] Value for which we need an answer [arbitrary units].

• range :: [in] Range over which the answer is non-zero [arbitrary units].

Return

undefined :: Return value [nondim].

Called from

user_change_diff

subroutine user_change_diffusivity/user_change_diff_init(Time, G, GV, US, param_file, diag, CS)

Set up the module control structure.

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

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

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

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

Call to
subroutine user_change_diffusivity/user_change_diff_end(CS)

Clean up the module control structure.

Parameters

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

Called from

mom_set_diffusivity::set_diffusivity_end