[6] | 1 | ;+ |
---|
| 2 | ; |
---|
[8] | 3 | ; .. _TropFlux_swr_NRT_19890101_20091231.pro: |
---|
[6] | 4 | ; |
---|
| 5 | ; ====================================== |
---|
| 6 | ; TropFlux_swr_NRT_19890101_20091231.pro |
---|
| 7 | ; ====================================== |
---|
| 8 | ; |
---|
| 9 | ; |
---|
[8] | 10 | ; .. graphviz:: |
---|
| 11 | ; |
---|
| 12 | ; digraph TropFlux_swr_NRT_19890101_200912311 { |
---|
| 13 | ; graph [ |
---|
| 14 | ; rankdir="LR", |
---|
| 15 | ; ] |
---|
| 16 | ; file_sw [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20071231_DT_v50.nc"]; |
---|
| 17 | ; file_olr [shape=ellipse,fontname=Courier,label="/Users/pkb/data/heat_budget/NOAA_OLR/olr_oafluxgrid_30n30s_19890101_20091231.nc"]; |
---|
| 18 | ; ncfile [shape=ellipse,fontname=Courier,label="/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20091231_NRT_v50.nc"]; |
---|
| 19 | ; TropFlux_swr_NRT_19890101_200912311 [shape=box, |
---|
| 20 | ; fontname=Courier, |
---|
| 21 | ; color=blue, |
---|
| 22 | ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/TropFlux_swr_NRT_19890101_200912311.pro", |
---|
| 23 | ; label="${TROPFLUX}/src/TropFlux_swr_NRT_19890101_200912311.pro"]; |
---|
| 24 | ; {file_sw file_olr}-> {TropFlux_swr_NRT_19890101_200912311} -> {ncfile} |
---|
| 25 | ; } |
---|
| 26 | ; |
---|
[6] | 27 | ; SEE ALSO |
---|
| 28 | ; ======== |
---|
| 29 | ; |
---|
| 30 | ; EXAMPLES |
---|
| 31 | ; ======== |
---|
| 32 | ; |
---|
| 33 | ; :: |
---|
| 34 | ; |
---|
| 35 | ; IDL> tropflux_swr_nrt_19890101_20091231 |
---|
| 36 | ; |
---|
| 37 | ; TODO |
---|
| 38 | ; ==== |
---|
| 39 | ; |
---|
| 40 | ; hard coded directory - usage of ${TROPFLUX_ID} |
---|
| 41 | ; |
---|
| 42 | ; coding rules |
---|
| 43 | ; |
---|
| 44 | ; EVOLUTIONS |
---|
| 45 | ; ========== |
---|
| 46 | ; |
---|
[8] | 47 | ; - fplod 20101215T092145Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 48 | ; |
---|
| 49 | ; * add graph in header |
---|
| 50 | ; |
---|
[6] | 51 | ; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 52 | ; |
---|
| 53 | ; * minimal header |
---|
| 54 | ; |
---|
| 55 | ; - pbk 2008 |
---|
| 56 | ; |
---|
| 57 | ; * creation |
---|
| 58 | ; |
---|
| 59 | ;- |
---|
[5] | 60 | pro TropFlux_swr_NRT_19890101_20091231 |
---|
| 61 | @common |
---|
| 62 | file='/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20071231_DT_v50.nc' |
---|
| 63 | initncdf, file |
---|
| 64 | sw=read_ncdf("swr", 19890101, 20071231, file=file,/nostr) |
---|
| 65 | |
---|
| 66 | swi=sw |
---|
| 67 | file_olr='/Users/pkb/data/heat_budget/NOAA_OLR/olr_oafluxgrid_30n30s_19890101_20091231.nc' |
---|
| 68 | |
---|
| 69 | initncdf,file_olr |
---|
| 70 | olr=read_ncdf('olr',19890100, 20071231,file=file_olr,/nost) |
---|
| 71 | |
---|
| 72 | help, sw, olr |
---|
| 73 | |
---|
| 74 | ;;creating climatology |
---|
| 75 | |
---|
| 76 | ny=(2007-1989)+1 |
---|
| 77 | nt=365*ny |
---|
| 78 | olri=total(reform(olr(*,*,0:nt-1),nxt,nyt,365,ny),4)/ny |
---|
| 79 | swi=total(reform(swi(*,*,0:nt-1),nxt,nyt,365,ny),4)/ny |
---|
| 80 | |
---|
| 81 | help, olri, swi |
---|
| 82 | |
---|
| 83 | ;; applying smoothing |
---|
| 84 | nsmooth=45 |
---|
| 85 | |
---|
| 86 | swi=[[[swi]],[[swi]],[[swi]]] & olri=[[[olri]],[[olri]],[[olri]]] |
---|
| 87 | si=size(sw) & n1=si(1) & n2=si(2) |
---|
| 88 | |
---|
| 89 | for j=0,n2-1 do begin |
---|
| 90 | for i=0,n1-1 do begin |
---|
| 91 | x=reform(swi(i,j,*)) |
---|
| 92 | y=reform(olri(i,j,*)) |
---|
| 93 | swi(i,j,*)=smooth(x,nsmooth) |
---|
| 94 | olri(i,j,*)=smooth(y,nsmooth) |
---|
| 95 | endfor |
---|
| 96 | endfor |
---|
| 97 | |
---|
| 98 | swi=swi[*,*,365:365+364] & olri=olri[*,*,365:365+364] |
---|
| 99 | help, swi |
---|
| 100 | |
---|
| 101 | initncdf, file_olr |
---|
| 102 | olr=read_ncdf('olr', 19890100, 20091231, box=box, file=file_olr,/nostr) |
---|
| 103 | tt=time & jpt=n_elements(time) |
---|
| 104 | caldat, time,mon,day,yea |
---|
| 105 | swm=olr*0. & olrm=olr*0. |
---|
| 106 | for jt=0,jpt-1 do begin |
---|
| 107 | jtt=(time(jt)-julday(1,1,yea(jt))) < 364 |
---|
| 108 | swm(*,*,jt)=swi(*,*,jtt) |
---|
| 109 | olrm(*,*,jt)=olri(*,*,jtt) |
---|
| 110 | endfor |
---|
| 111 | |
---|
| 112 | help, swm, olrm |
---|
| 113 | |
---|
| 114 | olra=olr-olrm ; olr anomaly |
---|
| 115 | rec=swm+(olra/0.760364) ; reconstructed sw |
---|
| 116 | ;writing field |
---|
| 117 | time=julday(1,1,1989)+lindgen(7670) |
---|
| 118 | cda0=string(jul2date(tt(0)),format='(i8.8)') |
---|
| 119 | cda1=string(jul2date(tt(jpt-1)),format='(i8.8)') |
---|
| 120 | |
---|
| 121 | lat=reform(gphit(0,0:jpj-1)) |
---|
| 122 | lon=reform(glamt(0:jpi-1,0)) |
---|
| 123 | time=time-julday(1,1,1950) & jpt=n_elements(time) |
---|
| 124 | |
---|
| 125 | ncfile='!/Users/pkb/data/TropFlux/TropFlux_swr_19890101_20091231_NRT_v50.nc' |
---|
| 126 | lon_attr={units:'degrees_east',long_name:'Longitude'} |
---|
| 127 | lat_attr={units:'degrees_north',long_name:'Latitude'} |
---|
| 128 | time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:''} |
---|
| 129 | sw_attr={units:'w/m^2',missing_value:1.e20,long_name:'Net Shortwave Radiation',short_name:'swr',axis:'TYX'} |
---|
| 130 | globattr={source:'Reconstructed from corrected OLR anomalies and TropFlux mean SWR climatology',timerange:cda0+' - '+cda1} |
---|
| 131 | |
---|
| 132 | |
---|
| 133 | ncfields = 'sw[longitude,latitude,time]=rec:sw_attr; ' $ |
---|
| 134 | + 'longitude[]=lon:lon_attr; ' $ |
---|
| 135 | + 'latitude[]=lat:lat_attr; ' $ |
---|
| 136 | + 'time[*time]=time:time_attr ' $ |
---|
| 137 | + ' @ globattr' |
---|
| 138 | |
---|
| 139 | @ncdf_quickwrite |
---|
| 140 | |
---|
| 141 | end |
---|