!-------------------------------------- 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 -------------------------------------- ***S/P DVRTEF *SUBROUTINE DVRTEF ( R , X , N , MR , MX , NK ,W ) * #include "impnone.cdk"
INTEGER N,MR,MX,NK REAL R(MR,NK),X(MX,NK),W(N,2) * *Author * J. Cote (RPN 1983) * *Revision * 001 J. Cote RPN(Nov 1984)SEF version documentation * 002 M. Lepine - RFE model code revision project (Jan87) * - pass the workfield W in an argument * *Object * to calculate the vertical derivative in finite_element space * *Arguments * * - Output - * R result * * - Input - * X variable to derive * N horizontal dimension * MR 1st dimension of R * MX 1st dimension of X * NK vertical dimension * W work space * *Notes * R and X can share the same space. * ** * INTEGER J,K,JO,JP,JJ * JO=1 JP=2 * DO 10 J=1,N W(J,JO)=X(J,1) R(J,1)=0.5*(X(J,2)-X(J,1)) 10 CONTINUE * DO 30 K=2,NK-1 CDIR$ IVDEP DO 20 J=1,N W(J,JP)=X(J,K) R(J,K)=0.5*(X(J,K+1)-W(J,JO)) 20 CONTINUE * JJ=JP JP=JO JO=JJ 30 CONTINUE * DO 40 J=1,N R(J,NK)=0.5*(X(J,NK)-W(J,JO)) 40 CONTINUE * RETURN END