Changeset 10 for branches/AllPostFred/AA_create_se
- Timestamp:
- 05/30/08 10:10:34 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/AllPostFred/AA_create_se
r5 r10 139 139 DateBegin=${DateBegin:=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} )} 140 140 # 141 PeriodDateEnd=${PeriodDateEnd:=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} )}141 DateEnd=${DateEnd:=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} )} 142 142 # 143 143 freq=$( echo ${config_Post_SeasonalFrequency} | sed -e "s/[yY]//" ) 144 144 # 145 an_fin=$( expr $( IGCM_date_ConvertGregorianDateToJulian $ PeriodDateEnd ) / 1000 )145 an_fin=$( expr $( IGCM_date_ConvertGregorianDateToJulian $DateEnd ) / 1000 ) 146 146 an_deb=$( IGCM_date_YearDigit $(( an_fin - freq + 1 )) ) 147 147 an_fin=$( IGCM_date_YearDigit ${an_fin} ) … … 227 227 FlagDir=$( echo ${file} | awk -F "_" '{print $1}' ) 228 228 case ${FlagDir} in 229 1Y) FreqDir=YE ;;230 1M) FreqDir=MO ;;231 5D|1D ) FreqDir=DA ;;229 *Y) FreqDir=YE ;; 230 *M) FreqDir=MO ;; 231 5D|1D|*D) FreqDir=DA ;; 232 232 HF) FreqDir=HF ;; 233 233 INS) FreqDir=INS ;; … … 286 286 IGCM_debug_Verif_Exit_Post 287 287 ;; 288 # For a Multi-Year simulation : 289 *Y|*y) 290 PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | awk -F '[yY]' '{print $1}' ) 291 (( an = an_deb )) 292 # Initialize array 293 set -A liste_file_se 294 set -A liste_file_se_tmp 295 while [ ${an} -le ${an_fin} ] ; do 296 moisL=$( IGCM_date_DaysInMonth ${an} ${mois} ) 297 # 298 an4=$(printf "%04i\n" ${an} ) 299 # 300 (( diy = 0 )) 301 (( ian = 0 )) 302 while [ ${ian} -lt ${PeriodLengthInYears} ] ; do 303 # 304 ian4=$(printf "%04i\n" $(( an + ian )) ) 305 (( diy = diy + $( IGCM_date_DaysInYear $ian4 ) )) 306 (( ian = ian + 1 )) 307 done 308 afin=$( IGCM_date_AddDaysToGregorianDate ${an4}0101 $(( diy - 1 )) ) 309 date=${an4}0101_${afin} 310 set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc 311 set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc 312 (( an = an + PeriodLengthInYears )) 313 done 314 # 315 IGCM_sys_Get /l liste_file_se[*] ${RUN_DIR_PATH} 316 eval ExitFlag=false 317 IGCM_debug_Verif_Exit_Post 318 319 # Apply IGCM_Patch if needed 320 if [ X$( eval echo \${LISTE_PATCHES_${file}[0]} ) != X${NULL_STR} ]; then 321 for file_t in $( eval echo ${liste_file_se_tmp[*]} ); do 322 for Patch in $( eval echo \${LISTE_PATCHES_${file}[*]} ); do 323 IGCM_${Patch} ${file_t} 324 done 325 done 326 fi 327 328 for mois in 01 02 03 04 05 06 07 08 09 10 11 12 ; do 329 # 330 (( nb = ${mois} - 1 )) 331 # 332 OUT_SE[${nb}]=${config_UserChoices_JobName}_SE${mois}_${an_deb}_${an_fin}_${file}.nc 333 IGCM_sys_ncra -O -d time_counter,${nb},,12 ${liste_file_se_tmp[*]} ${OUT_SE[${nb}]} 334 done 335 IGCM_sys_Rm ${liste_file_se_tmp[*]} 336 eval ExitFlag=false 337 IGCM_debug_Verif_Exit_Post 338 ;; 288 339 # For Monthly simulation : 289 340 1M|1m) … … 322 373 fi 323 374 324 IGCM_sys_ncra -O ${liste_file_se_tmp [*]} ${OUT_SE[${nb}]}325 IGCM_sys_Rm ${liste_file_se_tmp[*]}326 eval ExitFlag=false375 IGCM_sys_ncra -O ${liste_file_se_tmp} ${OUT_SE[${nb}]} 376 MENAGE_LOCAL ${liste_file_se_tmp} 377 # 327 378 IGCM_debug_Verif_Exit_Post 328 379 done 380 ;; 381 382 # For Multi-Monthly simulation : 383 *M|*m) 384 PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | awk -F '[mM]' '{print $1}' ) 385 # Must be a divisor of 12 !!! e.g. 2,3,4 and 6 only 386 if ( [ $PeriodLengthInMonths -ne 2 ] && \ 387 [ $PeriodLengthInMonths -ne 3 ] && \ 388 [ $PeriodLengthInMonths -ne 4 ] && \ 389 [ $PeriodLengthInMonths -ne 6 ] ) ; then 390 echo "create_se.job can't work with this monthly Period : ",$PeriodLengthInMonths,"M !!" 391 echo "It must be a divisor of twelve." 392 echo "We will stop there." 393 IGCM_debug_Verif_Exit_Post 394 else 395 # 396 (( NbSet = 12 / PeriodLengthInMonths )) 397 (( moisd = 01 )) 398 (( Mset = 1 )) 399 while [ ${Mset} -le ${NbSet} ] ; do 400 moisf=$(printf "%02i\n" $(( moisd + PeriodLengthInMonths - 1 )) ) 401 moisd=$(printf "%02i\n" ${moisd} ) 402 # 403 (( an = an_deb )) 404 # Initialize array 405 set -A liste_file_se 406 set -A liste_file_se_tmp 407 while [ ${an} -le ${an_fin} ] ; do 408 moisL=$( IGCM_date_DaysInMonth ${an} ${moisf} ) 409 # 410 an4=$(printf "%04i\n" ${an} ) 411 # 412 date=${an4}${moisd}01_${an4}${moisf}${moisL} 413 set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc 414 set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc 415 (( an = an + 1 )) 416 done 417 # 418 IGCM_sys_Get /l liste_file_se[*] ${RUN_DIR_PATH} 419 eval ExitFlag=false 420 IGCM_debug_Verif_Exit_Post 421 422 # Apply IGCM_Patch if needed 423 if [ X$( eval echo \${LISTE_PATCHES_${file}[0]} ) != X${NULL_STR} ]; then 424 for file_t in $( eval echo ${liste_file_se_tmp[*]} ); do 425 for Patch in $( eval echo \${LISTE_PATCHES_${file}[*]} ); do 426 IGCM_${Patch} ${file_t} 427 done 428 done 429 fi 430 431 (( imois = moisd )) 432 (( i = 0 )) 433 while [ ${imois} -le ${moisf} ] ; do 434 # 435 (( nb = ${imois} - 1 )) 436 # 437 OUT_SE[${nb}]=${config_UserChoices_JobName}_SE${imois}_${an_deb}_${an_fin}_${file}.nc 438 IGCM_sys_ncra -O -d time_counter,${i},,${PeriodLengthInMonths} ${liste_file_se_tmp[*]} ${OUT_SE[${nb}]} 439 (( imois = imois + 1 )) 440 (( i = i + 1 )) 441 done 442 443 IGCM_sys_Rm ${liste_file_se_tmp[*]} 444 eval ExitFlag=false 445 IGCM_debug_Verif_Exit_Post 446 moisf=$(printf "%02i\n" $(( moisf + 1 )) ) 447 448 (( Mset = Mset + 1 )) 449 done 450 fi 329 451 ;; 330 452 *D|*d)
Note: See TracChangeset
for help on using the changeset viewer.