Index: /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh	(revision 650)
+++ /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh	(revision 651)
@@ -420,4 +420,8 @@
   done
 
+  #check to be sure there is enough space on temporary filesystems to run
+  IGCM_debug_Print 1 "Check if there is enough space on temporary filesystem"
+  IGCM_sys_check_quota
+
   IGCM_debug_PopStack "IGCM_config_Check"
 }
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_brodie.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_brodie.ksh	(revision 650)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_brodie.ksh	(revision 651)
@@ -1151,2 +1151,13 @@
   
 }
+
+############################################################
+# Check of space available on temporary filesytems
+function IGCM_sys_check_quota {
+    IGCM_debug_PushStack "IGCM_sys_check_quota"
+    if ( $DEBUG_sys ) ; then
+	echo "IGCM_sys_check_quota"
+    fi
+    IGCM_debug_PopStack "IGCM_sys_check_quota"
+}
+
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_cesium.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_cesium.ksh	(revision 650)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_cesium.ksh	(revision 651)
@@ -1486,4 +1486,14 @@
 }
 
+############################################################
+# Check of space available on temporary filesytems
+function IGCM_sys_check_quota {
+    IGCM_debug_PushStack "IGCM_sys_check_quota"
+    if ( $DEBUG_sys ) ; then
+	echo "IGCM_sys_check_quota"
+    fi
+    IGCM_debug_PopStack "IGCM_sys_check_quota"
+}
+
 ##############################################################
 # NCO OPERATOR
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 650)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 651)
@@ -1954,2 +1954,13 @@
   IGCM_debug_PopStack "IGCM_sys_cdo"
 }
+
+############################################################
+# Check of space available on temporary filesytems
+function IGCM_sys_check_quota {
+    IGCM_debug_PushStack "IGCM_sys_check_quota"
+    if ( $DEBUG_sys ) ; then
+        echo "IGCM_sys_check_quota"
+    fi
+    IGCM_debug_PopStack "IGCM_sys_check_quota"
+}
+
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh	(revision 650)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh	(revision 651)
@@ -1395,2 +1395,12 @@
     IGCM_debug_PopStack "IGCM_sys_build_run_file"
 }
+
+############################################################
+# Check of space available on temporary filesytems
+function IGCM_sys_check_quota {
+    IGCM_debug_PushStack "IGCM_sys_check_quota"
+    if ( $DEBUG_sys ) ; then
+	echo "IGCM_sys_check_quota"
+    fi
+    IGCM_debug_PopStack "IGCM_sys_check_quota"
+}
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh	(revision 650)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh	(revision 651)
@@ -1118,2 +1118,12 @@
     IGCM_debug_PopStack "IGCM_sys_build_run_file"
 }
+
+############################################################
+# Check of space available on temporary filesytems
+function IGCM_sys_check_quota {
+    IGCM_debug_PushStack "IGCM_sys_check_quota"
+    if ( $DEBUG_sys ) ; then
+	echo "IGCM_sys_check_quota"
+    fi
+    IGCM_debug_PopStack "IGCM_sys_check_quota"
+}
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh	(revision 650)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh	(revision 651)
@@ -1446,4 +1446,14 @@
 }
 
+############################################################
+# Check of space available on temporary filesytems
+function IGCM_sys_check_quota {
+    IGCM_debug_PushStack "IGCM_sys_check_quota"
+    if ( $DEBUG_sys ) ; then
+        echo "IGCM_sys_check_quota"
+    fi
+    IGCM_debug_PopStack "IGCM_sys_check_quota"
+}
+
 ##############################################################
 # NCO OPERATOR
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex8.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex8.ksh	(revision 650)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex8.ksh	(revision 651)
@@ -1487,2 +1487,12 @@
   IGCM_debug_PopStack "IGCM_sys_build_run_file"
 }
+
+############################################################
+# Check of space available on temporary filesytems
+function IGCM_sys_check_quota {
+    IGCM_debug_PushStack "IGCM_sys_check_quota"
+    if ( $DEBUG_sys ) ; then
+	echo "IGCM_sys_check_quota"
+    fi
+    IGCM_debug_PopStack "IGCM_sys_check_quota"
+}
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh	(revision 650)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh	(revision 651)
@@ -1587,2 +1587,66 @@
 
 }
