Changeset 3928


Ignore:
Timestamp:
06/21/18 09:35:33 (2 years ago)
Author:
tlurton
Message:

Script for scenario GHG extraction: updated for subdirectory organisation by scenario.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/CMIP6_FORCING/GHG/extract_scenario_v.1.2.0.sh

    r3926 r3928  
    3333do 
    3434 
     35rep=${scenario}'/' 
     36 
    3537if [ ${scenario} == 'ssp119' ] ; then prefixe='IMAGE' ; fi 
    3638if [ ${scenario} == 'ssp126' ] ; then prefixe='IMAGE' ; fi 
     
    5153if [ ${scenario} == 'ssp585' ] ; then suffixe='' ; fi 
    5254 
     55if [ ! -d ${dirout}${rep} ] ; then mkdir -p ${dirout}${rep} ; fi 
    5356 
    5457#--N2O we leave unit to ppb 
     
    6063rm -f tmp.txt ${dirout}${GHG}_CMIP6_${scenario}_2015_2500.txt 
    6164cdo outputf,%12.4e,3 -selvar,'mole_fraction_of_'${namevar}'_in_air' ${dirin}${file} | awk '{print $1}' > tmp.txt 
    62 paste years.txt tmp.txt > ${dirout}${GHG}_CMIP6_${scenario}_2015_2500.txt 
     65paste years.txt tmp.txt > ${dirout}${rep}${GHG}_CMIP6_2015_2500.txt 
    6366 
    6467#--CH4 here we leave unit in ppb 
     
    7073rm -f tmp.txt ${dirout}${GHG}_CMIP6_${scenario}_2015_2500.txt 
    7174cdo outputf,%12.4e,3 -selvar,'mole_fraction_of_'${namevar}'_in_air' ${dirin}${file} | awk '{print $1}' > tmp.txt 
    72 paste years.txt tmp.txt > ${dirout}${GHG}_CMIP6_${scenario}_2015_2500.txt 
     75paste years.txt tmp.txt > ${dirout}${rep}${GHG}_CMIP6_2015_2500.txt 
    7376 
    7477#--CO2 here we leave unit in ppm 
     
    8083rm -f tmp.txt ${dirout}${GHG}_CMIP6_${scenario}_2015_2500.txt 
    8184cdo outputf,%12.4e,3 -selvar,'mole_fraction_of_'${namevar}'_in_air' ${dirin}${file} | awk '{print $1}' > tmp.txt 
    82 paste years.txt tmp.txt > ${dirout}${GHG}_CMIP6_${scenario}_2015_2500.txt 
     85paste years.txt tmp.txt > ${dirout}${rep}${GHG}_CMIP6_2015_2500.txt 
    8386 
    8487#--CFC11eq we leave in pptv 
     
    9194rm -f tmp.txt ${dirout}${GHG}_${scenario}_2015_2500.txt 
    9295cdo outputf,%12.4e,3 -selvar,'mole_fraction_of_'${namevar}'_in_air' ${dirin}${file} | awk '{print $1}' > tmp.txt 
    93 paste years.txt tmp.txt > ${dirout}${GHG}_${scenario}_2015_2500.txt 
     96paste years.txt tmp.txt > ${dirout}${rep}${GHG}_2015_2500.txt 
    9497 
    9598#--CFC12eq we leave in pptv 
     
    101104rm -f tmp.txt ${dirout}${GHG}_${scenario}_2015_2500.txt ${dirout}/${GHG}_CMIP6_${scenario}_2015_2500.txt 
    102105cdo outputf,%12.4e,3 -selvar,'mole_fraction_of_'${namevar}'_in_air' ${dirin}${file} | awk '{print $1}' > tmp.txt 
    103 paste years.txt tmp.txt > ${dirout}${GHG}_${scenario}_2015_2500.txt 
     106paste years.txt tmp.txt > ${dirout}${rep}${GHG}_2015_2500.txt 
    104107#--we will use CFC12eq for CMIP6 
    105 cp ${dirout}/${GHG}_${scenario}_2015_2500.txt ${dirout}/${GHG}_CMIP6_${scenario}_2015_2500.txt 
     108cp ${dirout}${rep}${GHG}_2015_2500.txt ${dirout}${rep}${GHG}_CMIP6_2015_2500.txt 
    106109 
    107110#--CFC11 we leave in pptv 
     
    114117rm -f tmp.txt ${dirout}${GHG}_${scenario}_2015_2500.txt 
    115118cdo outputf,%12.4e,3 -selvar,'mole_fraction_of_'${namevar}'_in_air' ${dirin}${file} | awk '{print $1}' > tmp.txt 
    116 paste years.txt tmp.txt > ${dirout}${GHG}_${scenario}_2015_2500.txt 
     119paste years.txt tmp.txt > ${dirout}${rep}${GHG}_2015_2500.txt 
    117120 
    118121#--CFC12 we leave in pptv 
     
    125128rm -f tmp.txt ${dirout}${GHG}_${scenario}_2015_2500.txt 
    126129cdo outputf,%12.4e,3 -selvar,'mole_fraction_of_'${namevar}'_in_air' ${dirin}${file} | awk '{print $1}' > tmp.txt 
    127 paste years.txt tmp.txt > ${dirout}${GHG}_${scenario}_2015_2500.txt 
     130paste years.txt tmp.txt > ${dirout}${rep}${GHG}_2015_2500.txt 
    128131 
    129132#--HFC134aeq we leave in pptv 
     
    135138rm -f tmp.txt ${dirout}${GHG}_${scenario}_2015_2500.txt ${dirout}/CFC11eq_CMIP6_${scenario}_2015_2500.txt 
    136139cdo outputf,%12.4e,3 -selvar,'mole_fraction_of_'${namevar}'_in_air' ${dirin}${file} | awk '{print $1}' > tmp.txt 
    137 paste years.txt tmp.txt > ${dirout}${GHG}_${scenario}_2015_2500.txt  
     140paste years.txt tmp.txt > ${dirout}${rep}${GHG}_2015_2500.txt  
    138141#--HFC134a-eq converted to CFC11-eq for CMIP6 
    139142#--by multiplying by (0.0100/62.7)/(0.062/238)=0.6122344 
    140 cdo outputf,%12.4e,3 -mulc,0.6122344 -selvar,'mole_fraction_of_'${namevar}'_in_air' ${dirin}/${file} | awk '{print $1}' > tmp.txt 
    141 paste years.txt tmp.txt > ${dirout}CFC11eq_CMIP6_${scenario}_2015_2500.txt 
     143cdo outputf,%12.4e,3 -mulc,0.6122344 -selvar,'mole_fraction_of_'${namevar}'_in_air' ${dirin}${file} | awk '{print $1}' > tmp.txt 
     144paste years.txt tmp.txt > ${dirout}${rep}CFC11eq_CMIP6_2015_2500.txt 
    142145 
    143146done 
Note: See TracChangeset for help on using the changeset viewer.