Changeset 2027 for TOOLS/PACK_IPSL/find_size_pack.sh
- Timestamp:
- 03/11/13 15:13:11 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/PACK_IPSL/find_size_pack.sh
r1962 r2027 54 54 55 55 DEM_write_state ${IGCM_DEM}/config_card.liste ${config_card} FindSizePackRunning 56 57 56 # Periodicite du pack (20 ans par defaut) 58 57 period_pack=20Y … … 119 118 # taille qu'aurait le pack de {periodpackinyear}ans 120 119 DEM_log -1 "Debut recherche taille de pack" 121 122 120 # Recherche des dates du premier pack 123 121 … … 136 134 137 135 # on ne fait le calcul que pour les dix premiers pack (donc 20 * 10 = 200 ans) 138 # cela doit donner un echantillon suffisant 136 # cela doit donner un echantillon suffisant 137 date_begin_pack=`echo $date_begin_pack|sed 's/^0*//'` 138 date_end_simulation=`echo $date_end_simulation|sed 's/^0*//'` 139 139 while [[ ${date_begin_pack} -le ${date_end_simulation} && ${number_pack} -le 10 ]] 140 140 do 141 141 142 142 month_end_pack=${month_begin_pack} 143 year_end_pack=$(( ${year_begin_pack} + ${periodpackinyear} )) 144 143 year_end_pack=$(( 10#${year_begin_pack} + ${periodpackinyear} )) 145 144 date_end_pack=${year_end_pack}${month_end_pack}01 146 145 … … 202 201 new_period=999999 203 202 newpackinyear=0 204 205 for type_file in `awk '{print $0}' ${IGCM_DEM_SIMU}/info_name_file.txt`206 do 207 208 209 210 for taille in `head -n -1 ${IGCM_TMP}/${$}.size_pack_${type_file}.txt`211 do212 213 214 215 216 done217 203 if [[ -f ${IGCM_TMP}/${$}.size_pack_${type_file}.txt ]]; then 204 for type_file in `awk '{print $0}' ${IGCM_DEM_SIMU}/info_name_file.txt` 205 do 206 nb_line=$(cat ${IGCM_TMP}/${$}.size_pack_${type_file}.txt | wc -l ) 207 if [ ${nb_line} -gt 1 ] 208 then 209 for taille in `head -n -1 ${IGCM_TMP}/${$}.size_pack_${type_file}.txt` 210 do 211 [[ ${taille} -lt ${size_pack_min} ]] && period_tmp=$(( ${size_pack_min} * ${periodpackinyear} / ${taille} )) 212 [[ ${taille} -gt ${size_pack_max} ]] && period_tmp=$(( ${size_pack_min} * ${periodpackinyear} / ${taille} )) 213 [[ ${taille} -ge ${size_pack_min} && ${taille} -le ${size_pack_max} ]] && period_tmp=${periodpackinyear} 214 [[ ${period_tmp} -lt ${new_period} ]] && new_period=${period_tmp} 215 done 216 else 218 217 # Dans ce cas la il n'y avait pas assez de fichiers pour remplir une periode complete # 219 218 # il faut donc commencer par calculer la taille du pack que l'on a fait # 220 newpackinyear=$(( ${year_end} - ${year_begin} )) 221 newpackinyear=$(( $newpackinyear + 1 )) 222 [[ ${newpackinyear} -lt 1 ]] && newpackinyear=1 223 224 for taille in `head ${IGCM_TMP}/${$}.size_pack_${type_file}.txt` 225 do 226 [[ ${taille} -lt ${size_pack_min} ]] && period_tmp=${newpackinyear} 227 [[ ${taille} -gt ${size_pack_max} ]] && period_tmp=$(( ${size_pack_min} * ${newpackinyear} / ${taille} )) 228 [[ ${taille} -ge ${size_pack_min} && ${taille} -le ${size_pack_max} ]] && period_tmp=${newpackinyear} 229 [[ ${period_tmp} -lt ${new_period} ]] && new_period=${period_tmp} 230 done 231 232 fi 233 done 234 219 newpackinyear=$(( ${year_end} - ${year_begin} )) 220 newpackinyear=$(( $newpackinyear + 1 )) 221 [[ ${newpackinyear} -lt 1 ]] && newpackinyear=1 222 for taille in `head ${IGCM_TMP}/${$}.size_pack_${type_file}.txt` 223 do 224 [[ ${taille} -lt ${size_pack_min} ]] && period_tmp=${newpackinyear} 225 [[ ${taille} -gt ${size_pack_max} ]] && period_tmp=$(( ${size_pack_min} * ${newpackinyear} / ${taille} )) 226 [[ ${taille} -ge ${size_pack_min} && ${taille} -le ${size_pack_max} ]] && period_tmp=${newpackinyear} 227 [[ ${period_tmp} -lt ${new_period} ]] && new_period=${period_tmp} 228 done 229 fi 230 done 231 fi 235 232 DEM_log -1 "taille=${taille}" 236 233 DEM_log -1 "new_period=${new_period}"
Note: See TracChangeset
for help on using the changeset viewer.