source: BOL/SATO/regrid_strat_aerosol_v2.sh @ 4125

Last change on this file since 4125 was 1768, checked in by Laurent Fairhead, 11 years ago

Stratospheric AOD files
Olivier Boucher
May 2013

see http://data.giss.nasa.gov/modelforce/strataer/

These files correspond to the "Sato" climatology which consists of monthly mean
latitudinal distributions of the stratospheric AOD at 550 nm in four vertical
layers. The climatology has been regridded on the LMDZ grid and can be used
as an input to the model (routine readaerosolstrato.F90).

They are available at horizontal resolutions of 48x36, 96x95 and 144x142,
and 39 layers, but can be regridded to any horizontal or vertical resolution
using the regrid tool available in the Boite a Outil LMDZ.

Currently the dataset is only available for the period 1850 to 2010
but can be extended as the original Sato dataset gets extended.

Regridding has three steps:

  • conversion of the Sato ascii file into netcdf (Ionela Musat)
  • horizontal regridding using cdo
  • vertical regridding using an idl script

The regridding conserves the total AOD. Although the Sato climatology
is a latitudinal mean, one can in principle introduce longitudinal
variations in the AOD field.

  • Property svn:executable set to *
File size: 3.0 KB
Line 
1#v2=better management of memory for large resolution
2
3#RES=48x36
4#RES=96x95
5RES=144x142
6
7#enlarge Sato file into a lat-lon field
8cdo enlarge,GRID/grid-giss-enlarged INPUT/tau_zm_NOAA-GISS.nc tmp0.nc
9
10#remap enlarged lat-lon field onto LMDZ CMIP5 grid
11cdo remapcon,GRID/grid-lmdz-lonlat_${RES} tmp0.nc tmp1.nc
12
13#regridding on the vertical
14rm -f regrid.pro
15cat << eod >> regrid.pro
16pro regrid
17filename1='tmp1.nc'
18NETCDFREAD,filename1,'tau',TAU
19NETCDFREAD,filename1,'lat',lat,dimlat0
20NETCDFREAD,filename1,'lon',lon,dimlon0
21NETCDFREAD,filename1,'time',time,dimtime0
22NETCDFREAD,filename1,'altitude',altitude,dimaltitude
23dimlat=dimlat0(0)
24dimlon=dimlon0(0)
25dimtime=dimtime0(0)
26month_in_year=12
27;
28;---approximate altitudes of LMDZ -L39
29dimz=39
30zz=fltarr(dimz)
31zz=[0.0338988, 0.1106602, 0.2139233, 0.3609663, 0.5685416, 0.8534464,     $
32    1.233232, 1.726868, 2.355076, 3.139813, 4.101937, 5.25541, 6.596076,  $
33    8.085103, 9.636482, 11.13441, 12.50023, 13.75765, 15.00424, 16.32207, $
34    17.74403, 19.27899, 20.93219, 22.70941, 24.61736, 26.66389, 28.85831, $
35    31.21178, 33.73778, 36.45278, 39.37709, 42.53607, 45.96209, 49.69786, $
36    53.80379, 58.37727, 63.61497, 70.07092, 80.52708]
37zzi=fltarr(dimz+1)
38zzi(0)=0.0
39for k=1, dimz-1 do begin
40 zzi(k)=(zz(k-1)+zz(k))/2.0
41endfor
42zzi(dimz)=100.00
43print, 'zzi=',zzi
44lev=indgen(dimz)+1
45;
46dimzori=4
47zziori=fltarr(dimzori+1)
48zziori=[15.,20.,25.,30.,35.]
49;
50tau2=fltarr(dimlon,dimlat,dimz,month_in_year)
51;
52for yr=0,dimtime/month_in_year-1 do begin
53;
54tau2(*,*,*,*)=0.0
55chyr=strcompress(1850+yr,/rem)
56print,'year=',chyr
57;
58for k=0, dimz-1 do begin
59for kori=0, dimzori-1 do begin
60;print, 'k=',k,' kori=',kori
61;
62;fraction de la maille kori qui se trouve dans la maille k
63frac= max([0.0,min([zzi(k+1),zziori(kori+1)])-max([zzi(k),zziori(kori)])])/(zziori(kori+1)-zziori(kori))
64;
65;regridding
66for i=0,dimlon-1  do begin
67for j=0,dimlat-1  do begin
68for l=0,month_in_year-1 do begin
69  tau2(i,j,k,l)=tau2(i,j,k,l)+tau(i,j,kori,yr*month_in_year+l)*frac
70endfor
71endfor
72endfor
73;
74endfor
75endfor
76;
77;saving netcdf file
78;
79taustruct={lon:fltarr(dimlon),lat:fltarr(dimlat), $
80     lev:fltarr(dimz),time:fltarr(month_in_year), $
81     taustrat:fltarr(dimlon,dimlat,dimz,month_in_year) }
82;
83taustruct.lon=lon
84taustruct.lat=lat
85taustruct.lev=lev
86taustruct.time=float(indgen(month_in_year)+1)
87taustruct.taustrat=tau2
88;
89attributes = {units:strarr(5),long_name:strarr(5)}
90attributes.units = ['degrees_east','degrees_north','level','month','taustrat']
91attributes.long_name = ['longitude','latitude','level', 'time', 'TAUSTRAT']
92;
93dimensions = {isdim:intarr(5), links:intarr(4,5)}
94       dimensions.isdim =  [1,1,1,1,0]  ; (1=dimension, 0=variable)
95       dimensions.links = [ [-1,-1,-1,-1],[-1,-1,-1,-1], $
96                            [-1,-1,-1,-1],[-1,-1,-1,-1], $
97                            [0,1,2,3]    ]
98;
99netcdfwrite,'/tmp15/obolmd/STRAT/OUTPUT_${RES}/taustrat.'+chyr+'.nc',taustruct,clobber=1, $
100            attributes=attributes, dimensions=dimensions
101;
102endfor
103;
104end
105eod
106#
107#--calling IDL
108#
109/opt/idl-6.4/idl/bin/idl << eod
110.r netcdf
111.r regrid
112regrid
113exit
114eod
115#
116#
117rm -f tmp0.nc tmp1.nc regrid.pro
Note: See TracBrowser for help on using the repository browser.