1 C======================================================================
2 C >>> REDIEG <<< READ INITIAL DATA(GRID) AND CONVERT TO WAVE
3 C======================================================================
5 I(NIEGFL,ITPGFL,IMAX,JMAX,KMAX,IMX ,MEND1,NEND1,JEND1,
6 I MNWAV ,JMAXHF,KMX2 ,KQDMAX,KTSTAR,LAG ,ITOPOG,MWVORG,
7 I PNM ,IFAX ,TRIG ,GW ,SINCLT,COSCLT,ALP ,DALP ,
8 O QDATA ,QPHIS ,IDATE ,ISTP ,KTM ,KT0 ,FSECM ,FSEC0 ,
10 O PA ,PB ,CWCM ,CWCP ,CVRM ,CVRP ,XMB ,CINF ,
12 O PA ,PB ,CWCM , CVRP , CINF ,
14 W RAA ,RBB ,IDA ,DATA ,EDAT1 ,EDAT2 ,EDAT3 ,WDATA )
17 C IMPLICIT DOUBLE PRECISION (A-H,O-Z,\)
20 CHARACTER*8 FILE, MODEL, RESL
21 CHARACTER*4 TYPE, EXPR, KTUNIT
22 INTEGER IMD, JMD, IMM, JMM
23 CHARACTER*4 NPROD, NPROM
24 CHARACTER*4 VCODD, VCODM
26 REAL RAA(KMAX+1), RBB(KMAX+1)
27 CHARACTER*80 CINF2(10)
29 DIMENSION QDATA(KQDMAX,MNWAV), QPHIS(2,MNWAV)
31 DIMENSION PA(KMAX+1), PB(KMAX+1)
32 DIMENSION CWCM(IMAX*JMAX*KMAX), CVRM(IMAX*JMAX*KMAX)
34 DIMENSION CWCP(IMAX*JMAX*KMAX), CVRP(IMAX*JMAX*KMAX)
35 DIMENSION XMB(IMAX*JMAX*KMAX)
39 INTEGER*2 IDA(IMAX*JMAX)
41 CHARACTER* 4 LEVEL, ELEM
44 DIMENSION EDAT1(IMX*JMAX*KMAX)
45 DIMENSION EDAT2(IMX*JMAX*KMAX)
46 DIMENSION EDAT3(IMX*JMAX*KMAX)
47 DIMENSION WDATA(KMX2,MNWAV,2)
48 CMM DIMENSION WDATA(KMX2*MNWAV*2)
49 CMM DIMENSION PNMGC(MNWAV*JMAXHF), DPNMGC(MNWAV*JMAXHF)
51 DIMENSION PNM(MNWAV,JMAXHF), IFAX(10), TRIG(IMAX), GW(JMAX)
52 DIMENSION SINCLT(JMAX), COSCLT(JMAX)
53 INTEGER LAG(MEND1,NEND1)
54 DIMENSION ALP(MNWAV), DALP(MNWAV)
55 CHARACTER*4 MWVORG,IWORG,INOUT
56 DATA IWORG,INOUT/'CLMN','IN '/
59 COMMON/COMPTR/KQA ,KQB ,KQF ,KQP ,KQE ,KQZ ,
60 1 KQTMP,KQWV,KQROT,KQDIV,KQU ,KQV ,KQPS,KDROT,KDWV,
61 2 MQTMP,MQWV,MQROT,MQDIV ,MQPS
63 C =================================================================
64 C >>> INPUT TOPOGRAPHY FILE <<<
65 C =================================================================
67 IF(MDIM.NE.MEND1) THEN
68 WRITE(6,*)'TOPOGRAPHY FILE IRRELEVANT MEND1,MDIM=',MEND1,MDIM
71 CMM READ(ITPGFL) ((WDATA(K,L),K=3, 4),L=1,MNWAV)
73 C *****************************************************************
74 C >>> INPUT INITIAL DATA <<<
75 C *****************************************************************
78 O TYPE ,IDATE ,FILE ,MODEL ,RESL ,EXPR ,KTUNIT,IDTYPE,
80 O IMD ,JMD ,NPROD ,FLONID, FLATID,
81 O XID ,XJD ,XLATD ,XLOND ,
82 O VCODD ,KMD ,RAA ,RBB ,
83 O IMM ,JMM ,NPROM ,FLONIM, FLATIM,
84 O XIM ,XJM ,XLATM ,XLONM ,
85 O VCODM ,KMM ,EDAT1 ,EDAT2 ,
87 WRITE(6,*) IDATE, FILE,MODEL,RESL,EXPR
88 WRITE(CINF(1:80),'(A80)') CINF2(1) ! FOR LONG FORECAST DIVISION
89 C IF( FILE.NE.'INITETA ' ) THEN
90 C WRITE(6,*) 'FILE ERROR! THIS IS NOT INITIAL DATA'
93 IF( IMAX.NE.IMD.OR.JMAX.NE.JMD.OR.KMAX.NE.KMD ) THEN
94 WRITE(6,*) 'DIMENSION ERROR'
107 C =================================================================
109 C =================================================================
113 O LEVEL , ELEM , TITLE , UNIT , KTSD , KTSA ,
117 IF( IRTN.EQ.-1 ) THEN
118 WRITE(6,*) '*** I CANNOT FIND INITIAL DATA KT=', KTSTAR
122 C write(*,*)'REDIEG : KT=',KT,KTSTAR,LEVEL,' ',ELEM
124 IF( KT.NE.KTSTAR ) GOTO 1100
125 IF( LEVEL.NE.'SURF'.OR.ELEM.NE.'P ' ) GOTO 1100
126 C WRITE(6,*) 'REDIEG : LEVEL=',LEVEL, 'ELEM=',ELEM, DATA(10*10)
127 CALL RESET(EDAT1,IMAX*JMAX*KMAX)
128 CALL MOVERD(DATA,EDAT1,IMD*JMD)
129 CALL MNMX(EDAT1,IMAX*JMAX,'QPS ')
130 CALL RESET(WDATA,KMX2*MNWAV)
132 I(MEND1,NEND1,JEND1,MNWAV,IMAX,JMAX,IMX ,JMAXHF, 1,
133 I PNM ,EDAT1,IFAX ,TRIG ,GW ,
135 CMM O WDATA(KMX2*MNWAV+1),
137 CALL REOWAV (WDATA(1,1,2),WDATA,MEND1,NEND1,JEND1,MNWAV,
138 CMM CALL REOWAV (WDATA(KMX2*MNWAV+1),WDATA,MEND1,NEND1,JEND1,MNWAV,
139 1 2, KMX2,0, 0, 2,LAG,IWORG,INOUT)
140 CALL WAVMAG (WDATA,MNWAV,KMAX,'QPS ')
142 READ(ITPGFL) ((WDATA(K,L,1),K=3,4),L=1,MNWAV)
143 CALL REOWAV (WDATA,QDATA,MEND1,NEND1,JEND1,MNWAV,
144 1 KMX2,KQDMAX,0,KQPS, 2,LAG,IWORG,INOUT)
148 CALL REOWAV (WDATA,QPHIS,MEND1,NEND1,JEND1,MNWAV,
149 1 KMX2, 2,2, 0, 2,LAG,MWVORG,INOUT)
157 C =================================================================
158 C >>> U, V -> ROT, DIV <<<
159 C =================================================================
164 O LEVEL , ELEM , TITLE , UNIT , KTSD , KTSA ,
168 IF( LEVEL.EQ.'SURF'.OR.ELEM.NE.'U ' ) GOTO 1210
169 CALL MOVERD(DATA,EDAT1(IMD*JMD*(K-1)+1),IMD*JMD)
175 O LEVEL , ELEM , TITLE , UNIT , KTSD , KTSA ,
179 IF( LEVEL.EQ.'SURF'.OR.ELEM.NE.'V ' ) GOTO 1310
180 CALL MOVERD(DATA,EDAT2(IMD*JMD*(K-1)+1),IMD*JMD)
184 CALL LGNDR1(COSCLT(J),MEND1,ALP,DALP)
186 CWCM (MN+(J-1)*MNWAV)= ALP(MN)*GW(J)/(1.0-COSCLT(J)**2)
187 CVRM (MN+(J-1)*MNWAV)=DALP(MN)*GW(J)/(1.0-COSCLT(J)**2)
188 CMM PNMGC(MN+(J-1)*MNWAV)= ALP(MN)*GW(J)/(1.0-COSCLT(J)**2)
189 CMM DPNMGC(MN+(J-1)*MNWAV)=DALP(MN)*GW(J)/(1.0-COSCLT(J)**2)
193 I(MEND1, NEND1 , JEND1, MNWAV, IMAX, JMAX , IMX , JMAXHF, KMAX,
194 I CWCM , CVRM , EDAT1, EDAT2, ER , SINCLT, IFAX, TRIG ,
195 CMM I PNMGC, DPNMGC, EDAT1, EDAT2, ER , SINCLT, IFAX, TRIG ,
196 O WDATA, WDATA(1,1,2),
197 CMM O WDATA, WDATA(KMX2*MNWAV+1),
199 CALL WAVMAG (WDATA,MNWAV,KMAX,'QROT')
200 CALL REOWAV (WDATA,QDATA,MEND1,NEND1,JEND1,MNWAV,
201 1 KMX2,KQDMAX,0,KQROT,KMX2,LAG,IWORG,INOUT)
202 CALL WAVMAG (WDATA(1,1,2),MNWAV,KMAX,'QDIV')
203 CMM CALL WAVMAG (WDATA(KMX2*MNWAV+1),MNWAV,KMAX,'QDIV')
204 CALL REOWAV (WDATA(1,1,2),QDATA,MEND1,NEND1,JEND1,MNWAV,
205 CMM CALL REOWAV (WDATA(KMX2*MNWAV+1),QDATA,MEND1,NEND1,JEND1,MNWAV,
206 1 KMX2,KQDMAX,0,KQDIV,KMX2,LAG,IWORG,INOUT)
208 C =================================================================
210 C =================================================================
215 O LEVEL , ELEM , TITLE , UNIT , KTSD , KTSA ,
219 IF( LEVEL.EQ.'SURF'.OR.ELEM.NE.'T ' ) GOTO 1410
220 CALL MOVERD(DATA,EDAT1(IMD*JMD*(K-1)+1),IMD*JMD)
223 I(MEND1,NEND1,JEND1,MNWAV,IMAX,JMAX,IMX ,JMAXHF,KMAX,
224 I PNM ,EDAT1,IFAX ,TRIG ,GW ,
227 CALL WAVMAG (WDATA,MNWAV,KMAX,'QTMP')
228 CALL REOWAV (WDATA,QDATA,MEND1,NEND1,JEND1,MNWAV,
229 1 KMX2,KQDMAX,0,KQTMP,KMX2,LAG,IWORG,INOUT)
231 C =================================================================
233 C =================================================================
238 O LEVEL , ELEM , TITLE , UNIT , KTSD , KTSA ,
242 IF( LEVEL.EQ.'SURF'.OR.ELEM.NE.'Q ' ) GOTO 1510
243 CALL MOVERD(DATA,EDAT1(IMD*JMD*(K-1)+1),IMD*JMD)
246 IF(EDAT1(IMD*JMD*(K-1)+I).LT.0.0)
247 1 EDAT1(IMD*JMD*(K-1)+I)=0.0
251 I(MEND1,NEND1,JEND1,MNWAV,IMAX,JMAX,IMX ,JMAXHF,KMAX,
252 I PNM ,EDAT1,IFAX ,TRIG ,GW ,
255 CALL WAVMAG (WDATA,MNWAV,KMAX,'QWV ')
256 CALL REOWAV (WDATA,QDATA,MEND1,NEND1,JEND1,MNWAV,
257 1 KMX2,KQDMAX,0,KQWV ,KMX2,LAG,IWORG,INOUT)
259 C =================================================================
260 C >>> CWC, CVR, XMB <<<
261 C =================================================================
266 O LEVEL , ELEM , TITLE , UNIT , KTSD , KTSA ,
270 IF( LEVEL.EQ.'SURF'.OR.ELEM.NE.'CWC ' ) GOTO 1610
271 CALL MOVERD(DATA,CWCP(IMD*JMD*(K-1)+1),IMD*JMD)
272 CALL MOVERD(DATA,CWCM(IMD*JMD*(K-1)+1),IMD*JMD)
275 IF(CWCP(IMD*JMD*(K-1)+I).LT.0.0)
276 1 CWCP(IMD*JMD*(K-1)+I)=0.0
277 IF(CWCM(IMD*JMD*(K-1)+I).LT.0.0)
278 1 CWCM(IMD*JMD*(K-1)+I)=0.0
285 O LEVEL , ELEM , TITLE , UNIT , KTSD , KTSA ,
289 IF( LEVEL.EQ.'SURF'.OR.ELEM.NE.'CVR ' ) GOTO 1710
290 CALL MOVERD(DATA,CVRP(IMD*JMD*(K-1)+1),IMD*JMD)
291 CALL MOVERD(DATA,CVRM(IMD*JMD*(K-1)+1),IMD*JMD)
294 IF(CVRP(IMD*JMD*(K-1)+I).LT.0.0)
295 1 CVRP(IMD*JMD*(K-1)+I)=0.0
296 IF(CVRM(IMD*JMD*(K-1)+I).LT.0.0)
297 1 CVRM(IMD*JMD*(K-1)+I)=0.0
304 O LEVEL , ELEM , TITLE , UNIT , KTSD , KTSA ,
308 IF( LEVEL.EQ.'SURF'.OR.ELEM.NE.'UMB ' ) GOTO 1810
309 CALL MOVERD(DATA,XMB(IMD*JMD*(K-1)+1),IMD*JMD)
312 IF(XMB(IMD*JMD*(K-1)+I).LT.0.0)
313 1 XMB(IMD*JMD*(K-1)+I)=0.0
318 C *****************************************************************
319 C >>> ( T - DELT T ) <<<
320 C *****************************************************************
322 CC IF(KTSTAR.LE.0) THEN
327 QDATA(MQTMP+K,L)=QDATA(KQTMP+K,L)
328 QDATA(MQROT+K,L)=QDATA(KQROT+K,L)
329 QDATA(MQDIV+K,L)=QDATA(KQDIV+K,L)
330 QDATA(MQWV +K,L)=QDATA(KQWV +K,L)
336 QDATA(MQPS +K,L)=QDATA(KQPS +K,L)
341 END SUBROUTINE REDIEG