NCEPLIBS-sp 2.4.0
sptgpmd.f
Go to the documentation of this file.
1C> @file
2C> @brief Transform spectral to Mercator gradients.
3C> @author Iredell @date 96-02-29
4
5C> This subprogram performs a spherical transform
6C> from spectral coefficients of scalar fields
7C> to gradient fields on a Mercator grid.
8C>
9C> The wave-space can be either triangular or rhomboidal.
10C> The wave and grid fields may have general indexing,
11C> but each wave field is in sequential 'IBM order',
12C> i.e. with zonal wavenumber as the slower index.
13C>
14C> The Mercator grid is identified by the location
15C> of its first point and by its respective increments.
16C>
17C> The transforms are all multiprocessed over sector points.
18C>
19C> Transform several fields at a time to improve vectorization.
20C> Subprogram can be called from a multiprocessing environment.
21C>
22C> @param IROMB Spectral domain shape
23C> (0 for triangular, 1 for rhomboidal)
24C> @param MAXWV Spectral truncation
25C> @param KMAX Number of fields to transform
26C> @param MI Number of points in the faster zonal direction
27C> @param MJ Number of points in the slower merid direction
28C> @param KWSKIP Skip number between wave fields
29C> (defaults to (MAXWV+1)*((IROMB+1)*MAXWV+2) if KWSKIP=0)
30C> @param KGSKIP Skip number between grid fields
31C> (defaults to MI*MJ if KGSKIP=0)
32C> @param NISKIP Skip number between grid i-points
33C> (defaults to 1 if NISKIP=0)
34C> @param NJSKIP Skip number between grid j-points
35C> (defaults to MI if NJSKIP=0)
36C> @param RLAT1 Latitude of the first grid point in degrees
37C> @param RLON1 Longitude of the first grid point in degrees
38C> @param DLAT Latitude increment in degrees such that
39C> D(PHI)/D(J)=DLAT*COS(PHI) where J is meridional index.
40C> DLAT is negative for grids indexed southward.
41C> (in terms of grid increment dy valid at latitude RLATI,
42C> the latitude increment DLAT is determined as
43C> DLAT=DPR*DY/(RERTH*COS(RLATI/DPR))
44C> where DPR=180/PI and RERTH is Earth's radius)
45C> @param DLON Longitude increment in degrees such that
46C> D(LAMBDA)/D(I)=DLON where I is zonal index.
47C> DLON is negative for grids indexed westward.
48C> @param WAVE Wave fields
49C> @param XM Mercator x-gradients
50C> @param YM Mercator y-gradients
51C>
52C> @author Iredell @date 96-02-29
53 SUBROUTINE sptgpmd(IROMB,MAXWV,KMAX,MI,MJ,
54 & KWSKIP,KGSKIP,NISKIP,NJSKIP,
55 & RLAT1,RLON1,DLAT,DLON,WAVE,XM,YM)
56
57 REAL WAVE(*),XM(*),YM(*)
58 REAL EPS((MAXWV+1)*((IROMB+1)*MAXWV+2)/2),EPSTOP(MAXWV+1)
59 REAL ENN1((MAXWV+1)*((IROMB+1)*MAXWV+2)/2)
60 REAL ELONN1((MAXWV+1)*((IROMB+1)*MAXWV+2)/2)
61 REAL EON((MAXWV+1)*((IROMB+1)*MAXWV+2)/2),EONTOP(MAXWV+1)
62 REAL WD((MAXWV+1)*((IROMB+1)*MAXWV+2)/2*2+1,KMAX)
63 REAL WZ((MAXWV+1)*((IROMB+1)*MAXWV+2)/2*2+1,KMAX)
64
65C CALCULATE PRELIMINARY CONSTANTS
66 CALL spwget(iromb,maxwv,eps,epstop,enn1,elonn1,eon,eontop)
67 mx=(maxwv+1)*((iromb+1)*maxwv+2)/2
68 mdim=2*mx+1
69 kw=kwskip
70 IF(kw.EQ.0) kw=2*mx
71
72C CALCULATE GRADIENTS
73C$OMP PARALLEL DO PRIVATE(KWS)
74 DO k=1,kmax
75 kws=(k-1)*kw
76 CALL splaplac(iromb,maxwv,enn1,wave(kws+1),wd(1,k),1)
77 wz(1:2*mx,k)=0.
78 ENDDO
79 CALL sptgpmv(iromb,maxwv,kmax,mi,mj,mdim,kgskip,niskip,njskip,
80 & rlat1,rlon1,dlat,dlon,wd,wz,xm,ym)
81 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 sptgpmd(IROMB, MAXWV, KMAX, MI, MJ, KWSKIP, KGSKIP, NISKIP, NJSKIP, RLAT1, RLON1, DLAT, DLON, WAVE, XM, YM)
This subprogram performs a spherical transform from spectral coefficients of scalar fields to gradien...
Definition: sptgpmd.f:56
subroutine sptgpmv(IROMB, MAXWV, KMAX, MI, MJ, KWSKIP, KGSKIP, NISKIP, NJSKIP, RLAT1, RLON1, DLAT, DLON, WAVED, WAVEZ, UM, VM)
This subprogram performs a spherical transform from spectral coefficients of divergences and curls to...
Definition: sptgpmv.f:63
subroutine spwget(IROMB, MAXWV, EPS, EPSTOP, ENN1, ELONN1, EON, EONTOP)
This subprogram gets wave-space constants.
Definition: spwget.f:18