1 SUBROUTINE CRH2SH( WV, T, PS, A, B, IJMAX, LMAX, LARHM,
5 1 WV(IJMAX,LMAX), T(IJMAX,LMAX), PS(IJMAX), A(LMAX), B(LMAX)
7 C INPUT WV : RELATIVE HUMIDITY( 0-1 ) ( L=<LARHM ) : CHANGED
8 C : SPECIFIC HUMIDITY( KG/KG ) ( L >LARHM ) : UNCHANGED
9 C T : VIRTUAL TEMPERATURE(K) : CHANGED
10 C PS : SURFACE PRESSURE(HPA)
11 C OUTPUT WV : SPECIFIC HUMIDITY( KG/KG ) ( FOR ALL LEVELS )
12 C T : REAL TEMPERATURE(K)
14 EE = 1.D0/(0.608D0*t_kelvin)
15 FF = 1.D0/(0.608D0*35.9D0)
17 CC = t_kelvin/35.9D0*7.5D0*LOG(10.D0)
25 IF( L.LE.LMAX-1 ) THEN
26 PHF1 = A(L )+B(L )*PS(IJ)
27 PHF2 = A(L+1)+B(L+1)*PS(IJ)
28 PL = EXP( ( PHF1*LOG(PHF1)-PHF2*LOG(PHF2) )
29 \ /( PHF1-PHF2 )-1.0 )
31 PL = 0.5*( A(L)+B(L)*PS(IJ) )
39 C ŒJ‚è•Ô‚µŒvŽZŠJŽn : QQ = INITIAL VALUE OF SPECIFIC HUMIDITY
43 DO 120 ITER = 1, ITERMX
44 QV = AA*EXP(CC*(QQ-BB)/(QQ-DD))
45 FQ = QV-QQ/(1.0+0.608*QQ)
46 DFQ = HH*QV/((QQ-DD)**2)-1.0/(1.0+0.608*QQ)**2
48 IF( QQ.LT.QMIN ) QQ = QMIN
51 C ŒJ‚è•Ô‚µŒvŽZ�I—¹�¨ŽÀ‰·“x‚ÌŒvŽZ
53 TT = VT/(1.0+0.608*QQ)
59 IF( LARHM.LT.LMAX ) THEN
60 DO 130 L = LARHM+1, LMAX
61 T(IJ,L) = T(IJ,L)/(1.0+0.608*WV(IJ,L))
69 C**********************************************************************
71 I(IJMAX,KMAX,PS,A,B,GRAV,GASR,TLAPS,QCONS,QMIN,KST,ITERMX,
77 C*** CALCULATE SPECIFIC HUMIDITY AND REAL TEMPERATURE
78 C FROM RELATIVE HUMIDITY ,REAL TEMPERATURE AND VIRTUAL TEMPERATURE
80 C SPECIFIC HUMIDITY = CONSTANT IN STRATOSPHERE
82 C*** (ARRAYS) (INPUT) ******************* (OUTPUT) ******************
83 C WV RELATIVE HUMIDITY(NOT %) SPECIFIC HUMIDITY(KG/KG)
84 C T VIRTUAL TEMPERATURE(K) REAL TEMPERATURE(K)
85 C PS SURFACE PRESSURE (MB) (UNCHANGED)
86 C A,B A+B*PS DEFINES INTER-LAYER LEVEL
87 C***********************************************************************
88 DIMENSION WV(IJMAX,KMAX),T(IJMAX,KMAX),PS(IJMAX),A(KMAX),B(KMAX)
89 DATA Q90/2.7E-6/ ! SAME AS IN WV300M
90 COMMON/CTETEN/TABLE(25000)
91 COMMON/DTETEN/DTABLE(25000)
102 IF( K.LT.LARHM ) THEN
107 PHF1=A(K )+B(K )*PS(I)
108 PHF2=A(K+1)+B(K+1)*PS(I)
109 PL =EXP( (PHF1*LOG(PHF1)-PHF2*LOG(PHF2))/(PHF1-PHF2)-1.0 )
111 PL =0.5*(A(K)+B(K)*PS(I))
116 YI = (T0-123.2D0)*100.0D0
118 IY = MAX( IY, 1 ) ! 96/01/31
119 IY = MIN( IY, 24999 ) ! 96/01/31
121 QSAT = ((1.0D0-X)*TABLE(IY)+X*TABLE(IY+1))/PL
122 CMM IF((IDX.EQ.1).AND.(PL.LE.90.)) THEN
123 CMM QQ=MIN(Q90,QSAT*0.9)
125 IF( K.LT.LARHM ) THEN
126 DQSAT = ((1.0D0-X)*DTABLE(IY)+X*DTABLE(IY+1))/PL
127 FT = VT-T0-0.608*T0*QSAT*RH
128 DFT = -1.0-0.608*QSAT*RH-0.608*T0*DQSAT*RH
131 YI = (T0-123.2D0)*100.0D0
133 IY = MAX( IY, 1 ) ! 96/01/31
134 IY = MIN( IY, 24999 ) ! 96/01/31
136 QSAT = ((1.0D0-X)*TABLE(IY)+X*TABLE(IY+1))/PL
137 DQSAT = ((1.0D0-X)*DTABLE(IY)+X*DTABLE(IY+1))/PL
138 FT = VT-T0-0.608*T0*QSAT*RH
139 DFT = -1.0-0.608*QSAT*RH-0.608*T0*DQSAT*RH
142 YI = (T0-123.2D0)*100.0D0
144 IY = MAX( IY, 1 ) ! 96/01/31
145 IY = MIN( IY, 24999 ) ! 96/01/31
147 QQ = ((1.0D0-X)*TABLE(IY)+X*TABLE(IY+1))/PL*RH
152 IF((IDX.EQ.1).AND.(PL.LE.90.)) THEN
156 C +++ CALCULATE REAL TEMPERATURE +++
166 END SUBROUTINE CRH2SHA
167 C ---------------------------------------------------------------------
168 SUBROUTINE SPLDIF( ZOUT, POUT, LMXOUT, ZIN, PIN, LMXIN )
170 DIMENSION ZOUT(LMXOUT), POUT(LMXOUT), ZIN(LMXIN), PIN(LMXIN)
171 DIMENSION SM(40), H(40), AL(40), AM(40), AP(40), C(40)
173 C INPUT / ZIN (L), PIN (L), LMXIN : INPUT.DATA, PRES(LOG), NUMBER
174 C OUTPUT/ ZOUT(L), POUT(L), LMXOUT : OUTPUT-VAL, PRES(LOG), NUMBER
177 GR = -gravity/gas_constant
180 H(L) = PIN(L)-PIN(L-1)
184 AL(L) = 0.5*H(L+1)/(H(L)+H(L+1))
188 C �I’[�ðŒ�( LAPSE RATE IS CONSTANT )
189 C SM(1) = SM(2) ; SM(LMXIN-1) = SM(LMXIN) : SECOND DERIVATIVE
196 AP(L) = 1.0/(1.0-AL(L-1)*AM(L))
203 C(L) = 3.0*((ZIN(L+1)-ZIN(L))/H(L+1) - (ZIN(L)-ZIN(L-1))/H(L))
207 C FORWARD SUBSTITUTION
210 C(L) = (C(L)-C(L-1)*AM(L))*AP(L)
214 C BACKWARD SUBSTUTUTION
218 SM(L) = C(L)-AL(L)*SM(L+1)
225 DO 500 LOUT = 1, LMXOUT
229 IF( X.GE.PIN(L) ) GO TO 310
234 C ‚RŽŸƒXƒvƒ‰ƒCƒ“ŠÖ�”‚Ì”÷•ª
236 ZOUT(LOUT) = SM(L-1)*( -(PIN(L)-X)**2 /(2.0*H(L))+H(L)/6.0 )
237 \ + SM(L) *( (X-PIN(L-1))**2 /(2.0*H(L))-H(L)/6.0 )
238 \ + ( ZIN(L)-ZIN(L-1) )/H(L)
239 ZOUT(LOUT) = ZOUT(LOUT)*GR
244 END SUBROUTINE SPLDIF
245 C ---------------------------------------------------------------------
246 SUBROUTINE SPLDIF3( ZOUT, POUT, LMXOUT, ZIN, PIN, LMXIN, IJMAX,
247 W SM, H, AL, AM, AP, C )
248 DIMENSION ZOUT(IJMAX,LMXOUT), POUT(IJMAX,LMXOUT),
249 1 ZIN (IJMAX,LMXIN), PIN (IJMAX,LMXIN)
250 CMM DIMENSION ZOUT(LMXOUT), POUT(LMXOUT), ZIN(LMXIN), PIN(LMXIN)
251 DIMENSION SM(IJMAX,LMXIN), H(IJMAX,LMXIN), AL(IJMAX,LMXIN),
252 1 AM(IJMAX,LMXIN), AP(IJMAX,LMXIN), C(IJMAX,LMXIN)
253 CMM DIMENSION SM(40), H(40), AL(40), AM(40), AP(40), C(40)
255 C INPUT / ZIN (L), PIN (L), LMXIN : INPUT.DATA, PRES(LOG), NUMBER
256 C OUTPUT/ ZOUT(L), POUT(L), LMXOUT : OUTPUT-VAL, PRES(LOG), NUMBER
259 GR = -gravity/gas_constant
263 H(I,L) = PIN(I,L)-PIN(I,L-1)
268 AL(I,L) = 0.5*H(I,L+1)/(H(I,L)+H(I,L+1))
269 AM(I,L) = 0.5-AL(I,L)
272 C �I’[�ðŒ�( LAPSE RATE IS CONSTANT )
273 C SM(1) = SM(2) ; SM(LMXIN-1) = SM(LMXIN) : SECOND DERIVATIVE
283 AP(I,L) = 1.0/(1.0-AL(I,L-1)*AM(I,L))
284 AL(I,L) = AL(I,L)*AP(I,L)
294 C(I,L) = 3.0*((ZIN(I,L+1)-ZIN(I,L))/H(I,L+1)
295 1 - (ZIN(I,L)-ZIN(I,L-1))/H(I,L))
299 C FORWARD SUBSTITUTION
303 C(I,L) = (C(I,L)-C(I,L-1)*AM(I,L))*AP(I,L)
306 SM(I,LMXIN) = C(I,LMXIN)
309 C BACKWARD SUBSTUTUTION
314 SM(I,L) = C(I,L)-AL(I,L)*SM(I,L+1)
321 DO 500 LOUT = 1, LMXOUT
325 L = LOUT ! FOR ONLY PIN.EQ.POUT
327 CM DO 300 L = LB, LMXIN
328 CM IF( X.GE.PIN(L) ) GO TO 310
333 ZOUT(I,LOUT) = SM(I,L-1)*( -(PIN(I,L)-X)**2
334 1 /(2.0*H(I,L))+H(I,L)/6.0 )
335 2 + SM(I,L) *( (X-PIN(I,L-1))**2
336 3 /(2.0*H(I,L))-H(I,L)/6.0 )
337 \ + ( ZIN(I,L)-ZIN(I,L-1) )/H(I,L)
338 ZOUT(I,LOUT) = ZOUT(I,LOUT)*GR
343 END SUBROUTINE SPLDIF3
344 C======================================================================
346 1(IMAX,JMAX,DP,IP,DCOSCL,DGW,COCLT)
347 DIMENSION DP(4,IMAX,JMAX)
348 INTEGER*2 IP(2,IMAX,JMAX)
349 REAL*8 DCOSCL(JMAX),DGW(JMAX),COCLT(JMAX)
351 Crizvi Already defined in module_wave2grid_kma
353 DELX=360.0/FLOAT(IMAX)
354 CALL GAUSS(DCOSCL,DGW,JMAX)
358 COCLT( J)= R2D*ACOS(DCOSCL(J))
359 COCLT(JMAX+1-J)=180.0-R2D*ACOS(DCOSCL(J))
361 C WRITE(6,*) 'CHECK OF COLATTITUDE',COCLT
368 QX=DELX*FLOAT(I-1)+1.5
373 DP(1,I,J)=(1.0-DLAT)*(1.0-DLON)
374 DP(2,I,J)=(1.0-DLAT)*DLON
376 DP(4,I,J)=DLAT*(1.0-DLON)
379 C WRITE(6,1010) J,IP(1,1,J),IP(2,1,J),(DP(I,1,J),I=1,4)
382 C WRITE(6,1010) J,IP(1,IMAX,J),IP(2,IMAX,J),(DP(I,IMAX,J),I=1,4)
385 C WRITE(6,1020) J,IP(1,J,1),IP(2,J,1),(DP(I,J,1),I=1,4)
388 C WRITE(6,1020) J,IP(1,J,JMAX),IP(2,J,JMAX),(DP(I,J,JMAX),I=1,4)
390 C1010 FORMAT(1H ,'J=',I3,5X,2I5,5X,4F10.3)
391 C1020 FORMAT(1H ,'I=',I3,5X,2I5,5X,4F10.3)
394 END SUBROUTINE SETWHT
396 1(WORK,DATA,IMAX,JMAX,DP,IP)
398 DIMENSION WORK(362,182),DATA(IMAX,JMAX),DP(4,IMAX,JMAX)
399 INTEGER*2 IP(2,IMAX,JMAX)
405 DATA(I,J)=DP(1,I,J)*WORK(II,JJ )+DP(2,I,J)*WORK(II+1,JJ )
406 * +DP(4,I,J)*WORK(II,JJ+1)+DP(3,I,J)*WORK(II+1,JJ+1)
410 END SUBROUTINE INTERP