[2] | 1 | #-Q- platine #!/usr/bin/ksh |
---|
| 2 | #-Q- platine ################### |
---|
| 3 | #-Q- platine ## PLATINE CEA ## |
---|
| 4 | #-Q- platine ################### |
---|
| 5 | #-Q- platine #BSUB -J SE # Nom du job |
---|
| 6 | #-Q- platine #BSUB -N # message a la fin du job |
---|
| 7 | #-Q- platine #BSUB -n 1 # reservation des processeurs pour le job |
---|
| 8 | #-Q- platine #BSUB -W 1:00 # Limite temps |
---|
[18] | 9 | #-Q- platine #BSUB -q post # Passage en queue post |
---|
[59] | 10 | #-Q- sx8brodie #!/bin/ksh |
---|
[2] | 11 | #-Q- sx8brodie ####################### |
---|
| 12 | #-Q- sx8brodie ## SX8BRODIE IDRIS ## |
---|
| 13 | #-Q- sx8brodie ####################### |
---|
[58] | 14 | #-Q- sx8brodie # Temps Elapsed max. d'une requete hh:mm:ss |
---|
[220] | 15 | #-Q- sx8brodie # @ wall_clock_limit = 20:00:00 |
---|
[58] | 16 | #-Q- sx8brodie # Nom du travail LoadLeveler |
---|
[66] | 17 | #-Q- sx8brodie # @ job_name = SE |
---|
[58] | 18 | #-Q- sx8brodie # Fichier de sortie standard du travail |
---|
| 19 | #-Q- sx8brodie # @ output = $(job_name).$(jobid) |
---|
| 20 | #-Q- sx8brodie # Fichier de sortie d'erreur du travail |
---|
| 21 | #-Q- sx8brodie # @ error = $(job_name).$(jobid) |
---|
| 22 | #-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) |
---|
| 23 | #-Q- sx8brodie # @ notification = error |
---|
[213] | 24 | #-Q- sx8brodie # @ environment = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $MASTER ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER |
---|
[58] | 25 | #-Q- sx8brodie # @ queue |
---|
[68] | 26 | #-Q- aix6 #!/bin/ksh |
---|
| 27 | #-Q- aix6 ####################### |
---|
| 28 | #-Q- aix6 ## VARGAS IDRIS ## |
---|
| 29 | #-Q- aix6 ####################### |
---|
| 30 | #-Q- aix6 # Temps Elapsed max. d'une requete hh:mm:ss |
---|
[220] | 31 | #-Q- aix6 # @ wall_clock_limit = 20:00:00 |
---|
[68] | 32 | #-Q- aix6 # Nom du travail LoadLeveler |
---|
| 33 | #-Q- aix6 # @ job_name = SE |
---|
| 34 | #-Q- aix6 # Fichier de sortie standard du travail |
---|
| 35 | #-Q- aix6 # @ output = $(job_name).$(jobid) |
---|
| 36 | #-Q- aix6 # Fichier de sortie d'erreur du travail |
---|
| 37 | #-Q- aix6 # @ error = $(job_name).$(jobid) |
---|
| 38 | #-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) |
---|
| 39 | #-Q- aix6 # @ notification = error |
---|
[213] | 40 | #-Q- aix6 # @ environment = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $MASTER ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER |
---|
[68] | 41 | #-Q- aix6 # @ queue |
---|
[2] | 42 | #-Q- sx8mercure #!/bin/ksh |
---|
| 43 | #-Q- sx8mercure ###################### |
---|
| 44 | #-Q- sx8mercure ## SX8MERCURE CEA ## |
---|
| 45 | #-Q- sx8mercure ###################### |
---|
| 46 | #-Q- sx8mercure #PBS -N SE # Nom du job |
---|
| 47 | #-Q- sx8mercure #PBS -j o # regroupement des stdout et stderr |
---|
| 48 | #-Q- sx8mercure #PBS -S /usr/bin/ksh # shell de soumission |
---|
| 49 | #-Q- sx8mercure #PBS -l memsz_job=1gb # Limite memoire a 1 Go |
---|
| 50 | #-Q- sx8mercure #PBS -l cputim_job=1:00:00 # Limite temps a 1 heures |
---|
| 51 | #-Q- sx8mercure #PBS -q scalaire |
---|
[172] | 52 | #-Q- sx9mercure #!/bin/ksh |
---|
| 53 | #-Q- sx9mercure ###################### |
---|
| 54 | #-Q- sx9mercure ## SX9MERCURE CEA ## |
---|
| 55 | #-Q- sx9mercure ###################### |
---|
[192] | 56 | #-Q- sx9mercure #MSUB -r SE # Nom du job |
---|
| 57 | #-Q- sx9mercure #MSUB -N 1 # Reservation du noeud |
---|
| 58 | #-Q- sx9mercure #MSUB -n 1 # Reservation du processus |
---|
| 59 | #-Q- sx9mercure #MSUB -T 86400 # Limite de temps elapsed du job |
---|
| 60 | #-Q- sx9mercure #MSUB -E "-j o" |
---|
| 61 | #-Q- sx9mercure #MSUB -E "-S /bin/ksh" |
---|
| 62 | #-Q- sx9mercure ##MSUB -e nco.out # Sortie standard |
---|
| 63 | #-Q- sx9mercure ##MSUB -o nco.out # Sortie standard |
---|
[222] | 64 | #-Q- titane #!/bin/ksh |
---|
| 65 | #-Q- titane ###################### |
---|
| 66 | #-Q- titane ## TITANE CEA ## |
---|
| 67 | #-Q- titane ###################### |
---|
| 68 | #-Q- titane #MSUB -r SE # Nom du job |
---|
| 69 | #-Q- titane #MSUB -N 1 # Reservation du noeud |
---|
| 70 | #-Q- titane #MSUB -n 1 # Reservation du processus |
---|
| 71 | #-Q- titane #MSUB -T 86400 # Limite de temps elapsed du job |
---|
| 72 | #-Q- titane #MSUB -E "-j o" |
---|
| 73 | #-Q- titane #MSUB -E "-S /bin/ksh" |
---|
| 74 | #-Q- titane ##MSUB -e nco.out # Sortie standard |
---|
| 75 | #-Q- titane ##MSUB -o nco.out # Sortie standard |
---|
[2] | 76 | #-Q- default #!/bin/ksh |
---|
| 77 | #-Q- default ################## |
---|
| 78 | #-Q- default ## DEFAULT HOST ## |
---|
| 79 | #-Q- default ################## |
---|
| 80 | |
---|
[108] | 81 | # $Date$ |
---|
| 82 | # $Author$ |
---|
| 83 | # $Revision$ |
---|
| 84 | # IPSL (2006) |
---|
| 85 | # This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC |
---|
| 86 | |
---|
| 87 | #set -eu |
---|
[2] | 88 | #set -vx |
---|
| 89 | |
---|
| 90 | date |
---|
| 91 | |
---|
| 92 | #-Q- sx8brodie export OMP_NUM_THREADS=1 |
---|
[108] | 93 | #-Q- aix6 export OMP_NUM_THREADS=1 |
---|
[2] | 94 | |
---|
| 95 | ######################################################################## |
---|
| 96 | |
---|
| 97 | #D- Flag to determine if this job in a standalone mode |
---|
| 98 | #D- Default : value from AA_job if any |
---|
| 99 | StandAlone=${StandAlone:=true} |
---|
| 100 | |
---|
[206] | 101 | #D- Low level debug : to bypass lib test checks and stack construction |
---|
| 102 | #D- Default : value from AA_job if any |
---|
[229] | 103 | libIGCM=${libIGCM:=::modipsl::/libIGCM} |
---|
| 104 | # WARNING for StandAlone used : To run this script on some machine, |
---|
| 105 | # you must check MirrorlibIGCM variable in sys library. |
---|
| 106 | # If this variable is true, you must use libIGCM_POST path instead |
---|
| 107 | # of your running libIGCM directory. |
---|
[206] | 108 | |
---|
[213] | 109 | #D- Flag to determine if rebuild process has been performed asynchronously |
---|
| 110 | #D- Possible value true or false. |
---|
| 111 | #D- If true raw files has allready been patched by rebuild job |
---|
| 112 | #D- If false create_ts will patch the raw files |
---|
| 113 | #D- Default : Value from AA_job if any. Usefull in StandAlone case. |
---|
| 114 | RebuildFrequency=${RebuildFrequency:=true} |
---|
| 115 | |
---|
[2] | 116 | #D- Flag to determine atlas job's output directory |
---|
| 117 | #D- Default : value from libIGCM_post.ksh if any |
---|
| 118 | POST_DIR=${POST_DIR:=${PBS_O_WORKDIR}} |
---|
| 119 | |
---|
| 120 | #D- Increased verbosity (1, 2, 3) |
---|
| 121 | #D- Default : value from AA_job if any |
---|
| 122 | Verbosity=${Verbosity:=3} |
---|
| 123 | |
---|
| 124 | #D- Low level debug : to bypass lib test checks and stack construction |
---|
| 125 | #D- Default : value from AA_job if any |
---|
| 126 | DEBUG_debug=${DEBUG_debug:=false} |
---|
| 127 | |
---|
| 128 | #D- TEMPORARY Flag to determine atmospheric resolution |
---|
| 129 | #D- Default : value from atmospheric driver if any |
---|
[135] | 130 | RESOL_ATM=${RESOL_ATM:=ALL} |
---|
[2] | 131 | |
---|
| 132 | #D- TEMPORARY Flag to determine ocean resolution |
---|
| 133 | #D- Default : value from ocean driver if any |
---|
| 134 | RESOL_OCE=${RESOL_OCE:=ORCA2} |
---|
| 135 | |
---|
| 136 | #D- TEMPORARY Flag to determine ice resolution |
---|
| 137 | #D- Default : value from ice driver if any |
---|
| 138 | RESOL_ICE=${RESOL_ICE:=ORCA2} |
---|
| 139 | |
---|
[178] | 140 | #D- TEMPORARY Flag to determine marine biogeochemistry resolution |
---|
| 141 | #D- Default : value from ice driver if any |
---|
| 142 | RESOL_MBG=${RESOL_MBG:=ORCA2} |
---|
| 143 | |
---|
[2] | 144 | #D- Flag to determine surface resolution |
---|
| 145 | #D- Default : value from surface driver if any |
---|
[213] | 146 | RESOL_SRF=ALL |
---|
[2] | 147 | |
---|
[213] | 148 | #D- Flag to determine surface resolution |
---|
| 149 | #D- Default : value from surface driver if any |
---|
| 150 | RESOL_SBG=ALL |
---|
| 151 | |
---|
[2] | 152 | ######################################################################## |
---|
| 153 | |
---|
[108] | 154 | . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh |
---|
| 155 | ( ${DEBUG_debug} ) && IGCM_debug_Check |
---|
| 156 | . ${libIGCM}/libIGCM_card/libIGCM_card.ksh |
---|
| 157 | ( ${DEBUG_debug} ) && IGCM_card_Check |
---|
| 158 | . ${libIGCM}/libIGCM_date/libIGCM_date.ksh |
---|
| 159 | ( ${DEBUG_debug} ) && IGCM_date_Check |
---|
| 160 | #------- |
---|
| 161 | . ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh |
---|
[2] | 162 | |
---|
| 163 | ######################################################################## |
---|
| 164 | |
---|
| 165 | #set -vx |
---|
| 166 | |
---|
[202] | 167 | IGCM_sys_MkdirWork ${RUN_DIR_PATH} |
---|
[2] | 168 | IGCM_sys_Cd ${RUN_DIR_PATH} |
---|
| 169 | |
---|
| 170 | if [ ${StandAlone} = true ] ; then |
---|
| 171 | CARD_DIR=${SUBMIT_DIR} |
---|
| 172 | else |
---|
| 173 | CARD_DIR=${RUN_DIR_PATH}/$( basename ${SUBMIT_DIR} ) |
---|
| 174 | IGCM_sys_Get_Master ${SUBMIT_DIR} ${RUN_DIR_PATH} |
---|
| 175 | fi |
---|
| 176 | |
---|
| 177 | # |
---|
| 178 | # First of all |
---|
| 179 | # |
---|
| 180 | IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card UserChoices |
---|
| 181 | typeset option |
---|
| 182 | for option in ${config_UserChoices[*]} ; do |
---|
| 183 | IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card UserChoices ${option} |
---|
| 184 | done |
---|
| 185 | # |
---|
| 186 | echo |
---|
| 187 | IGCM_debug_Print 1 "DefineArrayFromOption : config_UserChoices" |
---|
| 188 | IGCM_debug_PrintVariables 3 config_UserChoices_JobName |
---|
| 189 | IGCM_debug_PrintVariables 3 config_UserChoices_LongName |
---|
| 190 | IGCM_debug_PrintVariables 3 config_UserChoices_TagName |
---|
| 191 | IGCM_debug_PrintVariables 3 config_UserChoices_CalendarType |
---|
| 192 | IGCM_debug_PrintVariables 3 config_UserChoices_DateBegin |
---|
| 193 | IGCM_debug_PrintVariables 3 config_UserChoices_DateEnd |
---|
| 194 | IGCM_debug_PrintVariables 3 config_UserChoices_PeriodLength |
---|
| 195 | echo |
---|
| 196 | |
---|
| 197 | #================================== |
---|
| 198 | |
---|
| 199 | R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_JobName} |
---|
| 200 | # |
---|
| 201 | IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card ListOfComponents |
---|
| 202 | # |
---|
| 203 | IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card Post SeasonalFrequency |
---|
| 204 | # |
---|
| 205 | # Determine period for seasonnal average. Default : value from AA_job if any |
---|
| 206 | # |
---|
| 207 | DateBegin=${DateBegin:=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} )} |
---|
| 208 | # |
---|
| 209 | PeriodDateEnd=${PeriodDateEnd:=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} )} |
---|
| 210 | # |
---|
| 211 | freq=$( echo ${config_Post_SeasonalFrequency} | sed -e "s/[yY]//" ) |
---|
| 212 | # |
---|
[149] | 213 | an_fin=$(( $( IGCM_date_ConvertGregorianDateToJulian ${PeriodDateEnd} ) / 1000 )) |
---|
[2] | 214 | an_deb=$( IGCM_date_YearDigit $(( an_fin - freq + 1 )) ) |
---|
| 215 | an_fin=$( IGCM_date_YearDigit ${an_fin} ) |
---|
| 216 | # |
---|
| 217 | # For each component selected determine which files need post-processing |
---|
| 218 | # |
---|
| 219 | for comp in ${config_ListOfComponents[*]} ; do |
---|
| 220 | # |
---|
| 221 | IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp} |
---|
| 222 | eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1 |
---|
| 223 | # |
---|
| 224 | card=${CARD_DIR}/COMP/${compname}.card |
---|
| 225 | IGCM_card_DefineArrayFromOption ${card} OutputFiles List |
---|
| 226 | # |
---|
| 227 | ListFilesName=${compname}_OutputFiles_List |
---|
| 228 | eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1 |
---|
| 229 | # |
---|
| 230 | if [ X${FileName0} != X${NULL_STR} ] ; then |
---|
| 231 | # |
---|
| 232 | #IGCM_debug_Print 1 "Component : ${compname}" |
---|
| 233 | # |
---|
| 234 | # INITIALISATION |
---|
| 235 | # |
---|
| 236 | eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1 |
---|
| 237 | typeset i=0 |
---|
| 238 | # |
---|
| 239 | until [ $i -eq $NbFiles ]; do |
---|
| 240 | # |
---|
| 241 | eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1 |
---|
| 242 | eval file_in=${file_in_} |
---|
| 243 | let $(( i_ = i+2 )) |
---|
| 244 | eval flag_post_=\${${ListFilesName}[$i_]} > /dev/null 2>&1 |
---|
| 245 | eval flag_post=${flag_post_} |
---|
| 246 | # |
---|
| 247 | if [ X${flag_post} != XNONE ] ; then |
---|
| 248 | # |
---|
| 249 | # Initialize ${flag_post}_${compname}_${post_freq} |
---|
| 250 | # |
---|
[66] | 251 | eval export ${flag_post}_${compname}_SeasonalFrequency=true |
---|
[2] | 252 | fi |
---|
| 253 | let $(( i=i+3 )) |
---|
| 254 | done |
---|
| 255 | fi |
---|
| 256 | |
---|
[66] | 257 | for element in $( env | grep Post_ | grep ${compname}_SeasonalFrequency | grep -i "=true" ) ; do |
---|
[2] | 258 | # |
---|
[131] | 259 | FILE=$( echo ${element} | awk -F "_${compname}_SeasonalFrequency" '{print $1}' | awk "-FPost_" '{print $2}' ) |
---|
[2] | 260 | # |
---|
| 261 | # CREATE LIST |
---|
| 262 | # |
---|
| 263 | DIRECTORY=${R_SAVE}/${comp}/Analyse/SE |
---|
| 264 | # |
---|
| 265 | TestedFile=${config_UserChoices_JobName}_SE_${an_deb}_${an_fin}_${FILE}.nc |
---|
| 266 | # |
---|
[66] | 267 | IGCM_sys_TestFileArchive ${DIRECTORY}/${TestedFile} |
---|
| 268 | if [ ! $? = 0 ] ; then |
---|
[2] | 269 | eval set +A LISTE_FILE_${comp} \$\{LISTE_FILE_${comp}[*]} ${FILE} |
---|
[150] | 270 | if [ ! ${RebuildFrequency} = true ] ; then |
---|
| 271 | IGCM_card_DefineArrayFromOption ${card} Post_${FILE} Patches |
---|
| 272 | eval set +A LISTE_PATCHES_${FILE} \$\{${compname}_Post_${FILE}_Patches[*]} |
---|
| 273 | if [ X$( eval echo \${LISTE_PATCHES_${FILE}[0]} ) != X${NULL_STR} ]; then |
---|
| 274 | for Patch in $( eval echo \${LISTE_PATCHES_${FILE}[*]} ); do |
---|
| 275 | if [ Xload${Patch} != X ] ; then |
---|
| 276 | . ${libIGCM}/libIGCM_post/IGCM_${Patch}.ksh |
---|
| 277 | eval load${Patch}=loaded |
---|
| 278 | fi |
---|
| 279 | done |
---|
| 280 | fi |
---|
[2] | 281 | fi |
---|
| 282 | fi |
---|
[150] | 283 | # |
---|
| 284 | done # for element |
---|
| 285 | done # for comp |
---|
[2] | 286 | |
---|
| 287 | for comp in ${config_ListOfComponents[*]} ; do |
---|
| 288 | # |
---|
| 289 | eval R_OUT_${comp}=${R_SAVE}/${comp} |
---|
| 290 | # |
---|
| 291 | i=0 |
---|
| 292 | for file in $( eval echo \${LISTE_FILE_${comp}[*]} ); do |
---|
| 293 | # |
---|
| 294 | # Determine in which output can we find file |
---|
| 295 | # IE : Output/MO or Output/DA or ... |
---|
| 296 | # |
---|
| 297 | FlagDir=$( echo ${file} | awk -F "_" '{print $1}' ) |
---|
| 298 | case ${FlagDir} in |
---|
| 299 | 1Y) FreqDir=YE ;; |
---|
| 300 | 1M) FreqDir=MO ;; |
---|
| 301 | 5D|1D) FreqDir=DA ;; |
---|
| 302 | HF) FreqDir=HF ;; |
---|
| 303 | INS) FreqDir=INS ;; |
---|
| 304 | esac |
---|
| 305 | # |
---|
| 306 | RESULT_SE=${config_UserChoices_JobName}_SE_${an_deb}_${an_fin}_${file}.nc |
---|
| 307 | # Do not redoo an existing SE |
---|
[66] | 308 | IGCM_sys_TestFileArchive ${R_SAVE}/${comp}/Analyse/SE/${RESULT_SE} |
---|
| 309 | if [ $? = 0 ] ; then |
---|
[2] | 310 | continue |
---|
| 311 | fi |
---|
| 312 | # |
---|
| 313 | eval file_path=\${R_OUT_${comp}}/Output/${FreqDir}/ |
---|
| 314 | # |
---|
| 315 | case ${config_UserChoices_PeriodLength} in |
---|
| 316 | # For Yearly simulation : |
---|
| 317 | 1Y|1y) |
---|
| 318 | (( an = an_deb )) |
---|
| 319 | # Initialize array |
---|
[66] | 320 | #set -A liste_file_se |
---|
| 321 | #set -A liste_file_se_tmp |
---|
| 322 | unset liste_file_se |
---|
| 323 | unset liste_file_se_tmp |
---|
[2] | 324 | while [ ${an} -le ${an_fin} ] ; do |
---|
| 325 | moisL=$( IGCM_date_DaysInMonth ${an} ${mois} ) |
---|
| 326 | # |
---|
| 327 | an4=$(printf "%04i\n" ${an} ) |
---|
| 328 | # |
---|
| 329 | diy=$( IGCM_date_DaysInYear $an4 ) |
---|
| 330 | afin=$( IGCM_date_AddDaysToGregorianDate ${an4}0101 $(( diy - 1 )) ) |
---|
| 331 | date=${an4}0101_${afin} |
---|
[66] | 332 | #set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 333 | #set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 334 | liste_file_se[${#liste_file_se[*]}]=${file_path}${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 335 | liste_file_se_tmp[${#liste_file_se_tmp[*]}]=${config_UserChoices_JobName}_${date}_${file}.nc |
---|
[2] | 336 | (( an = an + 1 )) |
---|
| 337 | done |
---|
| 338 | # |
---|
| 339 | IGCM_sys_Get /l liste_file_se[*] ${RUN_DIR_PATH} |
---|
| 340 | eval ExitFlag=false |
---|
| 341 | IGCM_debug_Verif_Exit_Post |
---|
| 342 | |
---|
| 343 | # Apply IGCM_Patch if needed |
---|
[150] | 344 | if [ ! ${RebuildFrequency} = true ] ; then |
---|
| 345 | if [ X$( eval echo \${LISTE_PATCHES_${file}[0]} ) != X${NULL_STR} ]; then |
---|
| 346 | for file_t in $( eval echo ${liste_file_se_tmp[*]} ); do |
---|
| 347 | for Patch in $( eval echo \${LISTE_PATCHES_${file}[*]} ); do |
---|
| 348 | IGCM_${Patch} ${file_t} |
---|
| 349 | done |
---|
[2] | 350 | done |
---|
[150] | 351 | fi |
---|
[2] | 352 | fi |
---|
[231] | 353 | |
---|
| 354 | # Search of common list of variables to be treated |
---|
| 355 | nbfile=0 |
---|
| 356 | for file_common_var in ${liste_file_se_tmp[*]} ; do |
---|
| 357 | ncks -m ${file_common_var} | grep '# dim. =' | cut -d ':' -f 1 >> tmpfile_ncra |
---|
| 358 | let nbfile=nbfile+1 |
---|
| 359 | done |
---|
| 360 | list_var_final_ncra=`cat tmpfile_ncra | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 == nbfile) {print $2}}' | paste -s -d ','` |
---|
| 361 | IGCM_sys_Rm tmpfile_ncra |
---|
[2] | 362 | |
---|
| 363 | for mois in 01 02 03 04 05 06 07 08 09 10 11 12 ; do |
---|
| 364 | # |
---|
| 365 | (( nb = ${mois} - 1 )) |
---|
| 366 | # |
---|
| 367 | OUT_SE[${nb}]=${config_UserChoices_JobName}_SE${mois}_${an_deb}_${an_fin}_${file}.nc |
---|
[231] | 368 | IGCM_sys_ncra -O -v ${list_var_final_ncra} -d time_counter,${nb},,12 ${liste_file_se_tmp[*]} ${OUT_SE[${nb}]} |
---|
[2] | 369 | done |
---|
| 370 | IGCM_sys_Rm ${liste_file_se_tmp[*]} |
---|
| 371 | eval ExitFlag=false |
---|
| 372 | IGCM_debug_Verif_Exit_Post |
---|
| 373 | ;; |
---|
| 374 | # For Monthly simulation : |
---|
| 375 | 1M|1m) |
---|
| 376 | for mois in 01 02 03 04 05 06 07 08 09 10 11 12 ; do |
---|
| 377 | # |
---|
| 378 | (( nb = ${mois} - 1 )) |
---|
| 379 | # |
---|
| 380 | OUT_SE[${nb}]=${config_UserChoices_JobName}_SE${mois}_${an_deb}_${an_fin}_${file}.nc |
---|
| 381 | # |
---|
| 382 | (( an = an_deb )) |
---|
| 383 | # Initialize array |
---|
[66] | 384 | #set -A liste_file_se |
---|
| 385 | #set -A liste_file_se_tmp |
---|
| 386 | unset liste_file_se |
---|
| 387 | unset liste_file_se_tmp |
---|
[2] | 388 | while [ ${an} -le ${an_fin} ] ; do |
---|
| 389 | moisL=$( IGCM_date_DaysInMonth ${an} ${mois} ) |
---|
| 390 | # |
---|
| 391 | an4=$(printf "%04i\n" ${an} ) |
---|
| 392 | # |
---|
| 393 | date=${an4}${mois}01_${an4}${mois}${moisL} |
---|
[66] | 394 | #set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 395 | #set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 396 | liste_file_se[${#liste_file_se[*]}]=${file_path}${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 397 | liste_file_se_tmp[${#liste_file_se_tmp[*]}]=${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 398 | |
---|
[2] | 399 | (( an = an + 1 )) |
---|
| 400 | done |
---|
| 401 | # |
---|
| 402 | IGCM_sys_Get /l liste_file_se[*] ${RUN_DIR_PATH} |
---|
| 403 | eval ExitFlag=false |
---|
| 404 | IGCM_debug_Verif_Exit_Post |
---|
| 405 | |
---|
| 406 | # Apply IGCM_Patch if needed |
---|
[150] | 407 | if [ ! ${RebuildFrequency} = true ] ; then |
---|
| 408 | if [ X$( eval echo \${LISTE_PATCHES_${file}[0]} ) != X${NULL_STR} ]; then |
---|
| 409 | for file_t in $( eval echo ${liste_file_se_tmp[*]} ); do |
---|
| 410 | for Patch in $( eval echo \${LISTE_PATCHES_${file}[*]} ); do |
---|
| 411 | IGCM_${Patch} ${file_t} |
---|
| 412 | done |
---|
[2] | 413 | done |
---|
[150] | 414 | fi |
---|
[2] | 415 | fi |
---|
| 416 | |
---|
[231] | 417 | # Search of common list of variables to be treated |
---|
| 418 | nbfile=0 |
---|
| 419 | for file_common_var in ${liste_file_se_tmp[*]} ; do |
---|
| 420 | ncks -m ${file_common_var} | grep '# dim. =' | cut -d ':' -f 1 >> tmpfile_ncra |
---|
| 421 | let nbfile=nbfile+1 |
---|
| 422 | done |
---|
| 423 | list_var_final_ncra=`cat tmpfile_ncra | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 == nbfile) {print $2}}' | paste -s -d ','` |
---|
| 424 | IGCM_sys_Rm tmpfile_ncra |
---|
| 425 | IGCM_sys_ncra -O -v ${list_var_final_ncra} ${liste_file_se_tmp[*]} ${OUT_SE[${nb}]} |
---|
| 426 | |
---|
[2] | 427 | IGCM_sys_Rm ${liste_file_se_tmp[*]} |
---|
| 428 | eval ExitFlag=false |
---|
| 429 | IGCM_debug_Verif_Exit_Post |
---|
| 430 | done |
---|
| 431 | ;; |
---|
| 432 | *D|*d) |
---|
| 433 | for mois in 01 02 03 04 05 06 07 08 09 10 11 12 ; do |
---|
| 434 | # |
---|
| 435 | (( nb = ${mois} - 1 )) |
---|
| 436 | # |
---|
| 437 | OUT_SE[${nb}]=${config_UserChoices_JobName}_SE${mois}_${an_deb}_${an_fin}_${file}.nc |
---|
| 438 | # |
---|
| 439 | (( an = an_deb )) |
---|
| 440 | # Initialize array |
---|
[66] | 441 | #set -A liste_file_se |
---|
| 442 | #set -A liste_file_se_tmp |
---|
| 443 | unset liste_file_se |
---|
| 444 | unset liste_file_se_tmp |
---|
[2] | 445 | while [ ${an} -le ${an_fin} ] ; do |
---|
| 446 | moisL=$( IGCM_date_DaysInMonth ${an} ${mois} ) |
---|
| 447 | # |
---|
| 448 | an4=$(printf "%04i\n" ${an} ) |
---|
| 449 | # |
---|
| 450 | length_d=$(( ${config_UserChoices_PeriodLength} - 1 )) |
---|
| 451 | # for one day |
---|
| 452 | if [ ${length_d} -eq 1 ] ; then |
---|
| 453 | (( length_d = 0 )) |
---|
| 454 | fi |
---|
| 455 | (( day = 1 )) |
---|
| 456 | while [ ${day} -le ${moisL} ] ; do |
---|
| 457 | day2=$(printf "%02i\n" ${day} ) |
---|
| 458 | day_beg=${an4}${mois}${day2} |
---|
| 459 | day_end=$( IGCM_date_AddDaysToGregorianDate ${day_beg} ${length_d} ) |
---|
| 460 | date=${an4}${mois}${day_beg}_${an4}${mois}${day_end} |
---|
[66] | 461 | #set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 462 | #set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 463 | liste_file_se[${#liste_file_se[*]}]=${file_path}${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 464 | liste_file_se_tmp[${#liste_file_se_tmp[*]}]=${config_UserChoices_JobName}_${date}_${file}.nc |
---|
[2] | 465 | (( day = day + 1 )) |
---|
| 466 | done |
---|
| 467 | (( an = an + 1 )) |
---|
| 468 | done |
---|
| 469 | # |
---|
| 470 | IGCM_sys_Get /l liste_file_se[*] ${RUN_DIR_PATH} |
---|
| 471 | eval ExitFlag=false |
---|
| 472 | IGCM_debug_Verif_Exit_Post |
---|
| 473 | |
---|
| 474 | # Apply IGCM_Patch if needed |
---|
[150] | 475 | if [ ! ${RebuildFrequency} = true ] ; then |
---|
| 476 | if [ X$( eval echo \${LISTE_PATCHES_${file}[0]} ) != X${NULL_STR} ]; then |
---|
| 477 | for file_t in $( eval echo ${liste_file_se_tmp[*]} ); do |
---|
| 478 | for Patch in $( eval echo \${LISTE_PATCHES_${file}[*]} ); do |
---|
| 479 | IGCM_${Patch} ${file_t} |
---|
| 480 | done |
---|
[2] | 481 | done |
---|
[150] | 482 | fi |
---|
[2] | 483 | fi |
---|
| 484 | |
---|
[231] | 485 | # Search of common list of variables to be treated |
---|
| 486 | nbfile=0 |
---|
| 487 | for file_common_var in ${liste_file_se_tmp[*]} ; do |
---|
| 488 | ncks -m ${file_common_var} | grep '# dim. =' | cut -d ':' -f 1 >> tmpfile_ncra |
---|
| 489 | let nbfile=nbfile+1 |
---|
| 490 | done |
---|
| 491 | list_var_final_ncra=`cat tmpfile_ncra | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 == nbfile) {print $2}}' | paste -s -d ','` |
---|
| 492 | IGCM_sys_Rm tmpfile_ncra |
---|
| 493 | |
---|
| 494 | IGCM_sys_ncra -O -v ${list_var_final_ncra} ${liste_file_se_tmp[*]} ${OUT_SE[${nb}]} |
---|
[2] | 495 | IGCM_sys_Rm ${liste_file_se_tmp[*]} |
---|
| 496 | eval ExitFlag=false |
---|
| 497 | IGCM_debug_Verif_Exit_Post |
---|
| 498 | done |
---|
| 499 | ;; |
---|
| 500 | esac |
---|
| 501 | # |
---|
[231] | 502 | |
---|
| 503 | # Search of common list of variables to be treated |
---|
| 504 | nbfile=0 |
---|
| 505 | for file_common_var in ${OUT_SE[*]} ; do |
---|
| 506 | ncks -m ${file_common_var} | grep '# dim. =' | cut -d ':' -f 1 >> tmpfile_ncrcat |
---|
| 507 | let nbfile=nbfile+1 |
---|
| 508 | done |
---|
| 509 | list_var_final_ncrcat=`cat tmpfile_ncrcat | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 == nbfile) {print $2}}' | paste -s -d ','` |
---|
| 510 | IGCM_sys_Rm tmpfile_ncrcat |
---|
| 511 | |
---|
| 512 | IGCM_sys_ncrcat -O -v ${list_var_final_ncrcat} ${OUT_SE[*]} ${RESULT_SE} |
---|
[2] | 513 | # |
---|
| 514 | IGCM_sys_Rm ${OUT_SE[*]} |
---|
| 515 | # |
---|
| 516 | ${ncatted} -a modulo,time_counter,c,c," " ${RESULT_SE} |
---|
| 517 | # |
---|
| 518 | eval IGCM_sys_Put_Out ${RESULT_SE} \${R_OUT_${comp}}/Analyse/SE/${RESULT_SE} |
---|
| 519 | IGCM_sys_Rm ${RESULT_SE} |
---|
| 520 | # |
---|
| 521 | eval ExitFlag=false |
---|
| 522 | IGCM_debug_Verif_Exit_Post |
---|
| 523 | done |
---|
| 524 | done |
---|
| 525 | |
---|
| 526 | # DODS copy |
---|
| 527 | for comp in ${config_ListOfComponents[*]} ; do |
---|
[67] | 528 | IGCM_sys_TestDirArchive ${R_SAVE}/${comp}/Analyse/SE |
---|
| 529 | [ $? = 0 ] && IGCM_sys_Put_Dods ${comp}/Analyse/SE |
---|
[2] | 530 | done |
---|
| 531 | |
---|
| 532 | YEARS=${an_deb}_${an_fin} |
---|
| 533 | |
---|
| 534 | export POST_DIR; export SUBMIT_DIR; export libIGCM; export R_INIT; export R_BC; export StandAlone |
---|
[213] | 535 | export RESOL_ATM; export RESOL_OCE ; export RESOL_ICE ; export RESOL_MBG ; export RESOL_SRF ; export RESOL_SBG |
---|
[2] | 536 | export R_SAVE; export config_UserChoices_JobName; export config_UserChoices_TagName; export YEARS; |
---|
[213] | 537 | listVarEnv="POST_DIR,SUBMIT_DIR,libIGCM,R_INIT,R_BC,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG,R_SAVE,config_UserChoices_JobName,config_UserChoices_TagName,YEARS" |
---|
[2] | 538 | export listVarEnv; |
---|
| 539 | |
---|
| 540 | #D- |
---|
| 541 | # -------------------------------------------------------------------- |
---|
| 542 | #D- Test if all was right before ATLAS |
---|
| 543 | # -------------------------------------------------------------------- |
---|
| 544 | IGCM_debug_Verif_Exit_Post |
---|
| 545 | |
---|
| 546 | if [ ${config_UserChoices_TagName} = "IPSLCM4_v1_OASIS3" ] || \ |
---|
[15] | 547 | [ ${config_UserChoices_TagName} = "IPSLCM4_v2" ] || \ |
---|
[2] | 548 | [ ${config_UserChoices_TagName} = "IPSL_ESM_V1" ] ; then |
---|
| 549 | # |
---|
| 550 | IGCM_sys_QsubPost atlas_ORCHIDEE ; |
---|
| 551 | IGCM_sys_QsubPost atlas_LMDZ ; |
---|
| 552 | IGCM_sys_QsubPost atlas_ORCA_LIM ; |
---|
| 553 | IGCM_sys_QsubPost additionnal ; |
---|
| 554 | # |
---|
[74] | 555 | elif [ ${config_UserChoices_TagName} = "IPSLCM5" ] ; then |
---|
| 556 | IGCM_sys_QsubPost atlas_ORCHIDEE ; |
---|
| 557 | IGCM_sys_QsubPost atlas_LMDZ ; |
---|
| 558 | IGCM_sys_QsubPost atlas_ORCA_LIM ; |
---|
| 559 | # |
---|
[15] | 560 | elif [ ${config_UserChoices_TagName} = "LMDZ4OR" ] || \ |
---|
[43] | 561 | [ ${config_UserChoices_TagName} = "LMDZOR" ] || \ |
---|
[25] | 562 | [ ${config_UserChoices_TagName} = "LMDZ4OR_v2" ] ; then |
---|
[2] | 563 | # |
---|
| 564 | IGCM_sys_QsubPost atlas_LMDZ ; |
---|
| 565 | IGCM_sys_QsubPost atlas_ORCHIDEE ; |
---|
| 566 | # |
---|
[45] | 567 | elif [ ${config_UserChoices_TagName} = "LMDZ" ] ; then |
---|
[34] | 568 | # |
---|
| 569 | IGCM_sys_QsubPost atlas_LMDZ ; |
---|
| 570 | # |
---|
[15] | 571 | elif [ ${config_UserChoices_TagName} = "OL" ] || \ |
---|
[2] | 572 | [ ${config_UserChoices_TagName} = "OL2" ] ; then |
---|
| 573 | # |
---|
| 574 | IGCM_sys_QsubPost atlas_ORCHIDEE ; |
---|
| 575 | # |
---|
[87] | 576 | elif [ ${config_UserChoices_TagName} = "ORCA2_LIM" ] || |
---|
| 577 | [ ${config_UserChoices_TagName} = "ORCA2_LIM2" ] || |
---|
| 578 | [ ${config_UserChoices_TagName} = "ORCA2_LIM2_PISCES" ] ; then |
---|
[2] | 579 | # |
---|
| 580 | IGCM_sys_QsubPost atlas_ORCA_LIM ; |
---|
[87] | 581 | # IGCM_sys_QsubPost additionnal ; |
---|
[2] | 582 | # |
---|
| 583 | fi |
---|
[203] | 584 | |
---|
| 585 | # Clean RUN_DIR_PATH (necessary for cesium) |
---|
| 586 | IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH} |
---|