[6] | 1 | ;+ |
---|
| 2 | ; |
---|
| 3 | ; .. interp_erai_lwr_1989_2009.pro: |
---|
| 4 | ; |
---|
| 5 | ; ============================= |
---|
| 6 | ; interp_erai_lwr_1989_2009.pro |
---|
| 7 | ; ============================= |
---|
| 8 | ; |
---|
[8] | 9 | ; .. graphviz:: |
---|
| 10 | ; |
---|
| 11 | ; digraph interp_erai_lwr_1989_2009 { |
---|
| 12 | ; graph [ |
---|
| 13 | ; rankdir="LR", |
---|
| 14 | ; ] |
---|
| 15 | ; mask [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/work/flux_reconstruction/gridded_data/mask_oaflux_30N30S.nc"]; |
---|
| 16 | ; |
---|
| 17 | ; file_in [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/ERAI_global/20c3m_erai_str_TROP_1989_2009.nc"]; |
---|
| 18 | ; |
---|
| 19 | ; ncfile [shape=ellipse,fontname=Courier,label="/Volumes/PRAVEEN/TropFlux/input_uncor/erai_lwr_19890102_20091231_oafluxgrid.nc"]; |
---|
| 20 | ; |
---|
| 21 | ; interp_erai_lwr_1989_2009 [shape=box, |
---|
| 22 | ; fontname=Courier, |
---|
| 23 | ; color=blue, |
---|
| 24 | ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/interp_erai_lwr_1989_2009.pro", |
---|
| 25 | ; label="${TROPFLUX}/src/interp_erai_lwr_1989_2009.pro"]; |
---|
| 26 | ; |
---|
| 27 | ; {mask file_in} -> {interp_erai_lwr_1989_2009} -> {ncfile} |
---|
| 28 | ; |
---|
| 29 | ; } |
---|
| 30 | ; |
---|
[6] | 31 | ; SEE ALSO |
---|
| 32 | ; ======== |
---|
| 33 | ; |
---|
| 34 | ; EXAMPLES |
---|
| 35 | ; ======== |
---|
| 36 | ; |
---|
| 37 | ; :: |
---|
| 38 | ; |
---|
| 39 | ; IDL> interp_erai_lwr_1989_2009 |
---|
| 40 | ; |
---|
| 41 | ; TODO |
---|
| 42 | ; ==== |
---|
| 43 | ; |
---|
| 44 | ; hard coded directory - usage of ${TROPFLUX_ID} |
---|
| 45 | ; |
---|
| 46 | ; coding rules |
---|
| 47 | ; |
---|
| 48 | ; EVOLUTIONS |
---|
| 49 | ; ========== |
---|
| 50 | ; |
---|
[8] | 51 | ; - fplod 20101215T094137Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 52 | ; |
---|
| 53 | ; * add graph in header |
---|
| 54 | ; |
---|
[6] | 55 | ; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 56 | ; |
---|
| 57 | ; * minimal header |
---|
| 58 | ; |
---|
| 59 | ; - pbk 2008 |
---|
| 60 | ; |
---|
| 61 | ; * creation |
---|
| 62 | ; |
---|
| 63 | ;- |
---|
[5] | 64 | pro interp_erai_lwr_1989_2009 |
---|
| 65 | @common |
---|
| 66 | |
---|
| 67 | st=19890101 & en=20090801 |
---|
| 68 | |
---|
| 69 | filein='/Volumes/PRAVEEN/ERAI_global/20c3m_erai_str_TROP_1989_2009.nc' |
---|
| 70 | initncdf, filein |
---|
| 71 | lwrin=read_ncdf("str",0,7668,/timestep,file=filein,/nostr) |
---|
| 72 | lwrin=-1*lwrin |
---|
| 73 | help, lwrin |
---|
| 74 | |
---|
| 75 | gridout='/Volumes/PRAVEEN/work/flux_reconstruction/gridded_data/mask_oaflux_30N30S.nc' |
---|
| 76 | |
---|
| 77 | initncdf, filein |
---|
| 78 | domdef |
---|
| 79 | latin=reform(gphit(0,*)) & lonin=reform(glamt(*,0)) |
---|
| 80 | print, 'lat grid ',min(latin),max(latin),latin(1)-latin(0) |
---|
| 81 | print, 'lon grid ',min(lonin),max(lonin),lonin(1)-lonin(0) |
---|
| 82 | |
---|
| 83 | timein=time & jptin=jpt |
---|
| 84 | tab=lwrin(*,*,0) |
---|
| 85 | mskin=glamt*0.+1. |
---|
| 86 | |
---|
| 87 | initncdf, gridout |
---|
| 88 | domdef |
---|
| 89 | latout=reform(gphit(0,*)) & lonout=reform(glamt(*,0)) |
---|
| 90 | print, 'lat grid ',min(latout),max(latout),latout(1)-latout(0) |
---|
| 91 | print, 'lon grid ',min(lonout),max(lonout),lonout(1)-lonout(0) |
---|
| 92 | mskout=read_ncdf("msk", file=gridout,/nostr) |
---|
| 93 | |
---|
| 94 | help, lwrin |
---|
| 95 | |
---|
| 96 | si=size(swrin) |
---|
| 97 | lwrout=fltarr(jpi,jpj,jptin) |
---|
| 98 | |
---|
| 99 | for jt=0,jptin-1 do begin |
---|
| 100 | print, 'Interpolation jt=',jt,' / ',jptin-1 |
---|
| 101 | |
---|
| 102 | tab=reform(lwrin(*,*,jt)) |
---|
| 103 | lwrout(*,*,jt)=call_interp2d(tab,lonin,latin,mskin,lonout,latout,method='bilinear') |
---|
| 104 | lwrout(*,*,jt)=lwrout(*,*,jt)*mskout+(1.-mskout)*1.e20 |
---|
| 105 | |
---|
| 106 | endfor |
---|
| 107 | |
---|
| 108 | time=timegen(7669, start=julday(1,2,1989,0), units='days') & jpt=n_elements(time) |
---|
| 109 | tt=time & jptin=jpt |
---|
| 110 | cda0=string(jul2date(tt(0)),format='(i8.8)') |
---|
| 111 | cda1=string(jul2date(tt(jpt-1)),format='(i8.8)') |
---|
| 112 | tt=tt-julday(1,1,1950,00,00,00) |
---|
| 113 | xlon=reform(glamt(*,0) ) & ylat=reform(gphit(0,*)) |
---|
| 114 | |
---|
| 115 | initncdf, gridout |
---|
| 116 | valmask=1.e20 |
---|
| 117 | |
---|
| 118 | ylat=latout |
---|
| 119 | xlon=lonout |
---|
| 120 | ncfile='!/Volumes/PRAVEEN/TropFlux/input_uncor/erai_lwr_19890102_20091231_oafluxgrid.nc' |
---|
| 121 | |
---|
| 122 | lon_attr={units:'degrees_east',long_name:'Longitude'} |
---|
| 123 | lat_attr={units:'degrees_north',long_name:'Latitude'} |
---|
| 124 | time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'} |
---|
| 125 | |
---|
| 126 | lwr_attr={units:'W/m2',missing_value:valmask,long_name:'Surface net longwave radiation ',short_name:'lwr',axis:'TYX'} |
---|
| 127 | time_attr={units:'days since 1950-01-01 00:00:00',long_name:'Time axis',time_origin:' 1950-JAN-01 00:00:00'} |
---|
| 128 | globattr={source:'Tropical ocean fluxes obtained from ERA Interim',timerange:cda0+' - '+cda1} |
---|
| 129 | |
---|
| 130 | help,lwrout |
---|
| 131 | |
---|
| 132 | ncfields = 'lwr[longitude,latitude,time]=lwrout:lwr_attr; ' $ |
---|
| 133 | + 'longitude[]=xlon:lon_attr; ' $ |
---|
| 134 | + 'latitude[]=ylat:lat_attr; ' $ |
---|
| 135 | + 'tt[*time]=tt:time_attr ' $ |
---|
| 136 | + ' @ globattr' |
---|
| 137 | |
---|
| 138 | @ncdf_quickwrite |
---|
| 139 | |
---|
| 140 | return |
---|
| 141 | end |
---|