Changeset 2322


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

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

Location:
CONFIG/UNIFORM/v5
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • CONFIG/UNIFORM/v5/IPSLCM5CHS_v5/GENERAL/DRIVER/lmdz.driver

    r2319 r2322  
    258258 
    259259    ##-- GHG forcing : 
    260     ##   If forcing file exist in run directory, read values for the current year and modify config.def 
     260    ##   If forcing file exist in run directory, read values for the current year  
     261    ##   and set in config.def. If not use the default value set in config.def 
    261262    if [ -f SOLARANDVOLCANOES.txt ] ; then 
    262263        IPCC_SOLAR=`grep Annee_${year} SOLARANDVOLCANOES.txt | awk -F= '{print $2}'` 
    263         LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     264        if [ X"${IPCC_SOLAR}" = X ] ; then 
     265            # The grep returned empty variable, stop execution 
     266            IGCM_debug_Exit "The file SOLARANDVOLCANOES.txt do not contain the current year." 
     267            IGCM_debug_Verif_Exit 
     268        else 
     269            # Set new variable in config.def file 
     270            LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     271        fi 
    264272    else 
    265273        LMDZ_sed_default config.def solaire 
    266274    fi 
     275 
    267276    if [ -f CO2.txt ] ; then 
    268277        IPCC_CO2=`grep Annee_${year} CO2.txt | awk -F= '{print $2}'` 
    269         LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     278        if [ X"${IPCC_CO2}" = X ] ; then 
     279            # The grep returned empty variable, stop execution 
     280            IGCM_debug_Exit "The file CO2.txt do not contain the current year." 
     281            IGCM_debug_Verif_Exit 
     282        else 
     283            # Set new variable in config.def file 
     284            LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     285        fi 
    270286    else 
    271287        LMDZ_sed_default config.def co2_ppm 
    272288    fi 
    273  
    274289 
    275290    if [ -f CH4.txt ] ; then 
    276291        IPCC_CH4=`grep Annee_${year} CH4.txt | awk -F= '{print $2}'` 
    277         LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
    278     else 
     292        if [ X"${IPCC_CH4}" = X ] ; then 
     293            # The grep returned empty variable, stop execution 
     294            IGCM_debug_Exit "The file CH4.txt do not contain the current year." 
     295            IGCM_debug_Verif_Exit 
     296        else 
     297            # Set new variable in config.def file 
     298            LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
     299        fi 
     300     else 
    279301        LMDZ_sed_default config.def CH4_ppb 
    280302    fi 
     303 
    281304    if [ -f N2O.txt ] ; then 
    282305        IPCC_N2O=`grep Annee_${year} N2O.txt | awk -F= '{print $2}'` 
    283         LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     306        if [ X"${IPCC_N2O}" = X ] ; then 
     307            # The grep returned empty variable, stop execution 
     308            IGCM_debug_Exit "The file N2O.txt do not contain the current year." 
     309            IGCM_debug_Verif_Exit 
     310        else 
     311            # Set new variable in config.def file 
     312            LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     313        fi 
    284314    else 
    285315        LMDZ_sed_default config.def N2O_ppb 
    286316    fi 
     317 
    287318    if [ -f CFC11.txt ] ; then 
    288319        IPCC_CFC11=`grep Annee_${year} CFC11.txt | awk -F= '{print $2}'` 
    289         LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     320        if [ X"${IPCC_CFC11}" = X ] ; then 
     321            # The grep returned empty variable, stop execution 
     322            IGCM_debug_Exit "The file CFC11.txt do not contain the current year." 
     323            IGCM_debug_Verif_Exit 
     324        else 
     325            # Set new variable in config.def file 
     326            LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     327        fi 
    290328    else 
    291329        LMDZ_sed_default config.def CFC11_ppt 
    292330    fi 
     331 
    293332    if [ -f CFC12.txt ] ; then 
    294333        IPCC_CFC12=`grep Annee_${year} CFC12.txt | awk -F= '{print $2}'` 
    295         LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     334        if [ X"${IPCC_CFC12}" = X ] ; then 
     335            # The grep returned empty variable, stop execution 
     336            IGCM_debug_Exit "The file CFC12.txt do not contain the current year." 
     337            IGCM_debug_Verif_Exit 
     338        else 
     339            # Set new variable in config.def file 
     340            LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     341        fi 
    296342    else 
    297343        LMDZ_sed_default config.def CFC12_ppt 
  • CONFIG/UNIFORM/v5/IPSLCM5CHT_v5/GENERAL/DRIVER/lmdz.driver

    r2319 r2322  
    258258 
    259259    ##-- GHG forcing : 
    260     ##   If forcing file exist in run directory, read values for the current year and modify config.def 
     260    ##   If forcing file exist in run directory, read values for the current year  
     261    ##   and set in config.def. If not use the default value set in config.def 
    261262    if [ -f SOLARANDVOLCANOES.txt ] ; then 
    262263        IPCC_SOLAR=`grep Annee_${year} SOLARANDVOLCANOES.txt | awk -F= '{print $2}'` 
    263         LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     264        if [ X"${IPCC_SOLAR}" = X ] ; then 
     265            # The grep returned empty variable, stop execution 
     266            IGCM_debug_Exit "The file SOLARANDVOLCANOES.txt do not contain the current year." 
     267            IGCM_debug_Verif_Exit 
     268        else 
     269            # Set new variable in config.def file 
     270            LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     271        fi 
    264272    else 
    265273        LMDZ_sed_default config.def solaire 
    266274    fi 
     275 
    267276    if [ -f CO2.txt ] ; then 
    268277        IPCC_CO2=`grep Annee_${year} CO2.txt | awk -F= '{print $2}'` 
    269         LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     278        if [ X"${IPCC_CO2}" = X ] ; then 
     279            # The grep returned empty variable, stop execution 
     280            IGCM_debug_Exit "The file CO2.txt do not contain the current year." 
     281            IGCM_debug_Verif_Exit 
     282        else 
     283            # Set new variable in config.def file 
     284            LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     285        fi 
    270286    else 
    271287        LMDZ_sed_default config.def co2_ppm 
    272288    fi 
    273  
    274289 
    275290    if [ -f CH4.txt ] ; then 
    276291        IPCC_CH4=`grep Annee_${year} CH4.txt | awk -F= '{print $2}'` 
    277         LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
    278     else 
     292        if [ X"${IPCC_CH4}" = X ] ; then 
     293            # The grep returned empty variable, stop execution 
     294            IGCM_debug_Exit "The file CH4.txt do not contain the current year." 
     295            IGCM_debug_Verif_Exit 
     296        else 
     297            # Set new variable in config.def file 
     298            LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
     299        fi 
     300     else 
    279301        LMDZ_sed_default config.def CH4_ppb 
    280302    fi 
     303 
    281304    if [ -f N2O.txt ] ; then 
    282305        IPCC_N2O=`grep Annee_${year} N2O.txt | awk -F= '{print $2}'` 
    283         LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     306        if [ X"${IPCC_N2O}" = X ] ; then 
     307            # The grep returned empty variable, stop execution 
     308            IGCM_debug_Exit "The file N2O.txt do not contain the current year." 
     309            IGCM_debug_Verif_Exit 
     310        else 
     311            # Set new variable in config.def file 
     312            LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     313        fi 
    284314    else 
    285315        LMDZ_sed_default config.def N2O_ppb 
    286316    fi 
     317 
    287318    if [ -f CFC11.txt ] ; then 
    288319        IPCC_CFC11=`grep Annee_${year} CFC11.txt | awk -F= '{print $2}'` 
    289         LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     320        if [ X"${IPCC_CFC11}" = X ] ; then 
     321            # The grep returned empty variable, stop execution 
     322            IGCM_debug_Exit "The file CFC11.txt do not contain the current year." 
     323            IGCM_debug_Verif_Exit 
     324        else 
     325            # Set new variable in config.def file 
     326            LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     327        fi 
    290328    else 
    291329        LMDZ_sed_default config.def CFC11_ppt 
    292330    fi 
     331 
    293332    if [ -f CFC12.txt ] ; then 
    294333        IPCC_CFC12=`grep Annee_${year} CFC12.txt | awk -F= '{print $2}'` 
    295         LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     334        if [ X"${IPCC_CFC12}" = X ] ; then 
     335            # The grep returned empty variable, stop execution 
     336            IGCM_debug_Exit "The file CFC12.txt do not contain the current year." 
     337            IGCM_debug_Verif_Exit 
     338        else 
     339            # Set new variable in config.def file 
     340            LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     341        fi 
    296342    else 
    297343        LMDZ_sed_default config.def CFC12_ppt 
  • CONFIG/UNIFORM/v5/IPSLCM5_v5/GENERAL/DRIVER/lmdz.driver

    r2319 r2322  
    258258 
    259259    ##-- GHG forcing : 
    260     ##   If forcing file exist in run directory, read values for the current year and modify config.def 
     260    ##   If forcing file exist in run directory, read values for the current year  
     261    ##   and set in config.def. If not use the default value set in config.def 
    261262    if [ -f SOLARANDVOLCANOES.txt ] ; then 
    262263        IPCC_SOLAR=`grep Annee_${year} SOLARANDVOLCANOES.txt | awk -F= '{print $2}'` 
    263         LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     264        if [ X"${IPCC_SOLAR}" = X ] ; then 
     265            # The grep returned empty variable, stop execution 
     266            IGCM_debug_Exit "The file SOLARANDVOLCANOES.txt do not contain the current year." 
     267            IGCM_debug_Verif_Exit 
     268        else 
     269            # Set new variable in config.def file 
     270            LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     271        fi 
    264272    else 
    265273        LMDZ_sed_default config.def solaire 
    266274    fi 
     275 
    267276    if [ -f CO2.txt ] ; then 
    268277        IPCC_CO2=`grep Annee_${year} CO2.txt | awk -F= '{print $2}'` 
    269         LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     278        if [ X"${IPCC_CO2}" = X ] ; then 
     279            # The grep returned empty variable, stop execution 
     280            IGCM_debug_Exit "The file CO2.txt do not contain the current year." 
     281            IGCM_debug_Verif_Exit 
     282        else 
     283            # Set new variable in config.def file 
     284            LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     285        fi 
    270286    else 
    271287        LMDZ_sed_default config.def co2_ppm 
    272288    fi 
    273  
    274289 
    275290    if [ -f CH4.txt ] ; then 
    276291        IPCC_CH4=`grep Annee_${year} CH4.txt | awk -F= '{print $2}'` 
    277         LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
    278     else 
     292        if [ X"${IPCC_CH4}" = X ] ; then 
     293            # The grep returned empty variable, stop execution 
     294            IGCM_debug_Exit "The file CH4.txt do not contain the current year." 
     295            IGCM_debug_Verif_Exit 
     296        else 
     297            # Set new variable in config.def file 
     298            LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
     299        fi 
     300     else 
    279301        LMDZ_sed_default config.def CH4_ppb 
    280302    fi 
     303 
    281304    if [ -f N2O.txt ] ; then 
    282305        IPCC_N2O=`grep Annee_${year} N2O.txt | awk -F= '{print $2}'` 
    283         LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     306        if [ X"${IPCC_N2O}" = X ] ; then 
     307            # The grep returned empty variable, stop execution 
     308            IGCM_debug_Exit "The file N2O.txt do not contain the current year." 
     309            IGCM_debug_Verif_Exit 
     310        else 
     311            # Set new variable in config.def file 
     312            LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     313        fi 
    284314    else 
    285315        LMDZ_sed_default config.def N2O_ppb 
    286316    fi 
     317 
    287318    if [ -f CFC11.txt ] ; then 
    288319        IPCC_CFC11=`grep Annee_${year} CFC11.txt | awk -F= '{print $2}'` 
    289         LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     320        if [ X"${IPCC_CFC11}" = X ] ; then 
     321            # The grep returned empty variable, stop execution 
     322            IGCM_debug_Exit "The file CFC11.txt do not contain the current year." 
     323            IGCM_debug_Verif_Exit 
     324        else 
     325            # Set new variable in config.def file 
     326            LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     327        fi 
    290328    else 
    291329        LMDZ_sed_default config.def CFC11_ppt 
    292330    fi 
     331 
    293332    if [ -f CFC12.txt ] ; then 
    294333        IPCC_CFC12=`grep Annee_${year} CFC12.txt | awk -F= '{print $2}'` 
    295         LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     334        if [ X"${IPCC_CFC12}" = X ] ; then 
     335            # The grep returned empty variable, stop execution 
     336            IGCM_debug_Exit "The file CFC12.txt do not contain the current year." 
     337            IGCM_debug_Verif_Exit 
     338        else 
     339            # Set new variable in config.def file 
     340            LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     341        fi 
    296342    else 
    297343        LMDZ_sed_default config.def CFC12_ppt 
  • CONFIG/UNIFORM/v5/LMDZORINCA_v5/GENERAL/DRIVER/lmdz.driver

    r2319 r2322  
    258258 
    259259    ##-- GHG forcing : 
    260     ##   If forcing file exist in run directory, read values for the current year and modify config.def 
     260    ##   If forcing file exist in run directory, read values for the current year  
     261    ##   and set in config.def. If not use the default value set in config.def 
    261262    if [ -f SOLARANDVOLCANOES.txt ] ; then 
    262263        IPCC_SOLAR=`grep Annee_${year} SOLARANDVOLCANOES.txt | awk -F= '{print $2}'` 
    263         LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     264        if [ X"${IPCC_SOLAR}" = X ] ; then 
     265            # The grep returned empty variable, stop execution 
     266            IGCM_debug_Exit "The file SOLARANDVOLCANOES.txt do not contain the current year." 
     267            IGCM_debug_Verif_Exit 
     268        else 
     269            # Set new variable in config.def file 
     270            LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     271        fi 
    264272    else 
    265273        LMDZ_sed_default config.def solaire 
    266274    fi 
     275 
    267276    if [ -f CO2.txt ] ; then 
    268277        IPCC_CO2=`grep Annee_${year} CO2.txt | awk -F= '{print $2}'` 
    269         LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     278        if [ X"${IPCC_CO2}" = X ] ; then 
     279            # The grep returned empty variable, stop execution 
     280            IGCM_debug_Exit "The file CO2.txt do not contain the current year." 
     281            IGCM_debug_Verif_Exit 
     282        else 
     283            # Set new variable in config.def file 
     284            LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     285        fi 
    270286    else 
    271287        LMDZ_sed_default config.def co2_ppm 
    272288    fi 
    273  
    274289 
    275290    if [ -f CH4.txt ] ; then 
    276291        IPCC_CH4=`grep Annee_${year} CH4.txt | awk -F= '{print $2}'` 
    277         LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
    278     else 
     292        if [ X"${IPCC_CH4}" = X ] ; then 
     293            # The grep returned empty variable, stop execution 
     294            IGCM_debug_Exit "The file CH4.txt do not contain the current year." 
     295            IGCM_debug_Verif_Exit 
     296        else 
     297            # Set new variable in config.def file 
     298            LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
     299        fi 
     300     else 
    279301        LMDZ_sed_default config.def CH4_ppb 
    280302    fi 
     303 
    281304    if [ -f N2O.txt ] ; then 
    282305        IPCC_N2O=`grep Annee_${year} N2O.txt | awk -F= '{print $2}'` 
    283         LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     306        if [ X"${IPCC_N2O}" = X ] ; then 
     307            # The grep returned empty variable, stop execution 
     308            IGCM_debug_Exit "The file N2O.txt do not contain the current year." 
     309            IGCM_debug_Verif_Exit 
     310        else 
     311            # Set new variable in config.def file 
     312            LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     313        fi 
    284314    else 
    285315        LMDZ_sed_default config.def N2O_ppb 
    286316    fi 
     317 
    287318    if [ -f CFC11.txt ] ; then 
    288319        IPCC_CFC11=`grep Annee_${year} CFC11.txt | awk -F= '{print $2}'` 
    289         LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     320        if [ X"${IPCC_CFC11}" = X ] ; then 
     321            # The grep returned empty variable, stop execution 
     322            IGCM_debug_Exit "The file CFC11.txt do not contain the current year." 
     323            IGCM_debug_Verif_Exit 
     324        else 
     325            # Set new variable in config.def file 
     326            LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     327        fi 
    290328    else 
    291329        LMDZ_sed_default config.def CFC11_ppt 
    292330    fi 
     331 
    293332    if [ -f CFC12.txt ] ; then 
    294333        IPCC_CFC12=`grep Annee_${year} CFC12.txt | awk -F= '{print $2}'` 
    295         LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     334        if [ X"${IPCC_CFC12}" = X ] ; then 
     335            # The grep returned empty variable, stop execution 
     336            IGCM_debug_Exit "The file CFC12.txt do not contain the current year." 
     337            IGCM_debug_Verif_Exit 
     338        else 
     339            # Set new variable in config.def file 
     340            LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     341        fi 
    296342    else 
    297343        LMDZ_sed_default config.def CFC12_ppt 
  • CONFIG/UNIFORM/v5/LMDZOR_v5.2/GENERAL/DRIVER/lmdz.driver

    r2319 r2322  
    258258 
    259259    ##-- GHG forcing : 
    260     ##   If forcing file exist in run directory, read values for the current year and modify config.def 
     260    ##   If forcing file exist in run directory, read values for the current year  
     261    ##   and set in config.def. If not use the default value set in config.def 
    261262    if [ -f SOLARANDVOLCANOES.txt ] ; then 
    262263        IPCC_SOLAR=`grep Annee_${year} SOLARANDVOLCANOES.txt | awk -F= '{print $2}'` 
    263         LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     264        if [ X"${IPCC_SOLAR}" = X ] ; then 
     265            # The grep returned empty variable, stop execution 
     266            IGCM_debug_Exit "The file SOLARANDVOLCANOES.txt do not contain the current year." 
     267            IGCM_debug_Verif_Exit 
     268        else 
     269            # Set new variable in config.def file 
     270            LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     271        fi 
    264272    else 
    265273        LMDZ_sed_default config.def solaire 
    266274    fi 
     275 
    267276    if [ -f CO2.txt ] ; then 
    268277        IPCC_CO2=`grep Annee_${year} CO2.txt | awk -F= '{print $2}'` 
    269         LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     278        if [ X"${IPCC_CO2}" = X ] ; then 
     279            # The grep returned empty variable, stop execution 
     280            IGCM_debug_Exit "The file CO2.txt do not contain the current year." 
     281            IGCM_debug_Verif_Exit 
     282        else 
     283            # Set new variable in config.def file 
     284            LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     285        fi 
    270286    else 
    271287        LMDZ_sed_default config.def co2_ppm 
    272288    fi 
    273  
    274289 
    275290    if [ -f CH4.txt ] ; then 
    276291        IPCC_CH4=`grep Annee_${year} CH4.txt | awk -F= '{print $2}'` 
    277         LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
    278     else 
     292        if [ X"${IPCC_CH4}" = X ] ; then 
     293            # The grep returned empty variable, stop execution 
     294            IGCM_debug_Exit "The file CH4.txt do not contain the current year." 
     295            IGCM_debug_Verif_Exit 
     296        else 
     297            # Set new variable in config.def file 
     298            LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
     299        fi 
     300     else 
    279301        LMDZ_sed_default config.def CH4_ppb 
    280302    fi 
     303 
    281304    if [ -f N2O.txt ] ; then 
    282305        IPCC_N2O=`grep Annee_${year} N2O.txt | awk -F= '{print $2}'` 
    283         LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     306        if [ X"${IPCC_N2O}" = X ] ; then 
     307            # The grep returned empty variable, stop execution 
     308            IGCM_debug_Exit "The file N2O.txt do not contain the current year." 
     309            IGCM_debug_Verif_Exit 
     310        else 
     311            # Set new variable in config.def file 
     312            LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     313        fi 
    284314    else 
    285315        LMDZ_sed_default config.def N2O_ppb 
    286316    fi 
     317 
    287318    if [ -f CFC11.txt ] ; then 
    288319        IPCC_CFC11=`grep Annee_${year} CFC11.txt | awk -F= '{print $2}'` 
    289         LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     320        if [ X"${IPCC_CFC11}" = X ] ; then 
     321            # The grep returned empty variable, stop execution 
     322            IGCM_debug_Exit "The file CFC11.txt do not contain the current year." 
     323            IGCM_debug_Verif_Exit 
     324        else 
     325            # Set new variable in config.def file 
     326            LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     327        fi 
    290328    else 
    291329        LMDZ_sed_default config.def CFC11_ppt 
    292330    fi 
     331 
    293332    if [ -f CFC12.txt ] ; then 
    294333        IPCC_CFC12=`grep Annee_${year} CFC12.txt | awk -F= '{print $2}'` 
    295         LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     334        if [ X"${IPCC_CFC12}" = X ] ; then 
     335            # The grep returned empty variable, stop execution 
     336            IGCM_debug_Exit "The file CFC12.txt do not contain the current year." 
     337            IGCM_debug_Verif_Exit 
     338        else 
     339            # Set new variable in config.def file 
     340            LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     341        fi 
    296342    else 
    297343        LMDZ_sed_default config.def CFC12_ppt 
  • CONFIG/UNIFORM/v5/LMDZOR_v5/GENERAL/DRIVER/lmdz.driver

    r2319 r2322  
    258258 
    259259    ##-- GHG forcing : 
    260     ##   If forcing file exist in run directory, read values for the current year and modify config.def 
     260    ##   If forcing file exist in run directory, read values for the current year  
     261    ##   and set in config.def. If not use the default value set in config.def 
    261262    if [ -f SOLARANDVOLCANOES.txt ] ; then 
    262263        IPCC_SOLAR=`grep Annee_${year} SOLARANDVOLCANOES.txt | awk -F= '{print $2}'` 
    263         LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     264        if [ X"${IPCC_SOLAR}" = X ] ; then 
     265            # The grep returned empty variable, stop execution 
     266            IGCM_debug_Exit "The file SOLARANDVOLCANOES.txt do not contain the current year." 
     267            IGCM_debug_Verif_Exit 
     268        else 
     269            # Set new variable in config.def file 
     270            LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     271        fi 
    264272    else 
    265273        LMDZ_sed_default config.def solaire 
    266274    fi 
     275 
    267276    if [ -f CO2.txt ] ; then 
    268277        IPCC_CO2=`grep Annee_${year} CO2.txt | awk -F= '{print $2}'` 
    269         LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     278        if [ X"${IPCC_CO2}" = X ] ; then 
     279            # The grep returned empty variable, stop execution 
     280            IGCM_debug_Exit "The file CO2.txt do not contain the current year." 
     281            IGCM_debug_Verif_Exit 
     282        else 
     283            # Set new variable in config.def file 
     284            LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     285        fi 
    270286    else 
    271287        LMDZ_sed_default config.def co2_ppm 
    272288    fi 
    273  
    274289 
    275290    if [ -f CH4.txt ] ; then 
    276291        IPCC_CH4=`grep Annee_${year} CH4.txt | awk -F= '{print $2}'` 
    277         LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
    278     else 
     292        if [ X"${IPCC_CH4}" = X ] ; then 
     293            # The grep returned empty variable, stop execution 
     294            IGCM_debug_Exit "The file CH4.txt do not contain the current year." 
     295            IGCM_debug_Verif_Exit 
     296        else 
     297            # Set new variable in config.def file 
     298            LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
     299        fi 
     300     else 
    279301        LMDZ_sed_default config.def CH4_ppb 
    280302    fi 
     303 
    281304    if [ -f N2O.txt ] ; then 
    282305        IPCC_N2O=`grep Annee_${year} N2O.txt | awk -F= '{print $2}'` 
    283         LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     306        if [ X"${IPCC_N2O}" = X ] ; then 
     307            # The grep returned empty variable, stop execution 
     308            IGCM_debug_Exit "The file N2O.txt do not contain the current year." 
     309            IGCM_debug_Verif_Exit 
     310        else 
     311            # Set new variable in config.def file 
     312            LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     313        fi 
    284314    else 
    285315        LMDZ_sed_default config.def N2O_ppb 
    286316    fi 
     317 
    287318    if [ -f CFC11.txt ] ; then 
    288319        IPCC_CFC11=`grep Annee_${year} CFC11.txt | awk -F= '{print $2}'` 
    289         LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     320        if [ X"${IPCC_CFC11}" = X ] ; then 
     321            # The grep returned empty variable, stop execution 
     322            IGCM_debug_Exit "The file CFC11.txt do not contain the current year." 
     323            IGCM_debug_Verif_Exit 
     324        else 
     325            # Set new variable in config.def file 
     326            LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     327        fi 
    290328    else 
    291329        LMDZ_sed_default config.def CFC11_ppt 
    292330    fi 
     331 
    293332    if [ -f CFC12.txt ] ; then 
    294333        IPCC_CFC12=`grep Annee_${year} CFC12.txt | awk -F= '{print $2}'` 
    295         LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     334        if [ X"${IPCC_CFC12}" = X ] ; then 
     335            # The grep returned empty variable, stop execution 
     336            IGCM_debug_Exit "The file CFC12.txt do not contain the current year." 
     337            IGCM_debug_Verif_Exit 
     338        else 
     339            # Set new variable in config.def file 
     340            LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     341        fi 
    296342    else 
    297343        LMDZ_sed_default config.def CFC12_ppt 
  • CONFIG/UNIFORM/v5/LMDZREPR_v5/GENERAL/DRIVER/lmdz.driver

    r2319 r2322  
    258258 
    259259    ##-- GHG forcing : 
    260     ##   If forcing file exist in run directory, read values for the current year and modify config.def 
     260    ##   If forcing file exist in run directory, read values for the current year  
     261    ##   and set in config.def. If not use the default value set in config.def 
    261262    if [ -f SOLARANDVOLCANOES.txt ] ; then 
    262263        IPCC_SOLAR=`grep Annee_${year} SOLARANDVOLCANOES.txt | awk -F= '{print $2}'` 
    263         LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     264        if [ X"${IPCC_SOLAR}" = X ] ; then 
     265            # The grep returned empty variable, stop execution 
     266            IGCM_debug_Exit "The file SOLARANDVOLCANOES.txt do not contain the current year." 
     267            IGCM_debug_Verif_Exit 
     268        else 
     269            # Set new variable in config.def file 
     270            LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     271        fi 
    264272    else 
    265273        LMDZ_sed_default config.def solaire 
    266274    fi 
     275 
    267276    if [ -f CO2.txt ] ; then 
    268277        IPCC_CO2=`grep Annee_${year} CO2.txt | awk -F= '{print $2}'` 
    269         LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     278        if [ X"${IPCC_CO2}" = X ] ; then 
     279            # The grep returned empty variable, stop execution 
     280            IGCM_debug_Exit "The file CO2.txt do not contain the current year." 
     281            IGCM_debug_Verif_Exit 
     282        else 
     283            # Set new variable in config.def file 
     284            LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     285        fi 
    270286    else 
    271287        LMDZ_sed_default config.def co2_ppm 
    272288    fi 
    273  
    274289 
    275290    if [ -f CH4.txt ] ; then 
    276291        IPCC_CH4=`grep Annee_${year} CH4.txt | awk -F= '{print $2}'` 
    277         LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
    278     else 
     292        if [ X"${IPCC_CH4}" = X ] ; then 
     293            # The grep returned empty variable, stop execution 
     294            IGCM_debug_Exit "The file CH4.txt do not contain the current year." 
     295            IGCM_debug_Verif_Exit 
     296        else 
     297            # Set new variable in config.def file 
     298            LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
     299        fi 
     300     else 
    279301        LMDZ_sed_default config.def CH4_ppb 
    280302    fi 
     303 
    281304    if [ -f N2O.txt ] ; then 
    282305        IPCC_N2O=`grep Annee_${year} N2O.txt | awk -F= '{print $2}'` 
    283         LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     306        if [ X"${IPCC_N2O}" = X ] ; then 
     307            # The grep returned empty variable, stop execution 
     308            IGCM_debug_Exit "The file N2O.txt do not contain the current year." 
     309            IGCM_debug_Verif_Exit 
     310        else 
     311            # Set new variable in config.def file 
     312            LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     313        fi 
    284314    else 
    285315        LMDZ_sed_default config.def N2O_ppb 
    286316    fi 
     317 
    287318    if [ -f CFC11.txt ] ; then 
    288319        IPCC_CFC11=`grep Annee_${year} CFC11.txt | awk -F= '{print $2}'` 
    289         LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     320        if [ X"${IPCC_CFC11}" = X ] ; then 
     321            # The grep returned empty variable, stop execution 
     322            IGCM_debug_Exit "The file CFC11.txt do not contain the current year." 
     323            IGCM_debug_Verif_Exit 
     324        else 
     325            # Set new variable in config.def file 
     326            LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     327        fi 
    290328    else 
    291329        LMDZ_sed_default config.def CFC11_ppt 
    292330    fi 
     331 
    293332    if [ -f CFC12.txt ] ; then 
    294333        IPCC_CFC12=`grep Annee_${year} CFC12.txt | awk -F= '{print $2}'` 
    295         LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     334        if [ X"${IPCC_CFC12}" = X ] ; then 
     335            # The grep returned empty variable, stop execution 
     336            IGCM_debug_Exit "The file CFC12.txt do not contain the current year." 
     337            IGCM_debug_Verif_Exit 
     338        else 
     339            # Set new variable in config.def file 
     340            LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     341        fi 
    296342    else 
    297343        LMDZ_sed_default config.def CFC12_ppt 
  • CONFIG/UNIFORM/v5/LMDZ_v5/GENERAL/DRIVER/lmdz.driver

    r2319 r2322  
    258258 
    259259    ##-- GHG forcing : 
    260     ##   If forcing file exist in run directory, read values for the current year and modify config.def 
     260    ##   If forcing file exist in run directory, read values for the current year  
     261    ##   and set in config.def. If not use the default value set in config.def 
    261262    if [ -f SOLARANDVOLCANOES.txt ] ; then 
    262263        IPCC_SOLAR=`grep Annee_${year} SOLARANDVOLCANOES.txt | awk -F= '{print $2}'` 
    263         LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     264        if [ X"${IPCC_SOLAR}" = X ] ; then 
     265            # The grep returned empty variable, stop execution 
     266            IGCM_debug_Exit "The file SOLARANDVOLCANOES.txt do not contain the current year." 
     267            IGCM_debug_Verif_Exit 
     268        else 
     269            # Set new variable in config.def file 
     270            LMDZ_sed config.def solaire     ${IPCC_SOLAR} 
     271        fi 
    264272    else 
    265273        LMDZ_sed_default config.def solaire 
    266274    fi 
     275 
    267276    if [ -f CO2.txt ] ; then 
    268277        IPCC_CO2=`grep Annee_${year} CO2.txt | awk -F= '{print $2}'` 
    269         LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     278        if [ X"${IPCC_CO2}" = X ] ; then 
     279            # The grep returned empty variable, stop execution 
     280            IGCM_debug_Exit "The file CO2.txt do not contain the current year." 
     281            IGCM_debug_Verif_Exit 
     282        else 
     283            # Set new variable in config.def file 
     284            LMDZ_sed config.def co2_ppm     ${IPCC_CO2} 
     285        fi 
    270286    else 
    271287        LMDZ_sed_default config.def co2_ppm 
    272288    fi 
    273  
    274289 
    275290    if [ -f CH4.txt ] ; then 
    276291        IPCC_CH4=`grep Annee_${year} CH4.txt | awk -F= '{print $2}'` 
    277         LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
    278     else 
     292        if [ X"${IPCC_CH4}" = X ] ; then 
     293            # The grep returned empty variable, stop execution 
     294            IGCM_debug_Exit "The file CH4.txt do not contain the current year." 
     295            IGCM_debug_Verif_Exit 
     296        else 
     297            # Set new variable in config.def file 
     298            LMDZ_sed config.def CH4_ppb     ${IPCC_CH4} 
     299        fi 
     300     else 
    279301        LMDZ_sed_default config.def CH4_ppb 
    280302    fi 
     303 
    281304    if [ -f N2O.txt ] ; then 
    282305        IPCC_N2O=`grep Annee_${year} N2O.txt | awk -F= '{print $2}'` 
    283         LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     306        if [ X"${IPCC_N2O}" = X ] ; then 
     307            # The grep returned empty variable, stop execution 
     308            IGCM_debug_Exit "The file N2O.txt do not contain the current year." 
     309            IGCM_debug_Verif_Exit 
     310        else 
     311            # Set new variable in config.def file 
     312            LMDZ_sed config.def N2O_ppb     ${IPCC_N2O} 
     313        fi 
    284314    else 
    285315        LMDZ_sed_default config.def N2O_ppb 
    286316    fi 
     317 
    287318    if [ -f CFC11.txt ] ; then 
    288319        IPCC_CFC11=`grep Annee_${year} CFC11.txt | awk -F= '{print $2}'` 
    289         LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     320        if [ X"${IPCC_CFC11}" = X ] ; then 
     321            # The grep returned empty variable, stop execution 
     322            IGCM_debug_Exit "The file CFC11.txt do not contain the current year." 
     323            IGCM_debug_Verif_Exit 
     324        else 
     325            # Set new variable in config.def file 
     326            LMDZ_sed config.def CFC11_ppt   ${IPCC_CFC11} 
     327        fi 
    290328    else 
    291329        LMDZ_sed_default config.def CFC11_ppt 
    292330    fi 
     331 
    293332    if [ -f CFC12.txt ] ; then 
    294333        IPCC_CFC12=`grep Annee_${year} CFC12.txt | awk -F= '{print $2}'` 
    295         LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     334        if [ X"${IPCC_CFC12}" = X ] ; then 
     335            # The grep returned empty variable, stop execution 
     336            IGCM_debug_Exit "The file CFC12.txt do not contain the current year." 
     337            IGCM_debug_Verif_Exit 
     338        else 
     339            # Set new variable in config.def file 
     340            LMDZ_sed config.def CFC12_ppt   ${IPCC_CFC12} 
     341        fi 
    296342    else 
    297343        LMDZ_sed_default config.def CFC12_ppt 
Note: See TracChangeset for help on using the changeset viewer.