2 I (GPS ,GTMP,GWV ,GPHIS,IMAX,JMAX,KMAX,RGAS,G,A,B,
5 C***********************************************************************
6 C CALCULATION OF GEOPOTENTIAL HEIGHT
7 C***********************************************************************
8 ! WRFVAR compiles at double precision by default, so DOUBLE PRECISION is
10 ! IMPLICIT DOUBLE PRECISION (A-H,O-Z)
13 REAL*8 GPS (IMAX,JMAX ), GTMP(IMAX,JMAX,KMAX),
14 & GWV (IMAX,JMAX,KMAX), GPHIS(IMAX,JMAX )
15 REAL*8 GHGT(IMAX,JMAX,KMAX)
19 C DIMENSION PHALF(KM), DELP(KM), ALPHA(KM), TV(KM)
20 DIMENSION PHALF(KM), ALPHA(KM), TV(KM)
22 Crizvi REAL*8 A(50), B(50)
23 REAL*8 A(KMAX+1), B(KMAX+1)
26 C********************* PROCEDURE *************************************
29 WRITE(6,*) ' ERROR: <KMAX> IS TOO LARGE. in GPLHGT'
33 ALPHA(KMAX) = LOG(2.D0)
34 CPOPTION PARALLEL,DIVNUM(12),PRIND((J,1))
37 CLSW*POPTION TLOCAL(J,I,K,DELP,SHGT,HYDRO,
38 CLSW*POPTION PHALF,TV,ALPHA,PHALFL)
39 CLSW*POPTION INIT(ALPHA(KMAX))
44 PHALF(K) = A(K) + B(K)*GPS (I,J)
45 C TV (K) = (1.D0+COEF*GWV(I,J,K))*GTMP(I,J,K)
46 TV (K) = (1.D0+COEF*GWV(I,J,K))*GTMP(I,J,K)*RGASG
47 C WRITE(6,*) ' K,PHALF,TV=',K,PHALF(K),TV(K)
50 C DELP (K) = PHALF(K) - PHALF(K+1)
51 DELP = PHALF(K) - PHALF(K+1)
52 C ALPHA(K) = 1.D0-PHALF(K+1)*LOG(PHALF(K)/PHALF(K+1))/DELP(K)
53 PHALFL(K)= LOG(PHALF(K)/PHALF(K+1))
54 C ALPHA(K) = 1.D0-PHALF(K+1)*PHALFL(K)/DELP(K)
55 ALPHA(K) = 1.D0-PHALF(K+1)*PHALFL(K)/DELP
57 C ALPHA(KMAX) = LOG(2.D0)
58 SHGT = GPHIS(I,J)/G !SHCO
59 C SHGT = GPHIS(I,J) !SHCN
60 C WRITE(6,*) ' SHGT=',SHGT
62 C GHGT(I,J,K) = SHGT + ALPHA(K)*RGASG*TV(K)
63 GHGT(I,J,K) = SHGT + ALPHA(K)*TV(K)
64 C WRITE(6,*) ' K,SHGT+LEVEL K-1/2 TO K=',K,GHGT(I,J,K)
67 C WRITE(6,*) ' K,GHGT=',1,GHGT(I,J,1)
69 C HYDRO = HYDRO + RGASG*TV(K-1)*LOG(PHALF(K-1)/PHALF(K))
70 HYDRO = HYDRO + TV(K-1)*PHALFL(K-1)
71 GHGT(I,J,K) = GHGT(I,J,K) + HYDRO
72 C WRITE(6,*) ' K,GHGT=',K,GHGT(I,J,K)