Index: /TOOLS/CMIP6_FORCING/AER_TROP_EMISSIONS/README
===================================================================
--- /TOOLS/CMIP6_FORCING/AER_TROP_EMISSIONS/README	(revision 3566)
+++ /TOOLS/CMIP6_FORCING/AER_TROP_EMISSIONS/README	(revision 3567)
@@ -30,4 +30,10 @@
 Update: 02/10/2017
 report NOx emissions as NO for both FF and BB emissions
+
+Update: 05/02/2018
+New version of regrid.sh
+Diffs: * updated paths to access new version of input data;
+       * also some relevant corrections: underscores become hyphens for PNNL species-directories; VUA species-directory change from e.g. "CO-em-biomassburning" to "CO".
+
 
 **********************************************************
Index: /TOOLS/CMIP6_FORCING/AER_TROP_EMISSIONS/REGRID/regrid.sh
===================================================================
--- /TOOLS/CMIP6_FORCING/AER_TROP_EMISSIONS/REGRID/regrid.sh	(revision 3566)
+++ /TOOLS/CMIP6_FORCING/AER_TROP_EMISSIONS/REGRID/regrid.sh	(revision 3567)
@@ -1,2 +1,3 @@
+#--updated on 5/2/2018 with new paths, ThL
 #--updated on 4/5/2017 with improved Sheng & Zwiers algorithm, ThL
 #--corrected some interpolation preprocessing (compared to v4)
@@ -15,9 +16,9 @@
 
 #--input directory for anthropogenic (non-BB) emissions
-dirinPNNL="/prodigfs/project/input4MIPs/PNNL-JGCRI/emissions/CMIP/CEDS-2017-05-18/mon/"
+dirinPNNL="/prodigfs/esgf/mirror/input4MIPs/CMIP6/CMIP/PNNL-JGCRI/CEDS-2017-05-18/atmos/mon/"
 ##--Be careful if ever one needs the 3D (=AIR) data, the latest are in the different directory
-##dirinPNNL_AIR="/prodigfs/project/input4MIPs/PNNL-JGCRI/emissions/CMIP/mon/CEDS-2017-08-30/"
+## /prodigfs/esgf/mirror/input4MIPs/CMIP6/CMIP/PNNL-JGCRI/CEDS-2017-08-30/atmos/mon/
 #--input directory for anthropogenic (BB) emissions
-dirinVUA="/prodigfs/project/input4MIPs/VUA/emissions/CMIP/VUA-CMIP-BB4CMIP6-1-2/mon/"
+dirinVUA="/prodigfs/esgf/mirror/input4MIPs/CMIP6/CMIP/VUA/VUA-CMIP-BB4CMIP6-1-2/atmos/mon/"
 
 #--LMDz grid information
@@ -71,6 +72,6 @@
 fi
 
-#--input file PNNL (fossil fuel emissions)
-filename=${dirinPNNL}${species}_em_anthro/gn/v20170519/${species}-em-anthro_input4MIPs_emissions_CMIP_CEDS-2017-05-18_gn_${year1}01-${year2}12.nc
+#--input file PNNL (fossil fuel emissions)       Underscores in the old species-directory are now hyphens.
+filename=${dirinPNNL}${species}-em-anthro/gn/v20170519/${species}-em-anthro_input4MIPs_emissions_CMIP_CEDS-2017-05-18_gn_${year1}01-${year2}12.nc
 
 #--output files
@@ -266,6 +267,6 @@
 fi
 
-#--now dealing with BB sources
-filename=${dirinVUA}${species}"-em-biomassburning/gn/v20161213/"${species}"-em-biomassburning_input4MIPs_emissions_CMIP_VUA-CMIP-BB4CMIP6-1-2_gn_${year1}01-${year2}12.nc"
+#--now dealing with BB sources               Species-directory was previously of the form "CO-em-biomassburning", it is now just "CO"
+filename=${dirinVUA}${species}"/gn/v20161213/"${species}"-em-biomassburning_input4MIPs_emissions_CMIP_VUA-CMIP-BB4CMIP6-1-2_gn_${year1}01-${year2}12.nc"
 
 #--output files
Index: /TOOLS/CMIP6_FORCING/GHG/README
===================================================================
--- /TOOLS/CMIP6_FORCING/GHG/README	(revision 3566)
+++ /TOOLS/CMIP6_FORCING/GHG/README	(revision 3567)
@@ -1,2 +1,8 @@
+Script updated on 5 Feb. 2018
+Th. Lurton
+* Paths changed to retrieve new input data versions;
+* Correction of hyphens/underscores in directory/file names in order to suit the new data version.
+
+
 GHG data for CMIP6 are initially coming from 
 ftp://data.iac.ethz.ch/CMIP6/input4MIPs/UoM/GHGConc/CMIP
Index: /TOOLS/CMIP6_FORCING/GHG/extract.sh
===================================================================
--- /TOOLS/CMIP6_FORCING/GHG/extract.sh	(revision 3566)
+++ /TOOLS/CMIP6_FORCING/GHG/extract.sh	(revision 3567)
@@ -1,2 +1,7 @@
+#--Update Th.Lurton 05/02/2018 for paths to new version
+# ** species-directory take hyphens instead of underscores previously;
+# ** likewise for species names within filenames;
+# ** variable names stay with underscores.
+
 #--v3 of my script to extract global mean and put to IGCM format
 
@@ -11,6 +16,7 @@
 
 #--dir for annual mean data
-dirin1='/prodigfs/project/input4MIPs/UoM/GHGConcentrations/CMIP/UoM-CMIP-1-2-0/yr/'
-dirin2='gr1-GMNHSH/v20160902'
+dirin1='/prodigfs/esgf/mirror/input4MIPs/CMIP6/CMIP/UoM/UoM-CMIP-1-2-0/atmos/yr/'
+dirin2='gr1-GMNHSH/v20160830'
+#--dirin2 versioning date is different from previously
 
 dirout='./OUTPUT'
@@ -25,8 +31,8 @@
 #--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'
+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}
+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
@@ -35,6 +41,6 @@
 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}
+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
@@ -43,7 +49,7 @@
 #--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}
+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
@@ -54,6 +60,6 @@
 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}
+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
@@ -63,6 +69,6 @@
 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}
+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
@@ -75,6 +81,6 @@
 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}
+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
@@ -85,6 +91,6 @@
 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}
+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
@@ -94,6 +100,6 @@
 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}
