;+ ; ; .. _q2m_correction_ncdf.pro: ; ; ======================= ; q2m_correction_ncdf.pro ; ======================= ; ; SEE ALSO ; ======== ; ; EXAMPLES ; ======== ; ; :: ; ; IDL> q2m_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 q2m_correction_ncdf @common ;---------------------------------------------------------------------- da1=19880101 & da2=20101231 file='/Volumes/PRAVEEN/TropFlux/input_uncor/erai_q2m_19890101_20091231_oafluxgrid.nc' initncdf, file q2m=read_ncdf('q2m',da1,da2,file=file,/nostr) help, q2m q2m_mean=grossemoyenne(q2m,'t',/nan) help, q2m_mean ;---------------------------------------------------------------------- tt=time & jpt=n_elements(time) caldat, time,mon,day,yea q2m_m=q2m*0. for jt=0,jpt-1 do begin jtt=(time(jt)-julday(1,1,yea(jt))) < 364 q=reform(q2m_mean(*,*)) q2m_m(*,*,jt)=q endfor help, q2m_m q2m_ano=q2m-q2m_m ;; correction for mean based on scatter ;q2m_m=q2m_m+0.815445 ;; (2000-2008) q2m_m=q2m_m+0.792717 ;; (2000-2009) help, q2m_ano ;; applying the correction for varyability based on the scatter ;q2m_ano=q2m_ano*(1/0.919333) ;; (2000-2008) q2m_ano=q2m_ano*(1/0.924674) ;; (2000-2009) q2m_new=q2m_m+q2m_ano help, q2m_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,0)) & 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_q2m_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'} q2m_attr={units:'g/kg',missing_value:1.e20,long_name:'Specific humidity at 2m height',short_name:'q2m',axis:'TYX'} globattr={source:'Basic data obtained from ERAI. Mean correction for bias and correction for variability are applied',timerange:cda0+' - '+cda1} ncfields = 'q2m[longitude,latitude,time]=q2m_new:q2m_attr; ' $ + 'longitude[]=lon:lon_attr; ' $ + 'latitude[]=lat:lat_attr; ' $ + 'time[*time]=time:time_attr ' $ + ' @ globattr' @ncdf_quickwrite end