52 type(c_ptr),
intent(in) :: c_conf
55 character(len=20) :: ststep
56 type(duration) :: dtstep
57 real(kind=kind_real) :: dt
62 ststep = config_get_string(c_conf,len(ststep),
"tstep")
64 dt =
real(duration_seconds(dtstep),
kind_real)
69 self%fv3jedi_lm%conf%do_dyn = config_get_int(c_conf,
"lm_do_dyn")
70 self%fv3jedi_lm%conf%do_phy_trb = config_get_int(c_conf,
"lm_do_trb")
71 self%fv3jedi_lm%conf%do_phy_mst = config_get_int(c_conf,
"lm_do_mst")
73 call self%fv3jedi_lm%create(dt,geom%npx,geom%npy,geom%npz,geom%ptop,geom%ak,geom%bk)
75 self%fsoi_mode = .false.
76 if (config_element_exists(c_conf,
"fsoi_mode"))
then 77 tmp = config_get_int(c_conf,
"fsoi_mode")
78 if (tmp==1) self%fsoi_mode = .true.
92 call self%fv3jedi_lm%delete()
105 call self%fv3jedi_lm%init_ad()
118 if (self%fsoi_mode)
call incr_to_lm_tl(geom,incr,self%fv3jedi_lm)
120 call self%fv3jedi_lm%init_tl()
132 type(fv3jedi_traj),
intent(in) :: traj
136 if (.not. self%fsoi_mode)
call lm_to_incr_ad(geom,self%fv3jedi_lm,incr)
137 call self%fv3jedi_lm%step_ad()
150 type(fv3jedi_traj),
intent(in) :: traj
154 if (.not. self%fsoi_mode)
call incr_to_lm_tl(geom,incr,self%fv3jedi_lm)
155 call self%fv3jedi_lm%step_tl()
169 call self%fv3jedi_lm%final_ad()
170 if (.not. self%fsoi_mode)
call lm_to_incr_ad(geom,self%fv3jedi_lm,incr)
183 call self%fv3jedi_lm%final_tl()
194 type(fv3jedi_geom),
intent(inout) :: geom
195 type(fv3jedi_increment),
intent(in) :: incr
196 type(fv3jedi_lm_type),
intent(inout) :: lm
199 real(kind=kind_real),
allocatable,
dimension(:,:,:) :: ud,vd
201 allocate(ud(incr%isc:incr%iec ,incr%jsc:incr%jec+1,1:incr%npz))
202 allocate(vd(incr%isc:incr%iec+1,incr%jsc:incr%jec ,1:incr%npz))
206 call a2d(geom, incr%ua(incr%isc:incr%iec,incr%jsc:incr%jec,:), &
207 incr%va(incr%isc:incr%iec,incr%jsc:incr%jec,:), &
208 ud(incr%isc:incr%iec ,incr%jsc:incr%jec+1,:), &
209 vd(incr%isc:incr%iec+1,incr%jsc:incr%jec ,:))
211 lm%pert%u = ud(incr%isc:incr%iec,incr%jsc:incr%jec,:)
212 lm%pert%v = vd(incr%isc:incr%iec,incr%jsc:incr%jec,:)
217 lm%pert%delp(:,:,k) = (geom%bk(k+1)-geom%bk(k))*incr%ps(:,:)
224 if (.not. incr%hydrostatic)
then 225 lm%pert%delz = incr%delz
240 type(fv3jedi_geom),
intent(inout) :: geom
241 type(fv3jedi_increment),
intent(inout) :: incr
242 type(fv3jedi_lm_type),
intent(in) :: lm
244 real(kind=kind_real),
allocatable,
dimension(:,:,:) :: ua,va,ud,vd
246 allocate(ud(incr%isd:incr%ied ,incr%jsd:incr%jed+1,1:incr%npz))
247 allocate(vd(incr%isd:incr%ied+1,incr%jsd:incr%jed ,1:incr%npz))
251 allocate(ua(incr%isd:incr%ied ,incr%jsd:incr%jed ,1:incr%npz))
252 allocate(va(incr%isd:incr%ied ,incr%jsd:incr%jed ,1:incr%npz))
256 ud(incr%isc:incr%iec,incr%jsc:incr%jec,:) = lm%pert%u
257 vd(incr%isc:incr%iec,incr%jsc:incr%jec,:) = lm%pert%v
259 call d2a(geom, ud, vd, ua, va)
261 incr%ua = ua(incr%isc:incr%iec,incr%jsc:incr%jec,:)
262 incr%va = va(incr%isc:incr%iec,incr%jsc:incr%jec,:)
264 incr%ps = sum(lm%pert%delp,3)
269 if (.not. incr%hydrostatic)
then 270 incr%delz = lm%pert%delz
274 deallocate(ud,vd,ua,va)
285 type(fv3jedi_geom),
intent(inout) :: geom
286 type(fv3jedi_increment),
intent(in) :: incr
287 type(fv3jedi_lm_type),
intent(inout) :: lm
290 real(kind=kind_real),
allocatable,
dimension(:,:,:) :: ua,va,ud,vd
292 allocate(ud(incr%isd:incr%ied ,incr%jsd:incr%jed+1,1:incr%npz))
293 allocate(vd(incr%isd:incr%ied+1,incr%jsd:incr%jed ,1:incr%npz))
297 allocate(ua(incr%isd:incr%ied ,incr%jsd:incr%jed ,1:incr%npz))
298 allocate(va(incr%isd:incr%ied ,incr%jsd:incr%jed ,1:incr%npz))
302 ua(incr%isc:incr%iec,incr%jsc:incr%jec,:) = incr%ua
303 va(incr%isc:incr%iec,incr%jsc:incr%jec,:) = incr%va
307 lm%pert%delp(:,:,k) = incr%ps(:,:)
313 if (.not. incr%hydrostatic)
then 314 lm%pert%delz = incr%delz
318 call d2a_ad(geom, ud, vd, ua, va)
320 lm%pert%u = ud(incr%isc:incr%iec,incr%jsc:incr%jec,:)
321 lm%pert%v = vd(incr%isc:incr%iec,incr%jsc:incr%jec,:)
323 lm%pert%ua(incr%isc:incr%iec,incr%jsc:incr%jec,:) = 0.0
324 lm%pert%va(incr%isc:incr%iec,incr%jsc:incr%jec,:) = 0.0
326 deallocate(ud,vd,ua,va)
337 type(fv3jedi_geom),
intent(inout) :: geom
338 type(fv3jedi_increment),
intent(inout) :: incr
339 type(fv3jedi_lm_type),
intent(in) :: lm
342 real(kind=kind_real),
allocatable,
dimension(:,:,:) :: ud,vd
344 allocate(ud(incr%isc:incr%iec ,incr%jsc:incr%jec+1,1:incr%npz))
345 allocate(vd(incr%isc:incr%iec+1,incr%jsc:incr%jec ,1:incr%npz))
357 if (.not. incr%hydrostatic)
then 362 ud(incr%isc:incr%iec,incr%jsc:incr%jec,:) = lm%pert%u
363 vd(incr%isc:incr%iec,incr%jsc:incr%jec,:) = lm%pert%v
365 incr%ps = 0.0_kind_real
367 incr%ps(:,:) = incr%ps(:,:) + (geom%bk(k+1)-geom%bk(k))*lm%pert%delp(:,:,k)
373 if (.not. incr%hydrostatic)
then 374 incr%delz = lm%pert%delz
379 call a2d_ad(geom, incr%ua, incr%va, ud, vd)
390 type(fv3jedi_traj),
intent(in) :: traj
391 type(fv3jedi_lm_type),
intent(inout) :: lm
398 lm%traj%delp = traj%delp
404 if (.not. lm%conf%hydrostatic)
then 406 lm%traj%delz = traj%delz
409 if (lm%conf%do_phy_mst .ne. 0)
then 410 lm%traj%qls = traj%qls
411 lm%traj%qcn = traj%qcn
412 lm%traj%cfcn = traj%cfcn
416 lm%traj%phis = traj%phis
417 lm%traj%frocean = traj%frocean
418 lm%traj%frland = traj%frland
419 lm%traj%varflt = traj%varflt
420 lm%traj%ustar = traj%ustar
421 lm%traj%bstar = traj%bstar
422 lm%traj%zpbl = traj%zpbl
426 lm%traj%kcbl = traj%kcbl
428 lm%traj%khl = traj%khl
429 lm%traj%khu = traj%khu
subroutine lm_to_incr_tl(geom, lm, incr)
Fortran derived type to hold FV3JEDI increment.
Top level for fv3jedi linearized model.
Fortran derived type to hold tlm definition.
Fortran derived type to hold FV3JEDI state.
subroutine traj_to_traj(traj, lm)
subroutine, public tlm_step_tl(geom, self, incr, traj)
subroutine, public tlm_finalize_ad(geom, self, incr)
subroutine, public tlm_delete(self)
subroutine, public tlm_initialize_ad(geom, self, incr)
subroutine, public d2a(geom, u, v, ua, va)
Fortran derived type to hold geometry data for the FV3JEDI model.
subroutine, public a2d_ad(geom, ua_ad, va_ad, ud_ad, vd_ad)
subroutine, public tlm_finalize_tl(geom, self, incr)
subroutine, public tlm_step_ad(geom, self, incr, traj)
subroutine incr_to_lm_tl(geom, incr, lm)
Handle state for the FV3JEDI odel.
subroutine, public tlm_create(self, geom, c_conf)
subroutine incr_to_lm_ad(geom, incr, lm)
subroutine, public tlm_initialize_tl(geom, self, incr)
subroutine, public a2d(geom, ua, va, ud, vd)
Handle increment for the FV3JEDI model.
Variable transforms on wind variables for fv3-jedi Daniel Holdaway, NASA/JCSDA.
Fortran module handling geometry for the FV3 model.
subroutine lm_to_incr_ad(geom, lm, incr)
subroutine, public d2a_ad(geom, u_ad, v_ad, ua_ad, va_ad)
integer, parameter, public kind_real