;+ ; ; .. _TropFlux_NRT_ncdf.pro: ; ; ===================== ; TropFlux_NRT_ncdf.pro ; ===================== ; ; .. graphviz:: ; ; digraph tropflux_nrt_ncdf { ; graph [ ; rankdir="LR", ; ] ; file1 [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20091231_BLND.nc"]; ; file2 [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_lwr_19890101_20091231_v50.nc"]; ; file3 [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_19890101_20091231_v51.nc"]; ; ncfile [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_19890101_20091231.nc"]; ; ; tropflux_nrt_ncdf [shape=box, ; fontname=Courier, ; color=blue, ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/TropFlux_NRT_ncdf.pro", ; label="${PROJECT}/src/TropFlux_NRT_ncdf.pro" ]; ; ; {file1 file2 file3} -> {tropflux_nrt_ncdf} -> {ncfile} ; } ; ; SEE ALSO ; ======== ; ; :func:`initncdf ` ; :func:`read_ncdf ` ; :func:`julday ` ; :func:`jul2date ` ; :func:`ncdf_quickwrite ` ; ; EXAMPLES ; ======== ; ; :: ; ; IDL> tropflux_nrt_ncdf ; ; TODO ; ==== ; ; hard coded directory - usage of ${PROJECT_ID} ; ; coding rules ; ; create 4 files instead of one now ; ; EVOLUTIONS ; ========== ; ; $Id$ ; ; $URL$ ; ; - fplod 20110809T133815Z cratos (Linux) ; ; * remove v50 from pro name and in the graph ; ; - fplod 20101214T112526Z aedon.locean-ipsl.upmc.fr (Darwin) ; ; * add graph ; ; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin) ; ; * minimal header ; ; - pbk 2008 ; ; * creation ; ;- pro TropFlux_NRT_ncdf @common dir="/Users/pkb/data/TropFlux/" file=dir+"TropFlux_swr_19890101_20091231_BLND.nc" initncdf, file st=19800101 & en=20101231 swr=read_ncdf("swr", st, en, file=file,/nostr) file=dir+"TropFlux_lwr_19890101_20091231_v50.nc" initncdf, file lwr=read_ncdf("lwr", st, en, file=file,/nostr) file=dir+"TropFlux_19890101_20091231_v51.nc" initncdf, file lhf=read_ncdf("lhf", st, en, file=file,/nostr) shf=read_ncdf("shf", st, en, file=file,/nostr) help, swr, lwr, lhf, shf ;time=julday(1,1,1989)+lindgen(7670)+0.5 & jpt=n_elements(time) 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,00,00) ; lat=reform(gphit(0,0:jpj-1)) lon=reform(glamt(0:jpi-1,0)) ncfile='!/Users/pkb/data/TropFlux/TropFlux_19890101_20091231.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'} sw_attr={units:'w/m^2',missing_value:1.e20,long_name:'Net Shortwave Radiation',short_name:'swr',axis:'TYX'} lw_attr={units:'w/m^2',missing_value:1.e20,long_name:'Net Longwave Radiation',short_name:'lwr',axis:'TYX'} sh_attr={units:'w/m^2',missing_value:1.e20,long_name:'Sensible Heat Flux',short_name:'shf',axis:'TYX'} lh_attr={units:'w/m^2',missing_value:1.e20,long_name:'Latent Heat Flux',short_name:'lhf',axis:'TYX'} globattr={Source:'TropFlux - Air-Sea Fluxes for the Global Tropics', Resolution:'1 x 1 degree and daily', IDL_program_name:'TropFlux_ncdf.pro',Timerange:cda0+' - '+cda1, More_Info:'ISCCP based SWR until 2007 and OLR based SWR after that with a 90 day linear transition between the two'} ncfields = 'swr[longitude,latitude,time]=swr:sw_attr; ' $ +'lwr[longitude,latitude,time]=lwr:lw_attr; ' $ +'lhf[longitude,latitude,time]=lhf:lh_attr; ' $ +'shf[longitude,latitude,time]=shf:sh_attr; ' $ + 'longitude[]=lon:lon_attr; ' $ + 'latitude[]=lat:lat_attr; ' $ + 'time[*time]=time:time_attr ' $ + ' @ globattr' @ncdf_quickwrite end