namespace mom_shared_initialization

Overview

Code that initializes fixed aspects of the model grid, such as horizontal grid metrics, topography and Coriolis, and can be shared between components. More…

namespace mom_shared_initialization {

// global functions

subroutine, public mom_shared_init_init(PF PF);
subroutine, public mom_initialize_rotation(f f, G G, PF PF, US US);
subroutine, public mom_calculate_grad_coriolis(dF_dx dF_dx, dF_dy dF_dy, G G, US US);
real function, public diagnosemaximumdepth(D D, G G);
subroutine, public initialize_topography_from_file(D D, G G, param_file param_file, US US);
subroutine, public apply_topography_edits_from_file(D D, G G, param_file param_file, US US);

subroutine, public initialize_topography_named(
    D D,
    G G,
    param_file param_file,
    topog_config topog_config,
    max_depth max_depth,
    US US
    );

subroutine, public limit_topography(D D, G G, param_file param_file, max_depth max_depth, US US);
subroutine, public set_rotation_planetary(f f, G G, param_file param_file, US US);
subroutine, public set_rotation_beta_plane(f f, G G, param_file param_file, US US);
subroutine, public initialize_grid_rotation_angle(G G, PF PF);
subroutine, public reset_face_lengths_named(G G, param_file param_file, name name, US US);
subroutine, public reset_face_lengths_file(G G, param_file param_file, US US);
subroutine, public reset_face_lengths_list(G G, param_file param_file, US US);

subroutine, public read_face_length_list(
    iounit iounit,
    filename filename,
    num_lines num_lines,
    lines lines
    );

subroutine, public set_velocity_depth_max(G G);
subroutine, public set_velocity_depth_min(G G);
subroutine, public compute_global_grid_integrals(G G);

subroutine, public write_ocean_geometry_file(
    G G,
    param_file param_file,
    directory directory,
    geom_file geom_file,
    US US
    );

} // namespace mom_shared_initialization

Detailed Documentation

Code that initializes fixed aspects of the model grid, such as horizontal grid metrics, topography and Coriolis, and can be shared between components.

Global Functions

subroutine, public mom_shared_init_init(PF PF)

MOM_shared_init_init just writes the code version.

Parameters:

pf

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

subroutine, public mom_initialize_rotation(f f, G G, PF PF, US US)

MOM_initialize_rotation makes the appropriate call to set up the Coriolis parameter.

Parameters:

g

The dynamic horizontal grid type

f

The Coriolis parameter [T-1 ~> s-1]

pf

Parameter file structure

us

A dimensional unit scaling type

subroutine, public mom_calculate_grad_coriolis(
    dF_dx dF_dx,
    dF_dy dF_dy,
    G G,
    US US
    )

Calculates the components of grad f (Coriolis parameter)

Parameters:

g

The dynamic horizontal grid type

df_dx

x-component of grad f [T-1 L-1 ~> s-1 m-1]

df_dy

y-component of grad f [T-1 L-1 ~> s-1 m-1]

us

A dimensional unit scaling type

real function, public diagnosemaximumdepth(D D, G G)

Return the global maximum ocean bottom depth in the same units as the input depth.

Parameters:

g

The dynamic horizontal grid type

d

Ocean bottom depth in m or Z

Returns:

The global maximum ocean bottom depth in m or Z

subroutine, public initialize_topography_from_file(
    D D,
    G G,
    param_file param_file,
    US US
    )

Read gridded depths from file.

Parameters:

g

The dynamic horizontal grid type

d

Ocean bottom depth in m or Z if US is present

param_file

Parameter file structure

us

A dimensional unit scaling type

subroutine, public apply_topography_edits_from_file(
    D D,
    G G,
    param_file param_file,
    US US
    )

Applies a list of topography overrides read from a netcdf file.

Parameters:

g

The dynamic horizontal grid type

d

Ocean bottom depth in m or Z if US is present

param_file

Parameter file structure

us

A dimensional unit scaling type

subroutine, public initialize_topography_named(
    D D,
    G G,
    param_file param_file,
    topog_config topog_config,
    max_depth max_depth,
    US US
    )

