Index: TOOLS/CMIP6_FORCING/AER_STRAT/volc.sh
===================================================================
--- TOOLS/CMIP6_FORCING/AER_STRAT/volc.sh	(revision 3769)
+++ TOOLS/CMIP6_FORCING/AER_STRAT/volc.sh	(revision 3938)
@@ -1,5 +1,5 @@
 dirpwd=`pwd`
 
-vv='v4'
+vv='v3'
 
 #--choose the resolution
@@ -8,8 +8,8 @@
 #lmdz='VLR_L79'
 #lmdz='VLR'
-#lmdz='LR'
+lmdz='LR'
 #lmdz='MR'
 #--added for Frederique Cheruy
-lmdz='zoom_128x89'
+#lmdz='zoom_128x89'
 
 dirout='/data/'${USER}'/CMIP6/VOLC/'${lmdz}'_'${vv}'/'
@@ -227,8 +227,14 @@
 ggg_sun_lmdz_ave=fltarr(dimlatlmdz,dimz,NSW,month_in_year)
 ;
+tau_sun_lmdz_tr=fltarr(dimlatlmdz,dimz,NSW,month_in_year)
+ome_sun_lmdz_tr=fltarr(dimlatlmdz,dimz,NSW,month_in_year)
+ggg_sun_lmdz_tr=fltarr(dimlatlmdz,dimz,NSW,month_in_year)
+;
 ;--LW properties tau_abs
 tau_ear_lmdz=fltarr(dimlatlmdz,dimz,NLW,month_in_year)
 ;
 tau_ear_lmdz_ave=fltarr(dimlatlmdz,dimz,NLW,month_in_year)
+;
+tau_ear_lmdz_tr=fltarr(dimlatlmdz,dimz,NLW,month_in_year)
 ;
 tau_sun_lmdz_ave(*,*,*,0)=1.e-15
@@ -238,5 +244,4 @@
 ;
 for year=0, dimtime/month_in_year-1 do begin
-;for year=141, 141 do begin ;--Pinatubo
 ;
 tau_550_lmdz(*,*,*)=1.e-15
@@ -402,8 +407,8 @@
 ;
 for mth=1, month_in_year-1 do begin
-ggg_sun_lmdz_ave(*,*,*,mth)=ggg_sun_lmdz_ave(*,*,*,0)
-ome_sun_lmdz_ave(*,*,*,mth)=ome_sun_lmdz_ave(*,*,*,0)
-tau_sun_lmdz_ave(*,*,*,mth)=tau_sun_lmdz_ave(*,*,*,0)
-tau_ear_lmdz_ave(*,*,*,mth)=tau_ear_lmdz_ave(*,*,*,0)
+  ggg_sun_lmdz_ave(*,*,*,mth)=ggg_sun_lmdz_ave(*,*,*,0)
+  ome_sun_lmdz_ave(*,*,*,mth)=ome_sun_lmdz_ave(*,*,*,0)
+  tau_sun_lmdz_ave(*,*,*,mth)=tau_sun_lmdz_ave(*,*,*,0)
+  tau_ear_lmdz_ave(*,*,*,mth)=tau_ear_lmdz_ave(*,*,*,0)
 endfor
 ;
@@ -457,4 +462,79 @@
 netcdfwrite,output+'taulwstrat.2D.ave.nc',opticstruct,clobber=1, $
             attributes=attributes, dimensions=dimensions
