78 SUBROUTINE sptgps(IROMB,MAXWV,KMAX,NPS,
79 & KWSKIP,KGSKIP,NISKIP,NJSKIP,
80 & TRUE,XMESH,ORIENT,WAVE,GN,GS)
82 REAL WAVE(*),GN(*),GS(*)
83 REAL EPS((MAXWV+1)*((IROMB+1)*MAXWV+2)/2),EPSTOP(MAXWV+1)
84 REAL ENN1((MAXWV+1)*((IROMB+1)*MAXWV+2)/2)
85 REAL ELONN1((MAXWV+1)*((IROMB+1)*MAXWV+2)/2)
86 REAL EON((MAXWV+1)*((IROMB+1)*MAXWV+2)/2),EONTOP(MAXWV+1)
88 REAL SLON(MAXWV,8),CLON(MAXWV,8),SROT(0:3),CROT(0:3)
89 REAL WTOP(2*(MAXWV+1),KMAX)
90 REAL PLN((MAXWV+1)*((IROMB+1)*MAXWV+2)/2),PLNTOP(MAXWV+1)
91 REAL F(2*MAXWV+3,2,KMAX)
92 DATA srot/0.,1.,0.,-1./,crot/1.,0.,-1.,0./
93 parameter(rerth=6.3712e6)
94 parameter(pi=3.14159265358979,dpr=180./pi)
97 CALL spwget(iromb,maxwv,eps,epstop,enn1,elonn1,eon,eontop)
98 mx=(maxwv+1)*((iromb+1)*maxwv+2)/2
106 IF(kg.EQ.0) kg=nps*nps
111 gq=((1.+sin(true/dpr))*rerth/xmesh)**2
120 ij1=(i1-1)*ni+(j1-1)*nj+1
123 CALL splegend(iromb,maxwv,slat1,clat1,eps,epstop,
125 CALL spsynth(iromb,maxwv,2*maxwv,idim,kw,2*mxtop,kmax,
126 & clat1,pln,plntop,mp,wave,wtop,f)
150 ij1=(i1-1)*ni+(j1-1)*nj+1
151 ij3=(i3-1)*ni+(j3-1)*nj+1
152 ij5=(i5-1)*ni+(j5-1)*nj+1
153 ij7=(i7-1)*ni+(j7-1)*nj+1
157 slat1=(gq-rq)/(gq+rq)
158 clat1=sqrt(1.-slat1**2)
159 CALL splegend(iromb,maxwv,slat1,clat1,eps,epstop,
161 CALL spsynth(iromb,maxwv,2*maxwv,idim,kw,2*mxtop,kmax,
162 & clat1,pln,plntop,mp,wave,wtop,f)
164 slon(l,1)=sin(l*radlon)
165 clon(l,1)=cos(l*radlon)
166 slon(l,3)=slon(l,1)*crot(mod(1*l,4))
167 & -clon(l,1)*srot(mod(1*l,4))
168 clon(l,3)=clon(l,1)*crot(mod(1*l,4))
169 & +slon(l,1)*srot(mod(1*l,4))
170 slon(l,5)=slon(l,1)*crot(mod(2*l,4))
171 & -clon(l,1)*srot(mod(2*l,4))
172 clon(l,5)=clon(l,1)*crot(mod(2*l,4))
173 & +slon(l,1)*srot(mod(2*l,4))
174 slon(l,7)=slon(l,1)*crot(mod(3*l,4))
175 & -clon(l,1)*srot(mod(3*l,4))
176 clon(l,7)=clon(l,1)*crot(mod(3*l,4))
177 & +slon(l,1)*srot(mod(3*l,4))
198 gn(ij1)=gn(ij1)+2*(f(lr,1,1)*clon(l,1)
199 & -f(li,1,1)*slon(l,1))
200 gn(ij3)=gn(ij3)+2*(f(lr,1,1)*clon(l,3)
201 & -f(li,1,1)*slon(l,3))
202 gn(ij5)=gn(ij5)+2*(f(lr,1,1)*clon(l,5)
203 & -f(li,1,1)*slon(l,5))
204 gn(ij7)=gn(ij7)+2*(f(lr,1,1)*clon(l,7)
205 & -f(li,1,1)*slon(l,7))
206 gs(ij1)=gs(ij1)+2*(f(lr,2,1)*clon(l,5)
207 & -f(li,2,1)*slon(l,5))
208 gs(ij3)=gs(ij3)+2*(f(lr,2,1)*clon(l,3)
209 & -f(li,2,1)*slon(l,3))
210 gs(ij5)=gs(ij5)+2*(f(lr,2,1)*clon(l,1)
211 & -f(li,2,1)*slon(l,1))
212 gs(ij7)=gs(ij7)+2*(f(lr,2,1)*clon(l,7)
213 & -f(li,2,1)*slon(l,7))
225 gn(ijk1)=gn(ijk1)+2*(f(lr,1,k)*clon(l,1)
226 & -f(li,1,k)*slon(l,1))
227 gn(ijk3)=gn(ijk3)+2*(f(lr,1,k)*clon(l,3)
228 & -f(li,1,k)*slon(l,3))
229 gn(ijk5)=gn(ijk5)+2*(f(lr,1,k)*clon(l,5)
230 & -f(li,1,k)*slon(l,5))
231 gn(ijk7)=gn(ijk7)+2*(f(lr,1,k)*clon(l,7)
232 & -f(li,1,k)*slon(l,7))
233 gs(ijk1)=gs(ijk1)+2*(f(lr,2,k)*clon(l,5)
234 & -f(li,2,k)*slon(l,5))
235 gs(ijk3)=gs(ijk3)+2*(f(lr,2,k)*clon(l,3)
236 & -f(li,2,k)*slon(l,3))
237 gs(ijk5)=gs(ijk5)+2*(f(lr,2,k)*clon(l,1)
238 & -f(li,2,k)*slon(l,1))
239 gs(ijk7)=gs(ijk7)+2*(f(lr,2,k)*clon(l,7)
240 & -f(li,2,k)*slon(l,7))
255 radlon=(orient-45)/dpr
262 ij1=(i1-1)*ni+(j1-1)*nj+1
263 ij3=(i3-1)*ni+(j3-1)*nj+1
264 ij5=(i5-1)*ni+(j5-1)*nj+1
265 ij7=(i7-1)*ni+(j7-1)*nj+1
269 slat1=(gq-rq)/(gq+rq)
270 clat1=sqrt(1.-slat1**2)
271 CALL splegend(iromb,maxwv,slat1,clat1,eps,epstop,
273 CALL spsynth(iromb,maxwv,2*maxwv,idim,kw,2*mxtop,kmax,
274 & clat1,pln,plntop,mp,wave,wtop,f)
276 slon(l,1)=sin(l*radlon)
277 clon(l,1)=cos(l*radlon)
278 slon(l,3)=slon(l,1)*crot(mod(1*l,4))
279 & -clon(l,1)*srot(mod(1*l,4))
280 clon(l,3)=clon(l,1)*crot(mod(1*l,4))
281 & +slon(l,1)*srot(mod(1*l,4))
282 slon(l,5)=slon(l,1)*crot(mod(2*l,4))
283 & -clon(l,1)*srot(mod(2*l,4))
284 clon(l,5)=clon(l,1)*crot(mod(2*l,4))
285 & +slon(l,1)*srot(mod(2*l,4))
286 slon(l,7)=slon(l,1)*crot(mod(3*l,4))
287 & -clon(l,1)*srot(mod(3*l,4))
288 clon(l,7)=clon(l,1)*crot(mod(3*l,4))
289 & +slon(l,1)*srot(mod(3*l,4))
310 gn(ij1)=gn(ij1)+2*(f(lr,1,1)*clon(l,1)
311 & -f(li,1,1)*slon(l,1))
312 gn(ij3)=gn(ij3)+2*(f(lr,1,1)*clon(l,3)
313 & -f(li,1,1)*slon(l,3))
314 gn(ij5)=gn(ij5)+2*(f(lr,1,1)*clon(l,5)
315 & -f(li,1,1)*slon(l,5))
316 gn(ij7)=gn(ij7)+2*(f(lr,1,1)*clon(l,7)
317 & -f(li,1,1)*slon(l,7))
318 gs(ij1)=gs(ij1)+2*(f(lr,2,1)*clon(l,3)
319 & -f(li,2,1)*slon(l,3))
320 gs(ij3)=gs(ij3)+2*(f(lr,2,1)*clon(l,1)
321 & -f(li,2,1)*slon(l,1))
322 gs(ij5)=gs(ij5)+2*(f(lr,2,1)*clon(l,7)
323 & -f(li,2,1)*slon(l,7))
324 gs(ij7)=gs(ij7)+2*(f(lr,2,1)*clon(l,5)
325 & -f(li,2,1)*slon(l,5))
337 gn(ijk1)=gn(ijk1)+2*(f(lr,1,k)*clon(l,1)
338 & -f(li,1,k)*slon(l,1))
339 gn(ijk3)=gn(ijk3)+2*(f(lr,1,k)*clon(l,3)
340 & -f(li,1,k)*slon(l,3))
341 gn(ijk5)=gn(ijk5)+2*(f(lr,1,k)*clon(l,5)
342 & -f(li,1,k)*slon(l,5))
343 gn(ijk7)=gn(ijk7)+2*(f(lr,1,k)*clon(l,7)
344 & -f(li,1,k)*slon(l,7))
345 gs(ijk1)=gs(ijk1)+2*(f(lr,2,k)*clon(l,3)
346 & -f(li,2,k)*slon(l,3))
347 gs(ijk3)=gs(ijk3)+2*(f(lr,2,k)*clon(l,1)
348 & -f(li,2,k)*slon(l,1))
349 gs(ijk5)=gs(ijk5)+2*(f(lr,2,k)*clon(l,7)
350 & -f(li,2,k)*slon(l,7))
351 gs(ijk7)=gs(ijk7)+2*(f(lr,2,k)*clon(l,5)
352 & -f(li,2,k)*slon(l,5))
382 ij1=(i1-1)*ni+(j1-1)*nj+1
383 ij2=(i2-1)*ni+(j2-1)*nj+1
384 ij3=(i3-1)*ni+(j3-1)*nj+1
385 ij4=(i4-1)*ni+(j4-1)*nj+1
386 ij5=(i5-1)*ni+(j5-1)*nj+1
387 ij6=(i6-1)*ni+(j6-1)*nj+1
388 ij7=(i7-1)*ni+(j7-1)*nj+1
389 ij8=(i8-1)*ni+(j8-1)*nj+1
393 slat1=(gq-rq)/(gq+rq)
394 clat1=sqrt(1.-slat1**2)
395 radlon1=orient/dpr+atan(-di1/dj1)
396 radlon2=(orient-45)/dpr*2-radlon1
397 CALL splegend(iromb,maxwv,slat1,clat1,eps,epstop,
399 CALL spsynth(iromb,maxwv,2*maxwv,idim,kw,2*mxtop,kmax,
400 & clat1,pln,plntop,mp,wave,wtop,f)
402 slon(l,1)=sin(l*radlon1)
403 clon(l,1)=cos(l*radlon1)
404 slon(l,2)=sin(l*radlon2)
405 clon(l,2)=cos(l*radlon2)
406 slon(l,3)=slon(l,1)*crot(mod(1*l,4))
407 & -clon(l,1)*srot(mod(1*l,4))
408 clon(l,3)=clon(l,1)*crot(mod(1*l,4))
409 & +slon(l,1)*srot(mod(1*l,4))
410 slon(l,4)=slon(l,2)*crot(mod(1*l,4))
411 & -clon(l,2)*srot(mod(1*l,4))
412 clon(l,4)=clon(l,2)*crot(mod(1*l,4))
413 & +slon(l,2)*srot(mod(1*l,4))
414 slon(l,5)=slon(l,1)*crot(mod(2*l,4))
415 & -clon(l,1)*srot(mod(2*l,4))
416 clon(l,5)=clon(l,1)*crot(mod(2*l,4))
417 & +slon(l,1)*srot(mod(2*l,4))
418 slon(l,6)=slon(l,2)*crot(mod(2*l,4))
419 & -clon(l,2)*srot(mod(2*l,4))
420 clon(l,6)=clon(l,2)*crot(mod(2*l,4))
421 & +slon(l,2)*srot(mod(2*l,4))
422 slon(l,7)=slon(l,1)*crot(mod(3*l,4))
423 & -clon(l,1)*srot(mod(3*l,4))
424 clon(l,7)=clon(l,1)*crot(mod(3*l,4))
425 & +slon(l,1)*srot(mod(3*l,4))
426 slon(l,8)=slon(l,2)*crot(mod(3*l,4))
427 & -clon(l,2)*srot(mod(3*l,4))
428 clon(l,8)=clon(l,2)*crot(mod(3*l,4))
429 & +slon(l,2)*srot(mod(3*l,4))
462 gn(ij1)=gn(ij1)+2*(f(lr,1,1)*clon(l,1)
463 & -f(li,1,1)*slon(l,1))
464 gn(ij2)=gn(ij2)+2*(f(lr,1,1)*clon(l,2)
465 & -f(li,1,1)*slon(l,2))
466 gn(ij3)=gn(ij3)+2*(f(lr,1,1)*clon(l,3)
467 & -f(li,1,1)*slon(l,3))
468 gn(ij4)=gn(ij4)+2*(f(lr,1,1)*clon(l,4)
469 & -f(li,1,1)*slon(l,4))
470 gn(ij5)=gn(ij5)+2*(f(lr,1,1)*clon(l,5)
471 & -f(li,1,1)*slon(l,5))
472 gn(ij6)=gn(ij6)+2*(f(lr,1,1)*clon(l,6)
473 & -f(li,1,1)*slon(l,6))
474 gn(ij7)=gn(ij7)+2*(f(lr,1,1)*clon(l,7)
475 & -f(li,1,1)*slon(l,7))
476 gn(ij8)=gn(ij8)+2*(f(lr,1,1)*clon(l,8)
477 & -f(li,1,1)*slon(l,8))
478 gs(ij1)=gs(ij1)+2*(f(lr,2,1)*clon(l,4)
479 & -f(li,2,1)*slon(l,4))
480 gs(ij2)=gs(ij2)+2*(f(lr,2,1)*clon(l,3)
481 & -f(li,2,1)*slon(l,3))
482 gs(ij3)=gs(ij3)+2*(f(lr,2,1)*clon(l,2)
483 & -f(li,2,1)*slon(l,2))
484 gs(ij4)=gs(ij4)+2*(f(lr,2,1)*clon(l,1)
485 & -f(li,2,1)*slon(l,1))
486 gs(ij5)=gs(ij5)+2*(f(lr,2,1)*clon(l,8)
487 & -f(li,2,1)*slon(l,8))
488 gs(ij6)=gs(ij6)+2*(f(lr,2,1)*clon(l,7)
489 & -f(li,2,1)*slon(l,7))
490 gs(ij7)=gs(ij7)+2*(f(lr,2,1)*clon(l,6)
491 & -f(li,2,1)*slon(l,6))
492 gs(ij8)=gs(ij8)+2*(f(lr,2,1)*clon(l,5)
493 & -f(li,2,1)*slon(l,5))
509 gn(ijk1)=gn(ijk1)+2*(f(lr,1,k)*clon(l,1)
510 & -f(li,1,k)*slon(l,1))
511 gn(ijk2)=gn(ijk2)+2*(f(lr,1,k)*clon(l,2)
512 & -f(li,1,k)*slon(l,2))
513 gn(ijk3)=gn(ijk3)+2*(f(lr,1,k)*clon(l,3)
514 & -f(li,1,k)*slon(l,3))
515 gn(ijk4)=gn(ijk4)+2*(f(lr,1,k)*clon(l,4)
516 & -f(li,1,k)*slon(l,4))
517 gn(ijk5)=gn(ijk5)+2*(f(lr,1,k)*clon(l,5)
518 & -f(li,1,k)*slon(l,5))
519 gn(ijk6)=gn(ijk6)+2*(f(lr,1,k)*clon(l,6)
520 & -f(li,1,k)*slon(l,6))
521 gn(ijk7)=gn(ijk7)+2*(f(lr,1,k)*clon(l,7)
522 & -f(li,1,k)*slon(l,7))
523 gn(ijk8)=gn(ijk8)+2*(f(lr,1,k)*clon(l,8)
524 & -f(li,1,k)*slon(l,8))
525 gs(ijk1)=gs(ijk1)+2*(f(lr,2,k)*clon(l,4)
526 & -f(li,2,k)*slon(l,4))
527 gs(ijk2)=gs(ijk2)+2*(f(lr,2,k)*clon(l,3)
528 & -f(li,2,k)*slon(l,3))
529 gs(ijk3)=gs(ijk3)+2*(f(lr,2,k)*clon(l,2)
530 & -f(li,2,k)*slon(l,2))
531 gs(ijk4)=gs(ijk4)+2*(f(lr,2,k)*clon(l,1)
532 & -f(li,2,k)*slon(l,1))
533 gs(ijk5)=gs(ijk5)+2*(f(lr,2,k)*clon(l,8)
534 & -f(li,2,k)*slon(l,8))
535 gs(ijk6)=gs(ijk6)+2*(f(lr,2,k)*clon(l,7)
536 & -f(li,2,k)*slon(l,7))
537 gs(ijk7)=gs(ijk7)+2*(f(lr,2,k)*clon(l,6)
538 & -f(li,2,k)*slon(l,6))
539 gs(ijk8)=gs(ijk8)+2*(f(lr,2,k)*clon(l,5)
540 & -f(li,2,k)*slon(l,5))
subroutine splegend(I, M, SLAT, CLAT, EPS, EPSTOP, PLN, PLNTOP)
Evaluates the orthonormal associated Legendre polynomials in the spectral domain at a given latitude.
subroutine spsynth(I, M, IM, IX, NC, NCTOP, KM, CLAT, PLN, PLNTOP, MP, SPC, SPCTOP, F)
Synthesizes Fourier coefficients from spectral coefficients for a latitude pair (Northern and Souther...
subroutine sptgps(IROMB, MAXWV, KMAX, NPS, KWSKIP, KGSKIP, NISKIP, NJSKIP, TRUE, XMESH, ORIENT, WAVE, GN, GS)
This subprogram performs a spherical transform from spectral coefficients of scalar quantities to sca...
subroutine spwget(IROMB, MAXWV, EPS, EPSTOP, ENN1, ELONN1, EON, EONTOP)
This subprogram gets wave-space constants.