CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
cs_conv_pre.F90
1
3
5 contains
6
7!! \section arg_table_cs_conv_pre_run Argument Table
8!! \htmlinclude cs_conv_pre_run.html
9!!
10 subroutine cs_conv_pre_run(im, levs, ntrac, q, clw1, clw2, &
11 & work1, work2, cs_parm1, cs_parm2, wcbmax, &
12 & fswtr, fscav, save_q1, save_q2, save_q3, &
13 & errmsg, errflg)
14
15
16 use machine , only : kind_phys
17
18 implicit none
19
20! --- inputs
21 integer, intent(in) :: im, levs, ntrac
22 real(kind_phys), dimension(:,:), intent(in) :: q
23 real(kind_phys), dimension(:,:), intent(in) :: clw1,clw2
24 real(kind_phys), dimension(:), intent(in) :: work1, work2
25 real(kind_phys), intent(in) :: cs_parm1, cs_parm2
26
27! --- input/output
28 real(kind_phys), dimension(:), intent(out) :: fswtr, fscav
29 real(kind_phys), dimension(:), intent(out) :: wcbmax
30 real(kind_phys), dimension(:,:), intent(out) :: save_q1,save_q2
31 ! save_q3 is not allocated for Zhao-Carr MP
32 real(kind_phys), dimension(:,:), intent(out) :: save_q3
33
34 character(len=*), intent(out) :: errmsg
35 integer, intent(out) :: errflg
36
37! --- locals
38 integer :: i, k
39
40 ! Initialize CCPP error handling variables
41 errmsg = ''
42 errflg = 0
43
44 do i =1,im
45 wcbmax(i) = cs_parm1 * work1(i) + cs_parm2 * work2(i)
46 enddo
47
48 fswtr(:) = 0.0
49 fscav(:) = 0.0
50 do k=1,levs
51 do i=1,im
52 ! DH* note - save_q1 assignment may be redundant,
53 ! because already done in GFS_DCNV_generic_pre?
54 ! Keep for using cs_conv w/o GFS_DCNV_generic_pre?
55 save_q1(i,k) = q(i,k)
56 save_q2(i,k) = max(0.0,clw2(i,k))
57 save_q3(i,k) = max(0.0,clw1(i,k))
58 enddo
59 enddo
60
61 return
62 end subroutine cs_conv_pre_run
63
64end module cs_conv_pre