CCPP SciDoc v7.0.x  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, 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) :: prevst(:,:)
30 real(kind_phys), intent(out) :: prevsq(:,:)
31 integer, intent(in) :: cactiv(:)
32 integer, intent(in) :: cactiv_m(:)
33 real(kind_phys), intent(out) :: conv_act(:)
34 real(kind_phys), intent(out) :: conv_act_m(:)
35 integer, intent(in) :: ntsmoke, ntdust, ntcoarsepm
36 real(kind_phys), intent(inout), optional :: chem3d(:,:,:)
37 real(kind_phys), intent(inout) :: gq0(:,:,:)
38 character(len=*), intent(out) :: errmsg
39!$acc declare copyin(t,q,cactiv,cactiv_m) copyout(prevst,prevsq,conv_act,conv_act_m,chem3d,gq0)
40 integer, intent(out) :: errflg
41
42 ! Local variables
43 integer :: i, k
44
45 ! Initialize CCPP error handling variables
46 errmsg = ''
47 errflg = 0
48
49!$acc kernels
50 prevst(:,:) = t(:,:)
51 prevsq(:,:) = q(:,:)
52
53 do i = 1, im
54 if (cactiv(i).gt.0) then
55 conv_act(i) = conv_act(i)+1.0
56 else
57 conv_act(i)=0.0
58 endif
59 if (cactiv_m(i).gt.0) then
60 conv_act_m(i) = conv_act_m(i)+1.0
61 else
62 conv_act_m(i)=0.0
63 endif
64 enddo
65
66 if (present(chem3d)) then
67 gq0(:,:,ntsmoke ) = chem3d(:,:,1)
68 gq0(:,:,ntdust ) = chem3d(:,:,2)
69 gq0(:,:,ntcoarsepm) = chem3d(:,:,3)
70 endif
71!$acc end kernels
72
73 end subroutine cu_gf_driver_post_run
74
75end 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, ntsmoke, ntdust, ntcoarsepm, chem3d, gq0, errmsg, errflg)
This module contains code related to GF convective schemes to be used within the GFS physics suite.