MOM6
mom_boundary_update Module Reference

Detailed Description

Controls where open boundary conditions are applied.

This module updates the open boundary arrays when time-varying. It caused a circular dependency with the tidal_bay setup when MOM_open_boundary.

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

Data Types

type  update_obc_cs
 The control structure for the MOM_boundary_update module. More...
 
integer id_clock_pass
 A CPU time clock ID. More...
 
subroutine, public call_obc_register (param_file, CS, OBC)
 The following subroutines and associated definitions provide the machinery to register and call the subroutines that initialize open boundary conditions. More...
 
subroutine, public update_obc_data (OBC, G, GV, US, tv, h, CS, Time)
 Calls appropriate routine to update the open boundary conditions. More...
 
subroutine, public obc_register_end (CS)
 Clean up the OBC registry. More...
 

Function/Subroutine Documentation

◆ call_obc_register()

subroutine, public mom_boundary_update::call_obc_register ( type(param_file_type), intent(in)  param_file,
type(update_obc_cs), pointer  CS,
type(ocean_obc_type), pointer  OBC 
)

The following subroutines and associated definitions provide the machinery to register and call the subroutines that initialize open boundary conditions.

Parameters
[in]param_fileParameter file to parse
csControl structure for OBCs
obcOpen boundary structure

Definition at line 62 of file MOM_boundary_update.F90.

62  type(param_file_type), intent(in) :: param_file !< Parameter file to parse
63  type(update_OBC_CS), pointer :: CS !< Control structure for OBCs
64  type(ocean_OBC_type), pointer :: OBC !< Open boundary structure
65 
66  ! Local variables
67  character(len=40) :: mdl = "MOM_boundary_update" ! This module's name.
68  ! This include declares and sets the variable "version".
69 # include "version_variable.h"
70  if (associated(cs)) then
71  call mom_error(warning, "call_OBC_register called with an associated "// &
72  "control structure.")
73  return
74  else ; allocate(cs) ; endif
75 
76  call log_version(param_file, mdl, version, "")
77 
78  call get_param(param_file, mdl, "USE_FILE_OBC", cs%use_files, &
79  "If true, use external files for the open boundary.", &
80  default=.false.)
81  call get_param(param_file, mdl, "USE_TIDAL_BAY_OBC", cs%use_tidal_bay, &
82  "If true, use the tidal_bay open boundary.", &
83  default=.false.)
84  call get_param(param_file, mdl, "USE_KELVIN_WAVE_OBC", cs%use_Kelvin, &
85  "If true, use the Kelvin wave open boundary.", &
86  default=.false.)
87  call get_param(param_file, mdl, "USE_SHELFWAVE_OBC", cs%use_shelfwave, &
88  "If true, use the shelfwave open boundary.", &
89  default=.false.)
90  call get_param(param_file, mdl, "USE_DYED_CHANNEL_OBC", cs%use_dyed_channel, &
91  "If true, use the dyed channel open boundary.", &
92  default=.false.)
93 
94  if (cs%use_files) cs%use_files = &
95  register_file_obc(param_file, cs%file_OBC_CSp, &
96  obc%OBC_Reg)
97  if (cs%use_tidal_bay) cs%use_tidal_bay = &
98  register_tidal_bay_obc(param_file, cs%tidal_bay_OBC_CSp, &
99  obc%OBC_Reg)
100  if (cs%use_Kelvin) cs%use_Kelvin = &
101  register_kelvin_obc(param_file, cs%Kelvin_OBC_CSp, &
102  obc%OBC_Reg)
103  if (cs%use_shelfwave) cs%use_shelfwave = &
104  register_shelfwave_obc(param_file, cs%shelfwave_OBC_CSp, &
105  obc%OBC_Reg)
106  if (cs%use_dyed_channel) cs%use_dyed_channel = &
107  register_dyed_channel_obc(param_file, cs%dyed_channel_OBC_CSp, &
108  obc%OBC_Reg)
109 

References mom_error_handler::mom_error(), and mom_open_boundary::register_file_obc().

Referenced by mom::initialize_mom().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ obc_register_end()

subroutine, public mom_boundary_update::obc_register_end ( type(update_obc_cs), pointer  CS)

Clean up the OBC registry.

Parameters
csControl structure for OBCs

