MOM6
dyed_obcs_initialization Module Reference

Detailed Description

Dyed open boundary conditions.

Setting dyes, one for painting the inflow on each side.

Functions/Subroutines

subroutine, public dyed_obcs_set_obc_data (OBC, G, GV, param_file, tr_Reg)
 This subroutine sets the dye properties at open boundary conditions. More...
 

Variables

integer ntr = 0
 Number of dye tracers. More...
 

Function/Subroutine Documentation

◆ dyed_obcs_set_obc_data()

subroutine, public dyed_obcs_initialization::dyed_obcs_set_obc_data ( type(ocean_obc_type), pointer  OBC,
type(ocean_grid_type), intent(in)  G,
type(verticalgrid_type), intent(in)  GV,
type(param_file_type), intent(in)  param_file,
type(tracer_registry_type), pointer  tr_Reg 
)

This subroutine sets the dye properties at open boundary conditions.

Parameters
obcThis open boundary condition type specifies whether, where, and what open boundary conditions are used.
[in]gThe ocean's grid structure.
[in]gvThe ocean's vertical grid structure.
[in]param_fileA structure indicating the open file to parse for model parameter values.
tr_regTracer registry.

Definition at line 31 of file dyed_obcs_initialization.F90.

31  type(ocean_OBC_type), pointer :: OBC !< This open boundary condition type specifies
32  !! whether, where, and what open boundary
33  !! conditions are used.
34  type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure.
35  type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
36  type(param_file_type), intent(in) :: param_file !< A structure indicating the open file
37  !! to parse for model parameter values.
38  type(tracer_registry_type), pointer :: tr_Reg !< Tracer registry.
39  ! Local variables
40  character(len=40) :: mdl = "dyed_obcs_set_OBC_data" ! This subroutine's name.
41  character(len=80) :: name, longname
42  integer :: i, j, k, itt, is, ie, js, je, isd, ied, jsd, jed, m, n, nz
43  integer :: IsdB, IedB, JsdB, JedB
44  real :: dye
45  type(OBC_segment_type), pointer :: segment => null()
46  type(tracer_type), pointer :: tr_ptr => null()
47 
48  is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
49  isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
50  isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
51 
52  if (.not.associated(obc)) return
53 
54  call get_param(param_file, mdl, "NUM_DYE_TRACERS", ntr, &
55  "The number of dye tracers in this run. Each tracer "//&
56  "should have a separate boundary segment.", default=0, &
57  do_not_log=.true.)
58 
59  if (obc%number_of_segments < ntr) then
60  call mom_error(warning, "Error in dyed_obc segment setup")
61  return !!! Need a better error message here
62  endif
63 
64 ! ! Set the inflow values of the dyes, one per segment.
65 ! ! We know the order: north, south, east, west
66  do m=1,ntr
67  write(name,'("dye_",I2.2)') m
68  write(longname,'("Concentration of dyed_obc Tracer ",I2.2, " on segment ",I2.2)') m, m
69  call tracer_name_lookup(tr_reg, tr_ptr, name)
70 
71  do n=1,obc%number_of_segments
72  if (n == m) then
73  dye = 1.0
74  else
75  dye = 0.0
76  endif
77  call register_segment_tracer(tr_ptr, param_file, gv, &
78  obc%segment(n), obc_scalar=dye)
79  enddo
80  enddo
81 

References mom_error_handler::mom_error(), ntr, and mom_open_boundary::register_segment_tracer().

Referenced by mom_state_initialization::mom_initialize_state().

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

Variable Documentation

◆ ntr

integer dyed_obcs_initialization::ntr = 0
private

Number of dye tracers.

Todo:
This is a module variable. Move this variable into the control structure.

Definition at line 24 of file dyed_obcs_initialization.F90.

24 integer :: ntr = 0 !< Number of dye tracers

Referenced by dyed_obcs_set_obc_data().