Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_jeanzay.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_jeanzay.ksh	(revision 1501)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys_jeanzay.ksh	(revision 1502)
@@ -102,6 +102,6 @@
   module purge > /dev/null 2>&1
   . /gpfswork/rech/psl/commun/MachineEnvironment/jeanzay/env_jeanzay > /dev/null 2>&1
-#currently no atlas
-#  . /gpfswork/rech/psl/commun/MachineEnvironment/jeanzay/env_atlas_jeanzay > /dev/null 2>&1
+
+  . /gpfswork/rech/psl/commun/MachineEnvironment/jeanzay/env_atlas_jeanzay > /dev/null 2>&1
 
 #  export PCMDI_MP=/ccc/work/cont003/igcmg/igcmg/PCMDI-MP
@@ -347,5 +347,6 @@
   fi
   typeset IsArchivedFlag
-  IsArchivedFlag=$( [ X$( echo $@ | grep ^\/ccc\/store ) != X ] && echo 0 || echo 1 )
+# To be implemented on Jean Zay 
+#  IsArchivedFlag=$( [ X$( echo $@ | grep ^\/ccc\/store ) != X ] && echo 0 || echo 1 )
   IGCM_debug_PopStack "IGCM_sys_IsFileArchived"
 
@@ -538,6 +539,6 @@
     #
     # USUAL WAY
-    # add 'ccc_hsm get' (to demigrate all offline files) to reduce time of this command :
- #trouver la bonne commande sur jeanzay   ccc_hsm get -r $1
+    # add here command to demigrate all offline files to reduce time of this command 
+    # actually on Jean Zay files are not archive on bands
 
     i=0
@@ -655,5 +656,7 @@
     if [ -f $2 ] ; then
       IGCM_debug_Print 1 "$2 already exist"
- #trouver la bonne commande sur jeanzay     ccc_hsm get $2
+    # add here command to demigrate all offline files to reduce time of this command 
+    # actually on Jean Zay files are not archive on bands
+
       exist=true
       if [ "X$( diff $1 $2 )" = X ] ; then
