Index: TOOLS/CMIP6_FORCING/GHG/README
===================================================================
--- TOOLS/CMIP6_FORCING/GHG/README	(revision 3386)
+++ TOOLS/CMIP6_FORCING/GHG/README	(revision 3386)
@@ -0,0 +1,55 @@
+GHG data for CMIP6 are initially coming from 
+ftp://data.iac.ethz.ch/CMIP6/input4MIPs/UoM/GHGConc/CMIP
+see also http://www.climate-energy-college.net/cmip6
+They have been in September replaced by v1-2-0 from ESGF. 
+The format of the netcdf has changed with one variable (and sectors) per file.
+The data were downloaded in September 2016 and are available 
+on ciclad in /prodigfs/project/input4MIPs/UoM
+
+The data are processed to produce annual global mean files 
+for the IPSL model. This is currently done on ciclad in 
+/home/oboucher/CMIP6/GHG but will be moved in a central repository.
+
+The GHG to be used are 
+
+CO2
+CH4
+N2O
+
+and either 
+
+CFC11=CFC11eq
+CFC12=CFC12
+
+OR 
+
+HFC134a-eq
+CFC12eq 
+
+Do not use the original CFC11eq and CFC12eq together as some species 
+would be double-counted
+
+At IPSL we chose the second way of doing for CMIP5, and we do likewise for CMIP6.
+HFC134-eq are converted into CFC11-eq using AR5 values for their 2011 RF and 
+volume mixing ratios (Table 8.2 from Chapter 8, CFC11 0.062 Wm-2 for 238 pptv and 
+HFC134eq 0.0100 Wm-2 for 62.7 pptv), which gives the following conversions: 
+CFC11eq_CMIP6 <== HFC134a-eq * (0.0100/62.7)/(0.062/238.0)
+CFC12eq_CMIP6 <== CFC12eq 
+
+So in the end, we have 5 files for GHG for CMIP6 runs with IPSL-CM6
+CO2_CMIP6_0000_2014.txt
+CH4_CMIP6_0000_2014.txt
+N2O_CMIP6_0000_2014.txt
+CFC11eq_CMIP6_0000_2014.txt
+CFC12eq_CMIP6_0000_2014.txt
+
+Note that the CFCeq files have non-zero values for pre-industrial conditions 
+because they include some natural species.
+
+To produce the data used in CMIP6, just run the extract.sh script
+
+The plots in graphs are from Jean-Louis, blue is CMIP6, green is CMIP5.
+
+Olivier
+11/10/2016
+updated 13/12/2016
Index: TOOLS/CMIP6_FORCING/GHG/extract.sh
===================================================================
--- TOOLS/CMIP6_FORCING/GHG/extract.sh	(revision 3386)
+++ TOOLS/CMIP6_FORCING/GHG/extract.sh	(revision 3386)
@@ -0,0 +1,107 @@
+#--v3 of my script to extract global mean and put to IGCM format
+
+#--according to Malte Meinsheausen two options are possible 
+#    CFC11=CFC11eq and CCFC12=CFC12
+# or CFC11=HFC134a-eq * (0.0100/62.7)/(0.062/238) [values from AR5] and CFC12=CFC12eq 
+# in the second case the HFC134a-eq is converted into CFC11eq using RF efficiencies from AR5 in Wm-2pptv-1 
+
+#--11/10/2016 New format for the data, now global, NH and SH means are in a sector dimension
+#--hence I parse the first value from the cdo outputf to get the global mean
+#--outputf is used with format %12.4e to make sure there is a space between values and 3 values per line
+
+#--dir for annual mean data
+dirin1='/prodigfs/project/input4MIPs/UoM/GHGConcentrations/CMIP/UoM-CMIP-1-2-0/yr/'
+dirin2='gr1-GMNHSH/v20160902'
+
+dirout='./OUTPUT'
+if [ ! -d ${dirout} ] ; then mkdir ${dirout} ; fi
+
+rm -f years.txt
+for i in `seq -w 0 2014`
+do
+echo 'Annee_'$i'=' >> years.txt
+done
+
+#--N2O we leave unit to ppb
+GHG='N2O'
+name='nitrous_oxide'
+file='mole_fraction_of_'${name}'_in_air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-2-0_gr1-GMNHSH_0000-2014.nc'
+rm -f tmp.txt ${dirout}/${GHG}_CMIP6_0000_2014.txt
+dirin=${dirin1}'mole_fraction_of_'${name}'_in_air/'${dirin2}
+cdo outputf,%12.4e,3 -selvar,'mole_fraction_of_'${name}'_in_air' ${dirin}/${file} | awk '{print $1}' > tmp.txt
+paste years.txt tmp.txt > ${dirout}/${GHG}_CMIP6_0000_2014.txt
+
+#--CH4 here we leave unit in ppb
+GHG='CH4'
+name='methane'
+file='mole_fraction_of_'${name}'_in_air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-2-0_gr1-GMNHSH_0000-2014.nc'
+dirin=${dirin1}'mole_fraction_of_'${name}'_in_air/'${dirin2}
+rm -f tmp.txt ${dirout}/${GHG}_CMIP6_0000_2014.txt
+cdo outputf,%12.4e,3 -selvar,'mole_fraction_of_'${name}'_in_air' ${dirin}/${file} | awk '{print $1}' > tmp.txt
+paste years.txt tmp.txt > ${dirout}/${GHG}_CMIP6_0000_2014.txt
+
+#--CO2 here we leave unit in ppm
+GHG='CO2'
+name='carbon_dioxide'
+file='mole_fraction_of_'${name}'_in_air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-2-0_gr1-GMNHSH_0000-2014.nc'
+dirin=${dirin1}'mole_fraction_of_'${name}'_in_air/'${dirin2}
+rm -f tmp.txt ${dirout}/${GHG}_CMIP6_0000_2014.txt
+cdo outputf,%12.4e,3 -selvar,'mole_fraction_of_'${name}'_in_air' ${dirin}/${file} | awk '{print $1}' > tmp.txt
+paste years.txt tmp.txt > ${dirout}/${GHG}_CMIP6_0000_2014.txt
+
+#--CFC11eq we leave in en pptv
+#--not used for CMIP6
+GHG='CFC11eq'
+name='cfc11eq'
+file='mole_fraction_of_'${name}'_in_air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-2-0_gr1-GMNHSH_0000-2014.nc'
+dirin=${dirin1}'mole_fraction_of_'${name}'_in_air/'${dirin2}
+rm -f tmp.txt ${dirout}/${GHG}_0000_2014.txt
+cdo outputf,%12.4e,3 -selvar,'mole_fraction_of_'${name}'_in_air' ${dirin}/${file} | awk '{print $1}' > tmp.txt
+paste years.txt tmp.txt > ${dirout}/${GHG}_0000_2014.txt
+
+#--CFC12eq we leave in en pptv
+GHG='CFC12eq'
+name='cfc12eq'
+file='mole_fraction_of_'${name}'_in_air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-2-0_gr1-GMNHSH_0000-2014.nc'
+dirin=${dirin1}'mole_fraction_of_'${name}'_in_air/'${dirin2}
+rm -f tmp.txt ${dirout}/${GHG}_0000_2014.txt ${dirout}/${GHG}_CMIP6_0000_2014.txt
+cdo outputf,%12.4e,3 -selvar,'mole_fraction_of_'${name}'_in_air' ${dirin}/${file} | awk '{print $1}' > tmp.txt
+paste years.txt tmp.txt > ${dirout}/${GHG}_0000_2014.txt
+#--we will use CFC12eq for CMIP6
+cp ${dirout}/${GHG}_0000_2014.txt ${dirout}/${GHG}_CMIP6_0000_2014.txt
+
+#--CFC11 we leave in en pptv
+#--not used for CMIP6
+GHG='CFC11'
+name='cfc11'
+file='mole_fraction_of_'${name}'_in_air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-2-0_gr1-GMNHSH_0000-2014.nc'
+dirin=${dirin1}'mole_fraction_of_'${name}'_in_air/'${dirin2}
+rm -f tmp.txt ${dirout}/${GHG}_0000_2014.txt
+cdo outputf,%12.4e,3 -selvar,'mole_fraction_of_'${name}'_in_air' ${dirin}/${file} | awk '{print $1}' > tmp.txt
+paste years.txt tmp.txt > ${dirout}/${GHG}_0000_2014.txt
+
+#--CFC12 we leave in en pptv
+#--not used for CMIP6
+GHG='CFC12'
+name='cfc12'
+file='mole_fraction_of_'${name}'_in_air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-2-0_gr1-GMNHSH_0000-2014.nc'
+dirin=${dirin1}'mole_fraction_of_'${name}'_in_air/'${dirin2}
+rm -f tmp.txt ${dirout}/${GHG}_0000_2014.txt
+cdo outputf,%12.4e,3 -selvar,'mole_fraction_of_'${name}'_in_air' ${dirin}/${file} | awk '{print $1}' > tmp.txt
+paste years.txt tmp.txt > ${dirout}/${GHG}_0000_2014.txt
+
+#--HFC134aeq we leave in en pptv
+GHG='HFC134aeq'
+name='hfc134aeq'
+file='mole_fraction_of_'${name}'_in_air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-2-0_gr1-GMNHSH_0000-2014.nc'
+dirin=${dirin1}'mole_fraction_of_'${name}'_in_air/'${dirin2}
+rm -f tmp.txt ${dirout}/${GHG}_0000_2014.txt ${dirout}/CFC11eq_CMIP6_0000_2014.txt
+cdo outputf,%12.4e,3 -selvar,'mole_fraction_of_'${name}'_in_air' ${dirin}/${file} | awk '{print $1}' > tmp.txt
+paste years.txt tmp.txt > ${dirout}/${GHG}_0000_2014.txt 
+#--HFC134a-eq converted to CFC11-eq for CMIP6
+#--by multiplying by (0.0100/62.7)/(0.062/238)=0.6122344
+cdo outputf,%12.4e,3 -mulc,0.6122344 -selvar,'mole_fraction_of_'${name}'_in_air' ${dirin}/${file} | awk '{print $1}' > tmp.txt
+paste years.txt tmp.txt > ${dirout}/CFC11eq_CMIP6_0000_2014.txt
+
+#--clean up
+rm -f tmp.txt years.txt
