1 SUBROUTINE GH2TV(GZ, TV, PS, TOPO,
2 1 A, B, IMAX, JMAX, LMAX,
4 C----------------------------------------------------------------------
5 C INPUT GZ (I,J,L) : GEOPOTENTIAL HEIGHT(M)
6 C PS (I,J) : SURFACE PRESSURE(HPA)
7 C TOPO(I,J) : SURFACE GEOPOTENTIAL(GPM)
8 C A(L), B(L) : A+B*PS DEFINITION OF ETA-HALF LEVEL
9 C OUTPUT TV (I,J,L) : VIRTUAL TEMPERATURE(K)
10 C----------------------------------------------------------------------
11 DIMENSION Z(IMAX*JMAX,LMAX), TV(IMAX*JMAX,LMAX), PS(IMAX*JMAX),
12 1 A(LMAX), B(LMAX),TOPO(IMAX*JMAX),GZ(IMAX*JMAX,LMAX)
13 DIMENSION PK(IMAX*JMAX,LMAX),PBETA(IMAX*JMAX,LMAX),
14 1 ALPHA(IMAX*JMAX,LMAX), DPHI(IMAX*JMAX,LMAX)
15 DIMENSION VMAX(LMAX),VMIN(LMAX)
18 C......... PK is pressure at half level
21 PK(I,L) = A(L)+B(L)*PS(I)
24 C...... DPHI is DEL PHI
25 WRITE(*,*)'MAX PHI(1)=',MAXVAL(Z(:,1)),' MAX TOPO=',MAXVAL(TOPO)
27 DPHI(I,1)=Z(I,1)-TOPO(I)
31 DPHI(I,L)=Z(I,L)-Z(I,L-1)
35 C VMAX=MAXVAL(DPHI,DIM=1)
36 C VMIN=MINVAL(DPHI,DIM=1)
37 C WRITE(*,*)' LEVEL MAX MIN OF DPHI'
39 C WRITE(*,'(I3,2F13.4)')L,VMAX(L),VMIN(L)
41 C WRITE(*,*)'MAX(1)=',VMAX(1)
42 C....... PBETA is ln(Pk-1/2)-ln(Pk+1/2)
45 PBETA(I,L)=LOG(PK(I,L)/PK(I,L+1))
48 C....... ALPHA is ALPHA(K)
51 ALPHA(I,L)=1-PK(I,L+1)*PBETA(I,L)/
56 ALPHA(I,LMAX)=LOG(2.0)
59 C VMAX=MAXVAL(ALPHA,DIM=1)
60 C VMIN=MINVAL(ALPHA,DIM=1)
61 C WRITE(*,*)' LEVEL MAX MIN OF ALPHA'
63 C WRITE(*,'(I3,2F13.8)')L,VMAX(L),VMIN(L)
67 TV(I,1)=DPHI(I,1)/(ALPHA(I,1)*gas_constant)
71 TV(I,L)=(DPHI(I,L)+gas_constant*TV(I,L-1)*
72 1 (ALPHA(I,L-1)-PBETA(I,L-1)))/
73 1 (ALPHA(I,L)*gas_constant)