80 SUBROUTINE sptranfv(IROMB,MAXWV,IDRT,IMAX,JMAX,KMAX,
81 & IP,IS,JN,JS,KW,KG,JB,JE,JC,
82 & WAVED,WAVEZ,GRIDUN,GRIDUS,GRIDVN,GRIDVS,IDIR)
84 REAL WAVED(*),WAVEZ(*),GRIDUN(*),GRIDUS(*),GRIDVN(*),GRIDVS(*)
85 REAL EPS((MAXWV+1)*((IROMB+1)*MAXWV+2)/2),EPSTOP(MAXWV+1)
86 REAL ENN1((MAXWV+1)*((IROMB+1)*MAXWV+2)/2)
87 REAL ELONN1((MAXWV+1)*((IROMB+1)*MAXWV+2)/2)
88 REAL EON((MAXWV+1)*((IROMB+1)*MAXWV+2)/2),EONTOP(MAXWV+1)
89 REAL(8) AFFT(50000+4*IMAX), AFFT_TMP(50000+4*IMAX)
90 REAL CLAT(JB:JE),SLAT(JB:JE),WLAT(JB:JE)
91 REAL PLN((MAXWV+1)*((IROMB+1)*MAXWV+2)/2,JB:JE)
92 REAL PLNTOP(MAXWV+1,JB:JE)
94 REAL W((MAXWV+1)*((IROMB+1)*MAXWV+2)/2*2,2)
95 REAL WTOP(2*(MAXWV+1),2)
97 REAL WINC((MAXWV+1)*((IROMB+1)*MAXWV+2)/2*2,2)
100 mx=(maxwv+1)*((iromb+1)*maxwv+2)/2
102 CALL sptranf0(iromb,maxwv,idrt,imax,jmax,jb,je,
103 & eps,epstop,enn1,elonn1,eon,eontop,
104 & afft,clat,slat,wlat,pln,plntop)
112 CALL spdz2uv(iromb,maxwv,enn1,elonn1,eon,eontop,
113 & waved(kws+1),wavez(kws+1),
114 & w(1,1),w(1,2),wtop(1,1),wtop(1,2))
116 CALL sptranf1(iromb,maxwv,idrt,imax,jmax,j,j,
117 & eps,epstop,enn1,elonn1,eon,eontop,
118 & afft_tmp,clat(j),slat(j),wlat(j),
119 & pln(1,j),plntop(1,j),mp,
120 & w(1,1),wtop(1,1),g(1,1,1),idir)
121 CALL sptranf1(iromb,maxwv,idrt,imax,jmax,j,j,
122 & eps,epstop,enn1,elonn1,eon,eontop,
123 & afft_tmp,clat(j),slat(j),wlat(j),
124 & pln(1,j),plntop(1,j),mp,
125 & w(1,2),wtop(1,2),g(1,1,2),idir)
126 IF(ip.EQ.1.AND.is.EQ.1)
THEN
128 ijkn=i+(j-jb)*jn+(k-1)*kg
129 ijks=i+(j-jb)*js+(k-1)*kg
130 gridun(ijkn)=g(i,1,1)
131 gridus(ijks)=g(i,2,1)
132 gridvn(ijkn)=g(i,1,2)
133 gridvs(ijks)=g(i,2,2)
137 ijkn=mod(i+ip-2,imax)*is+(j-jb)*jn+(k-1)*kg+1
138 ijks=mod(i+ip-2,imax)*is+(j-jb)*js+(k-1)*kg+1
139 gridun(ijkn)=g(i,1,1)
140 gridus(ijks)=g(i,2,1)
141 gridvn(ijkn)=g(i,1,2)
142 gridvs(ijks)=g(i,2,2)
157 IF(wlat(j).GT.0.)
THEN
158 IF(ip.EQ.1.AND.is.EQ.1)
THEN
160 ijkn=i+(j-jb)*jn+(k-1)*kg
161 ijks=i+(j-jb)*js+(k-1)*kg
162 g(i,1,1)=gridun(ijkn)/clat(j)**2
163 g(i,2,1)=gridus(ijks)/clat(j)**2
164 g(i,1,2)=gridvn(ijkn)/clat(j)**2
165 g(i,2,2)=gridvs(ijks)/clat(j)**2
169 ijkn=mod(i+ip-2,imax)*is+(j-jb)*jn+(k-1)*kg+1
170 ijks=mod(i+ip-2,imax)*is+(j-jb)*js+(k-1)*kg+1
171 g(i,1,1)=gridun(ijkn)/clat(j)**2
172 g(i,2,1)=gridus(ijks)/clat(j)**2
173 g(i,1,2)=gridvn(ijkn)/clat(j)**2
174 g(i,2,2)=gridvs(ijks)/clat(j)**2
177 CALL sptranf1(iromb,maxwv,idrt,imax,jmax,j,j,
178 & eps,epstop,enn1,elonn1,eon,eontop,
179 & afft_tmp,clat(j),slat(j),wlat(j),
180 & pln(1,j),plntop(1,j),mp,
181 & w(1,1),wtop(1,1),g(1,1,1),idir)
182 CALL sptranf1(iromb,maxwv,idrt,imax,jmax,j,j,
183 & eps,epstop,enn1,elonn1,eon,eontop,
184 & afft_tmp,clat(j),slat(j),wlat(j),
185 & pln(1,j),plntop(1,j),mp,
186 & w(1,2),wtop(1,2),g(1,1,2),idir)
189 CALL spuv2dz(iromb,maxwv,enn1,elonn1,eon,eontop,
190 & w(1,1),w(1,2),wtop(1,1),wtop(1,2),
191 & winc(1,1),winc(1,2))
192 waved(kws+1:kws+2*mx)=waved(kws+1:kws+2*mx)+winc(1:2*mx,1)
193 wavez(kws+1:kws+2*mx)=wavez(kws+1:kws+2*mx)+winc(1:2*mx,2)