41 subroutine create(self, geom, vars)
51 self%vars%nv = vars%nv
52 allocate(self%vars%fldnames(self%vars%nv))
53 self%vars%fldnames = vars%fldnames
56 do var = 1, self%vars%nv
58 select case (trim(self%vars%fldnames(var)))
61 if (.not.
allocated( self%ud))
allocate ( self%ud(geom%isc:geom%iec, geom%jsc:geom%jec+1, geom%npz))
63 if (.not.
allocated( self%vd))
allocate ( self%vd(geom%isc:geom%iec+1,geom%jsc:geom%jec , geom%npz))
65 if (.not.
allocated( self%ua))
allocate ( self%ua(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
67 if (.not.
allocated( self%va))
allocate ( self%va(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
69 if (.not.
allocated( self%t))
allocate ( self%t(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
71 if (.not.
allocated(self%delp))
allocate (self%delp(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
73 if (.not.
allocated( self%q))
allocate ( self%q(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
75 if (.not.
allocated( self%qi))
allocate ( self%qi(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
77 if (.not.
allocated( self%ql))
allocate ( self%ql(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
79 if (.not.
allocated( self%o3))
allocate ( self%o3(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
81 if (.not.
allocated( self%w))
allocate ( self%w(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
83 if (.not.
allocated(self%delz))
allocate (self%delz(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
86 call abor1_ftn(
"Create: unknown variable "//trim(self%vars%fldnames(var)))
92 self%hydrostatic = .true.
93 if (
allocated(self%w).and.
allocated(self%delz)) self%hydrostatic = .false.
95 if (.not.
allocated(self%phis))
allocate(self%phis(geom%isc:geom%iec,geom%jsc:geom%jec))
98 if (.not.
allocated(self%slmsk ))
allocate(self%slmsk (geom%isc:geom%iec,geom%jsc:geom%jec))
99 if (.not.
allocated(self%sheleg))
allocate(self%sheleg(geom%isc:geom%iec,geom%jsc:geom%jec))
100 if (.not.
allocated(self%tsea ))
allocate(self%tsea (geom%isc:geom%iec,geom%jsc:geom%jec))
101 if (.not.
allocated(self%vtype ))
allocate(self%vtype (geom%isc:geom%iec,geom%jsc:geom%jec))
102 if (.not.
allocated(self%stype ))
allocate(self%stype (geom%isc:geom%iec,geom%jsc:geom%jec))
103 if (.not.
allocated(self%vfrac ))
allocate(self%vfrac (geom%isc:geom%iec,geom%jsc:geom%jec))
104 if (.not.
allocated(self%stc ))
allocate(self%stc (geom%isc:geom%iec,geom%jsc:geom%jec,4))
105 if (.not.
allocated(self%smc ))
allocate(self%smc (geom%isc:geom%iec,geom%jsc:geom%jec,4))
106 if (.not.
allocated(self%snwdph))
allocate(self%snwdph(geom%isc:geom%iec,geom%jsc:geom%jec))
107 if (.not.
allocated(self%u_srf ))
allocate(self%u_srf (geom%isc:geom%iec,geom%jsc:geom%jec))
108 if (.not.
allocated(self%v_srf ))
allocate(self%v_srf (geom%isc:geom%iec,geom%jsc:geom%jec))
109 if (.not.
allocated(self%f10m ))
allocate(self%f10m (geom%isc:geom%iec,geom%jsc:geom%jec))
112 if (.not.
allocated(self%qls ))
allocate(self%qls (geom%isc:geom%iec,geom%jsc:geom%jec,geom%npz))
113 if (.not.
allocated(self%qcn ))
allocate(self%qcn (geom%isc:geom%iec,geom%jsc:geom%jec,geom%npz))
114 if (.not.
allocated(self%cfcn ))
allocate(self%cfcn (geom%isc:geom%iec,geom%jsc:geom%jec,geom%npz))
115 if (.not.
allocated(self%frocean))
allocate(self%frocean(geom%isc:geom%iec,geom%jsc:geom%jec))
116 if (.not.
allocated(self%frland ))
allocate(self%frland (geom%isc:geom%iec,geom%jsc:geom%jec))
117 if (.not.
allocated(self%varflt ))
allocate(self%varflt (geom%isc:geom%iec,geom%jsc:geom%jec))
118 if (.not.
allocated(self%ustar ))
allocate(self%ustar (geom%isc:geom%iec,geom%jsc:geom%jec))
119 if (.not.
allocated(self%bstar ))
allocate(self%bstar (geom%isc:geom%iec,geom%jsc:geom%jec))
120 if (.not.
allocated(self%zpbl ))
allocate(self%zpbl (geom%isc:geom%iec,geom%jsc:geom%jec))
121 if (.not.
allocated(self%cm ))
allocate(self%cm (geom%isc:geom%iec,geom%jsc:geom%jec))
122 if (.not.
allocated(self%ct ))
allocate(self%ct (geom%isc:geom%iec,geom%jsc:geom%jec))
123 if (.not.
allocated(self%cq ))
allocate(self%cq (geom%isc:geom%iec,geom%jsc:geom%jec))
124 if (.not.
allocated(self%kcbl ))
allocate(self%kcbl (geom%isc:geom%iec,geom%jsc:geom%jec))
125 if (.not.
allocated(self%ts ))
allocate(self%ts (geom%isc:geom%iec,geom%jsc:geom%jec))
126 if (.not.
allocated(self%khl ))
allocate(self%khl (geom%isc:geom%iec,geom%jsc:geom%jec))
127 if (.not.
allocated(self%khu ))
allocate(self%khu (geom%isc:geom%iec,geom%jsc:geom%jec))
131 self%phis = 0.0_kind_real
146 self%ntile = geom%ntile
147 self%ntiles = geom%ntiles
157 if (
allocated(self%ud ))
deallocate (self%ud )
158 if (
allocated(self%vd ))
deallocate (self%vd )
159 if (
allocated(self%ua ))
deallocate (self%ua )
160 if (
allocated(self%va ))
deallocate (self%va )
161 if (
allocated(self%t ))
deallocate (self%t )
162 if (
allocated(self%delp))
deallocate (self%delp)
163 if (
allocated(self%q ))
deallocate (self%q )
164 if (
allocated(self%qi ))
deallocate (self%qi )
165 if (
allocated(self%ql ))
deallocate (self%ql )
166 if (
allocated(self%o3 ))
deallocate (self%o3 )
167 if (
allocated(self%phis))
deallocate (self%phis)
168 if (
allocated(self%w ))
deallocate (self%w )
169 if (
allocated(self%delz))
deallocate (self%delz)
171 if (
allocated(self%slmsk ))
deallocate(self%slmsk )
172 if (
allocated(self%sheleg))
deallocate(self%sheleg)
173 if (
allocated(self%tsea ))
deallocate(self%tsea )
174 if (
allocated(self%vtype ))
deallocate(self%vtype )
175 if (
allocated(self%stype ))
deallocate(self%stype )
176 if (
allocated(self%vfrac ))
deallocate(self%vfrac )
177 if (
allocated(self%stc ))
deallocate(self%stc )
178 if (
allocated(self%smc ))
deallocate(self%smc )
179 if (
allocated(self%snwdph))
deallocate(self%snwdph)
180 if (
allocated(self%u_srf ))
deallocate(self%u_srf )
181 if (
allocated(self%v_srf ))
deallocate(self%v_srf )
182 if (
allocated(self%f10m ))
deallocate(self%f10m )
184 if (
allocated(self%qls ))
deallocate(self%qls )
185 if (
allocated(self%qcn ))
deallocate(self%qcn )
186 if (
allocated(self%cfcn ))
deallocate(self%cfcn )
187 if (
allocated(self%frocean))
deallocate(self%frocean)
188 if (
allocated(self%frland ))
deallocate(self%frland )
189 if (
allocated(self%varflt ))
deallocate(self%varflt )
190 if (
allocated(self%ustar ))
deallocate(self%ustar )
191 if (
allocated(self%bstar ))
deallocate(self%bstar )
192 if (
allocated(self%zpbl ))
deallocate(self%zpbl )
193 if (
allocated(self%cm ))
deallocate(self%cm )
194 if (
allocated(self%ct ))
deallocate(self%ct )
195 if (
allocated(self%cq ))
deallocate(self%cq )
196 if (
allocated(self%kcbl ))
deallocate(self%kcbl )
197 if (
allocated(self%ts ))
deallocate(self%ts )
198 if (
allocated(self%khl ))
deallocate(self%khl )
199 if (
allocated(self%khu ))
deallocate(self%khu )
205 subroutine zeros(self)
212 if(
allocated(self%ud )) self%ud = 0.0_kind_real
213 if(
allocated(self%vd )) self%vd = 0.0_kind_real
214 if(
allocated(self%ua )) self%ua = 0.0_kind_real
215 if(
allocated(self%va )) self%va = 0.0_kind_real
216 if(
allocated(self%t )) self%t = 0.0_kind_real
217 if(
allocated(self%delp)) self%delp = 0.0_kind_real
218 if(
allocated(self%q )) self%q = 0.0_kind_real
219 if(
allocated(self%qi )) self%qi = 0.0_kind_real
220 if(
allocated(self%ql )) self%ql = 0.0_kind_real
221 if(
allocated(self%o3 )) self%o3 = 0.0_kind_real
222 if(
allocated(self%w )) self%w = 0.0_kind_real
223 if(
allocated(self%delz)) self%delz = 0.0_kind_real
229 subroutine copy(self,rhs)
245 self%havecrtmfields = rhs%havecrtmfields
246 self%hydrostatic = rhs%hydrostatic
247 self%calendar_type = rhs%calendar_type
249 self%date_init = rhs%date_init
250 self%ntile = rhs%ntile
251 self%ntiles = rhs%ntiles
253 if(
allocated(self%ud ).and.
allocated(rhs%ud )) self%ud = rhs%ud
254 if(
allocated(self%vd ).and.
allocated(rhs%vd )) self%vd = rhs%vd
255 if(
allocated(self%ua ).and.
allocated(rhs%ua )) self%ua = rhs%ua
256 if(
allocated(self%va ).and.
allocated(rhs%va )) self%va = rhs%va
257 if(
allocated(self%t ).and.
allocated(rhs%t )) self%t = rhs%t
258 if(
allocated(self%delp).and.
allocated(rhs%delp)) self%delp = rhs%delp
259 if(
allocated(self%q ).and.
allocated(rhs%q )) self%q = rhs%q
260 if(
allocated(self%qi ).and.
allocated(rhs%qi )) self%qi = rhs%qi
261 if(
allocated(self%ql ).and.
allocated(rhs%ql )) self%ql = rhs%ql
262 if(
allocated(self%o3 ).and.
allocated(rhs%o3 )) self%o3 = rhs%o3
263 if(
allocated(self%w ).and.
allocated(rhs%w )) self%w = rhs%w
264 if(
allocated(self%delz).and.
allocated(rhs%delz)) self%delz = rhs%delz
267 self%slmsk = rhs%slmsk
268 self%sheleg = rhs%sheleg
270 self%vtype = rhs%vtype
271 self%stype = rhs%stype
272 self%vfrac = rhs%vfrac
275 self%snwdph = rhs%snwdph
276 self%u_srf = rhs%u_srf
277 self%v_srf = rhs%v_srf
283 self%frocean = rhs%frocean
284 self%frland = rhs%frland
285 self%varflt = rhs%varflt
286 self%ustar = rhs%ustar
287 self%bstar = rhs%bstar
302 subroutine axpy(self,zz,rhs)
305 real(kind=kind_real),
intent(in) :: zz
308 if(
allocated(self%ud ).and.
allocated(rhs%ud )) self%ud = self%ud + zz * rhs%ud
309 if(
allocated(self%vd ).and.
allocated(rhs%vd )) self%vd = self%vd + zz * rhs%vd
310 if(
allocated(self%ua ).and.
allocated(rhs%ua )) self%ua = self%ua + zz * rhs%ua
311 if(
allocated(self%va ).and.
allocated(rhs%va )) self%va = self%va + zz * rhs%va
312 if(
allocated(self%t ).and.
allocated(rhs%t )) self%t = self%t + zz * rhs%t
313 if(
allocated(self%delp).and.
allocated(rhs%delp)) self%delp = self%delp + zz * rhs%delp
314 if(
allocated(self%q ).and.
allocated(rhs%q )) self%q = self%q + zz * rhs%q
315 if(
allocated(self%qi ).and.
allocated(rhs%qi )) self%qi = self%qi + zz * rhs%qi
316 if(
allocated(self%ql ).and.
allocated(rhs%ql )) self%ql = self%ql + zz * rhs%ql
317 if(
allocated(self%o3 ).and.
allocated(rhs%o3 )) self%o3 = self%o3 + zz * rhs%o3
318 if(
allocated(self%w ).and.
allocated(rhs%w )) self%w = self%w + zz * rhs%w
319 if(
allocated(self%delz).and.
allocated(rhs%delz)) self%delz = self%delz + zz * rhs%delz
335 integer :: isc,iec,jsc,jec,isd,ied,jsd,jed,npz,k
337 real(kind=kind_real),
allocatable,
dimension(:,:,:) :: ud, vd
340 if ((rhs%iec-rhs%isc+1)-(self%iec-self%isc+1)==0)
then 353 allocate(ud(isc:iec ,jsc:jec+1,1:npz))
354 allocate(vd(isc:iec+1,jsc:jec ,1:npz))
358 call a2d(geom, rhs%ua(isc:iec,jsc:jec,1:npz), rhs%va(isc:iec,jsc:jec,1:npz), ud, vd)
360 if(
allocated(self%ud )) self%ud(isc:iec ,jsc:jec+1,:) = self%ud(isc:iec ,jsc:jec+1,:) + ud(isc:iec ,jsc:jec+1,:)
361 if(
allocated(self%vd )) self%vd(isc:iec+1,jsc:jec ,:) = self%vd(isc:iec+1,jsc:jec ,:) + vd(isc:iec+1,jsc:jec ,:)
365 if(
allocated(self%ua )) self%ua = self%ua + rhs%ua
366 if(
allocated(self%va )) self%va = self%va + rhs%va
367 if(
allocated(self%t )) self%t = self%t + rhs%t
368 if(
allocated(self%delp))
then 369 if (
allocated(rhs%ps))
then 371 self%delp(:,:,k) = self%delp(:,:,k) + (geom%bk(k+1)-geom%bk(k))*rhs%ps
373 elseif (
allocated(rhs%delp))
then 374 self%delp = self%delp + rhs%delp
377 if(
allocated(self%q )) self%q = self%q + rhs%q
378 if(
allocated(self%qi )) self%qi = self%qi + rhs%qi
379 if(
allocated(self%ql )) self%ql = self%ql + rhs%ql
380 if(
allocated(self%o3 )) self%o3 = self%o3 + rhs%o3
381 if(
allocated(self%w )) self%w = self%w + rhs%w
382 if(
allocated(self%delz)) self%delz = self%delz + rhs%delz
384 call abor1_ftn(
"fv3jedi state: add_incr not implemented for low res increment yet")
398 check = (rhs%iec-rhs%isc+1) - (state%iec-state%isc+1)
401 call copy(state, rhs)
403 call abor1_ftn(
"fv3jedi_state: change_resol not implmeneted yet")
456 use fckit_log_module,
only : log
471 type(c_ptr),
intent(in) :: c_conf
472 type(datetime),
intent(inout) :: vdate
474 character(len=30) :: ic
475 character(len=20) :: sdate
476 character(len=1024) :: buf
478 real(kind=kind_real) :: rlat, rlon, z
479 real(kind=kind_real) :: pk,pe1,pe2,ps
480 real(kind=kind_real) :: u0,v0,w0,t0,phis0,ps0,rho0,hum0,q1,q2,q3,q4
483 real(kind=kind_real) :: dtdummy = 900.0
484 logical,
allocatable :: grids_on_this_pe(:)
485 integer :: p_split = 1
487 If (config_element_exists(c_conf,
"analytic_init"))
Then 488 ic = trim(config_get_string(c_conf,len(ic),
"analytic_init"))
494 call log%warning(
"fv3jedi_state:analytic_init: "//ic)
495 sdate = config_get_string(c_conf,len(sdate),
"date")
496 WRITE(buf,*)
'validity date is: '//sdate
498 call datetime_set(sdate, vdate)
501 int_option:
Select Case (ic)
507 Case(
"fv3_init_case")
510 call fv_init(fv_atmic, dtdummy, grids_on_this_pe, p_split)
514 test_case = config_get_int(c_conf,
"fv3_test_case")
516 call init_case( fv_atmic(1)%u,fv_atmic(1)%v,fv_atmic(1)%w,fv_atmic(1)%pt,fv_atmic(1)%delp,fv_atmic(1)%q, &
517 fv_atmic(1)%phis, fv_atmic(1)%ps,fv_atmic(1)%pe, fv_atmic(1)%peln,fv_atmic(1)%pk,fv_atmic(1)%pkz, &
518 fv_atmic(1)%uc,fv_atmic(1)%vc, fv_atmic(1)%ua,fv_atmic(1)%va, &
519 fv_atmic(1)%ak, fv_atmic(1)%bk, fv_atmic(1)%gridstruct, fv_atmic(1)%flagstruct,&
520 fv_atmic(1)%npx, fv_atmic(1)%npy, fv_atmic(1)%npz, fv_atmic(1)%ng, &
521 fv_atmic(1)%flagstruct%ncnst, fv_atmic(1)%flagstruct%nwat, &
522 fv_atmic(1)%flagstruct%ndims, fv_atmic(1)%flagstruct%ntiles, &
523 fv_atmic(1)%flagstruct%dry_mass, &
524 fv_atmic(1)%flagstruct%mountain, &
525 fv_atmic(1)%flagstruct%moist_phys, fv_atmic(1)%flagstruct%hydrostatic, &
526 fv_atmic(1)%flagstruct%hybrid_z, fv_atmic(1)%delz, fv_atmic(1)%ze0, &
527 fv_atmic(1)%flagstruct%adiabatic, fv_atmic(1)%ks, fv_atmic(1)%neststruct%npx_global, &
528 fv_atmic(1)%ptop, fv_atmic(1)%domain, fv_atmic(1)%tile, fv_atmic(1)%bd )
531 state%ud = fv_atmic(1)%u
532 state%vd = fv_atmic(1)%v
533 state%t = fv_atmic(1)%pt
534 state%delp = fv_atmic(1)%delp
535 state%q = fv_atmic(1)%q(:,:,:,1)
536 state%phis = fv_atmic(1)%phis
537 geom%ak = fv_atmic(1)%ak
538 geom%ak = fv_atmic(1)%ak
539 geom%ptop = fv_atmic(1)%ptop
540 if (.not. state%hydrostatic)
then 541 state%w = fv_atmic(1)%w
542 state%delz = fv_atmic(1)%delz
548 deallocate(grids_on_this_pe)
550 Case (
"dcmip-test-1-1")
552 do i = geom%isc,geom%iec
553 do j = geom%jsc,geom%jec
554 rlat = geom%grid_lat(i,j)
555 rlon = geom%grid_lon(i,j)
559 phis0,ps,rho0,hum0,q1,q2,q3,q4)
561 state%phis(i,j) = phis0
566 pe1 = geom%ak(k) + geom%bk(k)*ps
567 pe2 = geom%ak(k+1) + geom%bk(k+1)*ps
568 pk = 0.5_kind_real * (pe1+pe2)
570 phis0,ps0,rho0,hum0,q1,q2,q3,q4)
574 If (.not.state%hydrostatic) state%w(i,j,k) = w0
576 state%delp(i,j,k) = pe2-pe1
577 state%q (i,j,k) = hum0
586 Case (
"dcmip-test-1-2")
588 do i = geom%isc,geom%iec
589 do j = geom%jsc,geom%jec
590 rlat = geom%grid_lat(i,j)
591 rlon = geom%grid_lon(i,j)
595 t0,phis0,ps,rho0,hum0,q1)
597 state%phis(i,j) = phis0
602 pe1 = geom%ak(k) + geom%bk(k)*ps
603 pe2 = geom%ak(k+1) + geom%bk(k+1)*ps
604 pk = 0.5_kind_real * (pe1+pe2)
606 t0,phis0,ps,rho0,hum0,q1)
610 If (.not.state%hydrostatic) state%w(i,j,k) = w0
612 state%delp(i,j,k) = pe2-pe1
613 state%q (i,j,k) = hum0
620 Case (
"dcmip-test-3-1")
622 do i = geom%isc,geom%iec
623 do j = geom%jsc,geom%jec
624 rlat = geom%grid_lat(i,j)
625 rlon = geom%grid_lon(i,j)
629 t0,phis0,ps,rho0,hum0)
631 state%phis(i,j) = phis0
636 pe1 = geom%ak(k) + geom%bk(k)*ps
637 pe2 = geom%ak(k+1) + geom%bk(k+1)*ps
638 pk = 0.5_kind_real * (pe1+pe2)
640 t0,phis0,ps,rho0,hum0)
644 If (.not.state%hydrostatic) state%w(i,j,k) = w0
646 state%delp(i,j,k) = pe2-pe1
647 state%q(i,j,k) = hum0
653 Case (
"dcmip-test-4-0")
655 do i = geom%isc,geom%iec
656 do j = geom%jsc,geom%jec
657 rlat = geom%grid_lat(i,j)
658 rlon = geom%grid_lon(i,j)
661 Call test4_baroclinic_wave(0,1.0_kind_real,rlon,rlat,pk,0.d0,1,u0,v0,w0,&
662 t0,phis0,ps,rho0,hum0,q1,q2)
664 state%phis(i,j) = phis0
669 pe1 = geom%ak(k) + geom%bk(k)*ps
670 pe2 = geom%ak(k+1) + geom%bk(k+1)*ps
671 pk = 0.5_kind_real * (pe1+pe2)
672 Call test4_baroclinic_wave(0,1.0_kind_real,rlon,rlat,pk,0.d0,0,u0,v0,w0,&
673 t0,phis0,ps,rho0,hum0,q1,q2)
677 If (.not.state%hydrostatic) state%w(i,j,k) = w0
679 state%delp(i,j,k) = pe2-pe1
680 state%q(i,j,k) = hum0
690 End Select int_option
701 type(fv3jedi_state),
intent(inout) :: state
702 type(c_ptr),
intent(in) :: config
703 type(fv3jedi_geom),
intent(in) :: geom
709 do j = geom%jsc,geom%jec
710 do i = geom%isc,geom%iec
711 state%ud(i,j,k) = cos(0.25*geom%grid_lon(i,j)) + cos(0.25*geom%grid_lat(i,j))
718 do j = geom%jsc,geom%jec
719 do i = geom%isc,geom%iec
720 state%vd(i,j,k) = 1.0_kind_real
727 do j = geom%jsc,geom%jec
728 do i = geom%isc,geom%iec
729 state%ua(i,j,k) = cos(0.25*geom%grid_lon(i,j)) + cos(0.25*geom%grid_lat(i,j))
736 do j = geom%jsc,geom%jec
737 do i = geom%isc,geom%iec
738 state%va(i,j,k) = 1.0_kind_real
745 do j = geom%jsc,geom%jec
746 do i = geom%isc,geom%iec
747 state%t(i,j,k) = cos(0.25*geom%grid_lon(i,j)) + cos(0.25*geom%grid_lat(i,j))
754 do j = geom%jsc,geom%jec
755 do i = geom%isc,geom%iec
756 state%delp(i,j,k) = k
763 do j = geom%jsc,geom%jec
764 do i = geom%isc,geom%iec
772 do j = geom%jsc,geom%jec
773 do i = geom%isc,geom%iec
781 do j = geom%jsc,geom%jec
782 do i = geom%isc,geom%iec
790 do j = geom%jsc,geom%jec
791 do i = geom%isc,geom%iec
802 subroutine read_file(geom, state, c_conf, vdate)
808 type(c_ptr),
intent(in) :: c_conf
809 type(datetime),
intent(inout) :: vdate
811 character(len=10) :: restart_type
813 restart_type = config_get_string(c_conf,len(restart_type),
"restart_type")
815 if (trim(restart_type) ==
'gfs')
then 817 elseif (trim(restart_type) ==
'geos')
then 820 call abor1_ftn(
"fv3jedi_state read: restart type not supported")
829 subroutine write_file(geom, state, c_conf, vdate)
835 type(c_ptr),
intent(in) :: c_conf
836 type(datetime),
intent(inout) :: vdate
838 character(len=10) :: restart_type
840 restart_type = config_get_string(c_conf,len(restart_type),
"restart_type")
842 if (trim(restart_type) ==
'gfs')
then 844 elseif (trim(restart_type) ==
'geos')
then 847 call abor1_ftn(
"fv3jedi_state write: restart type not supported")
856 subroutine gpnorm(state, nf, pstat)
859 integer,
intent(in) :: nf
860 real(kind=kind_real),
intent(inout) :: pstat(3, nf)
862 integer :: isc, iec, jsc, jec, gs
873 gs = (iec-isc+1)*(jec-jsc+1)*state%npz
875 pstat = 0.0_kind_real
878 if (
allocated(state%ud))
then 879 pstat(1,1) = minval(state%ud(isc:iec,jsc:jec,:))
880 pstat(2,1) = maxval(state%ud(isc:iec,jsc:jec,:))
881 pstat(3,1) = sqrt((sum(state%ud(isc:iec,jsc:jec,:))/gs)**2)
885 if (
allocated(state%vd))
then 886 pstat(1,2) = minval(state%vd(isc:iec,jsc:jec,:))
887 pstat(2,2) = maxval(state%vd(isc:iec,jsc:jec,:))
888 pstat(3,2) = sqrt((sum(state%vd(isc:iec,jsc:jec,:))/gs)**2)
892 if (
allocated(state%ua))
then 893 pstat(1,3) = minval(state%ua(isc:iec,jsc:jec,:))
894 pstat(2,3) = maxval(state%ua(isc:iec,jsc:jec,:))
895 pstat(3,3) = sqrt((sum(state%ua(isc:iec,jsc:jec,:))/gs)**2)
899 if (
allocated(state%va))
then 900 pstat(1,4) = minval(state%va(isc:iec,jsc:jec,:))
901 pstat(2,4) = maxval(state%va(isc:iec,jsc:jec,:))
902 pstat(3,4) = sqrt((sum(state%va(isc:iec,jsc:jec,:))/gs)**2)
906 if (
allocated(state%t))
then 907 pstat(1,5) = minval(state%t(isc:iec,jsc:jec,:))
908 pstat(2,5) = maxval(state%t(isc:iec,jsc:jec,:))
909 pstat(3,5) = sqrt((sum(state%t(isc:iec,jsc:jec,:))/gs)**2)
913 if (
allocated(state%delp))
then 914 pstat(1,6) = minval(state%delp(isc:iec,jsc:jec,:))
915 pstat(2,6) = maxval(state%delp(isc:iec,jsc:jec,:))
916 pstat(3,6) = sqrt((sum(state%delp(isc:iec,jsc:jec,:))/gs)**2)
920 if (
allocated(state%q))
then 921 pstat(1,7) = minval(state%q(isc:iec,jsc:jec,:))
922 pstat(2,7) = maxval(state%q(isc:iec,jsc:jec,:))
923 pstat(3,7) = sqrt((sum(state%q(isc:iec,jsc:jec,:))/gs)**2)
927 if (
allocated(state%qi))
then 928 pstat(1,8) = minval(state%qi(isc:iec,jsc:jec,:))
929 pstat(2,8) = maxval(state%qi(isc:iec,jsc:jec,:))
930 pstat(3,8) = sqrt((sum(state%qi(isc:iec,jsc:jec,:))/gs)**2)
934 if (
allocated(state%ql))
then 935 pstat(1,9) = minval(state%ql(isc:iec,jsc:jec,:))
936 pstat(2,9) = maxval(state%ql(isc:iec,jsc:jec,:))
937 pstat(3,9) = sqrt((sum(state%ql(isc:iec,jsc:jec,:))/gs)**2)
941 if (
allocated(state%o3))
then 942 pstat(1,10) = minval(state%o3(isc:iec,jsc:jec,:))
943 pstat(2,10) = maxval(state%o3(isc:iec,jsc:jec,:))
944 pstat(3,10) = sqrt((sum(state%o3(isc:iec,jsc:jec,:))/gs)**2)
954 use fckit_mpi_module,
only : fckit_mpi_comm, fckit_mpi_sum
957 real(kind=kind_real),
intent(out) :: prms
959 real(kind=kind_real) :: zz
960 integer i,j,k,ii,nt,ierr,npes,iisum
961 integer :: isc,iec,jsc,jec,npz
962 type(fckit_mpi_comm) :: f_comm
970 f_comm = fckit_mpi_comm()
977 if (
allocated(state%ud))
then 981 zz = zz + state%ud(i,j,k)**2
989 if (
allocated(state%vd))
then 993 zz = zz + state%vd(i,j,k)**2
1001 if (
allocated(state%ua))
then 1005 zz = zz + state%ua(i,j,k)**2
1013 if (
allocated(state%va))
then 1017 zz = zz + state%va(i,j,k)**2
1025 if (
allocated(state%t))
then 1029 zz = zz + state%t(i,j,k)**2
1037 if (
allocated(state%delp))
then 1041 zz = zz + state%delp(i,j,k)**2
1049 if (
allocated(state%q))
then 1053 zz = zz + state%q(i,j,k)**2
1061 if (
allocated(state%qi))
then 1065 zz = zz + state%qi(i,j,k)**2
1073 if (
allocated(state%ql))
then 1077 zz = zz + state%ql(i,j,k)**2
1085 if (
allocated(state%o3))
then 1089 zz = zz + state%o3(i,j,k)**2
1097 call f_comm%allreduce(zz,prms,fckit_mpi_sum())
1098 call f_comm%allreduce(ii,iisum,fckit_mpi_sum())
subroutine, public gpnorm(inc, nf, pstat)
subroutine, public staterms(state, prms)
Fortran derived type to hold FV3JEDI increment.
subroutine, public change_resol(inc, rhs)
real(kind=8), parameter, public pi_8
Ratio of circle circumference to diameter [N/A].
real(kind=kind_real), parameter, public rad2deg
subroutine, public write_file(geom, inc, c_conf, vdate)
subroutine, public init_case(u, v, w, pt, delp, q, phis, ps, pe, peln, pk, pkz, uc, vc, ua, va, ak, bk, gridstruct, flagstruct, npx, npy, npz, ng, ncnst, nwat, ndims, nregions, dry_mass, mountain, moist_phys, hydrostatic, hybrid_z, delz, ze0, adiabatic, ks, npx_global, ptop, domain_in, tile_in, bd)
subroutine, public copy(self, rhs)
Fortran derived type to hold FV3JEDI state.
subroutine, public getvalues(geom, state, locs, vars, gom, traj)
subroutine, public read_fms_restart(geom, state, c_conf, vdate)
subroutine test1_advection_deformation(lon, lat, p, z, zcoords, u, v, w, t, phis, ps, rho, q, q1, q2, q3, q4)
integer, dimension(:), allocatable, public pelist_all
subroutine test4_baroclinic_wave(moist, X, lon, lat, p, z, zcoords, u, v, w, t, phis, ps, rho, q, q1, q2)
Fortran derived type to hold geometry data for the FV3JEDI model.
subroutine, public read_geos_restart(state, c_conf, vdate)
Fortran module to handle variables for the FV3JEDI model.
subroutine, public delete(self)
subroutine, public fv_init(Atm, dt_atmos, grids_on_this_pe, p_split)
Handle state for the FV3JEDI odel.
subroutine, public write_fms_restart(geom, state, c_conf, vdate)
subroutine invent_state(state, config, geom)
subroutine, public a2d(geom, ua, va, ud, vd)
subroutine, public add_incr(self, rhs)
Utilities for increment for the FV3JEDI model.
Variable transforms on wind variables for fv3-jedi Daniel Holdaway, NASA/JCSDA.
Utilities for state for the FV3JEDI model.
subroutine test1_advection_hadley(lon, lat, p, z, zcoords, u, v, w, t, phis, ps, rho, q, q1)
subroutine, public read_file(geom, inc, c_conf, vdate)
subroutine, public analytic_ic(state, geom, c_conf, vdate)
Analytic Initialization for the FV3 Model.
Fortran module handling geometry for the FV3 model.
subroutine, public zeros(self)
subroutine deallocate_fv_atmos_type(Atm)
subroutine test3_gravity_wave(lon, lat, p, z, zcoords, u, v, w, t, phis, ps, rho, q)
real(kind=kind_real), parameter, public constoz
integer, public test_case
Fortran derived type to represent fv3jedi model variables.
Fortran module handling observation locations.
integer, parameter, public kind_real
subroutine, public axpy(self, zz, rhs)
subroutine, public create(self, geom, vars)
subroutine, public write_geos_restart(geom, state, c_conf, vdate)
real(fp), parameter, public pi