Changeset 1316 for CONFIG/IPSLCM/IPSLCM5A/Chistorical
- Timestamp:
- 02/22/11 10:36:38 (13 years ago)
- Location:
- CONFIG/IPSLCM/IPSLCM5A/Chistorical
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
CONFIG/IPSLCM/IPSLCM5A/Chistorical/COMP/lmdz.driver
r1237 r1316 92 92 IGCM_debug_PushStack "ATM_Update" 93 93 94 typeset InitPeriodCo2 InitDateBeginCo2 InitDateEndCo2 94 95 typeset CO2SBG CO2MBG CO2LU CO2_ppm CO2_ppm_prec fCO2_ff 95 typeset PreviousLinelog LastPeriodDateBegin LastPeriodDateEnd LastDatesPeriod LastPREFIX 96 typeset PathCO2log Date_r OUT_OCE OUT_SRF 96 typeset PathCO2log 97 97 98 98 case ${config_UserChoices_PeriodLength} in … … 162 162 163 163 if ( ${FirstInitialize} && [ X"${config_ATM_Restart}" = X"n" ]) ; then 164 ##--Initialization of fluxes to an undefined value at the first run 165 UndefinedValueCo2=-9999 166 InitPeriodCo2=0 167 InitDateBeginCo2=${UndefinedValueCo2} 168 InitYearCo2=$(( ${year} - 1 )) 169 InitDateEndCo2=${InitYearCo2}1231 170 fCO2_ff=${UndefinedValueCo2} 171 CO2SBG=${UndefinedValueCo2} 172 CO2LU=${UndefinedValueCo2} 173 CO2MBG=${UndefinedValueCo2} 174 CO2_ppm_prec=${UndefinedValueCo2} 175 # Get the initial value of atmosp. pco2 176 CO2_ppm=${lmdz_UserChoices_co2_init} 177 178 IGCM_sys_Cp ${SUBMIT_DIR}/co2.log.init ${SUBMIT_DIR}/co2.log 179 IGCM_sys_Chmod u+w ${SUBMIT_DIR}/co2.log 180 181 # Save CO2 values in ExeCpuLog variable contents 5 fields 182 echo "${InitPeriodCo2} ${InitDateBeginCo2} ${InitDateEndCo2} ${CO2_ppm} ${CO2_ppm_prec} ${fCO2_ff} ${CO2MBG} ${CO2SBG} ${CO2LU}" | \ 183 gawk '{printf(" %11d | %15s | %15s | %22.15g | %20.15g | %11.8g | %11.8g | %12.8g | %12.8g \n", \ 184 $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/co2.log 185 186 # Get the path where the log file co2.log is 187 PathCO2log=${SUBMIT_DIR} 188 # Get Previous line in co2.log 189 PreviousLinelog=$( tail -1 ${PathCO2log}/co2.log ) 164 190 165 fCO2_ff=0166 CO2SRF=0167 CO2LU=0168 CO2MBG=0169 CO2_ppm=${lmdz_UserChoices_co2_init}170 CO2_ppm_prec=${lmdz_UserChoices_co2_init}171 172 IGCM_sys_Cp ${SUBMIT_DIR}/co2.log.init ${SUBMIT_DIR}/co2.log173 IGCM_sys_Chmod u+w ${SUBMIT_DIR}/co2.log174 175 echo "${CumulPeriod} ${PeriodDateBegin} ${PeriodDateEnd} ${CO2_ppm} ${CO2_ppm_prec} ${fCO2_ff} ${CO2MBG} ${CO2SRF} ${CO2LU}" | \176 gawk '{printf(" %11d | %15s | %15s | %22.15g | %20.15g | %11.8g | %11.8g | %12.8g | %12.8g \n", \177 $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/co2.log178 191 else 179 # get the fossile fuel file :180 fCO2_ff=$( gawk "{if (match(\$0,\"${year}\ *${month}\")) {print \$5}}" ${SUBMIT_DIR}/PARAM/CMIP5_gridcar_CO2_emissions_fossil_fuel_Andres_1751-2007_monthly_SC_grid1x1.txt )181 fCO2_ff=$( echo "${fCO2_ff} / 1000." | bc -l )182 echo "Fossil Fuel for historical run :" ${fCO2_ff}183 184 # Get restart line in co2.log185 192 186 193 # NEW parameter in config.card (even for Overule all restarts, you must modify the line after this comment ): … … 188 195 #SubmitRestartPath= 189 196 if ( ${FirstInitialize} && [ X"${config_ATM_Restart}" = X"y" ]) ; then 190 IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ATM SubmitRestartPath 191 PathCO2log=${config_ATM_SubmitRestartPath} 192 Date_r=$( IGCM_date_ConvertFormatToGregorian ${config_ATM_RestartDate} ) 193 PreviousLinelog=$( grep ${Date_r} ${PathCO2log}/co2.log ) 194 OUT_OCE=${config_OCE_RestartPath}/${config_OCE_RestartJobName}/OCE 195 OUT_SRF=${config_SRF_RestartPath}/${config_SRF_RestartJobName}/SRF 196 197 IGCM_sys_Cp ${SUBMIT_DIR}/co2.log.init ${SUBMIT_DIR}/co2.log 198 IGCM_sys_Chmod u+w ${SUBMIT_DIR}/co2.log 199 200 # Save Last Line of control in new co2.log file 201 echo ${PreviousLinelog} >> ${SUBMIT_DIR}/co2.log 197 IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ATM SubmitRestartPath 198 PathCO2log=${config_ATM_SubmitRestartPath} 199 Date_r=$( IGCM_date_ConvertFormatToGregorian ${config_ATM_RestartDate} ) 200 PreviousLinelog=$( grep ${Date_r} ${PathCO2log}/co2.log ) 201 202 IGCM_sys_Cp ${SUBMIT_DIR}/co2.log.init ${SUBMIT_DIR}/co2.log 203 IGCM_sys_Chmod u+w ${SUBMIT_DIR}/co2.log 204 205 # Save Last Line of control in new co2.log file 206 InitPeriodCo2=0 207 InitDateBeginCo2=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $2}' ) 208 InitDateEndCo2=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $3}' ) 209 fCO2_ff=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $6}' ) 210 CO2SBG=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $8}' ) 211 CO2LU=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $9}' ) 212 CO2MBG=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $7}' ) 213 CO2_ppm_prec=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $5}' ) 214 CO2_ppm=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $4}' ) 215 216 echo "${InitPeriodCo2} ${InitDateBeginCo2} ${InitDateEndCo2} ${CO2_ppm} ${CO2_ppm_prec} ${fCO2_ff} ${CO2MBG} ${CO2SBG} ${CO2LU}" | \ 217 gawk '{printf(" %11d | %15s | %15s | %22.15g | %20.15g | %11.8g | %11.8g | %12.8g | %12.8g \n", \ 218 $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/co2.log 202 219 else 203 PathCO2log=${SUBMIT_DIR} 204 PreviousLinelog=$( tail -1 ${PathCO2log}/co2.log ) 205 OUT_OCE=${R_OUT_OCE} 206 OUT_SRF=${R_OUT_SRF} 220 # Get restart line in co2.log 221 PathCO2log=${SUBMIT_DIR} 222 PreviousLinelog=$( tail -1 ${PathCO2log}/co2.log ) 223 # Get the value of atmosp. pco2 in co2.log 224 CO2_ppm=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $4}' ) 207 225 fi 208 209 # Get Previous period output PREFIX210 LastPeriodDateBegin=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $2}' )211 LastPeriodDateEnd=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $3}' )212 eval LastDatesPeriod=${LastPeriodDateBegin}_${LastPeriodDateEnd} > /dev/null 2>&1213 # Prefix for save files of this period214 if ( ${FirstInitialize} && [ X"${config_ATM_Restart}" = X"y" ]) ; then215 eval LastPREFIX=${config_ATM_RestartJobName}_${LastDatesPeriod} > /dev/null 2>&1216 else217 eval LastPREFIX=${config_UserChoices_JobName}_${LastDatesPeriod} > /dev/null 2>&1218 fi219 220 # Ocean221 IGCM_sys_TestFileArchive ${OUT_OCE}/Debug/${LastPREFIX}_ocean.output222 if [ $? = 0 ] ; then223 224 if [ $DRYRUN -gt 1 ]; then225 IGCM_sys_Cp ${OUT_OCE}/Debug/${LastPREFIX}_ocean.output ./226 else227 IGCM_sys_Get ${OUT_OCE}/Debug/${LastPREFIX}_ocean.output ./228 fi229 IGCM_comp_PrepareDeletedFiles ./${LastPREFIX}_ocean.output230 CO2MBG=$( ${SUBMIT_DIR}/COMP/lmdz_analyse_pisces_out.awk ${LastPREFIX}_ocean.output )231 CO2MBG=$( echo ${CO2MBG} | sed -e "s/ *//" )232 else233 echo "Error : file ${OUT_OCE}/Debug/${LastPREFIX}_ocean.output not found."234 exit 1235 fi236 237 # Surface238 IGCM_sys_TestFileArchive ${OUT_SRF}/Debug/${LastPREFIX}_out_orchidee_0000239 if [ $? = 0 ] ; then240 if [ $DRYRUN -gt 1 ]; then241 IGCM_sys_Cp ${OUT_SRF}/Debug/${LastPREFIX}_out_orchidee_0000 ./242 else243 IGCM_sys_Get ${OUT_SRF}/Debug/${LastPREFIX}_out_orchidee_0000 ./244 fi245 IGCM_comp_PrepareDeletedFiles ./${LastPREFIX}_out_orchidee_0000246 set +A CO2SBG -- $( ${SUBMIT_DIR}/COMP/lmdz_analyse_stomate_out.awk ${LastPREFIX}_out_orchidee_0000 )247 else248 echo "Error : file ${OUT_SRF}/Debug/${LastPREFIX}_ocean.output not found."249 exit 1250 fi251 CO2SRF=$( echo ${CO2SBG[0]} | sed -e "s/ *//" )252 CO2LU=$( echo ${CO2SBG[1]} | sed -e "s/ *//" )253 254 # Previous CO2255 CO2_ppm_prec=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $4}' )256 257 # Formula258 CO2_ppm=$( echo "${CO2_ppm_prec} + (${fCO2_ff} + ${CO2MBG} + ${CO2SRF} + ${CO2LU}) / 2.12" | bc -l )259 260 # Save CO2 values in ExeCpuLog variable contents 5 fields261 echo "${CumulPeriod} ${PeriodDateBegin} ${PeriodDateEnd} ${CO2_ppm} ${CO2_ppm_prec} ${fCO2_ff} ${CO2MBG} ${CO2SRF} ${CO2LU}" | \262 gawk '{printf(" %11d | %15s | %15s | %22.15g | %20.15g | %11.8g | %11.8g | %12.8g | %12.8g \n", \263 $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/co2.log264 226 265 227 fi … … 360 322 [ ${CumulPeriod} -le ${LMDZ_NbPeriod_adjust} ] && IGCM_sys_Put_Out Bands_${RESOL_ATM_3D}_${NUM_PROC_ATM}prc.dat ${R_OUT_ATM_D}/${config_UserChoices_JobName}_Bands_${RESOL_ATM_3D}_${NUM_PROC_ATM}prc.dat_${CumulPeriod} 361 323 324 typeset CO2SBG_3V CO2SBG CO2MBG CO2SRF CO2LU CO2_ppm CO2_ppm_prec fCO2_ff 325 326 # get the fossile fuel file : 327 fCO2_ff=$( gawk "{if (match(\$0,\"${year}\ *${month}\")) {print \$3}}" ${SUBMIT_DIR}/PARAM/CMIP5_gridcar_CO2_emissions_fossil_fuel_Andres_1751-2007_monthly_SC.txt ) 328 echo "Fossil Fuel for historical run :" ${fCO2_ff} 329 330 # Get the value of ocean carbon flux 331 CO2MBG=$( ${SUBMIT_DIR}/COMP/lmdz_analyse_pisces_out.awk ocean.output ) 332 CO2MBG=$( echo ${CO2MBG} | sed -e "s/ *//" ) 333 echo "Ocean carbon flux :" ${CO2MBG} 334 335 # Get the value of land fluxes 336 set +A CO2SBG_3V -- $( ${SUBMIT_DIR}/COMP/lmdz_analyse_stomate_out.awk out_orchidee_0000 ) 337 CO2SRF=$( echo ${CO2SBG_3V[0]} | sed -e "s/ *//" ) 338 CO2LU=$( echo ${CO2SBG_3V[1]} | sed -e "s/ *//" ) 339 CO2SBG=$( echo ${CO2SBG_3V[2]} | sed -e "s/ *//" ) 340 echo "Land carbon flux (NEP) :" ${CO2SRF} 341 echo "LU flux (FLUC) :" ${CO2LU} 342 echo "Total Land carbon flux (NBP) :" ${CO2SBG} 343 344 # Previous CO2 345 CO2_ppm_prec=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $4}' ) 346 echo "Previous CO2 :" ${CO2_ppm_prec} 347 348 # Formula 349 CO2_ppm=$( echo "${CO2_ppm_prec} + (${fCO2_ff} + ${CO2MBG} + ${CO2SBG}) / 2.12" | bc -l ) 350 echo "New CO2 :" ${CO2_ppm} 351 352 # Save CO2 values in ExeCpuLog variable contents 5 fields 353 echo "${CumulPeriod} ${PeriodDateBegin} ${PeriodDateEnd} ${CO2_ppm} ${CO2_ppm_prec} ${fCO2_ff} ${CO2MBG} ${CO2SBG} ${CO2LU}" | \ 354 gawk '{printf(" %11d | %15s | %15s | %22.15g | %20.15g | %11.8g | %11.8g | %12.8g | %12.8g \n", \ 355 $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/co2.log 362 356 echo FINALIZE ATM ! 363 357 -
CONFIG/IPSLCM/IPSLCM5A/Chistorical/COMP/lmdz_analyse_stomate_out.awk
r1237 r1316 25 25 #========================== 26 26 BEGIN { 27 #print "traitement de " ARGV[1]27 # print "traitement de " ARGV[1] 28 28 29 29 nbarg=ARGC … … 54 54 counterLU=0 55 55 56 fluxNBP_found=0 57 counterNBP=0 58 56 59 CO2file[1]="" 57 60 LUfile[1]="" 61 NBPfile[1]="" 58 62 } 59 63 … … 79 83 CO2file[counterCO2]=felts[2] 80 84 } 81 else if (match($0, ".*GLOBAL net cflux_prod_total_sum.*")) {85 else if (match($0, ".*GLOBAL net_cflux_prod_monthly.*")) { 82 86 myprint("fluxLU_found = 1") 83 87 fluxLU_found=1 … … 87 91 myprint("nb :" nb) 88 92 for (elt in felts) { 93 myprint(elt "- elt :" felts[elt]) 94 } 95 myprint("elts_co2 :" felts[2]) 96 97 LUfile[counterLU]=felts[2] 98 } 99 100 else if (match($0, ".*GLOBAL net_biosp_prod_monthly.*")) { 101 myprint("fluxNBP_found = 1") 102 fluxNBP_found=1 103 counterNBP=counterNBP+1 104 105 nb=split($0,felts, "=") 106 myprint("nb :" nb) 107 for (elt in felts) { 89 108 myprint(elt "- elt :" felts[elt]) 90 109 } 91 myprint("elts_ lu:" felts[2])110 myprint("elts_nbp :" felts[2]) 92 111 93 LUfile[counterLU]=felts[2]112 NBPfile[counterNBP]=felts[2] 94 113 } 95 114 } … … 106 125 myprint("value :" CO2file[i]) 107 126 } 108 109 if ( fluxLU_found == 1 ) { 110 myprint("LU value for " file) 111 myprint("counterLU :" counterLU) 112 for (i=1; i<=counterLU; i++) { 113 print LUfile[i] 114 myprint("value :" LUfile[i]) 127 128 if ( fluxLU_found == 1 ) { 129 myprint("LU value for " file) 130 myprint("counterLU :" counterLU) 131 for (i=1; i<=counterLU; i++) { 132 print LUfile[i] 133 myprint("value :" LUfile[i]) 134 } 135 136 if ( fluxNBP_found == 1 ) { 137 myprint("NBP value for " file) 138 myprint("counterNBP :" counterNBP) 139 for (i=1; i<=counterNBP; i++) { 140 print NBPfile[i] 141 myprint("value :" NBPfile[i]) 142 } 143 144 exit_value=0 145 exit 0 115 146 } 116 147 else { 148 myprint("ERROR : NO NBP value for " file) 149 print "0003" 150 exit 1 151 } 152 117 153 exit_value=0 118 154 exit 0 119 } 120 else { 121 myprint("ERROR : NO LU value for " file) 122 print "0002" 123 exit 1 124 } 125 126 exit_value=0 127 exit 0 155 } 156 else { 157 myprint("ERROR : NO LU value for " file) 158 print "0002" 159 print "0003" 160 exit 1 161 } 128 162 } 129 163 else { 130 131 132 133 exit 1 134 }135 164 myprint("ERROR : NO CO2 value for " file) 165 print "0001" 166 print "0002" 167 print "0003" 168 exit 1 169 } 136 170 } 137 171 else { -
CONFIG/IPSLCM/IPSLCM5A/Chistorical/COMP/pisces.driver
r1019 r1316 10 10 grep "^ *$1 *=" $2 | sed -e "s% *\!.*%%" 11 11 } 12 12 13 13 14 ##--Variables used by MBG -- … … 58 59 fi 59 60 60 ##-- GHG forcing for the current year 61 IPCC_PIS_CO2=`grep Annee_${year} CO2_1765_2005.txt | awk -F= '{print $2}'` 61 ##-- GHG forcing for the current year. Normally constant 62 PathCO2log=${SUBMIT_DIR} 63 PreviousLinelog=$( tail -1 ${PathCO2log}/co2.log ) 64 IPCC_PIS_CO2=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $4}' ) 62 65 63 66 ##-- Update namelist_top and namelist_pisces … … 73 76 namelist_pisces > namelist_pisces.tmp 74 77 75 IGCM_sys_Mv namelist_pisces.tmp namelist_pisces78 IGCM_sys_Mv namelist_pisces.tmp namelist_pisces 76 79 77 80 -
CONFIG/IPSLCM/IPSLCM5A/Chistorical/config.card
r1237 r1316 9 9 [UserChoices] 10 10 #============================ 11 JobName= EXP0011 JobName=Chistorical00 12 12 #----- Short Name of Experiment 13 13 ExperimentName=historical … … 56 56 OverRule=y 57 57 #D- Last day of the experience used as restart for all components 58 RestartDate=18 99-12-3158 RestartDate=1850-12-31 59 59 #D- Define restart simulation name for all components 60 60 # For historical simulation you have to start from an other simulation 61 RestartJobName= XXXXXXX61 RestartJobName=CpiControl00 62 62 #D- Path Server Group Login 63 RestartPath=${ARCHIVE}/IGCM_OUT/IPSLCM5A/DEVT/ piControl63 RestartPath=${ARCHIVE}/IGCM_OUT/IPSLCM5A/DEVT/CpiControl 64 64 65 65 #========================================================================
Note: See TracChangeset
for help on using the changeset viewer.