NCEPLIBS-sp  2.3.3
spgradx.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine spgradx (M, INCW, KMAX, MP, CLAT, W, WX)
 THIS SUBPROGRAM COMPUTES THE X-GRADIENT OF FIELDS IN COMPLEX FOURIER SPACE. More...
 

Detailed Description

Compute x-gradient in fourier space

Author
IREDELL
Date
96-02-20

Definition in file spgradx.f.

Function/Subroutine Documentation

◆ spgradx()

subroutine spgradx ( integer, intent(in)  M,
integer, intent(in)  INCW,
integer, intent(in)  KMAX,
integer, dimension(kmax), intent(in)  MP,
real, intent(in)  CLAT,
real, dimension(2*incw,kmax), intent(inout)  W,
real, dimension(2*incw,kmax), intent(out)  WX 
)

THIS SUBPROGRAM COMPUTES THE X-GRADIENT OF FIELDS IN COMPLEX FOURIER SPACE.

THE X-GRADIENT OF A VECTOR FIELD W IS WX=CONJG(W)*L/RERTH WHERE L IS THE WAVENUMBER AND RERTH IS THE EARTH RADIUS, SO THAT THE RESULT IS THE X-GRADIENT OF THE PSEUDO-VECTOR. THE X-GRADIENT OF A SCALAR FIELD W IS WX=CONJG(W)*L/(RERTH*CLAT) WHERE CLAT IS THE COSINE OF LATITUDE. AT THE POLE THIS IS UNDEFINED, SO THE WAY TO GET THE X-GRADIENT AT THE POLE IS BY PASSING BOTH THE WEIGHTED WAVENUMBER 0 AND THE UNWEIGHTED WAVENUMBER 1 AMPLITUDES AT THE POLE AND SETTING MP=10. IN THIS CASE, THE WAVENUMBER 1 AMPLITUDES ARE USED TO COMPUTE THE X-GRADIENT AND THEN ZEROED OUT.

Parameters
M- INTEGER FOURIER WAVENUMBER TRUNCATION
INCW- INTEGER FIRST DIMENSION OF THE COMPLEX AMPLITUDE ARRAY (INCW >= M+1)
KMAX- INTEGER NUMBER OF FOURIER FIELDS
MP- INTEGER (KM) IDENTIFIERS (0 OR 10 FOR SCALAR, 1 FOR VECTOR)
CLAT- REAL COSINE OF LATITUDE
[out]W- COMPLEX(INCW,KMAX) FOURIER AMPLITUDES CORRECTED WHEN MP=10 AND CLAT=0
[out]WX- COMPLEX(INCW,KMAX) COMPLEX AMPLITUDES OF X-GRADIENTS
Note
THIS SUBPROGRAM IS THREAD-SAFE.

Definition at line 35 of file spgradx.f.