NCEPLIBS-sp  2.5.0
sptgptd.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Transform spectral to station point gradients.
3 C>
4 C> ### Program History Log
5 C> Date | Programmer | Comments
6 C> -----|------------|---------
7 C> 96-02-29 | Iredell | Initial.
8 C> 1998-12-15 | Iredell | Openmp directives inserted.
9 C>
10 C> @author Iredell @date 96-02-29
11 
12 C> This subprogram performs a spherical transform
13 c> from spectral coefficients of scalar fields
14 c> to specified sets of station point gradients on the globe.
15 C>
16 C> The wave-space can be either triangular or rhomboidal.
17 C>
18 C> The wave and point fields may have general indexing,
19 c> but each wave field is in sequential 'IBM order',
20 c> i.e. with zonal wavenumber as the slower index.
21 C>
22 C> The transforms are all multiprocessed over stations.
23 C>
24 C> Transform several fields at a time to improve vectorization.
25 C>
26 C> Subprogram can be called from a multiprocessing environment.
27 C>
28 C> @param IROMB spectral domain shape
29 c> (0 for triangular, 1 for rhomboidal)
30 C> @param MAXWV spectral truncation
31 C> @param KMAX number of fields to transform.
32 C> @param NMAX number of station points to return
33 C> @param KWSKIP skip number between wave fields
34 C> (defaults to (MAXWV+1)*((IROMB+1)*MAXWV+2) if KWSKIP=0)
35 C> @param KGSKIP skip number between station point sets
36 C> (defaults to NMAX if KGSKIP=0)
37 C> @param NRSKIP skip number between station lats and lons
38 C> (defaults to 1 if NRSKIP=0)
39 C> @param NGSKIP skip number between station points
40 c> (defaults to 1 if NGSKIP=0)
41 C> @param RLAT station latitudes in degrees
42 C> @param RLON station longitudes in degrees
43 C> @param WAVE wave fields
44 C> @param XP station point x-gradient sets
45 C> @param YP station point y-gradient sets
46 C>
47 C> @author Iredell @date 96-02-29
48  SUBROUTINE sptgptd(IROMB,MAXWV,KMAX,NMAX,
49  & KWSKIP,KGSKIP,NRSKIP,NGSKIP,
50  & RLAT,RLON,WAVE,XP,YP)
51 
52  REAL RLAT(*),RLON(*),WAVE(*),XP(*),YP(*)
53  REAL EPS((MAXWV+1)*((IROMB+1)*MAXWV+2)/2),EPSTOP(MAXWV+1)
54  REAL ENN1((MAXWV+1)*((IROMB+1)*MAXWV+2)/2)
55  REAL ELONN1((MAXWV+1)*((IROMB+1)*MAXWV+2)/2)
56  REAL EON((MAXWV+1)*((IROMB+1)*MAXWV+2)/2),EONTOP(MAXWV+1)
57  REAL WD((MAXWV+1)*((IROMB+1)*MAXWV+2)/2*2+1,KMAX)
58  REAL WZ((MAXWV+1)*((IROMB+1)*MAXWV+2)/2*2+1,KMAX)
59 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
60 C CALCULATE PRELIMINARY CONSTANTS
61  CALL spwget(iromb,maxwv,eps,epstop,enn1,elonn1,eon,eontop)
62  mx=(maxwv+1)*((iromb+1)*maxwv+2)/2
63  mdim=2*mx+1
64  kw=kwskip
65  IF(kw.EQ.0) kw=2*mx
66 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
67 C CALCULATE STATION FIELDS
68 C$OMP PARALLEL DO PRIVATE(KWS)
69  DO k=1,kmax
70  kws=(k-1)*kw
71  CALL splaplac(iromb,maxwv,enn1,wave(kws+1),wd(1,k),1)
72  wz(1:2*mx,k)=0.
73  ENDDO
74  CALL sptgptv(iromb,maxwv,kmax,nmax,mdim,kgskip,nrskip,ngskip,
75  & rlat,rlon,wd,wz,xp,yp)
76 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
77  END
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:25
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:51
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:54
subroutine spwget(IROMB, MAXWV, EPS, EPSTOP, ENN1, ELONN1, EON, EONTOP)
This subprogram gets wave-space constants.
Definition: spwget.f:18