MOM6
supercritical_initialization.F90
Go to the documentation of this file.
2 
3 ! This file is part of MOM6. See LICENSE.md for the license.
4 
8 use mom_grid, only : ocean_grid_type
11 use mom_time_manager, only : time_type, set_time, time_type_to_real
12 
13 implicit none ; private
14 
15 #include <MOM_memory.h>
16 
19 
20 ! This include declares and sets the variable "version".
21 #include "version_variable.h"
22 
23 contains
24 
25 !> This subroutine sets the properties of flow at open boundary conditions.
26 subroutine supercritical_set_obc_data(OBC, G, param_file)
27  type(ocean_obc_type), pointer :: OBC !< This open boundary condition type specifies
28  !! whether, where, and what open boundary
29  !! conditions are used.
30  type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure.
31  type(param_file_type), intent(in) :: param_file !< Parameter file structure
32  ! Local variables
33  character(len=40) :: mdl = "supercritical_set_OBC_data" ! This subroutine's name.
34  real :: zonal_flow
35  integer :: i, j, k, l
36  integer :: isd, ied, jsd, jed, IsdB, IedB, JsdB, JedB
37  type(obc_segment_type), pointer :: segment ! pointer to segment type list
38 
39  if (.not.associated(obc)) call mom_error(fatal, 'supercritical_initialization.F90: '// &
40  'supercritical_set_OBC_data() was called but OBC type was not initialized!')
41 
42  call get_param(param_file, mdl, "SUPERCRITICAL_ZONAL_FLOW", zonal_flow, &
43  "Constant zonal flow imposed at upstream open boundary.", &
44  units="m/s", default=8.57)
45 
46  do l=1, obc%number_of_segments
47  segment => obc%segment(l)
48  if (.not. segment%on_pe) cycle
49  if (segment%gradient) cycle
50  if (segment%oblique .and. .not. segment%nudged .and. .not. segment%Flather) cycle
51 
52  if (segment%is_E_or_W) then
53  jsd = segment%HI%jsd ; jed = segment%HI%jed
54  isdb = segment%HI%IsdB ; iedb = segment%HI%IedB
55  do k=1,g%ke
56  do j=jsd,jed ; do i=isdb,iedb
57  if (segment%specified .or. segment%nudged) then
58  segment%normal_vel(i,j,k) = zonal_flow
59  endif
60  if (segment%specified) then
61  segment%normal_trans(i,j,k) = zonal_flow * g%dyCu(i,j)
62  endif
63  enddo ; enddo
64  enddo
65  do j=jsd,jed ; do i=isdb,iedb
66  segment%normal_vel_bt(i,j) = zonal_flow
67  enddo ; enddo
68  else
69  isd = segment%HI%isd ; ied = segment%HI%ied
70  jsdb = segment%HI%JsdB ; jedb = segment%HI%JedB
71 ! do k=1,G%ke
72 ! do J=JsdB,JedB ; do i=isd,ied
73 ! segment%normal_vel(i,J,k) = 0.0
74 ! enddo ; enddo
75 ! enddo
76  do j=jsdb,jedb ; do i=isd,ied
77  segment%normal_vel_bt(i,j) = 0.0
78  enddo ; enddo
79  endif
80  enddo
81 
82 end subroutine supercritical_set_obc_data
83 
84 !> This subroutine sets up the supercritical topography and land mask.
85 !! We were not able to get the shock wave to behave this way and are
86 !! now using an external file.
87 subroutine supercritical_initialize_topography(D, G, param_file, max_depth)
88  type(dyn_horgrid_type), intent(in) :: G !< The dynamic horizontal grid type
89  real, dimension(SZI_(G),SZJ_(G)), intent(out) :: D !< Ocean bottom depth in m
90  type(param_file_type), intent(in) :: param_file !< Parameter file structure
91  real, intent(in) :: max_depth !< Maximum depth of model in m
92  ! Local variables
93  character(len=40) :: mdl = "supercritical_initialize_topography" ! This subroutine's name.
94  real :: min_depth ! The minimum and maximum depths in m.
95  real :: PI ! 3.1415...
96  real :: coast_offset, coast_angle
97  integer :: i, j
98 
99  call mom_mesg(" supercritical_initialization.F90, supercritical_initialize_topography: setting topography", 5)
100 
101  call log_version(param_file, mdl, version, "")
102  call get_param(param_file, mdl, "MINIMUM_DEPTH", min_depth, &
103  "The minimum depth of the ocean.", units="m", default=0.0)
104  call get_param(param_file, mdl, "SUPERCRITICAL_COAST_OFFSET", coast_offset, &
105  "The distance along the southern boundary at which the coasts angles in.", &
106  units="km", default=10.0)
107  call get_param(param_file, mdl, "SUPERCRITICAL_COAST_ANGLE", coast_angle, &
108  "The angle of the southern bondary beyond X=SUPERCRITICAL_COAST_OFFSET.", &
109  units="degrees", default=8.95)
110 
111  coast_angle = coast_angle * (atan(1.0)/45.) ! Convert to radians
112 
113  do j=g%jsc,g%jec ; do i=g%isc,g%iec
114  d(i,j)=max_depth
115  if ((g%geoLonT(i,j) > coast_offset).AND. &
116  (atan2(g%geoLatT(i,j),g%geoLonT(i,j) - coast_offset) < coast_angle)) then
117  d(i,j)=0.5*min_depth
118  endif
119 
120  if (d(i,j) > max_depth) d(i,j) = max_depth
121  if (d(i,j) < min_depth) d(i,j) = 0.5*min_depth
122  enddo ; enddo
123 
125 
126 !> \namespace supercritical_initialization
127 !!
128 !! The module configures the model for the "supercritical" experiment.
129 !! https://marine.rutgers.edu/po/index.php?model=test-problems&title=supercritical
subroutine, public supercritical_initialize_topography(D, G, param_file, max_depth)
This subroutine sets up the supercritical topography and land mask. We were not able to get the shock...
Ocean grid type. See mom_grid for details.
Definition: MOM_grid.F90:19
Provides the ocean grid type.
Definition: MOM_grid.F90:2
Open boundary segment data structure.
integer, parameter, public obc_simple
logical function, public is_root_pe()
subroutine, public mom_mesg(message, verb, all_print)
subroutine, public supercritical_set_obc_data(OBC, G, param_file)
This subroutine sets the properties of flow at open boundary conditions.
integer, parameter, public obc_none
Controls where open boundary conditions are applied.
subroutine, public mom_error(level, message, all_print)
The module configures the model for the "supercritical" experiment. https://marine.rutgers.edu/po/index.php?model=test-problems&title=supercritical.