- Timestamp:
- 03/20/12 16:08:01 (12 years ago)
- Location:
- trunk/src
- Files:
-
- 8 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/TropFlux_19890101_20091231.pro
r153 r172 59 59 ; q2m corrected on OAFLUX grid 60 60 ; has been produced by 61 ; : ref:`d2m_to_q2m_erai.pro`.61 ; :func:`d2m_to_q2m_erai`. 62 62 ; 63 63 ; net heat flux components are written -
trunk/src/compute_erai_daily_region_2d.sh
r167 r172 108 108 # :func:`interp_erai_dewt` 109 109 # :func:`interp_erai_lwr` 110 # : ref:`interp_erai_sst_1989_2009.pro`110 # :func:`interp_erai_sst` 111 111 # :func:`interp_erai_t2m` 112 # : ref:`interp_erai_ws_1989_2009.pro`112 # :func:`interp_erai_ws` 113 113 # 114 114 # TODO -
trunk/src/d2m_to_q2m_erai.pro
r167 r172 1 1 ;+ 2 ;3 ; .. _d2m_to_q2m_erai.pro:4 2 ; 5 3 ; =================== … … 7 5 ; =================== 8 6 ; 7 ; .. function:: d2m_to_q2m_erai(yyyymmddb,yyyymmdde) 8 ; 9 ; DESCRIPTION 10 ; =========== 11 ; 9 12 ; Conversion of d2m to q2m on OAFLUX grid 10 13 ; 11 ; :file:`${PROJECT_OD}/erai_d2m_ 19890101_20091231_oafluxgrid.nc`14 ; :file:`${PROJECT_OD}/erai_d2m_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc` 12 15 ; containing 13 16 ; ++ … … 15 18 ; :func:`interp_erai_dewt`. 16 19 ; 17 ; :file:`${PROJECT_OD}/erai_t2m_ 19890101_20091231_oafluxgrid.nc`20 ; :file:`${PROJECT_OD}/erai_t2m_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc` 18 21 ; containing 19 22 ; ++ … … 21 24 ; :func:`interp_erai_t2m`. 22 25 ; 23 ; :file:`${PROJECT_OD}/erai_msl_ 19890101_20091231_oafluxgrid.nc`26 ; :file:`${PROJECT_OD}/erai_msl_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc` 24 27 ; containing 25 28 ; ++ … … 30 33 ; q2m on OAFLUX grid 31 34 ; is written in 32 ; :file:`${PROJECT_OD}/erai_q2m_ 19890101_20091231_oafluxgrid.nc`35 ; :file:`${PROJECT_OD}/erai_q2m_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc` 33 36 ; if this file not already exists. 34 37 ; 35 38 ; This file 36 ; :file:`${PROJECT_OD}/erai_q2m_ 19890101_20091231_oafluxgrid.nc`39 ; :file:`${PROJECT_OD}/erai_q2m_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc` 37 40 ; will be used by 38 41 ; :ref:`q2m_correction_ncdf.pro`. … … 48 51 ; digraph d2m_to_q2m_erai { 49 52 ; 50 ; file_d2m [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_d2m_ 19890101_20091231_oafluxgrid.nc"];51 ; file_t2m [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_t2m_ 19890101_20091231_oafluxgrid.nc"];52 ; file_msl [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_msl_ 19890101_20091231_oafluxgrid.nc"];53 ; file_q2m [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_q2m_ 19890101_20091231_oafluxgrid.nc"];53 ; file_d2m [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_d2m_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc"]; 54 ; file_t2m [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_t2m_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc"]; 55 ; file_msl [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_msl_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc"]; 56 ; file_q2m [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_q2m_{yyyymmdd}_{yyyymmdd}_oafluxgrid.nc"]; 54 57 ; 55 58 ; d2m_to_q2m_erai [shape=box, … … 72 75 ; [AOMIP]_ 73 76 ; 77 ; Used by :ref:`tropflux.sh` 78 ; 74 79 ; :ref:`project_profile.sh` 75 80 ; … … 91 96 ; :: 92 97 ; 93 ; IDL> d2m_to_q2m_erai 98 ; IDL> yyyymmddb = 19890101 99 ; IDL> yyyymmdde = 20091231 100 ; IDL> result = d2m_to_q2m_erai(yyyymmddb, yyyymmdde) 101 ; IDL> print, result 94 102 ; 95 103 ; TODO 96 104 ; ==== 105 ; 106 ; compare time between d2m and t2m after reading 97 107 ; 98 108 ; pb on cratos idl7 even if output file is written:: … … 118 128 ; $URL$ 119 129 ; 130 ; - fplod 20120320 131 ; 132 ; * try to add compile_opt seems to be incompatible with ncdf_quickwrite 133 ; * pro -> function with yyyymmddb and yyyymmdde parameters 134 ; * hard coded d1 and d2 replaced by yyyymmddb and yyyymmdde parameters 135 ; * start to homogenize time handling regarding :func:`interp_erai_t2m` 136 ; 120 137 ; - fplod 20110811T114932Z aedon.locean-ipsl.upmc.fr (Darwin) 121 138 ; … … 151 168 ; 152 169 ;- 153 pro d2m_to_q2m_erai 170 function d2m_to_q2m_erai $ 171 , yyyymmddb $ 172 , yyyymmdde 173 ; 174 compile_opt idl2, strictarrsubs, logical_predicate 154 175 ; 155 176 @cm_4cal … … 159 180 @cm_project 160 181 ; 182 ; Return to caller if errors 183 ON_ERROR, 2 184 ; 185 result = -1 186 ; 187 usage = 'result = interp_erai_t2m(yyyymmddb, yyyymmdde)' 188 nparam = N_PARAMS() 189 IF (nparam NE 2) THEN BEGIN 190 ras = report(['Incorrect number of arguments.' $ 191 + '!C' $ 192 + 'Usage : ' + usage]) 193 return, result 194 ENDIF 195 ; 161 196 ; test if ${PROJECT_OD} defined 162 197 CASE project_od_env OF … … 164 199 msg = 'eee : ${PROJECT_OD} is not defined' 165 200 ras = report(msg) 166 STOP201 return, result 167 202 END 168 203 ELSE: BEGIN … … 179 214 msg = 'eee : the directory' + iodirout + ' is not accessible.' 180 215 ras = report(msg) 181 STOP216 return, result 182 217 ENDIF 183 218 ; … … 186 221 msg = 'eee : the directory' + iodirout + ' was not found.' 187 222 ras = report(msg) 188 STOP 189 ENDIF 190 ; 191 d1=19881001 192 d2=20101231 223 return, result 224 ENDIF 193 225 ; 194 226 ; build d2m filename 195 filename_d2m='erai_d2m_ 19890101_20091231_oafluxgrid.nc'227 filename_d2m='erai_d2m_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_oafluxgrid.nc' 196 228 ; 197 229 ; check if this file exists … … 202 234 msg = 'eee : the file ' + fullfilename_d2m + ' was not found.' 203 235 ras = report(msg) 204 STOP236 return, result 205 237 ENDIF 206 238 ; 207 239 ; build t2m filename 208 filename_t2m='erai_t2m_ 19890101_20091231_oafluxgrid.nc'240 filename_t2m='erai_t2m_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_oafluxgrid.nc' 209 241 ; 210 242 ; check if this file exists … … 215 247 msg = 'eee : the file ' + fullfilename_t2m + ' was not found.' 216 248 ras = report(msg) 217 STOP249 return, result 218 250 ENDIF 219 251 ; 220 252 ; build msl filename 221 filename_msl='erai_msl_ 19890101_20091231_oafluxgrid.nc'253 filename_msl='erai_msl_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_oafluxgrid.nc' 222 254 ; 223 255 ; check if this file exists … … 228 260 msg = 'eee : the file ' + fullfilename_msl + ' was not found.' 229 261 ras = report(msg) 230 STOP262 return, result 231 263 ENDIF 232 264 ; 233 265 ; build output filename 234 filename_out = 'erai_q2m_ 19890101_20091231_oafluxgrid.nc'266 filename_out = 'erai_q2m_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_oafluxgrid.nc' 235 267 fullfilename_out = iodirout + filename_out 236 268 ; in order to avoid unexpected overwritten … … 238 270 msg = 'eee : the file ' + fullfilename_out + ' already exists.' 239 271 ras = report(msg) 240 STOP272 return, result 241 273 ENDIF 242 274 ; 243 275 ; reading erai dew point temperature 244 276 initncdf, fullfilename_d2m 245 td=read_ncdf("d2m", d1,d2, file=fullfilename_d2m,/nostr) 277 td=read_ncdf("d2m", yyyymmddb, yyyymmdde, file=fullfilename_d2m,/nostr) 278 timein=24.d*(time-julday(1,1,1957,0,0,0)) 279 jpt=n_elements(timein) 280 da=jul2date(time[0]) 281 cda0=string(da,format='(i8.8)') 282 da=jul2date(time[jpt-1]) 283 cda1=string(da,format='(i8.8)') 284 print, 'd2m first date ', cda0 285 print, 'd2m last date ' , cda1 246 286 ; 247 287 ; reading erai air temperature 248 288 initncdf, fullfilename_t2m 249 t=read_ncdf("t2m", d1,d2, file=fullfilename_t2m,/nostr) 250 jpt=n_elements(time) 289 t=read_ncdf("t2m", yyyymmddb, yyymmdde, file=fullfilename_t2m,/nostr) 290 timein=24.d*(time-julday(1,1,1957,0,0,0)) 291 jpt=n_elements(timein) 292 da=jul2date(time[0]) 293 cda0=string(da,format='(i8.8)') 294 da=jul2date(time[jpt-1]) 295 cda1=string(da,format='(i8.8)') 296 print, 't2m first date ', cda0 297 print, 't2m last date ' , cda1 298 251 299 help, t, td 252 300 ; … … 265 313 ; 266 314 initncdf, fullfilename_msl 267 P=read_ncdf("msl", d1, d2, file=fullfilename_msl,/nostr)315 P=read_ncdf("msl", yyyymmddb, yyyymmdde, file=fullfilename_msl,/nostr) 268 316 help, P 269 317 ; ++ for debug ftp error 270 ; ++print,P (0:1,0,0)318 ; ++print,P[0:1,0,0] 271 319 ; ++stop 272 320 q2m=rh_to_spechum(rh,t,P) … … 274 322 ;writing field 275 323 ncfile='!' + fullfilename_out 276 time=timegen(7670, start=julday(1,1,1989,0), units='days') 277 jpt=n_elements(time) 278 cda0=string(jul2date(time(0)),format='(i8.8)') 279 cda1=string(jul2date(time(jpt-1)),format='(i8.8)') 280 ; 281 time=time-julday(1,1,1950,00,00,00) 282 xlon=reform(glamt(*,0) ) 283 ylat=reform(gphit(0,*)) 324 xlon=reform(glamt[*,0]) 325 ylat=reform(gphit[0,*]) 284 326 valmask=1.e20 285 327 ; … … 290 332 globattr={source:'Surface specific humidity at 2m calculated from dew point temperature',timerange:cda0+' - '+cda1} 291 333 ; 292 ncfields = 'q2m[longitude,latitude, time]=q2m:q2m_attr; ' $334 ncfields = 'q2m[longitude,latitude,*time]=q2m:q2m_attr; ' $ 293 335 + 'longitude[]=xlon:lon_attr; ' $ 294 336 + 'latitude[]=ylat:lat_attr; ' $ 295 + 'time[ *time]=time:time_attr ' $337 + 'time[]=timein:time_attr ' $ 296 338 + ' @ globattr' 297 339 ; 298 340 @ncdf_quickwrite 299 341 ; 342 result = 0 343 return, result 344 ; 300 345 end -
trunk/src/interp_erai_ws.pro
r166 r172 1 1 ;+ 2 2 ; 3 ; .. _interp_erai_ws_1989_2009.pro: 4 ; 5 ; ============================ 6 ; interp_erai_ws_1989_2009.pro 7 ; ============================ 3 ; 4 ; ================== 5 ; interp_erai_ws.pro 6 ; ================== 7 ; 8 ; .. function:: interp_erai_ws(yyyymmddb,yyyymmdde) 8 9 ; 9 10 ; DESCRIPTION … … 27 28 ; containing OAFLUX grid 28 29 ; has been produced by 29 ; :func:`oaflux_mask_30n30s .pro`.30 ; :func:`oaflux_mask_30n30s`. 30 31 ; 31 32 ; Interpolated u10 and v10 are written in … … 46 47 ; .. graphviz:: 47 48 ; 48 ; digraph interp_erai_ws _1989_2009{49 ; digraph interp_erai_ws { 49 50 ; 50 51 ; file_u10 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/20c3m_erai_u10_TROP_1989_2009.nc"]; … … 53 54 ; file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/erai_ws_19890101_20091231_oafluxgrid.nc"]; 54 55 ; 55 ; interp_erai_ws _1989_2009[shape=box,56 ; interp_erai_ws [shape=box, 56 57 ; fontname=Courier, 57 58 ; color=blue, 58 ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/interp_erai_ws _1989_2009.pro",59 ; label="${PROJECT}/src/interp_erai_ws _1989_2009.pro"];60 ; 61 ; {file_u10 file_v10 mask} -> {interp_erai_ws _1989_2009} -> {file_out}59 ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/interp_erai_ws.pro", 60 ; label="${PROJECT}/src/interp_erai_ws.pro"]; 61 ; 62 ; {file_u10 file_v10 mask} -> {interp_erai_ws} -> {file_out} 62 63 ; 63 64 ; } … … 69 70 ; 70 71 ; :ref:`project_profile.sh` 72 ; 73 ; Used by :ref:`tropflux.sh` 71 74 ; 72 75 ; :func:`report <saxo:report>` … … 87 90 ; 88 91 ; IDL> .compile file_interp 89 ; IDL> interp_erai_ws_1989_2009 92 ; IDL> yyyymmddb = 20000101L 93 ; IDL> yyyymmdde = 20001231L 94 ; IDL> result = interp_erai_ws(yyyymmddb, yyyymmdde) 95 ; IDL> print, result 90 96 ; 91 97 ; TODO 92 98 ; ==== 99 ; 100 ; compare time between u10 and v10 after reading 93 101 ; 94 102 ; make it work : pb on loholt1 idl8 … … 116 124 ; Writing fields: 117 125 ; u10[longitude,latitude,time]=u10out:u10_attr; v10[longitude,latitude,time]=v10out:v10_attr; longitude[]=xlon:lon_attr; latitude[]=ylat:lat_attr; tt[*time]=tt:time_attr @ globattr 118 ; % NCDF_VARPUT: Operation Failed, bad file (6) or variable (0)id ?126 ; % NCDF_VARPUT: Operation Failed, bad file (6) or variable [0] id ? 119 127 ; (NC_ERROR=-31) 120 128 ; % Stop encountered: INTERP_ERAI_WS_1989_2009 1 … … 126 134 ; coding rules 127 135 ; 136 ; check [yyyymmddb,yyyymmdde] validity 137 ; 138 ; check if [yyyymmddb,yyyymmdde] is included in ERA-I file 139 ; 140 ; what happen if yyyymmdde > 20091231 : need to read an other ERA-I file 141 ; 128 142 ; KNOWN ISSUES 129 143 ; ============ … … 137 151 ; $Id$ 138 152 ; 139 ; $URL: svn+ssh://pinsard@forge.ipsl.jussieu.fr/ipsl/forge/projets/tropflux/svn/trunk/src/interp_erai_ws_1989_2009.pro $ 153 ; $URL: svn+ssh://pinsard@forge.ipsl.jussieu.fr/ipsl/forge/projets/tropflux/svn/trunk/src/interp_erai_ws.pro $ 154 ; 155 ; - fplod 20120320 156 ; 157 ; * taking project_overwite into account 158 ; * try to add compile_opt seems to be incompatible with ncdf_quickwrite 159 ; * pro -> function 160 ; * hard coded st and en replaced by yyyymmddb and yyyymmdde parameters 161 ; * start to homogenize time handling regarding :func:`interp_erai_t2m` 140 162 ; 141 163 ; - fplod 20110830T135212Z cratos (Linux) … … 172 194 ; 173 195 ;- 174 pro interp_erai_ws_1989_2009 196 function interp_erai_ws $ 197 , yyyymmddb $ 198 , yyyymmdde 199 ; 200 ;++compile_opt idl2, strictarrsubs, logical_predicate 201 ; 202 ; Return to caller if errors 203 ON_ERROR, 2 204 ; 205 result = -1 206 ; 207 usage = 'result = interp_erai_lwr(yyyymmddb, yyyymmdde)' 208 nparam = N_PARAMS() 209 IF (nparam NE 2) THEN BEGIN 210 ras = report(['Incorrect number of arguments.' $ 211 + '!C' $ 212 + 'Usage : ' + usage]) 213 return, result 214 ENDIF 175 215 ; 176 216 @cm_4cal … … 187 227 msg = 'eee : ${PROJECT_ID} is not defined' 188 228 ras = report(msg) 189 STOP229 return, result 190 230 END 191 231 ELSE: BEGIN … … 201 241 msg = 'eee : the directory' + iodirin + ' is not accessible.' 202 242 ras = report(msg) 203 STOP243 return, result 204 244 ENDIF 205 245 ; … … 214 254 msg = 'eee : the file ' + fullfilename_msk + ' was not found.' 215 255 ras = report(msg) 216 STOP 217 ENDIF 218 ; 219 st=19880101 220 en=20100930 256 return, result 257 ENDIF 221 258 ; 222 259 ; build u10 data filename … … 230 267 msg = 'eee : the file ' + fullfilename + ' was not found.' 231 268 ras = report(msg) 232 STOP269 return, result 233 270 ENDIF 234 271 ; … … 238 275 msg = 'eee : ${PROJECT_OD} is not defined' 239 276 ras = report(msg) 240 STOP277 return, result 241 278 END 242 279 ELSE: BEGIN … … 253 290 msg = 'eee : the directory' + iodirout + ' was not found.' 254 291 ras = report(msg) 255 STOP292 return, result 256 293 ENDIF 257 294 ; 258 295 ; build output filename 259 filename_out = 'erai_ws_ 19890101_20091231_oafluxgrid.nc'296 filename_out = 'erai_ws_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') + '_oafluxgrid.nc' 260 297 fullfilename_out = iodirout + filename_out 261 298 ; in order to avoid unexpected overwritten 262 IF ( FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN299 IF ((FILE_TEST(fullfilename_out) EQ 1) AND (project_overwrite EQ 0)) THEN BEGIN 263 300 msg = 'eee : the file ' + fullfilename_out + ' already exists.' 264 301 ras = report(msg) 265 STOP302 return, result 266 303 ENDIF 267 304 ; 268 305 initncdf, fullfilename 269 u10in=read_ncdf("u10",st, en,file=fullfilename,/nostr) 306 u10in=read_ncdf("u10", yyyymmddb - .5d, yyyymmdde, file=fullfilename,/nostr) 307 ; 308 timein=24.d*(time-julday(1,1,1957,0,0,0)) 309 jpt=n_elements(timein) 310 da=jul2date(time[0]) 311 cda0=string(da,format='(i8.8)') 312 da=jul2date(time[jpt-1]) 313 cda1=string(da,format='(i8.8)') 314 print, 'u10 first date ', cda0 315 print, 'u10 last date ' , cda1 270 316 ; 271 317 ; build v10 data filename … … 279 325 msg = 'eee : the file ' + fullfilename + ' was not found.' 280 326 ras = report(msg) 281 STOP327 return, result 282 328 ENDIF 283 329 initncdf, fullfilename 284 v10in=read_ncdf("v10", st, en,file=fullfilename,/nostr)330 v10in=read_ncdf("v10", yyyymmddb - .5d, yyyymmdde, file=fullfilename,/nostr) 285 331 ; 286 332 initncdf, fullfilename 287 333 domdef 288 latin=reform(gphit(0,*)) 289 lonin=reform(glamt(*,0)) 290 print, 'lat grid ',min(latin),max(latin),latin(1)-latin(0) 291 print, 'lon grid ',min(lonin),max(lonin),lonin(1)-lonin(0) 292 ; 293 timein=time 294 jptin=jpt 295 tab=u10in(*,*,0) 334 latin=reform(gphit[0,*]) 335 lonin=reform(glamt[*,0]) 336 print, 'lat grid ',min(latin),max(latin),latin[1]-latin[0] 337 print, 'lon grid ',min(lonin),max(lonin),lonin[1]-lonin[0] 338 ; 339 timein=24.d*(time-julday(1,1,1957,0,0,0)) 340 jptin=n_elements(timein) 341 da=jul2date(time[0]) 342 cda0=string(da,format='(i8.8)') 343 da=jul2date(time[jpt-1]) 344 cda1=string(da,format='(i8.8)') 345 print, 'v10 first date ', cda0 346 print, 'v10 last date ' , cda1 347 help, v10in 348 ; 349 tab=u10in[*,*,0] 296 350 mskin=glamt*0.+1. 297 351 ; 298 352 initncdf, fullfilename_msk 299 353 domdef 300 latout=reform(gphit (0,*))301 lonout=reform(glamt (*,0))302 print, 'lat grid ',min(latout),max(latout),latout (1)-latout(0)303 print, 'lon grid ',min(lonout),max(lonout),lonout (1)-lonout(0)354 latout=reform(gphit[0,*]) 355 lonout=reform(glamt[*,0]) 356 print, 'lat grid ',min(latout),max(latout),latout[1]-latout[0] 357 print, 'lon grid ',min(lonout),max(lonout),lonout[1]-lonout[0] 304 358 mskout=read_ncdf("msk", file=fullfilename_msk,/nostr) 305 359 ; … … 311 365 for jt=0,jptin-1 do begin 312 366 ; ++print, 'Interpolation jt=',jt,' / ',jptin-1 313 tab=reform(u10in (*,*,jt))314 u10out (*,*,jt)=call_interp2d(tab,lonin,latin,mskin $367 tab=reform(u10in[*,*,jt]) 368 u10out[*,*,jt]=call_interp2d(tab,lonin,latin,mskin $ 315 369 , lonout,latout,method='bilinear' $ 316 370 , OUTMASK_IND=mskout, SET_OUTMSKVAL=mskout) 317 u10out (*,*,jt)=u10out(*,*,jt)*mskout+(1.-mskout)*1.e20318 ; 319 tab=reform(v10in (*,*,jt))320 v10out (*,*,jt)=call_interp2d(tab,lonin,latin,mskin $371 u10out[*,*,jt]=u10out[*,*,jt]*mskout+(1.-mskout)*1.e20 372 ; 373 tab=reform(v10in[*,*,jt]) 374 v10out[*,*,jt]=call_interp2d(tab,lonin,latin,mskin $ 321 375 , lonout,latout,method='bilinear' $ 322 376 , OUTMASK_IND=mskout, SET_OUTMSKVAL=mskout) 323 v10out (*,*,jt)=v10out(*,*,jt)*mskout+(1.-mskout)*1.e20377 v10out[*,*,jt]=v10out[*,*,jt]*mskout+(1.-mskout)*1.e20 324 378 ; 325 379 endfor 326 380 ; 327 time=timegen(7670, start=julday(1,1,1989,0), units='days') 328 jpt=n_elements(time) 329 cda0=string(jul2date(time(0)),format='(i8.8)') 330 cda1=string(jul2date(time(jpt-1)),format='(i8.8)') 331 time=time-julday(1,1,1950,00,00,00) 332 xlon=reform(glamt(*,0) ) 333 ylat=reform(gphit(0,*)) 381 xlon=reform(glamt[*,0] ) 382 ylat=reform(gphit[0,*]) 334 383 ; 335 384 initncdf, fullfilename_msk … … 346 395 v10_attr={units:'m/s',missing_value:valmask,long_name:'10 metre v wind component',short_name:'v10',axis:'TYX'} 347 396 ; 348 help, u10out,v10out,time,xlon,ylat 349 ; 350 ncfields = 'u10[longitude,latitude,time]=u10out:u10_attr; ' $ 351 +'v10[longitude,latitude,time]=v10out:v10_attr; ' $ 397 help, u10out 398 help, v10out 399 help, timein 400 ; 401 ncfields = 'u10[longitude,latitude,*time]=u10out:u10_attr; ' $ 402 +'v10[longitude,latitude,*time]=v10out:v10_attr; ' $ 352 403 + 'longitude[]=xlon:lon_attr; ' $ 353 404 + 'latitude[]=ylat:lat_attr; ' $ 354 + 'time[ *time]=time:time_attr ' $405 + 'time[]=timein:time_attr ' $ 355 406 + ' @ globattr' 356 407 ; 357 408 @ncdf_quickwrite 358 409 ; 410 result = 0 411 return, result 412 ; 359 413 end -
trunk/src/interp_olr_30n30s.pro
r166 r172 1 1 ;+ 2 2 ; 3 ; .. _interp_olr_30n30s_1989_2009.pro:4 ; 5 ; ===================== ==========6 ; interp_olr_30n30s_1989_2009.pro7 ; ===============================3 ; ===================== 4 ; interp_olr_30n30s.pro 5 ; ===================== 6 ; 7 ; .. function:: interp_olr_30n30s(yyyymmddb,yyyymmdde) 8 8 ; 9 9 ; DESCRIPTION … … 21 21 ; 22 22 ; Interpolated OLR is written in 23 ; :file:`${PROJECT_OD}/${PROJECT_OD}/olr_oafluxgrid_30n30s_ 19890101_20091231.nc`23 ; :file:`${PROJECT_OD}/${PROJECT_OD}/olr_oafluxgrid_30n30s_{yyyymmdd}_{yyyymmdd}.nc` 24 24 ; if this file not already exists. 25 25 ; … … 29 29 ; .. graphviz:: 30 30 ; 31 ; digraph interp_olr_30n30s _1989_2009{31 ; digraph interp_olr_30n30s{ 32 32 ; 33 33 ; file_in [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/olr.day.mean_new.nc"]; 34 34 ; mask [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/mask_oaflux_30N30S.nc"]; 35 ; file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/olr_oafluxgrid_30n30s_ 19890101_20091231.nc"];36 ; 37 ; interp_olr_30n30s _1989_2009[shape=box,35 ; file_out [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/olr_oafluxgrid_30n30s_{yyyymmdd}_{yyyymmdd}.nc"]; 36 ; 37 ; interp_olr_30n30s [shape=box, 38 38 ; fontname=Courier, 39 39 ; color=blue, 40 ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/interp_olr_30n30s _1989_2009.pro",41 ; label="${PROJECT}/src/interp_olr_30n30s _1989_2009.pro"];42 ; 43 ; {file_in mask} -> {interp_olr_30n30s _1989_2009} -> {file_out}40 ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/interp_olr_30n30s.pro", 41 ; label="${PROJECT}/src/interp_olr_30n30s.pro"]; 42 ; 43 ; {file_in mask} -> {interp_olr_30n30s} -> {file_out} 44 44 ; 45 45 ; } … … 48 48 ; ======== 49 49 ; 50 ; :ref:`interpolate_data` 51 ; 52 ; Used by :ref:`tropflux.sh` 53 ; 50 54 ; :ref:`project_profile.sh` 51 ;52 ; :ref:`interpolate_data`53 55 ; 54 56 ; :ref:`data_in_olr`, :ref:`get_olr.sh` … … 69 71 ; 70 72 ; IDL> .compile file_interp 71 ; IDL> interp_olr_30n30s_1989_2009 73 ; IDL> yyyymmddb = 19890101 74 ; IDL> yyyymmdde = 20091231 75 ; IDL> result = interp_olr_30n30s(yyyymmddb, yyyymmdde) 76 ; IDL> print, result 72 77 ; 73 78 ; TODO … … 80 85 ; I think we do not need any zaxis 81 86 ; 82 ; strange second value (1)in the file produced on cratos idl 7 20110812::87 ; strange second value [1] in the file produced on cratos idl 7 20110812:: 83 88 ; 84 89 ; $ ncdump $PROJECT_OD/olr_oafluxgrid_30n30s_19890101_20091231.nc … … 106 111 ; ========== 107 112 ; 108 ; $Id: interp_olr_30n30s _1989_2009.pro 88 2011-08-19 15:40:14Z pinsard $113 ; $Id: interp_olr_30n30s.pro 88 2011-08-19 15:40:14Z pinsard $ 109 114 ; 110 115 ; $URL$ 116 ; 117 ; - fplod 20120320 118 ; 119 ; * taking project_overwite into account 120 ; * try to add compile_opt seems to be incompatible with ncdf_quickwrite 121 ; * pro -> function 111 122 ; 112 123 ; - fplod 20110812T084449Z aedon.locean-ipsl.upmc.fr (Darwin) … … 134 145 ; 135 146 ;- 136 pro interp_olr_30n30s_1989_2009 147 function interp_olr_30n30s $ 148 , yyyymmddb $ 149 , yyyymmdde 150 ; 151 ;++compile_opt idl2, strictarrsubs, logical_predicate 137 152 ; 138 153 @cm_4cal … … 142 157 @cm_project 143 158 ; 159 ; Return to caller if errors 160 ON_ERROR, 2 161 ; 162 result = -1 163 ; 164 usage = 'result = interp_olr_30n30s(yyyymmddb, yyyymmdde)' 165 nparam = N_PARAMS() 166 IF (nparam NE 2) THEN BEGIN 167 ras = report(['Incorrect number of arguments.' $ 168 + '!C' $ 169 + 'Usage : ' + usage]) 170 return, result 171 ENDIF 172 ; 144 173 ; check for input directory 145 174 ; … … 149 178 msg = 'eee : ${PROJECT_ID} is not defined' 150 179 ras = report(msg) 151 STOP180 return, result 152 181 END 153 182 ELSE: BEGIN … … 163 192 msg = 'eee : the directory' + iodirin + ' is not accessible.' 164 193 ras = report(msg) 165 STOP194 return, result 166 195 ENDIF 167 196 ; … … 176 205 msg = 'eee : the file ' + fullfilename_msk + ' was not found.' 177 206 ras = report(msg) 178 STOP207 return, result 179 208 ENDIF 180 209 ; … … 189 218 msg = 'eee : the file ' + fullfilename + ' was not found.' 190 219 ras = report(msg) 191 STOP220 return, result 192 221 ENDIF 193 222 ; … … 197 226 msg = 'eee : ${PROJECT_OD} is not defined' 198 227 ras = report(msg) 199 STOP228 return, result 200 229 END 201 230 ELSE: BEGIN … … 212 241 msg = 'eee : the directory' + iodirout + ' was not found.' 213 242 ras = report(msg) 214 STOP243 return, result 215 244 ENDIF 216 245 ; 217 246 ; build output filename 218 filename_out = 'olr_oafluxgrid_30n30s_ 19890101_20091231.nc'247 filename_out = 'olr_oafluxgrid_30n30s_' + string(yyyymmddb,format='(I8.8)') + '_' + string(yyyymmdde,format='(I8.8)') +'.nc' 219 248 fullfilename_out = iodirout + filename_out 220 249 ; in order to avoid unexpected overwritten 221 IF ( FILE_TEST(fullfilename_out) EQ 1) THEN BEGIN250 IF ((FILE_TEST(fullfilename_out) EQ 1) AND (project_overwrite EQ 0)) THEN BEGIN 222 251 msg = 'eee : the file ' + fullfilename_out + ' already exists.' 223 252 ras = report(msg) 224 STOP253 return, result 225 254 ENDIF 226 255 ; 227 256 initncdf, fullfilename 228 257 domdef 229 latin=reform(gphit (0,*))230 lonin=reform(glamt (*,0))231 print, 'lat grid ',min(latin),max(latin),latin (1)-latin(0)232 print, 'lon grid ',min(lonin),max(lonin),lonin (1)-lonin(0)233 olrin=read_ncdf("olr", 19881231, 20091231, file=fullfilename,/nostr)258 latin=reform(gphit[0,*]) 259 lonin=reform(glamt[*,0]) 260 print, 'lat grid ',min(latin),max(latin),latin[1]-latin[0] 261 print, 'lon grid ',min(lonin),max(lonin),lonin[1]-lonin[0] 262 olrin=read_ncdf("olr",yyyymmddb-.5d,yyyymmdde, file=fullfilename,/nostr) 234 263 ; 235 264 timein=time … … 239 268 initncdf, fullfilename_msk 240 269 domdef 241 latout=reform(gphit (0,*))242 lonout=reform(glamt (*,0))243 print, 'lat grid ',min(latout),max(latout),latout (1)-latout(0)244 print, 'lon grid ',min(lonout),max(lonout),lonout (1)-lonout(0)270 latout=reform(gphit[0,*]) 271 lonout=reform(glamt[*,0]) 272 print, 'lat grid ',min(latout),max(latout),latout[1]-latout[0] 273 print, 'lon grid ',min(lonout),max(lonout),lonout[1]-lonout[0] 245 274 mskout=read_ncdf("msk", file=fullfilename_msk,/nostr) 246 275 ; … … 252 281 ; 253 282 print, 'Interpolation jt=',jt,' / ',jptin-1 254 tab_olr=reform(olrin (*,*,jt))255 ; 256 olrout (*,*,jt)=call_interp2d(tab_olr,lonin,latin,mskin $283 tab_olr=reform(olrin[*,*,jt]) 284 ; 285 olrout[*,*,jt]=call_interp2d(tab_olr,lonin,latin,mskin $ 257 286 , lonout,latout,method='bilinear' $ 258 287 , OUTMASK_IND=mskout, SET_OUTMSKVAL=mskout) 259 olrout (*,*,jt)=olrout(*,*,jt)*mskout+(1.-mskout)*1.e20288 olrout[*,*,jt]=olrout[*,*,jt]*mskout+(1.-mskout)*1.e20 260 289 ; 261 290 endfor … … 280 309 @ncdf_quickwrite 281 310 ; 311 result = 0 312 return, result 313 ; 282 314 end -
trunk/src/oaflux_mask_30n30s.pro
r170 r172 67 67 ; :func:`interp_erai_sst`, 68 68 ; :func:`interp_erai_t2m`, 69 ; : ref:`interp_erai_ws_1989_2009.pro`,70 ; : ref:`interp_olr_30n30s_1989_2009.pro`69 ; :func:`interp_erai_ws`, 70 ; :func:`interp_olr_30n30s` 71 71 ; 72 72 ; EXAMPLES -
trunk/src/q2m_correction_ncdf.pro
r100 r172 16 16 ; ++ 17 17 ; has been produced by 18 ; : ref:`d2m_to_q2m_erai.pro`.18 ; :func:`d2m_to_q2m_erai`. 19 19 ; 20 20 ; Corrected q2m on OAFLUX grid … … 56 56 ; :ref:`mooring_corrections` 57 57 ; 58 ; : ref:`d2m_to_q2m_erai.pro`58 ; :func:`d2m_to_q2m_erai` 59 59 ; 60 60 ; :func:`initncdf <saxo:initncdf>` -
trunk/src/rh_to_spechum.pro
r97 r172 33 33 ; ======== 34 34 ; 35 ; called by : ref:`d2m_to_q2m_erai.pro`35 ; called by :func:`d2m_to_q2m_erai` 36 36 ; 37 37 ; use :func:`qsat` -
trunk/src/tropflux.sh
r170 r172 91 91 # :func:`oaflux_mask_30n30s`, :func:`interp_erai_t2m`, 92 92 # :func:`interp_erai_msl`, :func:`interp_erai_dewt`, :func:`interp_erai_lwr`, 93 # :func:`interp_erai_sst`, etc. 93 # :func:`interp_erai_sst`, :func:`interp_erai_ws`, :func:`interp_olr_30n30s`, 94 # :func:`d2m_to_q2m_erai`, 95 # etc. 94 96 # 95 97 # Next step : +validation ++ comparison … … 115 117 # - pinsard 20120320 116 118 # 117 # * handling error of inter_erai_sst (now function) 119 # * handling error of interp_erai_sst (now function) 120 # * handling error of interp_erai_ws (now function) 121 # * handling error of interp_olr_30n_30s (now function) 122 # * handling error of d2m_to_q2m_erai (now function) 118 123 # 119 124 # - pinsard 20120319 120 125 # 121 126 # * add project_overwrite usage 122 # * handling error of inter _erai_msl (now function)123 # * handling error of inter _erai_dewt (now function)124 # * handling error of inter _erai_lwr (now function)127 # * handling error of interp_erai_msl (now function) 128 # * handling error of interp_erai_dewt (now function) 129 # * handling error of interp_erai_lwr (now function) 125 130 # 126 131 # - pinsard 20120306 … … 295 300 ; define overwrite status 296 301 ; set to 1 to overwrite existing files 297 project_overwrite = 0302 project_overwrite = 1 298 303 ; 299 304 result = oaflux_mask_30n30s() … … 333 338 exit 334 339 ENDIF 335 ;interp_erai_ws_1989_2009 336 ;interp_olr_30n30s_1989_2009 337 d2m_to_q2m_erai 340 result = interp_erai_ws(${yyyymmddb}, ${yyyymmdde}) 341 IF result < 0 THEN BEGIN 342 msg = 'eee : pb after interp_erai_t2m' + string(result) 343 err = report(msg) 344 exit 345 ENDIF 346 result = interp_olr_30n30s(${yyyymmddb}, ${yyyymmdde}) 347 IF result < 0 THEN BEGIN 348 msg = 'eee : pb after interp_erai_t2m' + string(result) 349 err = report(msg) 350 exit 351 ENDIF 352 result = d2m_to_q2m_erai(${yyyymmddb}, ${yyyymmdde}) 353 IF result < 0 THEN BEGIN 354 msg = 'eee : pb after interp_erai_t2m' + string(result) 355 err = report(msg) 356 exit 357 ENDIF 338 358 ;++Program caused arithmetic error: Floating overflow 339 359 ;++ Program caused arithmetic error: Floating illegal operand -
trunk/src/ws_correction_ncdf.pro
r100 r172 13 13 ; ++ 14 14 ; have been produced by 15 ; : ref:`interp_erai_ws_1989_2009.pro`.15 ; :func:`interp_erai_ws`. 16 16 ; 17 17 ; Corrected ws on OAFLUX grid … … 55 55 ; :ref:`mooring_corrections` 56 56 ; 57 ; : ref:`interp_erai_vs_1989_2009.pro`57 ; :func:`interp_erai_ws` 58 58 ; 59 59 ; :func:`initncdf <saxo:initncdf>`
Note: See TracChangeset
for help on using the changeset viewer.