NCEPLIBS-sp 2.4.0
sptezmd.f
Go to the documentation of this file.
1C> @file
2C> @brief Perform simple gradient spherical transforms.
3C> @author Iredell @date 96-02-29
4
5C> This subprogram performs spherical transforms
6C> between spectral coefficients of scalar fields
7C> and their means and gradients on a global cylindrical grid.
8C>
9C> The wave-space can be either triangular or rhomboidal.
10C>
11C> The grid-space can be either an equally-spaced grid
12C> (with or without pole points) or a gaussian grid.
13C>
14C> The wave fields are in sequential 'IBM ORDER'.
15C>
16C> The grid fields are indexed East to West, then North to South.
17C>
18C> For more flexibility and efficiency, call sptran().
19C>
20C> Subprogram can be called from a multiprocessing environment.
21C>
22C> Minimum grid dimensions for unaliased transforms to spectral:
23C> DIMENSION |LINEAR |QUADRATIC
24C> ----------------------- |--------- |-------------
25C> IMAX |2*MAXWV+2 |3*MAXWV/2*2+2
26C> JMAX (IDRT=4,IROMB=0) |1*MAXWV+1 |3*MAXWV/2+1
27C> JMAX (IDRT=4,IROMB=1) |2*MAXWV+1 |5*MAXWV/2+1
28C> JMAX (IDRT=0,IROMB=0) |2*MAXWV+3 |3*MAXWV/2*2+3
29C> JMAX (IDRT=0,IROMB=1) |4*MAXWV+3 |5*MAXWV/2*2+3
30C> JMAX (IDRT=256,IROMB=0) |2*MAXWV+1 |3*MAXWV/2*2+1
31C> JMAX (IDRT=256,IROMB=1) |4*MAXWV+1 |5*MAXWV/2*2+1
32C>
33C> @param IROMB spectral domain shape
34C> (0 for triangular, 1 for rhomboidal)
35C> @param MAXWV spectral truncation
36C> @param IDRT grid identifier
37C> - IDRT=4 for Gaussian grid
38C> - IDRT=0 for equally-spaced grid including poles
39C> - IDRT=256 for equally-spaced grid excluding poles
40C> @param IMAX even number of longitudes.
41C> @param JMAX number of latitudes.
42C> @param KMAX number
43C> @param[out] WAVE wave field if IDIR>0
44C> where MX=(MAXWV+1)*((IROMB+1)*MAXWV+2)
45C> @param[out] GRIDMN global mean if IDIR<0
46C> @param[out] GRIDX grid x-gradients (E->W,N->S) if IDIR<0
47C> @param[out] GRIDY grid y-gradients (E->W,N->S) if IDIR<0
48C> @param IDIR transform flag
49C> (IDIR>0 for wave to grid, IDIR<0 for grid to wave).
50C>
51C> @author Iredell @date 96-02-29
52 SUBROUTINE sptezmd(IROMB,MAXWV,IDRT,IMAX,JMAX,KMAX,
53 & WAVE,GRIDMN,GRIDX,GRIDY,IDIR)
54
55 REAL WAVE((MAXWV+1)*((IROMB+1)*MAXWV+2),KMAX)
56 REAL GRIDMN(KMAX),GRIDX(IMAX,JMAX,KMAX),GRIDY(IMAX,JMAX,KMAX)
57
58 jc=ncpus()
59 CALL sptrand(iromb,maxwv,idrt,imax,jmax,kmax,
60 & 0,0,0,0,0,0,0,0,jc,
61 & wave,gridmn,
62 & gridx,gridx(1,jmax,1),gridy,gridy(1,jmax,1),idir)
63 END
function ncpus()
Set number of CPUs - the number of processors over which to parallelize.
Definition: ncpus.F:24
subroutine sptezmd(IROMB, MAXWV, IDRT, IMAX, JMAX, KMAX, WAVE, GRIDMN, GRIDX, GRIDY, IDIR)
This subprogram performs spherical transforms between spectral coefficients of scalar fields and thei...
Definition: sptezmd.f:54
subroutine sptrand(IROMB, MAXWV, IDRT, IMAX, JMAX, KMAX, IPRIME, ISKIP, JNSKIP, JSSKIP, KWSKIP, KGSKIP, JBEG, JEND, JCPU, WAVE, GRIDMN, GRIDXN, GRIDXS, GRIDYN, GRIDYS, IDIR)
This subprogram performs a spherical transform between spectral coefficients of scalar fields and the...
Definition: sptrand.f:92