[1849] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | listToProcessFile="${1}" |
---|
| 4 | # exemple de fichier liste : |
---|
| 5 | # /ccc/scratch/cont003/incka/pierreg/IGCM_DEM/dataDMNFS_FromTitane/IGCM_OUT/IPSLCM5A/REDO/historicalGHG/v3.historicalGHG1R/output_tar/v3.historicalGHG1R_20101201_20121231_1M_histmthNMC.nc.list |
---|
| 6 | |
---|
| 7 | |
---|
| 8 | # export INPUT_DMF_DATA=${SCRATCHDIR}/datasLabo/dataDMNFS_simple1 |
---|
| 9 | export INPUT_DMF_DATA=${SCRATCHDIR}/dataDMNFS_FromTitane |
---|
| 10 | |
---|
| 11 | # export OUTPUT_STORE=${SCRATCHDIR}/PSEUDO_DMNFS_STORE |
---|
| 12 | export OUTPUT_STORE=${SCRATCHDIR}/dataDMNFS_FromTitane_STORE |
---|
| 13 | |
---|
| 14 | # export OUTPUT_WORK=${SCRATCHDIR}/PSEUDO_DMNFS_WORK |
---|
| 15 | export OUTPUT_WORK=${SCRATCHDIR}/dataDMNFS_FromTitane_WORK |
---|
| 16 | |
---|
| 17 | # export OUTPUT_CHECK=${SCRATCHDIR}/PSEUDO_DMNFS_CHECK |
---|
| 18 | export OUTPUT_CHECK=${SCRATCHDIR}/dataDMNFS_FromTitane_CHECK |
---|
| 19 | |
---|
| 20 | |
---|
| 21 | dirin=$INPUT_DMF_DATA |
---|
| 22 | dirout=$OUTPUT_STORE |
---|
| 23 | dirout_work=$OUTPUT_WORK |
---|
| 24 | dirout_check=$OUTPUT_CHECK |
---|
| 25 | |
---|
| 26 | export JOB_DIR=${LS_SUBCWD:-${PWD}} |
---|
| 27 | export EXE_DIR=${JOB_DIR} |
---|
| 28 | source ${EXE_DIR}/DEM_utilities.sh |
---|
| 29 | |
---|
| 30 | dirPathOfListFile=$( dirname $listToProcessFile ) |
---|
| 31 | dirnameOfListFile=$( basename $dirPathOfListFile ) |
---|
| 32 | |
---|
| 33 | # rep de simu : celui contenant le rep qui contient la liste |
---|
| 34 | PATH_SIMU=$( dirname $dirPathOfListFile ) |
---|
| 35 | set=$listToProcessFile |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | #----------------------------------- |
---|
| 39 | # Set output file name from list name |
---|
| 40 | |
---|
| 41 | fileout1=$( basename $set ) |
---|
| 42 | fileout=${fileout1%.list} |
---|
| 43 | |
---|
| 44 | filefirst=`head -n 1 $set` |
---|
| 45 | diroutputfile=`dirname $filefirst | sed -e "s%$dirin%$dirout%"` |
---|
| 46 | |
---|
| 47 | output_ncrcat_file=$diroutputfile/${fileout} |
---|
| 48 | |
---|
| 49 | #---------------------------------- |
---|
| 50 | fileout_cdocat=${fileout1%.list}.cdocat |
---|
| 51 | |
---|
| 52 | dirOutput_cdocat_file=`dirname $filefirst | sed -e "s%$dirin%$dirout_check%"` |
---|
| 53 | |
---|
| 54 | output_cdocat_file=${dirOutput_cdocat_file}/${fileout_cdocat} |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | #---------------------------------- |
---|
| 58 | # log file |
---|
| 59 | datestr=`LC_ALL=C date +"%Y%m%dTT%H%M%S"` |
---|
| 60 | logfile=${fileout_cdocat%%.cdocat}_${datestr}.log |
---|
| 61 | output_cdocat_logFile=${dirOutput_cdocat_file}/${logfile} |
---|
| 62 | |
---|
| 63 | |
---|
| 64 | echo |
---|
| 65 | echo "Output file to write:" |
---|
| 66 | echo "$output_ncrcat_file" |
---|
| 67 | echo |
---|
| 68 | echo "Output cdo cat file to write:" |
---|
| 69 | echo "$output_cdocat_file" |
---|
| 70 | echo |
---|
| 71 | echo "Output cdo cat log file to write:" |
---|
| 72 | echo "$output_cdocat_logFile" |
---|
| 73 | |
---|
| 74 | |
---|
| 75 | if [ ! -e $outputfile ] |
---|
| 76 | then |
---|
| 77 | echo "Le fichier liste suivant n'existe pas :" |
---|
| 78 | echo "$outputfile" |
---|
| 79 | fi |
---|
| 80 | |
---|
| 81 | mkdir -p $dirOutput_cdocat_file |
---|
| 82 | |
---|
| 83 | listOfFilesToCdocat=`cat $listToProcessFile ` |
---|
| 84 | |
---|
| 85 | cdo cat $listOfFilesToCdocat $output_cdocat_file > $output_cdocat_logFile 2>&1 |
---|
| 86 | |
---|
| 87 | echo >> $output_cdocat_logFile |
---|
| 88 | |
---|
| 89 | vartoexclude="'t_inst*,contfracATM,sobowlin'" |
---|
| 90 | ./diff.bash $output_ncrcat_file $output_cdocat_file $vartoexclude >> $output_cdocat_logFile |
---|
| 91 | |
---|
| 92 | code_sortie=$? |
---|
| 93 | |
---|
| 94 | exit $code_sortie |
---|
| 95 | |
---|
| 96 | |
---|
| 97 | |
---|
| 98 | |
---|
| 99 | |
---|
| 100 | |
---|
| 101 | |
---|
| 102 | |
---|
| 103 | |
---|
| 104 | |
---|
| 105 | |
---|
| 106 | |
---|
| 107 | |
---|