Index: /trunk/tools/interpolate.F90
===================================================================
--- /trunk/tools/interpolate.F90	(revision 1354)
+++ /trunk/tools/interpolate.F90	(revision 1355)
@@ -225,5 +225,5 @@
   REAL(r_k), ALLOCATABLE, DIMENSION(:,:)                 :: fractionlon, fractionlat
   INTEGER                                                :: fracdx, fracdy
-  CHARACTER(LEN=50)                                      :: fname, errormsg
+  CHARACTER(LEN=50)                                      :: fname
 
 !!!!!!! Variables
Index: /trunk/tools/module_ForInterpolate.F90
===================================================================
--- /trunk/tools/module_ForInterpolate.F90	(revision 1354)
+++ /trunk/tools/module_ForInterpolate.F90	(revision 1355)
@@ -10,4 +10,6 @@
 MODULE module_ForInterpolate
 
+  USE module_generic
+
   CONTAINS
 
@@ -15,6 +17,4 @@
   Nperx, Npery, ilonlat, mindiffLl)
 ! Function to search a given value from a coarser version of the data
-
-  USE module_generic
 
   IMPLICIT NONE
@@ -206,6 +206,4 @@
   iv, lonv, latv, per, Nperx, Npery, mindiff, ilonlat, mindiffLl)
 ! Function to search a given value from a coarser version of the data
-
-  USE module_generic
 
   IMPLICIT NONE
@@ -437,6 +435,4 @@
 ! Function to search a given value from a coarser version of the data
 
-  USE module_generic
-
   IMPLICIT NONE
 
@@ -489,6 +485,4 @@
 !   approche from percentages of the whole domain
 
-  USE module_generic
-
   IMPLICIT NONE
 
@@ -592,6 +586,4 @@
 ! Subroutine which finds the closest grid point within a projection throughout a first guest 
 !   and then whole domain approche from percentages of the whole domain 
-
-  USE module_generic
 
   IMPLICIT NONE
@@ -724,6 +716,4 @@
 ! Subroutine which provides the indices for a given interpolation of a projection
 
-  USE module_generic
-
   IMPLICIT NONE
 
@@ -738,6 +728,8 @@
   INTEGER                                                :: i,j,iv, ix, iy
   REAL(r_k)                                              :: mindiffLl, dist
-  REAL(r_k)                                              :: inclon, inclat, maxdiffprojlonlat
+  REAL(r_k)                                              :: inclon, inclat, maxdiffprojlonlat,        &
+    maxdiffinlonlat
   REAL(r_k), DIMENSION(idimx,idimy)                      :: difflonlat
+  REAL(r_k), DIMENSION(idimx,idimy)                      :: idifflon, idifflat
   REAL(r_k), DIMENSION(pdimx,pdimy)                      :: difflon, difflat
   REAL(r_k), DIMENSION(2)                                :: extremelon, extremelat, ipos
@@ -763,4 +755,10 @@
   extremelat = (/ MINVAL(projlat), MAXVAL(projlat) /)
  
+  ! Maximum distance between grid points in input projection
+  idifflon = 0.
+  idifflat = 0.
+  idifflon(1:idimx-1,:) = inlonv(2:idimx,:)-inlonv(1:idimx-1,:)
+  idifflat(:,1:idimy-1) = inlatv(:,2:idimy)-inlatv(:,1:idimy-1)
+  maxdiffinlonlat = MAXVAL(SQRT(idifflon**2. + idifflat**2.))
   ! Maximum distance between grid points in target projection
   difflon = 0.
@@ -770,4 +768,10 @@
   maxdiffprojlonlat = MAXVAL(SQRT(difflon**2. + difflat**2.))
 
+  IF (maxdiffinlonlat > maxdiffprojlonlat) THEN
+    PRINT *,TRIM(warnmsg)
+    PRINT *,'  ' //TRIM(fname)// '; input resolution: ', maxdiffinlonlat, ' is coarser than target:', &
+      maxdiffprojlonlat, ' !!'
+  END IF
+
   ! Using case outside loop to be more efficient
   SELECT CASE(TRIM(intkind))
@@ -781,5 +785,5 @@
           difflonlat = SQRT((projlon(i,j)-inlonv)**2. + (projlat(i,j)-inlatv)**2.)
           mindiffLl = MINVAL(difflonlat)
-          IF (mindiffLl > maxdiffprojlonlat) THEN
+          IF ( (mindiffLl > maxdiffprojlonlat) .AND. (mindiffLl > maxdiffinlonlat)) THEN
             outLlw(3,:,i,j) = 0.
             outLlw(3,:,i,j) = -1.
@@ -852,5 +856,5 @@
           ! We do not want that values larger that the maximum distance between target grid points
 !          PRINT *,i,j,':',mindiffLl,'maxdiffLl:',maxdiffprojlonlat
-          IF (mindiffLl .gt. maxdiffprojlonlat) THEN
+          IF ((mindiffLl .gt. maxdiffprojlonlat) .AND. (mindiffLl > maxdiffinlonlat)) THEN
 !            PRINT *,'  ' // TRIM(fname) // ': reprojected minimum distance to nearest grid point:',   &
 !              mindiffLl, ' larger than the maximum distance between grid points in target projection!!'
@@ -870,6 +874,4 @@
   idimy, pdimx, pdimy)
 ! Subroutine to interpolate a 2D variable
-
-  USE module_generic
 
   IMPLICIT NONE
@@ -949,6 +951,4 @@
   idimy, pdimx, pdimy, d3)
 ! Subroutine to interpolate a 3D variable
-
-  USE module_generic
 
   IMPLICIT NONE
@@ -1032,6 +1032,4 @@
   idimy, pdimx, pdimy, d3, d4)
 ! Subroutine to interpolate a 4D variable
-
-  USE module_generic
 
   IMPLICIT NONE
@@ -1119,6 +1117,4 @@
   idimy, pdimx, pdimy, d3, d4, d5)
 ! Subroutine to interpolate a 5D variable
-
-  USE module_generic
 
   IMPLICIT NONE
@@ -1211,6 +1207,4 @@
 ! Subroutine which finds the closest grid point within a projection
 
-  USE module_generic
-
   IMPLICIT NONE
 
@@ -1309,6 +1303,4 @@
   Ninpts)
 ! Subroutine which finds the closest grid point within a projection with 1D longitudes and latitudes
-
-  USE module_generic
 
   IMPLICIT NONE
Index: /trunk/tools/module_generic.F90
===================================================================
--- /trunk/tools/module_generic.F90	(revision 1354)
+++ /trunk/tools/module_generic.F90	(revision 1355)
@@ -8,4 +8,6 @@
   ! Fill value at 64 bits
   REAL(r_k)                                              :: fillval64 = 1.e20
+  CHARACTER(len=50), PARAMETER                           :: errormsg = 'ERROR -- error -- ERROR -- error'
+  CHARACTER(len=50), PARAMETER                           :: warnmsg = 'WARNING -- warning -- WARNING -- warning'
 
   CONTAINS
