!-------------------------------------- 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/r e_intpoly - computes interpolation polynomials (coefficients) *subroutine e_intpoly ( frc0, frc1, frc2, 8 % frdel, frhh, frhm, frhp, fllag ) * #include "impnone.cdk"
* logical fllag real*8 frc0, frc1, frc2, frdel, frhh, frhm, frhp * *author jean cote - rpn - sept 95 - setint3 * *revision * v1_95 - alain patoine - split from e_intpoly.ftn * *language * fortran 77 * *object * see above ID * *arguments *______________________________________________________________________ * | | * NAME | DESCRIPTION | *--------------------|-------------------------------------------------| * frc0 | normalized relative coordinate | * frc1 | polynomial of second derivative/difference | * | in interpolation formula | * frc2 | polynomial of second derivative/difference | * | in interpolation formula | * frdel | relative coordinate | * frhh | grid interval where the interpolation point | * | lies | * frhm | grid interval left of where the | * | interpolation point lies (fllag=.true.) | * frhp | grid interval right of where the | * | interpolation point lies (fllag=.true.) | * fllag | .true. for cubic lagrange interpolation | * | .false. for cubic spline interpolation | * --------------------------------------------------------------------- * *implicits * *note * For an interpolation point x such that x1 < x2 < x < x3 < x4 then * frdel = x - x2, frhh = x3 - x2, frhm = x2 - x1, frhp = x4 - x3 and * the interpolation using f2 = f(x2), f3 = f(x3) and s2 = s(x2), s3 = s(x3) * the function and the second derivative/difference values at x2 and x3 * respectively is written as * * f(x) = ( 1.0 - frc0 ) * f2 + frc0 * f3 + frc1 * s2 + frc2 * s3 * ** * --------------------------------------------------------------- real*8 one, six parameter( one = 1.0 ) parameter( six = 6.0 ) * frc0 = frdel/frhh frc1 = one - frc0 if ( fllag ) then frc2 = ( frhh * frhh )/( frhm + frhh + frhp ) frc2 = - ( frc1 * frc0 * frc2 ) frc1 = frc2 * ( frc1 * frhh + frhp ) frc2 = frc2 * ( frc0 * frhh + frhm ) else frc2 = frhh * frhh / six frc2 = - ( frc1 * frc0 * frc2 ) frc1 = frc2 * ( frc1 + one ) frc2 = frc2 * ( frc0 + one ) endif return end