Index: TOOLS/AMIP/prepare_amip_original.sh
===================================================================
--- TOOLS/AMIP/prepare_amip_original.sh	(revision 5011)
+++ TOOLS/AMIP/prepare_amip_original.sh	(revision 6059)
@@ -2,32 +2,31 @@
 set -vx
 
-# Script that prepares the PCMDI-AMIP-1-1-6 files to be read by ce0l in LMDZ. 
-# These new files are stored in IGCM/ATM/LIMIT/AMIP.v20191121/original
+# Script that prepares the PCMDI-AMIP-1-1-7 files to be read by ce0l in LMDZ. 
+# These new files are stored in IGCM/ATM/LIMIT/AMIP.v20220201/original
 # and can be used to produce limit.nc files on model grid.
+# The input files from input4MIPs should be copied before launching this script. See comments in section 0).
+#
+# Use previous revision 5011 of this script for preparing version PCMDI-AMIP-1-1-6 files.
 # Done by J. Ghattas, 2020/03/03
 
-dirold=original/360x180.orig
-dirnew=original/360x180.new
+dirold=`pwd`/original/360x180.orig
+dirnew=`pwd`/original/360x180.new
 
 # 0) Copy original files from ciclad Input4MIPS and save in $dirold
-#/bdd/input4MIPs/CMIP6/CMIP/PCMDI/PCMDI-AMIP-1-1-6/ocean/mon/tosbcs/gn/v20191121/tosbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-6_gn_187001-201812.nc
-#/bdd/input4MIPs/CMIP6/CMIP/PCMDI/PCMDI-AMIP-1-1-6/seaIce/mon/siconcbcs/gn/v20191121/siconcbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-6_gn_187001-201812.nc
+#/bdd/input4MIPs/CMIP6/CMIP/PCMDI/PCMDI-AMIP-1-1-7/ocean/mon/tosbcs/gn/v20220201/tosbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-7_gn_187001-202106.nc
+#/bdd/input4MIPs/CMIP6/CMIP/PCMDI/PCMDI-AMIP-1-1-7/seaIce/mon/siconcbcs/gn/v20220201/siconcbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-7_gn_187001-202106.nc
 
 # 1) Split files to yearly files
 cd $dirold
-cdo splityear tosbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-6_gn_187001-201812.nc      amipbc_sst_360x180_
-cdo splityear siconcbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-6_gn_187001-201812.nc   amipbc_sic_360x180_
+cdo splityear tosbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-7_gn_187001-202106.nc      amipbc_sst_360x180_
+cdo splityear siconcbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-7_gn_187001-202106.nc   amipbc_sic_360x180_
 
 
-# 2) Produce climatologie files
-ncea amipbc_sst_360x180_1979.nc amipbc_sst_360x180_198* amipbc_sst_360x180_199* amipbc_sst_360x180_200[012345678]* amipbc_sst_360x180_1979_2008_clim.nc
-ncea amipbc_sic_360x180_1979.nc amipbc_sic_360x180_198* amipbc_sic_360x180_199* amipbc_sic_360x180_200[012345678]* amipbc_sic_360x180_1979_2008_clim.nc
-
-# 3) Rename variable name for sea-ice concentration into sicbcs
+# 2) Rename variable name for sea-ice concentration into sicbcs
 #    and 4) The time axis is set fixed instead of unlimited
 mkdir -p $dirnew
 
 Date_Begin=1870
-Date_End=2018
+Date_End=2021
 year=${Date_Begin}
 while [ ${year} -le ${Date_End} ] ; do
@@ -52,19 +51,21 @@
 done
 
-# Do 3) and 4) also for the climatologie files
-filesic=amipbc_sic_360x180_1979_2008_clim.nc
-filesst=amipbc_sst_360x180_1979_2008_clim.nc
-
-echo "Rename variable sicbcs in file $dirold/$filesic "
-ncrename -v siconcbcs,sicbcs $dirold/${filesic} $dirnew/tmpsic.nc
-
-echo "Copy sst file to new folder $dirold/$filesst "
-cp $dirold/${filesst} $dirnew/tmpsst.nc
-
-echo "Change time axis"
-ncks -4 --no_rec_dmn time $dirnew/tmpsic.nc -o $dirnew/${filesic}
-ncks -4 --no_rec_dmn time $dirnew/tmpsst.nc -o $dirnew/${filesst}
- 
-rm -f $dirnew/tmpsic.nc $dirnew/tmpsst.nc
 
 
+# 3) Produce climatologie files for different periods
+#
+#    Climatologie files for the years 1979-2008
+cd $dirnew
+
+ncea amipbc_sst_360x180_1979.nc amipbc_sst_360x180_198* amipbc_sst_360x180_199* amipbc_sst_360x180_200[012345678]* amipbc_sst_360x180_1979_2008_clim.nc
+ncea amipbc_sic_360x180_1979.nc amipbc_sic_360x180_198* amipbc_sic_360x180_199* amipbc_sic_360x180_200[012345678]* amipbc_sic_360x180_1979_2008_clim.nc
+
+
+#    Climatologie files for the years 1991-2020
+ncea amipbc_sst_360x180_199[123456789]* amipbc_sst_360x180_200* amipbc_sst_360x180_201* amipbc_sst_360x180_2020.nc amipbc_sst_360x180_1991_2020_clim.nc
+ncea amipbc_sic_360x180_199[123456789]* amipbc_sic_360x180_200* amipbc_sic_360x180_201* amipbc_sic_360x180_2020.nc amipbc_sic_360x180_1991_2020_clim.nc
+
+
+#    Climatologie files for the years 1870-1899
+ncea amipbc_sic_360x180_18* amipbc_sst_360x180_1870_1899_clim.nc
+ncea amipbc_sic_360x180_18* amipbc_sic_360x180_1870_1899_clim.nc