@@ -773,5 +776,7 @@
     fi
     eval DEST=\${${#}}
- #trouver la bonne commande sur jeanzay   ccc_hsm get ${dm_liste[*]} > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
+    # add here command to demigrate all offline files to reduce time of this command 
+    # actually on Jean Zay files are not archive on bands
+
     status=$?
     if [ ${status} -gt 0 ] ; then
@@ -919,10 +924,8 @@
 
     if [ "$#" -eq 1 ]; then
-      ## /ccc/cont003/home/igcmg/igcmg/Tools/irene/thredds_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
-      $(ccc_home -u igcmg)/Tools/irene/thredds_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
+#      $(ccc_home -u igcmg)/Tools/irene/thredds_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
       status=$?
     else
-      ## /ccc/cont003/home/igcmg/igcmg/Tools/irene/thredds_rm public/${LOGIN}/${R_DODS} # > out_dods_rm 2>&1
-      $(ccc_home -u igcmg)/Tools/irene/thredds_rm public/${LOGIN}/${R_DODS} # > out_dods_rm 2>&1
+#      $(ccc_home -u igcmg)/Tools/irene/thredds_rm public/${LOGIN}/${R_DODS} # > out_dods_rm 2>&1
       status=$?
     fi
@@ -958,6 +961,6 @@
 #    fi
 
-    ## /ccc/cont003/home/igcmg/igcmg/Tools/irene/bin/thredds_cp ${1} public/${LOGIN}/${R_DODS} # > out_dods_cp 2>&1
-    $(ccc_home -u igcmg)/Tools/irene/thredds_cp ${1} public/${LOGIN}/${R_DODS} # > out_dods_cp 2>&1
+#    $(ccc_home -u igcmg)/Tools/irene/thredds_cp ${1} public/${LOGIN}/${R_DODS} # > out_dods_cp 2>&1
+
     status=$?
 
@@ -1426,133 +1429,134 @@
 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' | gawk '{print $2}')
-  volume_avail=$(ccc_quota | grep ' scratch' | gawk '{print $3}')
-
-  if ( [ ! X${volume_quota} = X ] && [ ! ${volume_quota} = "-" ] ) ; then
-
-    unit_avail=${volume_avail: -1}
-    unit_quota=${volume_quota: -1}
-
-    if [ "${unit_quota}" = "*" ] ; then
-      IGCM_debug_Print 1 "Please, check your quota of volume on scratch"
-      IGCM_debug_Print 1 "More than 100% of your quota is used"
-      IGCM_debug_Print 1 "Use the ccc_quota command to check"
-      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
-
-    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 "${quota_volume}% of your quota is used"
-      IGCM_debug_Print 1 "Use the ccc_quota command to check"
-      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' | gawk '{print $6}')
-  inode_avail=$(ccc_quota | grep ' scratch' | gawk '{print $7}')
-
-  if ( [ ! X${inode_quota} = X ] && [ ! ${inode_quota} = "-" ] ) ; then
-
-    unit_avail=${inode_avail: -1}
-    unit_quota=${inode_quota: -1}
-
-    if [ "${unit_quota}" = "*" ] ; then
-      IGCM_debug_Print 1 "Please, check your quota of inode on scratch"
-      IGCM_debug_Print 1 "More than 100% of your quota is used"
-      IGCM_debug_Print 1 "Use the ccc_quota command to check"
-      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
-
-    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 "${quota_inode}% of your quota is used"
-      IGCM_debug_Print 1 "Use the ccc_quota command to check"
-      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
+  echo "IGCM_sys_check_quota is desactivated on JeanZay because there is actually no way to check scratch quota on this computing center (2019.11.19)"
+#  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' | gawk '{print $2}')
+#  volume_avail=$(ccc_quota | grep ' scratch' | gawk '{print $3}')
+#
+#  if ( [ ! X${volume_quota} = X ] && [ ! ${volume_quota} = "-" ] ) ; then
+#
+#    unit_avail=${volume_avail: -1}
+#    unit_quota=${volume_quota: -1}
+#
+#    if [ "${unit_quota}" = "*" ] ; then
+#      IGCM_debug_Print 1 "Please, check your quota of volume on scratch"
+#      IGCM_debug_Print 1 "More than 100% of your quota is used"
+#      IGCM_debug_Print 1 "Use the ccc_quota command to check"
+#      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
+#
+#    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 "${quota_volume}% of your quota is used"
+#      IGCM_debug_Print 1 "Use the ccc_quota command to check"
+#      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' | gawk '{print $6}')
+#  inode_avail=$(ccc_quota | grep ' scratch' | gawk '{print $7}')
+#
+#  if ( [ ! X${inode_quota} = X ] && [ ! ${inode_quota} = "-" ] ) ; then
+#
+#    unit_avail=${inode_avail: -1}
+#    unit_quota=${inode_quota: -1}
+#
+#    if [ "${unit_quota}" = "*" ] ; then
+#      IGCM_debug_Print 1 "Please, check your quota of inode on scratch"
+#      IGCM_debug_Print 1 "More than 100% of your quota is used"
+#      IGCM_debug_Print 1 "Use the ccc_quota command to check"
+#      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
+#
+#    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 "${quota_inode}% of your quota is used"
+#      IGCM_debug_Print 1 "Use the ccc_quota command to check"
+#      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"
 }
@@ -1568,6 +1572,7 @@
     echo "IGCM_sys_check_quota"
   fi
-
-  ssh irene191 /usr/bin/ccc_myproject > $1
+#need to implemented on Jean Zay 
+  touch $1
+#  ssh irene191 /usr/bin/ccc_myproject > $1
 
   IGCM_debug_PopStack "IGCM_sys_projectAccounting"
@@ -1601,7 +1606,6 @@
   fi
 
-  # With -f option, the full job name is given in the last column
-  ID=$( ccc_mstat -f -u $2 | \
-        gawk -v JobName=$1 '( $NF ~ JobName ) { print $1 }' )
+  ID=$( squeue -u $user | grep Job_${config_UserChoices_JobName} | gawk ' { print $1}' )
+
 
   eval ${3}=${ID}
@@ -1621,5 +1625,6 @@
 
   # With -f option, the full job name is given in the last column
-  NbRun=$( ccc_mstat -f | gawk -v JobName=$1 'BEGIN { x=0 } ( $NF ~ JobName ) { x=x+1 } END { print x }' )
+  NbRun=$(squeue -u $user | \ 
+      grep -v JOBID | gawk 'BEGIN { x=0 } ( $NF ~ JobName ) { x=x+1 } END { print x }' )
 
   eval ${2}=${NbRun}
@@ -1639,13 +1644,15 @@
   fi
 
-  # With -f option, the full job name is given in the last column
-  set -A JobList $( ccc_mstat -f | gawk -v User=$1             \
-                                        '( $2  == User      && \
-                                           $NF != /TS/      && \
-                                           $NF !~ /PACK/    && \
-                                           $NF !~ /REBUILD/ && \
-                                           $NF !~ /pack/ )     \
-                                         { print $NF }' | sed -e "s/\(.*\)\.[0-9]*/\1/" )
-
+# to be implemented on Jean Zay 
+ set -A JobList $( squeue -u $user | gawk '{print $3}' | grep -v NAME)
+#  # With -f option, the full job name is given in the last column
+#  set -A JobList $( ccc_mstat -f | gawk -v User=$1             \
+#                                        '( $2  == User      && \
+#                                           $NF != /TS/      && \
+#                                           $NF !~ /PACK/    && \
+#                                           $NF !~ /REBUILD/ && \
+#                                           $NF !~ /pack/ )     \
+#                                         { print $NF }' | sed -e "s/\(.*\)\.[0-9]*/\1/" )
+#
   eval set -A ${2} ${JobList[*]}
 
@@ -1665,18 +1672,19 @@
 
   typeset status
-
-  \ccc_mprun atlas $@ > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
-  status=$?
-  if [ ${status} -gt 0 ] ; then
-    echo "IGCM_sys_atlas : error code ${status}"
-    cat ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
-    \rm ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
-    IGCM_debug_PopStack "IGCM_sys_atlas"
-    return 1
-  else
-    IGCM_debug_PopStack "IGCM_sys_atlas"
-    return 0
-  fi
-
+# To be implemented on Jean Zay 
+#
+#  \ccc_mprun atlas $@ > ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$ 2>&1
+#  status=$?
+#  if [ ${status} -gt 0 ] ; then
+#    echo "IGCM_sys_atlas : error code ${status}"
+#    cat ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+#    \rm ${OUTCOMMAND_PATH}/out_command_${LOGIN}.$$
+#    IGCM_debug_PopStack "IGCM_sys_atlas"
+#    return 1
+#  else
+#    IGCM_debug_PopStack "IGCM_sys_atlas"
+#    return 0
+#  fi
+#
   IGCM_debug_PopStack "IGCM_sys_atlas"
 }
