Index: /branches/LMDZ_WRFmeas/WRFV3/lmdz/diagphy_mod.F90
===================================================================
--- /branches/LMDZ_WRFmeas/WRFV3/lmdz/diagphy_mod.F90	(revision 33)
+++ /branches/LMDZ_WRFmeas/WRFV3/lmdz/diagphy_mod.F90	(revision 34)
@@ -80,9 +80,11 @@
       integer pas
 ! L. Fita, LMD July 2014
-      CHARACTER(LEN=50)                                  :: errmsg, fname
+      CHARACTER(LEN=50)                                  :: errmsg, fname, varname
       LOGICAL                                            :: found
+      REAL                                               :: largest
 
       fname = 'diagphy'
       errmsg = 'ERROR -- error -- ERROR -- error'
+      largest = 10000.
 
       save pas
@@ -154,14 +156,50 @@
 
 ! L. Fita, LMD July 2014. Checking for consistency
-      IF (fs_bound .NE. fs_bound .OR. ABS(fs_bound) > 100000.) THEN
+      IF (fs_bound .NE. fs_bound .OR. ABS(fs_bound) > laragest) THEN
         PRINT *,TRIM(errmsg)
         PRINT *,'  ' + TRIM(fname) + ': Wrong fs_bound= ',fs_bound,' !!!'
         PRINT *,'    fs_bound: Heat flux at atm. boundaries'
         PRINT *,'    fs_bound = stops-stopl - (ssols+ssoll)+ssens+sfront'
-        PRINT *,'    stops-stopl= ',stops-stopl
+        PRINT *,'    airetot= ',airetot
+        IF (airetot .NE. airetot .OR. ABS(airetot) > largest) THEN
+          varname = 'airephy'
+          CALL check_var(fname, varn, airephy, klon, largest, .FALSE.)
+        END IF
+        PRINT *,'    stops= ',stops
+        IF (stops .NE. stops .OR. ABS(stops) > largest) THEN
+          varname = 'tops'
+          CALL check_var(fname, varn, tops, klon, largest, .FALSE.)
+        END IF
+        PRINT *,'    stopl= ',stopl
+        IF (stopl .NE. stopl .OR. ABS(stopl) > largest) THEN
+          varname = 'topl'
+          CALL check_var(fname, varn, topl, klon, largest, .FALSE.)
+        END IF
         PRINT *,'    ssols= ',ssols
+        IF (ssols .NE. ssols .OR. ABS(ssols) > largest) THEN
+          varname = 'sols'
+          CALL check_var(fname, varn, sols, klon, largest, .FALSE.)
+        END IF
         PRINT *,'    ssoll= ',ssoll
+        IF (ssoll .NE. ssoll .OR. ABS(ssoll) > largest) THEN
+          varname = 'soll'
+          CALL check_var(fname, varn, soll, klon, largest, .FALSE.)
+        END IF
         PRINT *,'    ssens= ',ssens
+        IF (ssens .NE. ssens .OR. ABS(ssens) > largest) THEN
+          varname = 'sens'
+          CALL check_var(fname, varn, sens, klon, largest, .FALSE.)
+        END IF
         PRINT *,'    sfront= ',sfront
+        IF (sfront .NE. sfront .OR. ABS(sfront) > largest) THEN
+          varname = 'evap'
+          CALL check_var(fname, varn, evap, klon, largest, .FALSE.)
+          varname = 'rain_fall'
+          CALL check_var(fname, varn, rain_fall, klon, largest, .FALSE.)
+          varname = 'snow_fall'
+          CALL check_var(fname, varn, snow_fall, klon, largest, .FALSE.)
+          varname = 'ts'
+          CALL check_var(fname, varn, ts, klon, largest, .FALSE.)
+        END IF
         STOP
       END IF
@@ -173,6 +211,20 @@
         PRINT *,'    fq_bound = evap_tot - rain_fall_tot -snow_fall_tot'
         PRINT *,'    evap_tot= ',evap_tot
+        PRINT *,'    airetot= ',airetot
+        IF (airetot .NE. airetot .OR. ABS(airetot) > largest) THEN
+          varname = 'airephy'
+          CALL check_var(fname, varn, airephy, klon, largest, .FALSE.)
+        END IF
+        IF (evap_tot .NE. evap_tot .OR. ABS(evap_tot) > largest) THEN
+          varname = 'evap'
+          CALL check_var(fname, varn, evap, klon, largest, .FALSE.)
         PRINT *,'    rain_fall_tot= ',rain_fall_tot
+        IF (rain_fall_tot .NE. rain_fall_tot .OR. ABS(rain_fall_tot) > largest) THEN
+          varname = 'rain_fall'
+          CALL check_var(fname, varn, rain_fall, klon, largest, .FALSE.)
         PRINT *,'    snow_fall_tot= ',snow_fall_tot
+        IF (snow_fall_tot .NE. snow_fall_tot .OR. ABS(snow_fall_tot) > largest) THEN
+          varname = 'snow_fall'
+          CALL check_var(fname, varn, snow_fall, klon, largest, .FALSE.)
         STOP
       END IF
