NCEPLIBS-sp  2.3.3
sptranf1.f
Go to the documentation of this file.
1 C> @file
2 C>
3 C> Sptranf spectral transform
4 C> @author IREDELL @date 96-02-29
5 
6 C> THIS SUBPROGRAM PERFORMS AN SINGLE LATITUDE TRANSFORM FOR
7 C> SUBPROGRAM SPTRANF. USE THIS SUBPROGRAM OUTSIDE
8 C> THE SPTRANF FAMILY CONTEXT AT YOUR OWN RISK.
9 C>
10 C> @param IROMB - INTEGER SPECTRAL DOMAIN SHAPE
11 C> (0 FOR TRIANGULAR, 1 FOR RHOMBOIDAL)
12 C> @param MAXWV - INTEGER SPECTRAL TRUNCATION
13 C> @param IDRT - INTEGER GRID IDENTIFIER
14 C> (IDRT=4 FOR GAUSSIAN GRID,
15 C> IDRT=0 FOR EQUALLY-SPACED GRID INCLUDING POLES,
16 C> IDRT=256 FOR EQUALLY-SPACED GRID EXCLUDING POLES)
17 C> @param IMAX - INTEGER EVEN NUMBER OF LONGITUDES
18 C> @param JMAX - INTEGER NUMBER OF LATITUDES
19 C> @param JB - INTEGER LATITUDE INDEX (FROM POLE) TO BEGIN TRANSFORM
20 C> @param JE - INTEGER LATITUDE INDEX (FROM POLE) TO END TRANSFORM
21 C> @param EPS - REAL ((MAXWV+1)*((IROMB+1)*MAXWV+2)/2)
22 C> @param EPSTOP - REAL (MAXWV+1)
23 C> @param ENN1 - REAL ((MAXWV+1)*((IROMB+1)*MAXWV+2)/2)
24 C> @param ELONN1 - REAL ((MAXWV+1)*((IROMB+1)*MAXWV+2)/2)
25 C> @param EON - REAL ((MAXWV+1)*((IROMB+1)*MAXWV+2)/2)
26 C> @param EONTOP - REAL (MAXWV+1)
27 C> @param CLAT - REAL (JB:JE) COSINES OF LATITUDE
28 C> @param SLAT - REAL (JB:JE) SINES OF LATITUDE
29 C> @param WLAT - REAL (JB:JE) GAUSSIAN WEIGHTS
30 C> @param AFFT - REAL(8) (50000+4*IMAX) AUXILIARY ARRAY IF IDIR=0
31 C> @param PLN - REAL ((M+1)*((I+1)*M+2)/2,JB:JE) LEGENDRE POLYNOMIALS
32 C> @param PLNTOP - REAL (M+1,JB:JE) LEGENDRE POLYNOMIAL OVER TOP
33 C> @param MP - INTEGER IDENTIFIER (0 FOR SCALAR, 1 FOR VECTOR)
34 C> @param[out] W - REAL (*) WAVE FIELD IF IDIR>0
35 C> @param[out] WTOP - REAL (*) WAVE FIELD OVER TOP IF IDIR>0
36 C> @param[out] G - REAL (IMAX,2,JB:JE) GRID FIELD IF IDIR<0
37 C> @param IDIR - INTEGER TRANSFORM FLAG
38 C> (IDIR>0 FOR WAVE TO GRID, IDIR<0 FOR GRID TO WAVE)
39 C>
40 C> SUBPROGRAMS CALLED:
41 C> - SPSYNTH SYNTHESIZE FOURIER FROM SPECTRAL
42 C> - SPANALY ANALYZE SPECTRAL FROM FOURIER
43 C> - SPFFTE PERFORM FAST FOURIER TRANSFORM
44  SUBROUTINE sptranf1(IROMB,MAXWV,IDRT,IMAX,JMAX,JB,JE,
45  & EPS,EPSTOP,ENN1,ELONN1,EON,EONTOP,
46  & AFFT,CLAT,SLAT,WLAT,PLN,PLNTOP,MP,
47  & W,WTOP,G,IDIR)
48 
49  REAL EPS((MAXWV+1)*((IROMB+1)*MAXWV+2)/2),EPSTOP(MAXWV+1)
50  REAL ENN1((MAXWV+1)*((IROMB+1)*MAXWV+2)/2)
51  REAL ELONN1((MAXWV+1)*((IROMB+1)*MAXWV+2)/2)
52  REAL EON((MAXWV+1)*((IROMB+1)*MAXWV+2)/2),EONTOP(MAXWV+1)
53  REAL(8) AFFT(50000+4*IMAX)
54  REAL CLAT(JB:JE),SLAT(JB:JE),WLAT(JB:JE)
55  REAL PLN((MAXWV+1)*((IROMB+1)*MAXWV+2)/2,JB:JE)
56  REAL PLNTOP(MAXWV+1,JB:JE)
57  REAL W((MAXWV+1)*((IROMB+1)*MAXWV+2))
58  REAL WTOP(2*(MAXWV+1))
59  REAL G(IMAX,2,JB:JE)
60  REAL F(IMAX+2,2)
61 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
62 ! write(0,*) 'sptranf1 top'
63  kw=(maxwv+1)*((iromb+1)*maxwv+2)
64  kwtop=2*(maxwv+1)
65  IF(idir.GT.0) THEN
66  DO j=jb,je
67  CALL spsynth(iromb,maxwv,imax,imax+2,kw,kwtop,1,
68  & clat(j),pln(1,j),plntop(1,j),mp,
69  & w,wtop,f)
70  CALL spffte(imax,(imax+2)/2,imax,2,f,g(1,1,j),+1,afft)
71  ENDDO
72  ELSE
73  DO j=jb,je
74  CALL spffte(imax,(imax+2)/2,imax,2,f,g(1,1,j),-1,afft)
75  CALL spanaly(iromb,maxwv,imax,imax+2,kw,kwtop,1,
76  & wlat(j),clat(j),pln(1,j),plntop(1,j),mp,
77  & f,w,wtop)
78  ENDDO
79 ! write(0,*) 'sptranf1 end'
80  ENDIF
81 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
82  END
spsynth
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...
Definition: spsynth.f:35
spffte
subroutine spffte(IMAX, INCW, INCG, KMAX, W, G, IDIR, AFFT)
This subprogram performs multiple fast fourier transforms between complex amplitudes in fourier space...
Definition: spffte.f:50
sptranf1
subroutine sptranf1(IROMB, MAXWV, IDRT, IMAX, JMAX, JB, JE, EPS, EPSTOP, ENN1, ELONN1, EON, EONTOP, AFFT, CLAT, SLAT, WLAT, PLN, PLNTOP, MP, W, WTOP, G, IDIR)
THIS SUBPROGRAM PERFORMS AN SINGLE LATITUDE TRANSFORM FOR SUBPROGRAM SPTRANF.
Definition: sptranf1.f:48