supercritical_initialization.F90

1! This file is part of MOM6, the Modular Ocean Model version 6.
2! See the LICENSE file for licensing information.
3! SPDX-License-Identifier: Apache-2.0
4
5!> The "super critical" configuration
7
9use mom_error_handler, only : mom_mesg, mom_error, fatal, is_root_pe
10use mom_file_parser, only : get_param, log_version, param_file_type
11use mom_grid, only : ocean_grid_type
13use mom_open_boundary, only : obc_direction_e, obc_direction_w
14use mom_time_manager, only : time_type
17
18implicit none ; private
19
20#include <MOM_memory.h>
21
23
24contains
25
26!> This subroutine sets the properties of flow at open boundary conditions.
27subroutine supercritical_set_obc_data(OBC, G, GV, US, param_file)
28 type(ocean_obc_type), pointer :: obc !< This open boundary condition type specifies
29 !! whether, where, and what open boundary
30 !! conditions are used.
31 type(ocean_grid_type), intent(in) :: g !< The ocean's grid structure.
32 type(verticalgrid_type), intent(in) :: gv !< The ocean's vertical grid structure
33 type(unit_scale_type), intent(in) :: us !< A dimensional unit scaling type
34 type(param_file_type), intent(in) :: param_file !< Parameter file structure
35 ! Local variables
36 character(len=40) :: mdl = "supercritical_set_OBC_data" ! This subroutine's name.
37 real :: zonal_flow ! Inflow speed [L T-1 ~> m s-1]
38 integer :: unrot_dir ! The unrotated direction of the segment
39 integer :: turns ! Number of index quarter turns
40 integer :: i, j, k, l
41 integer :: isd, ied, jsd, jed, isdb, iedb, jsdb, jedb
42 type(obc_segment_type), pointer :: segment => null() ! pointer to segment type list
43
44 if (.not.associated(obc)) call mom_error(fatal, 'supercritical_initialization.F90: '// &
45 'supercritical_set_OBC_data() was called but OBC type was not initialized!')
46
47 call get_param(param_file, mdl, "SUPERCRITICAL_ZONAL_FLOW", zonal_flow, &
48 "Constant zonal flow imposed at upstream open boundary.", &
49 units="m/s", default=8.57, scale=us%m_s_to_L_T)
50
51 turns = modulo(g%HI%turns, 4)
52
53 do l=1, obc%number_of_segments
54 segment => obc%segment(l)
55 if (.not. segment%on_pe) cycle
56 if (segment%gradient) cycle
57 if (segment%oblique .and. .not. segment%nudged .and. .not. segment%Flather) cycle
58
59 unrot_dir = segment%direction
60 if (turns /= 0) unrot_dir = rotate_obc_segment_direction(segment%direction, -turns)
61
62 if ((unrot_dir == obc_direction_e) .or. (unrot_dir == obc_direction_w)) then
63 jsd = segment%HI%jsd ; jed = segment%HI%jed
64 isdb = segment%HI%IsdB ; iedb = segment%HI%IedB
65 do k=1,gv%ke
66 do j=jsd,jed ; do i=isdb,iedb
67 if (segment%specified .or. segment%nudged) then
68 segment%normal_vel(i,j,k) = zonal_flow
69 endif
70 if (segment%specified) then
71 segment%normal_trans(i,j,k) = zonal_flow * g%dyCu(i,j)
72 endif
73 enddo ; enddo
74 enddo
75 do j=jsd,jed ; do i=isdb,iedb
76 segment%normal_vel_bt(i,j) = zonal_flow
77 enddo ; enddo
78 else
79 isd = segment%HI%isd ; ied = segment%HI%ied
80 jsdb = segment%HI%JsdB ; jedb = segment%HI%JedB
81 do j=jsdb,jedb ; do i=isd,ied
82 segment%normal_vel_bt(i,j) = 0.0
83 enddo ; enddo
84 endif
85 enddo
86
87end subroutine supercritical_set_obc_data
88
89!> \namespace supercritical_initialization
90!!
91!! The module configures the model for the "supercritical" experiment.
92!! https://marine.rutgers.edu/po/index.php?model=test-problems&title=supercritical