CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
cu_gf_driver_post.F90
1
3
6
7 implicit none
8
9 private
10
11 public :: cu_gf_driver_post_run
12
13 contains
14
19 subroutine cu_gf_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m, conv_act, conv_act_m, rrfs_sd, ntsmoke, ntdust, ntcoarsepm, chem3d, gq0, errmsg, errflg)
20
21 use machine, only: kind_phys
22
23 implicit none
24
25 ! Interface variables
26 integer, intent(in) :: im, km
27 real(kind_phys), intent(in) :: t(:,:)
28 real(kind_phys), intent(in) :: q(:,:)
29 real(kind_phys), intent(out), optional :: prevst(:,:)
30 real(kind_phys), intent(out), optional :: prevsq(:,:)
31 integer, intent(in), optional :: cactiv(:)
32 integer, intent(in), optional :: cactiv_m(:)
33 real(kind_phys), intent(out), optional :: conv_act(:)
34 real(kind_phys), intent(out), optional :: conv_act_m(:)
35 logical, intent(in) :: rrfs_sd
36 integer, intent(in) :: ntsmoke, ntdust, ntcoarsepm
37 real(kind_phys), intent(inout), optional :: chem3d(:,:,:)
38 real(kind_phys), intent(inout) :: gq0(:,:,:)
39 character(len=*), intent(out) :: errmsg
40!$acc declare copyin(t,q,cactiv,cactiv_m) copyout(prevst,prevsq,conv_act,conv_act_m,chem3d,gq0)
41 integer, intent(out) :: errflg
42
43 ! Local variables
44 integer :: i, k
45
46 ! Initialize CCPP error handling variables
47 errmsg = ''
48 errflg = 0
49
50!$acc kernels
51 prevst(:,:) = t(:,:)
52 prevsq(:,:) = q(:,:)
53
54 do i = 1, im
55 if (cactiv(i).gt.0) then
56 conv_act(i) = conv_act(i)+1.0
57 else
58 conv_act(i)=0.0
59 endif
60 if (cactiv_m(i).gt.0) then
61 conv_act_m(i) = conv_act_m(i)+1.0
62 else
63 conv_act_m(i)=0.0
64 endif
65 enddo
66
67 if (rrfs_sd) then
68 gq0(:,:,ntsmoke ) = chem3d(:,:,1)
69 gq0(:,:,ntdust ) = chem3d(:,:,2)
70 gq0(:,:,ntcoarsepm) = chem3d(:,:,3)
71 endif
72!$acc end kernels
73
74 end subroutine cu_gf_driver_post_run
75
76end module cu_gf_driver_post
subroutine, public cu_gf_driver_post_run(im, km, t, q, prevst, prevsq, cactiv, cactiv_m, conv_act, conv_act_m, rrfs_sd, ntsmoke, ntdust, ntcoarsepm, chem3d, gq0, errmsg, errflg)
This module contains code related to GF convective schemes to be used within the GFS physics suite.