CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
get_prs_fv3.F90
1
4
6
7 use machine, only: kind_phys
8
9!--- public declarations
10 public get_prs_fv3_run
11
12!--- local variables
13 real(kind=kind_phys), parameter :: zero = 0.0_kind_phys
14 real(kind=kind_phys), parameter :: one = 1.0_kind_phys
15
16contains
17
21 subroutine get_prs_fv3_run(ix, levs, con_fvirt, phii, prsi, tgrs, qgrs1, del, del_gz, errmsg, errflg)
22
23 implicit none
24
25 ! Interface variables
26 integer, intent(in) :: ix, levs
27 real(kind=kind_phys), intent(in) :: con_fvirt
28 real(kind=kind_phys), dimension(:,:), intent(in) :: phii
29 real(kind=kind_phys), dimension(:,:), intent(in) :: prsi
30 real(kind=kind_phys), dimension(:,:), intent(in) :: tgrs
31 real(kind=kind_phys), dimension(:,:), intent(in) :: qgrs1
32 real(kind=kind_phys), dimension(:,:), intent(out) :: del
33 real(kind=kind_phys), dimension(:,:), intent(out) :: del_gz
34 character(len=*), intent(out) :: errmsg
35 integer, intent(out) :: errflg
36
37 ! Local variables
38 integer :: i, k
39
40 ! Initialize CCPP error handling variables
41 errmsg = ''
42 errflg = 0
43
44! SJL: Adjust the geopotential height hydrostatically in a way consistent with FV3 discretization
45! del_gz is a temp array recording the old info before (t,q) are adjusted
46 do k=1,levs
47 do i=1,ix
48 del(i,k) = prsi(i,k) - prsi(i,k+1)
49 del_gz(i,k) = (phii(i,k+1) - phii(i,k)) / &
50 (tgrs(i,k)*(one + con_fvirt*max(zero,qgrs1(i,k))))
51 enddo
52 enddo
53
54 end subroutine get_prs_fv3_run
55
56end module get_prs_fv3