UPP  001
 All Data Structures Files Functions Pages
CALLCL.f
Go to the documentation of this file.
1 
30  SUBROUTINE callcl(P1D,T1D,Q1D,PLCL,ZLCL)
31 
32 !
33 !
34  use vrbls3d, only: alpint, zint
35  use vrbls2d, only: fis
36  use masks, only: lmh
37  use params_mod, only: eps, oneps, d01, h1m12, gi, d00
38  use ctlblk_mod, only: jsta, jend, spval, jsta_m, jend_m, im
39 !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
40  implicit none
41 !
42  real,PARAMETER :: d35=3.5, d4805=4.805, h2840=2840.
43  real,PARAMETER :: h55=55., d2845=0.2845, d28=0.28
44 !
45 ! DECLARE VARIABLES.
46 !
47  REAL,dimension(IM,jsta:jend), intent(in) :: p1d,t1d,q1d
48  REAL,dimension(IM,jsta:jend), intent(inout) :: plcl,zlcl
49  REAL tlcl(im,jsta:jend)
50  integer i,j,l,llmh
51  real dlplcl,zsfc,dz,dalp,alplcl,rmx,evp,arg,rkapa
52 !
53 !**********************************************************************
54 ! START CALLCL HERE.
55 !
56 ! LOAD OUTPUT ARRAYS WITH SPECIAL VALUE.
57 !
58 !$omp parallel do private(i,j)
59  DO j=jsta,jend
60  DO i=1,im
61  plcl(i,j) = spval
62  tlcl(i,j) = spval
63  zlcl(i,j) = spval
64  ENDDO
65  ENDDO
66 !
67 ! COMPUTE PRESSURE, TEMPERATURE AND AGL HEIGHT AT LCL.
68 !
69 ! Bo Cui 10/30/2019, remove "GOTO" statement
70 
71  DO 30 j=jsta_m,jend_m
72  DO 30 i=2,im-1
73 ! DO 30 I=1,IM
74  IF(p1d(i,j)<spval.and.q1d(i,j)<spval)THEN
75  evp = p1d(i,j)*q1d(i,j)/(eps+oneps*q1d(i,j))
76  rmx = eps*evp/(p1d(i,j)-evp)
77  rkapa = 1.0 / (d2845*(1.0-d28*rmx))
78  arg = max(h1m12,evp*d01)
79  tlcl(i,j) = h55 + h2840 / (d35*log(t1d(i,j))-log(arg)-d4805)
80  plcl(i,j) = p1d(i,j)*(tlcl(i,j)/t1d(i,j))**rkapa
81  alplcl = log(plcl(i,j))
82  llmh = nint(lmh(i,j))
83  zsfc = fis(i,j)*gi
84 !
85  DO 20 l=llmh,1,-1
86  IF(alpint(i,j,l) < alplcl)THEN
87  dlplcl = alplcl - alpint(i,j,l+1)
88  dalp = alpint(i,j,l) - alpint(i,j,l+1)
89  dz = zint(i,j,l) - zint(i,j,l+1)
90  zlcl(i,j) = max(d00, zint(i,j,l+1) + dz*dlplcl/dalp - zsfc)
91  EXIT
92  ENDIF
93  20 CONTINUE
94  ENDIF
95  30 CONTINUE
96 !
97 ! END OF ROUTINE.
98 !
99  RETURN
100  END
Definition: MASKS_mod.f:1