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%ua))
allocate ( self%ua(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
63 if (.not.
allocated( self%va))
allocate ( self%va(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
65 if (.not.
allocated( self%t))
allocate ( self%t(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
67 if (.not.
allocated( self%ps))
allocate ( self%ps(geom%isc:geom%iec, geom%jsc:geom%jec ))
69 if (.not.
allocated( self%q))
allocate ( self%q(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
71 if (.not.
allocated( self%qi))
allocate ( self%qi(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
73 if (.not.
allocated( self%ql))
allocate ( self%ql(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
75 if (.not.
allocated( self%o3))
allocate ( self%o3(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
77 if (.not.
allocated( self%psi))
allocate ( self%psi(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
79 if (.not.
allocated( self%chi))
allocate ( self%chi(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
81 if (.not.
allocated( self%tv))
allocate ( self%tv(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
83 if (.not.
allocated( self%qc))
allocate ( self%qc(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
85 if (.not.
allocated( self%qic))
allocate ( self%qic(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
87 if (.not.
allocated( self%qlc))
allocate ( self%qlc(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
89 if (.not.
allocated( self%o3c))
allocate ( self%o3c(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
91 if (.not.
allocated( self%w))
allocate ( self%w(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
93 if (.not.
allocated(self%delz))
allocate (self%delz(geom%isc:geom%iec, geom%jsc:geom%jec , geom%npz))
98 call abor1_ftn(
"Increment: unknown variable "//trim(self%vars%fldnames(var)))
104 self%hydrostatic = .true.
105 if (
allocated(self%w).and.
allocated(self%delz).and.
allocated(self%delp)) self%hydrostatic = .false.
107 if (
allocated(self%ps) .and.
allocated(self%delp))
then 108 call abor1_ftn(
"Increment: Ps and delp are both allocated, only one can be used")
135 if (
allocated(self%ua ))
deallocate (self%ua )
136 if (
allocated(self%va ))
deallocate (self%va )
137 if (
allocated(self%t ))
deallocate (self%t )
138 if (
allocated(self%ps ))
deallocate (self%ps )
139 if (
allocated(self%q ))
deallocate (self%q )
140 if (
allocated(self%qi ))
deallocate (self%qi )
141 if (
allocated(self%ql ))
deallocate (self%ql )
142 if (
allocated(self%o3 ))
deallocate (self%o3 )
144 if (
allocated(self%psi ))
deallocate(self%psi )
145 if (
allocated(self%chi ))
deallocate(self%chi )
146 if (
allocated(self%tv ))
deallocate(self%tv )
147 if (
allocated(self%qc ))
deallocate(self%qc )
148 if (
allocated(self%qic ))
deallocate(self%qic )
149 if (
allocated(self%qlc ))
deallocate(self%qlc )
150 if (
allocated(self%o3c ))
deallocate(self%o3c )
152 if (
allocated(self%w ))
deallocate (self%w )
153 if (
allocated(self%delz))
deallocate (self%delz)
154 if (
allocated(self%delp))
deallocate (self%delp)
160 subroutine zeros(self)
166 if(
allocated(self%ua )) self%ua = 0.0_kind_real
167 if(
allocated(self%va )) self%va = 0.0_kind_real
168 if(
allocated(self%t )) self%t = 0.0_kind_real
169 if(
allocated(self%ps )) self%ps = 0.0_kind_real
170 if(
allocated(self%q )) self%q = 0.0_kind_real
171 if(
allocated(self%qi )) self%qi = 0.0_kind_real
172 if(
allocated(self%ql )) self%ql = 0.0_kind_real
173 if(
allocated(self%o3 )) self%o3 = 0.0_kind_real
175 if(
allocated(self%psi)) self%psi = 0.0_kind_real
176 if(
allocated(self%chi)) self%chi = 0.0_kind_real
177 if(
allocated(self%tv )) self%tv = 0.0_kind_real
178 if(
allocated(self%qc )) self%qc = 0.0_kind_real
179 if(
allocated(self%qic)) self%qic = 0.0_kind_real
180 if(
allocated(self%qlc)) self%qlc = 0.0_kind_real
181 if(
allocated(self%o3c)) self%o3c = 0.0_kind_real
183 if(
allocated(self%w )) self%w = 0.0_kind_real
184 if(
allocated(self%delz)) self%delz = 0.0_kind_real
185 if(
allocated(self%delp)) self%delp = 0.0_kind_real
191 subroutine ones(self)
193 type(fv3jedi_increment),
intent(inout) :: self
197 if(
allocated(self%ua )) self%ua = 1.0_kind_real
198 if(
allocated(self%va )) self%va = 1.0_kind_real
199 if(
allocated(self%t )) self%t = 1.0_kind_real
200 if(
allocated(self%ps )) self%ps = 1.0_kind_real
201 if(
allocated(self%q )) self%q = 1.0_kind_real
202 if(
allocated(self%qi )) self%qi = 1.0_kind_real
203 if(
allocated(self%ql )) self%ql = 1.0_kind_real
204 if(
allocated(self%o3 )) self%o3 = 1.0_kind_real
206 if(
allocated(self%psi)) self%psi = 1.0_kind_real
207 if(
allocated(self%chi)) self%chi = 1.0_kind_real
208 if(
allocated(self%tv )) self%tv = 1.0_kind_real
209 if(
allocated(self%qc )) self%qc = 1.0_kind_real
210 if(
allocated(self%qic)) self%qic = 1.0_kind_real
211 if(
allocated(self%qlc)) self%qlc = 1.0_kind_real
212 if(
allocated(self%o3c)) self%o3c = 1.0_kind_real
214 if(
allocated(self%w )) self%w = 1.0_kind_real
215 if(
allocated(self%delz)) self%delz = 1.0_kind_real
216 if(
allocated(self%delp)) self%delp = 1.0_kind_real
253 subroutine copy(self,rhs)
269 self%hydrostatic = rhs%hydrostatic
270 self%calendar_type = rhs%calendar_type
272 self%date_init = rhs%date_init
274 if(
allocated(self%ua )) self%ua = rhs%ua
275 if(
allocated(self%va )) self%va = rhs%va
276 if(
allocated(self%t )) self%t = rhs%t
277 if(
allocated(self%ps )) self%ps = rhs%ps
278 if(
allocated(self%q )) self%q = rhs%q
279 if(
allocated(self%qi )) self%qi = rhs%qi
280 if(
allocated(self%ql )) self%ql = rhs%ql
281 if(
allocated(self%o3 )) self%o3 = rhs%o3
283 if(
allocated(self%psi )) self%psi = rhs%psi
284 if(
allocated(self%chi )) self%chi = rhs%chi
285 if(
allocated(self%tv )) self%tv = rhs%tv
286 if(
allocated(self%qc )) self%qc = rhs%qc
287 if(
allocated(self%qic )) self%qic = rhs%qic
288 if(
allocated(self%qlc )) self%qlc = rhs%qlc
289 if(
allocated(self%o3c )) self%o3c = rhs%o3c
291 if(
allocated(self%w )) self%w = rhs%w
292 if(
allocated(self%delz)) self%delz = rhs%delz
293 if(
allocated(self%delp)) self%delp = rhs%delp
305 if(
allocated(self%ua )) self%ua = self%ua + rhs%ua
306 if(
allocated(self%va )) self%va = self%va + rhs%va
307 if(
allocated(self%t )) self%t = self%t + rhs%t
308 if(
allocated(self%q )) self%q = self%q + rhs%q
309 if(
allocated(self%ps )) self%ps = self%ps + rhs%ps
310 if(
allocated(self%qi )) self%qi = self%qi + rhs%qi
311 if(
allocated(self%ql )) self%ql = self%ql + rhs%ql
312 if(
allocated(self%o3 )) self%o3 = self%o3 + rhs%o3
314 if(
allocated(self%psi )) self%psi = self%psi + rhs%psi
315 if(
allocated(self%chi )) self%chi = self%chi + rhs%chi
316 if(
allocated(self%tv )) self%tv = self%tv + rhs%tv
317 if(
allocated(self%qc )) self%qc = self%qc + rhs%qc
318 if(
allocated(self%qic )) self%qic = self%qic + rhs%qic
319 if(
allocated(self%qlc )) self%qlc = self%qlc + rhs%qlc
320 if(
allocated(self%o3c )) self%o3c = self%o3c + rhs%o3c
322 if(
allocated(self%w )) self%w = self%w + rhs%w
323 if(
allocated(self%delz)) self%delz = self%delz + rhs%delz
324 if(
allocated(self%delp)) self%delp = self%delp + rhs%delp
336 if(
allocated(self%ua )) self%ua = self%ua * rhs%ua
337 if(
allocated(self%va )) self%va = self%va * rhs%va
338 if(
allocated(self%t )) self%t = self%t * rhs%t
339 if(
allocated(self%ps )) self%ps = self%ps * rhs%ps
340 if(
allocated(self%q )) self%q = self%q * rhs%q
341 if(
allocated(self%qi )) self%qi = self%qi * rhs%qi
342 if(
allocated(self%ql )) self%ql = self%ql * rhs%ql
343 if(
allocated(self%o3 )) self%o3 = self%o3 * rhs%o3
345 if(
allocated(self%psi )) self%psi = self%psi * rhs%psi
346 if(
allocated(self%chi )) self%chi = self%chi * rhs%chi
347 if(
allocated(self%tv )) self%tv = self%tv * rhs%tv
348 if(
allocated(self%qc )) self%qc = self%qc * rhs%qc
349 if(
allocated(self%qic )) self%qic = self%qic * rhs%qic
350 if(
allocated(self%qlc )) self%qlc = self%qlc * rhs%qlc
351 if(
allocated(self%o3c )) self%o3c = self%o3c * rhs%o3c
353 if(
allocated(self%w )) self%w = self%w * rhs%w
354 if(
allocated(self%delz)) self%delz = self%delz * rhs%delz
355 if(
allocated(self%delp)) self%delp = self%delp * rhs%delp
367 if(
allocated(self%ua )) self%ua = self%ua - rhs%ua
368 if(
allocated(self%va )) self%va = self%va - rhs%va
369 if(
allocated(self%t )) self%t = self%t - rhs%t
370 if(
allocated(self%ps )) self%ps = self%ps - rhs%ps
371 if(
allocated(self%q )) self%q = self%q - rhs%q
372 if(
allocated(self%qi )) self%qi = self%qi - rhs%qi
373 if(
allocated(self%ql )) self%ql = self%ql - rhs%ql
374 if(
allocated(self%o3 )) self%o3 = self%o3 - rhs%o3
376 if(
allocated(self%psi )) self%psi = self%psi - rhs%psi
377 if(
allocated(self%chi )) self%chi = self%chi - rhs%chi
378 if(
allocated(self%tv )) self%tv = self%tv - rhs%tv
379 if(
allocated(self%qc )) self%qc = self%qc - rhs%qc
380 if(
allocated(self%qic )) self%qic = self%qic - rhs%qic
381 if(
allocated(self%qlc )) self%qlc = self%qlc - rhs%qlc
382 if(
allocated(self%o3c )) self%o3c = self%o3c - rhs%o3c
384 if(
allocated(self%w )) self%w = self%w - rhs%w
385 if(
allocated(self%delz)) self%delz = self%delz - rhs%delz
386 if(
allocated(self%delp)) self%delp = self%delp - rhs%delp
396 real(kind=kind_real),
intent(in) :: zz
398 if(
allocated(self%ua )) self%ua = zz * self%ua
399 if(
allocated(self%va )) self%va = zz * self%va
400 if(
allocated(self%t )) self%t = zz * self%t
401 if(
allocated(self%ps )) self%ps = zz * self%ps
402 if(
allocated(self%q )) self%q = zz * self%q
403 if(
allocated(self%qi )) self%qi = zz * self%qi
404 if(
allocated(self%ql )) self%ql = zz * self%ql
405 if(
allocated(self%o3 )) self%o3 = zz * self%o3
407 if(
allocated(self%psi )) self%psi = zz * self%psi
408 if(
allocated(self%chi )) self%chi = zz * self%chi
409 if(
allocated(self%tv )) self%tv = zz * self%tv
410 if(
allocated(self%qc )) self%qc = zz * self%qc
411 if(
allocated(self%qic )) self%qic = zz * self%qic
412 if(
allocated(self%qlc )) self%qlc = zz * self%qlc
413 if(
allocated(self%o3c )) self%o3c = zz * self%o3c
415 if(
allocated(self%w )) self%w = zz * self%w
416 if(
allocated(self%delz)) self%delz = zz * self%delz
417 if(
allocated(self%delp)) self%delp = zz * self%delp
427 real(kind=kind_real),
intent(in) :: zz
430 if(
allocated(self%ua )) self%ua = self%ua + zz * rhs%ua
431 if(
allocated(self%va )) self%va = self%va + zz * rhs%va
432 if(
allocated(self%t )) self%t = self%t + zz * rhs%t
433 if(
allocated(self%ps )) self%ps = self%ps + zz * rhs%ps
434 if(
allocated(self%q )) self%q = self%q + zz * rhs%q
435 if(
allocated(self%qi )) self%qi = self%qi + zz * rhs%qi
436 if(
allocated(self%ql )) self%ql = self%ql + zz * rhs%ql
437 if(
allocated(self%o3 )) self%o3 = self%o3 + zz * rhs%o3
439 if(
allocated(self%psi )) self%psi = self%psi + zz * rhs%psi
440 if(
allocated(self%chi )) self%chi = self%chi + zz * rhs%chi
441 if(
allocated(self%tv )) self%tv = self%tv + zz * rhs%tv
442 if(
allocated(self%qc )) self%qc = self%qc + zz * rhs%qc
443 if(
allocated(self%qic )) self%qic = self%qic + zz * rhs%qic
444 if(
allocated(self%qlc )) self%qlc = self%qlc + zz * rhs%qlc
445 if(
allocated(self%o3c )) self%o3c = self%o3c + zz * rhs%o3c
447 if(
allocated(self%w )) self%w = self%w + zz * rhs%w
448 if(
allocated(self%delz)) self%delz = self%delz + zz * rhs%delz
449 if(
allocated(self%delp)) self%delp = self%delp + zz * rhs%delp
459 real(kind=kind_real),
intent(in) :: zz
462 real(kind=kind_real),
allocatable :: rhs_ps(:,:)
464 if(
allocated(self%ua )) self%ua = self%ua + zz * rhs%ua
465 if(
allocated(self%va )) self%va = self%va + zz * rhs%va
466 if(
allocated(self%t )) self%t = self%t + zz * rhs%t
468 if(
allocated(self%ps))
then 469 allocate(rhs_ps(rhs%isc:rhs%iec,rhs%jsc:rhs%jec))
470 rhs_ps = sum(rhs%delp,3)
471 self%ps = self%ps + zz * rhs_ps
475 if(
allocated(self%delp)) self%delp = self%delp + zz * rhs%delp
477 if(
allocated(self%q )) self%q = self%q + zz * rhs%q
478 if(
allocated(self%qi )) self%qi = self%qi + zz * rhs%qi
479 if(
allocated(self%ql )) self%ql = self%ql + zz * rhs%ql
480 if(
allocated(self%o3 )) self%o3 = self%o3 + zz * rhs%o3
482 if(
allocated(self%w )) self%w = self%w + zz * rhs%w
483 if(
allocated(self%delz)) self%delz = self%delz + zz * rhs%delz
490 subroutine dot_prod(inc1,inc2,zprod)
492 use fckit_mpi_module,
only: fckit_mpi_comm, fckit_mpi_sum
496 real(kind=kind_real),
intent(inout) :: zprod
497 real(kind=kind_real) :: zp
500 type(fckit_mpi_comm) :: f_comm
502 f_comm = fckit_mpi_comm()
507 if (
allocated(inc1%ua))
then 509 do j = inc1%jsc,inc1%jec
510 do i = inc1%isc,inc1%iec
511 zp = zp + inc1%ua(i,j,k) * inc2%ua(i,j,k)
518 if (
allocated(inc1%va))
then 520 do j = inc1%jsc,inc1%jec
521 do i = inc1%isc,inc1%iec
522 zp = zp + inc1%va(i,j,k) * inc2%va(i,j,k)
529 if (
allocated(inc1%t))
then 531 do j = inc1%jsc,inc1%jec
532 do i = inc1%isc,inc1%iec
533 zp = zp + inc1%t(i,j,k) * inc2%t(i,j,k)
540 if (
allocated(inc1%ps))
then 541 do j = inc1%jsc,inc1%jec
542 do i = inc1%isc,inc1%iec
543 zp = zp + inc1%ps(i,j) * inc2%ps(i,j)
549 if (
allocated(inc1%q))
then 551 do j = inc1%jsc,inc1%jec
552 do i = inc1%isc,inc1%iec
553 zp = zp + inc1%q(i,j,k) * inc2%q(i,j,k)
560 if (
allocated(inc1%qi))
then 562 do j = inc1%jsc,inc1%jec
563 do i = inc1%isc,inc1%iec
564 zp = zp + inc1%qi(i,j,k) * inc2%qi(i,j,k)
571 if (
allocated(inc1%ql))
then 573 do j = inc1%jsc,inc1%jec
574 do i = inc1%isc,inc1%iec
575 zp = zp + inc1%ql(i,j,k) * inc2%ql(i,j,k)
582 if (
allocated(inc1%o3))
then 584 do j = inc1%jsc,inc1%jec
585 do i = inc1%isc,inc1%iec
586 zp = zp + inc1%o3(i,j,k) * inc2%o3(i,j,k)
593 if (
allocated(inc1%psi))
then 595 do j = inc1%jsc,inc1%jec
596 do i = inc1%isc,inc1%iec
597 zp = zp + inc1%psi(i,j,k) * inc2%psi(i,j,k)
604 if (
allocated(inc1%chi))
then 606 do j = inc1%jsc,inc1%jec
607 do i = inc1%isc,inc1%iec
608 zp = zp + inc1%chi(i,j,k) * inc2%chi(i,j,k)
615 if (
allocated(inc1%tv))
then 617 do j = inc1%jsc,inc1%jec
618 do i = inc1%isc,inc1%iec
619 zp = zp + inc1%tv(i,j,k) * inc2%tv(i,j,k)
626 if (
allocated(inc1%qc))
then 628 do j = inc1%jsc,inc1%jec
629 do i = inc1%isc,inc1%iec
630 zp = zp + inc1%qc(i,j,k) * inc2%qc(i,j,k)
637 if (
allocated(inc1%qic))
then 639 do j = inc1%jsc,inc1%jec
640 do i = inc1%isc,inc1%iec
641 zp = zp + inc1%qic(i,j,k) * inc2%qic(i,j,k)
648 if (
allocated(inc1%qlc))
then 650 do j = inc1%jsc,inc1%jec
651 do i = inc1%isc,inc1%iec
652 zp = zp + inc1%qlc(i,j,k) * inc2%qlc(i,j,k)
659 if (
allocated(inc1%o3c))
then 661 do j = inc1%jsc,inc1%jec
662 do i = inc1%isc,inc1%iec
663 zp = zp + inc1%o3c(i,j,k) * inc2%o3c(i,j,k)
670 if (
allocated(inc1%delz))
then 672 do j = inc1%jsc,inc1%jec
673 do i = inc1%isc,inc1%iec
674 zp = zp + inc1%delz(i,j,k) * inc2%delz(i,j,k)
681 if (
allocated(inc1%delp))
then 683 do j = inc1%jsc,inc1%jec
684 do i = inc1%isc,inc1%iec
685 zp = zp + inc1%delp(i,j,k) * inc2%delp(i,j,k)
692 if (
allocated(inc1%w))
then 694 do j = inc1%jsc,inc1%jec
695 do i = inc1%isc,inc1%iec
696 zp = zp + inc1%w(i,j,k) * inc2%w(i,j,k)
703 call f_comm%allreduce(zp,zprod,fckit_mpi_sum())
706 if (f_comm%rank() == 0) print*,
"Dot product test result: ", zprod
719 check = (rhs%iec-rhs%isc+1) - (self%iec-self%isc+1)
722 if(
allocated(rhs%ua )) self%ua = self%ua + rhs%ua
723 if(
allocated(rhs%va )) self%va = self%va + rhs%va
724 if(
allocated(rhs%t )) self%t = self%t + rhs%t
725 if(
allocated(rhs%ps )) self%ps = self%ps + rhs%ps
726 if(
allocated(rhs%q )) self%q = self%q + rhs%q
727 if(
allocated(rhs%qi )) self%qi = self%qi + rhs%qi
728 if(
allocated(rhs%ql )) self%ql = self%ql + rhs%ql
729 if(
allocated(rhs%o3 )) self%o3 = self%o3 + rhs%o3
731 if(
allocated(rhs%psi )) self%psi = self%psi + rhs%psi
732 if(
allocated(rhs%chi )) self%chi = self%chi + rhs%chi
733 if(
allocated(rhs%tv )) self%tv = self%tv + rhs%tv
734 if(
allocated(rhs%qc )) self%qc = self%qc + rhs%qc
735 if(
allocated(rhs%qic )) self%qic = self%qic + rhs%qic
736 if(
allocated(rhs%qlc )) self%qlc = self%qlc + rhs%qlc
737 if(
allocated(rhs%o3c )) self%o3c = self%o3c + rhs%o3c
739 if(
allocated(rhs%w )) self%w = self%w + rhs%w
740 if(
allocated(rhs%delz)) self%delz = self%delz + rhs%delz
741 if(
allocated(rhs%delp)) self%delp = self%delp + rhs%delp
743 call abor1_ftn(
"Increment: add_incr not implemented for low res increment yet")
757 real(kind=kind_real),
allocatable :: x1_ps(:,:), x2_ps(:,:)
760 check = (x1%iec-x1%isc+1) - (x2%iec-x2%isc+1)
765 if(
allocated(lhs%ua )) lhs%ua = x1%ua - x2%ua
766 if(
allocated(lhs%va )) lhs%va = x1%va - x2%va
767 if(
allocated(lhs%t )) lhs%t = x1%t - x2%t
769 if(
allocated(lhs%ps))
then 770 allocate(x1_ps(x1%isc:x1%iec,x1%jsc:x1%jec))
771 allocate(x2_ps(x2%isc:x2%iec,x2%jsc:x2%jec))
772 x1_ps = sum(x1%delp,3)
773 x2_ps = sum(x2%delp,3)
774 lhs%ps = x1_ps - x2_ps
775 deallocate(x1_ps,x2_ps)
778 if(
allocated(lhs%delp)) lhs%delp = x1%delp - x2%delp
780 if(
allocated(lhs%q )) lhs%q = x1%q - x2%q
781 if(
allocated(lhs%qi )) lhs%qi = x1%qi - x2%qi
782 if(
allocated(lhs%ql )) lhs%ql = x1%ql - x2%ql
783 if(
allocated(lhs%o3 )) lhs%o3 = x1%o3 - x2%o3
785 if(
allocated(lhs%w )) lhs%w = x1%w - x2%w
786 if(
allocated(lhs%delz)) lhs%delz = x1%delz - x2%delz
790 call abor1_ftn(
"Increment: diff_incr not implemented for low res increment yet")
805 check = (rhs%iec-rhs%isc+1) - (inc%iec-inc%isc+1)
810 call abor1_ftn(
"Increment: change_resol not implmeneted yet")
818 subroutine read_file(geom, inc, c_conf, vdate)
824 type(c_ptr),
intent(in) :: c_conf
825 type(datetime),
intent(inout) :: vdate
827 character(len=10) :: restart_type
829 restart_type = config_get_string(c_conf,len(restart_type),
"restart_type")
831 if (trim(restart_type) ==
'gfs')
then 833 elseif (trim(restart_type) ==
'geos')
then 836 call abor1_ftn(
"Increment: read restart type not supported")
845 subroutine write_file(geom, inc, c_conf, vdate)
851 type(c_ptr),
intent(in) :: c_conf
852 type(datetime),
intent(inout) :: vdate
854 character(len=10) :: restart_type
856 restart_type = config_get_string(c_conf,len(restart_type),
"restart_type")
858 if (trim(restart_type) ==
'gfs')
then 860 elseif (trim(restart_type) ==
'geos')
then 863 call abor1_ftn(
"Increment: write restart type not supported")
872 subroutine gpnorm(inc, nf, pstat)
875 integer,
intent(in) :: nf
876 real(kind=kind_real),
intent(inout) :: pstat(3, nf)
878 integer :: isc, iec, jsc, jec, gs2, gs3
889 gs2 = (iec-isc+1)*(jec-jsc+1)
893 if (
allocated(inc%ua))
then 894 pstat(1,1) = minval(inc%ua(isc:iec,jsc:jec,:))
895 pstat(2,1) = maxval(inc%ua(isc:iec,jsc:jec,:))
896 pstat(3,1) = sqrt((sum(inc%ua(isc:iec,jsc:jec,:))/gs3)**2)
900 if (
allocated(inc%va))
then 901 pstat(1,2) = minval(inc%va(isc:iec,jsc:jec,:))
902 pstat(2,2) = maxval(inc%va(isc:iec,jsc:jec,:))
903 pstat(3,2) = sqrt((sum(inc%va(isc:iec,jsc:jec,:))/gs3)**2)
907 if (
allocated(inc%t))
then 908 pstat(1,3) = minval(inc%t(isc:iec,jsc:jec,:))
909 pstat(2,3) = maxval(inc%t(isc:iec,jsc:jec,:))
910 pstat(3,3) = sqrt((sum(inc%t(isc:iec,jsc:jec,:))/gs3)**2)
914 if (
allocated(inc%ps))
then 915 pstat(1,4) = minval(inc%ps(isc:iec,jsc:jec))
916 pstat(2,4) = maxval(inc%ps(isc:iec,jsc:jec))
917 pstat(3,4) = sqrt((sum(inc%ps(isc:iec,jsc:jec))/gs2)**2)
921 if (
allocated(inc%q))
then 922 pstat(1,5) = minval(inc%q(isc:iec,jsc:jec,:))
923 pstat(2,5) = maxval(inc%q(isc:iec,jsc:jec,:))
924 pstat(3,5) = sqrt((sum(inc%q(isc:iec,jsc:jec,:))/gs3)**2)
928 if (
allocated(inc%qi))
then 929 pstat(1,6) = minval(inc%qi(isc:iec,jsc:jec,:))
930 pstat(2,6) = maxval(inc%qi(isc:iec,jsc:jec,:))
931 pstat(3,6) = sqrt((sum(inc%qi(isc:iec,jsc:jec,:))/gs3)**2)
935 if (
allocated(inc%ql))
then 936 pstat(1,7) = minval(inc%ql(isc:iec,jsc:jec,:))
937 pstat(2,7) = maxval(inc%ql(isc:iec,jsc:jec,:))
938 pstat(3,7) = sqrt((sum(inc%ql(isc:iec,jsc:jec,:))/gs3)**2)
942 if (
allocated(inc%o3))
then 943 pstat(1,8) = minval(inc%o3(isc:iec,jsc:jec,:))
944 pstat(2,8) = maxval(inc%o3(isc:iec,jsc:jec,:))
945 pstat(3,8) = sqrt((sum(inc%o3(isc:iec,jsc:jec,:))/gs3)**2)
949 if (
allocated(inc%psi))
then 950 pstat(1,1) = minval(inc%psi(isc:iec,jsc:jec,:))
951 pstat(2,1) = maxval(inc%psi(isc:iec,jsc:jec,:))
952 pstat(3,1) = sqrt((sum(inc%psi(isc:iec,jsc:jec,:))/gs3)**2)
956 if (
allocated(inc%chi))
then 957 pstat(1,2) = minval(inc%chi(isc:iec,jsc:jec,:))
958 pstat(2,2) = maxval(inc%chi(isc:iec,jsc:jec,:))
959 pstat(3,2) = sqrt((sum(inc%chi(isc:iec,jsc:jec,:))/gs3)**2)
963 if (
allocated(inc%tv))
then 964 pstat(1,3) = minval(inc%tv(isc:iec,jsc:jec,:))
965 pstat(2,3) = maxval(inc%tv(isc:iec,jsc:jec,:))
966 pstat(3,3) = sqrt((sum(inc%tv(isc:iec,jsc:jec,:))/gs3)**2)
970 if (
allocated(inc%qc))
then 971 pstat(1,5) = minval(inc%qc(isc:iec,jsc:jec,:))
972 pstat(2,5) = maxval(inc%qc(isc:iec,jsc:jec,:))
973 pstat(3,5) = sqrt((sum(inc%qc(isc:iec,jsc:jec,:))/gs3)**2)
977 if (
allocated(inc%qic))
then 978 pstat(1,6) = minval(inc%qic(isc:iec,jsc:jec,:))
979 pstat(2,6) = maxval(inc%qic(isc:iec,jsc:jec,:))
980 pstat(3,6) = sqrt((sum(inc%qic(isc:iec,jsc:jec,:))/gs3)**2)
984 if (
allocated(inc%qlc))
then 985 pstat(1,7) = minval(inc%qlc(isc:iec,jsc:jec,:))
986 pstat(2,7) = maxval(inc%qlc(isc:iec,jsc:jec,:))
987 pstat(3,7) = sqrt((sum(inc%qlc(isc:iec,jsc:jec,:))/gs3)**2)
991 if (
allocated(inc%o3c))
then 992 pstat(1,8) = minval(inc%o3c(isc:iec,jsc:jec,:))
993 pstat(2,8) = maxval(inc%o3c(isc:iec,jsc:jec,:))
994 pstat(3,8) = sqrt((sum(inc%o3c(isc:iec,jsc:jec,:))/gs3)**2)
998 if (
allocated(inc%w))
then 999 pstat(1,9) = minval(inc%w(isc:iec,jsc:jec,:))
1000 pstat(2,9) = maxval(inc%w(isc:iec,jsc:jec,:))
1001 pstat(3,9) = sqrt((sum(inc%w(isc:iec,jsc:jec,:))/gs3)**2)
1005 if (
allocated(inc%delz))
then 1006 pstat(1,10) = minval(inc%delz(isc:iec,jsc:jec,:))
1007 pstat(2,10) = maxval(inc%delz(isc:iec,jsc:jec,:))
1008 pstat(3,10) = sqrt((sum(inc%delz(isc:iec,jsc:jec,:))/gs3)**2)
1012 if (
allocated(inc%delp))
then 1013 pstat(1,4) = minval(inc%delp(isc:iec,jsc:jec,:))
1014 pstat(2,4) = maxval(inc%delp(isc:iec,jsc:jec,:))
1015 pstat(3,4) = sqrt((sum(inc%delp(isc:iec,jsc:jec,:))/gs3)**2)
1024 subroutine incrms(inc, prms)
1025 use fckit_mpi_module,
only : fckit_mpi_comm, fckit_mpi_sum
1028 real(kind=kind_real),
intent(out) :: prms
1030 real(kind=kind_real) :: zz
1031 integer i,j,k,ii,nt,ierr,npes,iisum
1032 integer :: isc,iec,jsc,jec,npz
1033 type(fckit_mpi_comm) :: f_comm
1041 f_comm = fckit_mpi_comm()
1044 prms = 0.0_kind_real
1048 if (
allocated(inc%ua))
then 1052 zz = zz + inc%ua(i,j,k)**2
1060 if (
allocated(inc%va))
then 1064 zz = zz + inc%va(i,j,k)**2
1072 if (
allocated(inc%t))
then 1076 zz = zz + inc%t(i,j,k)**2
1084 if (
allocated(inc%ps))
then 1087 zz = zz + inc%ps(i,j)**2
1094 if (
allocated(inc%q))
then 1098 zz = zz + inc%q(i,j,k)**2
1106 if (
allocated(inc%qi))
then 1110 zz = zz + inc%qi(i,j,k)**2
1118 if (
allocated(inc%ql))
then 1122 zz = zz + inc%ql(i,j,k)**2
1130 if (
allocated(inc%o3))
then 1134 zz = zz + inc%o3(i,j,k)**2
1142 if (
allocated(inc%psi))
then 1146 zz = zz + inc%psi(i,j,k)**2
1154 if (
allocated(inc%chi))
then 1158 zz = zz + inc%chi(i,j,k)**2
1166 if (
allocated(inc%tv))
then 1170 zz = zz + inc%tv(i,j,k)**2
1178 if (
allocated(inc%qc))
then 1182 zz = zz + inc%qc(i,j,k)**2
1190 if (
allocated(inc%qic))
then 1194 zz = zz + inc%qic(i,j,k)**2
1202 if (
allocated(inc%qlc))
then 1206 zz = zz + inc%qlc(i,j,k)**2
1214 if (
allocated(inc%o3c))
then 1218 zz = zz + inc%o3c(i,j,k)**2
1226 if (
allocated(inc%w))
then 1230 zz = zz + inc%w(i,j,k)**2
1238 if (
allocated(inc%delz))
then 1242 zz = zz + inc%delz(i,j,k)**2
1250 if (
allocated(inc%delp))
then 1254 zz = zz + inc%delp(i,j,k)**2
1262 call f_comm%allreduce(zz,prms,fckit_mpi_sum())
1263 call f_comm%allreduce(ii,iisum,fckit_mpi_sum())
1274 subroutine dirac(self, c_conf, geom)
1280 type(c_ptr),
intent(in) :: c_conf
1282 integer :: ndir,idir,ildir,ifdir,itiledir
1283 integer,
allocatable :: ixdir(:),iydir(:)
1284 character(len=3) :: idirchar
1287 ndir = config_get_int(c_conf,
"ndir")
1288 allocate(ixdir(ndir))
1289 allocate(iydir(ndir))
1292 write(idirchar,
'(i3)') idir
1293 ixdir(idir) = config_get_int(c_conf,
"ixdir("//trim(adjustl(idirchar))//
")")
1294 iydir(idir) = config_get_int(c_conf,
"iydir("//trim(adjustl(idirchar))//
")")
1296 ildir = config_get_int(c_conf,
"ildir")
1297 ifdir = config_get_int(c_conf,
"ifdir")
1298 itiledir = config_get_int(c_conf,
"itiledir")
1302 if (ndir<1)
call abor1_ftn(
"Increment: dirac non-positive ndir")
1303 if (any(ixdir<1).or.any(ixdir>self%npx))
then 1304 call abor1_ftn(
"Increment: dirac invalid ixdir")
1306 if (any(iydir<1).or.any(iydir>geom%size_cubic_grid))
then 1307 call abor1_ftn(
"Increment: dirac invalid iydir")
1309 if ((ildir<1).or.(ildir>self%npz))
then 1310 call abor1_ftn(
"Increment: dirac invalid ildir")
1312 if ((ifdir<1).or.(ifdir>5))
then 1313 call abor1_ftn(
"Increment: dirac invalid ifdir")
1315 if ((itiledir<1).or.(itiledir>6))
then 1316 call abor1_ftn(
"Increment: dirac invalid itiledir")
1326 if (geom%ntile == itiledir .and. &
1327 ixdir(idir) >= self%isc .and. ixdir(idir) <= self%iec .and. &
1328 iydir(idir) >= self%jsc .and. iydir(idir) <= self%jec)
then 1330 if (ifdir == 1)
then 1331 self%ua (ixdir(idir),iydir(idir),ildir) = 1.0
1332 else if (ifdir == 2)
then 1333 self%va (ixdir(idir),iydir(idir),ildir) = 1.0
1334 else if (ifdir == 3)
then 1335 self%t (ixdir(idir),iydir(idir),ildir) = 1.0
1336 else if (ifdir == 4)
then 1337 self%ps (ixdir(idir),iydir(idir) ) = 1.0
1338 else if (ifdir == 5)
then 1339 self%q (ixdir(idir),iydir(idir),ildir) = 1.0
1340 else if (ifdir == 6)
then 1341 self%qi (ixdir(idir),iydir(idir),ildir) = 1.0
1342 else if (ifdir == 7)
then 1343 self%ql (ixdir(idir),iydir(idir),ildir) = 1.0
1344 else if (ifdir == 8)
then 1345 self%o3 (ixdir(idir),iydir(idir),ildir) = 1.0
1350 end subroutine dirac 1357 type(fv3jedi_increment),
intent(in) :: self
1358 type(unstructured_grid),
intent(inout) :: ug
1363 if (ug%colocated==1)
then 1369 call abor1_ftn(
"Increment: Uncolocated grids not coded yet, and not needed")
1373 if (.not.
allocated(ug%grid))
allocate(ug%grid(ug%ngrid))
1377 ug%grid(1)%nmga = (self%iec - self%isc + 1) * (self%jec - self%jsc + 1)
1380 ug%grid(1)%nl0 = self%npz
1385 if (.not. self%hydrostatic)
then 1396 subroutine ug_coord(self, ug, colocated, geom)
1401 integer,
intent(in) :: colocated
1404 integer :: imga,jx,jy,jl
1405 real(kind=kind_real),
allocatable :: lon(:),lat(:),area(:),vunit(:,:)
1406 real(kind=kind_real) :: sigmaup,sigmadn
1410 ug%colocated = colocated
1418 if (ug%colocated==1)
then 1420 do jy=self%jsc,self%jec
1421 do jx=self%isc,self%iec
1423 ug%grid(1)%lon(imga) =
rad2deg*geom%grid_lon(jx,jy)
1424 ug%grid(1)%lat(imga) =
rad2deg*geom%grid_lat(jx,jy)
1425 ug%grid(1)%area(imga) = geom%area(jx,jy)
1427 sigmaup = geom%ak(jl+1)/101300.0+geom%bk(jl+1)
1428 sigmadn = geom%ak(jl )/101300.0+geom%bk(jl )
1429 ug%grid(1)%vunit(imga,jl) = 0.5*(sigmaup+sigmadn)
1430 ug%grid(1)%lmask(imga,jl) = .true.
1445 integer,
intent(in) :: colocated
1447 integer :: imga,jx,jy,jl
1448 real(kind=kind_real),
allocatable :: ptmp(:,:,:)
1452 ug%colocated = colocated
1462 ug%grid(1)%fld = 0.0_kind_real
1464 if (ug%colocated==1)
then 1466 if (
allocated(self%ua))
then 1468 do jy=self%jsc,self%jec
1469 do jx=self%isc,self%iec
1472 ug%grid(1)%fld(imga,jl,1,1) = self%ua (jx,jy,jl)
1478 if (
allocated(self%va))
then 1480 do jy=self%jsc,self%jec
1481 do jx=self%isc,self%iec
1484 ug%grid(1)%fld(imga,jl,2,1) = self%va (jx,jy,jl)
1490 if (
allocated(self%t))
then 1492 do jy=self%jsc,self%jec
1493 do jx=self%isc,self%iec
1496 ug%grid(1)%fld(imga,jl,3,1) = self%t (jx,jy,jl)
1502 if (
allocated(self%ps))
then 1504 do jy=self%jsc,self%jec
1505 do jx=self%isc,self%iec
1507 ug%grid(1)%fld(imga,self%npz,4,1) = self%ps (jx,jy)
1512 if (
allocated(self%q))
then 1514 do jy=self%jsc,self%jec
1515 do jx=self%isc,self%iec
1518 ug%grid(1)%fld(imga,jl,5,1) = self%q (jx,jy,jl)
1524 if (
allocated(self%qi))
then 1526 do jy=self%jsc,self%jec
1527 do jx=self%isc,self%iec
1530 ug%grid(1)%fld(imga,jl,6,1) = self%qi (jx,jy,jl)
1536 if (
allocated(self%ql))
then 1538 do jy=self%jsc,self%jec
1539 do jx=self%isc,self%iec
1542 ug%grid(1)%fld(imga,jl,7,1) = self%ql (jx,jy,jl)
1548 if (
allocated(self%o3))
then 1550 do jy=self%jsc,self%jec
1551 do jx=self%isc,self%iec
1554 ug%grid(1)%fld(imga,jl,8,1) = self%o3 (jx,jy,jl)
1560 if (
allocated(self%psi))
then 1562 do jy=self%jsc,self%jec
1563 do jx=self%isc,self%iec
1566 ug%grid(1)%fld(imga,jl,1,1) = self%psi (jx,jy,jl)
1572 if (
allocated(self%chi))
then 1574 do jy=self%jsc,self%jec
1575 do jx=self%isc,self%iec
1578 ug%grid(1)%fld(imga,jl,2,1) = self%chi (jx,jy,jl)
1584 if (
allocated(self%tv))
then 1586 do jy=self%jsc,self%jec
1587 do jx=self%isc,self%iec
1590 ug%grid(1)%fld(imga,jl,3,1) = self%tv (jx,jy,jl)
1596 if (
allocated(self%qc))
then 1598 do jy=self%jsc,self%jec
1599 do jx=self%isc,self%iec
1602 ug%grid(1)%fld(imga,jl,5,1) = self%qc (jx,jy,jl)
1608 if (
allocated(self%qic))
then 1610 do jy=self%jsc,self%jec
1611 do jx=self%isc,self%iec
1614 ug%grid(1)%fld(imga,jl,6,1) = self%qic (jx,jy,jl)
1620 if (
allocated(self%qlc))
then 1622 do jy=self%jsc,self%jec
1623 do jx=self%isc,self%iec
1626 ug%grid(1)%fld(imga,jl,7,1) = self%qlc (jx,jy,jl)
1632 if (
allocated(self%o3c))
then 1634 do jy=self%jsc,self%jec
1635 do jx=self%isc,self%iec
1638 ug%grid(1)%fld(imga,jl,8,1) = self%o3c (jx,jy,jl)
1644 if (
allocated(self%w))
then 1646 do jy=self%jsc,self%jec
1647 do jx=self%isc,self%iec
1650 ug%grid(1)%fld(imga,jl,9,1) = self%w (jx,jy,jl)
1656 if (
allocated(self%delz))
then 1658 do jy=self%jsc,self%jec
1659 do jx=self%isc,self%iec
1662 ug%grid(1)%fld(imga,jl,10,1) = self%delz(jx,jy,jl)
1668 if (
allocated(self%delp))
then 1670 do jy=self%jsc,self%jec
1671 do jx=self%isc,self%iec
1674 ug%grid(1)%fld(imga,jl,4,1) = self%delp(jx,jy,jl)
1692 integer :: imga,jx,jy,jl
1693 real(kind=kind_real),
allocatable :: ptmp(:,:,:)
1698 if (
allocated(self%ua))
then 1700 do jy=self%jsc,self%jec
1701 do jx=self%isc,self%iec
1704 self%ua (jx,jy,jl) = ug%grid(1)%fld(imga,jl,1,1)
1710 if (
allocated(self%va))
then 1712 do jy=self%jsc,self%jec
1713 do jx=self%isc,self%iec
1716 self%va (jx,jy,jl) = ug%grid(1)%fld(imga,jl,2,1)
1722 if (
allocated(self%t))
then 1724 do jy=self%jsc,self%jec
1725 do jx=self%isc,self%iec
1728 self%t (jx,jy,jl) = ug%grid(1)%fld(imga,jl,3,1)
1734 if (
allocated(self%ps))
then 1736 do jy=self%jsc,self%jec
1737 do jx=self%isc,self%iec
1739 self%ps (jx,jy) = ug%grid(1)%fld(imga,self%npz,4,1)
1744 if (
allocated(self%q))
then 1746 do jy=self%jsc,self%jec
1747 do jx=self%isc,self%iec
1750 self%q (jx,jy,jl) = ug%grid(1)%fld(imga,jl,5,1)
1756 if (
allocated(self%qi))
then 1758 do jy=self%jsc,self%jec
1759 do jx=self%isc,self%iec
1762 self%qi (jx,jy,jl) = ug%grid(1)%fld(imga,jl,6,1)
1768 if (
allocated(self%ql))
then 1770 do jy=self%jsc,self%jec
1771 do jx=self%isc,self%iec
1774 self%ql (jx,jy,jl) = ug%grid(1)%fld(imga,jl,7,1)
1780 if (
allocated(self%o3))
then 1782 do jy=self%jsc,self%jec
1783 do jx=self%isc,self%iec
1786 self%o3 (jx,jy,jl) = ug%grid(1)%fld(imga,jl,8,1)
1792 if (
allocated(self%psi))
then 1794 do jy=self%jsc,self%jec
1795 do jx=self%isc,self%iec
1798 self%psi (jx,jy,jl) = ug%grid(1)%fld(imga,jl,1,1)
1804 if (
allocated(self%chi))
then 1806 do jy=self%jsc,self%jec
1807 do jx=self%isc,self%iec
1810 self%chi (jx,jy,jl) = ug%grid(1)%fld(imga,jl,2,1)
1816 if (
allocated(self%tv))
then 1818 do jy=self%jsc,self%jec
1819 do jx=self%isc,self%iec
1822 self%tv (jx,jy,jl) = ug%grid(1)%fld(imga,jl,3,1)
1828 if (
allocated(self%qc))
then 1830 do jy=self%jsc,self%jec
1831 do jx=self%isc,self%iec
1834 self%qc (jx,jy,jl) = ug%grid(1)%fld(imga,jl,5,1)
1840 if (
allocated(self%qic))
then 1842 do jy=self%jsc,self%jec
1843 do jx=self%isc,self%iec
1846 self%qic (jx,jy,jl) = ug%grid(1)%fld(imga,jl,6,1)
1852 if (
allocated(self%qlc))
then 1854 do jy=self%jsc,self%jec
1855 do jx=self%isc,self%iec
1858 self%qlc (jx,jy,jl) = ug%grid(1)%fld(imga,jl,7,1)
1864 if (
allocated(self%o3c))
then 1866 do jy=self%jsc,self%jec
1867 do jx=self%isc,self%iec
1870 self%o3c (jx,jy,jl) = ug%grid(1)%fld(imga,jl,8,1)
1876 if (
allocated(self%w))
then 1878 do jy=self%jsc,self%jec
1879 do jx=self%isc,self%iec
1882 self%w (jx,jy,jl) = ug%grid(1)%fld(imga,jl,9,1)
1888 if (
allocated(self%delz))
then 1890 do jy=self%jsc,self%jec
1891 do jx=self%isc,self%iec
1894 self%delz(jx,jy,jl) = ug%grid(1)%fld(imga,jl,10,1)
1900 if (
allocated(self%delp))
then 1902 do jy=self%jsc,self%jec
1903 do jx=self%isc,self%iec
1906 self%delp(jx,jy,jl) = ug%grid(1)%fld(imga,jl,4,1)
1919 type(fv3jedi_increment),
intent(in) :: x1, x2
1921 if (x1%npx /= x2%npx .or. x1%npz /= x2%npz)
then 1922 call abor1_ftn (
"Increment: resolution error")
1931 subroutine check(self)
1933 type(fv3jedi_increment),
intent(in) :: self
1939 call abor1_ftn (
"Increment: increment not consistent")
1942 end subroutine check 1946 subroutine jnormgrad(self,geom,ref,c_conf)
1954 type(c_ptr) :: c_conf
1957 integer :: isc,iec,jsc,jec,npz
1958 real(kind=kind_real),
allocatable :: cellweight(:,:,:), ref_ps(:,:)
1960 real(kind=kind_real) :: global_area
1962 real(kind=kind_real) :: ufac
1963 real(kind=kind_real) :: tfac, tref
1964 real(kind=kind_real) :: qfac, qeps
1965 real(kind=kind_real) :: pfac, pref
1978 tref = config_get_real(c_conf,
"Tref")
1979 qeps = config_get_real(c_conf,
"qepsilon")
1980 pref = config_get_real(c_conf,
"pref")
1982 ufac = 0.5_kind_real
1983 tfac = 0.5_kind_real*
cp/tref
1984 qfac = 0.5_kind_real*qeps*
alhl*
alhl/(
cp*tref)
1985 pfac = 0.5_kind_real*
rgas*tref/pref**2
1990 global_area =
mpp_global_sum(geom%domain, geom%area, flags=bitwise_efp_sum)
1992 allocate(ref_ps(isc:iec,jsc:jec))
1993 ref_ps = sum(ref%delp,3)
1995 allocate(cellweight(isc:iec,jsc:jec,1:npz))
1999 cellweight(i,j,k) = (ref%delp(i,j,k)/ref_ps(i,j)) * geom%area(i,j)/global_area
2008 self%ua(i,j,k) = ufac * 2.0_kind_real * ref%ua(i,j,k) * cellweight(i,j,k)
2017 self%va(i,j,k) = ufac * 2.0_kind_real * ref%va(i,j,k) * cellweight(i,j,k)
2026 self%t(i,j,k) = tfac * 2.0_kind_real * ref%T(i,j,k) * cellweight(i,j,k)
2035 self%q(i,j,k) = qfac * 2.0_kind_real * ref%q (i,j,k) * cellweight(i,j,k)
2041 if (
allocated(self%ps))
then 2044 self%ps(i,j) = pfac * 2.0_kind_real * ref_ps(i,j) * cellweight(i,j,npz) / (ref%delp(i,j,npz)/ref_ps(i,j))
2048 call abor1_ftn(
"Increment: JGradNorm does not support not using Ps in the increment yet")
2051 deallocate(cellweight)
subroutine, public gpnorm(inc, nf, pstat)
subroutine, public allocate_unstructured_grid_coord(self)
Fortran generic for generating random 1d, 2d and 3d arrays.
Fortran derived type to hold FV3JEDI increment.
subroutine, public dirac(self, c_conf, geom)
subroutine, public change_resol(inc, rhs)
subroutine, public self_schur(self, rhs)
real(kind=kind_real), parameter, public rad2deg
subroutine, public axpy_state(self, zz, rhs)
subroutine, public write_file(geom, inc, c_conf, vdate)
subroutine, public dot_prod(inc1, inc2, zprod)
subroutine, public self_add(self, rhs)
subroutine, public copy(self, rhs)
real(kind=kind_real), parameter, public rgas
Fortran derived type to hold FV3JEDI state.
subroutine, public jnormgrad(self, geom, ref, c_conf)
subroutine, public incrms(inc, prms)
subroutine, public diff_incr(lhs, x1, x2)
subroutine, public self_sub(self, rhs)
Fortran derived type to hold geometry data for the FV3JEDI model.
subroutine, public getvalues_ad(geom, inc, locs, vars, gom, traj)
subroutine, public ug_coord(self, ug, colocated, geom)
subroutine, public write_fms_restart(geom, incr, c_conf, vdate)
subroutine, public random(self)
Fortran module to handle variables for the FV3JEDI model.
subroutine, public delete(self)
subroutine, public increment_to_ug(self, ug, colocated)
subroutine, public getvalues_tl(geom, inc, locs, vars, gom, traj)
subroutine, public add_incr(self, rhs)
subroutine, public allocate_unstructured_grid_field(self)
Utilities for increment for the FV3JEDI model.
subroutine, public write_geos_restart(geom, incr, c_conf, vdate)
Handle increment for the FV3JEDI model.
subroutine, public axpy_inc(self, zz, rhs)
Fortran module for generating random vectors.
Utilities for state for the FV3JEDI model.
subroutine, public read_file(geom, inc, c_conf, vdate)
Fortran module handling geometry for the FV3 model.
subroutine ug_size(self, ug)
subroutine, public zeros(self)
real(kind=kind_real), parameter, public constoz
subroutine, public increment_from_ug(self, ug)
Fortran derived type to represent fv3jedi model variables.
subroutine check_resolution(x1, x2)
integer, parameter, public kind_real
Fortran module for handling generic unstructured grid.
subroutine, public create(self, geom, vars)
subroutine, public self_mul(self, zz)
subroutine, public read_geos_restart(geom, incr, c_conf, vdate)
real(kind=kind_real), parameter, public alhl
real(kind=kind_real), parameter, public cp
subroutine, public read_fms_restart(geom, incr, c_conf, vdate)