- Timestamp:
- 12/23/10 17:23:57 (13 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/compute_erai_daily_region_2d.sh
r25 r26 109 109 # :func:`ncea <nco:ncea>` 110 110 # :func:`ncflint <nco:ncflint>` 111 # 112 # :ref:`interp_erai_dewt_1989_2009.pro` 113 # :ref:`interp_erai_lwr_1989_2009.pro` 114 # :ref:`interp_erai_sst_1989_2009.pro` 115 # :ref:`interp_erai_t2m_1989_2009.pro` 116 # :ref:`interp_erai_ws_1989_2009.pro` 111 117 # 112 118 # TODO -
trunk/src/interp_erai_t2m_1989_2009.pro
r25 r26 3 3 ; .. _interp_erai_t2m_1989_2009.pro: 4 4 ; 5 ; ============================= 6 ; interp_erai_t2m_1989_2009.pro 7 ; ============================= 8 ; 5 ; ================================================================================== 6 ; interp_erai_t2m_1989_2009.pro - Interpolation of t2 from ERA-I grid to OAFLUX grid 7 ; ================================================================================== 8 ; 9 ; Interpolation of t2 from ERA-I grid to OAFLUX grid 10 ; 11 ; :file:`${TROPFLUX_ID}/20c3m_erai_t2_TROP_1989_2009.nc` containing t2 from ERA-I have been produced 12 ; by :ref:`compute_erai_daily_region_2d.sh`. 13 ; 14 ; :file:`${TROPFLUX_ID}/mask_oaflux_30N30S.nc` containing OAFLUX grid have been produced by :ref:`oaflux_mask_30N30S.pro`. 15 ; 16 ; Interpolated t2 is written in 17 ; :file:`${TROPFLUX_OD}/erai_t2m_19890101_20091231_oafluxgrid.nc` if this file not already exists. 9 18 ; 10 19 ; .. graphviz:: … … 17 26 ; mask [shape=ellipse,fontname=Courier,label="${TROPFLUX_ID}/mask_oaflux_30N30S.nc"]; 18 27 ; 19 ; ncfile [shape=ellipse,fontname=Courier,label=" /Volumes/PRAVEEN/TropFlux/input_uncor/erai_t2m_19890101_20091231_oafluxgrid.nc"];28 ; ncfile [shape=ellipse,fontname=Courier,label="${TROPFLUX_OD}/erai_t2m_19890101_20091231_oafluxgrid.nc"]; 20 29 ; 21 30 ; interp_erai_t2m_1989_2009 [shape=box, … … 37 46 ; :ref:`tropflux_profile.sh` 38 47 ; 48 ; :ref:`compute_erai_daily_region_2d.sh` 49 ; 50 ; :ref:`oaflux_mask_30N30S.pro` 51 ; 39 52 ; :func:`report <saxo:report>` 40 53 ; :func:`isadirectory <saxo:isadirectory>` … … 42 55 ; :func:`initncdf <saxo:initncdf>` 43 56 ; :func:`read_ncdf <saxo:read_ncdf>` 57 ; :func:`ncdf_lec <saxo:ncdf_lec>` 44 58 ; :func:`domdef <saxo:domdef>` 45 59 ; :func:`call_interp2d <saxo:call_interp2d>` … … 60 74 ; make it work !! 61 75 ; 62 ; now (20101222) : 63 ; - /usr/work/incas/fplod/tropflux_d/20c3m_erai_t2_TROP_1989_2009.nc as no time axis variable 64 ; - Value of Julian date is out of allowed range 65 ; - % Array used to subscript array contains out of range subscript: DATAIN 76 ; strange view (lat and lon shift with ncview) : check grid init 77 ; 78 ; remove useless netcdf_read 79 ; 80 ; check time values 66 81 ; 67 82 ; why use :func:`call_interp2d <saxo:call_interp2d>` : this is an hidden function of SAXO 68 83 ; see :func:`file_interp <saxo:file_interp>` 69 84 ; 70 ; hard coded directory - usage of ${TROPFLUX_ID}71 ;72 85 ; use as input a file produced by compute_erai_daily_region_2d.sh 73 86 ; 74 87 ; coding rules 88 ; 89 ; hard coded time in module name and in code 90 ; 91 ; why two "initncdf, fullfilename_msk" 75 92 ; 76 93 ; KNOWN ISSUES … … 82 99 ; EVOLUTIONS 83 100 ; ========== 101 ; 102 ; - fplod 20101223T130406Z aedon.locean-ipsl.upmc.fr (Darwin) 103 ; 104 ; * replace /Volumes/PRAVEEN/TropFlux/input_uncor/ by ${TROPFLUX_OD} 105 ; * complete documentation 106 ; * get time dimension in data file 107 ; * replace read_ncdf by ncdf_lec 108 ; 109 ; usage of timestep keyword in read_ncdf was not efficient because of memory problem : 110 ; can not read the whole time range (ok with 7580, not ok with 7591 while need is 7670 111 ; :: 112 ; 113 ; % Unable to allocate memory: to make array. 114 ; Cannot allocate memory 115 ; 116 ; 117 ; When timestep keyword is not used we can see these messages:: 118 ; 119 ; /usr/work/incas/fplod/tropflux_d/20c3m_erai_t2_TROP_1989_2009.nc as no time axis variable 120 ; given by Praveen 121 ; 122 ; Value of Julian date is out of allowed range 123 ; 124 ; % Array used to subscript array contains out of range subscript: DATAIN 125 ; 84 126 ; 85 127 ; - fplod 20101222T163216Z aedon.locean-ipsl.upmc.fr (Darwin) … … 154 196 ENDIF 155 197 ; 198 ; test if ${TROPFLUX_OD} defined 199 tropflux_od_env=GETENV('TROPFLUX_OD') 200 CASE tropflux_od_env OF 201 '' : BEGIN 202 msg = 'eee : ${TROPFLUX_OD} is not defined' 203 ras = report(msg) 204 STOP 205 END 206 ELSE: BEGIN 207 msg = 'iii : ${TROPFLUX_OD} is ' + tropflux_od_env 208 ras = report(msg) 209 END 210 ENDCASE 211 ; 212 ; check if output data will be possible 213 iodirout = isadirectory(tropflux_od_env) 214 ; 215 ; existence and protection 216 IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN 217 msg = 'eee : the directory' + iodirout + ' was not found.' 218 ras = report(msg) 219 STOP 220 ENDIF 221 ; 222 ; build output filename 223 filename_out = 'erai_t2m_19890101_20091231_oafluxgrid.nc' 224 fullfilename_out = iodirout + filename_out 225 ; in order to avoid unexpected overwritten 226 IF (FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN 227 msg = 'eee : the file ' + fullfilename_out + ' already exists.' 228 ras = report(msg) 229 STOP 230 ENDIF 231 ; 232 ; define grid parameters with t2 file 156 233 initncdf, fullfilename_t2 157 234 domdef 158 235 latin=reform(gphit(0,*)) & lonin=reform(glamt(*,0)) 159 print, 'lat grid ',min(latin),max(latin),latin(1)-latin(0) 160 print, 'lon grid ',min(lonin),max(lonin),lonin(1)-lonin(0) 161 t2min=read_ncdf("t2",19880101,20100930,file=fullfilename_t2,/nostr) 162 163 timein=time & jptin=jpt 236 print, 'lat grid from data',min(latin),max(latin),latin(1)-latin(0) 237 print, 'lon grid from data',min(lonin),max(lonin),lonin(1)-lonin(0) 238 ; 239 ; get the number of time step in t2 file 240 time_in_step=ncdf_lec(fullfilename_t2,var='time') 241 ntt=n_elements(time_in_step) 242 print, 'time steps from data ', ntt 243 print, 'The first 10 time values (variable time_in_step) = ', time_in_step[0:9] 244 ; 245 ; read t2 data 246 ;++ pb memory t2min=read_ncdf("t2",0,ntt-1,/timestep,file=fullfilename_t2,/nostr) 247 ; the following line is here just to prepare replacement of read_ncdf by ncdf_lec 248 t2min_read_ncdf=read_ncdf("t2",0,10,/timestep,file=fullfilename_t2,/nostr) 249 help, t2min_read_ncdf 250 ;++print, 'The first 10 time values (variable time) = ', time[0:9] 251 ;++print, 'time steps after read_ncdf (variable jpt) ', jpt 252 t2min=ncdf_lec(fullfilename_t2,var='t2') 253 help, t2min 254 ; 255 timein=time & jptin=ntt 164 256 tab=t2min(*,*,0) 165 257 mskin=glamt*0.+1. 166 258 259 ; define grid parameters with mask file 167 260 initncdf, fullfilename_msk 168 261 domdef 169 262 latout=reform(gphit(0,*)) & lonout=reform(glamt(*,0)) 170 print, 'lat grid ',min(latout),max(latout),latout(1)-latout(0)171 print, 'lon grid ',min(lonout),max(lonout),lonout(1)-lonout(0)263 print, 'lat grid from mask ',min(latout),max(latout),latout(1)-latout(0) 264 print, 'lon grid from mask ',min(lonout),max(lonout),lonout(1)-lonout(0) 172 265 mskout=read_ncdf("msk", file=fullfilename_msk,/nostr) 173 266 … … 176 269 t2mout=fltarr(jpi,jpj,jptin) 177 270 for jt=0,jptin-1 do begin 178 print, 'Interpolation jt=',jt,' / ',jptin-1179 271 tab=reform(t2min(*,*,jt)) 180 272 t2mout(*,*,jt)=call_interp2d(tab,lonin,latin,mskin,lonout,latout,method='bilinear') … … 182 274 endfor 183 275 184 timein=timein & jptin=jpt185 186 276 initncdf, fullfilename_msk 187 277 help, t2mout 188 278 tt=timein 189 time=julday(1,1,1989)+lindgen(7670)+0.5 & jpt=n_elements(time) 190 ;cda0=string(jul2date(time(0)),format='(i8.8)') 279 time=julday(1,1,1989)+lindgen(ntt)+0.5 & jpt=n_elements(time) 280 help, time 281 ;cda0=string(jul2date(time[0]),format='(i8.8)') 191 282 ;cda1=string(jul2date(time(jpt-1)),format='(i8.8)') 192 ;cda0=string('19890101') & cda1=string('20091231')283 cda0=string('19890101') & cda1=string('20091231') 193 284 194 285 timein=time-julday(1,1,1950,00,00) … … 196 287 lat=latout 197 288 lon=lonout 198 ncfile='!/Volumes/PRAVEEN/TropFlux/input_uncor/erai_t2m_19890101_20091231_oafluxgrid.nc' 289 ncfile='!' + fullfilename_out 290 print, 'ncfile ', ncfile 199 291 lon_attr={units:'degrees_east',long_name:'Longitude'} 200 292 lat_attr={units:'degrees_north',long_name:'Latitude'}
Note: See TracChangeset
for help on using the changeset viewer.