20 implicit none ;
private
22 public coradcalc, coriolisadv_init, coriolisadv_end
24 #include <MOM_memory.h>
28 integer :: coriolis_scheme
41 integer :: pv_adv_scheme
45 real :: f_eff_max_blend
60 logical :: bound_coriolis
66 logical :: coriolis_en_dis
72 type(time_type),
pointer :: time
75 integer :: id_rv = -1, id_pv = -1, id_gkeu = -1, id_gkev = -1
76 integer :: id_rvxu = -1, id_rvxv = -1
80 integer,
parameter :: sadourny75_energy = 1
81 integer,
parameter :: arakawa_hsu90 = 2
82 integer,
parameter :: robust_enstro = 3
83 integer,
parameter :: sadourny75_enstro = 4
84 integer,
parameter :: arakawa_lamb81 = 5
85 integer,
parameter :: al_blend = 6
86 character*(20),
parameter :: sadourny75_energy_string =
"SADOURNY75_ENERGY"
87 character*(20),
parameter :: arakawa_hsu_string =
"ARAKAWA_HSU90"
88 character*(20),
parameter :: robust_enstro_string =
"ROBUST_ENSTRO"
89 character*(20),
parameter :: sadourny75_enstro_string =
"SADOURNY75_ENSTRO"
90 character*(20),
parameter :: arakawa_lamb_string =
"ARAKAWA_LAMB81"
91 character*(20),
parameter :: al_blend_string =
"ARAKAWA_LAMB_BLEND"
94 integer,
parameter :: ke_arakawa = 10
95 integer,
parameter :: ke_simple_gudonov = 11
96 integer,
parameter :: ke_gudonov = 12
97 character*(20),
parameter :: ke_arakawa_string =
"KE_ARAKAWA"
98 character*(20),
parameter :: ke_simple_gudonov_string =
"KE_SIMPLE_GUDONOV"
99 character*(20),
parameter :: ke_gudonov_string =
"KE_GUDONOV"
102 integer,
parameter :: pv_adv_centered = 21
103 integer,
parameter :: pv_adv_upwind1 = 22
104 character*(20),
parameter :: pv_adv_centered_string =
"PV_ADV_CENTERED"
105 character*(20),
parameter :: pv_adv_upwind1_string =
"PV_ADV_UPWIND1"
111 subroutine coradcalc(u, v, h, uh, vh, CAu, CAv, OBC, AD, G, GV, US, CS)
114 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
intent(in) :: u
115 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
intent(in) :: v
116 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(in) :: h
117 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
intent(in) :: uh
119 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
intent(in) :: vh
121 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
intent(out) :: cau
123 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
intent(out) :: cav
131 real,
dimension(SZIB_(G),SZJB_(G)) :: &
136 real,
dimension(SZIB_(G),SZJ_(G)) :: &
142 real,
dimension(SZI_(G),SZJ_(G)) :: &
146 real,
dimension(SZIB_(G),SZJ_(G)) :: &
152 real,
dimension(SZI_(G),SZJB_(G)) :: &
158 real,
dimension(SZI_(G),SZJ_(G)) :: &
164 real,
dimension(SZIB_(G),SZJB_(G)) :: &
172 real,
dimension(SZIB_(G),SZJB_(G),SZK_(G)) :: &
175 real :: fv1, fv2, fu1, fu2
176 real :: max_fv, max_fu
177 real :: min_fv, min_fu
179 real,
parameter :: c1_12=1.0/12.0
180 real,
parameter :: c1_24=1.0/24.0
181 real :: absolute_vorticity
182 real :: relative_vorticity
184 real :: max_ihq, min_ihq
190 real,
parameter :: eps_vel=1.0e-10
194 real :: c1, c2, c3, slope
210 real :: quheff,qvheff
211 integer :: i, j, k, n, is, ie, js, je, isq, ieq, jsq, jeq, nz
218 if (.not.
associated(cs))
call mom_error(fatal, &
219 "MOM_CoriolisAdv: Module must be initialized before it is used.")
220 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec
221 isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB ; nz = g%ke
222 h_neglect = gv%H_subroundoff
223 h_tiny = gv%Angstrom_H
226 do j=jsq-1,jeq+2 ;
do i=isq-1,ieq+2
227 area_h(i,j) = g%mask2dT(i,j) * g%areaT(i,j)
229 if (
associated(obc))
then ;
do n=1,obc%number_of_segments
230 if (.not. obc%segment(n)%on_pe) cycle
231 i = obc%segment(n)%HI%IsdB ; j = obc%segment(n)%HI%JsdB
232 if (obc%segment(n)%is_N_or_S .and. (j >= jsq-1) .and. (j <= jeq+1))
then
233 do i = max(isq-1,obc%segment(n)%HI%isd), min(ieq+2,obc%segment(n)%HI%ied)
234 if (obc%segment(n)%direction == obc_direction_n)
then
235 area_h(i,j+1) = area_h(i,j)
237 area_h(i,j) = area_h(i,j+1)
240 elseif (obc%segment(n)%is_E_or_W .and. (i >= isq-1) .and. (i <= ieq+1))
then
241 do j = max(jsq-1,obc%segment(n)%HI%jsd), min(jeq+2,obc%segment(n)%HI%jed)
242 if (obc%segment(n)%direction == obc_direction_e)
then
243 area_h(i+1,j) = area_h(i,j)
245 area_h(i,j) = area_h(i+1,j)
251 do j=jsq-1,jeq+1 ;
do i=isq-1,ieq+1
252 area_q(i,j) = (area_h(i,j) + area_h(i+1,j+1)) + &
253 (area_h(i+1,j) + area_h(i,j+1))
264 do j=jsq-1,jeq+1 ;
do i=isq-1,ieq+1
265 dvdx(i,j) = v(i+1,j,k)*g%dyCv(i+1,j) - v(i,j,k)*g%dyCv(i,j)
266 dudy(i,j) = u(i,j+1,k)*g%dxCu(i,j+1) - u(i,j,k)*g%dxCu(i,j)
268 do j=jsq-1,jeq+1 ;
do i=isq-1,ieq+2
269 harea_v(i,j) = 0.5*(area_h(i,j) * h(i,j,k) + area_h(i,j+1) * h(i,j+1,k))
271 do j=jsq-1,jeq+2 ;
do i=isq-1,ieq+1
272 harea_u(i,j) = 0.5*(area_h(i,j) * h(i,j,k) + area_h(i+1,j) * h(i+1,j,k))
274 if (cs%Coriolis_En_Dis)
then
275 do j=jsq,jeq+1 ;
do i=is-1,ie
276 uh_center(i,j) = 0.5 * (g%dy_Cu(i,j) * u(i,j,k)) * (h(i,j,k) + h(i+1,j,k))
278 do j=js-1,je ;
do i=isq,ieq+1
279 vh_center(i,j) = 0.5 * (g%dx_Cv(i,j) * v(i,j,k)) * (h(i,j,k) + h(i,j+1,k))
285 if (
associated(obc))
then ;
do n=1,obc%number_of_segments
286 if (.not. obc%segment(n)%on_pe) cycle
287 i = obc%segment(n)%HI%IsdB ; j = obc%segment(n)%HI%JsdB
288 if (obc%segment(n)%is_N_or_S .and. (j >= jsq-1) .and. (j <= jeq+1))
then
289 if (obc%zero_vorticity)
then ;
do i=obc%segment(n)%HI%IsdB,obc%segment(n)%HI%IedB
290 dvdx(i,j) = 0. ; dudy(i,j) = 0.
292 if (obc%freeslip_vorticity)
then ;
do i=obc%segment(n)%HI%IsdB,obc%segment(n)%HI%IedB
295 if (obc%computed_vorticity)
then ;
do i=obc%segment(n)%HI%IsdB,obc%segment(n)%HI%IedB
296 if (obc%segment(n)%direction == obc_direction_n)
then
297 dudy(i,j) = 2.0*(obc%segment(n)%tangential_vel(i,j,k) - u(i,j,k))*g%dxCu(i,j)
299 dudy(i,j) = 2.0*(u(i,j+1,k) - obc%segment(n)%tangential_vel(i,j,k))*g%dxCu(i,j+1)
302 if (obc%specified_vorticity)
then ;
do i=obc%segment(n)%HI%IsdB,obc%segment(n)%HI%IedB
303 if (obc%segment(n)%direction == obc_direction_n)
then
304 dudy(i,j) = obc%segment(n)%tangential_grad(i,j,k)*g%dxCu(i,j)*g%dyBu(i,j)
306 dudy(i,j) = obc%segment(n)%tangential_grad(i,j,k)*g%dxCu(i,j+1)*g%dyBu(i,j)
311 do i = max(isq-1,obc%segment(n)%HI%isd), min(ieq+2,obc%segment(n)%HI%ied)
312 if (obc%segment(n)%direction == obc_direction_n)
then
313 harea_v(i,j) = 0.5 * (area_h(i,j) + area_h(i,j+1)) * h(i,j,k)
315 harea_v(i,j) = 0.5 * (area_h(i,j) + area_h(i,j+1)) * h(i,j+1,k)
319 if (cs%Coriolis_En_Dis)
then
320 do i = max(isq-1,obc%segment(n)%HI%isd), min(ieq+2,obc%segment(n)%HI%ied)
321 if (obc%segment(n)%direction == obc_direction_n)
then
322 vh_center(i,j) = g%dx_Cv(i,j) * v(i,j,k) * h(i,j,k)
324 vh_center(i,j) = g%dx_Cv(i,j) * v(i,j,k) * h(i,j+1,k)
328 elseif (obc%segment(n)%is_E_or_W .and. (i >= isq-1) .and. (i <= ieq+1))
then
329 if (obc%zero_vorticity)
then ;
do j=obc%segment(n)%HI%JsdB,obc%segment(n)%HI%JedB
330 dvdx(i,j) = 0. ; dudy(i,j) = 0.
332 if (obc%freeslip_vorticity)
then ;
do j=obc%segment(n)%HI%JsdB,obc%segment(n)%HI%JedB
335 if (obc%computed_vorticity)
then ;
do j=obc%segment(n)%HI%JsdB,obc%segment(n)%HI%JedB
336 if (obc%segment(n)%direction == obc_direction_e)
then
337 dvdx(i,j) = 2.0*(obc%segment(n)%tangential_vel(i,j,k) - v(i,j,k))*g%dyCv(i,j)
339 dvdx(i,j) = 2.0*(v(i+1,j,k) - obc%segment(n)%tangential_vel(i,j,k))*g%dyCv(i+1,j)
342 if (obc%specified_vorticity)
then ;
do j=obc%segment(n)%HI%JsdB,obc%segment(n)%HI%JedB
343 if (obc%segment(n)%direction == obc_direction_e)
then
344 dvdx(i,j) = obc%segment(n)%tangential_grad(i,j,k)*g%dyCv(i,j)*g%dxBu(i,j)
346 dvdx(i,j) = obc%segment(n)%tangential_grad(i,j,k)*g%dyCv(i+1,j)*g%dxBu(i,j)
351 do j = max(jsq-1,obc%segment(n)%HI%jsd), min(jeq+2,obc%segment(n)%HI%jed)
352 if (obc%segment(n)%direction == obc_direction_e)
then
353 harea_u(i,j) = 0.5*(area_h(i,j) + area_h(i+1,j)) * h(i,j,k)
355 harea_u(i,j) = 0.5*(area_h(i,j) + area_h(i+1,j)) * h(i+1,j,k)
358 if (cs%Coriolis_En_Dis)
then
359 do j = max(jsq-1,obc%segment(n)%HI%jsd), min(jeq+2,obc%segment(n)%HI%jed)
360 if (obc%segment(n)%direction == obc_direction_e)
then
361 uh_center(i,j) = g%dy_Cu(i,j) * u(i,j,k) * h(i,j,k)
363 uh_center(i,j) = g%dy_Cu(i,j) * u(i,j,k) * h(i+1,j,k)
370 if (
associated(obc))
then ;
do n=1,obc%number_of_segments
371 if (.not. obc%segment(n)%on_pe) cycle
374 i = obc%segment(n)%HI%IsdB ; j = obc%segment(n)%HI%JsdB
375 if (obc%segment(n)%is_N_or_S .and. (j >= jsq-1) .and. (j <= jeq+1))
then
376 do i = max(isq-1,obc%segment(n)%HI%IsdB), min(ieq+1,obc%segment(n)%HI%IedB)
377 if (obc%segment(n)%direction == obc_direction_n)
then
378 if (area_h(i,j) + area_h(i+1,j) > 0.0)
then
379 harea_u(i,j+1) = harea_u(i,j) * ((area_h(i,j+1) + area_h(i+1,j+1)) / &
380 (area_h(i,j) + area_h(i+1,j)))
381 else ; harea_u(i,j+1) = 0.0 ;
endif
383 if (area_h(i,j+1) + area_h(i+1,j+1) > 0.0)
then
384 harea_u(i,j) = harea_u(i,j+1) * ((area_h(i,j) + area_h(i+1,j)) / &
385 (area_h(i,j+1) + area_h(i+1,j+1)))
386 else ; harea_u(i,j) = 0.0 ;
endif
389 elseif (obc%segment(n)%is_E_or_W .and. (i >= isq-1) .and. (i <= ieq+1))
then
390 do j = max(jsq-1,obc%segment(n)%HI%JsdB), min(jeq+1,obc%segment(n)%HI%JedB)
391 if (obc%segment(n)%direction == obc_direction_e)
then
392 if (area_h(i,j) + area_h(i,j+1) > 0.0)
then
393 harea_v(i+1,j) = harea_v(i,j) * ((area_h(i+1,j) + area_h(i+1,j+1)) / &
394 (area_h(i,j) + area_h(i,j+1)))
395 else ; harea_v(i+1,j) = 0.0 ;
endif
397 harea_v(i,j) = 0.5 * (area_h(i,j) + area_h(i,j+1)) * h(i,j+1,k)
398 if (area_h(i+1,j) + area_h(i+1,j+1) > 0.0)
then
399 harea_v(i,j) = harea_v(i+1,j) * ((area_h(i,j) + area_h(i,j+1)) / &
400 (area_h(i+1,j) + area_h(i+1,j+1)))
401 else ; harea_v(i,j) = 0.0 ;
endif
407 do j=jsq-1,jeq+1 ;
do i=isq-1,ieq+1
408 if (cs%no_slip )
then
409 relative_vorticity = (2.0-g%mask2dBu(i,j)) * (dvdx(i,j) - dudy(i,j)) * &
412 relative_vorticity = g%mask2dBu(i,j) * (dvdx(i,j) - dudy(i,j)) * &
415 absolute_vorticity = us%s_to_T*g%CoriolisBu(i,j) + relative_vorticity
417 if (area_q(i,j) > 0.0)
then
418 harea_q = (harea_u(i,j) + harea_u(i,j+1)) + (harea_v(i,j) + harea_v(i+1,j))
419 ih = area_q(i,j) / (harea_q + h_neglect*area_q(i,j))
421 q(i,j) = absolute_vorticity * ih
422 abs_vort(i,j) = absolute_vorticity
425 if (cs%bound_Coriolis)
then
426 fv1 = absolute_vorticity*v(i+1,j,k)
427 fv2 = absolute_vorticity*v(i,j,k)
428 fu1 = -absolute_vorticity*u(i,j+1,k)
429 fu2 = -absolute_vorticity*u(i,j,k)
431 max_fvq(i,j) = fv1 ; min_fvq(i,j) = fv2
433 max_fvq(i,j) = fv2 ; min_fvq(i,j) = fv1
436 max_fuq(i,j) = fu1 ; min_fuq(i,j) = fu2
438 max_fuq(i,j) = fu2 ; min_fuq(i,j) = fu1
442 if (cs%id_rv > 0) rv(i,j,k) = relative_vorticity
443 if (cs%id_PV > 0) pv(i,j,k) = q(i,j)
444 if (
associated(ad%rv_x_v) .or.
associated(ad%rv_x_u)) &
445 q2(i,j) = relative_vorticity * ih
452 if (cs%Coriolis_Scheme == arakawa_hsu90)
then
455 a(i,j) = (q(i,j) + (q(i+1,j) + q(i,j-1))) * c1_12
456 d(i,j) = ((q(i,j) + q(i+1,j-1)) + q(i,j-1)) * c1_12
459 b(i,j) = (q(i,j) + (q(i-1,j) + q(i,j-1))) * c1_12
460 c(i,j) = ((q(i,j) + q(i-1,j-1)) + q(i,j-1)) * c1_12
463 elseif (cs%Coriolis_Scheme == arakawa_lamb81)
then
464 do j=jsq,jeq+1 ;
do i=isq,ieq+1
465 a(i-1,j) = (2.0*(q(i,j) + q(i-1,j-1)) + (q(i-1,j) + q(i,j-1))) * c1_24
466 d(i-1,j) = ((q(i,j) + q(i-1,j-1)) + 2.0*(q(i-1,j) + q(i,j-1))) * c1_24
467 b(i,j) = ((q(i,j) + q(i-1,j-1)) + 2.0*(q(i-1,j) + q(i,j-1))) * c1_24
468 c(i,j) = (2.0*(q(i,j) + q(i-1,j-1)) + (q(i-1,j) + q(i,j-1))) * c1_24
469 ep_u(i,j) = ((q(i,j) - q(i-1,j-1)) + (q(i-1,j) - q(i,j-1))) * c1_24
470 ep_v(i,j) = (-(q(i,j) - q(i-1,j-1)) + (q(i-1,j) - q(i,j-1))) * c1_24
472 elseif (cs%Coriolis_Scheme == al_blend)
then
473 fe_m2 = cs%F_eff_max_blend - 2.0
474 rat_lin = 1.5 * fe_m2 / max(cs%wt_lin_blend, 1.0e-16)
477 if (cs%F_eff_max_blend <= 2.0)
then ; fe_m2 = -1. ; rat_lin = -1.0 ;
endif
479 do j=jsq,jeq+1 ;
do i=isq,ieq+1
480 min_ihq = min(ih_q(i-1,j-1), ih_q(i,j-1), ih_q(i-1,j), ih_q(i,j))
481 max_ihq = max(ih_q(i-1,j-1), ih_q(i,j-1), ih_q(i-1,j), ih_q(i,j))
483 if (max_ihq < 1.0e15*min_ihq) rat_m1 = max_ihq / min_ihq - 1.0
490 if (rat_m1 <= fe_m2)
then ; al_wt = 1.0
491 elseif (rat_m1 < 1.5*fe_m2)
then ; al_wt = 3.0*fe_m2 / rat_m1 - 2.0
492 else ; al_wt = 0.0 ;
endif
495 if (rat_m1 <= 1.5*fe_m2)
then ; sad_wt = 0.0
496 elseif (rat_m1 <= rat_lin)
then
497 sad_wt = 1.0 - (1.5*fe_m2) / rat_m1
498 elseif (rat_m1 < 2.0*rat_lin)
then
499 sad_wt = 1.0 - (cs%wt_lin_blend / rat_lin) * (rat_m1 - 2.0*rat_lin)
500 else ; sad_wt = 1.0 ;
endif
502 a(i-1,j) = sad_wt * 0.25 * q(i-1,j) + (1.0 - sad_wt) * &
503 ( ((2.0-al_wt)* q(i-1,j) + al_wt*q(i,j-1)) + &
504 2.0 * (q(i,j) + q(i-1,j-1)) ) * c1_24
505 d(i-1,j) = sad_wt * 0.25 * q(i-1,j-1) + (1.0 - sad_wt) * &
506 ( ((2.0-al_wt)* q(i-1,j-1) + al_wt*q(i,j)) + &
507 2.0 * (q(i-1,j) + q(i,j-1)) ) * c1_24
508 b(i,j) = sad_wt * 0.25 * q(i,j) + (1.0 - sad_wt) * &
509 ( ((2.0-al_wt)* q(i,j) + al_wt*q(i-1,j-1)) + &
510 2.0 * (q(i-1,j) + q(i,j-1)) ) * c1_24
511 c(i,j) = sad_wt * 0.25 * q(i,j-1) + (1.0 - sad_wt) * &
512 ( ((2.0-al_wt)* q(i,j-1) + al_wt*q(i-1,j)) + &
513 2.0 * (q(i,j) + q(i-1,j-1)) ) * c1_24
514 ep_u(i,j) = al_wt * ((q(i,j) - q(i-1,j-1)) + (q(i-1,j) - q(i,j-1))) * c1_24
515 ep_v(i,j) = al_wt * (-(q(i,j) - q(i-1,j-1)) + (q(i-1,j) - q(i,j-1))) * c1_24
519 if (cs%Coriolis_En_Dis)
then
521 c1 = 1.0-1.5*0.5 ; c2 = 1.0-0.5 ; c3 = 2.0 ; slope = 0.5
523 do j=jsq,jeq+1 ;
do i=is-1,ie
527 if (g%dy_Cu(i,j) == 0.0) uhc = uhm
529 if (abs(uhc) < 0.1*abs(uhm))
then
531 elseif (abs(uhc) > c1*abs(uhm))
then
532 if (abs(uhc) < c2*abs(uhm))
then ; uhc = (3.0*uhc+(1.0-c2*3.0)*uhm)
533 elseif (abs(uhc) <= c3*abs(uhm))
then ; uhc = uhm
534 else ; uhc = slope*uhc+(1.0-c3*slope)*uhm
539 uh_min(i,j) = uhm ; uh_max(i,j) = uhc
541 uh_max(i,j) = uhm ; uh_min(i,j) = uhc
544 do j=js-1,je ;
do i=isq,ieq+1
548 if (g%dx_Cv(i,j) == 0.0) vhc = vhm
550 if (abs(vhc) < 0.1*abs(vhm))
then
552 elseif (abs(vhc) > c1*abs(vhm))
then
553 if (abs(vhc) < c2*abs(vhm))
then ; vhc = (3.0*vhc+(1.0-c2*3.0)*vhm)
554 elseif (abs(vhc) <= c3*abs(vhm))
then ; vhc = vhm
555 else ; vhc = slope*vhc+(1.0-c3*slope)*vhm
560 vh_min(i,j) = vhm ; vh_max(i,j) = vhc
562 vh_max(i,j) = vhm ; vh_min(i,j) = vhc
568 call gradke(u, v, h, ke, kex, key, k, obc, g, cs)
573 if (cs%Coriolis_Scheme == sadourny75_energy)
then
574 if (cs%Coriolis_En_Dis)
then
576 do j=js,je ;
do i=isq,ieq
577 if (q(i,j)*u(i,j,k) == 0.0)
then
578 temp1 = q(i,j) * ( (vh_max(i,j)+vh_max(i+1,j)) &
579 + (vh_min(i,j)+vh_min(i+1,j)) )*0.5
580 elseif (q(i,j)*u(i,j,k) < 0.0)
then
581 temp1 = q(i,j) * (vh_max(i,j)+vh_max(i+1,j))
583 temp1 = q(i,j) * (vh_min(i,j)+vh_min(i+1,j))
585 if (q(i,j-1)*u(i,j,k) == 0.0)
then
586 temp2 = q(i,j-1) * ( (vh_max(i,j-1)+vh_max(i+1,j-1)) &
587 + (vh_min(i,j-1)+vh_min(i+1,j-1)) )*0.5
588 elseif (q(i,j-1)*u(i,j,k) < 0.0)
then
589 temp2 = q(i,j-1) * (vh_max(i,j-1)+vh_max(i+1,j-1))
591 temp2 = q(i,j-1) * (vh_min(i,j-1)+vh_min(i+1,j-1))
593 cau(i,j,k) = 0.25 * g%IdxCu(i,j) * (temp1 + temp2)
597 do j=js,je ;
do i=isq,ieq
598 cau(i,j,k) = 0.25 * &
599 (q(i,j) * (vh(i+1,j,k) + vh(i,j,k)) + &
600 q(i,j-1) * (vh(i,j-1,k) + vh(i+1,j-1,k))) * g%IdxCu(i,j)
603 elseif (cs%Coriolis_Scheme == sadourny75_enstro)
then
604 do j=js,je ;
do i=isq,ieq
605 cau(i,j,k) = 0.125 * (g%IdxCu(i,j) * (q(i,j) + q(i,j-1))) * &
606 ((vh(i+1,j,k) + vh(i,j,k)) + (vh(i,j-1,k) + vh(i+1,j-1,k)))
608 elseif ((cs%Coriolis_Scheme == arakawa_hsu90) .or. &
609 (cs%Coriolis_Scheme == arakawa_lamb81) .or. &
610 (cs%Coriolis_Scheme == al_blend))
then
612 do j=js,je ;
do i=isq,ieq
613 cau(i,j,k) = ((a(i,j) * vh(i+1,j,k) + &
614 c(i,j) * vh(i,j-1,k)) &
615 + (b(i,j) * vh(i,j,k) + &
616 d(i,j) * vh(i+1,j-1,k))) * g%IdxCu(i,j)
618 elseif (cs%Coriolis_Scheme == robust_enstro)
then
622 do j=js,je ;
do i=isq,ieq
623 heff1 = abs(vh(i,j,k)*g%IdxCv(i,j))/(eps_vel+abs(v(i,j,k)))
624 heff1 = max(heff1,min(h(i,j,k),h(i,j+1,k)))
625 heff1 = min(heff1,max(h(i,j,k),h(i,j+1,k)))
626 heff2 = abs(vh(i,j-1,k)*g%IdxCv(i,j-1))/(eps_vel+abs(v(i,j-1,k)))
627 heff2 = max(heff2,min(h(i,j-1,k),h(i,j,k)))
628 heff2 = min(heff2,max(h(i,j-1,k),h(i,j,k)))
629 heff3 = abs(vh(i+1,j,k)*g%IdxCv(i+1,j))/(eps_vel+abs(v(i+1,j,k)))
630 heff3 = max(heff3,min(h(i+1,j,k),h(i+1,j+1,k)))
631 heff3 = min(heff3,max(h(i+1,j,k),h(i+1,j+1,k)))
632 heff4 = abs(vh(i+1,j-1,k)*g%IdxCv(i+1,j-1))/(eps_vel+abs(v(i+1,j-1,k)))
633 heff4 = max(heff4,min(h(i+1,j-1,k),h(i+1,j,k)))
634 heff4 = min(heff4,max(h(i+1,j-1,k),h(i+1,j,k)))
635 if (cs%PV_Adv_Scheme == pv_adv_centered)
then
636 cau(i,j,k) = 0.5*(abs_vort(i,j)+abs_vort(i,j-1)) * &
637 ((vh(i ,j ,k)+vh(i+1,j-1,k)) + &
638 (vh(i ,j-1,k)+vh(i+1,j ,k)) ) / &
639 (h_tiny +((heff1+heff4) +(heff2+heff3)) ) * g%IdxCu(i,j)
640 elseif (cs%PV_Adv_Scheme == pv_adv_upwind1)
then
641 vheff = ((vh(i ,j ,k)+vh(i+1,j-1,k)) + &
642 (vh(i ,j-1,k)+vh(i+1,j ,k)) )
643 qvheff = 0.5*( (abs_vort(i,j)+abs_vort(i,j-1))*vheff &
644 -(abs_vort(i,j)-abs_vort(i,j-1))*abs(vheff) )
645 cau(i,j,k) = qvheff / &
646 (h_tiny +((heff1+heff4) +(heff2+heff3)) ) * g%IdxCu(i,j)
651 if ((cs%Coriolis_Scheme == arakawa_lamb81) .or. &
652 (cs%Coriolis_Scheme == al_blend))
then ;
do j=js,je ;
do i=isq,ieq
653 cau(i,j,k) = cau(i,j,k) + &
654 (ep_u(i,j)*uh(i-1,j,k) - ep_u(i+1,j)*uh(i+1,j,k)) * g%IdxCu(i,j)
655 enddo ;
enddo ;
endif
658 if (cs%bound_Coriolis)
then
659 do j=js,je ;
do i=isq,ieq
660 max_fv = max(max_fvq(i,j),max_fvq(i,j-1))
661 min_fv = min(min_fvq(i,j),min_fvq(i,j-1))
664 if (cau(i,j,k) > max_fv)
then
667 if (cau(i,j,k) < min_fv) cau(i,j,k) = min_fv
673 do j=js,je ;
do i=isq,ieq
674 cau(i,j,k) = cau(i,j,k) - kex(i,j)
675 if (
associated(ad%gradKEu)) ad%gradKEu(i,j,k) = -kex(i,j)
682 if (cs%Coriolis_Scheme == sadourny75_energy)
then
683 if (cs%Coriolis_En_Dis)
then
685 do j=jsq,jeq ;
do i=is,ie
686 if (q(i-1,j)*v(i,j,k) == 0.0)
then
687 temp1 = q(i-1,j) * ( (uh_max(i-1,j)+uh_max(i-1,j+1)) &
688 + (uh_min(i-1,j)+uh_min(i-1,j+1)) )*0.5
689 elseif (q(i-1,j)*v(i,j,k) > 0.0)
then
690 temp1 = q(i-1,j) * (uh_max(i-1,j)+uh_max(i-1,j+1))
692 temp1 = q(i-1,j) * (uh_min(i-1,j)+uh_min(i-1,j+1))
694 if (q(i,j)*v(i,j,k) == 0.0)
then
695 temp2 = q(i,j) * ( (uh_max(i,j)+uh_max(i,j+1)) &
696 + (uh_min(i,j)+uh_min(i,j+1)) )*0.5
697 elseif (q(i,j)*v(i,j,k) > 0.0)
then
698 temp2 = q(i,j) * (uh_max(i,j)+uh_max(i,j+1))
700 temp2 = q(i,j) * (uh_min(i,j)+uh_min(i,j+1))
702 cav(i,j,k) = - 0.25 * g%IdyCv(i,j) * (temp1 + temp2)
706 do j=jsq,jeq ;
do i=is,ie
707 cav(i,j,k) = - 0.25* &
708 (q(i-1,j)*(uh(i-1,j,k) + uh(i-1,j+1,k)) + &
709 q(i,j)*(uh(i,j,k) + uh(i,j+1,k))) * g%IdyCv(i,j)
712 elseif (cs%Coriolis_Scheme == sadourny75_enstro)
then
713 do j=jsq,jeq ;
do i=is,ie
714 cav(i,j,k) = -0.125 * (g%IdyCv(i,j) * (q(i-1,j) + q(i,j))) * &
715 ((uh(i-1,j,k) + uh(i-1,j+1,k)) + (uh(i,j,k) + uh(i,j+1,k)))
717 elseif ((cs%Coriolis_Scheme == arakawa_hsu90) .or. &
718 (cs%Coriolis_Scheme == arakawa_lamb81) .or. &
719 (cs%Coriolis_Scheme == al_blend))
then
721 do j=jsq,jeq ;
do i=is,ie
722 cav(i,j,k) = - ((a(i-1,j) * uh(i-1,j,k) + &
723 c(i,j+1) * uh(i,j+1,k)) &
724 + (b(i,j) * uh(i,j,k) + &
725 d(i-1,j+1) * uh(i-1,j+1,k))) * g%IdyCv(i,j)
727 elseif (cs%Coriolis_Scheme == robust_enstro)
then
731 do j=jsq,jeq ;
do i=is,ie
732 heff1 = abs(uh(i,j,k)*g%IdyCu(i,j))/(eps_vel+abs(u(i,j,k)))
733 heff1 = max(heff1,min(h(i,j,k),h(i+1,j,k)))
734 heff1 = min(heff1,max(h(i,j,k),h(i+1,j,k)))
735 heff2 = abs(uh(i-1,j,k)*g%IdyCu(i-1,j))/(eps_vel+abs(u(i-1,j,k)))
736 heff2 = max(heff2,min(h(i-1,j,k),h(i,j,k)))
737 heff2 = min(heff2,max(h(i-1,j,k),h(i,j,k)))
738 heff3 = abs(uh(i,j+1,k)*g%IdyCu(i,j+1))/(eps_vel+abs(u(i,j+1,k)))
739 heff3 = max(heff3,min(h(i,j+1,k),h(i+1,j+1,k)))
740 heff3 = min(heff3,max(h(i,j+1,k),h(i+1,j+1,k)))
741 heff4 = abs(uh(i-1,j+1,k)*g%IdyCu(i-1,j+1))/(eps_vel+abs(u(i-1,j+1,k)))
742 heff4 = max(heff4,min(h(i-1,j+1,k),h(i,j+1,k)))
743 heff4 = min(heff4,max(h(i-1,j+1,k),h(i,j+1,k)))
744 if (cs%PV_Adv_Scheme == pv_adv_centered)
then
745 cav(i,j,k) = - 0.5*(abs_vort(i,j)+abs_vort(i-1,j)) * &
746 ((uh(i ,j ,k)+uh(i-1,j+1,k)) + &
747 (uh(i-1,j ,k)+uh(i ,j+1,k)) ) / &
748 (h_tiny + ((heff1+heff4) +(heff2+heff3)) ) * g%IdyCv(i,j)
749 elseif (cs%PV_Adv_Scheme == pv_adv_upwind1)
then
750 uheff = ((uh(i ,j ,k)+uh(i-1,j+1,k)) + &
751 (uh(i-1,j ,k)+uh(i ,j+1,k)) )
752 quheff = 0.5*( (abs_vort(i,j)+abs_vort(i-1,j))*uheff &
753 -(abs_vort(i,j)-abs_vort(i-1,j))*abs(uheff) )
754 cav(i,j,k) = - quheff / &
755 (h_tiny + ((heff1+heff4) +(heff2+heff3)) ) * g%IdyCv(i,j)
760 if ((cs%Coriolis_Scheme == arakawa_lamb81) .or. &
761 (cs%Coriolis_Scheme == al_blend))
then ;
do j=jsq,jeq ;
do i=is,ie
762 cav(i,j,k) = cav(i,j,k) + &
763 (ep_v(i,j)*vh(i,j-1,k) - ep_v(i,j+1)*vh(i,j+1,k)) * g%IdyCv(i,j)
764 enddo ;
enddo ;
endif
766 if (cs%bound_Coriolis)
then
767 do j=jsq,jeq ;
do i=is,ie
768 max_fu = max(max_fuq(i,j),max_fuq(i-1,j))
769 min_fu = min(min_fuq(i,j),min_fuq(i-1,j))
770 if (cav(i,j,k) > max_fu)
then
773 if (cav(i,j,k) < min_fu) cav(i,j,k) = min_fu
779 do j=jsq,jeq ;
do i=is,ie
780 cav(i,j,k) = cav(i,j,k) - key(i,j)
781 if (
associated(ad%gradKEv)) ad%gradKEv(i,j,k) = -key(i,j)
784 if (
associated(ad%rv_x_u) .or.
associated(ad%rv_x_v))
then
786 if (cs%Coriolis_Scheme == sadourny75_energy)
then
787 if (
associated(ad%rv_x_u))
then
788 do j=jsq,jeq ;
do i=is,ie
789 ad%rv_x_u(i,j,k) = - 0.25* &
790 (q2(i-1,j)*(uh(i-1,j,k) + uh(i-1,j+1,k)) + &
791 q2(i,j)*(uh(i,j,k) + uh(i,j+1,k))) * g%IdyCv(i,j)
795 if (
associated(ad%rv_x_v))
then
796 do j=js,je ;
do i=isq,ieq
797 ad%rv_x_v(i,j,k) = 0.25 * &
798 (q2(i,j) * (vh(i+1,j,k) + vh(i,j,k)) + &
799 q2(i,j-1) * (vh(i,j-1,k) + vh(i+1,j-1,k))) * g%IdxCu(i,j)
803 if (
associated(ad%rv_x_u))
then
804 do j=jsq,jeq ;
do i=is,ie
805 ad%rv_x_u(i,j,k) = -g%IdyCv(i,j) * c1_12 * &
806 ((q2(i,j) + q2(i-1,j) + q2(i-1,j-1)) * uh(i-1,j,k) + &
807 (q2(i-1,j) + q2(i,j) + q2(i,j-1)) * uh(i,j,k) + &
808 (q2(i-1,j) + q2(i,j+1) + q2(i,j)) * uh(i,j+1,k) + &
809 (q2(i,j) + q2(i-1,j+1) + q2(i-1,j)) * uh(i-1,j+1,k))
813 if (
associated(ad%rv_x_v))
then
814 do j=js,je ;
do i=isq,ieq
815 ad%rv_x_v(i,j,k) = g%IdxCu(i,j) * c1_12 * &
816 ((q2(i+1,j) + q2(i,j) + q2(i,j-1)) * vh(i+1,j,k) + &
817 (q2(i-1,j) + q2(i,j) + q2(i,j-1)) * vh(i,j,k) + &
818 (q2(i-1,j-1) + q2(i,j) + q2(i,j-1)) * vh(i,j-1,k) + &
819 (q2(i+1,j-1) + q2(i,j) + q2(i,j-1)) * vh(i+1,j-1,k))
828 if (query_averaging_enabled(cs%diag))
then
829 if (cs%id_rv > 0)
call post_data(cs%id_rv, rv, cs%diag)
830 if (cs%id_PV > 0)
call post_data(cs%id_PV, pv, cs%diag)
831 if (cs%id_gKEu>0)
call post_data(cs%id_gKEu, ad%gradKEu, cs%diag)
832 if (cs%id_gKEv>0)
call post_data(cs%id_gKEv, ad%gradKEv, cs%diag)
833 if (cs%id_rvxu > 0)
call post_data(cs%id_rvxu, ad%rv_x_u, cs%diag)
834 if (cs%id_rvxv > 0)
call post_data(cs%id_rvxv, ad%rv_x_v, cs%diag)
837 end subroutine coradcalc
841 subroutine gradke(u, v, h, KE, KEx, KEy, k, OBC, G, CS)
843 real,
dimension(SZIB_(G),SZJ_(G),SZK_(G)),
intent(in) :: u
844 real,
dimension(SZI_(G),SZJB_(G),SZK_(G)),
intent(in) :: v
845 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(in) :: h
846 real,
dimension(SZI_(G) ,SZJ_(G) ),
intent(out) :: KE
847 real,
dimension(SZIB_(G),SZJ_(G) ),
intent(out) :: KEx
849 real,
dimension(SZI_(G) ,SZJB_(G)),
intent(out) :: KEy
851 integer,
intent(in) :: k
855 real :: um, up, vm, vp
856 real :: um2, up2, vm2, vp2
857 real :: um2a, up2a, vm2a, vp2a
858 integer :: i, j, is, ie, js, je, Isq, Ieq, Jsq, Jeq, nz, n
860 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec ; nz = g%ke
861 isq = g%IscB ; ieq = g%IecB ; jsq = g%JscB ; jeq = g%JecB
865 if (cs%KE_Scheme == ke_arakawa)
then
869 do j=jsq,jeq+1 ;
do i=isq,ieq+1
870 ke(i,j) = ( ( g%areaCu( i ,j)*(u( i ,j,k)*u( i ,j,k)) &
871 +g%areaCu(i-1,j)*(u(i-1,j,k)*u(i-1,j,k)) ) &
872 +( g%areaCv(i, j )*(v(i, j ,k)*v(i, j ,k)) &
873 +g%areaCv(i,j-1)*(v(i,j-1,k)*v(i,j-1,k)) ) &
876 elseif (cs%KE_Scheme == ke_simple_gudonov)
then
879 do j=jsq,jeq+1 ;
do i=isq,ieq+1
880 up = 0.5*( u(i-1,j,k) + abs( u(i-1,j,k) ) ) ; up2 = up*up
881 um = 0.5*( u( i ,j,k) - abs( u( i ,j,k) ) ) ; um2 = um*um
882 vp = 0.5*( v(i,j-1,k) + abs( v(i,j-1,k) ) ) ; vp2 = vp*vp
883 vm = 0.5*( v(i, j ,k) - abs( v(i, j ,k) ) ) ; vm2 = vm*vm
884 ke(i,j) = ( max(up2,um2) + max(vp2,vm2) ) *0.5
886 elseif (cs%KE_Scheme == ke_gudonov)
then
889 do j=jsq,jeq+1 ;
do i=isq,ieq+1
890 up = 0.5*( u(i-1,j,k) + abs( u(i-1,j,k) ) ) ; up2a = up*up*g%areaCu(i-1,j)
891 um = 0.5*( u( i ,j,k) - abs( u( i ,j,k) ) ) ; um2a = um*um*g%areaCu( i ,j)
892 vp = 0.5*( v(i,j-1,k) + abs( v(i,j-1,k) ) ) ; vp2a = vp*vp*g%areaCv(i,j-1)
893 vm = 0.5*( v(i, j ,k) - abs( v(i, j ,k) ) ) ; vm2a = vm*vm*g%areaCv(i, j )
894 ke(i,j) = ( max(um2a,up2a) + max(vm2a,vp2a) )*0.5*g%IareaT(i,j)
899 do j=js,je ;
do i=isq,ieq
900 kex(i,j) = (ke(i+1,j) - ke(i,j)) * g%IdxCu(i,j)
904 do j=jsq,jeq ;
do i=is,ie
905 key(i,j) = (ke(i,j+1) - ke(i,j)) * g%IdyCv(i,j)
908 if (
associated(obc))
then
909 do n=1,obc%number_of_segments
910 if (obc%segment(n)%is_N_or_S)
then
911 do i=obc%segment(n)%HI%isd,obc%segment(n)%HI%ied
912 key(i,obc%segment(n)%HI%JsdB) = 0.
914 elseif (obc%segment(n)%is_E_or_W)
then
915 do j=obc%segment(n)%HI%jsd,obc%segment(n)%HI%jed
916 kex(obc%segment(n)%HI%IsdB,j) = 0.
922 end subroutine gradke
925 subroutine coriolisadv_init(Time, G, param_file, diag, AD, CS)
926 type(time_type),
target,
intent(in) :: time
929 type(
diag_ctrl),
target,
intent(inout) :: diag
934 #include "version_variable.h"
935 character(len=40) :: mdl =
"MOM_CoriolisAdv"
936 character(len=20) :: tmpstr
937 character(len=400) :: mesg
938 integer :: isd, ied, jsd, jed, isdb, iedb, jsdb, jedb, nz
940 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed ; nz = g%ke
941 isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
943 if (
associated(cs))
then
944 call mom_error(warning,
"CoriolisAdv_init called with associated control structure.")
949 cs%diag => diag ; cs%Time => time
953 call get_param(param_file, mdl,
"NOSLIP", cs%no_slip, &
954 "If true, no slip boundary conditions are used; otherwise "//&
955 "free slip boundary conditions are assumed. The "//&
956 "implementation of the free slip BCs on a C-grid is much "//&
957 "cleaner than the no slip BCs. The use of free slip BCs "//&
958 "is strongly encouraged, and no slip BCs are not used with "//&
959 "the biharmonic viscosity.", default=.false.)
961 call get_param(param_file, mdl,
"CORIOLIS_EN_DIS", cs%Coriolis_En_Dis, &
962 "If true, two estimates of the thickness fluxes are used "//&
963 "to estimate the Coriolis term, and the one that "//&
964 "dissipates energy relative to the other one is used.", &
969 call get_param(param_file, mdl,
"CORIOLIS_SCHEME", tmpstr, &
970 "CORIOLIS_SCHEME selects the discretization for the "//&
971 "Coriolis terms. Valid values are: \n"//&
972 "\t SADOURNY75_ENERGY - Sadourny, 1975; energy cons. \n"//&
973 "\t ARAKAWA_HSU90 - Arakawa & Hsu, 1990 \n"//&
974 "\t SADOURNY75_ENSTRO - Sadourny, 1975; enstrophy cons. \n"//&
975 "\t ARAKAWA_LAMB81 - Arakawa & Lamb, 1981; En. + Enst.\n"//&
976 "\t ARAKAWA_LAMB_BLEND - A blend of Arakawa & Lamb with \n"//&
977 "\t Arakawa & Hsu and Sadourny energy", &
978 default=sadourny75_energy_string)
979 tmpstr = uppercase(tmpstr)
981 case (sadourny75_energy_string)
982 cs%Coriolis_Scheme = sadourny75_energy
983 case (arakawa_hsu_string)
984 cs%Coriolis_Scheme = arakawa_hsu90
985 case (sadourny75_enstro_string)
986 cs%Coriolis_Scheme = sadourny75_enstro
987 case (arakawa_lamb_string)
988 cs%Coriolis_Scheme = arakawa_lamb81
989 case (al_blend_string)
990 cs%Coriolis_Scheme = al_blend
991 case (robust_enstro_string)
992 cs%Coriolis_Scheme = robust_enstro
993 cs%Coriolis_En_Dis = .false.
995 call mom_mesg(
'CoriolisAdv_init: Coriolis_Scheme ="'//trim(tmpstr)//
'"', 0)
996 call mom_error(fatal,
"CoriolisAdv_init: Unrecognized setting "// &
997 "#define CORIOLIS_SCHEME "//trim(tmpstr)//
" found in input file.")
999 if (cs%Coriolis_Scheme == al_blend)
then
1000 call get_param(param_file, mdl,
"CORIOLIS_BLEND_WT_LIN", cs%wt_lin_blend, &
1001 "A weighting value for the ratio of inverse thicknesses, "//&
1002 "beyond which the blending between Sadourny Energy and "//&
1003 "Arakawa & Hsu goes linearly to 0 when CORIOLIS_SCHEME "//&
1004 "is ARAWAKA_LAMB_BLEND. This must be between 1 and 1e-16.", &
1005 units=
"nondim", default=0.125)
1006 call get_param(param_file, mdl,
"CORIOLIS_BLEND_F_EFF_MAX", cs%F_eff_max_blend, &
1007 "The factor by which the maximum effective Coriolis "//&
1008 "acceleration from any point can be increased when "//&
1009 "blending different discretizations with the "//&
1010 "ARAKAWA_LAMB_BLEND Coriolis scheme. This must be "//&
1011 "greater than 2.0 (the max value for Sadourny energy).", &
1012 units=
"nondim", default=4.0)
1013 cs%wt_lin_blend = min(1.0, max(cs%wt_lin_blend,1e-16))
1014 if (cs%F_eff_max_blend < 2.0)
call mom_error(warning,
"CoriolisAdv_init: "//&
1015 "CORIOLIS_BLEND_F_EFF_MAX should be at least 2.")
1018 mesg =
"If true, the Coriolis terms at u-points are bounded by "//&
1019 "the four estimates of (f+rv)v from the four neighboring "//&
1020 "v-points, and similarly at v-points."
1021 if (cs%Coriolis_En_Dis .and. (cs%Coriolis_Scheme == sadourny75_energy))
then
1022 mesg = trim(mesg)//
" This option is "//&
1023 "always effectively false with CORIOLIS_EN_DIS defined and "//&
1024 "CORIOLIS_SCHEME set to "//trim(sadourny75_energy_string)//
"."
1026 mesg = trim(mesg)//
" This option would "//&
1027 "have no effect on the SADOURNY Coriolis scheme if it "//&
1028 "were possible to use centered difference thickness fluxes."
1030 call get_param(param_file, mdl,
"BOUND_CORIOLIS", cs%bound_Coriolis, mesg, &
1032 if ((cs%Coriolis_En_Dis .and. (cs%Coriolis_Scheme == sadourny75_energy)) .or. &
1033 (cs%Coriolis_Scheme == robust_enstro)) cs%bound_Coriolis = .false.
1036 call get_param(param_file, mdl,
"KE_SCHEME", tmpstr, &
1037 "KE_SCHEME selects the discretization for acceleration "//&
1038 "due to the kinetic energy gradient. Valid values are: \n"//&
1039 "\t KE_ARAKAWA, KE_SIMPLE_GUDONOV, KE_GUDONOV", &
1040 default=ke_arakawa_string)
1041 tmpstr = uppercase(tmpstr)
1042 select case (tmpstr)
1043 case (ke_arakawa_string); cs%KE_Scheme = ke_arakawa
1044 case (ke_simple_gudonov_string); cs%KE_Scheme = ke_simple_gudonov
1045 case (ke_gudonov_string); cs%KE_Scheme = ke_gudonov
1047 call mom_mesg(
'CoriolisAdv_init: KE_Scheme ="'//trim(tmpstr)//
'"', 0)
1048 call mom_error(fatal,
"CoriolisAdv_init: "// &
1049 "#define KE_SCHEME "//trim(tmpstr)//
" in input file is invalid.")
1053 call get_param(param_file, mdl,
"PV_ADV_SCHEME", tmpstr, &
1054 "PV_ADV_SCHEME selects the discretization for PV "//&
1055 "advection. Valid values are: \n"//&
1056 "\t PV_ADV_CENTERED - centered (aka Sadourny, 75) \n"//&
1057 "\t PV_ADV_UPWIND1 - upwind, first order", &
1058 default=pv_adv_centered_string)
1059 select case (uppercase(tmpstr))
1060 case (pv_adv_centered_string)
1061 cs%PV_Adv_Scheme = pv_adv_centered
1062 case (pv_adv_upwind1_string)
1063 cs%PV_Adv_Scheme = pv_adv_upwind1
1065 call mom_mesg(
'CoriolisAdv_init: PV_Adv_Scheme ="'//trim(tmpstr)//
'"', 0)
1066 call mom_error(fatal,
"CoriolisAdv_init: "// &
1067 "#DEFINE PV_ADV_SCHEME in input file is invalid.")
1070 cs%id_rv = register_diag_field(
'ocean_model',
'RV', diag%axesBL, time, &
1071 'Relative Vorticity',
's-1')
1073 cs%id_PV = register_diag_field(
'ocean_model',
'PV', diag%axesBL, time, &
1074 'Potential Vorticity',
'm-1 s-1')
1076 cs%id_gKEu = register_diag_field(
'ocean_model',
'gKEu', diag%axesCuL, time, &
1077 'Zonal Acceleration from Grad. Kinetic Energy',
'm-1 s-2')
1078 if (cs%id_gKEu > 0)
call safe_alloc_ptr(ad%gradKEu,isdb,iedb,jsd,jed,nz)
1080 cs%id_gKEv = register_diag_field(
'ocean_model',
'gKEv', diag%axesCvL, time, &
1081 'Meridional Acceleration from Grad. Kinetic Energy',
'm-1 s-2')
1082 if (cs%id_gKEv > 0)
call safe_alloc_ptr(ad%gradKEv,isd,ied,jsdb,jedb,nz)
1084 cs%id_rvxu = register_diag_field(
'ocean_model',
'rvxu', diag%axesCvL, time, &
1085 'Meridional Acceleration from Relative Vorticity',
'm-1 s-2')
1086 if (cs%id_rvxu > 0)
call safe_alloc_ptr(ad%rv_x_u,isd,ied,jsdb,jedb,nz)
1088 cs%id_rvxv = register_diag_field(
'ocean_model',
'rvxv', diag%axesCuL, time, &
1089 'Zonal Acceleration from Relative Vorticity',
'm-1 s-2')
1090 if (cs%id_rvxv > 0)
call safe_alloc_ptr(ad%rv_x_v,isdb,iedb,jsd,jed,nz)
1092 end subroutine coriolisadv_init
1095 subroutine coriolisadv_end(CS)
1098 end subroutine coriolisadv_end