!-------------------------------------- LICENCE BEGIN ------------------------------------
!Environment Canada - Atmospheric Science and Technology License/Disclaimer,
! version 3; Last Modified: May 7, 2008.
!This is free but copyrighted software; you can use/redistribute/modify it under the terms
!of the Environment Canada - Atmospheric Science and Technology License/Disclaimer
!version 3 or (at your option) any later version that should be found at:
!http://collaboration.cmc.ec.gc.ca/science/rpn.comm/license.html
!
!This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
!without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
!See the above mentioned License/Disclaimer for more details.
!You should have received a copy of the License/Disclaimer along with this software;
!if not, you can write to: EC-RPN COMM Group, 2121 TransCanada, suite 500, Dorval (Quebec),
!CANADA, H9P 1J3; or send e-mail to service.rpn@ec.gc.ca
!-------------------------------------- LICENCE END --------------------------------------
!
SUBROUTINE reespe_hem(KFIELD,PSP,PGD 6,3
S ,KLA, KIBEG, KIEND, KJBEG, KJEND, KDIM)
#if defined (DOC)
*
***s/r reespe_hem - Hemispheric Spectral Transform for a number of scalar fields
*
*Author : L. Fillion - ARMA/EC - 13 May 2010.
*Revision:
*Arguments
* i KFIELD : number of fields to be processed
* o PSP(KLA,2,KDIM) : array of spectral coefficients
* i PGD(KIBEG:KIEND,KFIELD,KJBEG:KJEND)
* . : grid-point field
* Following parameters are only necessary for the dimensioning
* of PSP and PGD. Their equivalent global variables are used.
* i KLA : total number of spectral coefficients
* i KIBEG, KIEND : equivalent of NIBEG and NIEND
* i KJBEG, KJEND : equivalent of NJBEG and NJEND
* i KDIM : total number of spectral fields
* .
#endif
*
USE procs_topo
IMPLICIT NONE
*implicits
#include "comdim.cdk"
#include "comlun.cdk"
!
INTEGER :: KFIELD
INTEGER :: KLA, KIBEG, KIEND, KJBEG, KJEND, KDIM
REAL*8 :: PSP(KLA,2,KDIM), PGD(KIBEG:KIEND,KDIM,KJBEG:KJEND)
!
INTEGER :: ILEN, JK, JLON, JLAT,INCPU, ISIZ
REAL*8 :: ZFM(NI+2,KFIELD, NJ)
IF(myid == 0) THEN
write(nulout,fmt='(/,4x,A,i3,A)')'REESPE_HEM- Spectral transform of ',kfield,' scalar fields'
endif
!
! 1. Transfer global fields to local array
!
zfm(1:ni,1:kfield,1:nj) = pgd(1:ni,1:kfield,1:nj)
!
! 2. Apply the FFT
CALL FFT3DVAR
(ZFM,1,NI+2,KFIELD,NJBEG,NJEND,KFIELD,-1)
!
! 3. Direct Legendre transform
!
CALL REESPEPAR_hem
(PSP,ZFM,NI,NJ,KLA, KDIM,KFIELD)
!
END subroutine reespe_hem