2 SUBROUTINE PRS2SIG(PP,SIG,FSG,KX,PRES,FP,KXP,PS,PTOP,IWT,NAME)
3 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
5 C ...THIS PROGRAM WILL GET THE VALUES ON SIGMA LEVELS (SIG) C
6 C FROM THE VALUES (FP) ON THE PRESSURE LEVELS (SIG). THE RESULT C
7 C WILL BE PUT BACK INTO FSG. C
9 C SIG is the half sigma values (up-to-bottom) C
10 C PRES is the values from large to small in hPa C
12 C ...PP is coupled P-perturbation (cb*Pa), C
13 C PS is Pstar; PTOP is Ptop in cb C
15 C ... IWT = 0 LINEAR INTERPOLATION C
16 C IWT = 1 LOG LINEAR INTERPOLATION C
18 C ... ICRS = 1 cross points field, = 0 dot point field C
22 C Constants: SIG, PRES, PS, PTOP C
25 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
27 DIMENSION PP(KX) , SIG(KX+1), FSG(KX),
29 + ALP(80),ALS(80),D1(80),D2(80),SS(80)
32 C inverse the sigma values and stored in to SS:
34 C SIG(1) = 0.0, SID(2) = 0.10----> SIG(KX) = 0.96, SIG(KX+1) = 1.0
35 C SS (KX)) = .05, ----> SS (1) = 0.98
42 11 FORMAT(/'CALL SIG2PRS ==> ',A6,' IWT=',I2)
45 c PRINT 12,K,SIG(K),SS(K),PRES(K)
46 ELSE IF (K.LE.KX) THEN
47 c PRINT 12,K,SIG(K),SS(K)
52 12 FORMAT(5X,I3,2X,3F10.4)
56 C ... LINEAR INTERPOLATION
57 C | FIELDS RELATED TO WIND DO LINEAR
58 DO 20 K=1,KX ! INTERPOLATION
59 ALS(K)=10.*(SS(K)*PS+PTOP) + PP(K)/PS/100.
61 ELSE IF (IWT.EQ.1) THEN
63 C ... LOG INTERPOLATION
64 C | FIELDS RELATED TO MASS FIELD DO LOG
65 DO 21 K=1,KX ! IS LINEARLY INTEPOLATION
66 ALS(K)=ALOG(10.*(SS(K)*PS+PTOP) + PP(K)/PS/100.)
70 C .. to get FSG at pressure levels:
74 C ... LINEAR INTERPOLATION
80 ELSE IF (IWT.EQ.1) THEN
82 C ... LOG INTERPOLATION
93 IF(ALP(LL).LE.ALS(K)) GO TO 100
100 C ... DO THE REQUESTED EXTRAPOLATION AT BOTTOM
102 CC D2(K)=D1(L)+(ALP(L)-ALS(K))*
103 CC + (D1(L+1)-D1(L))/(ALP(L)-ALP(L+1))
104 C .. REGARDS AS MISSING:
107 ELSE IF(ALS(K).GE.ALP(KXP))THEN
109 C ... DO THE INTERPOLATION BETWEEN SIGMA LEVELS
113 D2(K)=(D1(L-1)*AU+D1(L)*AD)/(ALP(L-1)-ALP(L))
117 C ... DO THE REQUESTED EXTRAPOLATION T TOP
119 cc IF (IWT.EQ.0) THEN
120 cc D2(K)=D1(L)+(ALP(L)-ALS(K))*
121 cc + (D1(L)-D1(L-1))/(ALP(L-1)-ALP(L))
123 C above the old highest pressure level, T, Qv, .... will take
124 C the values on the old highest pressure level.
127 C .. REGARDS AS MISSING:
135 310 FORMAT(/5X,'NAME=',A6,' PS=',F10.2)
137 PSIG = 10.*(SS(K)*PS+PTOP) + PP(K)/PS/100.
139 cc PRINT 311,K,PSIG,FSG(K),PRES(K),FP(K)
140 311 FORMAT('K=',I2,' PSIG=',F8.2,' FSG=',F8.2,' PRES=',F8.2,
143 cc PRINT 311,K,PSIG,FSG(K)