+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
Index: /TOOLS/CMIP6_FORCING/NITROGEN/README
===================================================================
--- /TOOLS/CMIP6_FORCING/NITROGEN/README	(revision 3566)
+++ /TOOLS/CMIP6_FORCING/NITROGEN/README	(revision 3567)
@@ -1,2 +1,7 @@
+Update 05 Feb. 2018
+Th. Lurton
+** Changed paths to new version
+
+
 Here we only add drynhx+wetnhx and drynoy+wetnoy into nhx and noy deposition fluxes (kg N/m2/s).
 There is a 1850 climatological file (10-year average) and yearly files for 1850-2014.
Index: /TOOLS/CMIP6_FORCING/NITROGEN/nitrogen.sh
===================================================================
--- /TOOLS/CMIP6_FORCING/NITROGEN/nitrogen.sh	(revision 3566)
+++ /TOOLS/CMIP6_FORCING/NITROGEN/nitrogen.sh	(revision 3567)
@@ -1,4 +1,6 @@
-dirin1="/prodigfs/project/input4MIPs/UReading/surfaceFluxes/CMIP/NCAR-CCMI-2-0/mon"
+dirin1="/prodigfs/esgf/mirror/input4MIPs/CMIP6/CMIP/NCAR/NCAR-CCMI-2-0/atmos/mon"
 dirin2="gn/v20161207"
+dirinC1="/prodigfs/esgf/mirror/input4MIPs/CMIP6/CMIP/NCAR/NCAR-CCMI-2-0/atmos/monC"
+
 dirout="./OUTPUT"
 if [ ! -d ${dirout} ] ; then mkdir ${dirout} ; fi
@@ -6,14 +8,14 @@
 #--1850 climatological N deposition 
 #
-drynhx=${dirin1}"/drynhx/"${dirin2}"/drynhx_input4MIPs_surfaceFluxes_CMIP_NCAR-CCMI-2-0_gn_185001-185012-clim.nc"
-wetnhx=${dirin1}"/wetnhx/"${dirin2}"/wetnhx_input4MIPs_surfaceFluxes_CMIP_NCAR-CCMI-2-0_gn_185001-185012-clim.nc"
-drynoy=${dirin1}"/drynoy/"${dirin2}"/drynoy_input4MIPs_surfaceFluxes_CMIP_NCAR-CCMI-2-0_gn_185001-185012-clim.nc"
-wetnoy=${dirin1}"/wetnoy/"${dirin2}"/wetnoy_input4MIPs_surfaceFluxes_CMIP_NCAR-CCMI-2-0_gn_185001-185012-clim.nc"
+drynhx=${dirinC1}"/drynhx/"${dirin2}"/drynhx_input4MIPs_surfaceFluxes_CMIP_NCAR-CCMI-2-0_gn_185001-185012.nc"
+wetnhx=${dirinC1}"/wetnhx/"${dirin2}"/wetnhx_input4MIPs_surfaceFluxes_CMIP_NCAR-CCMI-2-0_gn_185001-185012.nc"
+drynoy=${dirinC1}"/drynoy/"${dirin2}"/drynoy_input4MIPs_surfaceFluxes_CMIP_NCAR-CCMI-2-0_gn_185001-185012.nc"
+wetnoy=${dirinC1}"/wetnoy/"${dirin2}"/wetnoy_input4MIPs_surfaceFluxes_CMIP_NCAR-CCMI-2-0_gn_185001-185012.nc"
 #
-cdo merge $drynhx $wetnhx $dirout/CMIP6_fluxnhx_merged_clim_1850.nc
-cdo merge $drynoy $wetnoy $dirout/CMIP6_fluxnoy_merged_clim_1850.nc
-cdo expr,'fluxnhx=drynhx+wetnhx' $dirout/CMIP6_fluxnhx_merged_clim_1850.nc $dirout/CMIP6_fluxnhx_clim_1850.nc
-cdo expr,'fluxnoy=drynoy+wetnoy' $dirout/CMIP6_fluxnoy_merged_clim_1850.nc $dirout/CMIP6_fluxnoy_clim_1850.nc
-rm -f $dirout/CMIP6_fluxnhx_merged_clim_1850.nc $dirout/CMIP6_fluxnoy_merged_clim_1850.nc
+cdo merge ${drynhx} ${wetnhx} ${dirout}/CMIP6_fluxnhx_merged_clim_1850.nc
+cdo merge ${drynoy} ${wetnoy} ${dirout}/CMIP6_fluxnoy_merged_clim_1850.nc
+cdo expr,'fluxnhx=drynhx+wetnhx' ${dirout}/CMIP6_fluxnhx_merged_clim_1850.nc ${dirout}/CMIP6_fluxnhx_clim_1850.nc
+cdo expr,'fluxnoy=drynoy+wetnoy' ${dirout}/CMIP6_fluxnoy_merged_clim_1850.nc ${dirout}/CMIP6_fluxnoy_clim_1850.nc
+rm -f ${dirout}/CMIP6_fluxnhx_merged_clim_1850.nc ${dirout}/CMIP6_fluxnoy_merged_clim_1850.nc
 #
 #
@@ -25,7 +27,7 @@
 wetnoy=${dirin1}"/wetnoy/"${dirin2}"/wetnoy_input4MIPs_surfaceFluxes_CMIP_NCAR-CCMI-2-0_gn_185001-201412.nc"
 #
-cdo merge $drynhx $wetnhx $dirout/CMIP6_fluxnhx_merged_annual_1850-2014.nc
-cdo merge $drynoy $wetnoy $dirout/CMIP6_fluxnoy_merged_annual_1850-2014.nc
-cdo splityear -expr,'fluxnhx=drynhx+wetnhx' $dirout/CMIP6_fluxnhx_merged_annual_1850-2014.nc $dirout/CMIP6_fluxnhx_annual_
-cdo splityear -expr,'fluxnoy=drynoy+wetnoy' $dirout/CMIP6_fluxnoy_merged_annual_1850-2014.nc $dirout/CMIP6_fluxnoy_annual_
-rm -f $dirout/CMIP6_fluxnhx_merged_annual_1850-2014.nc $dirout/CMIP6_fluxnoy_merged_annual_1850-2014.nc
+cdo merge ${drynhx} ${wetnhx} ${dirout}/CMIP6_fluxnhx_merged_annual_1850-2014.nc
+cdo merge ${drynoy} ${wetnoy} ${dirout}/CMIP6_fluxnoy_merged_annual_1850-2014.nc
+cdo splityear -expr,'fluxnhx=drynhx+wetnhx' ${dirout}/CMIP6_fluxnhx_merged_annual_1850-2014.nc ${dirout}/CMIP6_fluxnhx_annual_1850-2014.nc
+cdo splityear -expr,'fluxnoy=drynoy+wetnoy' ${dirout}/CMIP6_fluxnoy_merged_annual_1850-2014.nc ${dirout}/CMIP6_fluxnoy_annual_1850-2014.nc
+rm -f ${dirout}/CMIP6_fluxnhx_merged_annual_1850-2014.nc ${dirout}/CMIP6_fluxnoy_merged_annual_1850-2014.nc
Index: /TOOLS/CMIP6_FORCING/OZONE/clims_CMIP6.bash
===================================================================
--- /TOOLS/CMIP6_FORCING/OZONE/clims_CMIP6.bash	(revision 3566)
+++ /TOOLS/CMIP6_FORCING/OZONE/clims_CMIP6.bash	(revision 3567)
@@ -1,10 +1,7 @@
 #!/bin/bash
