UPP  001
 All Data Structures Files Functions Pages
TRPAUS.f
Go to the documentation of this file.
1 
5 
34  SUBROUTINE trpaus(PTROP,TTROP,ZTROP,UTROP,VTROP,SHTROP)
35 
36 !
37 !
38 ! INCLUDE ETA GRID DIMENSIONS. SET/DERIVE PARAMETERS.
39 !
40  use vrbls3d, only: pint, t, zint, uh, vh
41  use masks, only: lmh
42  use params_mod, only: d50
43  use ctlblk_mod, only: jsta, jend, spval, im, jm, lm
44 !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
45  implicit none
46 !
47 ! PARAMTER CRTLAP SPECIFIES THE CRITICAL LAPSE RATE
48 ! (IN K/M) IDENTIFYING THE TROPOPAUSE. WE START
49 ! LOOKING FOR THE TROPOPAUSE ABOVE PRESSURE LEVEL
50 ! PSTART (IN PASALS).
51  real,PARAMETER :: crtlap=0.002e0, pstart=5.0e4
52 !
53 ! DECLARE VARIABLES.
54 !
55  REAL,dimension(IM,JM),intent(out) :: ptrop,ttrop,ztrop,utrop, &
56  vtrop,shtrop
57  REAL tlapse(lm),dz2(lm),delt2(lm),tlapse2(lm)
58 !
59  integer i,j,ll,llmh,l
60  real pm,delt,dz,rsqdif
61 !
62 !*****************************************************************************
63 ! START TRPAUS HERE.
64 !
65 ! LOOP OVER THE HORIZONTAL GRID.
66 !
67  DO j=jsta,jend
68  DO i=1,im
69  ptrop(i,j) = spval
70  ttrop(i,j) = spval
71  ztrop(i,j) = spval
72  utrop(i,j) = spval
73  vtrop(i,j) = spval
74  shtrop(i,j) = spval
75  ENDDO
76  ENDDO
77 !
78 !!$omp parallel do
79 !!$omp& private(delt,delt2,dz,dz2,ie,iw,l,llmh,pm,rsqdif,
80 !!$omp& tlapse,tlapse2,u0,u0l,uh,uh0,ul,
81 !!$omp& v0,v0l,vh,vh0)
82  DO j=jsta,jend
83  loopi:DO i=1,im
84 !
85 ! COMPUTE THE TEMPERATURE LAPSE RATE (-DT/DZ) BETWEEN ETA
86 ! LAYERS MOVING UP FROM THE GROUND. THE FIRST ETA LAYER
87 ! ABOVE PRESSURE "PSTART" IN WHICH THE LAPSE RATE IS LESS
88 ! THAN THE CRITCAL LAPSE RATE IS LABELED THE TROPOPAUSE.
89 !
90  llmh=nint(lmh(i,j))
91 !
92  loopl: DO l=llmh-1,2,-1
93  pm = pint(i,j,l)
94  delt = t(i,j,l-1)-t(i,j,l)
95  dz = d50*(zint(i,j,l-1)-zint(i,j,l+1))
96  tlapse(l) = -delt/dz
97 !
98  IF ((tlapse(l)<crtlap).AND.(pm<pstart)) THEN
99  IF (l == 2 .AND. tlapse(l) < crtlap) goto 15
100  dz2(l+1) = 0.
101 !
102  DO 17 ll=l,3,-1
103  dz2(ll) = 0.
104  delt2(ll) = 0.
105  tlapse2(ll) = 0.
106  dz2(ll) = (2./3.)*(zint(i,j,ll-2)-zint(i,j,l+1))
107  IF ((dz2(ll) > 2000.) .AND. &
108  (dz2(ll+1) > 2000.)) go to 15
109  delt2(ll) = t(i,j,ll-2)-t(i,j,l)
110  tlapse2(ll) = -delt2(ll)/dz2(ll)
111 !
112  IF (tlapse2(ll) > crtlap) THEN
113  cycle loopl
114  ENDIF
115 !
116  17 CONTINUE
117  ELSE
118  cycle loopl
119  ENDIF
120 !
121  15 ptrop(i,j) = d50*(pint(i,j,l)+pint(i,j,l+1))
122  ttrop(i,j) = t(i,j,l)
123  ztrop(i,j)= 0.5*(zint(i,j,l)+zint(i,j,l+1))
124 !
125  utrop(i,j) = uh(i,j,l)
126  vtrop(i,j) = vh(i,j,l)
127  dz = zint(i,j,l)-zint(i,j,l+1)
128  rsqdif = sqrt(((uh(i,j,l-1)-uh(i,j,l+1))*0.5)**2 &
129  & +((vh(i,j,l-1)-vh(i,j,l+1))*0.5)**2)
130  shtrop(i,j) = rsqdif/dz
131  cycle loopi
132 
133  ENDDO loopl
134 
135 !X WRITE(88,*)'REACHED TOP FOR K,P,TLAPSE: ',K,PM,TLAPSE
136 
137  dz = d50*(zint(i,j,2)-zint(i,j,3))
138  ptrop(i,j) = d50*(pint(i,j,2)+pint(i,j,3))
139  ttrop(i,j) = t(i,j,2)
140  ztrop(i,j)= d50*(zint(i,j,2)+zint(i,j,3))
141  utrop(i,j) = uh(i,j,2)
142  vtrop(i,j) = vh(i,j,2)
143  rsqdif = sqrt(((uh(i,j,1)-uh(i,j,3))*0.5)**2 &
144  & +((vh(i,j,1)-vh(i,j,3))*0.5)**2)
145  shtrop(i,j) = rsqdif/dz
146 
147 !X WRITE(82,1010)I,J,L,PTROP(I,J)*D01,TTROP(I,J),
148 !X X UTROP(I,J),VTROP(I,J),SHTROP(I,J)
149 !
150  ENDDO loopi !end I
151  ENDDO !end J
152 
153 !
154 ! END OF ROUTINE.
155 !
156  RETURN
157  END
Definition: MASKS_mod.f:1