user_change_diffusivity module reference

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

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. The specific example implemented here augments the diffusivity for a specified range of latitude and coordinate potential density.

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

user_change_diff_init

Set up the module control structure.

user_change_diff_end

Clean up the module control structure.

Type Documentation

type, public :: user_change_diff_CS

Control structure for user_change_diffusivity

Parameters
  • initialized

    True if this control structure has been initialized.

  • Kd_add

    The scale of a diffusivity that is added everywhere without any filtering or scaling [H Z T-1 ~> m2 s-1 or kg m-1 s-1]

  • lat_range

    4 values that define the latitude range over which a diffusivity scaled by Kd_add is added [degrees_N].

  • rho_range

    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

    If true, use the absolute value of latitude when setting lat_range.

  • diag

    A structure that is used to regulate the timing of diagnostic output.

Functions/Subroutine Documentation

subroutine 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 [H Z T-1 ~> m2 s-1 or kg m-1 s-1]

  • Kd_int [inout]

    The diapycnal diffusivity at each interface [H Z T-1 ~> m2 s-1 or kg m-1 s-1]

  • T_f [in]

    Temperature with massless layers filled in vertically [C ~> degC].

  • S_f [in]

    Salinity with massless layers filled in vertically [S ~> ppt].

  • Kd_int_add

    The diapycnal diffusivity that is being added at each interface [H Z T-1 ~> m2 s-1 or kg m-1 s-1]

Callees call graph
Callees of user_change_diffusivity::user_change_diff calls cluster_mom_eos MOM_EOS cluster_mom_error_handler MOM_error_handler cluster_user_change_diffusivity user_change_diffusivity mom_eos::eos_domain EOS_domain mom_eos::interface::calculate_density calculate_density (interface) mom_error_handler::mom_error MOM_error user_change_diffusivity::range_ok range_OK [private/internal] user_change_diffusivity::user_change_diff user_change_diff user_change_diffusivity::user_change_diff->mom_eos::eos_domain user_change_diffusivity::user_change_diff->mom_eos::interface::calculate_density user_change_diffusivity::user_change_diff->mom_error_handler::mom_error user_change_diffusivity::user_change_diff->user_change_diffusivity::range_ok user_change_diffusivity::val_weights val_weights [private/internal] user_change_diffusivity::user_change_diff->user_change_diffusivity::val_weights
Text view
Callers call graph
Callers of user_change_diffusivity::user_change_diff calls cluster_mom_set_diffusivity MOM_set_diffusivity cluster_user_change_diffusivity user_change_diffusivity mom_set_diffusivity::set_diffusivity set_diffusivity user_change_diffusivity::user_change_diff user_change_diff mom_set_diffusivity::set_diffusivity->user_change_diffusivity::user_change_diff
Text view
function range_OK(range) result(OK)

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

Parameters
  • range [in]

    Four values to check [arbitrary]

  • OK

    Return value.

Callers call graph
Callers of user_change_diffusivity::range_ok calls cluster_user_change_diffusivity user_change_diffusivity user_change_diffusivity::range_ok range_OK [private/internal] user_change_diffusivity::user_change_diff user_change_diff user_change_diffusivity::user_change_diff->user_change_diffusivity::range_ok user_change_diffusivity::user_change_diff_init user_change_diff_init user_change_diffusivity::user_change_diff_init->user_change_diffusivity::range_ok
Text view
function val_weights(val, range) result(ans)

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].

  • ans

    Return value [nondim].

Callers call graph
Callers of user_change_diffusivity::val_weights calls cluster_user_change_diffusivity user_change_diffusivity user_change_diffusivity::user_change_diff user_change_diff user_change_diffusivity::val_weights val_weights [private/internal] user_change_diffusivity::user_change_diff->user_change_diffusivity::val_weights
Text view
subroutine 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.

Callees call graph
Callees of user_change_diffusivity::user_change_diff_init calls cluster_mom_error_handler MOM_error_handler cluster_mom_file_parser MOM_file_parser cluster_user_change_diffusivity user_change_diffusivity mom_error_handler::mom_error MOM_error mom_file_parser::interface::get_param get_param (interface) mom_file_parser::interface::log_version log_version (interface) user_change_diffusivity::range_ok range_OK [private/internal] user_change_diffusivity::user_change_diff_init user_change_diff_init user_change_diffusivity::user_change_diff_init->mom_error_handler::mom_error user_change_diffusivity::user_change_diff_init->mom_file_parser::interface::get_param user_change_diffusivity::user_change_diff_init->mom_file_parser::interface::log_version user_change_diffusivity::user_change_diff_init->user_change_diffusivity::range_ok
Text view
Callers call graph
Callers of user_change_diffusivity::user_change_diff_init calls cluster_mom_set_diffusivity MOM_set_diffusivity cluster_user_change_diffusivity user_change_diffusivity mom_set_diffusivity::set_diffusivity_init set_diffusivity_init user_change_diffusivity::user_change_diff_init user_change_diff_init mom_set_diffusivity::set_diffusivity_init->user_change_diffusivity::user_change_diff_init
Text view
subroutine 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.

Callers call graph
Callers of user_change_diffusivity::user_change_diff_end calls cluster_mom_set_diffusivity MOM_set_diffusivity cluster_user_change_diffusivity user_change_diffusivity mom_set_diffusivity::set_diffusivity_end set_diffusivity_end user_change_diffusivity::user_change_diff_end user_change_diff_end mom_set_diffusivity::set_diffusivity_end->user_change_diffusivity::user_change_diff_end
Text view
API generated with Flint · Rendered from reStructuredText