-
-ia="3"      #=== Indices of chosen Amip  datasets (see below AMIP_VERSION_NAMES/AMIP_VERSION_FOLDERS)
-io="1"      #=== Indices of chosen Ozone datasets (see below OZON_VERSION_NAMES/OZON_VERSION_FOLDERS)
-recomp='n'  #=== Recompute files that are already present (y/n)
-do_amip='n' #=== Compute sic/sst files
-do_ozon='y' #=== Compute ozone files
-
+module load nco/4.4.8
+
+ia="1"    #=== Indices of chosen Amip  datasets (see below AMIP_VERSION_NAMES/AMIP_VERSION_FOLDERS)
+io="1"    #=== Indices of chosen Ozone datasets (see below OZON_VERSION_NAMES/OZON_VERSION_FOLDERS)
 
 #===============================================================================
@@ -13,5 +10,5 @@
 if   [ ${HOSTNAME:0:3} = 'ada'    ]; then machine='ada';    work=$WORKDIR
 elif [ ${HOSTNAME:0:5} = 'curie'  ]; then machine='curie';  work=$CCCWORKDIR
-elif [ ${HOSTNAME:0:6} = 'ciclad' ]; then machine='ciclad'; work=/data/$USER
+elif [ ${HOSTNAME:0:6} = 'ciclad' ]; then machine='ciclad'; work=/home/$USER/tmp
 else echo "Not set up for this machine yet, sorry."; exit; fi
 export machine=$machine
@@ -21,59 +18,57 @@
 #===============================================================================
 local=$PWD
-echo $machine
 case $machine in
-  ada)    work=$WORKDIR
-          DATAIN="/workgpfs/rech/dzt/"$USER"/input4MIPs"
-          DATAOU="/workgpfs/rech/dzt/"$USER"/IGCM"
-          module load netcdf
-          module load nco/4.4.6 ;;
+  ada)    work=$WORKDIR;    DATAIN=""
+          DATAOU='/workgpfs/rech/psl/rpsl035/IGCM' ;;
   curie)  work=$CCCWORKDIR; DATAIN=""
-          DATAIN="/ccc/work/rech/psl/"$USER"/input4MIPs"
-          DATAOU="/ccc/work/rech/psl/"$USER"/IGCM"
-          module load netcdf
-          module load nco ;;
-  ciclad) work=/data/$USER
-          DATAIN='/prodigfs/project/input4MIPs'
-          DATAOU='/prodigfs/ipslfs/igcmg/IGCM'
-          DATAOU='/data/'${USER}'/CMIP6/OZONE'
-          module load nco/4.4.8 ;;
+          DATAOU='/ccc/work/rech/psl/rpsl035/IGCM' ;;
+  ciclad) work=/data/$USER; DATAIN=/prodigfs/esgf/mirror/input4MIPs/CMIP6/CMIP
+          DATAOU='/prodigfs/ipslfs/igcmg/IGCM'     ;;
 esac
-
-if [ ! -d ${DATAOU} ] ; then mkdir -p ${DATAOU} ; fi
+DATAOU=/home/tlurton/IGCM     ##### !!!!!! PROVISOIRE !!!!!!!
 
 #--- INPUT DATA: AMIP
-AMIP_VERSION_NAMES=('PCMDI-AMIP-1-1-0' 'PCMDI-AMIP-1-1-1' 'PCMDI-AMIP-1-1-2')
-AMIP_VERSION_FOLDERS=('gs1x1/v20160609' 'gn/v20161020' 'gn/v20170419')
-AMIP_FOLDER_IN=$DATAIN/PCMDI/SSTsAndSeaIce/CMIP/\${amip_version_name}/mon/\${V}/\${amip_version_folder}
-amip_vname_in=('tosbcs' 'siconcbcs')
-amip_fname_in='${V}_input4MIPs_SSTsAndSeaIce_CMIP_${amip_version_name}_${amip_version_folder%/*}*_18????-20????.nc'
+AMIP_VERSION_NAMES=('PCMDI-AMIP-1-1-3')
+AMIP_VERSION_FOLDERS=('gn/v20161031')
+AMIP_FOLDER_IN=$DATAIN'/PCMDI/${amip_version_name}/${W}/mon/${V}/${amip_version_folder}'
+amip_tname_in=('ocean' 'seaIce')
+amip_vname_in=('tos' 'siconc')
+amip_fname_in='${V}_input4MIPs_SSTsAndSeaIce_CMIP_${amip_version_name}_${amip_version_folder%/*}_187001-20????.nc'
 
 #--- INPUT DATA: OZONE
 OZON_VERSION_NAMES=('UReading-CCMI-1-0')
-OZON_VERSION_FOLDERS=('gr/v20160711'); if [ $machine = 'ciclad' ]; then OZON_VERSION_FOLDERS=('gr/v20160907'); fi
-OZON_FOLDER_IN=$DATAIN/UReading/ozone/CMIP/\${ozon_version_name}/mon/\${V}/\${ozon_version_folder}
+OZON_VERSION_FOLDERS=('gn/v20160711')
+OZON_VERSION_FOLDERS_CLIM=('gn/v20160830')
+OZON_FOLDER_IN=$DATAIN/'UReading/${ozon_version_name}/atmos/mon${clim}/${V}/${ozon_version_folder}'
 ozon_vname_in='vmro3'
-ozon_fname_in='${V}_input4MIPs_ozone_CMIP_${ozon_version_name}_${ozon_version_folder%/*}*_${Yi}01-${Yf}12.nc'
+ozon_fname_in='${V}_input4MIPs_ozone_CMIP_${ozon_version_name}_${ozon_version_folder%/*}_${Yi}01-${Yf}12.nc'
 
 #--- VERSIONS OF INPUT FILES EFFECTIVELY CHOSEN
 ((ia--)); ((io--))
