4.3.9 SHTG2S

1.
Function
Performs forward spectral transformation by successively carrying out SHTG2W and SHTW2S.

2.
Definition
The definitions of ISW and arrays S, W, and G are the same as for SHTG2W and SHTW2S. This subroutine performs SHTG2W and SHTW2S successively, with the following results.

When ISW=0, a normal forward spectral transformation is carried out.

(4.32)


When ISW=1, the latitudinal derivative of the forward spectral transform is calculated.

(4.33)



When ISW=-1, the meridional derivative of the forward spectral transform is calculated.

(4.34)

3.
Call
SHTG2S(MM,JM,IM,ISW,G,W,S,WORK)

4.
Explanation of Parameters
Output parameter. Wave data (For length and arrangement, see SHTS2W.)
MM (I) Input parameter. The cut-off wavenumber (M).
JM (I) Input parameter. 1/2 of the NS partition number (J)
IM (I) Input parameter. 1/2 of the EW partition number(I)
ISW (I) Input parameter. Specifies the type of transformation. (See above definition.)
G (R) Input parameter. Grid data. (For length and arrangement, see SHTW2G.)
W (R)
S (R) Output parameter. Spectral data. (For length and arrangement, see SHTNML.)
WORK (R) Working area initialized by SHTINT

5.
Notes
(a)
The present subroutine is equivalent to successively calling SHTG2W and SHTW2S.
(b)
By using the two transforms for ISW=1 and ISW=-1, the divergence of the vector field can be calculated.