SURFEX v7.3
General documentation of Surfex
 All Classes Files Functions Variables Typedefs
/home/dasprezs/EXPORT_v7_3/src/SURFEX/ver_interp_lin3d_surf.F90
Go to the documentation of this file.
00001 !     ##############################################
00002       FUNCTION VER_INTERP_LIN3D_SURF(PVAR1,KKLIN,PCOEFLIN) RESULT(PVAR2)
00003 !     ##############################################
00004 !
00005 !!****  *VER_INTERP_LIN* - vertical linear interpolation
00006 !!
00007 !!    PURPOSE
00008 !!    -------
00009 !     This function interpolates the 3D fields from one grid
00010 !     to another using linear interpolation cofficients stored in module
00011 !     MODD_VER_INTERP_LIN.
00012 !
00013 !!
00014 !!**  METHOD
00015 !!    ------
00016 !!
00017 !!    EXTERNAL
00018 !!    --------
00019 !!
00020 !!    IMPLICIT ARGUMENTS
00021 !!    ------------------
00022 !!
00023 !!    REFERENCE
00024 !!    ---------
00025 !!
00026 !!    Book 2
00027 !!
00028 !!    AUTHOR
00029 !!    ------
00030 !!      
00031 !     V.Masson  Meteo-France
00032 !!
00033 !!    MODIFICATIONS
00034 !!    -------------
00035 !!      Original    18/07/97
00036 !-------------------------------------------------------------------------------
00037 !
00038 !*       0.    DECLARATIONS
00039 !              ------------
00040 !
00041 !
00042 USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
00043 USE PARKIND1  ,ONLY : JPRB
00044 !
00045 IMPLICIT NONE
00046 !
00047 !*       0.1   Declaration of arguments
00048 !              ------------------------
00049 REAL,   DIMENSION(:,:,:), INTENT(IN) :: PVAR1 ! variable values on the initial
00050 !                                             ! grid
00051 INTEGER,DIMENSION(:,:,:), INTENT(IN) :: KKLIN ! lower interpolating level of
00052 !                                             ! grid 1 for each level of grid 2 
00053 REAL,   DIMENSION(:,:,:), INTENT(IN) :: PCOEFLIN ! coefficient for level KKLIN
00054 !
00055 REAL,   DIMENSION(SIZE(KKLIN,1),SIZE(KKLIN,2),SIZE(KKLIN,3))                   
00056                                        :: PVAR2 ! variable values on target  
00057 !                                             ! grid 
00058 !
00059 !*       0.2   Declaration of local variables
00060 !              ------------------------------
00061 !
00062 INTEGER                                               :: JI,JJ,JK2
00063 REAL(KIND=JPRB) :: ZHOOK_HANDLE
00064 !-------------------------------------------------------------------------------
00065 !
00066 IF (LHOOK) CALL DR_HOOK('MODI_VER_INTERP_LIN3D_SURF:VER_INTERP_LIN3D_SURF',0,ZHOOK_HANDLE)
00067 DO JK2=1,SIZE(KKLIN,3)
00068   DO JJ=1,SIZE(KKLIN,2)
00069     DO JI=1,SIZE(KKLIN,1)
00070       PVAR2(JI,JJ,JK2)=    PCOEFLIN(JI,JJ,JK2) *PVAR1(JI,JJ,KKLIN(JI,JJ,JK2)  )&
00071                         +(1.-PCOEFLIN(JI,JJ,JK2))*PVAR1(JI,JJ,KKLIN(JI,JJ,JK2)+1)  
00072     END DO
00073   END DO
00074 END DO
00075 IF (LHOOK) CALL DR_HOOK('MODI_VER_INTERP_LIN3D_SURF:VER_INTERP_LIN3D_SURF',1,ZHOOK_HANDLE)
00076 !
00077 !-------------------------------------------------------------------------------
00078 !
00079 END FUNCTION VER_INTERP_LIN3D_SURF