-amip_version_name=${AMIP_VERSION_NAMES[$ia]}; amip_version_folder=${AMIP_VERSION_FOLDERS[$ia]}
-ozon_version_name=${OZON_VERSION_NAMES[$io]}; ozon_version_folder=${OZON_VERSION_FOLDERS[$io]}
 
 #--- OUTPUT DATA
-AMIP_FOLDER_OU=$DATAOU/ATM/LIMIT/AMIP.\${amip_version_folder##*/}/original/\${nlon}x\${nlat}/BCS
-OZON_FOLDER_OU=$DATAOU/ATM/OZONE/UReading.\${ozon_version_folder##*/}/original
-amip_vname_ou=('tosbcs' 'sicbcs'); amip_fname_ou='amipbc_${V}_${nlon}x${nlat}_${Y}.nc'
+DATAOU=${DATAOU%/*}/ANTICHAMBRE; if [ ! -d $DATAOU ]; then mkdir -p $DATAOU; fi
+AMIP_FOLDER_OU=$DATAOU/'ATM/LIMIT/AMIP.${amip_version_folder##*/}/${suf}'
+OZON_FOLDER_OU=$DATAOU/'ATM/OZONE/UReading.${ozon_version_folder##*/}'
+amip_vname_ou=('tosbcs' 'sicbcs'); amip_fname_ou='amip${bc}_${V}_360x180_${Y}.nc'
 ozon_vname_ou='tro3'             ; ozon_fname_ou='${V}_${Y}.nc'
-Y_amip=1870-2016                     #--- FOR AMIP  FILES (INTERANNUAL)
-Y_ozon=1850-2014:50                  #--- FOR OZONE FILES (INTERANNUAL)
-Y_clim=1979-2008                     #--- FOR CLIMATOLOGIES (COMMON PERIODS FOR O3 AND SIC/SST)
-Y_pind=1870-1899                     #--- FOR SST/SIC PRE-INDUSTRIAL CLIMATOLOGY
+Y_amip_beg=1870 ; Y_amip_end=2017    #--- FOR AMIP  FILES (INTERANNUAL)
+Y_ozon_beg=1850 ; Y_ozon_end=2014    #--- FOR OZONE FILES (INTERANNUAL)
+Y_clim_beg=1979 ; Y_clim_end=2008    #--- FOR CLIMATOLOGIES (COMMON PERIOD FOR O3 AND SIC/SST)
+Y_pind_beg=1870 ; Y_pind_end=1899    #--- FOR SST/SIC PRE-INDUSTRIAL CLIMATOLOGY
+# NB: CLIMATOLOGIES ARE PRODUCED FOR EACH FILE CONTAINING "-clim" SUFFIX FOUND IN THE FOLDER TREE, IN PARTICULAR FOR OZONE.
+
+#--- RECOMPUTE FILES THAT ARE ALREADY PRESENT (y/n)
+recomp='n'
+do_amip='n'
+do_ozon='y'
 
 if [ "$do_amip" = "y" ]; then
+  amip_version_name=${AMIP_VERSION_NAMES[$ia]}; amip_version_folder=${AMIP_VERSION_FOLDERS[$ia]}
   echo ">> Chosen SST files:   $(V=${amip_vname_in[0]}; amip_version_name=$amip_version_name; amip_version_folder=$amip_version_folder; eval echo $AMIP_FOLDER_IN)"
   echo ">> Chosen SIC files:   $(V=${amip_vname_in[1]}; amip_version_name=$amip_version_name; amip_version_folder=$amip_version_folder; eval echo $AMIP_FOLDER_IN)"
 fi
 if [ "$do_ozon" = "y" ]; then
+  ozon_version_name=${OZON_VERSION_NAMES[$io]}; ozon_version_folder=${OZON_VERSION_FOLDERS[$io]}
   echo ">> Chosen OZONE files: $(V=${ozon_vname_in};    ozon_version_name=$ozon_version_name; ozon_version_folder=$ozon_version_folder; eval echo $OZON_FOLDER_IN)"
 fi
@@ -231,16 +226,4 @@
 
 #==================================================================================
-function tim_len {
-  local n
-  n=`ncdump -h $1 | grep 'UNLIMITED'`; n=${n#*// (}; n=${n% currently*}; echo $n
-}
-
-#==================================================================================
-function dim_len {
-  local n
-  if [ "$2" = "T" ]; then tim_len $1; else n=`ncdump -h $1 | grep $(dim_nam $1 $2)' = '`; n=${n#* = }; n=${n% ;*}; echo $n; fi
-}
-
-#==================================================================================
 function test_var {
 # Input arguments:
@@ -257,15 +240,13 @@
 #    Rename dimensions, dimensional variables and possibly bounds_<variable>.
 #
-  local f=$1 out="" nam_in nam_ou vOK
-  vOK=0; if [ $f = "v" ]; then vOK=1; shift; f=$1; fi
+  local f=$1 out="" nam_in nam_ou
   shift
   while [ $# -ge 1 ]; do
     nam_ou=${1##*:}; nam_in=$(dim_nam $f ${1%:*}); shift
     if [ "$nam_in" != "$nam_ou" ]; then
-      out="$out -d $nam_in,$nam_ou"
-      if [ $vOK -eq 1 ]; then out="$out -v $nam_in,$nam_ou"; fi
+      out="$out -d $nam_in,$nam_ou -v $nam_in,$nam_ou"
       nam_in=bounds_$nam_in; nam_ou=bounds_$nam_ou
       test_var $f $nam_in
-      if [ $? -eq 0 ]; then out="$out -v $nam_in,$nam_ou"; fi
+      if [ $? -eq 0 ]; then out="$out -d $nam_in,$nam_ou -v $nam_in,$nam_ou"; fi
     fi
     ((ia++))
@@ -282,29 +263,27 @@
 
 #=== BUILD YEARLY INTERANNUAL SIC/SST FILES WITH 12 RECORDS
-for is in $ia; do                                                       #--- Loop on Amip versions
+for is in $ia; do                                                            #--- Loop on Amip versions
   amip_version_name=${AMIP_VERSION_NAMES[$is]}
   amip_version_folder=${AMIP_VERSION_FOLDERS[$is]}
-  for ivar in $(eval echo {1..${#amip_vname_in[@]}}); do iv=$((ivar-1)) #--- Loop on variables
-
-    #--- VARIABLES NAMES (INPUT, OUTPUT AND FOR FILE NAMING PURPOSE)
-    v_in=${amip_vname_in[$iv]}; v_ou=${amip_vname_ou[$iv]}
-    var='sst'; if [ $ivar -eq  2 ]; then var='sic'; fi
-
-    #--- INPUT FOLDER AND FILE NAMES
-    d_in=$(amip_version_name=$amip_version_name; amip_version_folder=$amip_version_folder; V=$v_in; eval echo $AMIP_FOLDER_IN)
-    f_in=$d_in/$(V=$v_in;       eval echo ${amip_fname_in})
-
-    #--- OUTPUT FILE AND FOLDER NAMES
-    nlon=$(dim_len $f_in X); nlat=$(dim_len $f_in Y)                    #--- Dimensions lengths
-    d_ou=$(amip_version_name=$amip_version_name; amip_version_folder=$amip_version_folder; nlon=$nlon; nlat=$nlat; eval echo $AMIP_FOLDER_OU)
-    if [ ! -d $d_ou ]; then mkdir -p $d_ou; fi
-
-    #--- FILES NAMES (INPUT, OUTPUT)
-    f_ou=$d_ou/$(V=$var; Y=\$Y; nlon=$nlon; nlat=$nlat; eval echo ${amip_fname_ou})
-
-    for per in ${Y_amip}; do
-      Yb=${per%%-*}; Ye=${per##*-}
-      echo ">> BUILDING 12 MONTHS $v_in FILES FOR THE ${per} PERIOD USING $amip_version_name DATASET (${amip_version_folder##*/})..."
-      for Y in $(eval echo {${Yb}..${Ye}); do                             #--- Loop on years
+  for suf in AVE BCS; do                                                     #--- Loop on var type
+    for ivar in $(eval echo {1..${#amip_vname_in[@]}}); do iv=$((ivar-1))    #--- Loop on variables
+
+      #--- VARIABLES NAMES (INPUT, OUTPUT AND FOR FILE NAMING PURPOSE)
+      v_in=${amip_vname_in[$iv]}; if [ "$suf" = "BCS" ]; then v_in=${v_in}bcs; fi
+      v_ou=${amip_vname_ou[$iv]}; if [ "$suf" = "BCS" ]; then v_ou=${v_ou}bcs; fi
+      var='sst';                  if [ $ivar  -eq  2  ]; then var='sic';       fi
+
+      #--- INPUT/OUTPUT FOLDER NAME
+      d_in=$(amip_version_name=$amip_version_name; amip_version_folder=$amip_version_folder; suf=$suf; V=$v_in; eval echo $AMIP_FOLDER_IN)
+      d_ou=$(amip_version_name=$amip_version_name; amip_version_folder=$amip_version_folder; suf=$suf;          eval echo $AMIP_FOLDER_OU)
+      if [ ! -d $d_ou ]; then mkdir -p $d_ou; fi
+
+      #--- FILES NAMES (INPUT, OUTPUT)
+      bc=""; if [ "$suf" = "BCS" ]; then bc=bc; fi
+      f_in=$d_in/$(V=$v_in;               eval echo ${amip_fname_in})
+      f_ou=$d_ou/$(V=$var; Y=\$Y; bc=$bc; eval echo ${amip_fname_ou})
+
+      echo ">> BUILDING 12 MONTHS $v_in FILES FOR THE ${Y_amip_beg}-${Y_amip_end} PERIOD USING $amip_version_name DATASET (${amip_version_folder##*/})..."
+      for Y in $(eval echo {${Y_amip_beg}..${Y_amip_end}}); do               #--- Loop on years
 
         #--- RECOMPUTE OR NOT
@@ -312,36 +291,39 @@
 
         #--- 2D FIELDS EXTRACTION
-        extract $v_in,$v_ou $AMIP_FOLDER_IN/$amip_fname_in,$f_ou $Yb,$Ye,0 $Y 0
-
-        progress_bar $((Y-Yb+1)) $((Ye-Yb+1)) 50
-     done
-   done
+        extract $v_in,$v_ou $AMIP_FOLDER_IN/$amip_fname_in,$f_ou $Y_amip_beg,$Y_amip_end,0 $Y 0
+
+        progress_bar $((Y-Y_amip_beg+1)) $((Y_amip_end-Y_amip_beg+1)) 50
+      done
+    done
   done
 done
 
 #=== BUILD SIC/SST 12 RECORDS CLIMATOLOGIES
-for is in $ia; do                                                       #--- Loop on Amip versions
+for is in $ia; do                                                            #--- Loop on Amip versions
   amip_version_name=${AMIP_VERSION_NAMES[$is]}
   amip_version_folder=${AMIP_VERSION_FOLDERS[$is]}
-  for ivar in $(eval echo {1..${#amip_vname_in[@]}}); do iv=$((ivar-1)) #--- Loop on variables
-
-    #--- VARIABLES (OUTPUT, FOR FILE NAMING PURPOSE) AND OUTPUT FILE NAMES
-    v_ou=${amip_vname_ou[$iv]}
-    var='sst'; if [ $ivar -eq 2 ]; then var='sic'; fi
-    d_ou=$(amip_version_name=$amip_version_name; amip_version_folder=$amip_version_folder; eval echo $AMIP_FOLDER_OU)
-    f_ou=$(V=$var; Y=\$Y; eval echo ${amip_fname_ou})
-
-    for per in ${Y_clim} ${Y_pind}; do                                  #--- Loop on periods
-      Yb=${per%%-*}; Ye=${per##*-}
-      echo ">> BUILDING 12 MONTHS $v_ou CLIMATOLOGY ON PERIOD ${per} USING $amip_version_name DATASET (${amip_version_folder##*/})..."
-
-      #--- RECOMPUTE OR NOT
-      if [[ -f $d_ou/$(Y=${Yb}_${Ye}_clim; eval echo $f_ou) && $recomp = 'n' ]]; then continue; fi
-
-      #--- COMPUTE CLIMATOLOGY
-      make_clim $v_ou $d_ou/$f_ou ${Yb},${Ye} 0
-
+  for suf in AVE BCS; do                                                     #--- Loop on var type
+    for ivar in $(eval echo {1..${#amip_vname_in[@]}}); do iv=$((ivar-1))    #--- Loop on variables
+
+      #--- VARIABLES (OUTPUT, FOR FILE NAMING PURPOSE) AND OUTPUT FILE NAMES
+      bc=""; if [ "$suf" = "BCS" ]; then bc=bc; fi
+      v_ou=${amip_vname_ou[$iv]}; if [ "$suf" = "BCS" ]; then v_ou=${v_ou}bcs; fi
+      var='sst';                  if [ $ivar  -eq  2  ]; then var='sic';       fi
+      d_ou=$(amip_version_name=$amip_version_name; amip_version_folder=$amip_version_folder; suf=$suf; eval echo $AMIP_FOLDER_OU)
+      f_ou=$(V=$var; Y=\$Y; bc=$bc; eval echo ${amip_fname_ou})
+
+      for per in ${Y_clim_beg},${Y_clim_end} ${Y_pind_beg},${Y_pind_end}; do #--- Loop on periods
+        echo ">> BUILDING 12 MONTHS $v_ou CLIMATOLOGIES ON PERIOD ${per%%,*}-${per##*,} for $suf DATA..."
+
+        #--- RECOMPUTE OR NOT
+        Yint=${per%%,*}_${per##*,}_clim
+        if [[ -f $d_ou/$(Y=$Yint; eval echo $f_ou) && $recomp = 'n' ]]; then continue; fi
+
+        #--- COMPUTE CLIMATOLOGY
+        make_clim $v_ou $d_ou/$f_ou ${per} 0
+
+      done
+      cd $d_ou; ln -sf $(Y=2002; eval echo $f_ou) $(Y=2002_2002_clim; eval echo $f_ou); cd - 2>&1 > /dev/null
     done
-    cd $d_ou; ln -sf $(Y=2002; eval echo $f_ou) $(Y=2002_2002_clim; eval echo $f_ou); cd - 2>&1 > /dev/null
   done
 done
@@ -358,30 +340,22 @@
 
 #=== BUILD YEARLY INTERANNUAL OZONE FILES WITH 12 RECORDS
-Yb=${Y_ozon%%-*}; Ye=${Y_ozon##*-}; dY=${Ye#*:}; Ye=${Ye%:*}
 for is in $io; do                                                 #--- Loop on Ozone versions
   ozon_version_name=${OZON_VERSION_NAMES[$is]}
   ozon_version_folder=${OZON_VERSION_FOLDERS[$is]}
-
-  #--- VARIABLES NAMES (INPUT, OUTPUT)
+  d_ou=$(ozon_version_name=$ozon_version_name; ozon_version_folder=$ozon_version_folder; eval echo $OZON_FOLDER_OU)               #--- Output folder
+  if [ ! -d $d_ou ]; then mkdir -p $d_ou; fi
+  v_ou=${ozon_vname_ou}                                           #--- Output variable
   v_in=${ozon_vname_in}                                           #--- Input  variable
-  v_ou=${ozon_vname_ou}                                           #--- Output variable
-
-  #--- INPUT/OUTPUT FILE NAME
   f_in=$(V=$v_in; Yi=\${Yi}; Yf=\${Yf}; ozon_version_name=$ozon_version_name; ozon_version_folder=$ozon_version_folder; eval echo $OZON_FOLDER_IN/${ozon_fname_in[$is]})
   f_ou=$(V=$v_ou; Y=\$Y; eval echo $ozon_fname_ou)
 
-  #--- INPUT FILE HORIZONTAL RESOLUTION
-  f0=$(Yi=${Yb}; Yf=$((Yb+dY-1)); eval echo $f_in)                #--- First file name
-  nlon=$(dim_len $f0 X); nlat=$(dim_len $f0 Y)                    #--- Dimensions lengths
-
-  #--- OUTPUT FOLDERS NAMES
-  d_ou=$(ozon_version_name=$ozon_version_name; ozon_version_folder=$ozon_version_folder; eval echo $OZON_FOLDER_OU)
-  d_o2=$d_ou/1x${nlat}                                            #--- Output folder (2D)
-  d_o3=$d_ou/${nlon}x${nlat}                                      #--- Output folder (3D)
+  nm=12
+  d_o2=$d_ou/2D_12Fields                                          #--- Output folder (2D)
+  d_o3=$d_ou/3D_12Fields                                          #--- Output folder (3D)
   if [ ! -d $d_o2 ]; then mkdir -p $d_o2; fi; f_o2=$d_o2/$f_ou
   if [ ! -d $d_o3 ]; then mkdir -p $d_o3; fi; f_o3=$d_o3/$f_ou
-  if [ ! -d $d_ou ]; then mkdir -p $d_ou; fi
-
-  for Y in $(eval echo {${Yb}..${Ye}}); do      #--- Loop on years
+
+  echo ">> BUILDING $nm MONTHS OZONE FILES FOR PERIOD ${Y_ozon_beg}-${Y_ozon_end} USING $OZON_VERSION_NAMES DATASET (${ozon_version_folder##*/})..."
+  for Y in $(eval echo {${Y_ozon_beg}..${Y_ozon_end}}); do      #--- Loop on years
  
     #--- RECOMPUTE OR NOT
@@ -389,10 +363,9 @@
 
     #--- 3D FIELDS EXTRACTION
-    extract $v_in,$v_ou $f_in,$f_o3 $Yb,$Ye,$dY $Y 0
-    #$(((nm-12)/2))
+    extract $v_in,$v_ou $f_in,$f_o3 $Y_ozon_beg,$Y_ozon_end,50 $Y 0
 
     #--- RENAME DIMENSIONS ACCORDING TO $coords VARIABLE
     fo3=$(Y=$Y; eval echo $f_o3); fo2=$(Y=$Y; eval echo $f_o2)
-    if [ $Y -eq $Yb ]; then args_ren=$(renam_dims $fo3 $coords); fi
+    if [ $Y -eq $Y_ozon_beg ]; then args_ren=$(renam_dims $fo3 $coords); fi
     if [ "$args_ren" != "" ]; then ncrename $args_ren $fo3 2>&1 > /dev/null ; fi
 
@@ -405,5 +378,5 @@
     if [ $? -eq 0 ]; then ncks -x -v $v $fo2 $tmp ; mv $tmp $fo2; fi
 
-    progress_bar $((Y-Yb+1)) $((Ye-Yb+1)) $dY
+    progress_bar $((Y-Y_ozon_beg+1)) $((Y_ozon_end-Y_ozon_beg+1)) 50
 
   done
@@ -416,41 +389,38 @@
   v_ou=${ozon_vname_ou}                                           #--- Output variable
 
-  for per in ${Y_clim} ${Y_pind}; do                              #--- Loop on periods
-    Yb=${Y_clim%%-*}; Ye=${Y_clim##*-}
-    for rank in 3 2; do                                           #--- Loop on rank
-      if [ $rank -eq 2 ]; then d_ou=$d_o2; else d_ou=$d_o3; fi
-
-      #--- CLIMATOLOGY ON GIVEN YEARS INTERVAL (Y_clim)
-      f_ou=$(V=$v_ou; Y=${Yb}_${Ye}_clim; eval echo $ozon_fname_ou) #--- Regular climatology name
-      if [[ ! -f $d_ou/$f_ou || $recomp = 'y' ]]; then
-        echo ">> BUILDING 12 MONTHS ${rank}D $v_ou CLIMATOLOGY ON PERIOD ${Y_clim}..."
-        make_clim $v_ou $d_ou/\$ozon_fname_ou ${Yb},${Ye} 0
+  for rank in 3 2; do                                             #--- Loop on rank
+    d12=$d_ou/${rank}D_12Fields
+
+    #--- CLIMATOLOGY ON GIVEN YEARS INTERVAL (Y_clim_beg-Y_clim_end)
+    f_ou=$(V=$v_ou; Y=${Y_clim_beg}_${Y_clim_end}_clim; eval echo $ozon_fname_ou) #--- Regular climatology name
+    if [[ ! -f $d12/$f_ou || $recomp = 'y' ]]; then
+      echo ">> BUILDING 12 MONTHS ${rank}D $v_ou CLIMATOLOGY ON PERIOD ${Y_clim_beg}-${Y_clim_end}..."
+      make_clim $v_ou $d12/\$ozon_fname_ou ${Y_clim_beg},${Y_clim_end} 0
+    fi
+
+    #--- PRE-INDUSTRIAL CLIMATOLOGY USING SPECIAL FILE
+    ozon_version_folder=$(eval echo ${OZON_VERSION_FOLDERS_CLIM[$is]})
+
+    f_in=$(V=$v_in; Yi=1850; Yf=1850; ozon_version_name=$ozon_version_name; ozon_version_folder=$ozon_version_folder; clim='C'; eval echo $OZON_FOLDER_IN/$ozon_fname_in); #f_in=${f_in%.nc*}-clim.nc
+    f_ou=$(V=$v_ou; Y=1850_1850_clim; eval echo $ozon_fname_ou)
+    if [[ ! -f $d12/$f_ou || $recomp = 'y' ]]; then
+      echo ">> BUILDING 12 MONTHS ${rank}D $v_ou PRE-INDUSTRIAL CLIMATOLOGY..."
+      if [ $rank -eq 3 ]; then f_ou0=$d12/$f_ou
+
+        #--- DUPLICATE FILE AND RENAME DIMENSIONS
+        cp $f_in $d12/$f_ou ; args_ren=$(renam_dims $d12/$f_ou $coords)
+        ncrename $args_ren -v $ozon_vname_in,$ozon_vname_ou $d12/$f_ou 2>&1 > /dev/null
+
+      else
+        #--- ZONAL MEAN
+        ncwa    -a longitude      $f_ou0 $tmp ; mv $tmp $d12/$f_ou
+        ncks -x -v longitude $d12/$f_ou  $tmp ; mv $tmp $d12/$f_ou
+
+        #--- REMOVE USELESS VARIABLE
+        v="bounds_longitude"
+        test_var $d12/$f_ou $v
+        if [ $? -eq 0 ]; then ncks -x -v $v $d12/$f_ou $tmp ; mv $tmp $d12/$f_ou; fi
       fi
-
-      #--- PRE-INDUSTRIAL CLIMATOLOGY USING SPECIAL FILE
-#set -vx
-      f_in=$(V=$v_in; Yi=1850; Yf=1850; eval echo $OZON_FOLDER_IN/$ozon_fname_in); f_in=${f_in%.nc*}-clim.nc
-      f_ou=$(V=$v_ou; Y=1850_1850_clim; eval echo $ozon_fname_ou)
-      if [[ ! -f $d_ou/$f_ou || $recomp = 'y' ]]; then
-        echo ">> BUILDING 12 MONTHS ${rank}D $v_ou PRE-INDUSTRIAL CLIMATOLOGY..."
-        if [ $rank -eq 3 ]; then f_ou0=$d_ou/$f_ou
-
-          #--- DUPLICATE FILE AND RENAME DIMENSIONS
-          cp $f_in $d_ou/$f_ou ; args_ren=$(renam_dims v $d_ou/$f_ou $coords)
-          ncrename $args_ren -v $ozon_vname_in,$ozon_vname_ou $d_ou/$f_ou 2>&1 > /dev/null
-
-        else
-          #--- ZONAL MEAN
-          ncwa    -a longitude       $f_ou0 $tmp ; mv $tmp $d_ou/$f_ou
-          ncks -x -v longitude $d_ou/$f_ou  $tmp ; mv $tmp $d_ou/$f_ou
-
-          #--- REMOVE USELESS VARIABLE
-          v="bounds_longitude"
-          test_var $d_ou/$f_ou $v
-          if [ $? -eq 0 ]; then ncks -x -v $v $d_ou/$f_ou $tmp ; mv $tmp $d_ou/$f_ou; fi
-        fi
-      fi
-#set +vx
-    done
+    fi
   done
 done
Index: /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_historical_2bands.m
===================================================================
--- /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_historical_2bands.m	(revision 3566)
+++ /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_historical_2bands.m	(revision 3567)
@@ -1,2 +1,6 @@
+% Updated 05/02/2018, ThL
+% * changed paths to retrieve new version of input data;
+% * version considered is now 3.2.
+
 % MATLAB run script to integrate spectral solar irradiance (SSI) data
 % recommended and provided by SPARC/SOLARIS-HEPPA for use in CMIP6 to
@@ -51,5 +55,5 @@
 % placed in dir_in); adapt to respective file that is to be considered
 %filename_in='solarforcing_ref_mon_3.1.nc';
-filename_in='/prodigfs/project/input4MIPs/SOLAR/transient/solarforcing_ref_day_3.1.nc';
+filename_in='/prodigfs/esgf/mirror/input4MIPs/CMIP6/CMIP/SOLARIS-HEPPA/SOLARIS-HEPPA-3-2/atmos/day/multiple/gz/v20170103/solarforcing-ref-day_input4MIPs_solar_CMIP_SOLARIS-HEPPA-3-2_gn_18500101-22991231.nc';
 
 % lines 53-54 only used to match input and output filenames
Index: /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_historical_6bands.m
===================================================================
--- /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_historical_6bands.m	(revision 3566)
+++ /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_historical_6bands.m	(revision 3567)
@@ -1,2 +1,6 @@
+% Updated 05/02/2018, ThL
+% * changed paths to retrieve new version of input data;
+% * version considered is now 3.2.
+
 % MATLAB run script to integrate spectral solar irradiance (SSI) data
 % recommended and provided by SPARC/SOLARIS-HEPPA for use in CMIP6 to
@@ -51,5 +55,5 @@
 % placed in dir_in); adapt to respective file that is to be considered
 %filename_in='solarforcing_ref_mon_3.1.nc';
-filename_in='/prodigfs/project/input4MIPs/SOLAR/transient/solarforcing_ref_day_3.1.nc';
+filename_in='/prodigfs/esgf/mirror/input4MIPs/CMIP6/CMIP/SOLARIS-HEPPA/SOLARIS-HEPPA-3-2/atmos/day/multiple/gz/v20170103/solarforcing-ref-day_input4MIPs_solar_CMIP_SOLARIS-HEPPA-3-2_gn_18500101-22991231.nc'
 
 % lines 53-54 only used to match input and output filenames
Index: /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_piControl_2bands.m
===================================================================
--- /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_piControl_2bands.m	(revision 3566)
+++ /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_piControl_2bands.m	(revision 3567)
@@ -1,2 +1,6 @@
+% Updated 05/02/2018, ThL
+% * changed paths to retrieve new version of input data;
+% * version considered is now 3.2.
+
 % MATLAB run script to integrate spectral solar irradiance (SSI) data
 % recommended and provided by SPARC/SOLARIS-HEPPA for use in CMIP6 to
@@ -50,5 +54,5 @@
 %filename_in='solarforcing_ref_mon_3.1.nc';
 %filename_in='solarforcing_ref_day_3.1.nc';
-filename_in='/prodigfs/project/input4MIPs/SOLAR/solarforcing_picontrol_fx_3.1.nc';
+filename_in='/prodigfs/esgf/mirror/input4MIPs/CMIP6/CMIP/SOLARIS-HEPPA/SOLARIS-HEPPA-3-2/atmos/fx/multiple/gz/v20170103/solarforcing-picontrol-fx_input4MIPs_solar_CMIP_SOLARIS-HEPPA-3-2_gn_18500101-18730128.nc'
 
 % lines 53-54 only used to match input and output filenames
Index: /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_piControl_6bands.m
===================================================================
--- /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_piControl_6bands.m	(revision 3566)
+++ /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_piControl_6bands.m	(revision 3567)
@@ -1,2 +1,6 @@
+% Updated 05/02/2018, ThL
+% * changed paths to retrieve new version of input data;
+% * version considered is now 3.2.
+
 % MATLAB run script to integrate spectral solar irradiance (SSI) data
 % recommended and provided by SPARC/SOLARIS-HEPPA for use in CMIP6 to
@@ -50,5 +54,5 @@
 %filename_in='solarforcing_ref_mon_3.1.nc';
 %filename_in='solarforcing_ref_day_3.1.nc';
-filename_in='/prodigfs/project/input4MIPs/SOLAR/solarforcing_picontrol_fx_3.1.nc';
+filename_in='/prodigfs/esgf/mirror/input4MIPs/CMIP6/CMIP/SOLARIS-HEPPA/SOLARIS-HEPPA-3-2/atmos/fx/multiple/gz/v20170103/solarforcing-picontrol-fx_input4MIPs_solar_CMIP_SOLARIS-HEPPA-3-2_gn_18500101-18730128.nc'
 
 % lines 53-54 only used to match input and output filenames
Index: /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_sensitivity_2bands.m
===================================================================
--- /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_sensitivity_2bands.m	(revision 3566)
+++ /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_sensitivity_2bands.m	(revision 3567)
@@ -1,2 +1,6 @@
+% Updated 05/02/2018, ThL
+% * changed paths to retrieve new version of input data;
+% * version considered is now 3.2.
+
 % MATLAB run script to integrate spectral solar irradiance (SSI) data
 % recommended and provided by SPARC/SOLARIS-HEPPA for use in CMIP6 to
@@ -51,5 +55,5 @@
 % placed in dir_in); adapt to respective file that is to be considered
 %filename_in='solarforcing_ext_mon_3.1.nc';
-filename_in='/prodigfs/project/input4MIPs/SOLAR/sensitivity/solarforcing_ext_day_3.1.nc';
+filename_in='/prodigfs/esgf/mirror/input4MIPs/CMIP6/CMIP/SOLARIS-HEPPA/SOLARIS-HEPPA-3-2/atmos/day/multiple/gz/v20170103/solarforcing-ref-day_input4MIPs_solar_CMIP_SOLARIS-HEPPA-3-2_gn_18500101-22991231.nc'
 
 % lines 53-54 only used to match input and output filenames
Index: /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_sensitivity_6bands.m
===================================================================
--- /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_sensitivity_6bands.m	(revision 3566)
+++ /TOOLS/CMIP6_FORCING/SOLAR/CMIP6_sensitivity_6bands.m	(revision 3567)
@@ -1,2 +1,6 @@
+% Updated 05/02/2018, ThL
+% * changed paths to retrieve new version of input data;
+% * version considered is now 3.2.
+
 % MATLAB run script to integrate spectral solar irradiance (SSI) data
 % recommended and provided by SPARC/SOLARIS-HEPPA for use in CMIP6 to
@@ -51,5 +55,5 @@
 % placed in dir_in); adapt to respective file that is to be considered
 %filename_in='solarforcing_ext_mon_3.1.nc';
-filename_in='/prodigfs/project/input4MIPs/SOLAR/sensitivity/solarforcing_ext_day_3.1.nc';
+filename_in='/prodigfs/esgf/mirror/input4MIPs/CMIP6/CMIP/SOLARIS-HEPPA/SOLARIS-HEPPA-3-2/atmos/day/multiple/gz/v20170103/solarforcing-ref-day_input4MIPs_solar_CMIP_SOLARIS-HEPPA-3-2_gn_18500101-22991231.nc'
 
 % lines 53-54 only used to match input and output filenames
Index: /TOOLS/CMIP6_FORCING/SOLAR/README
===================================================================
--- /TOOLS/CMIP6_FORCING/SOLAR/README	(revision 3566)
+++ /TOOLS/CMIP6_FORCING/SOLAR/README	(revision 3567)
@@ -1,2 +1,8 @@
+Update 05/02/2018
+Thibaut Lurton
+Scripts now have paths directed to version 3.2 of the data.
+/prodigfs/esgf/mirror/input4MIPs/CMIP6/CMIP/SOLARIS-HEPPA/SOLARIS-HEPPA-3-2/atmos/
+
+
 Solar forcing dataset from CMIP6 
 See http://www.wcrp-climate.org/wgcm-cmip/wgcm-cmip6
