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