namespace user_initialization

Overview

A template of a user to code up customized initial conditions. More…

namespace user_initialization {

// global functions

subroutine, public user_set_coord(
    Rlay Rlay,
    g_prime g_prime,
    GV GV,
    param_file param_file,
    eqn_of_state eqn_of_state
    );

subroutine, public user_initialize_topography(D D, G G, param_file param_file, max_depth max_depth, US US);

subroutine, public user_initialize_thickness(
    h h,
    G G,
    GV GV,
    param_file param_file,
    just_read_params just_read_params
    );

subroutine, public user_initialize_velocity(
    u u,
    v v,
    G G,
    US US,
    param_file param_file,
    just_read_params just_read_params
    );

subroutine, public user_init_temperature_salinity(
    T T,
    S S,
    G G,
    param_file param_file,
    eqn_of_state eqn_of_state,
    just_read_params just_read_params
    );

subroutine, public user_initialize_sponges(
    G G,
    GV GV,
    use_temp use_temp,
    tv tv,
    param_file param_file,
    CSp CSp,
    h h
    );

subroutine, public user_set_obc_data(OBC OBC, tv tv, G G, param_file param_file, tr_Reg tr_Reg);
subroutine, public user_set_rotation(G G, param_file param_file);

} // namespace user_initialization

Detailed Documentation

A template of a user to code up customized initial conditions.

This subroutine initializes the fields for the simulations. The one argument passed to initialize, Time, is set to the current time of the simulation. The fields which are initialized here are:

  • u - Zonal velocity [m s-1].

  • v - Meridional velocity [m s-1].

  • h - Layer thickness [H ~> m or kg m-2]. (Must be positive.)

  • GbathyT - Basin depth [Z ~> m]. (Must be positive.)

  • GCoriolisBu - The Coriolis parameter [T-1 ~> s-1].

  • GVg_prime - The reduced gravity at each interface [L2 Z-1 T-2 ~> m s-2].

  • GVRlay - Layer potential density (coordinate variable) [kg m-3]. If ENABLE_THERMODYNAMICS is defined:

  • T - Temperature [degC].

  • S - Salinity [psu]. If BULKMIXEDLAYER is defined:

  • Rml - Mixed layer and buffer layer potential densities [kg m-3]. If SPONGE is defined:

  • A series of subroutine calls are made to set up the damping rates and reference profiles for all variables that are damped in the sponge.

Any user provided tracer code is also first linked through this subroutine.

These variables are all set in the set of subroutines (in this file) USER_initialize_bottom_depth, USER_initialize_thickness, USER_initialize_velocity, USER_initialize_temperature_salinity, USER_initialize_mixed_layer_density, USER_initialize_sponges, USER_set_coord, and USER_set_ref_profile.

The names of these subroutines should be self-explanatory. They start with “USER_” to indicate that they will likely have to be modified for each simulation to set the initial conditions and boundary conditions. Most of these take two arguments: an integer argument specifying whether the fields are to be calculated internally or read from a NetCDF file; and a string giving the path to that file. If the field is initialized internally, the path is ignored.

Global Functions

subroutine, public user_set_coord(
    Rlay Rlay,
    g_prime g_prime,
    GV GV,
    param_file param_file,
    eqn_of_state eqn_of_state
    )

Set vertical coordinates.

Parameters:

gv

The ocean’s vertical grid structure.

rlay

Layer potential density.

g_prime

The reduced gravity at each interface [L2 Z-1 T-2 ~> m s-2].

param_file

A structure indicating the open file to parse for model parameter values.

eqn_of_state

Integer that selects the equation of state.

subroutine, public user_initialize_topography(
    D D,
    G G,
    param_file param_file,
    max_depth max_depth,
    US US
    )

Initialize topography.

Parameters:

g

The dynamic horizontal grid type

d

Ocean bottom depth in m or Z if US is present

param_file

Parameter file structure

max_depth

Maximum model depth in the units of D

us

A dimensional unit scaling type

subroutine, public user_initialize_thickness(
    h h,
    G G,
    GV GV,
    param_file param_file,
    just_read_params just_read_params
    )

initialize thicknesses.

Parameters:

g

The ocean’s grid structure.

gv

The ocean’s vertical grid structure.

h

The thicknesses being initialized [H ~> m or kg m-2].

param_file

A structure indicating the open file to parse for model parameter values.

just_read_params

If present and true, this call will only read parameters without changing h.

subroutine, public user_initialize_velocity(
    u u,
    v v,
    G G,
    US US,
    param_file param_file,
    just_read_params just_read_params
    )

initialize velocities.

Parameters:

g

Ocean grid structure.

u

i-component of velocity [L T-1 ~> m s-1]

v

j-component of velocity [L T-1 ~> m s-1]

us

A dimensional unit scaling type

param_file

A structure indicating the open file to parse for model parameter values.

just_read_params

If present and true, this call will only read parameters without changing h.

subroutine, public user_init_temperature_salinity(
    T T,
    S S,
    G G,
    param_file param_file,
    eqn_of_state eqn_of_state,
    just_read_params just_read_params
    )

This function puts the initial layer temperatures and salinities into T(:,:,:) and S(:,:,:).

Parameters:

g

Ocean grid structure.

t

Potential temperature [degC].

s

Salinity [ppt].

param_file

A structure indicating the open file to parse for model parameter values.

eqn_of_state

Integer that selects the equation of state.

just_read_params

If present and true, this call will only read parameters without changing T & S.

subroutine, public user_initialize_sponges(
    G G,
    GV GV,
    use_temp use_temp,
    tv tv,
    param_file param_file,
    CSp CSp,
    h h
    )

Set up the sponges.

Parameters:

g

Ocean grid structure.

gv

The ocean’s vertical grid structure.

use_temp

If true, temperature and salinity are state variables.

tv

A structure containing pointers to any available thermodynamic fields, potential temperature and salinity or mixed layer density. Absent fields have NULL ptrs.

param_file

A structure indicating the open file to parse for model parameter values.

csp

A pointer to the sponge control structure.

h

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

subroutine, public user_set_obc_data(
    OBC OBC,
    tv tv,
    G G,
    param_file param_file,
    tr_Reg tr_Reg
    )

This subroutine sets the properties of flow at open boundary conditions.

Parameters:

obc

This open boundary condition type specifies whether, where, and what open boundary conditions are used.

tv

A structure containing pointers to any available thermodynamic fields, including potential temperature and salinity or mixed layer density. Absent fields have NULL ptrs.

g

The ocean’s grid structure.

param_file

A structure indicating the open file to parse for model parameter values.

tr_reg

Tracer registry.

subroutine, public user_set_rotation(G G, param_file param_file)

Parameters:

g

The ocean’s grid structure

param_file

A structure to parse for run-time parameters