source: BOL/SATO/regrid_strat_aerosol.sh @ 5226

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