+
+############################################################
+# Check of space available on temporary filesytems
+function IGCM_sys_check_quota {
+  IGCM_debug_PushStack "IGCM_sys_check_quota" 
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_check_quota "
+  fi
+  # Limit of quota (in %)
+  limit_quota=90
+
+  # Check of the volume
+  volume_quota=$(ccc_quota | grep ' scratch' | awk '{print $2}')
+  volume_avail=$(ccc_quota | grep ' scratch' | awk '{print $3}')
+
+  if ( [ ! X${volume_quota} = X ] && [ ! ${volume_quota} = "-" ] ) ; then
+
+    unit_avail=${volume_avail: -1}
+    unit_quota=${volume_quota: -1}
+
+    temp_avail=${volume_avail%%${volume_avail: -1}*}
+    temp_quota=${volume_quota%%${volume_quota: -1}*}
+
+    if [ ! ${unit_avail} = ${unit_quota} ] ; then
+
+    # Convertion
+      if [ ${volume_avail: -1} = "T" ] ; then
+	  (( temp_avail = temp_avail * 1000000000000 ))
+      elif [ ${volume_avail: -1} = "G" ] ; then
+	  (( temp_avail = temp_avail * 1000000000 ))
+      elif [ ${volume_avail: -1} = "M" ] ; then
+	  (( temp_avail = temp_avail * 1000000 ))
+      elif [ ${volume_avail: -1} = "k" ] ; then
+	  (( temp_avail = temp_avail * 1000 ))
+      else
+	  (( temp_avail = volume_avail ))
+      fi
+      if [ ${volume_quota: -1} = "T" ] ; then
+	  (( temp_quota = temp_quota * 1000000000000 ))
+      elif [ ${volume_quota: -1} = "G" ] ; then
+	  (( temp_quota = temp_quota * 1000000000 ))
+      elif [ ${volume_quota: -1} = "M" ] ; then
+	  (( temp_quota = temp_quota * 1000000 ))
+      elif [ ${volume_quota: -1} = "k" ] ; then
+	  (( temp_quota = temp_quota * 1000 ))
+      else
+	  (( temp_quota = volume_quota ))
+      fi
+    fi
+
+    quota_volume=$(echo "scale=2 ; $temp_quota/$temp_avail*100" | bc)
+#    echo "volume ratio is " $quota_volume
+
+    if [ ${quota_volume} -ge ${limit_quota} ] ; then
+      IGCM_debug_Print 1 "Please, check your quota of inode on scratch"
+      IGCM_debug_Print 1 "Use the ccc_quota command"
+      IGCM_debug_Print 1 "You must have more than 10% available to run"
+      IGCM_debug_Exit "Not enough space to run ! STOP HERE"
+      IGCM_debug_Verif_Exit
+    fi
+
+  fi
+  IGCM_debug_PopStack "IGCM_sys_check_quota"
+}
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 650)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 651)
@@ -1367,2 +1367,12 @@
     IGCM_debug_PopStack "IGCM_sys_build_run_file"
 }
+
+############################################################
+# Check of space available on temporary filesytems
+function IGCM_sys_check_quota {
+    IGCM_debug_PushStack "IGCM_sys_check_quota"
+    if ( $DEBUG_sys ) ; then
+	echo "IGCM_sys_check_quota"
+    fi
+    IGCM_debug_PopStack "IGCM_sys_check_quota"
+}
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_platine.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_platine.ksh	(revision 650)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_platine.ksh	(revision 651)
@@ -1472,2 +1472,12 @@
   
 }
+
+############################################################
+# Check of space available on temporary filesytems
+function IGCM_sys_check_quota {
+    IGCM_debug_PushStack "IGCM_sys_check_quota"
+    if ( $DEBUG_sys ) ; then
+	echo "IGCM_sys_check_quota"
+    fi
+    IGCM_debug_PopStack "IGCM_sys_check_quota"
+}
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh	(revision 650)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh	(revision 651)
@@ -1968,4 +1968,121 @@
 }
 
