namespace mom_open_boundary¶
Overview¶
Controls where open boundary conditions are applied. More…
namespace mom_open_boundary { // global variables integer, parameter, public obc_none = 0; integer, parameter, public obc_simple = 1; integer, parameter, public obc_wall = 2; integer, parameter, public obc_flather = 3; integer, parameter, public obc_radiation = 4; integer, parameter, public obc_direction_n = 100; integer, parameter, public obc_direction_s = 200; integer, parameter, public obc_direction_e = 300; integer, parameter, public obc_direction_w = 400; integer id_clock_pass; // global functions subroutine, public open_boundary_config(G G, US US, param_file param_file, OBC OBC); subroutine setup_segment_indices( G G, seg seg, Is_obc Is_obc, Ie_obc Ie_obc, Js_obc Js_obc, Je_obc Je_obc ); subroutine, public open_boundary_init(G G, param_file param_file, OBC OBC); logical function, public open_boundary_query( OBC OBC, apply_open_OBC apply_open_OBC, apply_specified_OBC apply_specified_OBC, apply_Flather_OBC apply_Flather_OBC, apply_nudged_OBC apply_nudged_OBC, needs_ext_seg_data needs_ext_seg_data ); subroutine, public open_boundary_end(OBC OBC); subroutine, public open_boundary_impose_normal_slope(OBC OBC, G G, depth depth); subroutine, public open_boundary_impose_land_mask(OBC OBC, G G, areaCu areaCu, areaCv areaCv, US US); subroutine, public radiation_open_bdry_conds( OBC OBC, u_new u_new, u_old u_old, v_new v_new, v_old v_old, G G, US US, dt dt ); subroutine, public open_boundary_apply_normal_flow(OBC OBC, G G, u u, v v); subroutine, public open_boundary_zero_normal_flow(OBC OBC, G G, u u, v v); subroutine, public set_tracer_data(OBC OBC, tv tv, h h, G G, PF PF, tracer_Reg tracer_Reg); subroutine, public open_boundary_test_extern_uv(G G, OBC OBC, u u, v v); subroutine, public open_boundary_test_extern_h(G G, OBC OBC, h h); subroutine, public update_obc_segment_data(G G, GV GV, US US, OBC OBC, tv tv, h h, Time Time); subroutine, public register_obc(name name, param_file param_file, Reg Reg); subroutine, public obc_registry_init(param_file param_file, Reg Reg); logical function, public register_file_obc(param_file param_file, CS CS, OBC_Reg OBC_Reg); subroutine, public file_obc_end(CS CS); subroutine, public segment_tracer_registry_init(param_file param_file, segment segment); subroutine, public register_segment_tracer( tr_ptr tr_ptr, param_file param_file, GV GV, segment segment, OBC_scalar OBC_scalar, OBC_array OBC_array ); subroutine, public segment_tracer_registry_end(Reg Reg); subroutine, public register_temp_salt_segments(GV GV, OBC OBC, tr_Reg tr_Reg, param_file param_file); subroutine, public fill_temp_salt_segments(G G, OBC OBC, tv tv); subroutine, public open_boundary_register_restarts(HI HI, GV GV, OBC_CS OBC_CS, restart_CSp restart_CSp); subroutine, public update_segment_tracer_reservoirs(G G, GV GV, uhr uhr, vhr vhr, h h, OBC OBC, dt dt, Reg Reg); } // namespace mom_open_boundary
Detailed Documentation¶
Controls where open boundary conditions are applied.
This module implements some aspects of internal open boundary conditions in MOM.
A small fragment of the grid is shown below:
j+1 x ^ x ^ x At x: q, CoriolisBu j+1 > o > o > At ^: v, tauy j x ^ x ^ x At >: u, taux j > o > o > At o: h, bathyT, buoy, tr, T, S, Rml, ustar j-1 x ^ x ^ x i-1 i i+1 At x & ^: i i+1 At > & o:
The boundaries always run through q grid points (x).
Global Variables¶
integer, parameter, public obc_none = 0
Indicates the use of no open boundary.
integer, parameter, public obc_simple = 1
Indicates the use of a simple inflow open boundary.
integer, parameter, public obc_wall = 2
Indicates the use of a closed sall.
integer, parameter, public obc_flather = 3
Indicates the use of a Flather open boundary.
integer, parameter, public obc_radiation = 4
Indicates the use of a radiation open boundary.
integer, parameter, public obc_direction_n = 100
Indicates the boundary is an effective northern boundary.
integer, parameter, public obc_direction_s = 200
Indicates the boundary is an effective southern boundary.
integer, parameter, public obc_direction_e = 300
Indicates the boundary is an effective eastern boundary.
integer, parameter, public obc_direction_w = 400
Indicates the boundary is an effective western boundary.
integer id_clock_pass
A CPU time clock.
Global Functions¶
subroutine, public open_boundary_config( G G, US US, param_file param_file, OBC OBC )
Enables OBC module and reads configuration parameters This routine is called from MOM_initialize_fixed which occurs before the initialization of the vertical coordinate and ALE_init. Therefore segment data are not fully initialized here. The remainder of the segment data are initialized in a later call to update_open_boundary_data.
Parameters:
g |
Ocean grid structure |
us |
A dimensional unit scaling type |
param_file |
Parameter file handle |
obc |
Open boundary control structure |
subroutine setup_segment_indices( G G, seg seg, Is_obc Is_obc, Ie_obc Ie_obc, Js_obc Js_obc, Je_obc Je_obc )
Define indices for segment and store in hor_index_type using global segment bounds corresponding to q-points.
Parameters:
g |
grid type |
seg |
Open boundary segment |
is_obc |
Q-point global i-index of start of segment |
ie_obc |
Q-point global i-index of end of segment |
js_obc |
Q-point global j-index of start of segment |
je_obc |
Q-point global j-index of end of segment |
subroutine, public open_boundary_init(G G, param_file param_file, OBC OBC)
Initialize open boundary control structure.
Parameters:
g |
Ocean grid structure |
param_file |
Parameter file handle |
obc |
Open boundary control structure |
logical function, public open_boundary_query( OBC OBC, apply_open_OBC apply_open_OBC, apply_specified_OBC apply_specified_OBC, apply_Flather_OBC apply_Flather_OBC, apply_nudged_OBC apply_nudged_OBC, needs_ext_seg_data needs_ext_seg_data )
Parameters:
obc |
Open boundary control structure |
apply_open_obc |
Returns True if open_*_BCs_exist_globally is true |
apply_specified_obc |
Returns True if specified_*_BCs_exist_globally is true |
apply_flather_obc |
Returns True if Flather_*_BCs_exist_globally is true |
apply_nudged_obc |
Returns True if nudged_*_BCs_exist_globally is true |
needs_ext_seg_data |
Returns True if external segment data needed |
subroutine, public open_boundary_end(OBC OBC)
Close open boundary data.
Parameters:
obc |
Open boundary control structure |
subroutine, public open_boundary_impose_normal_slope(OBC OBC, G G, depth depth)
Sets the slope of bathymetry normal to an open bounndary to zero.
Parameters:
obc |
Open boundary control structure |
g |
Ocean grid structure |
depth |
Bathymetry at h-points |
subroutine, public open_boundary_impose_land_mask( OBC OBC, G G, areaCu areaCu, areaCv areaCv, US US )
Reconcile masks and open boundaries, deallocate OBC on PEs where it is not needed. Also adjust u- and v-point cell area on specified open boundaries and mask all points outside open boundaries.
Parameters:
obc |
Open boundary control structure |
g |
Ocean grid structure |
us |
A dimensional unit scaling type |
areacu |
Area of a u-cell [L2 ~> m2] |
areacv |
Area of a u-cell [L2 ~> m2] |
subroutine, public radiation_open_bdry_conds( OBC OBC, u_new u_new, u_old u_old, v_new v_new, v_old v_old, G G, US US, dt dt )
Apply radiation conditions to 3D u,v at open boundaries.
Parameters:
g |
Ocean grid structure |
obc |
Open boundary control structure |
u_new |
On exit, new u values on open boundaries On entry, the old time-level v but including barotropic accelerations [L T-1 ~> m s-1]. |
u_old |
Original unadjusted u [L T-1 ~> m s-1] |
v_new |
On exit, new v values on open boundaries. On entry, the old time-level v but including barotropic accelerations [L T-1 ~> m s-1]. |
v_old |
Original unadjusted v [L T-1 ~> m s-1] |
us |
A dimensional unit scaling type |
dt |
Appropriate timestep [s] |
subroutine, public open_boundary_apply_normal_flow(OBC OBC, G G, u u, v v)
Applies OBC values stored in segments to 3d u,v fields.
Parameters:
obc |
Open boundary control structure |
g |
Ocean grid structure |
u |
u field to update on open boundaries [L T-1 ~> m s-1] |
v |
v field to update on open boundaries [L T-1 ~> m s-1] |
subroutine, public open_boundary_zero_normal_flow(OBC OBC, G G, u u, v v)
Applies zero values to 3d u,v fields on OBC segments.
Parameters:
obc |
Open boundary control structure |
g |
Ocean grid structure |
u |
u field to update on open boundaries |
v |
v field to update on open boundaries |
subroutine, public set_tracer_data( OBC OBC, tv tv, h h, G G, PF PF, tracer_Reg tracer_Reg )
Sets the initial values of the tracer open boundary conditions. Redoing this elsewhere.
Parameters:
g |
Ocean grid structure |
obc |
Open boundary structure |
tv |
Thermodynamics structure |
h |
Thickness |
pf |
Parameter file handle |
tracer_reg |
Tracer registry |
subroutine, public open_boundary_test_extern_uv(G G, OBC OBC, u u, v v)
Set tangential velocities outside of open boundaries to silly values (used for checking the interior state is independent of values outside of the domain).
Parameters:
g |
Ocean grid structure |
obc |
Open boundary structure |
u |
Zonal velocity [m s-1] |
v |
Meridional velocity [m s-1] |
subroutine, public open_boundary_test_extern_h(G G, OBC OBC, h h)
Set thicknesses outside of open boundaries to silly values (used for checking the interior state is independent of values outside of the domain).
Parameters:
g |
Ocean grid structure |
obc |
Open boundary structure |
h |
Layer thickness [H ~> m or kg m-2] |
subroutine, public update_obc_segment_data( G G, GV GV, US US, OBC OBC, tv tv, h h, Time Time )
Update the OBC values on the segments.
Parameters:
g |
Ocean grid structure |
gv |
Ocean vertical grid structure |
us |
A dimensional unit scaling type |
obc |
Open boundary structure |
tv |
Thermodynamics structure |
h |
Thickness [m] |
time |
Model time |
subroutine, public register_obc(name name, param_file param_file, Reg Reg)
register open boundary objects for boundary updates.
Parameters:
name |
OBC name used for error messages |
param_file |
file to parse for model parameter values |
reg |
pointer to the tracer registry |
subroutine, public obc_registry_init(param_file param_file, Reg Reg)
This routine include declares and sets the variable “version”.
Parameters:
param_file |
open file to parse for model parameters |
reg |
pointer to OBC registry |
logical function, public register_file_obc( param_file param_file, CS CS, OBC_Reg OBC_Reg )
Add file to OBC registry.
Parameters:
param_file |
parameter file. |
cs |
file control structure. |
obc_reg |
OBC registry. |
subroutine, public file_obc_end(CS CS)
Clean up the file OBC from registry.
Parameters:
cs |
OBC file control structure. |
subroutine, public segment_tracer_registry_init( param_file param_file, segment segment )
Initialize the segment tracer registry.
Parameters:
param_file |
open file to parse for model parameters |
segment |
the segment |
subroutine, public register_segment_tracer( tr_ptr tr_ptr, param_file param_file, GV GV, segment segment, OBC_scalar OBC_scalar, OBC_array OBC_array )
Parameters:
gv |
ocean vertical grid structure |
tr_ptr |
A target that can be used to set a pointer to the stored value of tr. This target must be an enduring part of the control structure, because the tracer registry will use this memory, but it also means that any updates to this structure in the calling module will be available subsequently to the tracer registry. |
param_file |
file to parse for model parameter values |
segment |
current segment data structure |
obc_scalar |
If present, use scalar value for segment tracer inflow concentration. |
obc_array |
If true, use array values for segment tracer inflow concentration. |
subroutine, public segment_tracer_registry_end(Reg Reg)
Clean up the segment tracer registry.
Parameters:
reg |
pointer to tracer registry |
subroutine, public register_temp_salt_segments( GV GV, OBC OBC, tr_Reg tr_Reg, param_file param_file )
Parameters:
gv |
ocean vertical grid structure |
obc |
Open boundary structure |
tr_reg |
Tracer registry |
param_file |
file to parse for model parameter values |
subroutine, public fill_temp_salt_segments(G G, OBC OBC, tv tv)
Parameters:
g |
Ocean grid structure |
obc |
Open boundary structure |
tv |
Thermodynamics structure |
subroutine, public open_boundary_register_restarts( HI HI, GV GV, OBC_CS OBC_CS, restart_CSp restart_CSp )
Register OBC segment data for restarts.
Parameters:
hi |
Horizontal indices |
gv |
Container for vertical grid information |
obc_cs |
OBC data structure, data intent(inout) |
restart_csp |
Restart structure, data intent(inout) |
subroutine, public update_segment_tracer_reservoirs( G G, GV GV, uhr uhr, vhr vhr, h h, OBC OBC, dt dt, Reg Reg )
Update the OBC tracer reservoirs after the tracers have been updated.
Parameters:
g |
The ocean’s grid structure |
gv |
Ocean vertical grid structure |
uhr |
accumulated volume/mass flux through the zonal face [H L2 ~> m3 or kg] |
vhr |
accumulated volume/mass flux through the meridional face [H L2 ~> m3 or kg] |
h |
layer thickness after advection [H ~> m or kg m-2] |
obc |
Open boundary structure |
dt |
time increment [s] |
reg |
pointer to tracer registry |