initialize the bathymetry based on one of several named idealized configurations

Parameters:

g

The dynamic horizontal grid type

d

Ocean bottom depth in m or Z if US is present

param_file

Parameter file structure

topog_config

The name of an idealized topographic configuration

max_depth

Maximum depth of model in the units of D

us

A dimensional unit scaling type

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

limit_topography ensures that min_depth < D(x,y) < max_depth

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 depth of model in the units of D

us

A dimensional unit scaling type

subroutine, public set_rotation_planetary(
    f f,
    G G,
    param_file param_file,
    US US
    )

This subroutine sets up the Coriolis parameter for a sphere.

Parameters:

g

The dynamic horizontal grid

f

Coriolis parameter (vertical component) [T-1 ~> s-1]

param_file

A structure to parse for run-time parameters

us

A dimensional unit scaling type

subroutine, public set_rotation_beta_plane(
    f f,
    G G,
    param_file param_file,
    US US
    )

This subroutine sets up the Coriolis parameter for a beta-plane or f-plane.

Parameters:

g

The dynamic horizontal grid

f

Coriolis parameter (vertical component) [T-1 ~> s-1]

param_file

A structure to parse for run-time parameters

us

A dimensional unit scaling type

subroutine, public initialize_grid_rotation_angle(G G, PF PF)

initialize_grid_rotation_angle initializes the arrays with the sine and cosine of the angle between logical north on the grid and true north.

Parameters:

g

The dynamic horizontal grid

pf

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

subroutine, public reset_face_lengths_named(
    G G,
    param_file param_file,
    name name,
    US US
    )

This subroutine sets the open face lengths at selected points to restrict passages to their observed widths based on a named set of sizes.

Parameters:

g

The dynamic horizontal grid

param_file

A structure to parse for run-time parameters

name

The name for the set of face lengths. Only “global_1deg” is currently implemented.

us

A dimensional unit scaling type

subroutine, public reset_face_lengths_file(G G, param_file param_file, US US)

This subroutine sets the open face lengths at selected points to restrict passages to their observed widths from a arrays read from a file.

Parameters:

g

The dynamic horizontal grid

param_file

A structure to parse for run-time parameters

us

A dimensional unit scaling type

subroutine, public reset_face_lengths_list(G G, param_file param_file, US US)

This subroutine sets the open face lengths at selected points to restrict passages to their observed widths from a list read from a file.

Parameters:

g

The dynamic horizontal grid

param_file

A structure to parse for run-time parameters

us

A dimensional unit scaling type

subroutine, public read_face_length_list(
    iounit iounit,
    filename filename,
    num_lines num_lines,
    lines lines
    )

This subroutine reads and counts the non-blank lines in the face length list file, after removing comments.

Parameters:

iounit

An open I/O unit number for the file

filename

The name of the face-length file to read

num_lines

The number of non-blank lines in the file

lines

The non-blank lines, after removing comments

subroutine, public set_velocity_depth_max(G G)

Set the bathymetry at velocity points to be the maximum of the depths at the neighoring tracer points.

Parameters:

g

The dynamic horizontal grid

subroutine, public set_velocity_depth_min(G G)

Set the bathymetry at velocity points to be the minimum of the depths at the neighoring tracer points.

Parameters:

g

The dynamic horizontal grid

subroutine, public compute_global_grid_integrals(G G)

Pre-compute global integrals of grid quantities (like masked ocean area) for later use in reporting diagnostics.

Parameters:

g

The dynamic horizontal grid

subroutine, public write_ocean_geometry_file(
    G G,
    param_file param_file,
    directory directory,
    geom_file geom_file,
    US US
    )

Write out a file describing the topography, Coriolis parameter, grid locations and various other fixed fields from the grid.

Parameters:

g

The dynamic horizontal grid

param_file

Parameter file structure

directory

The directory into which to place the geometry file.

geom_file

If present, the name of the geometry file (otherwise the file is “ocean_geometry”)

us

A dimensional unit scaling type