18 implicit none ;
private 20 #include <MOM_memory.h> 26 integer :: continuity_scheme
41 subroutine continuity(u, v, hin, h, uh, vh, dt, G, GV, CS, uhbt, vhbt, OBC, &
42 visc_rem_u, visc_rem_v, u_cor, v_cor, &
43 uhbt_aux, vhbt_aux, u_cor_aux, v_cor_aux, BT_cont)
46 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
intent(in) :: u
47 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
intent(in) :: v
48 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(inout) :: hin
49 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(inout) :: h
50 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
intent(out) :: uh
52 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
intent(out) :: vh
54 real,
intent(in) :: dt
56 real,
dimension(SZIB_(G),SZJ_(G)),
intent(in),
optional :: uhbt
58 real,
dimension(SZI_(G),SZJB_(G)),
intent(in),
optional :: vhbt
61 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
intent(in),
optional :: visc_rem_u
65 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
intent(in),
optional :: visc_rem_v
69 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
intent(out),
optional :: u_cor
71 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
intent(out),
optional :: v_cor
73 real,
dimension(SZIB_(G),SZJ_(G)),
intent(in),
optional :: uhbt_aux
75 real,
dimension(SZI_(G),SZJB_(G)),
intent(in),
optional :: vhbt_aux
77 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
intent(inout),
optional :: u_cor_aux
79 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
intent(inout),
optional :: v_cor_aux
84 if (
present(visc_rem_u) .neqv.
present(visc_rem_v))
call mom_error(fatal, &
85 "MOM_continuity: Either both visc_rem_u and visc_rem_v or neither"// &
86 " one must be present in call to continuity.")
87 if (
present(u_cor) .neqv.
present(v_cor))
call mom_error(fatal, &
88 "MOM_continuity: Either both u_cor and v_cor or neither"// &
89 " one must be present in call to continuity.")
90 if (
present(uhbt_aux) .neqv.
present(vhbt_aux))
call mom_error(fatal, &
91 "MOM_continuity: Either both uhbt_aux and uhbt_aux or neither"// &
92 " one must be present in call to continuity.")
93 if (
present(u_cor_aux) .neqv.
present(v_cor_aux))
call mom_error(fatal, &
94 "MOM_continuity: Either both u_cor_aux and v_cor_aux or neither"// &
95 " one must be present in call to continuity.")
96 if (
present(u_cor_aux) .neqv.
present(uhbt_aux))
call mom_error(fatal, &
97 "MOM_continuity: u_cor_aux can only be calculated if uhbt_aux is"// &
98 " provided, and uhbt_aux has no other purpose. Include both arguments"//&
102 call continuity_ppm(u, v, hin, h, uh, vh, dt, g, gv, cs%PPM_CSp, uhbt, vhbt, obc, &
103 visc_rem_u, visc_rem_v, u_cor, v_cor, &
104 uhbt_aux, vhbt_aux, u_cor_aux, v_cor_aux, bt_cont)
106 call mom_error(fatal,
"continuity: Unrecognized value of continuity_scheme")
113 type(time_type),
target,
intent(in) :: Time
117 type(
diag_ctrl),
target,
intent(inout) :: diag
120 #include "version_variable.h" 121 character(len=40) :: mdl =
"MOM_continuity" 122 character(len=20) :: tmpstr
124 if (
associated(cs))
then 125 call mom_error(warning,
"continuity_init called with associated control structure.")
132 call get_param(param_file, mdl,
"CONTINUITY_SCHEME", tmpstr, &
133 "CONTINUITY_SCHEME selects the discretization for the \n"//&
134 "continuity solver. The only valid value currently is: \n"//&
135 "\t PPM - use a positive-definite (or monotonic) \n"//&
136 "\t piecewise parabolic reconstruction solver.", &
139 tmpstr =
uppercase(tmpstr) ; cs%continuity_scheme = 0
140 select case (trim(tmpstr))
143 call mom_mesg(
'continuity_init: CONTINUITY_SCHEME ="'//trim(tmpstr)//
'"', 0)
144 call mom_mesg(
"continuity_init: The only valid value is currently "// &
146 call mom_error(fatal,
"continuity_init: Unrecognized setting "// &
147 "#define CONTINUITY_SCHEME "//trim(tmpstr)//
" found in input file.")
151 call continuity_ppm_init(time, g, gv, param_file, diag, cs%PPM_CSp)
165 stencil = continuity_ppm_stencil(cs%PPM_CSp)
integer, parameter ppm_scheme
Enumerated constant to select PPM.
subroutine, public continuity_init(Time, G, GV, param_file, diag, CS)
Initializes continuity_cs.
integer function, public continuity_ppm_stencil(CS)
continuity_PPM_stencil returns the continuity solver stencil size
Ocean grid type. See mom_grid for details.
Solve the layer continuity equation.
Provides the ocean grid type.
subroutine, public continuity_ppm(u, v, hin, h, uh, vh, dt, G, GV, CS, uhbt, vhbt, OBC, visc_rem_u, visc_rem_v, u_cor, v_cor, uhbt_aux, vhbt_aux, u_cor_aux, v_cor_aux, BT_cont)
Time steps the layer thicknesses, using a monotonically limit, directionally split PPM scheme...
The BT_cont_type structure contains information about the summed layer transports and how they will v...
Control structure for mom_continuity_ppm.
character(len=len(input_string)) function, public uppercase(input_string)
Control structure for mom_continuity.
logical function, public is_root_pe()
subroutine, public continuity_ppm_end(CS)
Destructor for continuity_ppm_cs.
character(len=20), parameter ppm_string
String to select PPM.
subroutine, public mom_mesg(message, verb, all_print)
integer function, public continuity_stencil(CS)
continuity_stencil returns the continuity solver stencil size
subroutine, public continuity(u, v, hin, h, uh, vh, dt, G, GV, CS, uhbt, vhbt, OBC, visc_rem_u, visc_rem_v, u_cor, v_cor, uhbt_aux, vhbt_aux, u_cor_aux, v_cor_aux, BT_cont)
Time steps the layer thicknesses, using a monotonically limited, directionally split PPM scheme...
Solve the layer continuity equation using the PPM method for layer fluxes.
Controls where open boundary conditions are applied.
subroutine, public continuity_end(CS)
Destructor for continuity_cs.
subroutine, public mom_error(level, message, all_print)
subroutine, public continuity_ppm_init(Time, G, GV, param_file, diag, CS)
Initializes continuity_ppm_cs.