source: trunk/mesoscale/LMD_MM_MARS/SRC/PREP_MARS/smoothoxf.pro @ 87

Last change on this file since 87 was 11, checked in by aslmd, 14 years ago

spiga@svn-planeto:ajoute le modele meso-echelle martien

File size: 2.5 KB
Line 
1pro smoothoxf
2
3;------------------------------------
4file='input_totoptdep.nc'
5smoothampl=4
6;------------------------------------
7
8cdfid = ncdf_open(file)
9;
10; coordinates
11;
12varid=ncdf_varid(cdfid,'lat')       & ncdf_varget, cdfid, varid, lati  & lat=n_elements(lati)
13varid=ncdf_varid(cdfid,'lon')       & ncdf_varget, cdfid, varid, longi & lon=n_elements(longi)
14varid=ncdf_varid(cdfid,'time')      & ncdf_varget, cdfid, varid, time  & ntime=n_elements(time)
15;
16; field
17;
18varid=ncdf_varid(cdfid,'totoptdep') & ncdf_varget, cdfid, varid, totoptdep
19help, totoptdep
20totoptdep=smooth(totoptdep,[smoothampl,smoothampl,0],/EDGE_TRUNCATE) ;; SMOOTH wrt SPACE
21fieldname='totoptdep'
22outfieldstring='Total dust  optical depth (tauref/700Pa)'
23unit='Opacity/Pa'
24
25goto, nointerp
26;;;*********************************************************************
27;
28; INTERPOLATE wrt TIME
29;
30which_utc_is_TES=3
31;; for Hellas 8AM is 02PM LT, i.e. TES measurements
32;; IDL convention, starts 0 !!!!
33nday=floor(float(ntime-1)/12.)-1 & ref=fltarr(nday) & subsarr=fltarr(nday)
34for 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
45endfor
46;;;*********************************************************************
47nointerp:
48
49
50;--------------------------------
51print,'writing netcdf file'
52
53filencdf='input_totoptdep_tot.nc' & cdfid=ncdf_create(filencdf,/clobber)
54;;
55londimid=ncdf_dimdef(cdfid,'lon',lon) & latdimid=ncdf_dimdef(cdfid,'lat',lat) & tdimid=ncdf_dimdef(cdfid,'time',ntime)
56;;
57lonid=ncdf_vardef(cdfid,'lon',[londimid],/float) & ncdf_attput,cdfid,lonid,'long_name','longitude'   & ncdf_attput,cdfid,lonid,'units','degrees_east'
58;;
59latid=ncdf_vardef(cdfid,'lat',[latdimid],/float) & ncdf_attput,cdfid,latid,'long_name','latitude'    & ncdf_attput,cdfid,latid,'units','degrees_north'
60;;
61timeid=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;;
63varid=ncdf_vardef(cdfid,fieldname,[londimid,latdimid,tdimid],/float)
64ncdf_attput,cdfid,varid,'Physics_diagnostic',outfieldstring
65ncdf_attput,cdfid,varid,'units',unit
66;;
67ncdf_control,cdfid,/endef
68;;
69ncdf_varput,cdfid,lonid,longi & ncdf_varput,cdfid,latid,lati & ncdf_varput,cdfid,timeid,time & ncdf_varput,cdfid,varid,totoptdep
70;;
71ncdf_close,cdfid
72
73end
Note: See TracBrowser for help on using the repository browser.