;+ ; ; .. sst_correction_ncdf.pro: ; ; ======================= ; sst_correction_ncdf.pro ; ======================= ; ; ; SEE ALSO ; ======== ; ; EXAMPLES ; ======== ; ; :: ; ; IDL> sst_correction_ncdf ; ; TODO ; ==== ; ; hard coded directory - usage of ${TROPFLUX_ID} ; ; coding rules ; ; EVOLUTIONS ; ========== ; ; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin) ; ; * minimal header ; ; - pbk 2008 ; ; * creation ; ;- pro sst_correction_ncdf @common da1=19880101 & da2=20091231 file='/Volumes/PRAVEEN/TropFlux/input_uncor/erai_sst_19890101_20091231_oafluxgrid.nc' initncdf, file sst=read_ncdf('sst',da1,da2,file=file,/nostr) & sst=sst-273.15 help, sst sst_mean=grossemoyenne(sst,'t',/nan) help, sst_mean tt=time & jpt=n_elements(time) caldat, time,mon,day,yea sst_m=sst*0. for jt=0,jpt-1 do begin jtt=(time(jt)-julday(1,1,yea(jt))) < 364 t=reform(sst_mean(*,*)) sst_m(*,*,jt)=t endfor help, sst_m sst_ano=sst-sst_m ;; correction for mean based on scatter ;sst_m=sst_m+0.0521111 ;; (2000-2008) sst_m=sst_m+0.0533692 ;; (2000-2009) help, sst_ano ;; applying the correction for varyability based on the scatter ;sst_ano=sst_ano*(1/0.989889) ;; (2000-2008) sst_ano=sst_ano*(1/0.986196) ;; (2000-2009) sst_new=sst_m+sst_ano+273.15 help, sst_new ;writing field lat=reform(gphit(0,0:jpj-1)) lon=reform(glamt(0:jpi-1,0)) time=timegen(7670, units='days', start=julday(1,1,1989)) & jpt=n_elements(time) cda0=string(jul2date(time(0)),format='(i8.8)') cda1=string(jul2date(time(jpt-1)),format='(i8.8)') time=time-julday(1,1,1950) & jpt=n_elements(time) ncfile='!/Volumes/PRAVEEN/TropFlux/input_cor/full_cor/TropFlux_sst_19890101_20091231_v20.nc' lon_attr={units:'degrees_east',long_name:'Longitude'} lat_attr={units:'degrees_north',long_name:'Latitude'} time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:'1950-JAN-01 00:00:00'} sst_attr={units:'degK',missing_value:1.e20,long_name:'Sea Surface Temperature',short_name:'sst',axis:'TYX'} globattr={source:'Basic data obtained from ERAI. Bias and variability correction are applied',timerange:cda0+' - '+cda1} ncfields = 'sst[longitude,latitude,time]=sst_new:sst_attr; ' $ + 'longitude[]=lon:lon_attr; ' $ + 'latitude[]=lat:lat_attr; ' $ + 'time[*time]=time:time_attr ' $ + ' @ globattr' @ncdf_quickwrite end