Ignore:
Timestamp:
08/13/14 18:48:29 (10 years ago)
Author:
jgipsl
Message:

Add error check if the year is not in forcing file for solar activity and GHG parameters.

LMDZOR_v6 : change default resolution to 96x95x39

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/DRIVER/lmdz.driver

    r2320 r2321  
    279279 
    280280    ##-- GHG forcing : 
    281     ##   If forcing file exist in run directory, read values for the current year and modify config.def 
     281    ##   If forcing file exist in run directory, read values for the current year  
     282    ##   and set in config.def. If not use the default value set in config.def 
    282283    if [ -f SOLARANDVOLCANOES.txt ] ; then 
    283284        IPCC_SOLAR=`grep Annee_${year} SOLARANDVOLCANOES.txt | awk -F= '{print $2}'` 
    284         LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     285        if [ X"${IPCC_SOLAR}" = X ] ; then 
     286            # The grep returned empty variable, stop execution 
     287            IGCM_debug_Exit "The file SOLARANDVOLCANOES.txt do not contain the current year." 
     288            IGCM_debug_Verif_Exit 
     289        else 
     290            # Set new variable in config.def file 
     291            LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     292        fi 
    285293    else 
    286294        LMDZ_sed_default config.def solaire 
    287295    fi 
     296 
    288297    if [ -f CO2.txt ] ; then 
    289298        IPCC_CO2=`grep Annee_${year} CO2.txt | awk -F= '{print $2}'` 
    290         LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     299        if [ X"${IPCC_CO2}" = X ] ; then 
     300            # The grep returned empty variable, stop execution 
     301            IGCM_debug_Exit "The file CO2.txt do not contain the current year." 
     302            IGCM_debug_Verif_Exit 
     303        else 
     304            # Set new variable in config.def file 
     305            LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     306        fi 
    291307    else 
    292308        LMDZ_sed_default config.def co2_ppm 
    293309    fi 
    294  
    295310 
    296311    if [ -f CH4.txt ] ; then 
    297312        IPCC_CH4=`grep Annee_${year} CH4.txt | awk -F= '{print $2}'` 
    298         LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
    299     else 
     313        if [ X"${IPCC_CH4}" = X ] ; then 
     314            # The grep returned empty variable, stop execution 
     315            IGCM_debug_Exit "The file CH4.txt do not contain the current year." 
     316            IGCM_debug_Verif_Exit 
     317        else 
     318            # Set new variable in config.def file 
     319            LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
     320        fi 
     321     else 
    300322        LMDZ_sed_default config.def CH4_ppb 
    301323    fi 
     324 
    302325    if [ -f N2O.txt ] ; then 
    303326        IPCC_N2O=`grep Annee_${year} N2O.txt | awk -F= '{print $2}'` 
    304         LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     327        if [ X"${IPCC_N2O}" = X ] ; then 
     328            # The grep returned empty variable, stop execution 
     329            IGCM_debug_Exit "The file N2O.txt do not contain the current year." 
     330            IGCM_debug_Verif_Exit 
     331        else 
     332            # Set new variable in config.def file 
     333            LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     334        fi 
    305335    else 
    306336        LMDZ_sed_default config.def N2O_ppb 
    307337    fi 
     338 
    308339    if [ -f CFC11.txt ] ; then 
    309340        IPCC_CFC11=`grep Annee_${year} CFC11.txt | awk -F= '{print $2}'` 
    310         LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     341        if [ X"${IPCC_CFC11}" = X ] ; then 
     342            # The grep returned empty variable, stop execution 
     343            IGCM_debug_Exit "The file CFC11.txt do not contain the current year." 
     344            IGCM_debug_Verif_Exit 
     345        else 
     346            # Set new variable in config.def file 
     347            LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     348        fi 
    311349    else 
    312350        LMDZ_sed_default config.def CFC11_ppt 
    313351    fi 
     352 
    314353    if [ -f CFC12.txt ] ; then 
    315354        IPCC_CFC12=`grep Annee_${year} CFC12.txt | awk -F= '{print $2}'` 
    316         LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     355        if [ X"${IPCC_CFC12}" = X ] ; then 
     356            # The grep returned empty variable, stop execution 
     357            IGCM_debug_Exit "The file CFC12.txt do not contain the current year." 
     358            IGCM_debug_Verif_Exit 
     359        else 
     360            # Set new variable in config.def file 
     361            LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     362        fi 
    317363    else 
    318364        LMDZ_sed_default config.def CFC12_ppt 
    319365    fi 
     366 
    320367 
    321368    ## Coupling Time Step 
Note: See TracChangeset for help on using the changeset viewer.