Changeset 172 for trunk/SRC/ToBeReviewed
- Timestamp:
- 09/11/06 09:11:26 (18 years ago)
- Location:
- trunk/SRC/ToBeReviewed
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/GRILLE/grille.pro
r163 r172 111 111 ;------------------------------------------------------------ 112 112 ;------------------------------------------------------------ 113 pro grille, mask, glam, gphi, gdep, nx, ny, nz, firstx, firsty, firstz, lastx, lasty, lastz, e1, e2, e3, TRI = tri, NOTRI = notri, TOUT = tout, FORPLT = forplt, IFPLTZ = ifpltz, WDEPTH = wdepth, _EXTRA = ex113 pro grille, mask, glam, gphi, gdep, nx, ny, nz, firstx, firsty, firstz, lastx, lasty, lastz, e1, e2, e3, TRI = tri, NOTRI = notri, TOUT = tout, FORPLT = forplt, TYPE = type, WDEPTH = wdepth, _EXTRA = ex 114 114 ;------------------------------------------------------------ 115 115 ; include commons … … 119 119 @cm_4mesh 120 120 @cm_4data 121 @cm_4cal ; for jpt 121 122 IF NOT keyword_set(key_forgetold) THEN BEGIN 122 123 @updatenew … … 354 355 ENDELSE 355 356 ; for the vertical sections with partial steps 356 IF keyword_set( ifpltz) AND keyword_set(key_partialstep) THEN BEGIN357 IF keyword_set(type) AND keyword_set(key_partialstep) THEN BEGIN 357 358 CASE 1 OF 358 ifpltzEQ 'xz' AND ny EQ 1:BEGIN359 type EQ 'xz' AND ny EQ 1:BEGIN 359 360 bottom = total(tmask[firstx:lastx, firsty:lasty, firstz:lastz], 3) 360 361 good = where(bottom NE 0 AND bottom NE nz+keyword_set(wdepth)) … … 370 371 ENDIF 371 372 END 372 ifpltzEQ 'yz' AND nx EQ 1:BEGIN373 type EQ 'yz' AND nx EQ 1:BEGIN 373 374 bottom = total(tmask[firstx:lastx, firsty:lasty, firstz:lastz], 3) 374 375 good = where(bottom NE 0 AND bottom NE nz+keyword_set(wdepth)) … … 387 388 ENDCASE 388 389 ENDIF 390 ; for the vertical sections with roms 391 IF keyword_set(type) AND n_elements(romszinfos) NE 0 THEN BEGIN 392 romsdp = romsdepth() 393 IF romsdp[0] NE -1 THEN BEGIN 394 IF jpt EQ 1 THEN BEGIN 395 CASE type OF 396 'z':gdep = moyenne(temporary(romsdp), 'xy') 397 'xz':gdep = moyenne(temporary(romsdp), 'y') 398 'yz':gdep = moyenne(temporary(romsdp), 'x') 399 'zt':gdep = moyenne(temporary(romsdp), 'xy') 400 ELSE: 401 ENDCASE 402 ENDIF ELSE BEGIN 403 CASE type OF 404 'z':gdep = moyenne(temporary(romsdp), 'xyt') 405 'xz':gdep = grossemoyenne(temporary(romsdp), 'yt') 406 'yz':gdep = grossemoyenne(temporary(romsdp), 'xt') 407 'zt':gdep = grossemoyenne(temporary(romsdp), 'xy') 408 ELSE: 409 ENDCASE 410 ENDELSE 411 IF size(gdep, /n_dimensions) EQ 2 THEN $ 412 gdep = remplit(gdep, niter = 32000, mask = gdep LT 1.E19, /basique, /fillxdir) 413 ENDIF 414 ENDIF 415 ; 389 416 IF testvar(var = key_performance) EQ 2 THEN $ 390 417 print, 'temps grille: Variables se rapportant a la dimension verticale ', systime(1)-tempdeux -
trunk/SRC/ToBeReviewed/INIT/initncdf.pro
r167 r172 5 5 ; 6 6 ; @file_comments 7 ; Initfile for Netcdf file. define all the grid parameters 7 ; Initfile for Netcdf file. define all the grid parameters through 8 ; an appropriate call to computegid 8 9 ; 9 10 ; @categories 10 ; 11 ; Grid 11 12 ; 12 ; @param NCFILEIN {in}{required}{type=s tring}13 ; @param NCFILEIN {in}{required}{type=scalar string} 13 14 ; A string giving the name of the NetCdf file 14 15 ; 15 ; @keyword INVMASK 16 ; To inverse the mask: mask = 1-mask16 ; @keyword INVMASK {default=0}{type=scalar: 0 or 1} 17 ; Inverse the land/sea mask (that should have 0/1 values for land/sea): mask = 1-mask 17 18 ; 18 19 ; @keyword MASKNAME {type=string} … … 20 21 ; that contains the land/sea mask 21 22 ; 22 ; @keyword MISSING_VALUE 23 ; @keyword MISSING_VALUE {type=scalar} 23 24 ; To define (or redefine if the attribute is 24 25 ; already existing) the missing values used with USEASMASK 25 26 ; keyword 26 27 ; 27 ; @keyword START1 28 ; @keyword START1 {default=0}{type=scalar: 0 or 1} 28 29 ; Index the axis from 1 instead of 0 when using 29 30 ; /xyindex and/or zindex 30 31 ; 31 ; @keyword USEASMASK {type=s tring}32 ; @keyword USEASMASK {type=scalar string} 32 33 ; A string giving the name of the variable in the file 33 34 ; that will be used to build the land/sea mask. In this case the … … 38 39 ; 3 NaN values if existing 39 40 ; 40 ; @keyword XAXISNAME {default='x', 'longitude', 'nav_lon' or 'lon'}{type=string}41 ; @keyword XAXISNAME {default='x', 'longitude', 'nav_lon', 'lon', 'lon_rho' or 'NbLongitudes'}{type=scalar string} 41 42 ; A string giving the name of the variable in the file 42 43 ; that contains the [xyz]axis. 43 44 ; 44 ; @keyword YAXISNAME {default='y', 'latitude', 'nav_lat' or 'lat'}{type=string}45 ; @keyword YAXISNAME {default='y', 'latitude', 'nav_lat','lat', 'lat_rho' or 'NbLatitudes'}{type=scalar string} 45 46 ; A string giving the name of the variable in the file 46 47 ; that contains the [xyz]axis. 47 48 ; 48 ; @keyword ZAXISNAME {default='z', 'level', 'lev', 'depth...'}{type=s tring}49 ; @keyword ZAXISNAME {default='z', 'level', 'lev', 'depth...'}{type=scalar string} 49 50 ; A string giving the name of the variable in the file 50 51 ; that contains the [xyz]axis. 51 52 ; 52 ; @keyword XYINDEX 53 ; @keyword XYINDEX {default=0}{type=scalar: 0 or 1} 53 54 ; To define the x/y axis with index instead of using 54 55 ; the values contained in X/YAXISNAME. … … 56 57 ; this forces key_onearth = 0 57 58 ; 58 ; @keyword ZINDEX 59 ; @keyword ZINDEX {default=0}{type=scalar: 0 or 1} 59 60 ; To define the z axis with index instead of using 60 61 ; the values contained in ZAXISNAME. … … 62 63 ; 63 64 ; @keyword _EXTRA 64 ; Used to pass your keywords/65 ; Used to pass keywords to computegrid 65 66 ; 66 67 ; @uses … … 68 69 ; 69 70 ; @restrictions 70 ; Change the grid parameters of the common.pro71 ; Change the grid parameters (see computegrid) 71 72 ; 72 73 ; @restrictions … … 122 123 ; find the xaxis 123 124 if keyword_set(xaxisname) then xaxisname = strlowcase(xaxisname) ELSE xaxisname = 'x' 124 xvarid = where(namevar EQ xaxisname OR namevar EQ 'longitude' $125 OR namevar EQ 'nav_lon' OR namevar EQ 'lon' $126 OR namevar EQ 'NbLongitudes')127 xvarid = xvarid[0]125 xvarid = (where(namevar EQ xaxisname OR namevar EQ 'longitude' $ 126 OR namevar EQ 'nav_lon' OR namevar EQ 'lon' $ 127 OR namevar EQ 'lon_rho' OR namevar EQ 'NbLongitudes'))[0] 128 romsgrid = strmid(namevar[xvarid], 0, 4) EQ 'lon_' 128 129 if xvarid EQ -1 then begin 129 130 print, 'the xaxis was not found, check the use of XAXISNAME keyword' … … 146 147 ; find the yaxis 147 148 if keyword_set(yaxisname) then yaxisname = strlowcase(yaxisname) ELSE yaxisname = 'y' 148 yvarid = where(namevar EQ yaxisname OR namevar EQ 'latitude' $149 OR namevar EQ 'nav_lat' OR namevar EQ 'lat' $150 OR namevar EQ 'NbLatitudes')149 yvarid = (where(namevar EQ yaxisname OR namevar EQ 'latitude' $ 150 OR namevar EQ 'nav_lat' OR namevar EQ 'lat' $ 151 OR namevar EQ 'lat_rho' OR namevar EQ 'NbLatitudes'))[0] 151 152 yvarid = yvarid[0] 152 153 if yvarid EQ -1 then begin … … 177 178 ;---------------------------------------------------------- 178 179 ; find the zaxis 179 if keyword_set(zaxisname) then zaxisname = strlowcase(zaxisname) ELSE zaxisname = 'z' 180 zvarid = where(namevar EQ 'nav_lev' or namevar EQ zaxisname OR namevar EQ 'level' OR namevar EQ 'lev' OR strmid(namevar, 0, 5) EQ 'depth') 181 zvarid = zvarid[0] 182 if zvarid EQ -1 AND inside.ndims GT 3 then begin 183 print, 'initncdf: the zaxis was not found..., check the the use of ZAXISNAME keyword if you whant to find one...' 180 IF keyword_set(romsgrid) THEN BEGIN 181 FOR i = 0, inside.ndims-1 DO BEGIN 182 ncdf_diminq, cdfid, i, name, size 183 CASE strlowcase(name) OF 184 's_rho':zaxis = reverse(indgen(size)) 185 's_u':zaxis = reverse(indgen(size)) 186 's_v':zaxis = reverse(indgen(size)) 187 's_psi':zaxis = reverse(indgen(size)) 188 's_w':zaxis = reverse(indgen(size-1)) 189 ELSE: 190 ENDCASE 191 ENDFOR 192 IF (where(namevar EQ 'h'))[0] NE -1 THEN BEGIN 193 ncdf_varget, cdfid, 'h', romsh 194 ENDIF ELSE romsh = -1 195 ENDIF ELSE BEGIN 196 if keyword_set(zaxisname) then zaxisname = strlowcase(zaxisname) ELSE zaxisname = 'z' 197 zvarid = (where(namevar EQ 'nav_lev' or namevar EQ zaxisname OR namevar EQ 'level' OR namevar EQ 'lev' OR strmid(namevar, 0, 5) EQ 'depth'))[0] 198 if zvarid EQ -1 AND inside.ndims GT 3 then begin 199 print, 'initncdf: the zaxis was not found..., check the the use of ZAXISNAME keyword if you whant to find one...' 184 200 ; stop 185 endif201 endif 186 202 ; read the zaxis 187 if zvarid NE -1 THEN ncdf_varget, cdfid, zvarid, zaxis 188 IF keyword_set(zindex) THEN $ 189 zaxis = keyword_set(start1) + findgen(n_elements(zaxis)) 203 if zvarid NE -1 THEN ncdf_varget, cdfid, zvarid, zaxis 204 ENDELSE 205 IF keyword_set(zindex) AND keyword_set(zaxis) THEN $ 206 zaxis = keyword_set(start1) + findgen(n_elements(zaxis)) 190 207 ;---------------------------------------------------------- 191 208 ; mask 209 IF NOT (keyword_set(maskname) OR keyword_set(useasmask)) AND keyword_set(romsgrid) THEN maskname = 'mask_rho' 192 210 CASE 1 OF 193 211 keyword_set(maskname):BEGIN … … 252 270 'scale_factor':ncdf_attget, cdfid, mskid, attname, scale_factor 253 271 'missing_value':IF n_elements(missing_value) EQ 0 THEN $ 254 ncdf_attget, cdfid, mskid, attname, missing_value272 ncdf_attget, cdfid, mskid, attname, missing_value 255 273 ELSE: 256 274 ENDCASE … … 279 297 ELSE:tmask = -1 280 298 ENDCASE 299 ; 281 300 ncdf_close, cdfid 282 301 ; 283 302 ; compute the grid 284 if zvarid EQ -1then BEGIN303 if NOT keyword_set(zaxis) then BEGIN 285 304 computegrid, xaxis = xaxis, yaxis = yaxis $ 286 , mask = tmask, onearth = 1b - keyword_set(xyindex), _EXTRA = ex305 , mask = tmask, onearth = 1b - keyword_set(xyindex), ROMSH = romsh, _EXTRA = ex 287 306 ENDIF ELSE BEGIN 288 307 computegrid, xaxis = xaxis, yaxis = yaxis, zaxis = zaxis $ 289 , mask = tmask, onearth = 1b - keyword_set(xyindex), _EXTRA = ex308 , mask = tmask, onearth = 1b - keyword_set(xyindex), ROMSH = romsh, _EXTRA = ex 290 309 ENDELSE 291 310 IF n_elements(time) EQ 0 THEN time = 0 -
trunk/SRC/ToBeReviewed/LECTURE/read_ncdf.pro
r163 r172 91 91 , PARENTIN = parentin, TIMESTEP = timestep, TIMEVAR = timevar $ 92 92 , TOUT = tout, NOSTRUCT = nostruct, CONT_NOFILL = CONT_NOFILL, INIT = init $ 93 , GRID = grid, FBASE2TBASE = fbase2tbase, _EXTRA = ex 93 , GRID = grid, FBASE2TBASE = fbase2tbase, _EXTRA = ex, CALLITSELF = callitself 94 94 ;--------------------------------------------------------- 95 95 ; … … 129 129 ENDIF 130 130 varcontient = ncdf_varinq(cdfid, name) 131 IF varcontient.ndims LT 2 THEN return, report('read_ncdf cannot read scalar or 1D data') 132 ; look for the dimension names 133 dimnames = strarr(varcontient.ndims) 134 FOR i = 0, varcontient.ndims-1 DO BEGIN 135 ncdf_diminq, cdfid, varcontient.dim[i], tmp, dimsize 136 dimnames[i] = tmp 137 ENDFOR 131 138 ;------------------------------------------------------------ 132 139 ; shall we redefine the grid parameters … … 144 151 if n_elements(ending) NE 0 then lasttps = ending[0] ELSE lasttps = firsttps 145 152 jpt = lasttps-firsttps+1 146 time = julday(1, 1, 1) + lindgen(jpt)153 IF NOT keyword_set(callitself) then time = julday(1, 1, 1) + lindgen(jpt) 147 154 ENDIF ELSE BEGIN 148 155 if keyword_set(parent) then BEGIN … … 236 243 mots = str_sep(value, ' ') 237 244 unite = mots[0] 245 IF unite NE 'seconds' AND unite NE 'hours' AND unite NE 'days' $ 246 AND unite NE 'months' AND unite NE 'years' THEN BEGIN 247 ncdf_close, cdfid 248 return, report('time units does not start with seconds/hours/days/months/years') 249 ENDIF 250 IF stregex(value, '[^ ]* since ([0-9]){4}-([0-9]){2}-([0-9]){2}.*', /boolean) EQ 0 THEN BEGIN 251 ncdf_close, cdfid 252 return, report('attribut units of time has not the good format: [^ ]* since ([0-9]){4}-([0-9]){2}-([0-9]){2}.*') 253 ENDIF 238 254 depart = str_sep(mots[2], '-') 239 255 ncdf_varget, cdfid, timeid, time … … 260 276 ELSE:BEGIN 261 277 ncdf_close, cdfid 262 return, report('The "units" attribu of the time axis must be something like: !C "seconds since 0001-01-01 ..." !C "days since 1979-01-01 ..." !C "months since 1979-01-01 ..." !C "years since 1979-01-01 ..."')278 return, report('The "units" attribute of the time axis must be something like: !C "seconds since 0001-01-01 ..." !C "days since 1979-01-01 ..." !C "months since 1979-01-01 ..." !C "years since 1979-01-01 ..."') 263 279 end 264 280 ENDCASE … … 291 307 vargrid = 'T' ; default definition 292 308 IF finite(glamu[0]) EQ 1 THEN BEGIN 293 pattern = ['GRID.', 'GRID_', 'GRID', 'UPID_', '30ID_'] 294 gdtype = ['T', 'U', 'V', 'W', 'F'] 295 fnametest = strupcase(filename) 296 FOR i = 0, n_elements(pattern)-1 DO BEGIN 297 FOR j = 0, n_elements(gdtype)-1 DO BEGIN 298 substr = pattern[i]+gdtype[j] 299 pos = strpos(fnametest, substr) 300 IF pos NE -1 THEN $ 301 vargrid = strmid(fnametest, pos+strlen(substr)-1, 1) 302 ENDFOR 303 ENDFOR 304 ENDIF 309 ; are we in one of the case corresponding to ROMS conventions? 310 CASE 1 OF 311 dimnames[2 <(varcontient.ndims-1)] EQ 's_w':vargrid = 'W' 312 dimnames[0] EQ 'xi_rho' AND dimnames[1] EQ 'eta_rho':vargrid = 'T' 313 dimnames[0] EQ 'xi_u' AND dimnames[1] EQ 'eta_u' :vargrid = 'U' 314 dimnames[0] EQ 'xi_v' AND dimnames[1] EQ 'eta_v' :vargrid = 'V' 315 dimnames[0] EQ 'xi_psi' AND dimnames[1] EQ 'eta_psi':vargrid = 'F' 316 dimnames[0] EQ 'xi_rho' AND dimnames[1] EQ 'eta_v' :vargrid = 'V' 317 dimnames[0] EQ 'xi_u' AND dimnames[1] EQ 'eta_rho':vargrid = 'U' 318 dimnames[0] EQ 'xi_u' AND dimnames[1] EQ 'eta_v' :vargrid = 'F' 319 ELSE:BEGIN 320 ; could we define the grid type from the file name?? 321 pattern = ['GRID.', 'GRID_', 'GRID', 'UPID_', '30ID_'] 322 gdtype = ['T', 'U', 'V', 'W', 'F'] 323 fnametest = strupcase(filename) 324 FOR i = 0, n_elements(pattern)-1 DO BEGIN 325 FOR j = 0, n_elements(gdtype)-1 DO BEGIN 326 substr = pattern[i]+gdtype[j] 327 pos = strpos(fnametest, substr) 328 IF pos NE -1 THEN $ 329 vargrid = strmid(fnametest, pos+strlen(substr)-1, 1) 330 ENDFOR 331 ENDFOR 332 END 333 ENDCASE 334 ENDIF 305 335 ENDELSE 306 336 ;--------------------------------------------------------------- … … 380 410 ENDIF 381 411 ; 412 IF n_elements(key_zreverse) EQ 0 THEN key_zreverse = 0 413 IF keyword_set(key_zreverse) THEN BEGIN 414 tmp = jpk-1-firstz 415 firstz = jpk-1-lastz 416 lastz = tmp 417 ENDIF 418 ; 382 419 IF keyword_set(fbase2tbase) THEN BEGIN 383 420 case strupcase(vargrid) of … … 419 456 ;--------------------------------------------------------------------- 420 457 ; varname 421 varname = name458 IF NOT keyword_set(callitself) THEN varname = name 422 459 ; varunit 423 460 if varcontient.natts NE 0 then begin … … 428 465 found = (where(lowattnames EQ 'units'))[0] 429 466 IF found NE -1 then ncdf_attget, cdfid, name, attnames[found], value ELSE value = '' 430 varunit = strtrim(string(value), 2)467 IF NOT keyword_set(callitself) THEN varunit = strtrim(string(value), 2) 431 468 ; 432 469 found = (where(lowattnames EQ 'add_offset'))[0] … … 443 480 ; 444 481 ENDIF ELSE BEGIN 445 varunit = ''482 IF NOT keyword_set(callitself) THEN varunit = '' 446 483 add_offset = 0. 447 484 scale_factor = 1. … … 457 494 458 495 ; we apply reverse 459 if keyword_set(key_yreverse) then res = reverse(temporary(res), 2) 460 if keyword_set(key_zreverse) AND (size(res))[0] EQ 3 AND jpt EQ 1 then res = reverse(temporary(res), 3) 461 if keyword_set(key_zreverse) AND (size(res))[0] EQ 4 THEN res = reverse(temporary(res), 3) 462 496 if keyword_set(key_yreverse) AND ny NE 1 THEN $ 497 res = reverse(reform(res, nx, ny, nz, jpt, /overwrite), 2) 498 if keyword_set(key_zreverse) AND nz NE 1 $ 499 AND varcontient.ndims - ((where(varcontient.dim EQ contient.recdim))[0] NE -1) EQ 3 THEN $ 500 res = reverse(reform(res, nx, ny, nz, jpt, /overwrite), 3) 463 501 ; We apply the value valmask on land points. 464 502 if NOT keyword_set(cont_nofill) then begin … … 501 539 if add_offset NE 0 then res = temporary(res)+add_offset 502 540 if missing[0] NE -1 then res[temporary(missing)] = !values.f_nan 503 if earth[0] NE -1 then res[temporary(earth)] = 1e20 541 if earth[0] NE -1 then res[temporary(earth)] = 1.e20 542 ;--------------------------------------------------------------------- 543 ; if it is roms outputs, we need to get additionals infos... 544 IF NOT keyword_set(callitself) THEN BEGIN 545 IF strmid(dimnames[0], 0, 3) EQ 'xi_' AND strmid(dimnames[1], 0, 4) EQ 'eta_' THEN BEGIN 546 ncdf_attget, cdfid, 'theta_s', theta_s, /global 547 ncdf_attget, cdfid, 'theta_b', theta_b, /global 548 ncdf_attget, cdfid, 'hc', hc, /global 549 ; +++ binder l'exsitance de h et zeta... 550 ; +++ mettre zeta a 0 par defaut 551 hroms = read_ncdf('h', 0, 0, FILENAME = filename $ 552 , /TIMESTEP, /NOSTRUCT, CONT_NOFILL = CONT_NOFILL $ 553 , GRID = vargrid, /CALLITSELF, _EXTRA = ex) 554 zeta = read_ncdf('zeta', firsttps, lasttps, FILENAME = filename $ 555 , /TIMESTEP, /NOSTRUCT, CONT_NOFILL = CONT_NOFILL $ 556 , GRID = vargrid, /CALLITSELF, _EXTRA = ex) 557 romszinfos = {h:temporary(hroms), zeta:temporary(zeta), theta_s:theta_s, theta_b:theta_b, hc:hc} 558 ENDIF ELSE romszinfos = {h:-1, zeta:-1, theta_s:-1, theta_b:-1, hc:-1} 559 ENDIF 504 560 ;--------------------------------------------------------------------- 505 561 ncdf_close, cdfid 506 ;--------------------------------------------------------------------- 507 ifkeyword_set(savedbox) THEN restoreboxparam, 'boxparam4rdncdf.dat'508 if keyword_set(nostruct) then return, res $ 509 ELSE BEGIN510 511 return, {arr:res, grid:vargrid, unit:varunit, experiment:varexp, name:varname}512 513 return, {tab:res, grille:vargrid, unite:varunit, experience:varexp, nom:varname}514 ENDELSE515 ENDELSE 562 563 IF keyword_set(savedbox) THEN restoreboxparam, 'boxparam4rdncdf.dat' 564 565 IF keyword_set(nostruct) THEN return, res 566 IF keyword_set(key_forgetold) THEN BEGIN 567 return, {arr:temporary(res), grid:vargrid, unit:varunit, experiment:varexp, name:varname} 568 ENDIF ELSE BEGIN 569 return, {tab:temporary(res), grille:vargrid, unite:varunit, experience:varexp, nom:varname} 570 ENDELSE 571 516 572 END 517 573 -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/plt1d.pro
r163 r172 180 180 z1d = checkfield(tab, 'plt1d', TYPE = type, BOXZOOM = boxzoom $ 181 181 , direc = direc, _extra = ex) 182 grille, mask, glam, gphi, gdep, nx, ny, nz 182 grille, mask, glam, gphi, gdep, nx, ny, nz, type = type 183 183 ENDELSE 184 184 if z1d[0] EQ -1 then BEGIN -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltt.pro
r163 r172 267 267 return 268 268 endif 269 grille, mask, glam, gphi, gdep, nx, ny, nz269 grille, mask, glam, gphi, gdep, nx, ny, nz, type = type 270 270 ENDELSE 271 271 ;--------------------------------------------------------------- … … 412 412 end 413 413 type eq 'zt' : begin 414 yy = gdep 414 IF size(gdep, /n_dimensions) EQ 2 THEN $ 415 yy = transpose(gdep) ELSE yy = gdep 415 416 xx = temps-tempsmin 416 417 z2d = transpose(z2d) … … 463 464 z2d = remplit(z2d,nite=2+keyword_set(nan), mask = mask, /basique, _extra=ex) 464 465 if NOT keyword_set(strictfill) then z2d = min > z2d < max 465 if keyword_set(nan) then $ 466 triangulation = triangule(mask,/basic,coinmonte=coinmontemask $ 467 ,coindescend=coindescendmask) $ 468 ELSE triangulation = -1 466 if keyword_set(nan) then BEGIN 467 triangulation = triangule(mask, /basic, coinmonte = coinmontemask $ 468 , coindescend = coindescendmask) 469 usetri = 1 470 ENDIF ELSE triangulation = -1 471 472 IF size(gdep, /n_dimensions) EQ 2 THEN BEGIN 473 usetri = 2 474 IF triangulation[0] EQ -1 THEN $ 475 triangulation = triangule(mask, /basic, coinmonte = coinmontemask $ 476 , coindescend = coindescendmask) 477 ENDIF 469 478 ;---------------------------------------------------------------------- 470 pltbase, z2d, xx, yy, mask,xx, yy, level_z2d,colnumb, contour = contour,/noerase $479 pltbase, z2d, xx, yy, mask, xx, yy, level_z2d, colnumb, contour = contour, /noerase $ 471 480 , c_linestyle=linestyle,c_labels=1-(indgen(n_elements(level_z2d)) MOD 2) $ 472 481 , trichamp = triangulation, trimsk = triangulation, overplot = overplot $ 473 , c_thick=thick, performance = key_performance, usetri = keyword_set(nan)$482 , c_thick=thick, performance = key_performance, usetri = usetri $ 474 483 , coinmontemask=coinmontemask, coindescendmask=coindescendmask, _extra = ex 475 484 ;------------------------------------------------------------ -
trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltz.pro
r171 r172 244 244 return 245 245 ENDIF 246 IF realsection EQ 1 THEN grille, mask, glam, gphi, gdep, nx, ny, nz, ifpltz= type, WDEPTH = wdepth $246 IF realsection EQ 1 THEN grille, mask, glam, gphi, gdep, nx, ny, nz, type = type, WDEPTH = wdepth $ 247 247 ELSE grille, mask, glam, gphi, gdep, nx, ny, nz, WDEPTH = wdepth 248 248 ENDELSE 249 ; stop 249 IF size(gdep, /n_dimensions) EQ 2 THEN usetri = 2 250 250 ;--------------------------------------------------------------- 251 251 profmax = !y.range[0] … … 357 357 ; dessin en lui meme 358 358 ;------------------------------------------------------------ 359 IF n_elements(romszinfos) EQ 1 THEN BEGIN 360 ; add one line at bottom to have nicer plot (colors go until the ocean bottom) 361 IF n_elements(romszinfos.h) NE 1 THEN BEGIN 362 CASE type OF 363 'xz':romsh = moyenne(romszinfos.h, 'y') 364 'yz':romsh = moyenne(romszinfos.h, 'x') 365 ENDCASE 366 IF nzt EQ jpk THEN BEGIN 367 z2d = [[z2d], [z2d[*, jpk-1]]] 368 zzaxis = [[zzaxis], [romsh]] 369 ENDIF 370 ENDIF 371 ENDIF 359 372 pltbase, z2d, xxaxis, zzaxis, mask, xmask, zmask $ 360 373 , level_z2d, colnumb, overplot = overplot $ -
trunk/SRC/ToBeReviewed/PLOTS/DIVERS/axis4pltz.pro
r163 r172 90 90 ENDELSE 91 91 if keyword_set(sin) then xxaxis = sin(!pi/180.*xxaxis) 92 if (size(z))[0] EQ 1 THEN zzaxis = z ELSE zzaxis = z93 92 ENDIF ELSE BEGIN 94 93 xxaxis = glam[*, 0] 95 if (size(z))[0] EQ 1 then zzaxis = z ELSE zzaxis = z96 94 ENDELSE 95 zzaxis = z 97 96 ;---------------------------------------------------------- 98 97 ; We project the z axis in [0,1] … … 102 101 if zoom LT profmax then begin 103 102 mp = projsegment([profmin, zoom], [0, zratio], /mp) 104 zzaxis[where(zzaxis LE zoom)] = mp[0]*zzaxis[where(zzaxis LE zoom)]+mp[1] 103 small = where(zzaxis LE zoom) 104 IF small[0] NE -1 THEN zzaxis[small] = mp[0]*zzaxis[small]+mp[1] 105 105 mp = projsegment([zoom, profmax], [zratio, 1], /mp) 106 zzaxis[where(zzaxis GE zoom)] = mp[0]*zzaxis[where(zzaxis GE zoom)]+mp[1] 106 big = where(zzaxis GE zoom) 107 IF big[0] NE -1 THEN zzaxis[big] = mp[0]*zzaxis[big]+mp[1] 107 108 ENDIF ELSE BEGIN 108 109 mp = projsegment([profmin, profmax], [0, 1], /mp) -
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/buildcmd.pro
r157 r172 184 184 if yindex NE 0 then extra = create_struct(extra, 'yindex', yindex) 185 185 exextra = cw_specifie_get_value(base) 186 tgnm = strlowcase(tag_names(exextra)) 187 indtmp = where(tgnm EQ 'box' OR tgnm EQ 'boxzoom', cnt) 188 IF cnt EQ 1 THEN BEGIN 189 boxextra = exextra.(indtmp[0]) 190 exextra = extractstru(exextra, ['box', 'boxzoom']) 191 ENDIF 186 192 extra = mixstru(exextra, extra) 187 193 sextra = struct2string(extra) … … 342 348 ; determination of the boxzoom's name. 343 349 if NOT keyword_set(boxzoom) then widget_control, domainid, get_value = boxzoom 350 CASE n_elements(boxextra) OF 351 0: 352 1:boxzoom[5] = boxextra 353 2:boxzoom[4:5] = boxextra 354 4:boxzoom[0:3] = boxextra 355 5:boxzoom = [boxextra[0:3], 0, boxextra[4]] 356 6:boxzoom = boxextra 357 ENDCASE 344 358 ; Writting of this one as a string 345 359 box = '['+strtrim(boxzoom[0], 1) … … 358 372 if chkstru(exextra, 'profmax') then pmax = exextra.profmax $ 359 373 ELSE pmax = 200 360 box = box+',0,'+strtrim( pmax, 1)374 box = box+',0,'+strtrim(boxzoom[5] > pmax, 1) 361 375 ENDELSE 362 376 endif -
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/buildreadcmd.pro
r157 r172 87 87 if yindex NE 0 then extra = create_struct(extra, 'yindex', yindex) 88 88 exextra = cw_specifie_get_value(base) 89 exextra = extractstru(exextra, ['min', 'max', 'inter', 'lct']) 89 tgnm = strlowcase(tag_names(exextra)) 90 indtmp = where(tgnm EQ 'box' OR tgnm EQ 'boxzoom', cnt) 91 IF cnt EQ 1 THEN boxextra = exextra.(indtmp[0]) 92 exextra = extractstru(exextra, ['min', 'max', 'inter', 'lct', 'box', 'boxzoom']) 90 93 if size(exextra, /type) EQ 8 then extra = mixstru(exextra, extra) 91 94 sextra = struct2string(extra) … … 116 119 ;--------------- 117 120 if NOT keyword_set(boxzoom) then widget_control, domainid, get_value = boxzoom 121 CASE n_elements(boxextra) OF 122 0: 123 1:boxzoom[5] = boxextra 124 2:boxzoom[4:5] = boxextra 125 4:boxzoom[0:3] = boxextra 126 5:boxzoom = [boxextra[0:3], 0, boxextra[4]] 127 6:boxzoom = boxextra 128 ENDCASE 118 129 ; put boxzoom into a string 119 130 box = '['+strtrim(boxzoom[0], 1) … … 121 132 box = box+', '+strtrim(boxzoom[i], 1) 122 133 if strpos(type, 'z') NE -1 then BEGIN 123 @c ommon124 min = min([gdept, gdepw ], max = max)134 @cm_4mesh 135 min = min([gdept, gdepw, boxzoom[4:5]], max = max) 125 136 box = box+','+strtrim(floor(min), 1)+','+strtrim(ceil(max), 1) 126 137 endif -
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/scanfile.pro
r167 r172 89 89 ;------------------------------------------------------------ 90 90 infile = ncdf_inquire(cdfid) ; 91 ; find vargrid ... 92 IF keyword_set(grid) THEN vargrid = strupcase(grid) ELSE BEGIN 93 vargrid = 'T' ; default definition 94 IF finite(glamu[0]) EQ 1 THEN BEGIN 91 ;------------------------------------------------------------ 92 ; name of all dimensions 93 ;------------------------------------------------------------ 94 namedim = strarr(infile.ndims) 95 for dimiq = 0, infile.ndims-1 do begin 96 ncdf_diminq, cdfid, dimiq, tmpname, value 97 namedim[dimiq] = strlowcase(tmpname) 98 ENDFOR 99 ; roms file? 100 dimidx = where(namedim EQ 'xi_rho' OR namedim EQ 'xi_u' OR namedim EQ 'xi_v' OR namedim EQ 'xi_psi') 101 IF dimidx[0] EQ -1 THEN BEGIN 102 ; we are looking for a x dimension with a name matching one of the following regular expression: 103 testname = ['longitude', 'lon', 'x', 'longitude*', 'lon*', 'x*', '*longitude*', '*lon*', '*x*'] 104 cnt = -1 105 ii = 0 106 WHILE cnt NE 1 AND ii LT n_elements(testname) DO BEGIN 107 dimidx = where(strmatch(namedim, testname[ii]) EQ 1, cnt) 108 ii = ii+1 109 ENDWHILE 110 CASE cnt OF 111 0:begin 112 dummy = report(['none of the dimensions name matches one of the following regular expression:' $ 113 , '''longitude'', ''lon'', ''x'', ''longitude*'', ''lon*'', ''x*'', ''*longitude*'', ''*lon*'', ''*x*''' $ 114 , ' => we cannot find the x dimension']) 115 stop 116 END 117 1:dimidx = dimidx[0] 118 ELSE:begin 119 dummy = report(['several (and not one unique) dimensions name matches the following regular expression:' $ 120 , '''longitude'', ''lon'', ''x'', ''longitude*'', ''lon*'', ''x*'', ''*longitude*'', ''*lon*'', ''*x*''' $ 121 , ' => we cannot find the x dimension']) 122 stop 123 ENDELSE 124 ENDCASE 125 ENDIF 126 ; roms file? 127 dimidy = where(namedim EQ 'eta_rho' OR namedim EQ 'eta_u' OR namedim EQ 'eta_v' OR namedim EQ 'eta_psi') 128 IF dimidy[0] EQ -1 THEN BEGIN 129 ; we are looking for a y dimension with a name matching one of the following regular expression: 130 testname = ['latitude', 'lat', 'y', 'latitude*', 'lat*', 'y*', 'eta_*', '*latitude*', '*lat*', '*y*'] 131 cnt = -1 132 ii = 0 133 WHILE cnt NE 1 AND ii LT n_elements(testname) DO BEGIN 134 dimidy = where(strmatch(namedim, testname[ii]) EQ 1, cnt) 135 ii = ii+1 136 ENDWHILE 137 CASE cnt OF 138 0:begin 139 dummy = report(['none of the dimensions name matches one of the following regular expression:' $ 140 , '''latitude'', ''lat'', ''y'', ''latitude*'', ''lat*'', ''y*'', ''eta_*'', ''*latitude*'', ''*lat*'', ''*y*''' $ 141 , ' => we cannot find the y dimension']) 142 stop 143 END 144 1:dimidy = dimidy[0] 145 ELSE:begin 146 dummy = report(['several (and not one unique) dimensions name matches the following regular expression:' $ 147 , '''latitude'', ''lat'', ''y'', ''latitude*'', ''lat*'', ''y*'', ''eta_*'', ''*latitude*'', ''*lat*'', ''*y*''' $ 148 , ' => we cannot find the x dimension']) 149 stop 150 ENDELSE 151 ENDCASE 152 ENDIF 153 ;------------------------------------------------------------ 154 ; name of all variables 155 ;------------------------------------------------------------ 156 ; we keep only the variables containing at least x, y and time dimension (if existing...) 157 namevar = strarr(infile.nvars) 158 for varid = 0, infile.nvars-1 do begin 159 invar = ncdf_varinq(cdfid, varid) ; what contains the variable? 160 if (inter(invar.dim, dimidx))[0] NE -1 AND $ 161 (inter(invar.dim, dimidy))[0] NE -1 AND $ 162 ((where(invar.dim EQ infile.recdim))[0] NE -1 OR infile.recdim EQ -1) $ 163 THEN namevar[varid] = invar.name 164 ENDFOR 165 namevar = namevar[where(namevar NE '')] 166 ;------------------------------------------------------------ 167 ; find vargrid for each selected variable... 168 ;------------------------------------------------------------ 169 listgrid = strarr(n_elements(namevar)) 170 ; default definitions 171 IF keyword_set(grid) THEN vargrid = strupcase(grid) ELSE vargrid = 'T' 172 ; look for values of vargrid for each variable 173 IF finite(glamu[0]) EQ 1 AND NOT keyword_set(grid) THEN BEGIN 174 ; for each variable, look if we in one of the case corresponding to ROMS conventions? 175 FOR i = 0, n_elements(namevar)-1 do begin 176 invar = ncdf_varinq(cdfid, namevar[i]) 177 tmpnm = namedim[invar.dim] 178 ; are we in one of the case corresponding to ROMS conventions? 179 CASE 1 OF 180 tmpnm[2 <(invar.ndims-1)] EQ 's_w':vargrid = 'W' 181 tmpnm[0] EQ 'xi_rho' AND tmpnm[1] EQ 'eta_rho':listgrid[i] = 'T' 182 tmpnm[0] EQ 'xi_u' AND tmpnm[1] EQ 'eta_u' :listgrid[i] = 'U' 183 tmpnm[0] EQ 'xi_v' AND tmpnm[1] EQ 'eta_v' :listgrid[i] = 'V' 184 tmpnm[0] EQ 'xi_psi' AND tmpnm[1] EQ 'eta_psi':listgrid[i] = 'F' 185 tmpnm[0] EQ 'xi_rho' AND tmpnm[1] EQ 'eta_v' :listgrid[i] = 'V' 186 tmpnm[0] EQ 'xi_u' AND tmpnm[1] EQ 'eta_rho':listgrid[i] = 'U' 187 tmpnm[0] EQ 'xi_u' AND tmpnm[1] EQ 'eta_v' :listgrid[i] = 'F' 188 ELSE: 189 ENDCASE 190 ENDFOR 191 empty = where(listgrid EQ '') 192 IF empty[0] NE -1 THEN BEGIN 193 ; could we define the grid type from the file name?? 95 194 pattern = ['GRID.', 'GRID_', 'GRID', 'UPID_', '30ID_'] 96 195 gdtype = ['T', 'U', 'V', 'W', 'F'] … … 104 203 ENDFOR 105 204 ENDFOR 106 ENDIF 107 ENDELSE 108 ;------------------------------------------------------------ 109 ; name of all dimensions 110 ;------------------------------------------------------------ 111 namedim = strarr(infile.ndims) 112 for dimiq = 0, infile.ndims-1 do begin 113 ncdf_diminq, cdfid, dimiq, tmpname, value 114 namedim[dimiq] = strlowcase(tmpname) 115 ENDFOR 116 ; we are looking for a x dimension with a name matching one of the following regular expression: 117 testname = ['longitude', 'lon', 'x', 'longitude*', 'lon*', 'x*', '*longitude*', '*lon*', '*x*'] 118 cnt = -1 119 ii = 0 120 WHILE cnt NE 1 AND ii LT n_elements(testname) DO BEGIN 121 dimidx = where(strmatch(namedim, testname[ii]) EQ 1, cnt) 122 ii = ii+1 123 ENDWHILE 124 CASE cnt OF 125 0:begin 126 dummy = report(['none of the dimensions name matches one of the following regular expression:' $ 127 , '''longitude'', ''lon'', ''x'', ''longitude*'', ''lon*'', ''x*'', ''*longitude*'', ''*lon*'', ''*x*''' $ 128 , ' => we cannot find the x dimension']) 129 stop 130 END 131 1:dimidx = dimidx[0] 132 ELSE:begin 133 dummy = report(['several (and not one unique) dimensions name matches the following regular expression:' $ 134 , '''longitude'', ''lon'', ''x'', ''longitude*'', ''lon*'', ''x*'', ''*longitude*'', ''*lon*'', ''*x*''' $ 135 , ' => we cannot find the x dimension']) 136 stop 137 END 138 ENDCASE 139 ; we are looking for a y dimension with a name matching one of the following regular expression: 140 testname = ['latitude', 'lat', 'y', 'latitude*', 'lat*', 'y*', 'eta_*', '*latitude*', '*lat*', '*y*'] 141 cnt = -1 142 ii = 0 143 WHILE cnt NE 1 AND ii LT n_elements(testname) DO BEGIN 144 dimidy = where(strmatch(namedim, testname[ii]) EQ 1, cnt) 145 ii = ii+1 146 ENDWHILE 147 CASE cnt OF 148 0:begin 149 dummy = report(['none of the dimensions name matches one of the following regular expression:' $ 150 , '''latitude'', ''lat'', ''y'', ''latitude*'', ''lat*'', ''y*'', ''eta_*'', ''*latitude*'', ''*lat*'', ''*y*''' $ 151 , ' => we cannot find the y dimension']) 152 stop 153 END 154 1:dimidy = dimidy[0] 155 ELSE:begin 156 dummy = report(['several (and not one unique) dimensions name matches the following regular expression:' $ 157 , '''latitude'', ''lat'', ''y'', ''latitude*'', ''lat*'', ''y*'', ''eta_*'', ''*latitude*'', ''*lat*'', ''*y*''' $ 158 , ' => we cannot find the x dimension']) 159 stop 160 END 161 ENDCASE 162 ;------------------------------------------------------------ 163 ; name of all variables 164 ;------------------------------------------------------------ 165 ; we keep only the variables containing at least x, y and time dimension (if existing...) 166 namevar = strarr(infile.nvars) 167 for varid = 0, infile.nvars-1 do begin 168 invar = ncdf_varinq(cdfid, varid) ; what contains the variable? 169 if (where(invar.dim EQ dimidx))[0] NE -1 AND $ 170 (where(invar.dim EQ dimidy))[0] NE -1 AND $ 171 ((where(invar.dim EQ infile.recdim))[0] NE -1 OR infile.recdim EQ -1) $ 172 THEN namevar[varid] = invar.name 173 ENDFOR 174 namevar = namevar[where(namevar NE '')] 175 listgrid = replicate(vargrid, n_elements(namevar)) 205 listgrid[empty] = vargrid 206 ENDIF 207 ENDIF ELSE listgrid[*] = vargrid 176 208 ;------------------------------------------------------------ 177 209 ; time axis … … 229 261 mots = str_sep(value, ' ') 230 262 unite = mots[0] 231 debut = str_sep(mots[2], '-') 263 err = 0 264 IF unite NE 'seconds' AND unite NE 'hours' AND unite NE 'days' $ 265 AND unite NE 'months' AND unite NE 'years' THEN BEGIN 266 dummy = report('time units does not start with seconds/hours/days/months/years') 267 err = 1 268 ENDIF 269 err = err + 1 - stregex(value, '[^ ]* since ([0-9]){4}-([0-9]){2}-([0-9]){2}.*', /boolean) 270 IF err GT 0 THEN BEGIN 271 dummy = report('attribut units of time has not the good format: [^ ]* since ([0-9]){4}-([0-9]){2}-([0-9]){2}.*') 272 fakecal = 1 273 time = date0fk + lindgen(jpt) 274 ENDIF ELSE BEGIN 275 debut = str_sep(mots[2], '-') 232 276 ; 233 277 ; now we try to find the attribut called calendar... … … 235 279 ; If no, we suppose that the calendar is gregorian calendar 236 280 ; 237 if (where(attnames EQ 'calendar'))[0] NE -1 then BEGIN238 ncdf_attget, cdfid, varid, 'calendar', value239 value = string(value)240 CASE value OF241 'noleap':key_caltype = 'noleap'242 '360d':key_caltype = '360d'243 'greg':IF n_elements(key_caltype) EQ 0 THEN key_caltype = 'greg'244 ELSE:BEGIN281 if (where(attnames EQ 'calendar'))[0] NE -1 then BEGIN 282 ncdf_attget, cdfid, varid, 'calendar', value 283 value = string(value) 284 CASE value OF 285 'noleap':key_caltype = 'noleap' 286 '360d':key_caltype = '360d' 287 'greg':IF n_elements(key_caltype) EQ 0 THEN key_caltype = 'greg' 288 ELSE:BEGIN 245 289 ; notused = report('Unknown calendar: '+value+', we use greg calendar.') 246 key_caltype = 'greg' 290 key_caltype = 'greg' 291 END 292 ENDCASE 293 ENDIF ELSE BEGIN 294 ; notused = report('Unknown calendar, we use '+key_caltype+' calendar.') 295 IF n_elements(key_caltype) EQ 0 THEN key_caltype = 'greg' 296 ENDELSE 297 ; 298 ; BEWARE we have to get back the calendar attribute and ajust time by consequence... 299 ; 300 ; 301 ; We pass time in IDL julian days 302 ; 303 unite = strlowcase(unite) 304 IF strpos(unite, 's', strlen(unite)-1) NE -1 THEN unite = strmid(unite, 0, strlen(unite)-1) 305 IF strpos(unite, 'julian_') NE -1 THEN unite = strmid(unite, 7) 306 case unite of 307 'second':time = julday(debut[1], debut[2], debut[0])+time/86400.d 308 'hour':time = julday(debut[1], debut[2], debut[0])+time/24.d 309 'day':time = julday(debut[1], debut[2], debut[0])+time 310 'month':BEGIN 311 if total(fix(time) NE time) NE 0 then $ ; we switch to days with 30d/m 312 time = julday(debut[1], debut[2], debut[0])+round(time*30) $ 313 ELSE for t = 0, n_elements(time)-1 DO $ 314 time[t] = julday(debut[1]+time[t], debut[2], debut[0]) 315 END 316 'year':BEGIN 317 if total(fix(time) NE time) NE 0 then $ ; we switch to days with 365d/y 318 time = julday(debut[1], debut[2], debut[0])+round(time*365) $ 319 ELSE for t = 0, n_elements(time)-1 do $ 320 time[t] = julday(debut[1], debut[2], debut[0]+time[t]) 247 321 END 248 322 ENDCASE 249 ENDIF ELSE BEGIN 250 ; notused = report('Unknown calendar, we use '+key_caltype+' calendar.') 251 IF n_elements(key_caltype) EQ 0 THEN key_caltype = 'greg' 323 ; 324 ; high frequency calendar: more than one element per day 325 IF max(histogram([long(time-time[0])])) GT 1 THEN fakecal = 1 ELSE fakecal = 0 326 date0fk = date2jul(19000101) 327 IF keyword_set(fakecal) THEN time = date0fk+lindgen(jpt) $ 328 ELSE time = long(time) 329 ; 252 330 ENDELSE 253 ;254 ; BEWARE we have to get back the calendar attribute and ajust time by consequence...255 ;256 ;257 ; We pass time in IDL julian days258 ;259 unite = strlowcase(unite)260 IF strpos(unite, 's', strlen(unite)-1) NE -1 THEN unite = strmid(unite, 0, strlen(unite)-1)261 IF strpos(unite, 'julian_') NE -1 THEN unite = strmid(unite, 7)262 case unite of263 'second':time = julday(debut[1], debut[2], debut[0])+time/86400.d264 'hour':time = julday(debut[1], debut[2], debut[0])+time/24.d265 'day':time = julday(debut[1], debut[2], debut[0])+time266 'month':BEGIN267 if total(fix(time) NE time) NE 0 then $ ; we switch to days with 30d/m268 time = julday(debut[1], debut[2], debut[0])+round(time*30) $269 ELSE for t = 0, n_elements(time)-1 DO $270 time[t] = julday(debut[1]+time[t], debut[2], debut[0])271 END272 'year':BEGIN273 if total(fix(time) NE time) NE 0 then $ ; we switch to days with 365d/y274 time = julday(debut[1], debut[2], debut[0])+round(time*365) $275 ELSE for t = 0, n_elements(time)-1 do $276 time[t] = julday(debut[1], debut[2], debut[0]+time[t])277 END278 ENDCASE279 ;280 ; high frequency calendar: more than one element per day281 IF max(histogram([long(time-time[0])])) GT 1 THEN fakecal = 1 ELSE fakecal = 0282 date0fk = date2jul(19000101)283 IF keyword_set(fakecal) THEN time = date0fk+lindgen(jpt) $284 ELSE time = long(time)285 ;286 331 ENDELSE 287 332 END -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_domain.pro
r167 r172 245 245 gdep1 = floor(gdep) 246 246 gdep2 = ceil(gdep) 247 same = where(gdep2-gdep1 EQ 0)248 if same[0] NE -1 then gdep2[same] = gdep2[same] + 1247 ;; same = where(gdep2-gdep1 EQ 0) 248 ;; if same[0] NE -1 then gdep2[same] = gdep2[same] + 1 249 249 widget_control, dthlv1id, set_value = {value:strtrim(gdep1, 1)} 250 250 widget_control, dthlv2id, set_value = {value:strtrim(gdep2, 1)} … … 321 321 compile_opt idl2, strictarrsubs 322 322 ; 323 box = lonarr(6)323 box = fltarr(6) 324 324 possiblecase = ['lon1', 'lon2', 'lat1', 'lat2', 'depth1', 'depth2'] 325 325 for i = 0, 5 do begin … … 327 327 , get_value = value 328 328 box[i] = value.value 329 endfor329 ENDFOR 330 330 return, box 331 331 end … … 636 636 gdep1 = floor(gdep) 637 637 gdep2 = ceil(gdep) 638 same = where(gdep2-gdep1 EQ 0)639 if same[0] NE -1 then gdep2[same] = gdep2[same] +1638 ;; same = where(gdep2-gdep1 EQ 0) 639 ;; if same[0] NE -1 then gdep2[same] = gdep2[same] +1 640 640 sgdep1 = strtrim(gdep1, 1) 641 641 sgdep2 = strtrim(gdep2, 1)
Note: See TracChangeset
for help on using the changeset viewer.