+;
+;--finally prepare the transition period 2015-2023
+;--we mix the last year of the period with the climatology
+;
+for year=2015,2023 do begin
+;
+chyr=strcompress(year,/rem)
+;--compute weights
+w1=float(2024-year)/10.
+w2=1-w1
+;--SW properties
+tau_sun_lmdz_tr=w1*tau_sun_lmdz+w2*tau_sun_lmdz_ave
+ome_sun_lmdz_tr=w1*tau_sun_lmdz*ome_sun_lmdz+w2*tau_sun_lmdz_ave*ome_sun_lmdz_ave
+ggg_sun_lmdz_tr=w1*tau_sun_lmdz*ome_sun_lmdz*ggg_sun_lmdz+ $ 
+                w2*tau_sun_lmdz_ave*ome_sun_lmdz_ave*ggg_sun_lmdz_ave
+ggg_sun_lmdz_tr=ggg_sun_lmdz_tr/ome_sun_lmdz_tr
+ome_sun_lmdz_tr=ome_sun_lmdz_tr/tau_sun_lmdz_tr
+;
+;--LW properties
+tau_ear_tr=w1*tau_ear_lmdz+w2*tau_ear_lmdz_ave
+;
+;--prepare SW output
+opticstruct={lat:fltarr(dimlatlmdz),lev:fltarr(dimz),             $ 
+             wav:fltarr(NSW),time:fltarr(month_in_year),          $ 
+             tau_sun:fltarr(dimlatlmdz,dimz,NSW,month_in_year),   $
+             ome_sun:fltarr(dimlatlmdz,dimz,NSW,month_in_year),   $
+             ggg_sun:fltarr(dimlatlmdz,dimz,NSW,month_in_year) }
+;
+opticstruct.lat=latitudelmdz
+opticstruct.lev=lev
+opticstruct.wav=(wl1_sun(0:NSW-1)+wl2_sun(0:NSW-1))/2.
+opticstruct.time=float(indgen(month_in_year)+1)
+opticstruct.tau_sun=tau_sun_lmdz_tr
+opticstruct.ome_sun=ome_sun_lmdz_tr
+opticstruct.ggg_sun=ggg_sun_lmdz_tr
+;
+attributes = {units:strarr(7),long_name:strarr(7)}
+attributes.units =     ['degrees_north','level','meters','month','-','-','-']
+attributes.long_name = ['latitude','level','wavelength','time','tau_sun','ome_sun','g_sun']
+;
+dimensions = {isdim:intarr(7), links:intarr(4,7)}
+       dimensions.isdim =  [1,1,1,1,0,0,0]  ; (1=dimension, 0=variable)
+       dimensions.links = [ [-1,-1,-1,-1],[-1,-1,-1,-1],   $
+                            [-1,-1,-1,-1],[-1,-1,-1,-1],   $
+                            [0,1,2,3],[0,1,2,3],[0,1,2,3]  ]
+;
+netcdfwrite,output+'tauswstrat.2D.'+chyr+'.nc',opticstruct,clobber=1, $
+            attributes=attributes, dimensions=dimensions
+;
+;--prepare LW output
+opticstruct={lat:fltarr(dimlatlmdz),lev:fltarr(dimz),             $ 
+             wav:fltarr(NLW),time:fltarr(month_in_year),          $
+             tau_ear:fltarr(dimlatlmdz,dimz,NLW,month_in_year) }
+;
+opticstruct.lat=latitudelmdz
+opticstruct.lev=lev
+opticstruct.wav=(wl1_earth+wl2_earth)/2.
+opticstruct.time=float(indgen(month_in_year)+1)
+opticstruct.tau_ear=tau_ear_lmdz_tr
+;
+attributes = {units:strarr(5),long_name:strarr(5)}
+attributes.units = ['degrees_north','level','cm-1','month','-']
+attributes.long_name = ['latitude','level','wavenumber','time','tau_ear']
+;
+dimensions = {isdim:intarr(5), links:intarr(4,5)}
+       dimensions.isdim =  [1,1,1,1,0]  ; (1=dimension, 0=variable)
+       dimensions.links = [ [-1,-1,-1,-1],[-1,-1,-1,-1],   $
+                            [-1,-1,-1,-1],[-1,-1,-1,-1],   $
+                            [0,1,2,3]  ]
+;
+netcdfwrite,output+'taulwstrat.2D.'+chyr+'.nc',opticstruct,clobber=1, $
+            attributes=attributes, dimensions=dimensions
+;
+endfor
+;--end loop on years
 ;
 end
@@ -479,3 +559,3 @@
 EOF2
 
-#qsub volc.job
+qsub volc.job
