;+ ; ; .. _t2m_correction_ncdf.pro: ; ; ======================= ; t2m_correction_ncdf.pro ; ======================= ; ; SEE ALSO ; ======== ; ; EXAMPLES ; ======== ; ; :: ; ; IDL> t2m_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 t2m_correction_ncdf @common da1=19890101 & da2=20091231 file='/Volumes/Iomega_HDD/TropFlux/input_uncor/erai_t2m_19890101_20091231_oafluxgrid.nc' initncdf, file t2m=read_ncdf('t2m',da1,da2,file=file,/nostr) & t2m=t2m-273.15 help, t2m t2m_mean=grossemoyenne(t2m,'t',/nan) help, w_mean tt=time & jpt=n_elements(time) caldat, time,mon,day,yea t2m_m=t2m*0. bias_cor=t2m*0. ;; line fit -> -0.0755589x + 1.71090 ;; (2000-2008) ;; line fit -> -0.0741607x + 1.67601 ;; (2000-2009) for jt=0,jpt-1 do begin jtt=(time(jt)-julday(1,1,yea(jt))) < 364 t=reform(t2m_mean(*,*)) t2m_m(*,*,jt)=t bias_cor(*,*,jt)=(((t-22.6)*0.4004896/(28-22.6)) > 0.) <0.4 ;; (2000-2009) endfor help, t2m_m,bias_cor t2m_ano=t2m-t2m_m ;; correction for mean based on scatter help, t2m_ano ;; applying the correction for varyability based on the scatter ;t2m_ano=t2m_ano*(1/0.916484) ;; (2000-2008) t2m_ano=t2m_ano*(1/0.918085) ;; (2000-2009) ;; applying the correction for varyability based on the scatter t2m_m=t2m_m+bias_cor t2m_new=t2m_m+t2m_ano+273.15 help, t2m_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/Iomega_HDD/TropFlux/input_cor/full_cor/TropFlux_t2m_19890101_20091231_v20.nc' ncfile='!/Users/pkb/data/TropFlux/TropFlux_t2m_19890101_20091231_v50.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'} t2m_attr={units:'degK',missing_value:1.e20,long_name:'Air Temperature at 2m',short_name:'t2m',axis:'TYX'} globattr={source:'Basic data obtained from ERAI. Mean correction for air temperautre bias and correction for variability are applied',timerange:cda0+' - '+cda1} ncfields = 't2m[longitude,latitude,time]=t2m_new:t2m_attr; ' $ + 'longitude[]=lon:lon_attr; ' $ + 'latitude[]=lat:lat_attr; ' $ + 'time[*time]=time:time_attr ' $ + ' @ globattr' @ncdf_quickwrite end