1 | pro smoothoxf |
---|
2 | |
---|
3 | ;------------------------------------ |
---|
4 | file='input_totoptdep.nc' |
---|
5 | smoothampl=4 |
---|
6 | ;------------------------------------ |
---|
7 | |
---|
8 | cdfid = ncdf_open(file) |
---|
9 | ; |
---|
10 | ; coordinates |
---|
11 | ; |
---|
12 | varid=ncdf_varid(cdfid,'lat') & ncdf_varget, cdfid, varid, lati & lat=n_elements(lati) |
---|
13 | varid=ncdf_varid(cdfid,'lon') & ncdf_varget, cdfid, varid, longi & lon=n_elements(longi) |
---|
14 | varid=ncdf_varid(cdfid,'time') & ncdf_varget, cdfid, varid, time & ntime=n_elements(time) |
---|
15 | ; |
---|
16 | ; field |
---|
17 | ; |
---|
18 | varid=ncdf_varid(cdfid,'totoptdep') & ncdf_varget, cdfid, varid, totoptdep |
---|
19 | help, totoptdep |
---|
20 | totoptdep=smooth(totoptdep,[smoothampl,smoothampl,0],/EDGE_TRUNCATE) ;; SMOOTH wrt SPACE |
---|
21 | fieldname='totoptdep' |
---|
22 | outfieldstring='Total dust optical depth (tauref/700Pa)' |
---|
23 | unit='Opacity/Pa' |
---|
24 | |
---|
25 | goto, nointerp |
---|
26 | ;;;********************************************************************* |
---|
27 | ; |
---|
28 | ; INTERPOLATE wrt TIME |
---|
29 | ; |
---|
30 | which_utc_is_TES=3 |
---|
31 | ;; for Hellas 8AM is 02PM LT, i.e. TES measurements |
---|
32 | ;; IDL convention, starts 0 !!!! |
---|
33 | nday=floor(float(ntime-1)/12.)-1 & ref=fltarr(nday) & subsarr=fltarr(nday) |
---|
34 | for i=0, n_elements(totoptdep(*,0,0))-1 do begin |
---|
35 | for j=0, n_elements(totoptdep(0,*,0))-1 do begin |
---|
36 | for each=0,nday-1 do begin |
---|
37 | subs=each*12 + which_utc_is_TES |
---|
38 | ref(each)=totoptdep(i,j,subs) |
---|
39 | subsarr(each)=subs |
---|
40 | endfor |
---|
41 | ;;yeah=interpol(ref,subsarr,findgen(ntime), /spline) |
---|
42 | yeah=interpol(ref,subsarr,findgen(ntime) ) |
---|
43 | totoptdep(i,j,*)=yeah |
---|
44 | endfor |
---|
45 | endfor |
---|
46 | ;;;********************************************************************* |
---|
47 | nointerp: |
---|
48 | |
---|
49 | |
---|
50 | ;-------------------------------- |
---|
51 | print,'writing netcdf file' |
---|
52 | |
---|
53 | filencdf='input_totoptdep_tot.nc' & cdfid=ncdf_create(filencdf,/clobber) |
---|
54 | ;; |
---|
55 | londimid=ncdf_dimdef(cdfid,'lon',lon) & latdimid=ncdf_dimdef(cdfid,'lat',lat) & tdimid=ncdf_dimdef(cdfid,'time',ntime) |
---|
56 | ;; |
---|
57 | lonid=ncdf_vardef(cdfid,'lon',[londimid],/float) & ncdf_attput,cdfid,lonid,'long_name','longitude' & ncdf_attput,cdfid,lonid,'units','degrees_east' |
---|
58 | ;; |
---|
59 | latid=ncdf_vardef(cdfid,'lat',[latdimid],/float) & ncdf_attput,cdfid,latid,'long_name','latitude' & ncdf_attput,cdfid,latid,'units','degrees_north' |
---|
60 | ;; |
---|
61 | timeid=ncdf_vardef(cdfid,'time',[tdimid],/float) & ncdf_attput,cdfid,timeid,'long_name','model time' & ncdf_attput,cdfid,timeid,'units','hours since 00:00:00' |
---|
62 | ;; |
---|
63 | varid=ncdf_vardef(cdfid,fieldname,[londimid,latdimid,tdimid],/float) |
---|
64 | ncdf_attput,cdfid,varid,'Physics_diagnostic',outfieldstring |
---|
65 | ncdf_attput,cdfid,varid,'units',unit |
---|
66 | ;; |
---|
67 | ncdf_control,cdfid,/endef |
---|
68 | ;; |
---|
69 | ncdf_varput,cdfid,lonid,longi & ncdf_varput,cdfid,latid,lati & ncdf_varput,cdfid,timeid,time & ncdf_varput,cdfid,varid,totoptdep |
---|
70 | ;; |
---|
71 | ncdf_close,cdfid |
---|
72 | |
---|
73 | end |
---|