Changeset 4378


Ignore:
Timestamp:
03/28/19 14:43:11 (5 years ago)
Author:
jgipsl
Message:

Removed old code never used or maybe used in IPSLCM5A/Chistorical.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CONFIG/UNIFORM/v7/ICOLMDZOR_v7/GENERAL/DRIVER/lmdz.driver

    r4366 r4378  
    189189    IGCM_comp_modifyDefFile nonblocker config.def t_coupl   ${LMDZ_t_coupl}  
    190190 
    191     ##-- Add special treatement for CARBON CYCLE 
    192     if [ X"${lmdz_UserChoices_CARBON_CYCLE}" = X"control" ] || [ X"${lmdz_UserChoices_CARBON_CYCLE}" = X"historical" ] ; then 
    193         ATM_Carbon_Update 
    194     fi 
    195  
    196  
    197     ##-- Set LMDZ_COSP_daily1979=y in section UserChoices in lmdz.card to activate  
    198     ##   COSP daily output for years 1979 and later (mandatory for historical CMIP5 run). 
    199     if ([ X"${lmdz_UserChoices_LMDZ_COSP_daily1979}" = X"y" ] &&  [ ${year} -ge 1979 ]) ; then 
    200         LMDZ_COSP_daily=.TRUE. 
    201     fi 
    202191 
    203192    ## Modifiy  
     
    561550    IGCM_debug_PushStack "ATM_Finalize" 
    562551 
    563     # Add special treatement for CARBON CYCLE 
    564     if [ X"${lmdz_UserChoices_CARBON_CYCLE}" = X"control" ] || [ X"${lmdz_UserChoices_CARBON_CYCLE}" = X"historical" ] ; then 
    565         ATM_Carbon_Finalize 
    566     fi 
    567  
    568     echo FINALIZE ATM ! 
    569  
    570552    IGCM_debug_PopStack "ATM_Finalize" 
    571553} 
    572554 
    573555 
    574  
    575 function ATM_Carbon_Update 
    576 { 
    577     # This fuction will be called only if CARBON_CYCLE is set to control or historical in lmdz.card 
    578  
    579     IGCM_debug_PushStack "ATM_Carbon_Update" 
    580  
    581     typeset InitPeriodCo2 InitDateBeginCo2 InitDateEndCo2 
    582     typeset CO2SBG CO2MBG CO2LU CO2_ppm CO2_ppm_prec fCO2_ff 
    583     typeset PathCO2log  
    584     typeset PreviousLinelog LastPeriodDateBegin LastPeriodDateEnd LastDatesPeriod LastPREFIX 
    585      
    586     if ( ${FirstInitialize} && [ X"${config_ATM_Restart}" = X"n" ] ) ; then 
    587         ##--Initialization of fluxes to an undefined value at the first run 
    588         UndefinedValueCo2=-9999 
    589         InitPeriodCo2=0 
    590         InitDateBeginCo2=${UndefinedValueCo2} 
    591         InitYearCo2=$(( ${year} - 1 ))  
    592         InitDateEndCo2=${InitYearCo2}1231 
    593         fCO2_ff=${UndefinedValueCo2}  
    594         CO2SBG=${UndefinedValueCo2} 
    595         CO2LU=${UndefinedValueCo2} 
    596         CO2MBG=${UndefinedValueCo2} 
    597         CO2_ppm_prec=${UndefinedValueCo2} 
    598         # Get the initial value of atmosp. pco2  
    599         CO2_ppm=${lmdz_UserChoices_co2_init} 
    600          
    601         IGCM_sys_Cp ${SUBMIT_DIR}/co2.log.init ${SUBMIT_DIR}/co2.log 
    602         IGCM_sys_Chmod u+w ${SUBMIT_DIR}/co2.log 
    603          
    604         # Save CO2 values in ExeCpuLog variable contents 5 fields 
    605         echo "${InitPeriodCo2} ${InitDateBeginCo2} ${InitDateEndCo2} ${CO2_ppm} ${CO2_ppm_prec} ${fCO2_ff} ${CO2MBG} ${CO2SBG} ${CO2LU}" |   \ 
    606             gawk '{printf("  %11d | %15s | %15s | %22.15g | %20.15g | %11.8g | %11.8g | %12.8g | %12.8g \n", \ 
    607                               $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/co2.log 
    608          
    609         # Get the path where the log file co2.log is 
    610         PathCO2log=${SUBMIT_DIR}  
    611         # Get Previous line in co2.log 
    612         PreviousLinelog=$( tail -1 ${PathCO2log}/co2.log ) 
    613          
    614     else 
    615          
    616         # NEW parameter in config.card (even for Overule all restarts, you must modify the line after this comment ): 
    617         # !! NEW for Carbone cycle !! Path where to find old co2.log file for restart CO2. 
    618         #SubmitRestartPath= 
    619         if ( ${FirstInitialize} && [ X"${config_ATM_Restart}" = X"y" ] ) ; then 
    620             IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ATM SubmitRestartPath 
    621             PathCO2log=${config_ATM_SubmitRestartPath} 
    622             Date_r=$( IGCM_date_ConvertFormatToGregorian ${config_ATM_RestartDate} ) 
    623             PreviousLinelog=$( grep ${Date_r} ${PathCO2log}/co2.log ) 
    624              
    625             IGCM_sys_Cp ${SUBMIT_DIR}/co2.log.init ${SUBMIT_DIR}/co2.log 
    626             IGCM_sys_Chmod u+w ${SUBMIT_DIR}/co2.log 
    627              
    628             # Save Last Line of control in new co2.log file 
    629             InitPeriodCo2=0    
    630             InitDateBeginCo2=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $2}' ) 
    631             InitDateEndCo2=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $3}' ) 
    632             fCO2_ff=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $6}' ) 
    633             CO2SBG=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $8}' ) 
    634             CO2LU=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $9}' ) 
    635             CO2MBG=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $7}' ) 
    636             CO2_ppm_prec=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $5}' ) 
    637             CO2_ppm=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $4}' ) 
    638              
    639             echo "${InitPeriodCo2} ${InitDateBeginCo2} ${InitDateEndCo2} ${CO2_ppm} ${CO2_ppm_prec} ${fCO2_ff} ${CO2MBG} ${CO2SBG} ${CO2LU}" |   \ 
    640                 gawk '{printf("  %11d | %15s | %15s | %22.15g | %20.15g | %11.8g | %11.8g | %12.8g | %12.8g \n", \ 
    641                               $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/co2.log 
    642         else 
    643            # Get restart line in co2.log 
    644             PathCO2log=${SUBMIT_DIR} 
    645             PreviousLinelog=$( tail -1 ${PathCO2log}/co2.log ) 
    646            # Get the value of atmosp. pco2 in co2.log 
    647             CO2_ppm=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $4}' ) 
    648         fi 
    649          
    650     fi 
    651      
    652     if [ ${lmdz_UserChoices_CARBON_CYCLE} = historical ] ; then 
    653         # Modify co2_ppm in config.def only for historical run 
    654         # If not historical run, keep co2_ppm value set earlier by IGCM_comp_modifyDefFile 
    655         IGCM_comp_modifyDefFile force config.def co2_ppm     ${CO2_ppm} 
    656     fi 
    657     IGCM_debug_PopStack "ATM_Carbon_Update" 
    658 } 
    659  
    660  
    661 function ATM_Carbon_Finalize 
    662 { 
    663     # This fuction will be called only if CARBON_CYCLE is set to control or historical in lmdz.card 
    664  
    665     IGCM_debug_PushStack "ATM_Carbon_Finalize" 
    666  
    667     typeset CO2SBG_3V CO2SBG CO2MBG CO2SRF CO2LU CO2_ppm CO2_ppm_prec fCO2_ff 
    668      
    669         # Fossil fuel emission 
    670     if [ ${lmdz_UserChoices_CARBON_CYCLE} = control ] ; then 
    671             # For Control, no fossil fuel emission : 
    672         fCO2_ff=0 
    673         echo "Fossil Fuel for control run  :" ${fCO2_ff} 
    674     else 
    675             # For historical, get the fossile fuel file : 
    676         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 ) 
    677         echo "Fossil Fuel for historical run  :" ${fCO2_ff} 
    678     fi 
    679      
    680         # Get the value of ocean carbon flux 
    681     CO2MBG=$( ${SUBMIT_DIR}/COMP/lmdz_analyse_pisces_out.awk ocean.output ) 
    682     CO2MBG=$( echo ${CO2MBG} | sed -e "s/ *//" ) 
    683     echo "Ocean carbon flux  :" ${CO2MBG} 
    684      
    685         # Get the value of land fluxes 
    686     set +A CO2SBG_3V -- $( ${SUBMIT_DIR}/COMP/lmdz_analyse_stomate_out.awk out_orchidee_0000 ) 
    687     CO2SRF=$( echo ${CO2SBG_3V[0]} | sed -e "s/ *//" ) 
    688     CO2LU=$( echo ${CO2SBG_3V[1]} | sed -e "s/ *//" ) 
    689     CO2SBG=$( echo ${CO2SBG_3V[2]} | sed -e "s/ *//" ) 
    690     echo "Land carbon flux (NEP)         :" ${CO2SRF} 
    691     echo "LU flux          (FLUC)        :" ${CO2LU} 
    692     echo "Total Land carbon flux (NBP)   :" ${CO2SBG} 
    693      
    694         # Previous CO2 
    695     CO2_ppm_prec=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $4}' ) 
    696     echo "Previous CO2  :" ${CO2_ppm_prec} 
    697      
    698         # Formula 
    699     CO2_ppm=$( echo "${CO2_ppm_prec} + (${fCO2_ff} + ${CO2MBG} + ${CO2SBG}) / 2.12" | bc -l ) 
    700     echo "New CO2  :" ${CO2_ppm} 
    701      
    702         # Save CO2 values in ExeCpuLog variable contents 5 fields 
    703     echo "${CumulPeriod} ${PeriodDateBegin} ${PeriodDateEnd} ${CO2_ppm} ${CO2_ppm_prec} ${fCO2_ff} ${CO2MBG} ${CO2SBG} ${CO2LU}" |   \ 
    704         gawk '{printf("  %11d | %15s | %15s | %22.15g | %20.15g | %11.8g | %11.8g | %12.8g | %12.8g \n", \ 
    705                            $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/co2.log 
    706      
    707     IGCM_debug_PopStack "ATM_Carbon_Finalize" 
    708 } 
Note: See TracChangeset for help on using the changeset viewer.