24 real(kind_real),
allocatable,
dimension(:,:,:) :: akq, bkq, ckq
25 real(kind_real),
allocatable,
dimension(:,:,:) :: aks, bks, cks
26 real(kind_real),
allocatable,
dimension(:,:,:) :: akv, bkv, ckv
27 real(kind_real),
allocatable,
dimension(:,:,:) :: pk
28 logical ::
set = .false.
33 real(kind_real),
dimension(22) :: turbparams
34 integer,
dimension(4) :: turbparamsi
56 subroutine create(self,conf)
60 class(fv3jedi_lm_turbulence_type),
target,
intent(inout) :: self
61 type(fv3jedi_lm_conf),
intent(in) :: conf
63 real(kind_real),
allocatable,
dimension(:) :: pref
66 if (
conf%saveltraj)
then 67 allocate(self%ltraj(
conf%nt))
72 allocate(self%ltraj(1))
76 allocate(pref(0:
conf%lm))
82 self%lcnst%TurbParams(1) = 5.0_kind_real
83 self%lcnst%TurbParams(2) = 160.0_kind_real
84 self%lcnst%TurbParams(3) = 1.0_kind_real
85 self%lcnst%TurbParams(4) = 160.0_kind_real
86 self%lcnst%TurbParams(5) = 1.0_kind_real
87 self%lcnst%TurbParams(6) = 3000.0_kind_real
88 self%lcnst%TurbParams(7) = 3000.0_kind_real
89 self%lcnst%TurbParams(8) = 0.1_kind_real
90 self%lcnst%TurbParams(9) = 0.0030_kind_real
91 self%lcnst%TurbParams(10) = 2.5101471e-8_kind_real
92 self%lcnst%TurbParams(11) = 1500.0_kind_real
93 self%lcnst%TurbParams(12) = 500.0_kind_real
94 self%lcnst%TurbParams(13) = 1.0_kind_real
95 self%lcnst%TurbParams(14) = 0.75_kind_real
96 self%lcnst%TurbParams(15) = 0.50_kind_real
97 self%lcnst%TurbParams(16) = 0.25_kind_real
98 self%lcnst%TurbParams(17) = 0.85_kind_real
99 self%lcnst%TurbParams(18) = 0.45_kind_real
100 self%lcnst%TurbParams(19) = 20.0_kind_real
101 self%lcnst%TurbParams(20) = 1.5e-3_kind_real
102 self%lcnst%TurbParams(21) = 0.5_kind_real
103 self%lcnst%TurbParams(22) = -999.0_kind_real
104 self%lcnst%TurbParamsI(1) = count(pref < 50000.0_kind_real)
105 self%lcnst%TurbParamsI(2) = 1
106 self%lcnst%TurbParamsI(3) = 1
107 self%lcnst%TurbParamsI(4) = 0
115 subroutine init_nl(self,pert,traj)
119 class(fv3jedi_lm_turbulence_type),
intent(inout) :: self
120 type(fv3jedi_lm_pert),
intent(inout) :: pert
121 type(fv3jedi_lm_traj),
intent(in) :: traj
127 subroutine init_tl(self,pert,traj)
131 class(fv3jedi_lm_turbulence_type),
intent(inout) :: self
132 type(fv3jedi_lm_pert),
intent(inout) :: pert
133 type(fv3jedi_lm_traj),
intent(in) :: traj
139 subroutine init_ad(self,pert,traj)
143 class(fv3jedi_lm_turbulence_type),
intent(inout) :: self
144 type(fv3jedi_lm_pert),
intent(inout) :: pert
145 type(fv3jedi_lm_traj),
intent(in) :: traj
151 subroutine step_nl(self,conf,traj)
155 class(fv3jedi_lm_turbulence_type),
target,
intent(inout) :: self
156 type(fv3jedi_lm_traj),
target,
intent(inout) :: traj
157 type(fv3jedi_lm_conf),
intent(in) :: conf
159 type(local_traj_turbulence),
pointer :: ltraj
160 real(kind_real),
pointer,
dimension(:,:,:) :: p_u
161 real(kind_real),
pointer,
dimension(:,:,:) :: p_v
162 real(kind_real),
pointer,
dimension(:,:,:) :: p_t
163 real(kind_real),
pointer,
dimension(:,:,:) :: p_delp
164 real(kind_real),
pointer,
dimension(:,:,:) :: p_qv
165 real(kind_real),
pointer,
dimension(:,:,:) :: p_qi
166 real(kind_real),
pointer,
dimension(:,:,:) :: p_ql
167 real(kind_real),
pointer,
dimension(:,:,:) :: p_o3
180 if (
conf%saveltraj)
then 181 ltraj => self%ltraj(
conf%n)
183 ltraj => self%ltraj(1)
187 if (.not. ltraj%set)
call set_ltraj(
conf,self%lcnst,traj,ltraj)
218 subroutine step_tl(self,conf,traj,pert)
222 class(fv3jedi_lm_turbulence_type),
target,
intent(inout) :: self
223 type(fv3jedi_lm_conf),
intent(in) :: conf
224 type(fv3jedi_lm_traj),
intent(in) :: traj
225 type(fv3jedi_lm_pert),
target,
intent(inout) :: pert
227 type(local_traj_turbulence),
pointer :: ltraj
228 real(kind_real),
pointer,
dimension(:,:,:) :: p_u
229 real(kind_real),
pointer,
dimension(:,:,:) :: p_v
230 real(kind_real),
pointer,
dimension(:,:,:) :: p_t
231 real(kind_real),
pointer,
dimension(:,:,:) :: p_delp
232 real(kind_real),
pointer,
dimension(:,:,:) :: p_qv
233 real(kind_real),
pointer,
dimension(:,:,:) :: p_qi
234 real(kind_real),
pointer,
dimension(:,:,:) :: p_ql
235 real(kind_real),
pointer,
dimension(:,:,:) :: p_o3
248 if (
conf%saveltraj)
then 249 ltraj => self%ltraj(
conf%n)
251 ltraj => self%ltraj(1)
255 if (.not. ltraj%set)
call set_ltraj(
conf,self%lcnst,traj,ltraj)
286 subroutine step_ad(self,conf,traj,pert)
290 class(fv3jedi_lm_turbulence_type),
target,
intent(inout) :: self
291 type(fv3jedi_lm_conf),
intent(in) :: conf
292 type(fv3jedi_lm_traj),
intent(in) :: traj
293 type(fv3jedi_lm_pert),
target,
intent(inout) :: pert
295 type(local_traj_turbulence),
pointer :: ltraj
296 real(kind_real),
pointer,
dimension(:,:,:) :: p_u
297 real(kind_real),
pointer,
dimension(:,:,:) :: p_v
298 real(kind_real),
pointer,
dimension(:,:,:) :: p_t
299 real(kind_real),
pointer,
dimension(:,:,:) :: p_delp
300 real(kind_real),
pointer,
dimension(:,:,:) :: p_qv
301 real(kind_real),
pointer,
dimension(:,:,:) :: p_qi
302 real(kind_real),
pointer,
dimension(:,:,:) :: p_ql
303 real(kind_real),
pointer,
dimension(:,:,:) :: p_o3
316 if (
conf%saveltraj)
then 317 ltraj => self%ltraj(
conf%n)
319 ltraj => self%ltraj(1)
323 if (.not. ltraj%set)
call set_ltraj(
conf,self%lcnst,traj,ltraj)
354 subroutine delete(self,conf)
357 class(fv3jedi_lm_turbulence_type),
intent(inout) :: self
358 type(fv3jedi_lm_conf),
intent(in) :: conf
362 if (
conf%saveltraj)
then 370 deallocate(self%ltraj)
376 subroutine set_ltraj(conf,lcnst,traj,ltraj)
378 type(fv3jedi_lm_conf),
intent(in) :: conf
379 type(local_cnst_turbulence),
intent(in) :: lcnst
380 type(fv3jedi_lm_traj),
target,
intent(in) :: traj
381 type(local_traj_turbulence),
intent(inout) :: ltraj
383 integer :: i,j,l,im,jm,lm,isc,iec,jsc,jec
385 real(kind_real),
allocatable,
dimension(:,:,:) :: PTT1
386 real(kind_real),
allocatable,
dimension(:,:) :: ZPBL1, CT1
387 real(kind_real),
allocatable,
dimension(:,:,:) :: EKV, FKV
388 real(kind_real),
allocatable,
dimension(:,:,:) :: pet, pmt
389 real(kind_real),
allocatable,
dimension(:,:,:) :: QIT1, QLT1
390 real(kind_real),
allocatable,
dimension(:,:,:) :: fQi
392 real(kind_real),
pointer,
dimension(:,:,:) :: p_u
393 real(kind_real),
pointer,
dimension(:,:,:) :: p_v
394 real(kind_real),
pointer,
dimension(:,:,:) :: p_t
395 real(kind_real),
pointer,
dimension(:,:,:) :: p_delp
396 real(kind_real),
pointer,
dimension(:,:,:) :: p_qv
397 real(kind_real),
pointer,
dimension(:,:) :: p_frland
398 real(kind_real),
pointer,
dimension(:,:) :: p_frocean
399 real(kind_real),
pointer,
dimension(:,:) :: p_varflt
400 real(kind_real),
pointer,
dimension(:,:) :: p_cm
401 real(kind_real),
pointer,
dimension(:,:) :: p_cq
402 real(kind_real),
pointer,
dimension(:,:) :: p_ustar
403 real(kind_real),
pointer,
dimension(:,:) :: p_bstar
414 allocate(ptt1(1:im,1:jm,1:lm))
415 allocate(ekv(1:im,1:jm,1:lm))
416 allocate(fkv(1:im,1:jm,1:lm))
417 allocate(pet(1:im,1:jm,0:lm))
418 allocate(pmt(1:im,1:jm,1:lm))
419 allocate(qit1(1:im,1:jm,1:lm))
420 allocate(qlt1(1:im,1:jm,1:lm))
421 allocate(fqi(1:im,1:jm,1:lm))
422 allocate(zpbl1(1:im,1:jm))
423 allocate(ct1(1:im,1:jm))
425 p_u(1:im,1:jm,1:lm) => traj%u
426 p_v(1:im,1:jm,1:lm) => traj%v
427 p_t(1:im,1:jm,1:lm) => traj%t
428 p_delp(1:im,1:jm,1:lm) => traj%delp
429 p_qv(1:im,1:jm,1:lm) => traj%qv
430 p_frland(1:im,1:jm) => traj%FRLAND
431 p_frocean(1:im,1:jm) => traj%FROCEAN
432 p_varflt(1:im,1:jm) => traj%VARFLT
433 p_cm(1:im,1:jm) => traj%CM
434 p_cq(1:im,1:jm) => traj%CQ
435 p_ustar(1:im,1:jm) => traj%USTAR
436 p_bstar(1:im,1:jm) => traj%BSTAR
442 zpbl1(1:im,1:jm) = traj%ZPBL(isc:iec,jsc:jec)
443 ct1(1:im,1:jm) = traj%CT (isc:iec,jsc:jec)
448 if (
conf%do_phy_mst == 0)
then 450 qit1(1:im,1:jm,:) = traj%QI(isc:iec,jsc:jec,:)
451 qlt1(1:im,1:jm,:) = traj%QL(isc:iec,jsc:jec,:)
463 qit1(1:im,1:jm,:) = (traj%QLS(isc:iec,jsc:jec,:) + traj%QCN(isc:iec,jsc:jec,:)) * fqi(1:im,1:jm,:)
464 qlt1(1:im,1:jm,:) = (traj%QLS(isc:iec,jsc:jec,:) + traj%QCN(isc:iec,jsc:jec,:)) * (1-fqi(1:im,1:jm,:))
501 lcnst%TURBPARAMSI , &
504 ltraj%AKS, ltraj%BKS, ltraj%CKS, &
505 ltraj%AKQ, ltraj%BKQ, ltraj%CKQ, &
506 ltraj%AKV, ltraj%BKV, ltraj%CKV, &
510 call vtrilupert(im,jm,lm,ltraj%AKV,ltraj%BKV,ltraj%CKV)
511 call vtrilupert(im,jm,lm,ltraj%AKS,ltraj%BKS,ltraj%CKS)
512 call vtrilupert(im,jm,lm,ltraj%AKQ,ltraj%BKQ,ltraj%CKQ)
538 if (
conf%saveltraj) ltraj%set = .true.
546 integer,
intent(in) :: im,jm,lm
547 type(local_traj_turbulence),
intent(inout) :: ltraj
549 allocate(ltraj%pk(im,jm,lm))
550 allocate(ltraj%akv(im,jm,lm))
551 allocate(ltraj%bkv(im,jm,lm))
552 allocate(ltraj%ckv(im,jm,lm))
553 allocate(ltraj%aks(im,jm,lm))
554 allocate(ltraj%bks(im,jm,lm))
555 allocate(ltraj%cks(im,jm,lm))
556 allocate(ltraj%akq(im,jm,lm))
557 allocate(ltraj%bkq(im,jm,lm))
558 allocate(ltraj%ckq(im,jm,lm))
566 type(local_traj_turbulence),
intent(inout) :: ltraj
568 deallocate(ltraj%pk )
569 deallocate(ltraj%akv)
570 deallocate(ltraj%bkv)
571 deallocate(ltraj%ckv)
572 deallocate(ltraj%aks)
573 deallocate(ltraj%bks)
574 deallocate(ltraj%cks)
575 deallocate(ltraj%akq)
576 deallocate(ltraj%bkq)
577 deallocate(ltraj%ckq)
589 integer,
intent(in ) :: im, jm, lm
590 real(kind_real),
dimension(im,jm,lm),
intent(in ) :: c
591 real(kind_real),
dimension(im,jm,lm),
intent(inout) :: a, b
595 b(:,:,1) = 1. / b(:,:,1)
597 a(:,:,l) = a(:,:,l) * b(:,:,l-1)
598 b(:,:,l) = 1. / ( b(:,:,l) - c(:,:,l-1) * a(:,:,l) )
612 integer,
intent(in ) :: im, jm, lm, phase, ygswitch
613 real(kind_real),
dimension(im,jm,lm),
intent(in ) :: a, b, c
614 real(kind_real),
dimension(im,jm,lm),
intent(inout) :: y
625 y(:,:,l) = y(:,:,l) - a(:,:,l)*y(:,:,l-1)
629 if (ygswitch == 1)
then 630 y(:,:,lm) = y(:,:,lm)*b(:,:,lm)
632 y(:,:,lm) = y(:,:,lm)*b(:,:,lm-1)/(b(:,:,lm-1) - a(:,:,lm)*(1.0+c(:,:,lm-1)*b(:,:,lm-1) ))
636 y(:,:,l) = b(:,:,l)*(y(:,:,l)-c(:,:,l)*y(:,:,l+1) )
639 elseif (phase == 2)
then 641 if (ygswitch == 1)
then 644 y(:,:,1) = y(:,:,1)*b(:,:,1)
646 y(:,:,l) = b(:,:,l) * (y(:,:,l) - c(:,:,l-1)*y(:,:,l-1))
651 y(:,:,l) = y(:,:,l) - a(:,:,l+1)*y(:,:,l+1)
658 y(:,:,l+1) = y(:,:,l+1) - c(:,:,l)*b(:,:,l)*y(:,:,l)
659 y(:,:,l) = b(:,:,l)*y(:,:,l)
663 y(:,:,lm) = b(:,:,lm-1)*y(:,:,lm)/(b(:,:,lm-1)-a(:,:,lm)*(c(:,:,lm-1)*b(:,:,lm-1)+1.0))
667 y(:,:,l-1) = y(:,:,l-1) - a(:,:,l)*y(:,:,l)
subroutine allocate_ltraj(im, jm, lm, ltraj)
subroutine vtrilupert(im, jm, lm, a, b, c)
integer, parameter, public set
real(kind=kind_real), parameter, public p00
Compute ice fraction from temperature.
subroutine step_nl(self, conf, traj)
Compute pressures from delp.
type(cp_iter_controls_type), target, public cp_iter_controls
subroutine, public bl_driver(IM, JM, LM, DT, U, V, TH, Q, P, QIT, QLT, FRLAND, FROCEAN, VARFLT, ZPBL, CM, CT, CQ, TURBPARAMS, TURBPARAMSI, USTAR, BSTAR, AKS, BKS, CKS, AKQ, BKQ, CKQ, AKV, BKV, CKV, EKV, FKV)
subroutine, public cp_mod_ini(cp_mod_index)
subroutine, public cp_mod_mid
subroutine step_tl(self, conf, traj, pert)
subroutine init_tl(self, pert, traj)
subroutine, public cp_mod_end
subroutine set_ltraj(conf, lcnst, traj, ltraj)
subroutine, public delete(self)
subroutine init_ad(self, pert, traj)
type(cp_iter_type), dimension(:), allocatable, target, public cp_iter
subroutine, public finalize_cp_iter
subroutine deallocate_ltraj(ltraj)
subroutine step_ad(self, conf, traj, pert)
subroutine init_nl(self, pert, traj)
subroutine, public initialize_cp_iter
subroutine, public create(self, geom, vars)
real(kind=kind_real), parameter, public kappa
Constants for the FV3 model.
subroutine vtrisolvepert(im, jm, lm, a, b, c, y, phase, ygswitch)