source: TOOLS/PACK_IPSL/check_ncrcat_list.sh @ 1900

Last change on this file since 1900 was 1900, checked in by aclsce, 10 years ago

Modified to write log files in TMP_MIGR_DATA directory (instead of current directory)

  • Property svn:executable set to *
File size: 2.4 KB
Line 
1#!/bin/bash
2listToProcessFile="${1}"
3# exemple de fichier liste :
4# /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
5
6
7# On renseigne les variables d'environnement (ici surtout pour la var OUTPUT_CHECK)
8. load_ipslPack_env.sh
9
10
11dirin=$INPUT_DMF_DATA
12dirout=$OUTPUT_STORE
13dirout_work=$OUTPUT_WORK
14dirout_check=$OUTPUT_CHECK
15
16export JOB_DIR=${TMP_MIGR_DATA}
17export EXE_DIR=${LS_SUBCWD:-${PWD}}
18source ${EXE_DIR}/DEM_utilities.sh
19
20# Ca sert a quoi tout ca ?
21# dirPathOfListFile=$( dirname  $listToProcessFile )
22# dirnameOfListFile=$( basename $dirPathOfListFile )
23
24# rep de simu : celui contenant le rep qui contient la liste
25# PATH_SIMU=$( dirname  $dirPathOfListFile )
26
27set=$listToProcessFile
28
29
30#-----------------------------------
31# Set output file name from list name
32
33fileout1=$( basename $set )
34fileout=${fileout1%.list}
35
36filefirst=`head -n 1 $set`
37diroutputfile=`dirname $filefirst | sed -e "s%$dirin%$dirout%"`
38
39output_ncrcat_file=$diroutputfile/${fileout}
40
41#----------------------------------
42fileout_cdocat=${fileout1%.list}.cdocat
43
44dirOutput_cdocat_file=`dirname $filefirst | sed -e "s%$dirin%$dirout_check%"`
45
46output_cdocat_file=${dirOutput_cdocat_file}/${fileout_cdocat}
47
48
49#----------------------------------
50# log file
51datestr=`LC_ALL=C date +"%Y%m%dTT%H%M%S"`
52logfile=${fileout_cdocat%%.cdocat}_${datestr}.log
53output_cdocat_logFile=${dirOutput_cdocat_file}/${logfile}
54
55
56#echo
57#echo "ncrcat file to compare cdo cat file with :"
58#echo "$output_ncrcat_file"
59#echo
60#echo "Output cdo cat file to create:"
61#echo "$output_cdocat_file"
62#echo
63#echo "Output cdo cat log file:"
64#echo "$output_cdocat_logFile"
65
66if [ ! -e $listToProcessFile ]
67then
68    echo "Le fichier en entree n'existe pas. STOP." > $output_cdocat_logFile
69    exit 1
70fi
71
72
73if [ ! -e $outputfile ]
74then
75   echo "Le fichier liste suivant n'existe pas :" >> $output_cdocat_logFile
76   echo "$outputfile" >> $output_cdocat_logFile
77   exit 1
78fi
79
80mkdir -p $dirOutput_cdocat_file
81
82listOfFilesToCdocat=`cat $listToProcessFile `
83
84
85cdo cat $listOfFilesToCdocat $output_cdocat_file > $output_cdocat_logFile 2>&1
86
87
88echo >> $output_cdocat_logFile
89
90vartoexclude="t_inst*,contfracATM,sobowlin,Contfrac"
91./diff.bash $output_ncrcat_file $output_cdocat_file $vartoexclude >> $output_cdocat_logFile
92
93code_sortie=$?
94
95exit $code_sortie
96
97
98
99
100
101
102
103
104
105
106
107
108
Note: See TracBrowser for help on using the repository browser.