!-------------------------------------- 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 --------------------------------------
!
!
! X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X
!
subroutine lapm(pout,pin,cdgrid,kfi) 2,2
!
!**s/r lapm - Computes the Laplacian for a given zonal component
!
!
!Author : Luc Fillion - MSC - 10 March 04.
!Revision:
!
! -------------------
!
!Arguments
!
implicit none
!
#include "taglam4d.cdk"
#include "pardim.cdk"
#include "comdim.cdk"
#include "comgrd_param.cdk"
#include "comct0.cdk"
#include "comcst.cdk"
#include "comlun.cdk"
#include "comgemla.cdk"
!
integer kfi
real*8 pin(nj),pout(nj)
!
real*8 za(nj),zb(nj),zax(nj),zc(nj),zr(nj)
real*8 zalpha,zbeta,zcon
!
character*1 cdgrid
logical lsettri
integer jj
!
!!
call zero
(nj,pout)
!
! Build cyclic tridiagonal matrix A
!
call settrilax
(za,zb,zc,zalpha,zbeta,cdgrid,kfi)
!
! compute A*x
!
do jj=2,nj-1
pout(jj)=za(jj)*pin(jj-1)+zb(jj)*pin(jj)+zc(jj)*pin(jj+1)
enddo
!
pout(1)=zb(1)*pin(1)+zc(1)*pin(2) + zbeta*pin(nj)
pout(nj)=zalpha*pin(1) + za(nj)*pin(nj-1)+zb(nj)*pin(nj)
!
return
end