+############################################################
+# Check of space available on temporary filesytems
+function IGCM_sys_check_quota {
+  IGCM_debug_PushStack "IGCM_sys_check_quota"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_check_quota "
+  fi
+  # Limit of quota (in %)
+  limit_quota=90
+
+  # Check of the volume
+  volume_quota=$(ccc_quota | grep ' scratch' | awk '{print $2}')
+  volume_avail=$(ccc_quota | grep ' scratch' | awk '{print $3}')
+
+  if ( [ ! X${volume_quota} = X ] && [ ! ${volume_quota} = "-" ] ) ; then
+
+    unit_avail=${volume_avail: -1}
+    unit_quota=${volume_quota: -1}
+
+    temp_avail=${volume_avail%%${volume_avail: -1}*}
+    temp_quota=${volume_quota%%${volume_quota: -1}*}
+
+    if [ ! ${unit_avail} = ${unit_quota} ] ; then
+
+    # Convertion
+      if [ ${volume_avail: -1} = "T" ] ; then
+        (( temp_avail = temp_avail * 1000000000000 ))
+      elif [ ${volume_avail: -1} = "G" ] ; then
+        (( temp_avail = temp_avail * 1000000000 ))
+      elif [ ${volume_avail: -1} = "M" ] ; then
+        (( temp_avail = temp_avail * 1000000 ))
+      elif [ ${volume_avail: -1} = "k" ] ; then
+        (( temp_avail = temp_avail * 1000 ))
+      else
+        (( temp_avail = volume_avail ))
+      fi
+      if [ ${volume_quota: -1} = "T" ] ; then
+        (( temp_quota = temp_quota * 1000000000000 ))
+      elif [ ${volume_quota: -1} = "G" ] ; then
+        (( temp_quota = temp_quota * 1000000000 ))
+      elif [ ${volume_quota: -1} = "M" ] ; then
+        (( temp_quota = temp_quota * 1000000 ))
+      elif [ ${volume_quota: -1} = "k" ] ; then
+        (( temp_quota = temp_quota * 1000 ))
+      else
+        (( temp_quota = volume_quota ))
+      fi
+    fi
+
+    quota_volume=$(echo "scale=2 ; $temp_quota/$temp_avail*100" | bc)
+#    echo "volume ratio is " $quota_volume
+
+    if [ ${quota_volume} -ge ${limit_quota} ] ; then
+      IGCM_debug_Print 1 "Please, check your quota of volume on scratch"
+      IGCM_debug_Print 1 "Use the ccc_quota command"
+      IGCM_debug_Print 1 "You must have more than 10% available to run"
+      IGCM_debug_Exit "Not enough space to run ! STOP HERE"
+      IGCM_debug_Verif_Exit
+    fi
+
+  fi
+
+# Check of the number of inodes
+
+  inode_quota=$(ccc_quota | grep ' scratch' | awk '{print $6}')
+  inode_avail=$(ccc_quota | grep ' scratch' | awk '{print $7}')
+
+  if ( [ ! X${inode_quota} = X ] && [ ! ${inode_quota} = "-" ] ) ; then
+
+    unit_avail=${inode_avail: -1}
+    unit_quota=${inode_quota: -1}
+
+    temp_avail=${inode_avail%%${inode_avail: -1}*}
+    temp_quota=${inode_quota%%${inode_quota: -1}*}
+
+    if [ ! ${unit_avail} = ${unit_quota} ] ; then
+
+    # Convertion
+      if [ ${inode_avail: -1} = "T" ] ; then
+        (( temp_avail = temp_avail * 1000000000000 ))
+      elif [ ${inode_avail: -1} = "G" ] ; then
+        (( temp_avail = temp_avail * 1000000000 ))
+      elif [ ${inode_avail: -1} = "M" ] ; then
+        (( temp_avail = temp_avail * 1000000 ))
+      elif [ ${inode_avail: -1} = "k" ] ; then
+        (( temp_avail = temp_avail * 1000 ))
+      else
+        (( temp_avail = inode_avail ))
+      fi
+
+      if [ ${inode_quota: -1} = "T" ] ; then
+        (( temp_quota = temp_quota * 1000000000000 ))
+      elif [ ${inode_quota: -1} = "G" ] ; then
+        (( temp_quota = temp_quota * 1000000000 ))
+      elif [ ${inode_quota: -1} = "M" ] ; then
+        (( temp_quota = temp_quota * 1000000 ))
+      elif [ ${inode_quota: -1} = "k" ] ; then
+        (( temp_quota = temp_quota * 1000 ))
+      else
+        (( temp_quota = inode_quota ))
+      fi
+    fi
+    quota_inode=$(echo "scale=2 ; $temp_quota/$temp_avail*100" | bc)
+#    echo "inode ratio is " $quota_inode
+
+    if [ ${quota_inode} -ge ${limit_quota} ] ; then
+      IGCM_debug_Print 1 "Please, check your quota of inode on scratch"
+      IGCM_debug_Print 1 "Use the ccc_quota command"
+      IGCM_debug_Print 1 "You must have more than 10% available to run"
+      IGCM_debug_Exit "Not enough space to run ! STOP HERE"
+      IGCM_debug_Verif_Exit
+    fi
+
+  fi
+  IGCM_debug_PopStack "IGCM_sys_check_quota"
+}
+
 ##############################################################
 # NCO OPERATOR
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ulam.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ulam.ksh	(revision 650)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ulam.ksh	(revision 651)
@@ -1277,2 +1277,12 @@
   IGCM_debug_PopStack "IGCM_sys_build_run_file"
 }
+
+############################################################
+# Check of space available on temporary filesytems
+function IGCM_sys_check_quota {
+    IGCM_debug_PushStack "IGCM_sys_check_quota"
+    if ( $DEBUG_sys ) ; then
+	echo "IGCM_sys_check_quota"
+    fi
+    IGCM_debug_PopStack "IGCM_sys_check_quota"
+}
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_vargas.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_vargas.ksh	(revision 650)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_vargas.ksh	(revision 651)
@@ -1547,2 +1547,28 @@
 
 }
+
+############################################################
+# Check of space available on temporary filesytems
+function IGCM_sys_check_quota {
+  IGCM_debug_PushStack "IGCM_sys_check_quota" 
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_check_quota "
+  fi
+  # Limit of quota (in %)
+  limit_quota=90
+  # Check of the volume
+  volume_quota=$(quota_u -w | grep 'Quota soft' | awk '{print $5}')
+  if [ ! X${volume_quota} = X ] ; then
+    quota_volume=${volume_quota%%\%}
+#    echo $quota_volume
+    if [ ${quota_volume} -ge ${limit_quota} ] ; then
+      IGCM_debug_Print 1 "Please, check your quota of inode on scratch"
+      IGCM_debug_Print 1 "Use the ccc_quota command"
+      IGCM_debug_Print 1 "You must have more than 10% available to run"
+      IGCM_debug_Exit "Not enough space to run ! STOP HERE"
+      IGCM_debug_Verif_Exit
+    fi
+
+  fi
+  IGCM_debug_PopStack "IGCM_sys_check_quota"
+}
