Index: /trunk/tools/Makefile.llamp
===================================================================
--- /trunk/tools/Makefile.llamp	(revision 1811)
+++ /trunk/tools/Makefile.llamp	(revision 1812)
@@ -33,12 +33,20 @@
 	module_NCgeneric.o \
 	module_scientific.o \
+	module_ForInterpolate.o \
 	module_ForDiagnosticsVars.o \
 	module_ForDiagnostics.o \
 	module_DistriCorrection.o
 
+FINTMODULES = \
+	module_definitions.o \
+	module_basic.o \
+	module_generic.o \
+	module_scientific.o \
+	module_ForInterpolate.o
+
 all : \
 	module_ForDiagnostics.o \
+	interpolate.o \
 	DistriCorrection.o \
-	interpolate.o \
 	pydistrimods.o \
 	pydiagmods.o \
@@ -73,4 +81,7 @@
 	$(FC) $(FCFLAGS) module_scientific.f90
 
+module_ForInterpolate.o: module_definitions.o module_generic.o
+	$(FC) $(FCFLAGS) $(LIB_INC) module_ForInterpolate.f90
+
 module_ForDiagnosticsVars.o: module_definitions.o module_basic.o module_generic.o
 	$(FC) $(FCFLAGS) $(LIB_INC) module_ForDiagnosticsVars.f90
@@ -82,8 +93,9 @@
 	$(FC) $(FCFLAGS) module_DistriCorrection.f90
 
+FCEXEFINTCFLAGS = $(FINTMODULES) $(LIB_NETCDF) $(LIB_INC)
 FCEXECFLAGS = $(MODULES) $(LIB_NETCDF) $(LIB_INC)
 
-interpolate.o: module_definitions.o module_basic.o module_generic.o module_scientific.o
-	$(FC) $(FCEXECFLAGS) interpolate.f90 -o interpolate
+interpolate.o: module_definitions.o module_basic.o module_generic.o module_scientific.o module_ForInterpolate.o
+	$(FC) $(FCEXEFINTCFLAGS) interpolate.f90 -o interpolate
 
 DistriCorrection.o: module_definitions.o module_basic.o module_generic.o module_NCgeneric.o module_scientific.o module_DistriCorrection.o
Index: /trunk/tools/module_ForInterpolate.f90
===================================================================
--- /trunk/tools/module_ForInterpolate.f90	(revision 1811)
+++ /trunk/tools/module_ForInterpolate.f90	(revision 1812)
@@ -1406,20 +1406,24 @@
      INTEGER, INTENT(IN)                                 :: ix, iy, iz, it
      INTEGER, INTENT(IN)                                 :: num_metgrid_levels, LINLOG
-     REAL, DIMENSION(ix,iy,iz,it), INTENT(IN)            :: data_in, pres_field, tk, qv
-     REAL, DIMENSION(ix,iy,it), INTENT(IN)               :: psfc
-     REAL, DIMENSION(ix,iy), INTENT(IN)                  :: ter
-     REAL, DIMENSION(num_metgrid_levels), INTENT(IN)     :: interp_levels
+     REAL(r_k),DIMENSION(ix,iy,iz,it), INTENT(IN)        :: data_in, pres_field, tk, qv
+     REAL(r_k),DIMENSION(ix,iy,it), INTENT(IN)           :: psfc
+     REAL(r_k),DIMENSION(ix,iy), INTENT(IN)              :: ter
+     REAL(r_k),DIMENSION(num_metgrid_levels), INTENT(IN) :: interp_levels
      INTEGER, INTENT(IN)                                 :: extrapolate
-     REAL, INTENT(IN)                                    :: MISSING
+     REAL(r_k),INTENT(IN)                                :: MISSING
      LOGICAL, INTENT(IN)                                 :: GEOPT
-     REAL, DIMENSION(ix,iy,num_metgrid_levels,it),                                                    &
+     REAL(r_k),DIMENSION(ix,iy,num_metgrid_levels,it),                                                &
        INTENT(OUT)                                       :: data_out
 
 ! Local
      INTEGER                                             :: i, j, itt, k, kk, kin
-     REAL, DIMENSION(num_metgrid_levels)                 :: data_out1D
-     REAL, DIMENSION(iz)                                 :: data_in1D, pres_field1D
-     REAL, DIMENSION(ix, iy, num_metgrid_levels, it)     :: N
-     REAL                                                :: sumA, sumN, AVE_geopt
+     INTEGER                                             :: kupper
+     REAL(r_k),DIMENSION(num_metgrid_levels)             :: data_out1D
+     REAL(r_k),DIMENSION(iz)                             :: data_in1D, pres_field1D
+     REAL(r_k),DIMENSION(ix, iy, num_metgrid_levels, it) :: N
+     REAL(r_k)                                           :: sumA, sumN, AVE_geopt
+     REAL(r_k)                                           :: dp, dpmin, expon
+     REAL(r_k)                                           :: pbot, ptarget, tbotextrap, tvbotextrap,   &
+       zbot
 
 !!!!!!! Variables
@@ -1577,17 +1581,17 @@
 
 !                                                ! input types
-      INTEGER   :: npin,npout,linlog,ier
-      real      :: ppin(npin),xxin(npin),ppout(npout)
-      real      :: MISSING       
-     logical                                          :: AVERAGE
+      INTEGER                                            :: npin,npout,linlog,ier
+      REAL(r_k)                                          :: ppin(npin),xxin(npin),ppout(npout)
+      REAL(r_k)                                          :: MISSING       
+      logical                                            :: AVERAGE
 !                                                ! output
-      real      :: xxout(npout)
-      INTEGER   :: j1,np,nl,nin,nlmax,nplvl
-      INTEGER   :: nlsave,np1,no1,n1,n2,nlstrt
-      real      :: slope,pa,pb,pc
+      REAL(r_k)                                          :: xxout(npout)
+      INTEGER                                            :: j1,np,nl,nin,nlmax,nplvl
+      INTEGER                                            :: nlsave,np1,no1,n1,n2,nlstrt
+      REAL(r_k)                                          :: slope,pa,pb,pc
 
 ! automatic arrays
-      real      :: pin(npin),xin(npin),p(npin),x(npin)
-      real      :: pout(npout),xout(npout)
+      REAL(r_k)                                          :: pin(npin),xin(npin),p(npin),x(npin)
+      REAL(r_k)                                          :: pout(npout),xout(npout)
 
 
@@ -1652,5 +1656,5 @@
 !      in K and mixing ratio in kg/kg.
 
-     real                              :: tmp, rmix, virtual
+     REAL(r_k)                              :: tmp, rmix, virtual
 
      virtual=tmp*(0.622+rmix)/(0.622*(1.+rmix))