Definition at line 155 of file MOM_boundary_update.F90.

155  type(update_OBC_CS), pointer :: CS !< Control structure for OBCs
156 
157  if (cs%use_files) call file_obc_end(cs%file_OBC_CSp)
158  if (cs%use_tidal_bay) call tidal_bay_obc_end(cs%tidal_bay_OBC_CSp)
159  if (cs%use_Kelvin) call kelvin_obc_end(cs%Kelvin_OBC_CSp)
160 
161  if (associated(cs)) deallocate(cs)

References mom_open_boundary::file_obc_end(), kelvin_initialization::kelvin_obc_end(), and tidal_bay_initialization::tidal_bay_obc_end().

Referenced by mom::mom_end().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_obc_data()

subroutine, public mom_boundary_update::update_obc_data ( type(ocean_obc_type), pointer  OBC,
type(ocean_grid_type), intent(in)  G,
type(verticalgrid_type), intent(in)  GV,
type(unit_scale_type), intent(in)  US,
type(thermo_var_ptrs), intent(in)  tv,
real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(inout)  h,
type(update_obc_cs), pointer  CS,
type(time_type), intent(in)  Time 
)

Calls appropriate routine to update the open boundary conditions.

Parameters
[in]gOcean grid structure
[in]gvOcean vertical grid structure
[in]usA dimensional unit scaling type
[in]tvThermodynamics structure
[in,out]hlayer thicknesses [H ~> m or kg m-2]
obcOpen boundary structure
csControl structure for OBCs
[in]timeModel time

Definition at line 114 of file MOM_boundary_update.F90.

114  type(ocean_grid_type), intent(in) :: G !< Ocean grid structure
115  type(verticalGrid_type), intent(in) :: GV !< Ocean vertical grid structure
116  type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
117  type(thermo_var_ptrs), intent(in) :: tv !< Thermodynamics structure
118  real, dimension(SZI_(G),SZJ_(G),SZK_(G)), intent(inout) :: h !< layer thicknesses [H ~> m or kg m-2]
119  type(ocean_OBC_type), pointer :: OBC !< Open boundary structure
120  type(update_OBC_CS), pointer :: CS !< Control structure for OBCs
121  type(time_type), intent(in) :: Time !< Model time
122 
123  ! Local variables
124  logical :: read_OBC_eta = .false.
125  logical :: read_OBC_uv = .false.
126  logical :: read_OBC_TS = .false.
127  integer :: i, j, k, itt, is, ie, js, je, isd, ied, jsd, jed, nz
128  integer :: isd_off, jsd_off
129  integer :: IsdB, IedB, JsdB, JedB
130  character(len=40) :: mdl = "update_OBC_data" ! This subroutine's name.
131  character(len=200) :: filename, OBC_file, inputdir ! Strings for file/path
132 
133  is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
134  isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
135  isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
136 
137 ! Something here... with CS%file_OBC_CSp?
138 ! if (CS%use_files) &
139 ! call update_OBC_segment_data(G, GV, OBC, tv, h, Time)
140  if (cs%use_tidal_bay) &
141  call tidal_bay_set_obc_data(obc, cs%tidal_bay_OBC_CSp, g, h, time)
142  if (cs%use_Kelvin) &
143  call kelvin_set_obc_data(obc, cs%Kelvin_OBC_CSp, g, gv, us, h, time)
144  if (cs%use_shelfwave) &
145  call shelfwave_set_obc_data(obc, cs%shelfwave_OBC_CSp, g, h, time)
146  if (cs%use_dyed_channel) &
147  call dyed_channel_update_flow(obc, cs%dyed_channel_OBC_CSp, g, time)
148  if (obc%needs_IO_for_data) &
149  call update_obc_segment_data(g, gv, us, obc, tv, h, time)
150 

Referenced by mom_dynamics_split_rk2::step_mom_dyn_split_rk2(), mom_dynamics_unsplit::step_mom_dyn_unsplit(), and mom_dynamics_unsplit_rk2::step_mom_dyn_unsplit_rk2().

Here is the caller graph for this function:

Variable Documentation

◆ id_clock_pass

integer mom_boundary_update::id_clock_pass

A CPU time clock ID.

Definition at line 52 of file MOM_boundary_update.F90.

52 integer :: id_clock_pass !< A CPU time clock ID