;+ ; ; .. _TropFlux_swr_NRT_19890101_20091231.pro: ; ; ====================================== ; TropFlux_swr_NRT_19890101_20091231.pro ; ====================================== ; ; ; .. graphviz:: ; ; digraph tropflux_swr_nrt_19890101_200912311 { ; graph [ ; rankdir="LR", ; ] ; file_sw [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20071231_DT_v50.nc"]; ; file_olr [shape=ellipse,fontname=Courier,label="/Users/pkb/data/heat_budget/NOAA_OLR/olr_oafluxgrid_30n30s_19890101_20091231.nc"]; ; ncfile [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20091231_NRT_v50.nc"]; ; ; tropflux_swr_nrt_19890101_200912311 [shape=box, ; fontname=Courier, ; color=blue, ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/TropFlux_swr_NRT_19890101_200912311.pro", ; label="${PROJECT}/src/TropFlux_swr_NRT_19890101_200912311.pro"]; ; ; {file_sw file_olr}-> {tropflux_swr_nrt_19890101_200912311} -> {ncfile} ; } ; ; SEE ALSO ; ======== ; ; :func:`initncdf ` ; :func:`read_ncdf ` ; :func:`julday ` ; :func:`ncdf_quickwrite ` ; ; EXAMPLES ; ======== ; ; :: ; ; IDL> tropflux_swr_nrt_19890101_20091231 ; ; TODO ; ==== ; ; hard coded directory - usage of ${PROJECT_ID} ; ; coding rules ; ; change the name to swr_nrt_correction_ncdf.pro ; ; EVOLUTIONS ; ========== ; ; - fplod 20101215T092145Z aedon.locean-ipsl.upmc.fr (Darwin) ; ; * add graph in header ; ; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin) ; ; * minimal header ; ; - pbk 2008 ; ; * creation ; ;- pro TropFlux_swr_NRT_19890101_20091231 @common file='/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20071231_DT_v50.nc' initncdf, file sw=read_ncdf("swr", 19890101, 20071231, file=file,/nostr) swi=sw file_olr='/Users/pkb/data/heat_budget/NOAA_OLR/olr_oafluxgrid_30n30s_19890101_20091231.nc' initncdf,file_olr olr=read_ncdf('olr',19890100, 20071231,file=file_olr,/nost) help, sw, olr ;;creating climatology ny=(2007-1989)+1 nt=365*ny olri=total(reform(olr(*,*,0:nt-1),nxt,nyt,365,ny),4)/ny swi=total(reform(swi(*,*,0:nt-1),nxt,nyt,365,ny),4)/ny help, olri, swi ;; applying smoothing nsmooth=45 swi=[[[swi]],[[swi]],[[swi]]] & olri=[[[olri]],[[olri]],[[olri]]] si=size(sw) & n1=si(1) & n2=si(2) for j=0,n2-1 do begin for i=0,n1-1 do begin x=reform(swi(i,j,*)) y=reform(olri(i,j,*)) swi(i,j,*)=smooth(x,nsmooth) olri(i,j,*)=smooth(y,nsmooth) endfor endfor swi=swi[*,*,365:365+364] & olri=olri[*,*,365:365+364] help, swi initncdf, file_olr olr=read_ncdf('olr', 19890100, 20091231, box=box, file=file_olr,/nostr) tt=time & jpt=n_elements(time) caldat, time,mon,day,yea swm=olr*0. & olrm=olr*0. for jt=0,jpt-1 do begin jtt=(time(jt)-julday(1,1,yea(jt))) < 364 swm(*,*,jt)=swi(*,*,jtt) olrm(*,*,jt)=olri(*,*,jtt) endfor help, swm, olrm olra=olr-olrm ; olr anomaly rec=swm+(olra/0.760364) ; reconstructed sw ;writing field time=julday(1,1,1989)+lindgen(7670) cda0=string(jul2date(tt(0)),format='(i8.8)') cda1=string(jul2date(tt(jpt-1)),format='(i8.8)') lat=reform(gphit(0,0:jpj-1)) lon=reform(glamt(0:jpi-1,0)) time=time-julday(1,1,1950) & jpt=n_elements(time) ncfile='!/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20091231_NRT_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:''} sw_attr={units:'w/m^2',missing_value:1.e20,long_name:'Net Shortwave Radiation',short_name:'swr',axis:'TYX'} globattr={source:'Reconstructed from corrected OLR anomalies and TropFlux mean SWR climatology',timerange:cda0+' - '+cda1} ncfields = 'sw[longitude,latitude,time]=rec:sw_attr; ' $ + 'longitude[]=lon:lon_attr; ' $ + 'latitude[]=lat:lat_attr; ' $ + 'time[*time]=time:time_attr ' $ + ' @ globattr' @ncdf_quickwrite end