NCEPLIBS-sp  2.3.3
sptgptd.f
Go to the documentation of this file.
1 C> @file
2 C>
3 C> Transform spectral to station point gradients
4 C> @author IREDELL @date 96-02-29
5 
6 C> This subprogram performs a spherical transform
7 c> from spectral coefficients of scalar fields
8 c> to specified sets of station point gradients on the globe.
9 C> The wave-space can be either triangular or rhomboidal.
10 C> The wave and point fields may have general indexing,
11 c> but each wave field is in sequential 'ibm order',
12 c> i.e. with zonal wavenumber as the slower index.
13 C> The transforms are all multiprocessed over stations.
14 C> Transform several fields at a time to improve vectorization.
15 C> Subprogram can be called from a multiprocessing environment.
16 C>
17 C> PROGRAM HISTORY LOG:
18 C> - 96-02-29 IREDELL
19 C> - 1998-12-15 IREDELL OPENMP DIRECTIVES INSERTED
20 C>
21 C> @param IROMB - INTEGER SPECTRAL DOMAIN SHAPE
22 C> (0 FOR TRIANGULAR, 1 FOR RHOMBOIDAL)
23 C> @param MAXWV - INTEGER SPECTRAL TRUNCATION
24 C> @param KMAX - INTEGER NUMBER OF FIELDS TO TRANSFORM.
25 C> @param NMAX - INTEGER NUMBER OF STATION POINTS TO RETURN
26 C> @param KWSKIP - INTEGER SKIP NUMBER BETWEEN WAVE FIELDS
27 C> (DEFAULTS TO (MAXWV+1)*((IROMB+1)*MAXWV+2) IF KWSKIP=0)
28 C> @param KGSKIP - INTEGER SKIP NUMBER BETWEEN STATION POINT SETS
29 C> (DEFAULTS TO NMAX IF KGSKIP=0)
30 C> @param NRSKIP - INTEGER SKIP NUMBER BETWEEN STATION LATS AND LONS
31 C> (DEFAULTS TO 1 IF NRSKIP=0)
32 C> @param NGSKIP - INTEGER SKIP NUMBER BETWEEN STATION POINTS
33 C> (DEFAULTS TO 1 IF NGSKIP=0)
34 C> @param RLAT - REAL (*) STATION LATITUDES IN DEGREES
35 C> @param RLON - REAL (*) STATION LONGITUDES IN DEGREES
36 C> @param WAVE - REAL (*) WAVE FIELDS
37 C> @param XP - REAL (*) STATION POINT X-GRADIENT SETS
38 C> @param YP - REAL (*) STATION POINT Y-GRADIENT SETS
39 C>
40 C> SUBPROGRAMS CALLED:
41 C> - SPWGET() GET WAVE-SPACE CONSTANTS
42 C> - SPLAPLAC() COMPUTE LAPLACIAN IN SPECTRAL SPACE
43 C> - SPTGPTV() TRANSFORM SPECTRAL VECTOR TO STATION POINTS
44  SUBROUTINE sptgptd(IROMB,MAXWV,KMAX,NMAX,
45  & KWSKIP,KGSKIP,NRSKIP,NGSKIP,
46  & RLAT,RLON,WAVE,XP,YP)
47 
48  REAL RLAT(*),RLON(*),WAVE(*),XP(*),YP(*)
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 WD((MAXWV+1)*((IROMB+1)*MAXWV+2)/2*2+1,KMAX)
54  REAL WZ((MAXWV+1)*((IROMB+1)*MAXWV+2)/2*2+1,KMAX)
55 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
56 C CALCULATE PRELIMINARY CONSTANTS
57  CALL spwget(iromb,maxwv,eps,epstop,enn1,elonn1,eon,eontop)
58  mx=(maxwv+1)*((iromb+1)*maxwv+2)/2
59  mdim=2*mx+1
60  kw=kwskip
61  IF(kw.EQ.0) kw=2*mx
62 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
63 C CALCULATE STATION FIELDS
64 C$OMP PARALLEL DO PRIVATE(KWS)
65  DO k=1,kmax
66  kws=(k-1)*kw
67  CALL splaplac(iromb,maxwv,enn1,wave(kws+1),wd(1,k),1)
68  wz(1:2*mx,k)=0.
69  ENDDO
70  CALL sptgptv(iromb,maxwv,kmax,nmax,mdim,kgskip,nrskip,ngskip,
71  & rlat,rlon,wd,wz,xp,yp)
72 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
73  END
spwget
subroutine spwget(IROMB, MAXWV, EPS, EPSTOP, ENN1, ELONN1, EON, EONTOP)
This subprogram gets wave-space constants.
Definition: spwget.f:22
splaplac
subroutine splaplac(I, M, ENN1, Q, QD2, IDIR)
COMPUTES THE LAPLACIAN OR THE INVERSE LAPLACIAN OF A SCALAR FIELD IN SPECTRAL SPACE.
Definition: splaplac.f:22
sptgptd
subroutine sptgptd(IROMB, MAXWV, KMAX, NMAX, KWSKIP, KGSKIP, NRSKIP, NGSKIP, RLAT, RLON, WAVE, XP, YP)
This subprogram performs a spherical transform from spectral coefficients of scalar fields to specifi...
Definition: sptgptd.f:47
sptgptv
subroutine sptgptv(IROMB, MAXWV, KMAX, NMAX, KWSKIP, KGSKIP, NRSKIP, NGSKIP, RLAT, RLON, WAVED, WAVEZ, UP, VP)
THIS SUBPROGRAM PERFORMS A SPHERICAL TRANSFORM FROM SPECTRAL COEFFICIENTS OF DIVERGENCES AND CURLS TO...
Definition: sptgptv.f:52