Changeset 205 for trunk/procs
- Timestamp:
- 01/26/10 10:46:13 (14 years ago)
- Location:
- trunk/procs
- Files:
-
- 78 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/procs/add_txt_pltt.pro
r203 r205 2 2 ; 3 3 ; define additional text for <pro>pltt</pro> 4 ; 5 ; TODO 6 ; ==== 7 ; 8 ; should be a function 4 9 ; 5 10 ; @version … … 19 24 ; anomaly 20 25 IF strmid(cmd.trend, 0, 1) EQ '4' THEN BEGIN 21 IF strmid(cmd.trend, 1, strlen(cmd.trend)-1) EQ 12 THEN $ 22 filleg = filleg+' [seasonal anomaly n=12]' ELSE $ 26 IF strmid(cmd.trend, 1, strlen(cmd.trend)-1) EQ 12 THEN BEGIN 27 filleg = filleg+' [seasonal anomaly n=12]' 28 ENDIF ELSE BEGIN 23 29 filleg = filleg+' [n='+strmid(cmd.trend, 1, strlen(cmd.trend)-1)+ ' anomaly]' 30 ENDELSE 24 31 ENDIF 25 32 ; integral -
trunk/procs/ajoutvectz.pro
r203 r205 140 140 ;------------------------------------------------------------ 141 141 CASE type OF 142 'yz': IF grilleu EQ '' then grilleu = 'V' 143 'xz': IF grilleu EQ '' then grilleu = 'U' 144 ELSE: IF grilleu EQ '' then grilleu = 'V' 142 'yz': IF grilleu EQ '' THEN BEGIN 143 grilleu = 'V' 144 ENDIF 145 'xz': IF grilleu EQ '' THEN BEGIN 146 grilleu = 'U' 147 ENDIF 148 ELSE: IF grilleu EQ '' THEN BEGIN 149 grilleu = 'V' 150 ENDIF 145 151 ENDCASE 146 IF grillew EQ '' then grillew = 'W' 147 148 IF grilleu EQ 'T' AND grillew EQ 'T' THEN interpolle = 0 ELSE interpolle = 1 152 IF grillew EQ '' THEN BEGIN 153 grillew = 'W' 154 ENDIF 155 156 IF grilleu EQ 'T' AND grillew EQ 'T' THEN BEGIN 157 interpolle = 0 158 ENDIF ELSE BEGIN 159 interpolle = 1 160 ENDELSE 149 161 150 162 ;------------------------------------------------------------ 151 163 ; on trouve les points que u et v ont en communs 152 164 ;------------------------------------------------------------ 153 if interpolle then begin165 if interpolle THEN BEGIN 154 166 CASE type OF 155 167 'yz': indicehx = (lindgen(jpj))[firstyv:firstyv+nyv-1] … … 179 191 ; extraction de u et v sur le domaine qui convient 180 192 ;------------------------------------------------------------ 181 if nxh NE nx then $ 182 if indicex[0] EQ firsth then u = u[0:nx-1, *] ELSE u = u[1: nx, *] 183 IF nxt NE nx THEN $ 184 if indicex[0] EQ firstxt then w = w[0:nx-1, *] ELSE w = w[1: nx, *] 185 IF nzt NE nz THEN $ 186 if indicez[0] EQ firstzt then u = u[*, 0:nz-1] ELSE u = u[*, 1: nz] 187 IF nzw NE nz THEN $ 188 if indicez[0] EQ firstzw then w = w[*, 0:nz-1] ELSE w = w[*, 1: nz] 193 if nxh NE nx THEN BEGIN 194 if indicex[0] EQ firsth THEN BEGIN 195 u = u[0:nx-1, *] 196 ENDIF ELSE BEGIN 197 u = u[1: nx, *] 198 ENDELSE 199 ENDIF 200 IF nxt NE nx THEN BEGIN 201 if indicex[0] EQ firstxt THEN BEGIN 202 w = w[0:nx-1, *] 203 ENDIF ELSE BEGIN 204 w = w[1: nx, *] 205 ENDELSE 206 ENDIF 207 IF nzt NE nz THEN BEGIN 208 if indicez[0] EQ firstzt THEN BEGIN 209 u = u[*, 0:nz-1] 210 ENDIF ELSE BEGIN 211 u = u[*, 1: nz] 212 ENDELSE 213 ENDIF 214 IF nzw NE nz THEN BEGIN 215 if indicez[0] EQ firstzw THEN BEGIN 216 w = w[*, 0:nz-1] 217 ENDIF ELSE BEGIN 218 w = w[*, 1: nz] 219 ENDELSE 220 ENDIF 189 221 ;------------------------------------------------------------------ 190 222 ; on reform u et w pour s'assurer qu'aucune dimension n'a ete ecrasee 191 223 ;------------------------------------------------------------------ 192 if nz EQ 1 then begin224 if nz EQ 1 THEN BEGIN 193 225 u = reform(u, nx, nz) 194 226 w = reform(w, nx, nz) … … 199 231 200 232 terre = where(u GE valmask/10.) 201 IF terre[0] NE -1 THEN u[terre] = !VALUES.F_NAN 233 IF terre[0] NE -1 THEN BEGIN 234 u[terre] = !VALUES.F_NAN 235 ENDIF 202 236 terre = where(w GE valmask/10.) 203 IF terre[0] NE -1 THEN w[terre] = !VALUES.F_NAN 237 IF terre[0] NE -1 THEN BEGIN 238 w[terre] = !VALUES.F_NAN 239 ENDIF 204 240 205 241 a=u[0,*] … … 217 253 ; tracer qu'un vecteur sur 218 254 ;----------------------------------------------------------- 219 if keyword_set(unvectsur) then BEGIN ;255 if keyword_set(unvectsur) THEN BEGIN 220 256 ; indx est un vecteur contenant les numero des colonnes a selectionner 221 257 ; indz est un vecteur contenant les numero des lignes a selectionner 222 if n_elements(unvectsur) EQ 1 then begin258 if n_elements(unvectsur) EQ 1 THEN BEGIN 223 259 indx = where((lindgen(nx) MOD unvectsur[0]) eq 0) 224 260 indz = where((lindgen(nz) MOD unvectsur[0]) eq 0) … … 280 316 281 317 sortie: 282 if keyword_set(key_performance) NE 0 THEN print, 'temps ajoutvectz', systime(1)-tempsun 283 end 284 285 318 if keyword_set(key_performance) NE 0 THEN BEGIN 319 print, 'temps ajoutvectz', systime(1)-tempsun 320 ENDIF 321 322 END -
trunk/procs/bining2.pro
r203 r205 240 240 241 241 242 IF i_ocean[0] NE -1 THEN BEGIN ; on n entre que si il y a des points ocean 242 IF i_ocean[0] NE -1 THEN BEGIN 243 ; on n entre que si il y a des points ocean 243 244 ; print, 'ocean point' 244 245 i_bottom = i_ocean[n_elements[i_ocean]-1] … … 267 268 i_max = i_max[0] 268 269 ; print, 'i_min, i_max', i_min, i_max 269 ;IF i_min GT i_max THEN print, 'WARNING: i_min, i_max=', i_min, i_max, ' at i,j=,', i, j 270 ;IF i_min GT i_max THEN BEGIN 271 ; print, 'WARNING: i_min, i_max=', i_min, i_max, ' at i,j=,', i, j 272 ;ENDIF 270 273 ; on prend le plus grand des indices min 271 274 272 ; IF i_max GE jpk-1 THEN print, i, j, i_max 273 ; IF i_min LE 1 THEN print, i, j, i_min 275 ; IF i_max GE jpk-1 THEN BEGIN 276 ; print, i, j, i_max 277 ; ENDIF 278 ; IF i_min LE 1 THEN BEGIN 279 ; print, i, j, i_min 280 ; ENDIF 274 281 275 282 ; Si la valeur du niveau (s_s) est plus faible que la densite de surface, … … 280 287 ind = where(s_s LT s_z[i_min]) 281 288 IF ind[0] NE -1 THEN BEGIN 282 ; IF i_min GT i_max THEN print, 'min reached at sigma indices', ind 289 ; IF i_min GT i_max THEN BEGIN 290 ; print, 'min reached at sigma indices', ind 291 ; ENDIF 283 292 z_s[ind] = 0 284 293 c1_s[ind] = !VALUES.F_NAN … … 292 301 293 302 IF ind[0] NE -1 THEN BEGIN 294 ; IF i_min GT i_max THEN print, 'max reached at sigma indices', ind 303 ; IF i_min GT i_max THEN BEGIN 304 ; print, 'max reached at sigma indices', ind 305 ; ENDIF 295 306 z_s[ind] = z_s[N_s] 296 307 c1_s[ind] = c1_s[N_s] … … 299 310 ; cas general 300 311 ind = where( (s_s GE s_z[i_min]) AND (s_s LE s_z[i_max]) ) 301 ; IF i_min GT i_max THEN print, 's_s indices inside min/max', ind 312 ; IF i_min GT i_max THEN BEGIN 313 ; print, 's_s indices inside min/max', ind 314 ; ENDIF 302 315 IF ind[0] NE -1 THEN BEGIN 303 316 i_profil = i_ocean[i_min:i_max] ; problem line -
trunk/procs/colorbartv.pro
r203 r205 202 202 ENDIF ELSE ncolors = !D.N_COLORS 203 203 ENDIF 204 IF N_ELEMENTS(bottom) EQ 0 THEN bottom = 0B 205 IF N_ELEMENTS(charsize) EQ 0 THEN charsize = 1.0 206 IF N_ELEMENTS(format) EQ 0 THEN format = '(F8.2)' 207 IF N_ELEMENTS(color) EQ 0 THEN color = ncolors - 1 + bottom 208 IF N_ELEMENTS(min) EQ 0 THEN min = 0.0 209 IF N_ELEMENTS(max) EQ 0 THEN max = FLOAT(ncolors) - 1 210 IF N_ELEMENTS(divisions) EQ 0 THEN divisions = 2 211 IF N_ELEMENTS(title) EQ 0 THEN title = '' 204 IF N_ELEMENTS(bottom) EQ 0 THEN BEGIN 205 bottom = 0B 206 ENDIF 207 IF N_ELEMENTS(charsize) EQ 0 THEN BEGIN 208 charsize = 1.0 209 ENDIF 210 IF N_ELEMENTS(format) EQ 0 THEN BEGIN 211 format = '(F8.2)' 212 ENDIF 213 IF N_ELEMENTS(color) EQ 0 THEN BEGIN 214 color = ncolors - 1 + bottom 215 ENDIF 216 IF N_ELEMENTS(min) EQ 0 THEN BEGIN 217 min = 0.0 218 ENDIF 219 IF N_ELEMENTS(max) EQ 0 THEN BEGIN 220 max = FLOAT(ncolors) - 1 221 ENDIF 222 IF N_ELEMENTS(divisions) EQ 0 THEN BEGIN 223 divisions = 2 224 ENDIF 225 IF N_ELEMENTS(title) EQ 0 THEN BEGIN 226 title = '' 227 ENDIF 212 228 pscolor = KEYWORD_SET(pscolor) 213 229 214 230 IF KEYWORD_SET(vertical) THEN BEGIN 215 IF KEYWORD_SET(discret) THEN begin231 IF KEYWORD_SET(discret) THEN BEGIN 216 232 facteur=256/n_elements(discret) 217 233 discret=reform(replicate(1,facteur) # discret,facteur*n_elements(discret)) 218 234 bar = REPLICATE(1B,10) # discret 219 235 endif else bar = REPLICATE(1B,10) # BINDGEN(256) 220 IF N_ELEMENTS(position) EQ 0 THEN position = [0.88, 0.15, 0.95, 0.95] 236 IF N_ELEMENTS(position) EQ 0 THEN BEGIN 237 position = [0.88, 0.15, 0.95, 0.95] 238 ENDIF 221 239 ENDIF ELSE BEGIN 222 IF KEYWORD_SET(discret) THEN begin240 IF KEYWORD_SET(discret) THEN BEGIN 223 241 facteur=256/n_elements(discret) 224 242 discret=reform(replicate(1,facteur) # discret,facteur*n_elements(discret)) 225 243 bar = discret # REPLICATE(1B,10) 226 244 endif else bar = BINDGEN(256) # REPLICATE(1B, 10) 227 IF N_ELEMENTS(position) EQ 0 THEN position = [0.15, 0.88, 0.95, 0.95] 245 IF N_ELEMENTS(position) EQ 0 THEN BEGIN 246 position = [0.15, 0.88, 0.95, 0.95] 247 ENDIF 228 248 ENDELSE 229 249 230 250 ; Scale the color bar. 231 IF NOT KEYWORD_SET(discret) THEN $251 IF NOT KEYWORD_SET(discret) THEN BEGIN 232 252 bar = BYTSCL(bar, TOP=ncolors-1) + bottom 253 ENDIF 233 254 234 255 ; Get starting locations in DEVICE coordinates. … … 320 341 ; Restore color variable if changed for PostScript. 321 342 322 IF postScriptDevice AND (pscolor NE 1) THEN color = oldcolor 323 343 IF postScriptDevice AND (pscolor NE 1) THEN BEGIN 344 color = oldcolor 345 ENDIF 324 346 END -
trunk/procs/compute_time.pro
r203 r205 265 265 END 266 266 ENDCASE 267 IF date1 EQ date2 THEN count = 1 267 IF date1 EQ date2 THEN BEGIN 268 count = 1 269 ENDIF 268 270 timearr = {count: count, scale: time} 269 271 return, timearr -
trunk/procs/data_read.pro
r203 r205 261 261 read = 1 262 262 IF strpos(cmd.plt, '#') NE -1 THEN BEGIN 263 IF cmd.plt EQ cmd_prev.plt THEN BEGIN ; not same zoom 263 IF cmd.plt EQ cmd_prev.plt THEN BEGIN 264 ; not same zoom 264 265 fldr = field 265 266 read = 0 … … 306 307 ncdf_db = def_dbase(cmd.exp) 307 308 308 IF debug_w THEN print, ' varexp defined in data_read = ', varexp 309 IF debug_w THEN BEGIN 310 print, ' varexp defined in data_read = ', varexp 311 ENDIF 309 312 310 313 ; define file name … … 333 336 small_domain = cmd.plt 334 337 CASE n_elements(box_plot) OF 335 4 : IF vert_switch GE 1 THEN box_plot = [box_plot, vert_mean] 336 6 : IF vert_switch GE 1 THEN box_plot = [box_plot[0:3], vert_mean] ELSE box_plot = box_plot[0:3] 338 4 : IF vert_switch GE 1 THEN BEGIN 339 box_plot = [box_plot, vert_mean] 340 ENDIF 341 6 : IF vert_switch GE 1 THEN BEGIN 342 box_plot = [box_plot[0:3], vert_mean] 343 ENDIF ELSE BEGIN 344 box_plot = box_plot[0:3] 345 ENDELSE 337 346 ENDCASE 338 347 339 348 ; Exceptions : need to read all the vertical data (and not a subset) 340 349 ; for the pltz case. Other cases ? 341 IF plttyp EQ 'pltz' THEN box_plot = box_plot[0:3] 342 350 IF plttyp EQ 'pltz' THEN BEGIN 351 box_plot = box_plot[0:3] 352 ENDIF 343 353 ; define timesteps time1 and time2 344 354 … … 349 359 time = timearr.scale 350 360 ENDIF ELSE BEGIN 351 IF strpos(cmd.timave, 'mm') NE -1 THEN time1 = delta_t1+long(strmid(cmd.date1, 0, 2)) $ 352 ELSE time1 = delta_t1+1 361 IF strpos(cmd.timave, 'mm') NE -1 THEN BEGIN 362 time1 = delta_t1+long(strmid(cmd.date1, 0, 2)) 363 ENDIF ELSE BEGIN 364 time1 = delta_t1+1 365 ENDELSE 353 366 time2 = time1 354 367 time = time1 … … 364 377 CASE STRMID(cmd.var, 0, 2) OF 365 378 '@@': BEGIN 366 IF debug_w THEN print, 'keyword_set(all_data) : ', keyword_set(all_data) 379 IF debug_w THEN BEGIN 380 print, 'keyword_set(all_data) : ', keyword_set(all_data) 381 ENDIF 367 382 fldr = macro_read(file_name, cmd.var, ncdf_db, BOXZOOM = box_plot, TIME_1 = time1, TIME_2 = time2, ALL_DATA = all_data, _EXTRA=extra) 368 IF stddev_diff EQ 1 THEN fldr.origin = 'diff' 383 IF stddev_diff EQ 1 THEN BEGIN 384 fldr.origin = 'diff' 385 ENDIF 369 386 END 370 387 ELSE: BEGIN … … 418 435 varpos = strpos(file_name, var1) 419 436 file_name3= strmid(file_name, 0, varpos)+var3_ybinx+'.nc' 420 IF debug_w THEN print, ' file_name3 = ', file_name3 437 IF debug_w THEN BEGIN 438 print, ' file_name3 = ', file_name3 439 ENDIF 421 440 ENDIF ELSE file_name3 = file_name 422 441 box_plot = def_box(small_domain, dimplot, legbox, time_stride) … … 445 464 END 446 465 ELSE: BEGIN 447 IF vecplot EQ 1 THEN BEGIN ; vectors case 466 IF vecplot EQ 1 THEN BEGIN 467 ; vectors case 448 468 idx = strpos(cmd.var, ',') 449 469 var1 = strmid(cmd.var, 1, idx-1) … … 528 548 cumulative = 0. 529 549 FOR i = 1, 12 DO BEGIN 530 IF i EQ 1 THEN cmd.date1 = year_s + '01' 531 IF i EQ 2 THEN cmd.date1 = year_s + '02' 532 IF i EQ 3 THEN cmd.date1 = year_s + '03' 533 IF i EQ 4 THEN cmd.date1 = year_s + '04' 534 IF i EQ 5 THEN cmd.date1 = year_s + '05' 535 IF i EQ 6 THEN cmd.date1 = year_s + '06' 536 IF i EQ 7 THEN cmd.date1 = year_s + '07' 537 IF i EQ 8 THEN cmd.date1 = year_s + '08' 538 IF i EQ 9 THEN cmd.date1 = year_s + '09' 539 IF i EQ 10 THEN cmd.date1 = year_s + '10' 540 IF i EQ 11 THEN cmd.date1 = year_s + '11' 541 IF i EQ 12 THEN cmd.date1 = year_s + '12' 550 IF i EQ 1 THEN BEGIN 551 cmd.date1 = year_s + '01' 552 ENDIF 553 IF i EQ 2 THEN BEGIN 554 cmd.date1 = year_s + '02' 555 ENDIF 556 IF i EQ 3 THEN BEGIN 557 cmd.date1 = year_s + '03' 558 ENDIF 559 IF i EQ 4 THEN BEGIN 560 cmd.date1 = year_s + '04' 561 ENDIF 562 IF i EQ 5 THEN BEGIN 563 cmd.date1 = year_s + '05' 564 ENDIF 565 IF i EQ 6 THEN BEGIN 566 cmd.date1 = year_s + '06' 567 ENDIF 568 IF i EQ 7 THEN BEGIN 569 cmd.date1 = year_s + '07' 570 ENDIF 571 IF i EQ 8 THEN BEGIN 572 cmd.date1 = year_s + '08' 573 ENDIF 574 IF i EQ 9 THEN BEGIN 575 cmd.date1 = year_s + '09' 576 ENDIF 577 IF i EQ 10 THEN BEGIN 578 cmd.date1 = year_s + '10' 579 ENDIF 580 IF i EQ 11 THEN BEGIN 581 cmd.date1 = year_s + '11' 582 ENDIF 583 IF i EQ 12 THEN BEGIN 584 cmd.date1 = year_s + '12' 585 ENDIF 542 586 print, ' Date1 = ', cmd.date1 543 587 sfild = fldr … … 587 631 ENDCASE 588 632 589 IF n_elements(fldr.data) EQ 1 THEN return, fldr 633 IF n_elements(fldr.data) EQ 1 THEN BEGIN 634 return, fldr 635 ENDIF 590 636 591 637 ; Difference 2 cases : from cmd.exp or from cmd.spec … … 599 645 ; read field2 600 646 field2 = data_read(cmd, hotyp, plttyp, dimplot, iover, ALL_DATA = all_data, _EXTRA=extra) 601 IF n_elements(field2.data) EQ 1 THEN return, field2 602 647 IF n_elements(field2.data) EQ 1 THEN BEGIN 648 return, field2 649 ENDIF 603 650 ; perform difference 604 651 diff = fldr.data-field2.data 605 IF (where(fldr.data EQ valmask))[0] NE -1 THEN $652 IF (where(fldr.data EQ valmask))[0] NE -1 THEN BEGIN 606 653 diff[where(fldr.data EQ valmask)] = valmask 654 ENDIF 607 655 fldr.data = diff 656 608 657 fldr.origin = 'diff' 609 658 cmd.exp = exp_init … … 619 668 ; read field2 620 669 field2 = data_read(cmd, hotyp, plttyp, dimplot, iover, ALL_DATA = all_data, _EXTRA=extra) 621 IF n_elements(field2.data) EQ 1 THEN return, field2 670 IF n_elements(field2.data) EQ 1 THEN BEGIN 671 return, field2 672 ENDIF 622 673 623 674 IF plttyp EQ 'pltt' THEN BEGIN … … 665 716 cmd2.spec = '-' 666 717 667 IF n_elements(argvar) EQ 4 THEN cmd2.spec = argvar[3] 718 IF n_elements(argvar) EQ 4 THEN BEGIN 719 cmd2.spec = argvar[3] 720 ENDIF 668 721 669 722 ; read field2 670 723 field2 = data_read(cmd2, hotyp, plttyp, dimplot, iover, ALL_DATA = all_data, _EXTRA=extra) 671 IF n_elements(field2.data) EQ 1 THEN return, field2 724 IF n_elements(field2.data) EQ 1 THEN BEGIN 725 return, field2 726 ENDIF 672 727 673 728 ; perform difference 674 729 diff = fldr.data-field2.data 675 IF (where(fldr.data EQ valmask))[0] NE -1 THEN $730 IF (where(fldr.data EQ valmask))[0] NE -1 THEN BEGIN 676 731 diff[where(fldr.data EQ valmask)] = valmask 732 ENDIF 677 733 fldr.data = diff 678 734 fldr.origin = 'diff' … … 703 759 ENDIF 704 760 705 706 761 return, fldr 707 762 -
trunk/procs/daypm.pro
r182 r205 103 103 ENDIF ELSE BEGIN 104 104 leap = year_i MOD 4 105 IF leap EQ 0 THEN feb = 29 ELSE feb = 28 105 IF leap EQ 0 THEN BEGIN 106 feb = 29 107 ENDIF ELSE BEGIN 108 feb = 28 109 ENDELSE 106 110 ENDELSE 107 111 CASE month_i OF -
trunk/procs/def_box.pro
r203 r205 123 123 force_all_data_read = 1 124 124 125 IF debug_w THEN print, ' boxdef stage 1 = ',boxdef 125 IF debug_w THEN BEGIN 126 print, ' boxdef stage 1 = ',boxdef 127 ENDIF 126 128 127 129 ; define box from pseudo-3Dmask -
trunk/procs/def_file_name.pro
r203 r205 194 194 f_suffix = suffix 195 195 196 IF debug_w THEN print, ' suffix before search_time_file = ', suffix 196 IF debug_w THEN BEGIN 197 print, ' suffix before search_time_file = ', suffix 198 ENDIF 197 199 198 200 CASE strmid(cmd.plt, 0, 2) OF … … 213 215 END 214 216 ENDCASE 215 IF debug_w THEN print, ' suffix after search_time_file = ', suffix 216 IF debug_w THEN print, ' date1, date2 = ', date1, ' ', date2 217 IF debug_w THEN BEGIN 218 print, ' suffix after search_time_file = ', suffix 219 print, ' date1, date2 = ', date1, ' ', date2 220 ENDIF 217 221 218 222 IF date1 EQ '???' THEN BEGIN -
trunk/procs/def_file_suff_var.pro
r203 r205 10 10 IF debug_w THEN BEGIN 11 11 info = report('enter ...') 12 print, ' cmd=', cmd 12 13 ENDIF 13 14 14 IF debug_w THEN print, ' cmd=', cmd15 15 macro_base_fld = cmd.var 16 16 IF strpos(cmd.var, '@@') NE -1 THEN BEGIN 17 17 CASE cmd.var OF 18 18 '@@voenergy': BEGIN 19 IF debug_w THEN print, ' cmd.grid in def_file_suff_var = ', cmd.grid 19 IF debug_w THEN BEGIN 20 print, ' cmd.grid in def_file_suff_var = ', cmd.grid 21 ENDIF 20 22 CASE cmd.grid OF 21 23 'T': file_suff_var = '_votemper' … … 27 29 IF strpos(cmd.var, '@@') NE -1 THEN BEGIN 28 30 @def_macro_base_fld 29 IF strpos(macro_base_fld, ',') NE -1 THEN macro_base_fld = (strsplit(macro_base_fld, ',', /EXTRACT))[0] 31 IF strpos(macro_base_fld, ',') NE -1 THEN BEGIN 32 macro_base_fld = (strsplit(macro_base_fld, ',', /EXTRACT))[0] 33 ENDIF 30 34 file_suff_var = '_'+macro_base_fld 31 35 ENDIF ELSE BEGIN … … 40 44 var1 = strmid(cmd.var, 0, idx) 41 45 sl_pos = strpos(cmd.var, '/') 42 IF sl_pos NE -1 THEN var1 = strmid(cmd.var, 0, sl_pos) 46 IF sl_pos NE -1 THEN BEGIN 47 var1 = strmid(cmd.var, 0, sl_pos) 48 ENDIF 43 49 file_suff_var = '_'+var1 44 50 ENDIF ELSE file_suff_var = '_'+cmd.var -
trunk/procs/def_grid.pro
r203 r205 194 194 ENDIF 195 195 196 IF debug_w THEN print, ' file_suff_var = ', file_suff_var 196 IF debug_w THEN BEGIN 197 print, ' file_suff_var = ', file_suff_var 198 ENDIF 197 199 198 200 ; read_grid_from_file ? … … 211 213 ENDIF ELSE var_read_grd_file = cmd.var 212 214 213 IF debug_w THEN print, ' cmd.grid after test read_grid_from_file: ', cmd.grid 215 IF debug_w THEN BEGIN 216 print, ' cmd.grid after test read_grid_from_file: ', cmd.grid 217 ENDIF 214 218 215 219 ; choose grid (if not already loaded) … … 217 221 ; tests to read 218 222 test_box = 0 219 IF box_h[0] NE box_h_prev[0] OR box_h[1] NE box_h_prev[1] THEN test_box = 1 223 IF box_h[0] NE box_h_prev[0] OR box_h[1] NE box_h_prev[1] THEN BEGIN 224 test_box = 1 225 ENDIF 220 226 test_read = 0 221 227 IF cmd.grid NE cmd_prev.grid OR test_box EQ 1 THEN BEGIN … … 225 231 suff_domain = suff_domain 226 232 ENDELSE 227 IF sw_diffg EQ 1 THEN test_read = 1 233 IF sw_diffg EQ 1 THEN BEGIN 234 test_read = 1 235 ENDIF 228 236 229 237 IF test_read EQ 1 THEN BEGIN 230 238 ; read attributes from Defaults/Grids/grid_config.def 231 239 file_grid_config = hom_def+'grid_config.def' 232 IF debug_w THEN print, ' doing: grep -i "\ '+cmd.grid+' " '+file_grid_config 240 IF debug_w THEN BEGIN 241 print, ' doing: grep -i "\ '+cmd.grid+' " '+file_grid_config 242 ENDIF 233 243 spawn, 'grep -i "\ '+cmd.grid+' " '+file_grid_config, line 234 244 line = strcompress(strtrim(line[0], 2)) 235 245 length = strlen(line) 236 246 237 IF debug_w THEN print, ' line from grid_config.def ',line 247 IF debug_w THEN BEGIN 248 print, ' line from grid_config.def ',line 249 ENDIF 238 250 239 251 IF length EQ 0 THEN BEGIN … … 251 263 ENDIF 252 264 253 IF masked_data EQ 0 THEN atmos_msk = 0 265 IF masked_data EQ 0 THEN BEGIN 266 atmos_msk = 0 267 ENDIF 254 268 255 269 ; init zoom for data read … … 260 274 izmindta = 0 261 275 ENDIF 262 IF debug_w THEN print, ' varexp in def_grid before case cmd.grid:', varexp 263 264 IF read_grid_from_file EQ 1 THEN GOTO, final 265 276 IF debug_w THEN BEGIN 277 print, ' varexp in def_grid before case cmd.grid:', varexp 278 ENDIF 279 280 IF read_grid_from_file EQ 1 THEN BEGIN 281 GOTO, final 282 ENDIF 266 283 CASE cmd.grid OF 267 284 't30': BEGIN … … 314 331 END 315 332 'reg1.125': BEGIN 316 IF test_read EQ 1 THEN read_grid_from_file = 1 333 IF test_read EQ 1 THEN BEGIN 334 read_grid_from_file = 1 335 ENDIF 317 336 END 318 337 ; 'reg2.5': BEGIN 319 ; IF test_read EQ 1 THEN read_grid_from_file = 1 338 ; IF test_read EQ 1 THEN BEGIN 339 ; read_grid_from_file = 1 340 ; ENDIF 320 341 ; END 321 342 'reg1m': BEGIN 322 IF test_read EQ 1 THEN read_grid_from_file = 1 343 IF test_read EQ 1 THEN BEGIN 344 read_grid_from_file = 1 345 ENDIF 323 346 END 324 347 'reg1': BEGIN 325 IF test_read EQ 1 THEN read_grid_from_file = 1 348 IF test_read EQ 1 THEN BEGIN 349 read_grid_from_file = 1 350 ENDIF 326 351 END 327 352 'reg1mtrop': BEGIN … … 355 380 356 381 h_config_oce = 'ORCA_R2' 357 IF strpos (cmd.grid, '05') NE -1 THEN h_config_oce = 'ORCA05' 382 IF strpos (cmd.grid, '05') NE -1 THEN BEGIN 383 h_config_oce = 'ORCA05' 384 ENDIF 358 385 359 386 IF meshlec_type NE 'oce' OR data_dom_type NE data_domain OR h_config_oce_type NE h_config_oce OR v_config_oce_type NE v_config_oce OR orca_mask_version_type NE orca_mask_version OR test_box EQ 1 OR test_read EQ 1 THEN BEGIN -
trunk/procs/def_macro_base_fld.pro
r203 r205 7 7 var_name = cmd.var 8 8 @get_macro_def 9 IF debug_w THEN print, ' macro_def in def_file_suff_var =', macro_def 9 IF debug_w THEN BEGIN 10 print, ' macro_def in def_file_suff_var =', macro_def 11 ENDIF 10 12 CASE macro_def[1] OF 11 13 '=:': BEGIN -
trunk/procs/def_month.pro
r203 r205 84 84 ENDIF 85 85 86 IF strpos(date, '_') GT -1 THEN date = strmid(date, 0, strpos(date, '_')) 86 IF strpos(date, '_') GT -1 THEN BEGIN 87 date = strmid(date, 0, strpos(date, '_')) 88 ENDIF 87 89 CASE strmid(timave, 0, 2) OF 88 90 '1m': BEGIN -
trunk/procs/def_work.pro
r203 r205 172 172 cmd = decode_cmd(cmdline, iline) 173 173 174 IF out_all NE '-' THEN cmd.out = out_all 174 IF out_all NE '-' THEN BEGIN 175 cmd.out = out_all 176 ENDIF 175 177 176 178 IF cmd.on EQ 1 THEN BEGIN 177 IF debug_w THEN print, ' iline = ', iline 179 IF debug_w THEN BEGIN 180 print, ' iline = ', iline 181 ENDIF 178 182 iplot = iplot + 1 179 183 print, ' ' … … 215 219 216 220 display = cmd.disp 217 IF posP GT 0 OR posL GT 0 THEN display = strmid(cmd.disp, 0, len-1) 221 IF posP GT 0 OR posL GT 0 THEN BEGIN 222 display = strmid(cmd.disp, 0, len-1) 223 ENDIF 218 224 posx = rstrpos(display, 'x') 219 225 IF posx GT 0 THEN BEGIN … … 395 401 396 402 line = conv+out_ps+'/'+fileps+' '+dir_name+'/'+nfile_name+file_suffix+ext 397 IF debug_w THEN print, ' Convert command= ', line 403 IF debug_w THEN BEGIN 404 print, ' Convert command= ', line 405 ENDIF 398 406 spawn, line, prtout 399 407 print, ' ' -
trunk/procs/densit_pltmap_read.pro
r203 r205 20 20 cumulative = 0. 21 21 FOR i = 1, 12 DO BEGIN 22 IF strlen(strmid(strcompress(string(year_s)),1)) eq 1 THEN year_s_string = '0'+strmid(strcompress(string(year_s)),1) 23 IF strlen(strmid(strcompress(string(year_s)),1)) GT 1 THEN year_s_string = strmid(strcompress(string(year_s)),1) 22 IF strlen(strmid(strcompress(string(year_s)),1)) eq 1 THEN BEGIN 23 year_s_string = '0'+strmid(strcompress(string(year_s)),1) 24 ENDIF 25 IF strlen(strmid(strcompress(string(year_s)),1)) GT 1 THEN BEGIN 26 year_s_string = strmid(strcompress(string(year_s)),1) 27 ENDIF 24 28 IF i LE 9 THEN BEGIN 25 29 cmd.date1 = year_s_string+'0'+strtrim(string(i), 2) -
trunk/procs/fld_pltext.pro
r203 r205 170 170 fldextr.dmax = !VALUES.F_NAN 171 171 fldextr.spec = !VALUES.F_NAN 172 IF debug_w THEN print, ' Number of args for fldext:', n_elements(argvar) 172 IF debug_w THEN BEGIN 173 print, ' Number of args for fldext:', n_elements(argvar) 174 ENDIF 173 175 IF n_elements(argvar) GE 5 THEN BEGIN 174 176 fldextr.homin = float(argvar[3]) -
trunk/procs/fld_pltint.pro
r203 r205 121 121 ELSE: file_iso = 'fld_glo_iso.def' 122 122 ENDCASE 123 IF field.origin EQ 'diff' THEN file_iso = 'fld_zoo_iso.def' 123 IF field.origin EQ 'diff' THEN BEGIN 124 file_iso = 'fld_zoo_iso.def' 125 ENDIF 124 126 125 IF debug_w THEN print, ' field.origin in fld_pltint: ', field.origin 127 IF debug_w THEN BEGIN 128 print, ' field.origin in fld_pltint: ', field.origin 129 ENDIF 126 130 127 131 print,' ' -
trunk/procs/get_macro_def.pro
r203 r205 18 18 ; name of macro file 19 19 file_mac = hom_def+'fld_macros.def' 20 IF debug_w THEN print, ' var_name in get_macro_def: ', var_name 20 IF debug_w THEN BEGIN 21 print, ' var_name in get_macro_def: ', var_name 22 ENDIF 21 23 ; 22 24 ; special case for stddev monthly … … 32 34 line = strcompress(strtrim(line[0], 2)) 33 35 length = strlen(line) 34 IF debug_w THEN print, ' line: ', line 36 IF debug_w THEN BEGIN 37 print, ' line: ', line 38 ENDIF 35 39 36 40 IF length EQ 0 THEN BEGIN -
trunk/procs/lec_pal_gmt.pro
r203 r205 137 137 ENDIF 138 138 139 IF n_elements(idx_pal) EQ 0 THEN idx_pal = 0 139 IF n_elements(idx_pal) EQ 0 THEN BEGIN 140 idx_pal = 0 141 ENDIF 140 142 141 143 found = 1 … … 213 215 ENDELSE 214 216 IF long(iso) NE 0 THEN BEGIN 215 IF iso/long(iso) NE 1 THEN fmt = '(f5.1)' 217 IF iso/long(iso) NE 1 THEN BEGIN 218 fmt = '(f5.1)' 219 ENDIF 216 220 ENDIF 217 221 ENDIF ELSE begin -
trunk/procs/legend_overlay.pro
r203 r205 11 11 ; domain_y = minc,maxc / 12 12 ; domaint=time[0], time[jptmax-1] 13 IF debug_w THEN print, ' in legend_overlay, iover=', iover 13 IF debug_w THEN BEGIN 14 print, ' in legend_overlay, iover=', iover 15 ENDIF 14 16 ; 15 17 ; decode legend format from command line (see def_work cmdi.proj) … … 24 26 ; when there is more than one seasonal cycle 25 27 jptmax = jpt * nb_cycles 26 IF debug_w THEN print, 'leg_format, leg_pos: ', leg_format, leg_pos 27 IF debug_w THEN print, 'jpt, jptmax, nb_cycles: ', jpt, jptmax, nb_cycles 28 IF debug_w THEN BEGIN 29 print, 'leg_format, leg_pos: ', leg_format, leg_pos 30 print, 'jpt, jptmax, nb_cycles: ', jpt, jptmax, nb_cycles 31 ENDIF 28 32 29 33 ; legend line text 30 34 leg_txt = '' 31 IF strpos(txt_format, 'E') NE -1 THEN leg_txt = leg_txt+cmd.exp+' ' 32 IF strpos(txt_format, 'V') NE -1 THEN leg_txt = leg_txt+cmd.var+' ' 33 IF strpos(txt_format, 'L') NE -1 THEN leg_txt = leg_txt+field.legend+' ' 34 IF strpos(txt_format, 'U') NE -1 THEN leg_txt = leg_txt+'('+field.units+') ' 35 IF strpos(txt_format, 'T') NE -1 THEN leg_txt = leg_txt+cmd.date1+' ' 36 IF strpos(txt_format, 'B') NE -1 THEN leg_txt = leg_txt+legz+' ' 37 IF strpos(txt_format, 'S') NE -1 THEN leg_txt = leg_txt+' std='+stddev_txt+' ' 35 IF strpos(txt_format, 'E') NE -1 THEN BEGIN 36 leg_txt = leg_txt+cmd.exp+' ' 37 ENDIF 38 IF strpos(txt_format, 'V') NE -1 THEN BEGIN 39 leg_txt = leg_txt+cmd.var+' ' 40 ENDIF 41 IF strpos(txt_format, 'L') NE -1 THEN BEGIN 42 leg_txt = leg_txt+field.legend+' ' 43 ENDIF 44 IF strpos(txt_format, 'U') NE -1 THEN BEGIN 45 leg_txt = leg_txt+'('+field.units+') ' 46 ENDIF 47 IF strpos(txt_format, 'T') NE -1 THEN BEGIN 48 leg_txt = leg_txt+cmd.date1+' ' 49 ENDIF 50 IF strpos(txt_format, 'B') NE -1 THEN BEGIN 51 leg_txt = leg_txt+legz+' ' 52 ENDIF 53 IF strpos(txt_format, 'S') NE -1 THEN BEGIN 54 leg_txt = leg_txt+' std='+stddev_txt+' ' 55 ENDIF 38 56 39 57 CASE plttyp OF … … 43 61 44 62 45 IF debug_w THEN print, ' leg_pos, leg_txt = ', leg_pos, leg_txt 63 IF debug_w THEN BEGIN 64 print, ' leg_pos, leg_txt = ', leg_pos, leg_txt 65 ENDIF 46 66 ; px_n = percentage of window size function of number of windows 47 67 ; initial percentage px_1r is function of strlen(leg_txt) … … 80 100 px_tl = px_2l+delta_txt 81 101 82 IF plttyp EQ 'yfx' THEN px_tl = 0.04 83 84 IF debug_w THEN print, ' nwin_tot, n_leg_max = ', nwin_tot, n_leg_max 102 IF plttyp EQ 'yfx' THEN BEGIN 103 px_tl = 0.04 104 ENDIF 105 106 IF debug_w THEN BEGIN 107 print, ' nwin_tot, n_leg_max = ', nwin_tot, n_leg_max 108 ENDIF 85 109 86 110 delta = float(maxc-minc)/(float(n_leg_max)+2.) 87 111 ; position of legend line (x_leg_1 to 2,y_leg) and text x_leg_t,; y_leg_t 88 IF strmid(leg_pos, 0, 1) EQ 'L' THEN BEGIN ; (L)ower 89 y_leg = minc+(nover-float(iover)+0.5)*delta 90 ENDIF ELSE BEGIN ; (U)pper 91 y_leg = maxc-(float(iover))*delta 112 IF strmid(leg_pos, 0, 1) EQ 'L' THEN BEGIN 113 ; (L)ower 114 y_leg = minc+(nover-float(iover)+0.5)*delta 115 ENDIF ELSE BEGIN 116 ; (U)pper 117 y_leg = maxc-(float(iover))*delta 92 118 ENDELSE 93 119 ; special case of plt1d,'z' 94 120 95 IF plttyp EQ 'plt1d' AND plt1dtyp EQ 'z' THEN 121 IF plttyp EQ 'plt1d' AND plt1dtyp EQ 'z' THEN BEGIN 96 122 ymin = boite_plt1d(4) 97 123 ymax = boite_plt1d(5) 98 124 y_dim = boite_plt1d(5)-boite_plt1d(4) 99 125 delta = y_dim/(float(n_leg_max)+2.) 100 IF strmid(leg_pos, 0, 1) EQ 'L' THEN BEGIN ; (L)ower 101 y_leg = ymax-(nover-float(iover)+0.5)*delta 102 ENDIF ELSE BEGIN ; (U)pper 103 y_leg = ymin+(float(iover)+0.5)*delta 126 IF strmid(leg_pos, 0, 1) EQ 'L' THEN BEGIN 127 ; (L)ower 128 y_leg = ymax-(nover-float(iover)+0.5)*delta 129 ENDIF ELSE BEGIN 130 ; (U)pper 131 y_leg = ymin+(float(iover)+0.5)*delta 104 132 ENDELSE 105 133 ENDIF 106 134 y_leg_t = y_leg*y_scale_txt 107 135 ; case pltt plt1d 108 IF debug_w THEN print, 'size(time) ', size(time) 109 IF debug_w THEN print, 'minc/maxc =', minc, maxc 136 IF debug_w THEN BEGIN 137 print, 'size(time) ', size(time) 138 print, 'minc/maxc =', minc, maxc 139 ENDIF 110 140 111 141 CASE plttyp OF 112 142 'pltt': BEGIN 113 IF strmid(leg_pos, 1, 1) EQ 'R' THEN BEGIN ; (R)ight 114 x_leg_1 = time[floor(px_1r*(jptmax-1))] 115 x_leg_2 = time[floor(px_2r*(jptmax-1))] 116 x_leg_t = time[floor(px_tr*(jptmax-1))] 117 ENDIF ELSE BEGIN ; (L)eft 118 x_leg_1 = time[floor(px_1l*(jptmax-1))] 119 x_leg_2 = time[floor(px_2l*(jptmax-1))] 120 x_leg_t = time[floor(px_tl*(jptmax-1))] 143 IF strmid(leg_pos, 1, 1) EQ 'R' THEN BEGIN 144 ; (R)ight 145 x_leg_1 = time[floor(px_1r*(jptmax-1))] 146 x_leg_2 = time[floor(px_2r*(jptmax-1))] 147 x_leg_t = time[floor(px_tr*(jptmax-1))] 148 ENDIF ELSE BEGIN 149 ; (L)eft 150 x_leg_1 = time[floor(px_1l*(jptmax-1))] 151 x_leg_2 = time[floor(px_2l*(jptmax-1))] 152 x_leg_t = time[floor(px_tl*(jptmax-1))] 121 153 ENDELSE 122 154 END … … 137 169 ELSE: 138 170 ENDCASE 139 IF strmid(leg_pos, 1, 1) EQ 'R' THEN BEGIN ; (R)ight 140 x_leg_1 = xmin+px_1r*x_dim 141 x_leg_2 = xmin+px_2r*x_dim 142 x_leg_t = xmin+px_tr*x_dim 143 ENDIF ELSE BEGIN ; (L)eft 144 x_leg_1 = xmin+px_1l*x_dim 145 x_leg_2 = xmin+px_2l*x_dim 146 x_leg_t = xmin+px_tl*x_dim 171 IF strmid(leg_pos, 1, 1) EQ 'R' THEN BEGIN 172 ; (R)ight 173 x_leg_1 = xmin+px_1r*x_dim 174 x_leg_2 = xmin+px_2r*x_dim 175 x_leg_t = xmin+px_tr*x_dim 176 ENDIF ELSE BEGIN 177 ; (L)eft 178 x_leg_1 = xmin+px_1l*x_dim 179 x_leg_2 = xmin+px_2l*x_dim 180 x_leg_t = xmin+px_tl*x_dim 147 181 ENDELSE 148 182 END … … 150 184 x_leg_1 = -1.e10 151 185 x_leg_2 = -1.e10 152 IF debug_w THEN print, 'minc2/maxc2 =', minc2, maxc2 186 IF debug_w THEN BEGIN 187 print, 'minc2/maxc2 =', minc2, maxc2 188 ENDIF 153 189 xmin = minc2 154 190 x_dim = maxc2-minc2 155 IF strmid(leg_pos, 1, 1) EQ 'R' THEN BEGIN ; (R)ight 156 x_leg_t = xmin+px_tr*x_dim 157 ENDIF ELSE BEGIN ; (L)eft 158 x_leg_t = xmin+px_tl*x_dim 191 IF strmid(leg_pos, 1, 1) EQ 'R' THEN BEGIN 192 ; (R)ight 193 x_leg_t = xmin+px_tr*x_dim 194 ENDIF ELSE BEGIN 195 ; (L)eft 196 x_leg_t = xmin+px_tl*x_dim 159 197 ENDELSE 160 198 END … … 184 222 ELSE: 185 223 ENDCASE 186 IF debug_w THEN print, overc_l 224 IF debug_w THEN BEGIN 225 print, overc_l 226 ENDIF 187 227 ; draw text 188 228 xyouts, x_leg_t, y_leg_t, leg_txt, charsize = txt_ft_size, color = string(line_color(iover-1)), charthick = 1., font = 1. -
trunk/procs/macros/make_bsf.pro
r203 r205 157 157 158 158 isign=where(glamt gt 380.) 159 IF isign[0] NE -1 THEN glamt[isign] = glamt[isign]-360. 159 IF isign[0] NE -1 THEN BEGIN 160 glamt[isign] = glamt[isign]-360. 161 ENDIF 160 162 isign=where(glamu gt 380.) 161 IF isign[0] NE -1 THEN glamu[isign] = glamu[isign]-360. 163 IF isign[0] NE -1 THEN BEGIN 164 glamu[isign] = glamu[isign]-360. 165 ENDIF 162 166 isign=where(glamv gt 380.) 163 IF isign[0] NE -1 THEN glamv[isign] = glamv[isign]-360. 167 IF isign[0] NE -1 THEN BEGIN 168 glamv[isign] = glamv[isign]-360. 169 ENDIF 164 170 isign=where(glamf gt 380.) 165 IF isign[0] NE -1 THEN glamf[isign] = glamf[isign]-360. 171 IF isign[0] NE -1 THEN BEGIN 172 glamf[isign] = glamf[isign]-360. 173 ENDIF 166 174 ; domdef, old_boite 167 175 -
trunk/procs/macros/make_correlation.pro
r203 r205 91 91 varpos = strpos(file_name, var_name1) 92 92 file_name2= strmid(file_name, 0, varpos)+var_name2+'.nc' 93 IF debug_w THEN print, ' file_name2 = ', file_name2 93 IF debug_w THEN BEGIN 94 print, ' file_name2 = ', file_name2 95 ENDIF 94 96 ENDIF ELSE file_name2 = file_name 95 97 … … 114 116 FOR imth = 0, nmth-1 DO BEGIN 115 117 116 IF debug_w THEN print, ' month idx/value: ', imth, strd[imth] 118 IF debug_w THEN BEGIN 119 print, ' month idx/value: ', imth, strd[imth] 120 ENDIF 117 121 118 122 data1 = (var1.data)[*, *, reform(idxm[imth,*], njpt)] … … 130 134 pt_correl = pt_correl/float(nmth) 131 135 132 IF idm[0] NE -1 THEN pt_correl[idm] = valmask 136 IF idm[0] NE -1 THEN BEGIN 137 pt_correl[idm] = valmask 138 ENDIF 133 139 134 140 varname = varname+' '+ntxt -
trunk/procs/macros/make_correldomain.pro
r203 r205 95 95 96 96 file_domain = domain_db+domain+'_'+cmd1_back.exp+'_'+cmd1_back.date1+'_'+cmd1_back.spec+'.nc' 97 IF debug_w THEN print, ' file_domain: ', file_domain 97 IF debug_w THEN BEGIN 98 print, ' file_domain: ', file_domain 99 ENDIF 98 100 99 101 var_dom = ncdf_lec(file_domain, var = domain) 100 102 101 IF debug_w THEN print, ' size of var_dom: ', size(var_dom) 103 IF debug_w THEN BEGIN 104 print, ' size of var_dom: ', size(var_dom) 105 ENDIF 102 106 103 107 IF (size(var_dom))[1] NE jpt THEN BEGIN … … 113 117 nya = (size(var.data))[2] 114 118 115 IF debug_w THEN print, ' nxa, nya', nxa, nya 119 IF debug_w THEN BEGIN 120 print, ' nxa, nya', nxa, nya 121 ENDIF 116 122 117 123 correl = fltarr(nxa, nya) … … 124 130 FOR imth = 0, nmth-1 DO BEGIN 125 131 126 IF debug_w THEN print, ' month idx/value: ', imth, strd[imth] 132 IF debug_w THEN BEGIN 133 print, ' month idx/value: ', imth, strd[imth] 134 ENDIF 127 135 128 136 data = (var.data)[*, *, reform(idxm[imth,*], njpt)] … … 149 157 correl = correl/float(nmth) 150 158 151 IF idm[0] NE -1 THEN correl[idm] = valmask 159 IF idm[0] NE -1 THEN BEGIN 160 correl[idm] = valmask 161 ENDIF 152 162 153 163 varname = varname+' '+ntxt -
trunk/procs/macros/make_crtm.pro
r203 r205 99 99 field.direc = ucrt.direc 100 100 posave = max( [strpos(ucrt.legend, ' averaged'), strpos(ucrt.legend, ' at')] ) 101 IF posave NE -1 THEN field.legend = strmid(ucrt.legend, posave) 101 IF posave NE -1 THEN BEGIN 102 field.legend = strmid(ucrt.legend, posave) 103 ENDIF 102 104 103 105 return, field -
trunk/procs/macros/make_denflw.pro
r203 r205 86 86 field.origin = 'computed' 87 87 field.dim = 2 88 IF jpt EQ 1 THEN field.direc = 'xy' ELSE field.direc = 'xyt' 88 IF jpt EQ 1 THEN BEGIN 89 field.direc = 'xy' 90 ENDIF ELSE BEGIN 91 field.direc = 'xyt' 92 ENDELSE 89 93 90 94 return, field -
trunk/procs/macros/make_denflx.pro
r203 r205 74 74 field.origin = 'computed' 75 75 field.dim = 2 76 IF jpt EQ 1 THEN field.direc = 'xy' ELSE field.direc = 'xyt' 76 IF jpt EQ 1 THEN BEGIN 77 field.direc = 'xy' 78 ENDIF ELSE BEGIN 79 field.direc = 'xyt' 80 ENDELSE 77 81 78 82 return, field -
trunk/procs/macros/make_depth.pro
r203 r205 92 92 fieldr = {name: '', data: fltarr(jpi, jpj, jpk), legend: '', units: '', origin: '', dim: 0, direc:''} 93 93 94 IF strpos(ncdf_db, ':') GE 1 THEN directory = (strsplit(ncdf_db, ':', /EXTRACT))[1] $ 95 ELSE directory = ncdf_db 94 IF strpos(ncdf_db, ':') GE 1 THEN BEGIN 95 directory = (strsplit(ncdf_db, ':', /EXTRACT))[1] 96 ENDIF ELSE BEGIN 97 directory = ncdf_db 98 ENDELSE 96 99 97 100 fieldr.origin = directory+file_name -
trunk/procs/macros/make_energetics.pro
r203 r205 190 190 valmask = 1.e20 191 191 idxw = where (tmaskr EQ 0) 192 IF idxw[0] NE -1 THEN w[idxw] = valmask 192 IF idxw[0] NE -1 THEN BEGIN 193 w[idxw] = valmask 194 ENDIF 193 195 idxt = where (tmaskr EQ 0) 194 IF idxt[0] NE -1 THEN t [idxt] = 0. 195 IF idxt[0] NE -1 THEN s [idxt] = 0. 196 IF idxt[0] NE -1 THEN BEGIN 197 t[idxt] = 0. 198 ENDIF 199 IF idxt[0] NE -1 THEN BEGIN 200 s[idxt] = 0. 201 ENDIF 196 202 tmaskr = 0 ; free memory 197 203 ENDIF ELSE BEGIN 198 204 idxt = where (t EQ valmask) 199 IF idxt[0] NE -1 THEN t [idxt] = 0. 200 IF idxt[0] NE -1 THEN s [idxt] = 0. 205 IF idxt[0] NE -1 THEN BEGIN 206 t[idxt] = 0. 207 ENDIF 208 IF idxt[0] NE -1 THEN BEGIN 209 s[idxt] = 0. 210 ENDIF 201 211 ENDELSE 202 212 … … 223 233 224 234 idx_2d = where (u[*, *, 0, 0] GT valmask/10.) 225 IF idx_2d[0] NE -1 THEN tx[idx_2d] = valmask 235 IF idx_2d[0] NE -1 THEN BEGIN 236 tx[idx_2d] = valmask 237 ENDIF 226 238 idx_2d = where (v[*, *, 0, 0] GT valmask/10.) 227 IF idx_2d[0] NE -1 THEN ty[idx_2d] = valmask 239 IF idx_2d[0] NE -1 THEN BEGIN 240 ty[idx_2d] = valmask 241 ENDIF 228 242 idx = where (t LT valmask/10.) 229 243 IF t_unit NE "C" THEN BEGIN 230 IF idx[0] NE -1 THEN t[idx] = t[idx]-273.15 244 IF idx[0] NE -1 THEN BEGIN 245 t[idx] = t[idx]-273.15 246 ENDIF 231 247 ENDIF 232 248 idx1 = n_elements(idx_t) … … 241 257 idxt=where(t GT valmask/10.) 242 258 idxs=where(s GT valmask/10.) 243 IF source_model EQ 'ipcc' THEN print, ' check these are 0 (T,S): ', min(idxt -idxs), max(idxt-idxs) 244 IF idxt[0] NE -1 THEN t[idxt]=0. 245 IF idxs[0] NE -1 THEN s[idxs]=0. 259 IF source_model EQ 'ipcc' THEN BEGIN 260 print, ' check these are 0 (T,S): ', min(idxt -idxs), max(idxt-idxs) 261 ENDIF 262 IF idxt[0] NE -1 THEN BEGIN 263 t[idxt]=0. 264 ENDIF 265 IF idxs[0] NE -1 THEN BEGIN 266 s[idxs]=0. 267 ENDIF 246 268 idxs = 0 ; free memory 247 269 … … 262 284 rhop = ( ( 4.8314E-4*s + r3*sr +r2)*s +r1) 263 285 print, ' rhop min/max', min(rhop), max(rhop) 264 IF idxt[0] NE -1 THEN rhop[idxt] = valmask 286 IF idxt[0] NE -1 THEN BEGIN 287 rhop[idxt] = valmask 288 ENDIF 265 289 sr = 0 & r1 = 0 & r2 = 0 & r3 = 0 & t = 0 & s = 0 ; free memory 266 290 … … 305 329 306 330 int_val2 = ((rhop-rho_s4d)^2)*stab_inv 307 IF idxt[0] NE -1 THEN int_val2[idxt] = 0. 331 IF idxt[0] NE -1 THEN BEGIN 332 int_val2[idxt] = 0. 333 ENDIF 308 334 309 335 print, ' compute APE...' … … 321 347 322 348 int_val = (rhop-rho_s4d)*(w_T) 323 IF idxt[0] NE -1 THEN int_val[idxt] = 0. 349 IF idxt[0] NE -1 THEN BEGIN 350 int_val[idxt] = 0. 351 ENDIF 324 352 325 353 ; remove first 2 levels (MXL too unstable) … … 348 376 idyv = where(vmean GT valmask/10.) 349 377 350 IF idx[0] NE -1 THEN tx[idx] = 0. 351 IF idy[0] NE -1 THEN ty[idy] = 0. 352 IF idxu[0] NE -1 THEN umean[idxu] = 0. 353 IF idyv[0] NE -1 THEN vmean[idyv] = 0. 378 IF idx[0] NE -1 THEN BEGIN 379 tx[idx] = 0. 380 ENDIF 381 IF idy[0] NE -1 THEN BEGIN 382 ty[idy] = 0. 383 ENDIF 384 IF idxu[0] NE -1 THEN BEGIN 385 umean[idxu] = 0. 386 ENDIF 387 IF idyv[0] NE -1 THEN BEGIN 388 vmean[idyv] = 0. 389 ENDIF 354 390 355 391 dot_prodx = tx*umean … … 387 423 tvlct, red, green, blue 388 424 389 IF cmd_wrk.out EQ 'ps' THEN ps = 1 390 391 IF ps EQ 1 THEN openps 425 IF cmd_wrk.out EQ 'ps' THEN BEGIN 426 ps = 1 427 ENDIF 428 429 IF ps EQ 1 THEN BEGIN 430 openps 431 ENDIF 392 432 393 433 pltt, ape, 't', petit = [2, 4, 1], landscape = 1, /rempli, /BASICMARGES, title = 'APE (full) '+cmd_wrk.exp, window=3 … … 422 462 423 463 maxdepth = 10 424 IF gdept[0] GT maxdepth THEN maxdepth = gdept[0] 464 IF gdept[0] GT maxdepth THEN BEGIN 465 maxdepth = gdept[0] 466 ENDIF 425 467 426 468 ;domdef, [210., 280., -5., 5., 0., maxdepth] -
trunk/procs/macros/make_eos.pro
r203 r205 115 115 idxt=where(t eq valmask) 116 116 idxs=where(s eq valmask) 117 IF idxt[0] NE -1 THEN t[idxt]=0. 118 IF idxs[0] NE -1 THEN s[idxs]=0. 117 IF idxt[0] NE -1 THEN BEGIN 118 t[idxt]=0. 119 ENDIF 120 IF idxs[0] NE -1 THEN BEGIN 121 s[idxs]=0. 122 ENDIF 119 123 ; 120 124 ; potential volumic mass … … 127 131 rhopn = ( ( 4.8314E-4*s + r3*sr +r2)*s +r1) 128 132 129 IF idxs[0] NE -1 THEN rhopn[idxt] = valmask 133 IF idxs[0] NE -1 THEN BEGIN 134 rhopn[idxt] = valmask 135 ENDIF 130 136 131 137 fdirec = tn.direc -
trunk/procs/macros/make_eos_sal.pro
r203 r205 116 116 idxt=where(t eq valmask) 117 117 idxs=where(s eq valmask) 118 IF idxt[0] NE -1 THEN t[idxt]=0. 119 IF idxs[0] NE -1 THEN s[idxs]=0. 118 IF idxt[0] NE -1 THEN BEGIN 119 t[idxt]=0. 120 ENDIF 121 IF idxs[0] NE -1 THEN BEGIN 122 s[idxs]=0. 123 ENDIF 120 124 ; 121 125 ; potential volumic mass … … 128 132 rhopn = ( ( 0.0E-4*s + 0.0*r3*sr +r2)*s +0.0*r1) 129 133 130 IF idxs[0] NE -1 THEN rhopn[idxt] = valmask 134 IF idxs[0] NE -1 THEN BEGIN 135 rhopn[idxt] = valmask 136 ENDIF 131 137 132 138 fdirec = tn.direc -
trunk/procs/macros/make_eos_tem.pro
r203 r205 118 118 idxt=where(t eq valmask) 119 119 idxs=where(s eq valmask) 120 IF idxt[0] NE -1 THEN t[idxt]=0. 121 IF idxs[0] NE -1 THEN s[idxs]=0. 120 IF idxt[0] NE -1 THEN BEGIN 121 t[idxt]=0. 122 ENDIF 123 IF idxs[0] NE -1 THEN BEGIN 124 s[idxs]=0. 125 ENDIF 122 126 ; 123 127 ; potential volumic mass … … 130 134 rhopn = ( ( 4.8314E-4*s + r3*sr +r2)*s +r1) 131 135 132 IF idxs[0] NE -1 THEN rhopn[idxt] = valmask 136 IF idxs[0] NE -1 THEN BEGIN 137 rhopn[idxt] = valmask 138 ENDIF 133 139 134 140 fdirec = tn.direc -
trunk/procs/macros/make_interp.pro
r203 r205 109 109 print, 'var1 : ', varname1, 'coef1 : ', coef1 110 110 print, 'var2 : ', varname2, 'coef2 : ', coef2 111 IF nb EQ 6 THEN print, 'var3 : ', varname3, 'coef3 : ', coef3 111 IF nb EQ 6 THEN BEGIN 112 print, 'var3 : ', varname3, 'coef3 : ', coef3 113 ENDIF 112 114 ENDIF 113 115 114 116 var1 = nc_read(file_name, varname1, ncdf_db, BOXZOOM = boxzoom, TIME_1 = time_1, TIME_2 = time_2, ALL_DATA = all_data) 115 117 var2 = nc_read(file_name, varname2, ncdf_db, BOXZOOM = boxzoom, TIME_1 = time_1, TIME_2 = time_2, ALL_DATA = all_data) 116 IF nb EQ 6 THEN var3 = nc_read(file_name, varname3, ncdf_db, BOXZOOM = boxzoom, TIME_1 = time_1, TIME_2 = time_2, ALL_DATA = all_data) 118 IF nb EQ 6 THEN BEGIN 119 var3 = nc_read(file_name, varname3, ncdf_db, BOXZOOM = boxzoom, TIME_1 = time_1, TIME_2 = time_2, ALL_DATA = all_data) 120 ENDIF 117 121 118 122 interp = var1.data 119 123 idx = WHERE( var1.data NE valmask ) 120 IF( idx[0] EQ -1 ) THEN STOP, 'STOP. Something wrong in the data' 124 IF( idx[0] EQ -1 ) THEN BEGIN 125 STOP, 'STOP. Something wrong in the data' 126 ENDIF 121 127 122 128 interp[idx] = ( nb EQ 6 ) ? coef1*var1.data[idx] + coef2*var2.data[idx] + coef3*var3.data[idx] : coef1*var1.data[idx] + coef2*var2.data[idx] -
trunk/procs/macros/make_linfit.pro
r203 r205 91 91 varpos = strpos(file_name, var_name1) 92 92 file_name2= strmid(file_name, 0, varpos)+var_name2+'.nc' 93 IF debug_w THEN print, ' file_name2 = ', file_name2 93 IF debug_w THEN BEGIN 94 print, ' file_name2 = ', file_name2 95 ENDIF 94 96 ENDIF ELSE file_name2 = file_name 95 97 … … 104 106 nya = (size(var1.data))[2] 105 107 106 IF debug_w THEN print, ' nxa, nya', nxa, nya 108 IF debug_w THEN BEGIN 109 print, ' nxa, nya', nxa, nya 110 ENDIF 107 111 108 112 pt_linfit = fltarr(nxa, nya) … … 118 122 FOR imth = 0, nmth-1 DO BEGIN 119 123 120 IF debug_w THEN print, ' month idx/value: ', imth, strd[imth] 124 IF debug_w THEN BEGIN 125 print, ' month idx/value: ', imth, strd[imth] 126 ENDIF 121 127 122 128 data1 = (var1.data)[*, *, reform(idxm[imth,*], njpt)] … … 195 201 pt_linfit = pt_linfit/float(nmth) 196 202 pt_corr = pt_corr/float(nmth) 197 IF idm[0] NE -1 THEN pt_linfit[idm] = valmask 203 IF idm[0] NE -1 THEN BEGIN 204 pt_linfit[idm] = valmask 205 ENDIF 198 206 199 207 ; only take points where correlation larger than 0.2 200 208 201 209 idc = where(abs(pt_corr) LT corr_thres) 202 IF idc[0] NE -1 THEN pt_linfit[idc] = !values.f_nan 210 IF idc[0] NE -1 THEN BEGIN 211 pt_linfit[idc] = !values.f_nan 212 ENDIF 203 213 204 214 corr_txt = '[r>'+strtrim(string(corr_thres, format = '(f5.2)'), 2)+']' … … 245 255 ; meantsp=reform(meants,nxt*nyt) 246 256 ; meanlf=reform(pt_linfit,nxt*nyt) 247 ; IF min (meantsp) GE 100 THEN meantsp=meantsp-273.15 257 ; IF min (meantsp) GE 100 THEN BEGIN 258 ; meantsp=meantsp-273.15 259 ; ENDIF 248 260 ; pltsc, meanlf,meantsp,-70,30,20,34,"SST "+mth[strd-1], window=2 249 261 ; pltsc, meanlf,meantsp,-70,30,20,34,"SST "+mth[strd-1], window=2, /noerase, /ov1d, col1d=2 -
trunk/procs/macros/make_linfitdom.pro
r203 r205 93 93 94 94 file_domain = domain_db+domain+'_'+cmd1_back.exp+'_'+cmd1_back.date1+'_'+cmd1_back.spec+'.nc' 95 IF debug_w THEN print, ' file_domain: ', file_domain 95 IF debug_w THEN BEGIN 96 print, ' file_domain: ', file_domain 97 ENDIF 96 98 97 99 var_dom = ncdf_lec(file_domain, var = domain) 98 100 99 IF debug_w THEN print, ' size of var_dom: ', size(var_dom) 101 IF debug_w THEN BEGIN 102 print, ' size of var_dom: ', size(var_dom) 103 ENDIF 100 104 101 105 IF (size(var_dom))[1] NE jpt THEN BEGIN … … 111 115 nya = (size(var1.data))[2] 112 116 113 IF debug_w THEN print, ' nxa, nya', nxa, nya 117 IF debug_w THEN BEGIN 118 print, ' nxa, nya', nxa, nya 119 ENDIF 114 120 115 121 pt_linfit = fltarr(nxa, nya) … … 125 131 FOR imth = 0, nmth-1 DO BEGIN 126 132 127 IF debug_w THEN print, ' month idx/value: ', imth, strd[imth] 133 IF debug_w THEN BEGIN 134 print, ' month idx/value: ', imth, strd[imth] 135 ENDIF 128 136 129 137 data1 = (var1.data)[*, *, reform(idxm[imth,*], njpt)] … … 180 188 pt_linfit = pt_linfit/float(nmth) 181 189 pt_corr = pt_corr/float(nmth) 182 IF idm[0] NE -1 THEN pt_linfit[idm] = valmask 190 IF idm[0] NE -1 THEN BEGIN 191 pt_linfit[idm] = valmask 192 ENDIF 183 193 184 194 ; only take points where ABS(correlation) larger than a value … … 229 239 ; meantsp=reform(meants,nxt*nyt) 230 240 ; meanlf=reform(pt_linfit,nxt*nyt) 231 ; IF min (meantsp) GE 100 THEN meantsp=meantsp-273.15 241 ; IF min (meantsp) GE 100 THEN BEGIN 242 ; meantsp=meantsp-273.15 243 ; ENDIF 232 244 ; pltsc, meanlf,meantsp,-70,30,20,34,"SST "+mth[strd-1], window=2 233 245 ; pltsc, meanlf,meantsp,-70,30,20,34,"SST "+mth[strd-1], window=2, /noerase, /ov1d, col1d=2 -
trunk/procs/macros/make_msf.pro
r203 r205 89 89 90 90 idx = where(v.data EQ valmask) 91 IF idx[0] NE -1 THEN v.data[idx] = 0.0 91 IF idx[0] NE -1 THEN BEGIN 92 v.data[idx] = 0.0 93 ENDIF 92 94 ; 93 95 ; Mask bathymetry ? -
trunk/procs/macros/make_msf2.pro
r203 r205 88 88 89 89 idx = where(v.data EQ valmask) 90 IF idx[0] NE -1 THEN v.data[idx] = 0.0 90 IF idx[0] NE -1 THEN BEGIN 91 v.data[idx] = 0.0 92 ENDIF 91 93 ; 92 94 ; Mask bathymetry ? … … 111 113 ENDIF 112 114 113 IF jpt EQ 1 THEN v.data =reform(v.data,jpi,jpj,jpk,1) 115 IF jpt EQ 1 THEN BEGIN 116 v.data =reform(v.data,jpi,jpj,jpk,1) 117 ENDIF 114 118 115 119 strcmd = 'msf_mult, v.data, msf, msfmsk' … … 125 129 ; average in box ? 126 130 127 ;IF n_elements(msf_mean) GT 1 THEN BEGIN128 ; appel a proc129 ;ENDIF ELSE BEGIN130 ; IF msf_mean NE 0 THEN131 ; appel a proc msf_indexXS132 ;ENDELSE133 134 135 131 ;pas de condition : equivalent a msf_mean=0 ---> plot yz a la date T 136 132 ;field = {name: '', data: 0, legend: '', units: 'm3/s', origin: '', dim: 0, direc:''} … … 138 134 139 135 IF msf_mean EQ 2 THEN BEGIN 140 msf_index, msf, index141 field = {name: '', data: index, legend: '', units: 'm3/s', origin: '', dim: 1, direc:'t'}136 msf_index, msf, index 137 field = {name: '', data: index, legend: '', units: 'm3/s', origin: '', dim: 1, direc:'t'} 142 138 ENDIF 143 139 -
trunk/procs/macros/make_ratio.pro
r203 r205 88 88 89 89 tab_var = strsplit(macro_base_fld, ',', /EXTRACT) 90 IF ( debug_w ) THEN print, 'size(tab_var) : ', size(tab_var) 90 IF ( debug_w ) THEN BEGIN 91 print, 'size(tab_var) : ', size(tab_var) 92 ENDIF 91 93 92 94 IF ( (size(tab_var))[1] NE 2 AND (size(tab_var))[1] NE 4 ) THEN BEGIN … … 116 118 117 119 idx = WHERE( diff NE 0.0 ) 118 IF( idx[0] EQ -1 ) THEN STOP, 'STOP. Division cannot be computed' 120 IF( idx[0] EQ -1 ) THEN BEGIN 121 STOP, 'STOP. Division cannot be computed' 122 ENDIF 119 123 120 124 div[idx] = ( var_a.data[idx] - var_b.data[idx] )/( diff[idx] ) … … 138 142 139 143 idx = WHERE( var_b.data NE 0.0 ) 140 IF( idx[0] EQ -1 ) THEN STOP, 'STOP. Division cannot be computed' 144 IF( idx[0] EQ -1 ) THEN BEGIN 145 STOP, 'STOP. Division cannot be computed' 146 ENDIF 141 147 142 148 div[idx] = ( var_a.data[idx] )/( var_b.data[idx] ) -
trunk/procs/macros/make_skewness.pro
r203 r205 82 82 ; Read time serie 83 83 ; 84 IF debug_w THEN print, 'keyword_set(ALL_DATA) : ', keyword_set(ALL_DATA) 84 IF debug_w THEN BEGIN 85 print, 'keyword_set(ALL_DATA) : ', keyword_set(ALL_DATA) 86 ENDIF 85 87 mfld = nc_read(file_name, macro_base_fld, ncdf_db, BOXZOOM = boxzoom, TIME_1 = time_1, TIME_2 = time_2, ALL_DATA = all_data) 86 88 -
trunk/procs/macros/make_stddev.pro
r203 r205 89 89 ; Read time serie 90 90 ; 91 IF debug_w THEN print, 'keyword_set(ALL_DATA) : ', keyword_set(ALL_DATA) 91 IF debug_w THEN BEGIN 92 print, 'keyword_set(ALL_DATA) : ', keyword_set(ALL_DATA) 93 ENDIF 92 94 print, ' Warning: standard deviation assuming monthly time serie of base field ',macro_base_fld 93 95 … … 98 100 nya = (size(mfld.data))[2] 99 101 100 IF debug_w THEN print, ' nxa, nya', nxa, nya 102 IF debug_w THEN BEGIN 103 print, ' nxa, nya', nxa, nya 104 ENDIF 101 105 102 106 stdw = fltarr(nxa, nya) … … 109 113 FOR imth = 0, nmth-1 DO BEGIN 110 114 111 IF debug_w THEN print, ' month idx/value: ', imth, strd[imth] 115 IF debug_w THEN BEGIN 116 print, ' month idx/value: ', imth, strd[imth] 117 ENDIF 112 118 113 119 data = (mfld.data)[*, *, reform(idxm[imth,*], njpt)] … … 123 129 stdw = stdw/float(nmth) 124 130 125 IF idm[0] NE -1 THEN stdw[idm] = valmask 131 IF idm[0] NE -1 THEN BEGIN 132 stdw[idm] = valmask 133 ENDIF 126 134 127 135 varname = varname+' '+ntxt … … 131 139 std_tot = a_timecorrelate(mfld.data, 0,/covariance) 132 140 std_tot = sqrt( jpt/(jpt-1)*std_tot ) 133 IF idm[0] NE -1 THEN std_tot[idm] = valmask 141 IF idm[0] NE -1 THEN BEGIN 142 std_tot[idm] = valmask 143 ENDIF 134 144 idx_diff = WHERE (stdw NE valmask) 135 145 stdw[idx_diff] = stdw[idx_diff] - std_tot[idx_diff] -
trunk/procs/macros/make_thdepth.pro
r203 r205 99 99 FOR jk = 0, nzt-1-1 DO BEGIN 100 100 idx = where (tn.data[*, *, jk] GE 20) 101 IF idx[0] NE -1 THEN ik20c[idx] = jk 101 IF idx[0] NE -1 THEN BEGIN 102 ik20c[idx] = jk 103 ENDIF 102 104 ENDFOR 103 105 … … 105 107 106 108 hd20 = gdept[ik20c] 107 IF debug_w THEN help, hd20 108 IF debug_w THEN print, 'min(hd20), max(hd20) : ', min(hd20), max(hd20) 109 IF debug_w THEN BEGIN 110 help, hd20 111 print, 'min(hd20), max(hd20) : ', min(hd20), max(hd20) 112 ENDIF 109 113 110 114 IF valmask EQ 0. THEN BEGIN … … 128 132 129 133 ; hd20 = min(hd20, 0.) 130 IF debug_w THEN help, hd20 131 IF debug_w THEN print, 'min(hd20), max(hd20) : ', min(hd20), max(hd20) 134 IF debug_w THEN BEGIN 135 help, hd20 136 print, 'min(hd20), max(hd20) : ', min(hd20), max(hd20) 137 ENDIF 132 138 133 139 … … 137 143 field = {name: '', data: hd20, legend: '', units: '', origin: '', dim: 2, direc:'xy'} 138 144 139 IF debug_w THEN print, tn.origin, tn.direc 145 IF debug_w THEN BEGIN 146 print, tn.origin, tn.direc 147 ENDIF 140 148 141 149 field.origin = tn.origin -
trunk/procs/macros/make_transfo.pro
r203 r205 106 106 idxt=where(sst eq valmask) 107 107 idxs=where(sss eq valmask) 108 IF idxt[0] NE -1 THEN sst[idxt]=0. 109 IF idxs[0] NE -1 THEN sss[idxs]=0. 108 IF idxt[0] NE -1 THEN BEGIN 109 sst[idxt]=0. 110 ENDIF 111 IF idxs[0] NE -1 THEN BEGIN 112 sss[idxs]=0. 113 ENDIF 110 114 111 115 ; Compute potential density (sigma_0) 112 116 113 117 rho0 = eos[sst, sss]-1000. 114 IF idxs[0] NE -1 THEN rho0[idxt] = valmask 118 IF idxs[0] NE -1 THEN BEGIN 119 rho0[idxt] = valmask 120 ENDIF 115 121 116 122 ; Define density grid … … 125 131 jpj = sizef[2] 126 132 jpt = 1 127 IF sizef[0] EQ 3 THEN jpt = sizef[3] 133 IF sizef[0] EQ 3 THEN BEGIN 134 jpt = sizef[3] 135 ENDIF 128 136 129 137 dt = 1./float(jpt) ; integration delta time -
trunk/procs/macros/make_wcurl.pro
r203 r205 91 91 varpos = strpos(file_name, var_name1) 92 92 file_name2= strmid(file_name, 0, varpos)+var_name2+'.nc' 93 IF debug_w THEN print, ' file_name2 = ', file_name2 93 IF debug_w THEN BEGIN 94 print, ' file_name2 = ', file_name2 95 ENDIF 94 96 ENDIF ELSE file_name2 = file_name 95 97 -
trunk/procs/macros/make_wdiv.pro
r203 r205 91 91 varpos = strpos(file_name, var_name1) 92 92 file_name2= strmid(file_name, 0, varpos)+var_name2+'.nc' 93 IF debug_w THEN print, ' file_name2 = ', file_name2 93 IF debug_w THEN BEGIN 94 print, ' file_name2 = ', file_name2 95 ENDIF 94 96 ENDIF ELSE file_name2 = file_name 95 97 -
trunk/procs/macros/make_wm.pro
r203 r205 96 96 field.direc = taux.direc 97 97 posave = max( [strpos(ucrt.legend, ' averaged'), strpos(ucrt.legend, ' at')] ) 98 IF posave NE -1 THEN field.legend = strmid(ucrt.legend, posave) 98 IF posave NE -1 THEN BEGIN 99 field.legend = strmid(ucrt.legend, posave) 100 ENDIF 99 101 100 102 return, field -
trunk/procs/macros/make_wwv.pro
r203 r205 112 112 FOR jk = 0, nzt-1 DO BEGIN 113 113 idx = where ( tn.data[*, *, jk,*] GE thermo) 114 IF idx[0] NE -1 THEN ik20c[idx] = jk 114 IF idx[0] NE -1 THEN BEGIN 115 ik20c[idx] = jk 116 ENDIF 115 117 ENDFOR 116 117 118 118 119 ; depth is a linear interpolation … … 122 123 tempm[bad] = 0 123 124 124 IF debug_w THEN help, hd20 125 IF debug_w THEN print, 'min(hd20), max(hd20) : ', min(hd20), max(hd20) 125 IF debug_w THEN BEGIN 126 help, hd20 127 print, 'min(hd20), max(hd20) : ', min(hd20), max(hd20) 128 ENDIF 126 129 127 130 … … 147 150 ;------------------------calcul du wwv------------------------------------------- 148 151 ;-------------------------------------------------------------------------------- 149 IF debug_w THEN help, hd20 150 IF debug_w THEN print, 'min(hd20), max(hd20) : ', min(hd20), max(hd20) 152 IF debug_w THEN BEGIN 153 help, hd20 154 print, 'min(hd20), max(hd20) : ', min(hd20), max(hd20) 155 ENDIF 151 156 152 157 … … 168 173 field = {name: '', data: wwv, legend: '', units: '', origin: '', dim: 1, direc:'t'} 169 174 170 IF debug_w THEN print, tn.origin, tn.direc 175 IF debug_w THEN BEGIN 176 print, tn.origin, tn.direc 177 ENDIF 171 178 172 179 field.origin = tn.origin -
trunk/procs/macros/make_ytran.pro
r203 r205 88 88 89 89 idx = where(v.data EQ valmask) 90 IF idx[0] NE -1 THEN v.data[idx] = 0.0 90 IF idx[0] NE -1 THEN BEGIN 91 v.data[idx] = 0.0 92 ENDIF 91 93 92 94 ; Transport along Y : try = v*e1t*e3t (Sv) -
trunk/procs/mask_z.pro
r203 r205 179 179 'oce': BEGIN 180 180 181 IF splot EQ 1 THEN vertical_domain = [sig_min, sig_max] ELSE vertical_domain = [0, depth_z] 181 IF splot EQ 1 THEN BEGIN 182 vertical_domain = [sig_min, sig_max] 183 ENDIF ELSE BEGIN 184 vertical_domain = [0, depth_z] 185 ENDELSE 182 186 183 187 CASE data_domain OF 184 188 'equator': BEGIN 185 189 tmask[*, *, *] = 1 186 IF dimplot EQ 1 THEN boite_pltz = box_h 187 IF dimplot EQ 2 THEN boite_pltz = [box_h, vertical_domain] 190 IF dimplot EQ 1 THEN BEGIN 191 boite_pltz = box_h 192 ENDIF 193 IF dimplot EQ 2 THEN BEGIN 194 boite_pltz = [box_h, vertical_domain] 195 ENDIF 188 196 END 189 197 'zonal': BEGIN … … 192 200 boite_pltz = zbox 193 201 IF dimplot EQ 2 THEN BEGIN 194 IF n_elements(boite_pltz) EQ 4 THEN boite_pltz = [zbox, vertical_domain] 202 IF n_elements(boite_pltz) EQ 4 THEN BEGIN 203 boite_pltz = [zbox, vertical_domain] 204 ENDIF 195 205 ENDIF 196 ; IF dimplot EQ 1 THEN boite_pltz = box_h 197 ; IF dimplot EQ 2 THEN boite_pltz = [box_h, 198 ; vertical_domain] 206 ; IF dimplot EQ 1 THEN BEGIN 207 ; boite_pltz = box_h 208 ; ENDIF 209 ; IF dimplot EQ 2 THEN BEGIN 210 ; boite_pltz = [box_h,vertical_domain] 211 ; ENDIF 212 199 213 idxmsk=where(fld eq valmask) 200 214 IF idxmsk[0] ne -1 THEN BEGIN … … 220 234 tmask = tmask*maskzm 221 235 ENDIF 222 IF dimplot EQ 1 THEN boite_pltz = box_h 236 IF dimplot EQ 1 THEN BEGIN 237 boite_pltz = box_h 238 ENDIF 223 239 IF dimplot EQ 2 THEN BEGIN 224 240 CASE strmid(cmd.plt, 1, 1) OF … … 251 267 maskzm = maskread(full_name, 'orca', /D3) 252 268 tmask = tmask*maskzm 253 IF dimplot EQ 1 THEN boite_pltz = box_h 269 IF dimplot EQ 1 THEN BEGIN 270 boite_pltz = box_h 271 ENDIF 254 272 IF dimplot EQ 2 THEN BEGIN 255 273 CASE strmid(cmd.plt, 1, 1) OF … … 275 293 CASE strmid(cmd.plt, 1, 1) OF 276 294 't': boite_pltz = zbox 277 ELSE : IF n_elements(boite_pltz) EQ 4 THEN boite_pltz = [zbox, vertical_domain] 295 ELSE : IF n_elements(boite_pltz) EQ 4 THEN BEGIN 296 boite_pltz = [zbox, vertical_domain] 297 ENDIF 278 298 ENDCASE 279 299 ENDIF … … 285 305 'x': boite_pltz = zbox 286 306 'y': boite_pltz = zbox 287 ELSE: IF n_elements(boite_pltz) EQ 4 THEN boite_pltz = [zbox, vertical_domain] 307 ELSE: IF n_elements(boite_pltz) EQ 4 THEN BEGIN 308 boite_pltz = [zbox, vertical_domain] 309 ENDIF 288 310 ENDCASE 289 311 END … … 312 334 ELSE: BEGIN ; atmosphere or data 313 335 314 ; IF masked_data EQ 0 THEN tmask[*] = 1 336 ; IF masked_data EQ 0 THEN BEGIN 337 ; tmask[*] = 1 338 ; ENDIF 315 339 CASE strmid(cmd.plt, 0, 2) OF 316 340 'xy': BEGIN & char = strmid(cmd.plt,3, 1) & ideb = 4 & END … … 356 380 CASE strmid(cmd.plt, 1, 1) OF 357 381 't': boite_pltz = zbox 358 ELSE : IF n_elements(boite_pltz) EQ 4 THEN boite_pltz = [zbox, pres_min, pres_max] 382 ELSE : IF n_elements(boite_pltz) EQ 4 THEN BEGIN 383 boite_pltz = [zbox, pres_min, pres_max] 384 ENDIF 359 385 ENDCASE 360 386 ENDIF -
trunk/procs/maskread.pro
r203 r205 126 126 ;--------------------------------------------------------------------- 127 127 if n_elements(jpidta) EQ 0 THEN BEGIN 128 if n_elements(ixmindta) EQ 0 OR n_elements(ixmaxdta) EQ 0 then $ 129 jpidta = jpiglo else jpidta = ixmaxdta-ixmindta+1 128 if n_elements(ixmindta) EQ 0 OR n_elements(ixmaxdta) EQ 0 THEN BEGIN 129 jpidta = jpiglo 130 ENDIF ELSE BEGIN 131 jpidta = ixmaxdta-ixmindta+1 132 ENDELSE 130 133 endif 131 134 if n_elements(jpjdta) EQ 0 THEN BEGIN 132 if n_elements(iymindta) EQ 0 OR n_elements(iymaxdta) EQ 0 then $ 133 jpjdta = jpjglo else jpjdta = iymaxdta-iymindta+1 135 if n_elements(iymindta) EQ 0 OR n_elements(iymaxdta) EQ 0 THEN BEGIN 136 jpjdta = jpjgloo 137 ENDIF ELSE BEGIN 138 jpjdta = iymaxdta-iymindta+1 139 ENDELSE 134 140 endif 135 141 if n_elements(jpkdta) EQ 0 THEN BEGIN 136 if n_elements(izmindta) EQ 0 OR n_elements(izmaxdta) EQ 0 then $ 137 jpkdta = jpkglo else jpkdta = izmaxdta-izmindta+1 142 if n_elements(izmindta) EQ 0 OR n_elements(izmaxdta) EQ 0 THEN BEGIN 143 jpkdta = jpkglo 144 ENDIF ELSE BEGIN 145 jpkdta = izmaxdta-izmindta+1 146 ENDELSE 138 147 endif 139 148 ;-------------------------------------------------------------------- -
trunk/procs/meshes/build_mesh_glosea.pro
r203 r205 106 106 IF keyword_set(J_INDEX) THEN BEGIN 107 107 108 IF NOT keyword_set(DELTA_J) THEN delta_j = 1 108 IF NOT keyword_set(DELTA_J) THEN BEGIN 109 delta_j = 1 110 ENDIF 109 111 delta_j = delta_j - 1 110 112 … … 122 124 no_lon_shift = no_lon_shift + 1 123 125 124 IF NOT keyword_set(DELTA_I) THEN delta_i = 1 126 IF NOT keyword_set(DELTA_I) THEN BEGIN 127 delta_i = 1 128 ENDIF 125 129 delta_i = delta_i - 1 126 130 … … 144 148 IF keyword_set(K_INDEX) THEN BEGIN 145 149 146 IF NOT keyword_set(DELTA_K) THEN delta_k = 1 150 IF NOT keyword_set(DELTA_K) THEN BEGIN 151 delta_k = 1 152 ENDIF 147 153 delta_k = delta_k - 1 148 154 … … 233 239 234 240 isign=where(glamt gt 380.) 235 IF isign[0] NE -1 THEN glamt[isign] = glamt[isign]-360. 241 IF isign[0] NE -1 THEN BEGIN 242 glamt[isign] = glamt[isign]-360. 243 ENDIF 236 244 isign=where(glamu gt 380.) 237 IF isign[0] NE -1 THEN glamu[isign] = glamu[isign]-360. 245 IF isign[0] NE -1 THEN BEGIN 246 glamu[isign] = glamu[isign]-360. 247 ENDIF 238 248 isign=where(glamv gt 380.) 239 IF isign[0] NE -1 THEN glamv[isign] = glamv[isign]-360. 249 IF isign[0] NE -1 THEN BEGIN 250 glamv[isign] = glamv[isign]-360. 251 ENDIF 240 252 isign=where(glamf gt 380.) 241 IF isign[0] NE -1 THEN glamf[isign] = glamf[isign]-360. 253 IF isign[0] NE -1 THEN BEGIN 254 glamf[isign] = glamf[isign]-360. 255 ENDIF 242 256 243 257 ; reduce grid to zonal mean -
trunk/procs/meshes/mesh_from_file.pro
r203 r205 87 87 ; masks made in data_read 88 88 ; 89 IF strpos(ncdf_db, ':') GE 1 THEN directory = (strsplit(ncdf_db, ':', /EXTRACT))[1] $ 90 ELSE directory = ncdf_db 89 IF strpos(ncdf_db, ':') GE 1 THEN BEGIN 90 directory = (strsplit(ncdf_db, ':', /EXTRACT))[1] 91 ENDIF ELSE BEGIN 92 directory = ncdf_db 93 ENDELSE 91 94 92 95 s_file = directory+file_name … … 109 112 idx = where(tmask EQ valmask) 110 113 111 IF idx[0] NE -1 THEN tmask[idx] = 0. 114 IF idx[0] NE -1 THEN BEGIN 115 tmask[idx] = 0. 116 ENDIF 112 117 idx = where(tmask LE 50.) 113 118 tmask[idx] = 0. … … 132 137 var_local = strmid(var_local, 0, idx) 133 138 sl_pos = strpos(var_local, '/') 134 IF sl_pos NE -1 THEN var_local = strmid(var_local, 0, sl_pos) 139 IF sl_pos NE -1 THEN BEGIN 140 var_local = strmid(var_local, 0, sl_pos) 141 ENDIF 135 142 ENDIF 136 143 137 IF debug_w THEN print, ' var_local = ', var_local 144 IF debug_w THEN BEGIN 145 print, ' var_local = ', var_local 146 ENDIF 138 147 139 148 ; find valmask … … 147 156 IF att_txt EQ 'missing_value' OR att_txt EQ 'mask value' OR att_txt EQ '_FillValue' THEN BEGIN 148 157 ncdf_attget, cdfidl, varidl, att_txt, valmask 149 IF debug_w THEN print, ' valmask found = ',valmask, ' in attribute ', att_txt 158 IF debug_w THEN BEGIN 159 print, ' valmask found = ',valmask, ' in attribute ', att_txt 160 ENDIF 150 161 ENDIF 151 162 ENDFOR … … 164 175 END 165 176 ENDCASE 166 IF debug_w THEN print, ' Grid info after initncdf :' 167 IF debug_w THEN print, ' glamt :', size(glamt) 168 IF debug_w THEN print, ' gphit :', size(gphit) 169 IF debug_w THEN print, ' gdept :', size(gdept) 177 IF debug_w THEN BEGIN 178 print, ' Grid info after initncdf :' 179 print, ' glamt :', size(glamt) 180 print, ' gphit :', size(gphit) 181 print, ' gdept :', size(gdept) 182 ENDIF 170 183 171 184 ENDELSE -
trunk/procs/meshes/mesh_gaussian.pro
r203 r205 94 94 ENDIF 95 95 96 IF debug_w THEN print, ' key_yreverse = ', key_yreverse 96 IF debug_w THEN BEGIN 97 print, ' key_yreverse = ', key_yreverse 98 ENDIF 97 99 98 100 CASE trunc OF -
trunk/procs/meshes/mesh_glosea.pro
r197 r205 101 101 IF keyword_set(J_INDEX) THEN BEGIN 102 102 103 IF NOT keyword_set(DELTA_J) THEN delta_j = 1 103 IF NOT keyword_set(DELTA_J) THEN BEGIN 104 delta_j = 1 105 ENDIF 104 106 delta_j = delta_j - 1 105 107 … … 117 119 no_lon_shift = no_lon_shift + 1 118 120 119 IF NOT keyword_set(DELTA_I) THEN delta_i = 1 121 IF NOT keyword_set(DELTA_I) THEN BEGIN 122 delta_i = 1 123 ENDIF 120 124 delta_i = delta_i - 1 121 125 … … 139 143 IF keyword_set(K_INDEX) THEN BEGIN 140 144 141 IF NOT keyword_set(DELTA_K) THEN delta_k = 1 145 IF NOT keyword_set(DELTA_K) THEN BEGIN 146 delta_k = 1 147 ENDIF 142 148 delta_k = delta_k - 1 143 149 … … 171 177 172 178 key_shift =-16 173 IF keyword_set(NO_SHIFT) THEN key_shift = 0 179 IF keyword_set(NO_SHIFT) THEN BEGIN 180 key_shift = 0 181 ENDIF 174 182 175 183 glamt = shift(glamt,key_shift, 0) … … 186 194 187 195 isign=where(glamt LE glamt[0,0]) 188 IF isign[0] NE -1 THEN glamt[isign] = glamt[isign]+360. 196 IF isign[0] NE -1 THEN BEGIN 197 glamt[isign] = glamt[isign]+360. 198 ENDIF 189 199 isign=where(glamu LE glamu[0,0]) 190 IF isign[0] NE -1 THEN glamu[isign] = glamu[isign]+360. 200 IF isign[0] NE -1 THEN BEGIN 201 glamu[isign] = glamu[isign]+360. 202 ENDIF 191 203 192 204 glamv = glamu -
trunk/procs/meshes/mesh_micom.pro
r203 r205 103 103 ; init shift and periodicity 104 104 105 IF keyword_set(NO_SHIFT) THEN key_shift = 0 105 IF keyword_set(NO_SHIFT) THEN BEGIN 106 key_shift = 0 107 ENDIF 106 108 107 109 no_lon_shift = 0 … … 113 115 IF keyword_set(J_INDEX) THEN BEGIN 114 116 115 IF NOT keyword_set(DELTA_J) THEN delta_j = 1 117 IF NOT keyword_set(DELTA_J) THEN BEGIN 118 delta_j = 1 119 ENDIF 116 120 delta_j = delta_j - 1 117 121 … … 131 135 no_lon_shift = no_lon_shift + 1 132 136 133 IF NOT keyword_set(DELTA_I) THEN delta_i = 1 137 IF NOT keyword_set(DELTA_I) THEN BEGIN 138 delta_i = 1 139 ENDIF 134 140 delta_i = delta_i - 1 135 141 … … 163 169 ENDELSE 164 170 165 IF keyword_set(WHOLE_ARRAYS) THEN print, ' [whole array]' 171 IF keyword_set(WHOLE_ARRAYS) THEN BEGIN 172 print, ' [whole array]' 173 ENDIF 166 174 167 175 IF no_lon_shift EQ 0 THEN BEGIN … … 169 177 ENDIF 170 178 171 IF keyword_set(NO_SHIFT) THEN key_offset = [0, 0, 0] 179 IF keyword_set(NO_SHIFT) THEN BEGIN 180 key_offset = [0, 0, 0] 181 ENDIF 172 182 173 183 print, ' key_shift =', key_shift -
trunk/procs/meshes/mesh_orca.pro
r203 r205 77 77 ; temporary 78 78 79 IF h_config EQ 'ORCA05' THEN v_config = 'L46' 80 ; IF h_config EQ 'ORCA_R2' THEN v_config = 'L30' 81 82 IF NOT keyword_set(H_CONFIG) THEN h_config = 'ORCA_R2' 83 IF NOT keyword_set(V_CONFIG) THEN v_config = 'L30' 79 IF h_config EQ 'ORCA05' THEN BEGIN 80 v_config = 'L46' 81 ENDIF 82 ; IF h_config EQ 'ORCA_R2' THEN BEGIN 83 ; v_config = 'L30' 84 ; ENDIF 85 86 IF NOT keyword_set(H_CONFIG) THEN BEGIN 87 h_config = 'ORCA_R2' 88 ENDIF 89 IF NOT keyword_set(V_CONFIG) THEN BEGIN 90 v_config = 'L30' 91 ENDIF 84 92 print, ' Init ORCA mesh horizontal config '+h_config 85 93 print, ' vertical config '+v_config … … 133 141 134 142 135 ; IF keyword_set(NO_SHIFT) THEN key_shift = 0 136 IF keyword_set(NO_SHIFT) THEN shift = 0 ;; key_shift = 0 143 ; IF keyword_set(NO_SHIFT) THEN BEGIN 144 ; key_shift = 0 145 ; ENDIF 146 IF keyword_set(NO_SHIFT) THEN BEGIN 147 shift = 0 148 key_shift = 0 149 ENDIF 137 150 no_lon_shift = 0 138 151 … … 144 157 IF keyword_set(J_INDEX) THEN BEGIN 145 158 146 IF NOT keyword_set(DELTA_J) THEN delta_j = 1 159 IF NOT keyword_set(DELTA_J) THEN BEGIN 160 delta_j = 1 161 ENDIF 147 162 delta_j = delta_j - 1 148 163 … … 160 175 no_lon_shift = no_lon_shift + 1 161 176 162 IF NOT keyword_set(DELTA_I) THEN delta_i = 1 177 IF NOT keyword_set(DELTA_I) THEN BEGIN 178 delta_i = 1 179 ENDIF 163 180 delta_i = delta_i - 1 164 181 … … 179 196 IF keyword_set(K_INDEX) THEN BEGIN 180 197 181 IF NOT keyword_set(DELTA_K) THEN delta_k = 1 198 IF NOT keyword_set(DELTA_K) THEN BEGIN 199 delta_k = 1 200 ENDIF 182 201 delta_k = delta_k - 1 183 202 … … 244 263 245 264 print, ' mask config '+orca_mask_version 246 IF keyword_set(WHOLE_ARRAYS) THEN print, ' [whole array]' 265 IF keyword_set(WHOLE_ARRAYS) THEN BEGIN 266 print, ' [whole array]' 267 ENDIF 247 268 248 269 sm_file = hom_idl+'grids/'+mesmsk … … 331 352 varexp = varexpp 332 353 333 IF keyword_set(NO_SHIFT) THEN key_offset = [0, 0, 0] 354 IF keyword_set(NO_SHIFT) THEN BEGIN 355 key_offset = [0, 0, 0] 356 ENDIF 334 357 335 358 print, ' key_shift =', key_shift 336 IF debug_w THEN print, ' vargrid, varexp at exit = ',vargrid, varexp 359 IF debug_w THEN BEGIN 360 print, ' vargrid, varexp at exit = ',vargrid, varexp 361 ENDIF 337 362 338 363 print, ' End of ORCA mesh config ' -
trunk/procs/meshes/mesh_pcmdi.pro
r203 r205 57 57 58 58 print,' Model inits for ', model 59 IF debug_w THEN print, ' varexp at start of mesh_pcmdi:', varexp 59 IF debug_w THEN BEGIN 60 print, ' varexp at start of mesh_pcmdi:', varexp 61 ENDIF 60 62 61 63 varexpp = varexp … … 87 89 ENDIF 88 90 89 IF debug_w THEN print, ' key_yreverse = ', key_yreverse 91 IF debug_w THEN BEGIN 92 print, ' key_yreverse = ', key_yreverse 93 ENDIF 90 94 91 95 IF res NE 'NOT FOUND' THEN BEGIN … … 94 98 res_grid = execute(cmd_grid) 95 99 96 IF debug_w THEN print, ' Found mask from ',sm_file 100 IF debug_w THEN BEGIN 101 print, ' Found mask from ',sm_file 102 ENDIF 97 103 98 104 tmask = byte(read_ncdf('sftlf', 0, 0, /timestep, file = sm_file, /nostruct)) 99 105 100 106 idx = where(tmask EQ valmask) 101 IF idx[0] NE -1 THEN tmask[idx] = 0. 107 IF idx[0] NE -1 THEN BEGIN 108 tmask[idx] = 0. 109 ENDIF 102 110 103 111 idx = where(tmask LE 50.) … … 108 116 ENDIF 109 117 110 IF debug_w THEN print, ' key_shift = ', key_shift 111 IF debug_w THEN print, ' key_yreverse = ', key_yreverse 118 IF debug_w THEN BEGIN 119 print, ' key_shift = ', key_shift 120 print, ' key_yreverse = ', key_yreverse 121 ENDIF 112 122 113 123 masked_data = 0 -
trunk/procs/meshes/mesh_regular.pro
r203 r205 89 89 jpi = floor(360./deltax) 90 90 jpj = floor(180./deltay) 91 IF keyword_set(EQUATOR) THEN jpj = jpj + 1 91 IF keyword_set(EQUATOR) THEN BEGIN 92 jpj = jpj + 1 93 ENDIF 92 94 jpk = 1 93 95 … … 99 101 ; 1. Define longitudes 100 102 101 IF NOT keyword_set(inilon) THEN inilon = 0. 103 IF NOT keyword_set(inilon) THEN BEGIN 104 inilon = 0. 105 ENDIF 102 106 103 107 glamt = 360.0*findgen(jpi)/float(jpi)+inilon … … 152 156 ENDIF 153 157 154 IF keyword_set(REVERSE_Y) THEN gphit = reverse(gphit) 158 IF keyword_set(REVERSE_Y) THEN BEGIN 159 gphit = reverse(gphit) 160 ENDIF 155 161 gphit = replicate(1, jpi)#gphit 156 162 … … 170 176 ; Use the computegrid routine 171 177 cmd_grid = 'computegrid, XAXIS = glamt, YAXIS = gphit, MASK = tmask, GLAMBOUNDARY = glamboundary, /FULLCGRID'+shift_txt+periodic_txt+idx_txt 172 IF debug_w THEN print, cmd_grid 178 IF debug_w THEN BEGIN 179 print, cmd_grid 180 ENDIF 173 181 res = execute( cmd_grid ) 174 182 -
trunk/procs/meshes/mesh_tao.pro
r203 r205 44 44 45 45 jpi = 86L & jpj = 21L & jpk = 51L & key_shift = 0 46 IF keyword_set(NO_SHIFT) THEN key_shift = 0 46 IF keyword_set(NO_SHIFT) THEN BEGIN 47 key_shift = 0 48 ENDIF 47 49 48 50 jpiglo = jpi -
trunk/procs/meshes/mesh_um.pro
r203 r205 239 239 ; Shift re-init U,V,F 240 240 241 IF keyword_set(NO_SHIFT) THEN key_shift = 0 241 IF keyword_set(NO_SHIFT) THEN BEGIN 242 key_shift = 0 243 ENDIF 242 244 243 245 glamu = glamt -
trunk/procs/msf_mult.pro
r203 r205 72 72 ENDIF 73 73 74 IF n_elements(jpl) EQ 0 THEN jpl = jpj 74 IF n_elements(jpl) EQ 0 THEN BEGIN 75 jpl = jpj 76 ENDIF 75 77 ; 76 78 ; jpl bandes de latitudes -
trunk/procs/msf_simple.pro
r203 r205 73 73 ENDIF 74 74 75 IF n_elements(jpl) EQ 0 THEN jpl = jpj 75 IF n_elements(jpl) EQ 0 THEN BEGIN 76 jpl = jpj 77 ENDIF 76 78 ; 77 79 ; jpl bandes de latitudes -
trunk/procs/mth_decode.pro
r203 r205 38 38 nmth = (size(strd))[1] 39 39 njpt = n_elements((lindgen(jpt))[0:*:12]) 40 IF debug_w THEN print, ' nmth,njpt', nmth, njpt 40 IF debug_w THEN BEGIN 41 print, ' nmth,njpt', nmth, njpt 42 ENDIF 41 43 42 44 idxm = lonarr(nmth, njpt) … … 46 48 ENDFOR 47 49 48 IF nmth EQ 1 THEN ntxt = mth[strd-1] 50 IF nmth EQ 1 THEN BEGIN 51 ntxt = mth[strd-1] 52 ENDIF 49 53 50 54 print, ' Warning: monthly computation and average for following period: ', ntxt -
trunk/procs/nc_put.pro
r203 r205 203 203 204 204 cdfid = ncdf_create(ncdf_db+file_name, /clobber) 205 IF debug_w THEN print, ' type,cdfid = ', type, cdfid 205 IF debug_w THEN BEGIN 206 print, ' type,cdfid = ', type, cdfid 207 ENDIF 206 208 ncdf_control, cdfid, /fill 207 209 … … 240 242 tid = ncdf_dimdef(cdfid, 'time', /UNLIMITED) 241 243 242 IF debug_w THEN print, ' dim check ', dim_check 244 IF debug_w THEN BEGIN 245 print, ' dim check ', dim_check 246 ENDIF 243 247 244 248 IF dim_check NE dim[0] THEN BEGIN … … 251 255 252 256 ; horizontal zonal axis 253 IF debug_w THEN print, ' building zonal axis, xid: ', xid 257 IF debug_w THEN BEGIN 258 print, ' building zonal axis, xid: ', xid 259 ENDIF 254 260 ; IF strpos(type, 'x') NE -1 AND keyword_set(X) THEN BEGIN 255 261 IF strpos (type, 'xy') NE -1 THEN BEGIN … … 264 270 265 271 ; horizontal meridional axis 266 IF debug_w THEN print, ' building Y axis, yid: ', yid 272 IF debug_w THEN BEGIN 273 print, ' building Y axis, yid: ', yid 274 ENDIF 267 275 IF strpos (type, 'xy') NE -1 THEN BEGIN 268 276 latid = ncdf_vardef(cdfid,'lat', [xid, yid], /FLOAT) … … 275 283 276 284 ; vertical axis 277 IF debug_w THEN print, ' building Z axis, zid: ', zid 285 IF debug_w THEN BEGIN 286 print, ' building Z axis, zid: ', zid 287 ENDIF 278 288 IF zpos NE -1 AND keyword_set(Z) THEN BEGIN 279 289 vertid = ncdf_vardef(cdfid,z.name, [zid], /FLOAT) … … 286 296 287 297 ; time axis 288 IF debug_w THEN print, ' building T axis, tid: ', tid 298 IF debug_w THEN BEGIN 299 print, ' building T axis, tid: ', tid 300 ENDIF 289 301 IF tpos NE -1 AND keyword_set(T) THEN BEGIN 290 302 mid = NCDF_VARDEF(cdfid, 'time', [tid], /long) … … 315 327 ENDELSE 316 328 317 IF debug_w THEN print, ' test 1 fld.short_name = ', fld.short_name 318 IF debug_w THEN print, ' swx,y,z,t = ', swx, swy, swz, swt 329 IF debug_w THEN BEGIN 330 print, ' test 1 fld.short_name = ', fld.short_name 331 print, ' swx,y,z,t = ', swx, swy, swz, swt 332 ENDIF 319 333 320 334 ; field attributes 321 335 322 IF debug_w THEN print, ' type, size fld.data ', type, size(fld.data) 336 IF debug_w THEN BEGIN 337 print, ' type, size fld.data ', type, size(fld.data) 338 ENDIF 323 339 324 340 varn = strcompress(fld.short_name, /remove_all) -
trunk/procs/nc_read.pro
r203 r205 123 123 ENDIF 124 124 125 IF NOT keyword_set(TIME_1) THEN time_1 = 1 126 IF NOT keyword_set(TIME_2) THEN time_2 = time_1 127 IF debug_w THEN print, ' Before read_ncdf, key_yreverse=', key_yreverse 125 IF NOT keyword_set(TIME_1) THEN BEGIN 126 time_1 = 1 127 ENDIF 128 IF NOT keyword_set(TIME_2) THEN BEGIN 129 time_2 = time_1 130 ENDIF 131 IF debug_w THEN BEGIN 132 print, ' Before read_ncdf, key_yreverse=', key_yreverse 133 ENDIF 128 134 129 135 ; decide which subdomain of data to read 130 IF debug_w THEN print, ' keyword_set(ALL_DATA) : ', keyword_set(ALL_DATA) 136 IF debug_w THEN BEGIN 137 print, ' keyword_set(ALL_DATA) : ', keyword_set(ALL_DATA) 138 ENDIF 131 139 IF keyword_set(ALL_DATA) THEN BEGIN 132 140 tout = 1 … … 139 147 140 148 ; local directory 141 IF strpos(ncdf_db, ':') GE 1 THEN directory = (strsplit(ncdf_db, ':', /EXTRACT))[1] $ 142 ELSE directory = ncdf_db 149 IF strpos(ncdf_db, ':') GE 1 THEN BEGIN 150 directory = (strsplit(ncdf_db, ':', /EXTRACT))[1] 151 ENDIF ELSE BEGIN 152 directory = ncdf_db 153 ENDELSE 143 154 144 155 ; Find the variable's attribute … … 148 159 ; By default units for the Z axis are meters 149 160 IF n_elements(gdept) GT 1 THEN BEGIN 150 IF name_level NE '-' THEN $ 151 ncdf_getatt, directory+file_name, name_level, units = units_depth ELSE units_depth = 'm' 161 IF name_level NE '-' THEN BEGIN 162 ncdf_getatt, directory+file_name, name_level, units = units_depth 163 ENDIF ELSE BEGIN 164 units_depth = 'm' 165 ENDELSE 152 166 ENDIF ELSE units_depth = '' 153 167 … … 155 169 ; of time steps found in the file. 156 170 jpt_max = find_jptmax(file_name, IODIRECTORY = directory) 157 IF time_2-time_1+1 GT jpt_max AND jpt_max NE -1 THEN time_2 = time_1+jpt_max-1 171 IF time_2-time_1+1 GT jpt_max AND jpt_max NE -1 THEN BEGIN 172 time_2 = time_1+jpt_max-1 173 ENDIF 158 174 159 175 ; Read the data with a call to read_ncdf 160 IF debug_w THEN print, ' ' 161 IF debug_w THEN print, ' Reading raw data from ', file_name 162 IF debug_w AND keyword_set(boxzoom) THEN print, ' boxzoom before=', boxzoom 176 IF debug_w THEN BEGIN 177 print, ' ' 178 print, ' Reading raw data from ', file_name 179 IF keyword_set(boxzoom) THEN BEGIN 180 print, ' boxzoom before=', boxzoom 181 ENDIF 182 ENDIF 163 183 164 184 lec_data = read_ncdf(var_name, time_1-1, time_2-1, BOXZOOM = boxzoom, FILENAME = directory+file_name, $ … … 171 191 ENDIF 172 192 173 IF debug_w THEN print, ' ' 174 IF debug_w AND keyword_set(boxzoom) THEN print, ' boxzoom after=', boxzoom 175 IF debug_w THEN print, ' firstxt,firstyt,firstzt=', firstxt, firstyt, firstzt 176 IF debug_w THEN print, ' lastxt,lastyt,lastzt=', lastxt, lastyt, lastzt 177 IF debug_w THEN print, ' zinvar=', zinvar 178 IF debug_w THEN print, ' jpt=', jpt 179 IF debug_w THEN print, ' key_shift=', key_shift 180 IF debug_w THEN print, ' After read_ncdf, key_yreverse=',key_yreverse 181 IF debug_w THEN print, ' ' 193 IF debug_w THEN BEGIN 194 print, ' ' 195 IF keyword_set(boxzoom) THEN BEGIN 196 print, ' boxzoom after=', boxzoom 197 ENDIF 198 print, ' firstxt,firstyt,firstzt=', firstxt, firstyt, firstzt 199 print, ' lastxt,lastyt,lastzt=', lastxt, lastyt, lastzt 200 print, ' zinvar=', zinvar 201 print, ' jpt=', jpt 202 print, ' key_shift=', key_shift 203 print, ' After read_ncdf, key_yreverse=',key_yreverse 204 print, ' ' 205 ENDIF 182 206 183 207 ; Average data along vertical if needed and update some features … … 200 224 ; replace NaN with valmask 201 225 ; idx_t = where (~finite(field.data)) 202 ; IF idx_t[0] NE -1 THEN field.data(idx_t) = valmask 226 ; IF idx_t[0] NE -1 THEN BEGIN 227 ; field.data(idx_t) = valmask 228 ; ENDIF 203 229 204 230 ; get valmask (might need valmask = float(string(valmask)) … … 210 236 print, ' *** Warning valmask is negative - changing sign: ', valmask 211 237 idx_t = where (field.data EQ valmask) 212 IF idx_t[0] NE -1 THEN field.data[idx_t] = -valmask 238 IF idx_t[0] NE -1 THEN BEGIN 239 field.data[idx_t] = -valmask 240 ENDIF 213 241 valmask = -valmask 214 242 idx_t=0 ; free memory -
trunk/procs/overlay_type.pro
r203 r205 119 119 overc = ',ov1d='+strtrim(string((iover-1) < 1), 2) 120 120 121 IF iover EQ 1 THEN overc = ',ov1d=0' 121 IF iover EQ 1 THEN BEGIN 122 overc = ',ov1d=0' 123 ENDIF 122 124 123 125 ; overlay color … … 125 127 colov = '' 126 128 127 IF dimplot EQ 1 THEN index_over = index_over + 1 129 IF dimplot EQ 1 THEN BEGIN 130 index_over = index_over + 1 131 ENDIF 128 132 IF index_over EQ 1 THEN BEGIN 129 133 ; index_over = 2 … … 138 142 ENDIF 139 143 140 IF pal_type EQ 'col' AND index_over GE 1 THEN colov = ',COLOR='+string(line_color[index_over-1]) 144 IF pal_type EQ 'col' AND index_over GE 1 THEN BEGIN 145 colov = ',COLOR='+string(line_color[index_over-1]) 146 ENDIF 141 147 142 148 ; overlay thickness … … 150 156 ; result 151 157 152 IF dimplot EQ 1 THEN overc = overc+colov+line_thick_txt+line_style_txt 153 ; IF dimplot EQ 2 THEN overc = overc+line_thick_txt+line_style_txt 154 IF dimplot EQ 2 THEN overc = overc+line_style_txt 158 IF dimplot EQ 1 THEN BEGIN 159 overc = overc+colov+line_thick_txt+line_style_txt 160 ENDIF 161 ; IF dimplot EQ 2 THEN BEGIN 162 ; overc = overc+line_thick_txt+line_style_txt 163 ; ENDIF 164 IF dimplot EQ 2 THEN BEGIN 165 overc = overc+line_style_txt 166 ENDIF 155 167 156 168 return, overc -
trunk/procs/plt_map.pro
r203 r205 116 116 cmd_wrk = cmd 117 117 118 IF cmd.on EQ 2 THEN stop 118 IF cmd.on EQ 2 THEN BEGIN 119 stop 120 ENDIF 119 121 ; 120 122 ; incompatible options of plt_def and post_it … … 161 163 162 164 CASE cmd.plt OF 163 'xyt': BEGIN & plttyp = 'plt' & hotyp = 'xyt' & dimplot = 2 & END 165 'xyt': BEGIN 166 plttyp = 'plt' 167 hotyp = 'xyt' 168 dimplot = 2 169 END 164 170 ELSE: 165 171 ENDCASE … … 220 226 spectplt = 0 221 227 IF strpos(cmd.plt, '@s') GE 1 THEN BEGIN 222 IF hotyp EQ 't' THEN spectplt = 1 ELSE BEGIN 223 print, ' *** spectrum [@s] applies to 1D time serie only (t_<box>)' 224 stop 228 IF hotyp EQ 't' THEN BEGIN 229 spectplt = 1 230 ENDIF ELSE BEGIN 231 print, ' *** spectrum [@s] applies to 1D time serie only (t_<box>)' 232 stop 225 233 ENDELSE 226 234 cmd.plt = strmid(cmd.plt, 0, strpos(cmd.plt, '@s')) … … 231 239 waveplt = 0 232 240 IF strpos(cmd.plt, '@w') GE 1 THEN BEGIN 233 IF hotyp EQ 't' THEN waveplt = 1 ELSE BEGIN 234 print, ' *** wavelet [@w] applies to 1D time serie only (t_<box>)' 235 stop 241 IF hotyp EQ 't' THEN BEGIN 242 waveplt = 1 243 ENDIF ELSE BEGIN 244 print, ' *** wavelet [@w] applies to 1D time serie only (t_<box>)' 245 stop 236 246 ENDELSE 237 247 cmd.plt = strmid(cmd.plt, 0, strpos(cmd.plt, '@w')) … … 257 267 sw_diffg = 0 258 268 def_grid, cmd 259 IF debug_w THEN print, ' after def_grid in plt_map: cmd.grid/varexp/vargrid ',cmd.grid,' ', varexp, ' ', vargrid 269 IF debug_w THEN BEGIN 270 print, ' after def_grid in plt_map: cmd.grid/varexp/vargrid ',cmd.grid,' ', varexp, ' ', vargrid 271 ENDIF 260 272 261 273 ; vertical average if 3D field 262 274 vert_switch = 0 263 IF plttyp EQ 'plt' AND vert_type ne '0' THEN vert_switch = 1 264 IF plttyp EQ 'pltt' AND vert_type ne '0' THEN vert_switch = 1 265 IF plttyp EQ 'plt1d' AND vert_type ne '0' THEN vert_switch = 1 266 IF plt1dtyp EQ 'z' THEN vert_switch = 0 275 IF plttyp EQ 'plt' AND vert_type ne '0' THEN BEGIN 276 vert_switch = 1 277 ENDIF 278 IF plttyp EQ 'pltt' AND vert_type ne '0' THEN BEGIN 279 vert_switch = 1 280 ENDIF 281 IF plttyp EQ 'plt1d' AND vert_type ne '0' THEN BEGIN 282 vert_switch = 1 283 ENDIF 284 IF plt1dtyp EQ 'z' THEN BEGIN 285 vert_switch = 0 286 ENDIF 267 287 268 288 ; read all data if netcdf output 269 289 270 IF debug_w THEN print, ' force_all_data_read in pltmap: ', force_all_data_read 290 IF debug_w THEN BEGIN 291 print, ' force_all_data_read in pltmap: ', force_all_data_read 292 ENDIF 271 293 272 294 IF cmd.out NE 'cdf' THEN BEGIN … … 274 296 ENDIF ELSE BEGIN 275 297 all_data_str = ',/ALL_DATA' 276 END 298 ENDELSE 277 299 278 300 ; =========== … … 287 309 printf, nulhis, strcompress(pltcmd) 288 310 printf, nulhis, ' ' 289 IF execute(pltcmd) EQ 0 THEN stop 311 IF execute(pltcmd) EQ 0 THEN BEGIN 312 stop 313 ENDIF 290 314 ENDELSE 291 315 292 316 ; data specific treatments 293 IF cmd.var EQ 'sla' THEN field.origin = 'diff' 317 IF cmd.var EQ 'sla' THEN BEGIN 318 field.origin = 'diff' 319 ENDIF 294 320 IF cmd.var EQ 'sosstsst' AND cmd.exp EQ 'HadISST1' THEN BEGIN 295 321 ; limit data to -1.8 C 296 322 idx = where(field.data EQ valmask) 297 323 field.data = field.data > (-1.8) 298 IF idx[0] NE -1 THEN field.data[idx] = valmask 324 IF idx[0] NE -1 THEN BEGIN 325 field.data[idx] = valmask 326 ENDIF 299 327 ENDIF 300 328 301 329 help, field,/structure 302 IF n_elements(field.data) EQ 1 THEN stop 330 IF n_elements(field.data) EQ 1 THEN BEGIN 331 stop 332 ENDIF 303 333 304 334 ; change cmd.var if macro … … 307 337 cmd.var = field.name 308 338 cmd.var = STRMID(cmd.var, 2, 15) 309 IF debug_w THEN print, 'cmd.var : ', cmd.var 339 IF debug_w THEN BEGIN 340 print, 'cmd.var : ', cmd.var 341 ENDIF 310 342 END 311 343 ELSE: 312 344 ENDCASE 313 IF vecplot EQ 1 THEN BEGIN ; vectors case 345 IF vecplot EQ 1 THEN BEGIN 346 ; vectors case 314 347 CASE STRMID(cmd.var2, 0, 2) OF 315 '@@': begin348 '@@': BEGIN 316 349 cmd.var2 = STRMID(cmd.var2, 2, 15) 317 350 END … … 321 354 322 355 ; spectum plot 323 IF spectplt EQ 1 THEN plttyp = 'spec' 356 IF spectplt EQ 1 THEN BEGIN 357 plttyp = 'spec' 358 ENDIF 324 359 ; wavelet plot 325 IF waveplt EQ 1 THEN plttyp = 'wavelet' 360 IF waveplt EQ 1 THEN BEGIN 361 plttyp = 'wavelet' 362 ENDIF 326 363 327 364 xlogax = '' … … 339 376 e3w_b = e3w 340 377 tmask_b = tmask 341 ; IF cmd.var EQ 'vosigvol' THEN xlogax = ',xlog = 1' 378 ; IF cmd.var EQ 'vosigvol' THEN BEGIN 379 ; xlogax = ',xlog = 1' 380 ; ENDIF 342 381 ; modify vertical grid -> sigma 343 382 n_sig = (sig_max - sig_min)/sig_del + 1 … … 360 399 END 361 400 362 IF debug_w THEN print, ' cmd after data_read in plt_map = ', cmd 401 IF debug_w THEN BEGIN 402 print, ' cmd after data_read in plt_map = ', cmd 403 ENDIF 363 404 ; 364 405 ; ====================== … … 377 418 'ybinx': BEGIN 378 419 ; if var3 exists then var = var1/var3 379 IF var3_ybinx NE "" THEN var_att = cmd.var+"/"+var3_ybinx ELSE var_att = cmd.var 420 IF var3_ybinx NE "" THEN BEGIN 421 var_att = cmd.var+"/"+var3_ybinx 422 ENDIF ELSE BEGIN 423 var_att = cmd.var 424 ENDELSE 380 425 END 381 426 ELSE: var_att = cmd.var 382 427 ENDCASE 383 428 384 IF debug_w THEN print, ' Looking for min/max/iso attributes for variable :', var_att 429 IF debug_w THEN BEGIN 430 print, ' Looking for min/max/iso attributes for variable :', var_att 431 ENDIF 385 432 386 433 ; extremum … … 409 456 fldatt.mid = fldint.mid 410 457 411 IF debug_w THEN print, 'plt_map 1 :', fldatt.mult, fldatt.add, fldatt.min, fldatt.max 412 413 IF fldatt.mult NE 1. OR fldatt.add NE 0. THEN field.units = fldatt.unit 458 IF debug_w THEN BEGIN 459 print, 'plt_map 1 :', fldatt.mult, fldatt.add, fldatt.min, fldatt.max 460 ENDIF 461 462 IF fldatt.mult NE 1. OR fldatt.add NE 0. THEN BEGIN 463 field.units = fldatt.unit 464 ENDIF 414 465 fld = field.data*fldatt.mult + fldatt.add 415 IF (where(field.data EQ valmask))[0] NE -1 THEN $466 IF (where(field.data EQ valmask))[0] NE -1 THEN BEGIN 416 467 fld[where(field.data EQ valmask)] = valmask 468 ENDIF 417 469 418 470 ; field 2 if needed 419 471 420 IF plttyp EQ 'yfx' OR plttyp EQ 'ybinx' OR vecplot EQ 1 THEN 472 IF plttyp EQ 'yfx' OR plttyp EQ 'ybinx' OR vecplot EQ 1 THEN BEGIN 421 473 fldatt2 = fldatt 422 474 … … 441 493 fldatt2.mid = fldint2.mid 442 494 443 IF fldatt2.mult NE 1. OR fldatt2.add NE 0. THEN field.units2 = fldatt2.unit 495 IF fldatt2.mult NE 1. OR fldatt2.add NE 0. THEN BEGIN 496 field.units2 = fldatt2.unit 497 ENDIF 444 498 fld2 = field.data2*fldatt2.mult + fldatt2.add 445 IF (where(field.data2 EQ valmask))[0] NE -1 THEN $499 IF (where(field.data2 EQ valmask))[0] NE -1 THEN BEGIN 446 500 fld2[where(field.data2 EQ valmask)] = valmask 501 ENDIF 447 502 448 503 ENDIF … … 450 505 ; field 3 if needed 451 506 452 IF plttyp EQ 'ybinx' AND var3_ybinx NE "" THEN 507 IF plttyp EQ 'ybinx' AND var3_ybinx NE "" THEN BEGIN 453 508 fldatt3 = fldatt 454 509 … … 473 528 fldatt3.mid = fldint3.mid 474 529 475 IF fldatt3.mult NE 1. OR fldatt3.add NE 0. THEN field.units3 = fldatt3.unit 530 IF fldatt3.mult NE 1. OR fldatt3.add NE 0. THEN BEGIN 531 field.units3 = fldatt3.unit 532 ENDIF 476 533 fld3 = field.data3*fldatt3.mult + fldatt3.add 477 IF (where(field.data3 EQ valmask))[0] NE -1 THEN $534 IF (where(field.data3 EQ valmask))[0] NE -1 THEN BEGIN 478 535 fld3[where(field.data3 EQ valmask)] = valmask 536 ENDIF 479 537 480 538 ENDIF … … 509 567 'yfx': varlegend2 = field.legend2+trd_txt+' ('+field.units2+')' 510 568 'ybinx': BEGIN 511 IF strmid(cmd2.trend, 0, 1) EQ '4' THEN varlegend = field.legend2+trd_txt+' ('+field.units2+')' $ 512 ELSE varlegend = field.legend2+' ('+field.units2+')' 569 IF strmid(cmd2.trend, 0, 1) EQ '4' THEN BEGIN 570 varlegend = field.legend2+trd_txt+' ('+field.units2+')' 571 ENDIF ELSE BEGIN 572 varlegend = field.legend2+' ('+field.units2+')' 573 ENDELSE 513 574 varlegend2 = field.legend+trd_txt+' ('+field.units+')' 514 575 END 515 576 ELSE: BEGIN 516 IF run_stddev GT 0 THEN trd_txt = trd_txt+' running Std Dev ['+string(run_stddev, format = '(I3)')+']' 577 IF run_stddev GT 0 THEN BEGIN 578 trd_txt = trd_txt+' running Std Dev ['+string(run_stddev, format = '(I3)')+']' 579 ENDIF 517 580 END 518 581 ENDCASE … … 523 586 '1m': BEGIN 524 587 mn = def_month(cmd.timave, cmd.date1) 525 IF strmid(cmd.timave, 0, 3) EQ '1mm' THEN $ 526 date_txt = mn+' ('+strmid(cmd.date1, 3, strlen(cmd.date1)-3)+')' $ 527 ELSE date_txt = mn+' '+strmid(cmd.date1, 0, strlen(cmd.date1)-2) 588 IF strmid(cmd.timave, 0, 3) EQ '1mm' THEN BEGIN 589 date_txt = mn+' ('+strmid(cmd.date1, 3, strlen(cmd.date1)-3)+')' 590 ENDIF ELSE BEGIN 591 date_txt = mn+' '+strmid(cmd.date1, 0, strlen(cmd.date1)-2) 592 ENDELSE 528 593 END 529 594 '3m': BEGIN 530 595 mn = def_month(cmd.timave, cmd.date1) 531 IF strmid(cmd.timave, 0, 3) EQ '3mm' THEN $ 532 date_txt = mn+' ('+strmid(cmd.date1, 3, strlen(cmd.date1)-3)+')' $ 533 ELSE date_txt = mn+' '+strmid(cmd.date1, 0, strlen(cmd.date1)-2) 596 IF strmid(cmd.timave, 0, 3) EQ '3mm' THEN BEGIN 597 date_txt = mn+' ('+strmid(cmd.date1, 3, strlen(cmd.date1)-3)+')' 598 ENDIF ELSE BEGIN 599 date_txt = mn+' '+strmid(cmd.date1, 0, strlen(cmd.date1)-2) 600 ENDELSE 534 601 END 535 602 '6m': BEGIN 536 603 mn = def_month(cmd.timave, cmd.date1) 537 IF strmid(cmd.timave, 0, 3) EQ '6mm' THEN $ 538 date_txt = mn+' ('+strmid(cmd.date1, 3, strlen(cmd.date1)-3)+')' $ 539 ELSE date_txt = mn+' '+strmid(cmd.date1, 0, strlen(cmd.date1)-2) 604 IF strmid(cmd.timave, 0, 3) EQ '6mm' THEN BEGIN 605 date_txt = mn+' ('+strmid(cmd.date1, 3, strlen(cmd.date1)-3)+')' 606 ENDIF ELSE BEGIN 607 date_txt = mn+' '+strmid(cmd.date1, 0, strlen(cmd.date1)-2) 608 ENDELSE 540 609 END 541 610 ELSE:date_txt = cmd.timave+' '+cmd.date1 … … 545 614 'pltt':BEGIN 546 615 date_txt = cmd.timave 547 IF strmid(cmd.timave, 1, 2) EQ 'mm' THEN $616 IF strmid(cmd.timave, 1, 2) EQ 'mm' THEN BEGIN 548 617 date_txt = cmd.timave+' ('+strmid(cmd.date1, 3, strlen(cmd.date1)-3)+')' 618 ENDIF 549 619 END 550 620 'yfx': BEGIN 551 IF hotyp NE '-' THEN date_txt = cmd.timave+' '+cmd.date1+' '+cmd.spec 621 IF hotyp NE '-' THEN BEGIN 622 date_txt = cmd.timave+' '+cmd.date1+' '+cmd.spec 623 ENDIF 552 624 END 553 625 'ybinx': BEGIN 554 IF hotyp NE '-' THEN date_txt = cmd.timave+' '+cmd.date1+' '+cmd.spec 626 IF hotyp NE '-' THEN BEGIN 627 date_txt = cmd.timave+' '+cmd.date1+' '+cmd.spec 628 ENDIF 555 629 END 556 630 'wavelet': BEGIN 557 631 date_txt = cmd.timave+' Wavelet' 558 IF strmid(cmd.timave, 1, 2) EQ 'mm' THEN $632 IF strmid(cmd.timave, 1, 2) EQ 'mm' THEN BEGIN 559 633 date_txt = cmd.timave+' Wavelet ('+strmid(cmd.date1, 3, strlen(cmd.date1)-3)+')' 634 ENDIF 560 635 END 561 636 ELSE: … … 566 641 ; defined if fraction of x/y.range is added to plot domain 567 642 568 ; IF free_1d_minmax EQ 'no' THEN fraction = 0. ELSE fraction = 1.0 643 ; IF free_1d_minmax EQ 'no' THEN BEGIN 644 ; fraction = 0. 645 ; ENDIF ELSE BEGIN 646 ; fraction = 1.0 647 ; ENDELSE 569 648 fraction = 0. 570 649 … … 601 680 minc2 = -fldatt2.dmax & maxc2 = fldatt2.dmax 602 681 ENDIF 603 IF debug_w THEN print, ' minc/maxc for 1d fld1/fld2', minc, maxc, minc2, maxc2 682 IF debug_w THEN BEGIN 683 print, ' minc/maxc for 1d fld1/fld2', minc, maxc, minc2, maxc2 684 ENDIF 604 685 END 605 686 ELSE: BEGIN & minc = 0. & maxc = 0. & END … … 622 703 print, ' '+cmd.var, ' plot attributes ('+plttyp+') : min/max/int=', $ 623 704 minc, maxc, fldatt.int 624 IF ( fldatt.mult NE 1.0 OR fldatt.add NE 0.0 ) THEN $705 IF ( fldatt.mult NE 1.0 OR fldatt.add NE 0.0 ) THEN BEGIN 625 706 print, ' --> Modify field using : ', 'mult/add=' , $ 626 707 fldatt.mult, fldatt.add, ' to obtain : ', fldatt.unit 708 ENDIF 627 709 END 628 710 1: BEGIN 629 711 print, ' '+cmd.var, ' plot attributes ('+plttyp+') : min/max=',minc, maxc 630 IF ( fldatt.mult NE 1.0 OR fldatt.add NE 0.0 ) THEN $712 IF ( fldatt.mult NE 1.0 OR fldatt.add NE 0.0 ) THEN BEGIN 631 713 print, ' --> Modify field using : ', 'mult/add=' , $ 632 714 fldatt.mult, fldatt.add, ' to obtain : ', fldatt.unit 715 ENDIF 633 716 END 634 717 0: BEGIN 635 718 print, ' '+cmd.var, ' plot attributes ('+plttyp+') : min/max=',minc, maxc 636 IF ( fldatt.mult NE 1.0 OR fldatt.add NE 0.0 ) THEN $719 IF ( fldatt.mult NE 1.0 OR fldatt.add NE 0.0 ) THEN BEGIN 637 720 print, ' --> Modify field using : ', 'mult/add=' , $ 638 721 fldatt.mult, fldatt.add, ' to obtain : ', fldatt.unit 722 ENDIF 639 723 print, ' '+cmd.var2, ' plot attributes ('+plttyp+') : min/max=',minc2, maxc2 640 IF ( fldatt2.mult NE 1.0 OR fldatt2.add NE 0.0 ) THEN $724 IF ( fldatt2.mult NE 1.0 OR fldatt2.add NE 0.0 ) THEN BEGIN 641 725 print, ' --> Modify field using : ', 'mult/add=' , $ 642 726 fldatt2.mult, fldatt2.add, ' to obtain : ', fldatt2.unit 727 ENDIF 643 728 END 644 729 ELSE: … … 666 751 ENDELSE 667 752 IF long(fldatt.int) NE 0 THEN BEGIN 668 IF fldatt.int/long(fldatt.int) NE 1 THEN fmt = '(f5.1)' 753 IF fldatt.int/long(fldatt.int) NE 1 THEN BEGIN 754 fmt = '(f5.1)' 755 ENDIF 669 756 ENDIF 670 757 colbarfor = ', format = '''+fmt+'''' … … 696 783 697 784 nocoltxt = '' 698 IF nofill EQ 1 THEN nocoltxt = ',NOCOULEUR=1' 699 700 IF dimplot NE 2 THEN nofill = 1 785 IF nofill EQ 1 THEN BEGIN 786 nocoltxt = ',NOCOULEUR=1' 787 ENDIF 788 789 IF dimplot NE 2 THEN BEGIN 790 nofill = 1 791 ENDIF 701 792 702 793 nocolorbar = 0 703 IF col_palette EQ 'no' THEN nocolorbar = 1 704 IF pal_type EQ '2dom' THEN nocolorbar = 1 705 IF iover GT 1 THEN nocolorbar = 1 706 IF dimplot NE 2 THEN nocolorbar = 1 707 794 IF col_palette EQ 'no' THEN BEGIN 795 nocolorbar = 1 796 ENDIF 797 IF pal_type EQ '2dom' THEN BEGIN 798 nocolorbar = 1 799 ENDIF 800 IF iover GT 1 THEN BEGIN 801 nocolorbar = 1 802 ENDIF 803 IF dimplot NE 2 THEN BEGIN 804 nocolorbar = 1 805 ENDIF 708 806 IF cmd.out NE 'cdf' THEN BEGIN 709 807 readpal = 0 710 IF nofill EQ 0 AND dimplot GT 1 THEN readpal = 1 711 IF waveplt EQ 1 THEN readpal = 2 712 IF field.origin EQ 'div' AND plttyp NE 'pltt' THEN readpal = 3 808 IF nofill EQ 0 AND dimplot GT 1 THEN BEGIN 809 readpal = 1 810 ENDIF 811 IF waveplt EQ 1 THEN BEGIN 812 readpal = 2 813 ENDIF 814 IF field.origin EQ 'div' AND plttyp NE 'pltt' THEN BEGIN 815 readpal = 3 816 ENDIF 713 817 ;; Necessary for correlation plots (overlay of 2D fields) 714 IF dimplot GT 1 AND nover GT 1 AND iover GT 1 THEN readpal = 1 818 IF dimplot GT 1 AND nover GT 1 AND iover GT 1 THEN BEGIN 819 readpal = 1 820 ENDIF 715 821 IF readpal GE 1 THEN BEGIN 716 822 lec_pal_gmt, cmd.var, c_anot_str, fmt, found, readpal … … 722 828 min_palette = min(levels_gmt) 723 829 max_palette = max(levels_gmt) 724 IF finite(minc) NE 0 THEN minc = min([minc, min_palette]) ELSE minc = min_palette 725 IF finite(maxc) NE 0 THEN maxc = max([maxc, max_palette]) ELSE maxc = max_palette 830 IF finite(minc) NE 0 THEN BEGIN 831 minc = min([minc, min_palette]) 832 ENDIF ELSE BEGIN 833 minc = min_palette 834 ENDELSE 835 IF finite(maxc) NE 0 THEN BEGIN 836 maxc = max([maxc, max_palette]) 837 ENDIF ELSE BEGIN 838 maxc = max_palette 839 ENDELSE 726 840 print, ' '+cmd.var, ' plot attributes ('+plttyp+') modified via color palette: min/max=', $ 727 841 minc, maxc … … 759 873 ; vertical grid type 760 874 ; 761 IF debug_w THEN print, ' splot=', splot 875 IF debug_w THEN BEGIN 876 print, ' splot=', splot 877 ENDIF 762 878 CASE mesh_type OF 763 879 'oce': BEGIN … … 780 896 strcont ='' 781 897 IF mesh_type NE 'oce' THEN BEGIN 782 IF cont_fill EQ 0 THEN strcont = ',/CONT_NOFILL, nite=0' 783 IF cont_real GE 1 THEN strcont = strcont+', REALCONT = '+string(strtrim(cont_real, 2))+', COAST_THICK = 2' 898 IF cont_fill EQ 0 THEN BEGIN 899 strcont = ',/CONT_NOFILL, nite=0' 900 ENDIF 901 IF cont_real GE 1 THEN BEGIN 902 strcont = strcont+', REALCONT = '+string(strtrim(cont_real, 2))+', COAST_THICK = 2' 903 ENDIF 784 904 ENDIF 785 905 … … 787 907 788 908 cal_typ = '' 789 IF calendar_type GT 1 THEN cal_typ = ',ndayspm=calendar_type' 909 IF calendar_type GT 1 THEN BEGIN 910 cal_typ = ',ndayspm=calendar_type' 911 ENDIF 790 912 791 913 ; titles options … … 802 924 803 925 filltxt = '' 804 IF fill_space EQ 1 THEN filltxt = ',/rempli' 926 IF fill_space EQ 1 THEN BEGIN 927 filltxt = ',/rempli' 928 ENDIF 805 929 806 930 ; axis charsize option (x/ychartxt read from plt_def) … … 812 936 ; add contour_options not overlay 813 937 814 IF iover EQ 1 THEN com_strplt = com_strplt+contour_options 815 816 IF debug_w THEN print, ' Cmd before making output in plt_map = ', cmd 817 818 IF debug_w THEN print, ' We are in plt_map: ' 938 IF iover EQ 1 THEN BEGIN 939 com_strplt = com_strplt+contour_options 940 ENDIF 941 942 IF debug_w THEN BEGIN 943 print, ' Cmd before making output in plt_map = ', cmd 944 print, ' We are in plt_map: ' 945 ENDIF 946 819 947 @zoom_indices_debug 820 948 … … 877 1005 mask_z, fld, cmd, boite_plt1d, dimplot 878 1006 fld = checkfield(fld, 'pltt', type = datyp.hotyp, boite = boite_plt1d) 879 IF debug_w THEN print, 'size(fld)', size(fld) 880 IF debug_w THEN print, 'boite_plt1d', boite_plt1d 1007 IF debug_w THEN BEGIN 1008 print, 'size(fld)', size(fld) 1009 print, 'boite_plt1d', boite_plt1d 1010 ENDIF 881 1011 IF cmd.trend GT 0 THEN BEGIN 882 1012 fld = trends(fld, cmd.trend, datyp.hotyp) 883 1013 add_txt = trd_txt 884 ENDIF ELSE print, 'You need to have a trend to make 1D netcdf output' 1014 ENDIF ELSE BEGIN 1015 print, 'You need to have a trend to make 1D netcdf output' 1016 ENDELSE 885 1017 END 886 1018 ELSE: BEGIN ; $$$$$$$$$$$$$$$$$$$$$$$$$$ make plot $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ … … 889 1021 print, ' Plot type (plttyp) = ', plttyp 890 1022 ENDIF 891 C aseplttyp OF1023 CASE plttyp OF 892 1024 'plt': BEGIN 893 1025 ; … … 920 1052 921 1053 922 IF hotyp EQ 'xyt' THEN date_txt = 'monthly' 1054 IF hotyp EQ 'xyt' THEN BEGIN 1055 date_txt = 'monthly' 1056 ENDIF 923 1057 924 1058 pltcmd = 'plt,{a:fld, d:'''+date_txt+''', n:'''+edd_txt+varlegend+' '+legbox+legsurf+''', u:'''+field.units+filleg+''', g:'''+vargrid+'''}'+mincmd+maxcmd+intcmd+com_strplt+strcont+map_cmd … … 946 1080 ENDELSE 947 1081 948 IF debug_w THEN print, strcompress(pltcmd) 1082 IF debug_w THEN BEGIN 1083 print, strcompress(pltcmd) 1084 ENDIF 949 1085 printf, nulhis, strcompress(pltcmd) 950 1086 res = execute(pltcmd[0]) … … 980 1116 sz = size(fld) 981 1117 IF sz[0] EQ 2 THEN BEGIN 982 IF sz[1] EQ 1 OR sz[2] EQ 1 THEN fld = reform(fld, sz[1]*sz[2]) 1118 IF sz[1] EQ 1 OR sz[2] EQ 1 THEN BEGIN 1119 fld = reform(fld, sz[1]*sz[2]) 1120 ENDIF 983 1121 ENDIF 984 1122 IF sz[0] EQ 3 THEN BEGIN 985 IF sz[1] EQ 1 THEN fld = reform(fld, sz[2], sz[3]) 986 IF sz[2] EQ 1 THEN fld = reform(fld, sz[1], sz[3]) 987 IF sz[3] EQ 1 THEN fld = reform(fld, sz[1], sz[2]) 1123 IF sz[1] EQ 1 THEN BEGIN 1124 fld = reform(fld, sz[2], sz[3]) 1125 ENDIF 1126 IF sz[2] EQ 1 THEN BEGIN 1127 fld = reform(fld, sz[1], sz[3]) 1128 ENDIF 1129 IF sz[3] EQ 1 THEN BEGIN 1130 fld = reform(fld, sz[1], sz[2]) 1131 ENDIF 988 1132 ENDIF 989 1133 … … 997 1141 IF vecplot EQ 0 THEN BEGIN 998 1142 999 IF cmd.var EQ 'vozonbsf' THEN xindstr = ', /xindex' ELSE xindstr = '' 1143 IF cmd.var EQ 'vozonbsf' THEN BEGIN 1144 xindstr = ', /xindex' 1145 ENDIF ELSE BEGIN 1146 xindstr = '' 1147 ENDELSE 1000 1148 1001 1149 pltcmd = 'pltz,{a:fld, d:'''+date_txt+''', n:'''+varlegend+' '+legz+''', u:'''+field.units+''', g:'''+vargrid+'''}'+mincmd+maxcmd+intcmd+',/'+pltztyp+', boite=boite_pltz'+zoom_txt+com_strplt+xindstr … … 1013 1161 ENDELSE 1014 1162 1015 IF debug_w THEN print, pltcmd 1163 IF debug_w THEN BEGIN 1164 print, pltcmd 1165 ENDIF 1016 1166 printf, nulhis, strcompress(pltcmd) 1017 1167 res = execute(pltcmd[0]) … … 1019 1169 1020 1170 ; overlay bowl if sig_bowl=1 1021 IF sig_bowl EQ 1 THEN begin1171 IF sig_bowl EQ 1 THEN BEGIN 1022 1172 ; define line color, thickness and type 1023 1173 iover = 2 1024 1174 overc = overlay_type(iover, dimplot) 1025 1175 ; type of latitude axis 1026 IF strmid(cmd.plt, 0, 1) EQ 'y' AND lat_axis EQ 'sin' THEN $ 1027 sin = ',/sin' ELSE sin = '' 1176 IF strmid(cmd.plt, 0, 1) EQ 'y' AND lat_axis EQ 'sin' THEN BEGIN 1177 sin = ',/sin' 1178 ENDIF ELSE BEGIN 1179 sin = '' 1180 ENDELSE 1028 1181 plt1dtyp = strmid(pltztyp, 0, 1) 1029 1182 noerase = 1 1030 1183 com_strplt = ', NOERASE = '+string(noerase) 1031 1184 pltcmd = 'plt1d,field.bowl,/'+plt1dtyp+', boite=boite_pltz'+overc+sin+com_strplt 1032 IF debug_w THEN print, pltcmd 1185 IF debug_w THEN BEGIN 1186 print, pltcmd 1187 ENDIF 1033 1188 1034 1189 res = execute(pltcmd[0]) … … 1049 1204 sz = size(fld) 1050 1205 IF sz[0] EQ 2 THEN BEGIN 1051 IF sz[1] EQ 1 OR sz[2] EQ 1 THEN fld = reform(fld, sz[1]*sz[2]) 1206 IF sz[1] EQ 1 OR sz[2] EQ 1 THEN BEGIN 1207 fld = reform(fld, sz[1]*sz[2]) 1208 ENDIF 1052 1209 ENDIF 1053 1210 IF sz[0] EQ 3 THEN BEGIN 1054 IF sz[1] EQ 1 THEN fld = reform(fld, sz[2], sz[3]) 1055 IF sz[2] EQ 1 THEN fld = reform(fld, sz[1], sz[3]) 1056 IF sz[3] EQ 1 THEN fld = reform(fld, sz[1], sz[2]) 1211 IF sz[1] EQ 1 THEN BEGIN 1212 fld = reform(fld, sz[2], sz[3]) 1213 ENDIF 1214 IF sz[2] EQ 1 THEN BEGIN 1215 fld = reform(fld, sz[1], sz[3]) 1216 ENDIF 1217 IF sz[3] EQ 1 THEN BEGIN 1218 fld = reform(fld, sz[1], sz[2]) 1219 ENDIF 1057 1220 ENDIF 1058 1221 ; mask fld 1059 1222 mask_z, fld, cmd, boite_plt1d, dimplot, legz 1060 1223 1061 IF debug_w THEN print, boite_plt1d 1224 IF debug_w THEN BEGIN 1225 print, boite_plt1d 1226 ENDIF 1062 1227 niveau = 1 1063 1228 ; define line color, thickness and type 1064 1229 overc = overlay_type(iover, dimplot) 1065 1230 ; type of latitude axis 1066 IF strmid(cmd.plt, 0, 1) EQ 'y' AND lat_axis EQ 'sin' THEN $ 1067 sin = ',/sin' ELSE sin = '' 1231 IF strmid(cmd.plt, 0, 1) EQ 'y' AND lat_axis EQ 'sin' THEN BEGIN 1232 sin = ',/sin' 1233 ENDIF ELSE BEGIN 1234 sin = '' 1235 ENDELSE 1068 1236 1069 1237 print, ' '+cmd.var+' data to plot min and max : ', $ … … 1077 1245 printf, nulhis, 'boite_plt1d=',boite_plt1d 1078 1246 printf, nulhis, strcompress(pltcmd) 1079 IF debug_w THEN print, pltcmd 1247 IF debug_w THEN BEGIN 1248 print, pltcmd 1249 ENDIF 1080 1250 res = execute(pltcmd[0]) 1081 1251 … … 1095 1265 1096 1266 ; mask fld 1097 1267 mask_z, fld, cmd, boite_pltt, dimplot, legz 1098 1268 ; define line color, thickness and type 1099 1269 overc = overlay_type(iover, dimplot) 1100 1270 ; define additional text for pltt 1101 1271 @add_txt_pltt 1102 1272 1103 1273 ; compute mean and time rms if hoytp='t' … … 1126 1296 1127 1297 IF common_time EQ 1 THEN BEGIN 1128 IF iover EQ 1 THEN time_prev = time ELSE time = time_prev 1129 ENDIF 1130 1131 IF st_rms EQ 1 THEN BEGIN ; time series of rms deviation on a sigma surface 1298 IF iover EQ 1 THEN BEGIN 1299 time_prev = time 1300 ENDIF ELSE BEGIN 1301 time = time_prev 1302 ENDELSE 1303 ENDIF 1304 1305 IF st_rms EQ 1 THEN BEGIN 1306 ; time series of rms deviation on a sigma surface 1132 1307 @densit_pltmap_plot 1133 1308 ENDIF ELSE BEGIN … … 1137 1312 printf, nulhis, 'boite_pltt=',boite_pltt 1138 1313 printf, nulhis, strcompress(pltcmd) 1139 IF debug_w THEN print, pltcmd 1314 IF debug_w THEN BEGIN 1315 print, pltcmd 1316 ENDIF 1317 1140 1318 res = execute(pltcmd[0]) 1141 IF iover EQ 4 THEN print, 'There might be a pb with the legends !' 1319 IF iover EQ 4 THEN BEGIN 1320 print, 'There might be a pb with the legends !' 1321 ENDIF 1142 1322 ; legend if plot=t 1143 1323 IF hotyp EQ 't' THEN BEGIN 1144 1324 ; positions of the legend depend on nb_cycles 1145 1325 ; it is different from 1 only with 1mm case 1146 IF cmd.timave NE '1mm' THEN nb_cycles = 1 1326 IF cmd.timave NE '1mm' THEN BEGIN 1327 nb_cycles = 1 1328 ENDIF 1147 1329 @legend_overlay 1148 1330 ENDIF … … 1174 1356 fld = checkfield(fld, 'pltt', type = 't', boite = boite_pltspec, _EXTRA=extra) 1175 1357 ; apply trends 1176 IF long(cmd.trend) GT 0 THEN fld = trends(fld, long(cmd.trend), 't') 1358 IF long(cmd.trend) GT 0 THEN BEGIN 1359 fld = trends(fld, long(cmd.trend), 't') 1360 ENDIF 1177 1361 1178 1362 ; make spectrum … … 1243 1427 printf, nulhis, 'boite_pltspec=',boite_pltspec 1244 1428 printf, nulhis, strcompress(pltcmd) 1245 IF debug_w THEN print, pltcmd 1429 IF debug_w THEN BEGIN 1430 print, pltcmd 1431 ENDIF 1246 1432 res = execute(pltcmd[0]) 1247 1433 … … 1264 1450 fld = checkfield(fld, 'pltt', type = 't', boite = boite_pltspec, _EXTRA=extra) 1265 1451 ; apply trends 1266 IF long(cmd.trend) GT 0 THEN fld = trends(fld, long(cmd.trend), 't') 1452 IF long(cmd.trend) GT 0 THEN BEGIN 1453 fld = trends(fld, long(cmd.trend), 't') 1454 ENDIF 1267 1455 1268 1456 ; make spectrum … … 1292 1480 printf, nulhis, 'boite_pltspec=',boite_pltspec 1293 1481 printf, nulhis, strcompress(pltcmd) 1294 IF debug_w THEN print, pltcmd 1482 IF debug_w THEN BEGIN 1483 print, pltcmd 1484 ENDIF 1295 1485 res = execute(pltcmd[0]) 1296 1486 contour,abs(wave)^2/signif,time,period, /overplot,level=1.0,c_annot='95%' -
trunk/procs/saxo_mods/ncdf_meshmicom.pro
r203 r205 52 52 ; set default glamboundary 53 53 ;--------------------------------------------------------- 54 IF n_elements(glamboundary) NE 2 THEN glamboundary = [20, 380] 54 IF n_elements(glamboundary) NE 2 THEN BEGIN 55 glamboundary = [20, 380] 56 ENDIF 55 57 56 58 ;--------------------------------------------------------- … … 76 78 glamu = temporary(glamu) MOD 360 77 79 smaller = where(glamu LT glamboundary[0]) 78 if smaller[0] NE -1 then glamu[smaller] = glamu[smaller]+360 80 if smaller[0] NE -1 THEN BEGIN 81 glamu[smaller] = glamu[smaller]+360 82 ENDIF 79 83 bigger = where(glamu GE glamboundary[1]) 80 if bigger[0] NE -1 then glamu[bigger] = glamu[bigger]-360 84 if bigger[0] NE -1 THEN BEGIN 85 glamu[bigger] = glamu[bigger]-360 86 ENDIF 81 87 glamv = temporary(glamv) MOD 360 82 88 smaller = where(glamv LT glamboundary[0]) 83 if smaller[0] NE -1 then glamv[smaller] = glamv[smaller]+360 89 if smaller[0] NE -1 THEN BEGIN 90 glamv[smaller] = glamv[smaller]+360 91 ENDIF 84 92 bigger = where(glamv GE glamboundary[1]) 85 if bigger[0] NE -1 then glamv[bigger] = glamv[bigger]-360 93 if bigger[0] NE -1 THEN BEGIN 94 glamv[bigger] = glamv[bigger]-360 95 ENDIF 86 96 glamf = temporary(glamf) MOD 360 87 97 smaller = where(glamf LT glamboundary[0]) 88 if smaller[0] NE -1 then glamf[smaller] = glamf[smaller]+360 98 if smaller[0] NE -1 THEN BEGIN 99 glamf[smaller] = glamf[smaller]+360 100 ENDIF 89 101 bigger = where(glamf GE glamboundary[1]) 90 if bigger[0] NE -1 then glamf[bigger] = glamf[bigger]-360 102 if bigger[0] NE -1 THEN BEGIN 103 glamf[bigger] = glamf[bigger]-360 104 ENDIF 91 105 toosmall = where(glamu EQ glamboundary[0]) 92 IF toosmall[0] NE -1 THEN glamu[toosmall] = glamu[toosmall] + 360 106 IF toosmall[0] NE -1 THEN BEGIN 107 glamu[toosmall] = glamu[toosmall] + 360 108 ENDIF 93 109 toosmall = where(glamf EQ glamboundary[0]) 94 IF toosmall[0] NE -1 THEN glamf[toosmall] = glamf[toosmall] + 360 110 IF toosmall[0] NE -1 THEN BEGIN 111 glamf[toosmall] = glamf[toosmall] + 360 112 ENDIF 95 113 96 114 ;--------------------------------------------------------- -
trunk/procs/saxo_mods/pltsc.pro
r203 r205 102 102 103 103 ; Rq: on ne reinitialise pas qd on rapelle pltsc 104 IF NOT keyword_set(ov1d) THEN reinitplt 105 IF NOT keyword_set(thickn) THEN thickn = 2 106 IF NOT keyword_set(fraction) THEN fraction = 1. 104 IF NOT keyword_set(ov1d) THEN BEGIN 105 reinitplt 106 ENDIF 107 IF NOT keyword_set(thickn) THEN BEGIN 108 thickn = 2 109 ENDIF 110 IF NOT keyword_set(fraction) THEN BEGIN 111 fraction = 1. 112 ENDIF 107 113 ;; reduce data xyzt domain 108 114 109 115 oldboite = [lon1, lon2, lat1, lat2, prof1, prof2] 110 116 IF keyword_set(boite) THEN BEGIN 111 IF n_elements(integration3d) EQ 0 THEN integration3d = n_elements(boite) NE 4 117 IF n_elements(integration3d) EQ 0 THEN BEGIN 118 integration3d = n_elements(boite) NE 4 119 ENDIF 112 120 CASE 1 Of 113 121 N_Elements(Boite) Eq 1:bte=[lon1, lon2, lat1, lat2, 0.,boite[0]] … … 134 142 135 143 ; deal with min and max of plot 136 IF finite(min1) EQ 0 THEN min1 = min(tab1) 137 IF finite(max1) EQ 0 THEN max1 = max(tab1) 138 IF finite(min2) EQ 0 THEN min2 = min(tab2) 139 IF finite(max2) EQ 0 THEN max2 = max(tab2) 144 IF finite(min1) EQ 0 THEN BEGIN 145 min1 = min(tab1) 146 ENDIF 147 IF finite(max1) EQ 0 THEN BEGIN 148 max1 = max(tab1) 149 ENDIF 150 IF finite(min2) EQ 0 THEN BEGIN 151 min2 = min(tab2) 152 ENDIF 153 IF finite(max2) EQ 0 THEN BEGIN 154 max2 = max(tab2) 155 ENDIF 140 156 141 157 142 158 ; init plot if not overlay 143 159 144 IF NOT keyword_set(ov1d) THEN placedessin, 'yfx', posfenetre, posbar, $ 160 IF NOT keyword_set(ov1d) THEN BEGIN 161 placedessin, 'yfx', posfenetre, posbar, $ 145 162 contour = contour, _EXTRA=EXTRA 163 ENDIF 146 164 yy = tab1 147 165 xx = tab2 … … 154 172 !y.range = [min1-fraction*abs(max1-min1)/5.,max1+fraction*abs(max1-min1)/5.] 155 173 156 IF (NOT keyword_set(sty1d)) THEN sty1d = 0 157 IF (NOT keyword_set(col1d)) THEN col1d = 0 158 IF NOT keyword_set(ov1d) THEN BEGIN 174 IF (NOT keyword_set(sty1d)) THEN BEGIN 175 sty1d = 0 176 ENDIF 177 IF (NOT keyword_set(col1d)) THEN BEGIN 178 col1d = 0 179 ENDIF 180 IF NOT keyword_set(ov1d) THEN BEGIN 159 181 legende, min1, max1, 'yfx', VARNAME2 = varname2, NPTS = npts, _EXTRA=extra 160 182 ; … … 164 186 IF n_elements(ex) NE 0 THEN BEGIN 165 187 ; pour avoir un cadre de la couleur c_cote et trace une ligne a y=0 166 IF (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 THEN ex.COLOR = c_cote 167 IF (where(tag_names(ex) EQ 'LINESTYLE'))[0] NE -1 THEN ex.LINESTYLE= 0 188 IF (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 THEN BEGIN 189 ex.COLOR = c_cote 190 ENDIF 191 IF (where(tag_names(ex) EQ 'LINESTYLE'))[0] NE -1 THEN BEGIN 192 ex.LINESTYLE= 0 193 ENDIF 168 194 ENDIF 169 195 plot, !x.range, [0, 0],/noerase,color=c_cote, xstyle = 1, ystyle = 1, _EXTRA=extra … … 180 206 terminedessin, _EXTRA=extra 181 207 ;------------------------------------------------------------ 182 IF n_elements(key_performance) NE 0 THEN $ 183 IF key_performance EQ 1 THEN print, 'temps plt1d', systime(1)-tempsun 208 IF n_elements(key_performance) NE 0 THEN BEGIN 209 IF key_performance EQ 1 THEN BEGIN 210 print, 'temps plt1d', systime(1)-tempsun 211 ENDIF 212 ENDIF 184 213 END -
trunk/procs/saxo_mods/plttg.pro
r203 r205 333 333 ;-------------------------------------------------------------- 334 334 if n_elements(contour) ne 4 AND NOT keyword_set(overplot) $ 335 AND NOT keyword_set(ov1d) then reinitplt 335 AND NOT keyword_set(ov1d) THEN BEGIN 336 reinitplt 337 ENDIF 336 338 ;-------------------------------------------------------------- 337 339 ; I1) lecture du champ 338 340 ;-------------------------------------------------------------- 339 if keyword_set(boite) then oldboite = [lon1, lon2, lat1, lat2, prof1, prof2] 340 if n_elements(giventype) NE 0 then type = giventype 341 if n_elements(givenmin) NE 0 then min = givenmin 342 if n_elements(givenmax) NE 0 then max = givenmax 343 if n_elements(minin) NE 0 then min = minin 344 if n_elements(maxin) NE 0 then max = maxin 345 if keyword_set(typein) then BEGIN 346 if size(type, /type) NE 7 AND size(type, /type) NE 0 then begin 347 if n_elements(min) NE 0 then max = min 341 if keyword_set(boite) THEN BEGIN 342 oldboite = [lon1, lon2, lat1, lat2, prof1, prof2] 343 ENDIF 344 if n_elements(giventype) NE 0 THEN BEGIN 345 type = giventype 346 ENDIF 347 if n_elements(givenmin) NE 0 THEN BEGIN 348 min = givenmin 349 ENDIF 350 if n_elements(givenmax) NE 0 THEN BEGIN 351 max = givenmax 352 ENDIF 353 if n_elements(minin) NE 0 THEN BEGIN 354 min = minin 355 ENDIF 356 if n_elements(maxin) NE 0 THEN BEGIN 357 max = maxin 358 ENDIF 359 if keyword_set(typein) THEN BEGIN 360 if size(type, /type) NE 7 AND size(type, /type) NE 0 THEN BEGIN 361 if n_elements(min) NE 0 THEN BEGIN 362 max = min 363 ENDIF 348 364 min = type 349 endif365 ENDIF 350 366 type = typein 351 367 ENDIF … … 361 377 ;--------------------------------------------------------------- 362 378 363 IF NOT keyword_set(repeat_c) THEN repeat_c = 1 379 IF NOT keyword_set(repeat_c) THEN BEGIN 380 repeat_c = 1 381 ENDIF 364 382 365 383 temps = time[0:jpt-1] … … 384 402 autoscale = testvar(var = min) EQ testvar(var = max) AND NOT keyword_set(intervalle) 385 403 determineminmax, z2d, mask, mi, ma, MININ = min, MAXIN = max, nan = nan, INTERVALLE = intervalle 386 if z2d[0] EQ -1 THEN return 404 if z2d[0] EQ -1 THEN BEGIN 405 return 406 ENDIF 387 407 ; on fait un autoscale si besoin 388 if autoscale then autoscale, min, max, intervalle 389 ;----------------------------------------------------------------------------- 390 ;----------------------------------------------------------------------------- 391 if n_elements(contour) ne 4 AND NOT keyword_set(overplot) THEN $ 408 if autoscale THEN BEGIN 409 autoscale, min, max, intervalle 410 ENDIF 411 ;----------------------------------------------------------------------------- 412 ;----------------------------------------------------------------------------- 413 if n_elements(contour) ne 4 AND NOT keyword_set(overplot) THEN BEGIN 392 414 placedessin, 'pltt',posfenetre, posbar, contour = contour, direc = direc, type = type, endpoints = endpoints, _EXTRA=extra 415 ENDIF 393 416 ;-------------------------------------------------------------- 394 417 ;-------------------------------------------------------------- … … 427 450 xx = temps-tempsmin 428 451 ;-------------------------------------------------------------- 429 if NOT keyword_set(overplot) THEN axe, type, tempsmin, tempsmax, plttg = 1, _EXTRA=extra ELSE BEGIN 452 if NOT keyword_set(overplot) THEN BEGIN 453 axe, type, tempsmin, tempsmax, plttg = 1, _EXTRA=extra 454 ENDIF ELSE BEGIN 430 455 !x.range=!x.range-tempsmin 431 456 !x.tickv=!x.tickv-tempsmin … … 440 465 ; choix des labels 441 466 ;----------------------------------------------------------- 442 if keyword_set(intervalle) AND NOT keyword_set(label) then label=1 443 if keyword_set(label) eq 0 then cas=0 else cas=label 467 if keyword_set(intervalle) AND NOT keyword_set(label) THEN BEGIN 468 label=1 469 ENDIF 470 if keyword_set(label) eq 0 THEN BEGIN 471 cas=0 472 ENDIF ELSE BEGIN 473 cas=label 474 ENDELSE 444 475 label,cas,min,max,ncontour,level_z2d,NLEVEL=nlevel,INTERVALLE=intervalle, strictfill = strictfill 445 476 ;-------------------------------------------------------------- 446 477 ; choix de style 447 478 ;----------------------------------------------------------- 448 if not keyword_set(style) then style=0 479 if not keyword_set(style) THEN BEGIN 480 style=0 481 ENDIF 449 482 style,style,level_z2d,linestyle,thick 450 if keyword_set(inv) then couleur=reverse(couleur) 483 if keyword_set(inv) THEN BEGIN 484 couleur=reverse(couleur) 485 ENDIF 451 486 ;---------------------------------------------------------------------- 452 487 nby = n_elements(yy) … … 463 498 , coinmontemask=coinmontemask, coindescendmask=coindescendmask, _EXTRA=extra 464 499 ;------------------------------------------------------------ 465 if n_elements(contour) eq 4 thenBEGIN ; c''est la 2eme fois que je passe ds pltt500 if n_elements(contour) eq 4 THEN BEGIN ; c''est la 2eme fois que je passe ds pltt 466 501 contour = {mietma:[mi, ma], unit:varunit, inter:intervalle} ; je renvoie le min, le max et l''unite 467 502 return 468 503 endif 469 504 ;------------------------------------------------------------ 470 if keyword_set(contour) thenBEGIN505 if keyword_set(contour) THEN BEGIN 471 506 pourlegende = [1, 1, 1, 1] 472 507 oldattributs = saveatt() … … 480 515 ;---------------------------------------------------------------------- 481 516 ;---------------------------------------------------------------------- 482 if keyword_set(overplot) then GOTO, fini 517 if keyword_set(overplot) THEN BEGIN 518 GOTO, fini 519 ENDIF 483 520 ;------------------------------------------------------------ 484 521 ; legendes + affichage de celles-ci … … 508 545 ;------------------------------------------------------------ 509 546 terminedessin, _EXTRA=extra 510 if keyword_set(oldboite) then domdef, oldboite,GRILLE=[vargrid, 'T'] 511 ;------------------------------------------------------------ 512 if n_elements(key_performance) NE 0 then $ 513 IF key_performance EQ 1 THEN print, 'temps pltt', systime(1)-tempsun 547 if keyword_set(oldboite) THEN BEGIN 548 domdef, oldboite,GRILLE=[vargrid, 'T'] 549 ENDIF 550 ;------------------------------------------------------------ 551 if n_elements(key_performance) NE 0 THEN BEGIN 552 IF key_performance EQ 1 THEN BEGIN 553 print, 'temps pltt', systime(1)-tempsun 554 ENDIF 555 ENDIF 514 556 end -
trunk/procs/saxo_mods/skewness_4d.pro
r203 r205 89 89 ntreal = ( (WHERE(FINITE(x) EQ 0 ))[0] NE -1 ) ? TOTAL(FINITE(x), xndim) : nt 90 90 91 IF ARG_PRESENT(NVAL) THEN nval = ntreal 91 IF ARG_PRESENT(NVAL) THEN BEGIN 92 nval = ntreal 93 ENDIF 92 94 93 95 ; Check length. 94 IF (WHERE(ntreal LE 1))[0] NE -1 THEN $96 IF (WHERE(ntreal LE 1))[0] NE -1 THEN BEGIN 95 97 MESSAGE, "Matrix of length of time-series must contain 2 or more elements" 98 ENDIF 96 99 97 100 ; If the DOUBLE keyword is not set then the internal precision and … … 114 117 zero = where(std EQ 0) 115 118 116 if zero[0] NE -1 then STOP, $ 119 if zero[0] NE -1 THEN BEGIN 120 STOP, $ 117 121 'Cannot compute skewness since there are zeros in the matrix of standard deviations !' 122 ENDIF 118 123 119 124 ; Problem with high masked values (x^3 makes NAN when x is high) … … 125 130 ; Compute skewness 126 131 Skew = Skewness_Num(x, nt, Double = useDouble, NAN = nan) / (ntreal*std^3) 127 IF idx_std[0] NE -1 THEN Skew[idx_std] = valmask 132 IF idx_std[0] NE -1 THEN BEGIN 133 Skew[idx_std] = valmask 134 ENDIF 128 135 129 136 return, useDouble ? Skew : FLOAT(Skew) -
trunk/procs/search_time_file.pro
r203 r205 183 183 suff_var = '' 184 184 185 IF strpos(cmd.timave, 'mm') NE -1 THEN meanm = 'yes' ELSE meanm = 'no' 185 IF strpos(cmd.timave, 'mm') NE -1 THEN BEGIN 186 meanm = 'yes' 187 ENDIF ELSE BEGIN 188 meanm = 'no' 189 ENDELSE 186 190 187 191 CASE meanm OF … … 231 235 WHILE il LE nfiles-1 AND found EQ 0 DO BEGIN 232 236 file = line[il] 233 IF debug_w THEN print, ' line = ', line 237 IF debug_w THEN BEGIN 238 print, ' line = ', line 239 ENDIF 234 240 ; remove root directory if exists 235 241 IF strpos(file, '/') NE -1 THEN BEGIN … … 246 252 dat2 = argvar[3] 247 253 248 IF debug_w THEN print, ' dat1, date1, dat2, date2 ', dat1,' ', date1,' ', dat2,' ', date2 254 IF debug_w THEN BEGIN 255 print, ' dat1, date1, dat2, date2 ', dat1,' ', date1,' ', dat2,' ', date2 256 ENDIF 249 257 250 258 IF strpos(dat1, '_') EQ -1 AND strpos(dat2, '_') EQ -1 AND $ 251 259 strpos(dat1, '-') EQ -1 AND strpos(dat2, '-') EQ -1 THEN BEGIN 252 IF (long(dat1) LE long(date1) AND long(dat2) GE long(date2)) 260 IF (long(dat1) LE long(date1) AND long(dat2) GE long(date2)) THEN BEGIN 253 261 found = 1 254 262 delta_t2 = compute_time(cmd.timave, dat1, date1) … … 290 298 ; print, date1, date2, delta_t1 291 299 292 IF nfiles EQ 0 OR found EQ 0 THEN BEGIN & date1 = '???' & date2 = '???' & END 300 IF nfiles EQ 0 OR found EQ 0 THEN BEGIN 301 date1 = '???' 302 date2 = '???' 303 ENDIF 293 304 294 305 END -
trunk/procs/stat_error.pro
r203 r205 91 91 92 92 niter1 = 999 93 IF keyword_set(niter) THEN niter1 = niter 93 IF keyword_set(niter) THEN BEGIN 94 niter1 = niter 95 ENDIF 94 96 95 97 errstats = fltarr(niter1) -
trunk/procs/tools_wavelets/wavetest.pro
r203 r205 114 114 TITLE='a) NINO3 Sea Surface Temperature (seasonal)', $ 115 115 POSITION=pos1 116 IF (N_ELEMENTS(recon_sst) GT 1) THEN OPLOT,time,recon_sst,COLOR=144 116 IF (N_ELEMENTS(recon_sst) GT 1) THEN BEGIN 117 OPLOT,time,recon_sst,COLOR=144 118 ENDIF 117 119 XYOUTS,0.85,0.9,/NORMAL,ALIGN=0.5, $ 118 120 '!5WAVELET ANALYSIS!X'+$ … … 165 167 OPLOT,xrange,scaleavg_signif+[0,0],LINES=1 166 168 167 IF (printfile) THEN DEVICE,/CLOSE 169 IF (printfile) THEN BEGIN 170 DEVICE,/CLOSE 171 ENDIF 168 172 END -
trunk/procs/trends.pro
r203 r205 162 162 ; build indexes to keep in [0,N-1] = serie of [sel1,sel2] mod(freq) 163 163 164 IF (size(fld))[0] EQ 1 AND sample EQ 1 THEN BEGIN ; 1D time serie 165 IF NOT keyword_set(silent) THEN print, ' Extract months : ', month1, month2 164 IF (size(fld))[0] EQ 1 AND sample EQ 1 THEN BEGIN 165 ; 1D time serie 166 IF NOT keyword_set(silent) THEN BEGIN 167 print, ' Extract months : ', month1, month2 168 ENDIF 166 169 Ndim = (size(fld))[1] 167 170 idx0 = floor(findgen(sel2-sel1+1)+sel1) … … 188 191 189 192 IF c_normal EQ 1 AND (size(fld))[0] EQ 1 THEN BEGIN 190 IF NOT keyword_set(silent) THEN print, ' Normalizing 1D time series with stddev = ',sqrt((moment(fld))[1]) 193 IF NOT keyword_set(silent) THEN BEGIN 194 print, ' Normalizing 1D time series with stddev = ',sqrt((moment(fld))[1]) 195 ENDIF 191 196 fld = fld/sqrt((moment(fld))[1]) 192 197 ENDIF … … 198 203 '1': BEGIN ; trend = remove first value 199 204 ; --------------------------- 200 IF (size(fld))[0] EQ 1 THEN BEGIN ; 1D time serie 205 IF (size(fld))[0] EQ 1 THEN BEGIN 206 ; 1D time serie 201 207 fld = fld-fld[0] 202 ENDIF ELSE BEGIN ; hovmoeller 208 ENDIF ELSE BEGIN 209 ; hovmoeller 203 210 fldrem = fld[*, 0]#replicate(1, (size(fld))[2]) 204 211 fld = fld-fldrem … … 207 214 '2': BEGIN ; drift = remove previous value 208 215 ; ------------------------------ 209 IF (size(fld))[0] EQ 1 THEN BEGIN ; 1D time serie 216 IF (size(fld))[0] EQ 1 THEN BEGIN 217 ; 1D time serie 210 218 fldrem = shift(fld, 1) 211 219 fldrem[0]= fld[0] … … 219 227 '3': BEGIN ; inverse trend = remove mean of <n> last values 220 228 ; ---------------------------------------------- 221 IF strlen(trend_type) GT 1 THEN $ 222 mean_n = long(strmid(trend_type, 1, strlen(trend_type)-1)) ELSE mean_n = 1 223 IF (size(fld))[0] EQ 1 THEN BEGIN ; 1D time serie 229 IF strlen(trend_type) GT 1 THEN BEGIN 230 mean_n = long(strmid(trend_type, 1, strlen(trend_type)-1)) 231 ENDIF ELSE BEGIN 232 mean_n = 1 233 ENDELSE 234 IF (size(fld))[0] EQ 1 THEN BEGIN 235 ; 1D time serie 224 236 fld = mean(fld[(size(fld))[1]-mean_n:(size(fld))[1]-1])-fld 225 237 ENDIF ELSE BEGIN ; hovmoeller … … 228 240 idx = where(fld EQ valmask) 229 241 fld = fldrem-fld 230 IF idx[0] NE -1 THEN fld[idx] = valmask 242 IF idx[0] NE -1 THEN BEGIN 243 fld[idx] = valmask 244 ENDIF 231 245 ENDELSE 232 246 END 233 247 '4': BEGIN ; anomaly = remove average running mean 234 248 ; ------------------------------------- 235 IF strlen(trend_type) GT 1 THEN $ 236 running = long(strmid(trend_type, 1, strlen(trend_type)-1)) ELSE running = 1 249 IF strlen(trend_type) GT 1 THEN BEGIN 250 running = long(strmid(trend_type, 1, strlen(trend_type)-1)) 251 ENDIF ELSE BEGIN 252 running = 1 253 ENDELSE 237 254 238 255 ; check that jpt is a multiple of running 239 IF NOT keyword_set(silent) THEN print, ' jpt MOD running = ', jpt, running, jpt MOD running 256 IF NOT keyword_set(silent) THEN BEGIN 257 print, ' jpt MOD running = ', jpt, running, jpt MOD running 258 ENDIF 240 259 241 260 IF (jpt MOD running) NE 0 THEN BEGIN … … 244 263 ENDIF 245 264 246 IF (size(fld))[0] EQ 1 THEN BEGIN ; 1D time serie 265 IF (size(fld))[0] EQ 1 THEN BEGIN 266 ; 1D time serie 247 267 ; build array to remove from time serie 248 268 IF running GE 2 THEN BEGIN … … 255 275 fldrem_t1 = fldrem 256 276 ENDIF 257 IF fld_flag EQ 2 THEN fldrem_t2 = fldrem 277 IF fld_flag EQ 2 THEN BEGIN 278 fldrem_t2 = fldrem 279 ENDIF 258 280 sc_ampl = sqrt((moment(fldrem))[1]) 259 281 sc_ampl2 = max(fldrem)-min(fldrem) … … 283 305 ENDIF ELSE err_std_3 = 0 284 306 285 IF NOT keyword_set(silent) THEN print, ' 1D times-serie anomaly info : var/stddev +- error (24,36,48)', (moment(fld - fldrem))[1], sqrt((moment(fld - fldrem))[1]), err_std_1, err_std_2, err_std_3 307 IF NOT keyword_set(silent) THEN BEGIN 308 print, ' 1D times-serie anomaly info : var/stddev +- error (24,36,48)', (moment(fld - fldrem))[1], sqrt((moment(fld - fldrem))[1]), err_std_1, err_std_2, err_std_3 309 ENDIF 286 310 stddev_txt = strtrim(string(sqrt((moment(fld - fldrem))[1])), 2) 287 IF NOT keyword_set(silent) THEN print, ' ' 311 IF NOT keyword_set(silent) THEN BEGIN 312 print, ' ' 313 ENDIF 288 314 ENDIF ELSE fldrem = mean(fld) 289 315 … … 332 358 ENDIF ELSE BEGIN ; hovmoeller 333 359 ; build array to remove from time serie 334 IF NOT keyword_set(silent) THEN print, ' anomaly = remove average running mean (hovmoeller)' 360 IF NOT keyword_set(silent) THEN BEGIN 361 print, ' anomaly = remove average running mean (hovmoeller)' 362 ENDIF 335 363 CASE type OF 336 364 'xt': BEGIN … … 378 406 ; keep mean seasonal cycle in common 379 407 mean_sc = fldrem 380 IF idx[0] NE -1 THEN fld[idx] = valmask 408 IF idx[0] NE -1 THEN BEGIN 409 fld[idx] = valmask 410 ENDIF 381 411 ENDELSE 382 412 … … 409 439 410 440 ; compute field time integral if required 411 IF n_elements(field_int) EQ 0 THEN field_int = 0 441 IF n_elements(field_int) EQ 0 THEN BEGIN 442 field_int = 0 443 ENDIF 412 444 IF field_intl EQ 1 THEN BEGIN 413 445 ; running integral ? 414 IF strlen(trend_type) GT 1 THEN $ 415 int_win = long(strmid(trend_type, 1, strlen(trend_type)-1)) ELSE int_win = 0 446 IF strlen(trend_type) GT 1 THEN BEGIN 447 int_win = long(strmid(trend_type, 1, strlen(trend_type)-1)) 448 ENDIF ELSE BEGIN 449 int_win = 0 450 ENDELSE 416 451 CASE (size(fld))[0] OF 417 452 1: BEGIN … … 419 454 fldint = fld 420 455 lenght = (size(fld))[1] 421 IF int_win EQ 0 THEN BEGIN ; integral from start 456 IF int_win EQ 0 THEN BEGIN 457 ; integral from start 422 458 FOR t = 0, lenght-1 DO BEGIN 423 459 fldint[t] = total(fld[0:t]) … … 463 499 zwrk = fld[i, *] 464 500 zint = zwrk 465 IF int_win EQ 0 THEN BEGIN ; integral from start 501 IF int_win EQ 0 THEN BEGIN 502 ; integral from start 466 503 FOR t = 0, lenght-1 DO BEGIN 467 504 zint[t] = total(zwrk[0:t]) … … 488 525 ; if write_data then write to ascii/cdf file 489 526 490 IF n_elements(write_data) EQ 0 THEN write_data = 0 527 IF n_elements(write_data) EQ 0 THEN BEGIN 528 write_data = 0 529 ENDIF 491 530 IF write_data NE 0 THEN BEGIN 492 IF write_data GE 1 THEN BEGIN ; ascii 531 IF write_data GE 1 THEN BEGIN 532 ; ascii 493 533 scale = 1. 494 534 get_lun, nuldat 495 IF field.origin EQ 'div' THEN $ 496 name_exp = strjoin(strsplit(cmd_wrk.exp, '/', /EXTRACT), '-', /SINGLE) ELSE name_exp = cmd_wrk.exp 535 IF field.origin EQ 'div' THEN BEGIN 536 name_exp = strjoin(strsplit(cmd_wrk.exp, '/', /EXTRACT), '-', /SINGLE) 537 ENDIF ELSE BEGIN 538 name_exp = cmd_wrk.exp 539 ENDELSE 497 540 filename = name_exp+'_'+ cmd_wrk.var+'_'+cmd_wrk.date1+'_'+cmd_wrk.spec+'_'+cmd_wrk.plt+'.asc' 498 541 openw, nuldat, asciidir+filename … … 522 565 523 566 END 524 -
trunk/procs/tvnplot.pro
r203 r205 72 72 ENDIF 73 73 ; 74 IF keyword_set(min) EQ 0 THEN min = min(image) 75 IF keyword_set(max) EQ 0 THEN max = max(image) 76 IF keyword_set(scale_x) EQ 0 THEN scale_x = 1. 77 IF keyword_set(scale_y) EQ 0 THEN scale_y = 1. 78 IF keyword_set(ibase) EQ 0 THEN ibase = 0. 79 IF keyword_set(jbase) EQ 0 THEN jbase = 0. 74 IF keyword_set(min) EQ 0 THEN BEGIN 75 min = min(image) 76 ENDIF 77 IF keyword_set(max) EQ 0 THEN BEGIN 78 max = max(image) 79 ENDIF 80 IF keyword_set(scale_x) EQ 0 THEN BEGIN 81 scale_x = 1. 82 ENDIF 83 IF keyword_set(scale_y) EQ 0 THEN BEGIN 84 scale_y = 1. 85 ENDIF 86 IF keyword_set(ibase) EQ 0 THEN BEGIN 87 ibase = 0. 88 ENDIF 89 IF keyword_set(jbase) EQ 0 THEN BEGIN 90 jbase = 0. 91 ENDIF 80 92 sample = 0 81 IF keyword_set(interp) EQ 0 THEN sample = 1 82 93 IF keyword_set(interp) EQ 0 THEN BEGIN 94 sample = 1 95 ENDIF 83 96 84 97 x_env_save = !x … … 99 112 nj = (size(image))[2] 100 113 101 IF keyword_set(gamma) 114 IF keyword_set(gamma) EQ 0 THEN BEGIN 102 115 gamma = 600/max([ni, nj]) 103 116 ENDIF … … 115 128 xsize = ni*gamma+200 116 129 ysize = nj*gamma+200 117 IF (!d.x_size LT xsize) OR (!d.y_size LT ysize) THEN $130 IF (!d.x_size LT xsize) OR (!d.y_size LT ysize) THEN BEGIN 118 131 window, xsize = ni*gamma+200, ysize = nj*gamma+200 132 ENDIF 119 133 120 134 xcmperpix = 1. … … 145 159 subtitle = 'MIN='+string(min)+' / MAX='+string(max) 146 160 147 IF keyword_set(erase) NE 0 THEN erase, 255 161 IF keyword_set(erase) NE 0 THEN BEGIN 162 erase, 255 163 ENDIF 148 164 149 165 tv, image2, x0, y0, xsize = xsize, ysize = ysize, _EXTRA=extra … … 184 200 i1=0 > floor(ni*(x-x0)/dx) < (ni-1) 185 201 j1=0 > floor(nj*(y-y0)/dy) < (nj-1) 186 IF i1 LE i0 THEN i1 = (i0+10) < (ni-1) 187 IF j1 LE j0 THEN j1 = (j0+10) < (nj-1) 202 IF i1 LE i0 THEN BEGIN 203 i1 = (i0+10) < (ni-1) 204 ENDIF 205 IF j1 LE j0 THEN BEGIN 206 j1 = (j0+10) < (nj-1) 207 ENDIF 188 208 tvnplot, image[i0:i1, j0:j1], _EXTRA=extra, /erase, $ 189 209 ibase = i0+ibase, jbase = j0+jbase, MIN = min, Max = max -
trunk/procs/two_var_read.pro
r203 r205 19 19 ; read second variable 20 20 21 IF debug_w THEN print, 'Reading second variable in data_read/two_var_read' 21 IF debug_w THEN BEGIN 22 print, 'Reading second variable in data_read/two_var_read' 23 ENDIF 22 24 23 25 IF strpos(cmd.var, '(next)') EQ -1 THEN BEGIN ; type 1 y=f(x) on 1 line … … 39 41 40 42 ;Exception if large_domain = 1 41 IF debug_w THEN print, 'type 2 y=f(next) or y=bin(x) on 2 lines' 43 IF debug_w THEN BEGIN 44 print, 'type 2 y=f(next) or y=bin(x) on 2 lines' 45 ENDIF 42 46 IF large_domain EQ 1 AND plttyp EQ 'ybinx' THEN BEGIN 43 47 use_large_domain = 1 … … 63 67 sw_diffg = 1 64 68 jptb = jpt 65 IF debug_w THEN print, ' (in data_read) cmd2.grid <> cmd.grid ', cmd2.grid, cmd.grid 66 IF debug_w THEN print, ' exec def_grid, cmd2_back in data_read : ' 69 IF debug_w THEN BEGIN 70 print, ' (in data_read) cmd2.grid <> cmd.grid ', cmd2.grid, cmd.grid 71 print, ' exec def_grid, cmd2_back in data_read : ' 72 ENDIF 67 73 grid2_full = cmd2_back.grid 68 74 def_grid, cmd2_back … … 74 80 print, ' Variable 2 ', var2, ' read on vargrid ', vargrid 75 81 jptb = jpt 76 if debug_w THEN print, ' yfx grids different ? / sw_diffg = ', sw_diffg 82 if debug_w THEN BEGIN 83 print, ' yfx grids different ? / sw_diffg = ', sw_diffg 84 ENDIF 85 77 86 IF sw_diffg EQ 1 THEN BEGIN 78 IF debug_w THEN print, ' exec def_grid, cmd1_back in data_read : ' 87 IF debug_w THEN BEGIN 88 print, ' exec def_grid, cmd1_back in data_read : ' 89 ENDIF 79 90 grid1_full = cmd1_back.grid 80 91 def_grid, cmd1_back -
trunk/procs/update_data.pro
r203 r205 117 117 ;old_boite = [lon1, lon2, lat1, lat2, prof1, prof2] 118 118 print, ' Average in vertical domain ', vert_type, vert_mean 119 ;IF vert_mean[0] EQ vert_mean[1] THEN stop, report('vert_mean[0] cannot be equal to vert_mean[1]') 119 ;IF vert_mean[0] EQ vert_mean[1] THEN BEGIN 120 ; stop, report('vert_mean[0] cannot be equal to vert_mean[1]') 121 ; ENDIF 120 122 CASE vert_type OF 121 123 'z': BEGIN … … 139 141 ;; fichier 4d : volume + temps 140 142 4: BEGIN 141 IF debug_w THEN print, ' jpt = ', jpt 143 IF debug_w THEN BEGIN 144 print, ' jpt = ', jpt 145 ENDIF 142 146 IF jpt GT 1 THEN BEGIN 143 147 print, ' Found ', vname, ' (3D data time serie)', strcompress(string(time_1)),'-', strtrim(string(time_2), 2), ' from file' -
trunk/procs/ybinx.pro
r203 r205 28 28 bin_plt = [2*bin_plt[0]-bin_plt[1], bin_plt[0:nbins-2], 2*bin_plt[nbins-2]-bin_plt[nbins-3]] 29 29 30 IF debug_w THEN print, ' bin_plt= ', bin_plt 31 IF debug_w THEN print, ' nbins= ', nbins 30 IF debug_w THEN BEGIN 31 print, ' bin_plt= ', bin_plt 32 print, ' nbins= ', nbins 33 ENDIF 32 34 33 35 ; 3rd field to bin regression ? 34 36 35 IF var3_ybinx NE "" THEN sw3 = 1 ELSE sw3 = 0 37 IF var3_ybinx NE "" THEN BEGIN 38 sw3 = 1 39 ENDIF ELSE BEGIN 40 sw3 = 0 41 ENDELSE 36 42 37 43 ; mask fields with valmask for regression computation … … 39 45 IF sw3 THEN BEGIN 40 46 idxmsk = where(fld GT valmask/10.) 41 IF idxmsk[0] NE -1 THEN fld[idxmsk] = valmask 42 IF idxmsk[0] NE -1 THEN fld3[idxmsk] = valmask 47 IF idxmsk[0] NE -1 THEN BEGIN 48 fld[idxmsk] = valmask 49 ENDIF 50 IF idxmsk[0] NE -1 THEN BEGIN 51 fld3[idxmsk] = valmask 52 ENDIF 43 53 ENDIF 44 54 … … 47 57 idxmskpn = where(finite(fld, /nan)) 48 58 idxmskpn2 = where(finite(fld2, /nan)) 49 IF idxmskpn[0] NE -1 THEN fld[idxmskpn] = valmask 50 IF idxmskpn2[0] NE -1 THEN fld2[idxmskpn2] = valmask 59 IF idxmskpn[0] NE -1 THEN BEGIN 60 fld[idxmskpn] = valmask 61 ENDIF 62 IF idxmskpn2[0] NE -1 THEN BEGIN 63 fld2[idxmskpn2] = valmask 64 ENDIF 51 65 52 66 idxmskpn = where(fld GT valmask/10.) 53 67 idxmskpn2 = where(fld2 GT valmask/10.) 54 IF idxmskpn[0] NE -1 THEN fld2[idxmskpn] = valmask 55 IF idxmskpn2[0] NE -1 THEN fld[idxmskpn2] = valmask 68 IF idxmskpn[0] NE -1 THEN BEGIN 69 fld2[idxmskpn] = valmask 70 ENDIF 71 IF idxmskpn2[0] NE -1 THEN BEGIN 72 fld[idxmskpn2] = valmask 73 ENDIF 56 74 57 75 ; print min/max of field for debug 58 76 idxmskp = where(fld LE valmask/10.) 59 IF debug_w THEN print, ' Min/max fld= ', min(fld[idxmskp]), max(fld[idxmskp]) 60 IF debug_w THEN print, ' Min/max fld2= ', min(fld2[idxmskp]), max(fld2[idxmskp]) 77 IF debug_w THEN BEGIN 78 print, ' Min/max fld= ', min(fld[idxmskp]), max(fld[idxmskp]) 79 print, ' Min/max fld2= ', min(fld2[idxmskp]), max(fld2[idxmskp]) 80 ENDIF 61 81 62 82 ; remove mean seasonal cycle if required … … 64 84 IF cmd.trend GT 0 THEN BEGIN 65 85 fld = trends(fld, cmd.trend, 'xyt') 66 IF sw3 THEN fld3 = trends(fld3, cmd.trend, 'xyt') 86 IF sw3 THEN BEGIN 87 fld3 = trends(fld3, cmd.trend, 'xyt') 88 ENDIF 67 89 ENDIF 68 90 IF cmd2.trend GT 0 THEN BEGIN … … 82 104 fldn = (fld)[*, *, reform(idxm[0,*], njpt)] 83 105 fld2n = (fld2)[*, *, reform(idxm[0,*], njpt)] 84 IF sw3 THEN fld3n = (fld3)[*, *, reform(idxm[0,*], njpt)] 106 IF sw3 THEN BEGIN 107 fld3n = (fld3)[*, *, reform(idxm[0,*], njpt)] 108 ENDIF 85 109 86 110 FOR imth = 1, nmth-1 DO BEGIN … … 88 112 fldn = [fldn, (fld)[*, *, reform(idxm[imth,*], njpt)]] 89 113 fld2n = [fld2n, (fld2)[*, *, reform(idxm[imth,*], njpt)]] 90 IF sw3 THEN fld3n = [fld3n, (fld3)[*, *, reform(idxm[imth,*], njpt)]] 114 IF sw3 THEN BEGIN 115 fld3n = [fld3n, (fld3)[*, *, reform(idxm[imth,*], njpt)]] 116 ENDIF 91 117 92 118 ENDFOR … … 95 121 fld = fldn 96 122 fld2 = fld2n 97 IF sw3 THEN fld3 = fld3n 123 IF sw3 THEN BEGIN 124 fld3 = fld3n 125 ENDIF 98 126 ENDIF 99 127 … … 116 144 binpop[ib] = n_elements(indices) 117 145 idxb[ib, 0:binpop[ib]-1] = where(fld2 GT bin_interval[ib-1] AND fld2 LE bin_interval[ib]) 118 IF debug_w THEN print, ' Size of bin[i] ', ib, binpop[ib] 146 IF debug_w THEN BEGIN 147 print, ' Size of bin[i] ', ib, binpop[ib] 148 ENDIF 119 149 120 150 ib = ib + 1 … … 133 163 max_idx = max(binpop) 134 164 135 IF debug_w THEN print, ' Max bin size ', max_idx 136 IF debug_w THEN print, ' Number of bins ', nbins 165 IF debug_w THEN BEGIN 166 print, ' Max bin size ', max_idx 167 print, ' Number of bins ', nbins 168 ENDIF 137 169 fldy = fltarr(nbins+1, max_idx) 138 170 fldy[*, *] = !values.f_nan … … 159 191 WHILE ib LE nbins DO BEGIN 160 192 161 IF debug_w THEN print, 'bin = ', ib 193 IF debug_w THEN BEGIN 194 print, 'bin = ', ib 195 ENDIF 162 196 binsz = binpop[ib] 163 197 IF binsz GT 1 THEN BEGIN 164 198 fldy[ib, 0:binsz-1] = fld[idxb[ib, 0:binsz-1]] 165 IF debug_w THEN print, 'fld[idxb[ib, 0:binsz-1]] =',fld[idxb[ib, 0:binsz-1]] 199 IF debug_w THEN BEGIN 200 print, 'fld[idxb[ib, 0:binsz-1]] =',fld[idxb[ib, 0:binsz-1]] 201 ENDIF 166 202 fldys[ib, 0:binsz-1] = flds[idxb[ib, 0:binsz-1]] 167 203 surfb[ib, 0:binsz-1] = surf[idxb[ib, 0:binsz-1]] 168 IF sw3 THEN fldy2[ib, 0:binsz-1] = fld3[idxb[ib, 0:binsz-1]] 204 IF sw3 THEN BEGIN 205 fldy2[ib, 0:binsz-1] = fld3[idxb[ib, 0:binsz-1]] 206 ENDIF 169 207 ENDIF 170 208 ib = ib + 1 … … 196 234 197 235 ; print bin info 198 IF ib GT 0 AND ib LT nbins THEN print, ' Bin size, occurence, average: ', bin_interval[ib-1], bin_interval[ib], binpop[ib], (binpop[ib]/total(binpop))*100., yplt[ib] 199 IF ib EQ 0 THEN print, ' Bin size, occurence, average: min' , bin_interval[ib], binpop[ib], (binpop[ib]/total(binpop))*100. , yplt[ib] 200 IF ib EQ nbins THEN print, ' Bin size, occurence, average: ', bin_interval[ib-1],' max ', binpop[ib], (binpop[ib]/total(binpop))*100. , yplt[ib] 201 ENDIF ELSE yplt[ib] = !values.f_nan 236 IF ib GT 0 AND ib LT nbins THEN BEGIN 237 print, ' Bin size, occurence, average: ', bin_interval[ib-1], bin_interval[ib], binpop[ib], (binpop[ib]/total(binpop))*100., yplt[ib] 238 ENDIF 239 IF ib EQ 0 THEN BEGIN 240 print, ' Bin size, occurence, average: min' , bin_interval[ib], binpop[ib], (binpop[ib]/total(binpop))*100. , yplt[ib] 241 ENDIF 242 IF ib EQ nbins THEN BEGIN 243 print, ' Bin size, occurence, average: ', bin_interval[ib-1],' max ', binpop[ib], (binpop[ib]/total(binpop))*100. , yplt[ib] 244 ENDIF 245 ENDIF ELSE BEGIN 246 yplt[ib] = !values.f_nan 247 ENDELSE 202 248 203 249 ib = ib + 1 … … 237 283 238 284 ; print bin info 239 IF ib GT 0 AND ib LT nbins THEN print, ' Bin size, occurence, regress.: ', bin_interval[ib-1], bin_interval[ib], binpop[ib], (binpop[ib]/total(binpop))*100., yplt[ib] 240 IF ib EQ 0 THEN print, ' Bin size, occurence, regress.: min' , bin_interval[ib], binpop[ib], (binpop[ib]/total(binpop))*100. , yplt[ib] 241 IF ib EQ nbins THEN print, ' Bin size, occurence, regress.: ', bin_interval[ib-1],' max ', binpop[ib], (binpop[ib]/total(binpop))*100. , yplt[ib] 242 243 ENDIF ELSE yplt[ib] = !values.f_nan 285 IF ib GT 0 AND ib LT nbins THEN BEGIN 286 print, ' Bin size, occurence, regress.: ', bin_interval[ib-1], bin_interval[ib], binpop[ib], (binpop[ib]/total(binpop))*100., yplt[ib] 287 ENDIF 288 IF ib EQ 0 THEN BEGIN 289 print, ' Bin size, occurence, regress.: min' , bin_interval[ib], binpop[ib], (binpop[ib]/total(binpop))*100. , yplt[ib] 290 ENDIF 291 IF ib EQ nbins THEN BEGIN 292 print, ' Bin size, occurence, regress.: ', bin_interval[ib-1],' max ', binpop[ib], (binpop[ib]/total(binpop))*100. , yplt[ib] 293 ENDIF 294 295 ENDIF ELSE BEGIN 296 yplt[ib] = !values.f_nan 297 ENDELSE 244 298 245 299 ib = ib + 1 … … 269 323 270 324 printf, nulhis, strcompress(pltcmd) 271 IF debug_w THEN print, ' ', pltcmd 325 IF debug_w THEN BEGIN 326 print, ' ', pltcmd 327 ENDIF 272 328 res = execute(pltcmd) 273 329 … … 279 335 res = execute(pltcmd) 280 336 281 IF debug_w THEN print, " ... Exit ybinx" 337 IF debug_w THEN BEGIN 338 print, " ... Exit ybinx" 339 ENDIF -
trunk/procs/yfx.pro
r203 r205 30 30 boxx = ' ['+boxx+']' 31 31 vargrid = vargrid1 32 IF debug_w THEN print, ' yfx: domdef and vargrid : ', boite_plt1d[0:3], vargrid 32 IF debug_w THEN BEGIN 33 print, ' yfx: domdef and vargrid : ', boite_plt1d[0:3], vargrid 34 ENDIF 33 35 domdef, boite_plt1d[0:3] 34 36 print, ' Averaging (time serie plot) cmd.var '+cmd.var+' in'+boxx 35 IF debug_w THEN print, ' fld size', size(fld) 37 IF debug_w THEN BEGIN 38 print, ' fld size', size(fld) 39 ENDIF 36 40 fld = checkfield(fld, 'plt1d', type = datyp.hotyp, boite = boite_plt1d) 37 41 IF cmd.trend GT 0 THEN BEGIN … … 42 46 ENDIF 43 47 ; space and time plots fld2 44 IF debug_w THEN print, ' cmd1_back = ', cmd1_back 45 IF debug_w THEN print, ' cmd2_back = ', cmd2_back 46 IF debug_w AND sw_diffg THEN print, ' grid1_full = ', grid1_full 47 IF debug_w AND sw_diffg THEN print, ' grid2_full = ', grid2_full 48 IF debug_w THEN BEGIN 49 print, ' cmd1_back = ', cmd1_back 50 print, ' cmd2_back = ', cmd2_back 51 IF sw_diffg THEN BEGIN 52 print, ' grid1_full = ', grid1_full 53 print, ' grid2_full = ', grid2_full 54 ENDIF 55 ENDIF 48 56 IF sw_diffg EQ 1 THEN BEGIN 49 57 jptb = jpt 50 IF debug_w THEN print, ' calling def_grid, cmd2_back in plt_map/yfx ' 58 IF debug_w THEN BEGIN 59 print, ' calling def_grid, cmd2_back in plt_map/yfx ' 60 ENDIF 51 61 cmd2_back.grid = grid2_full 52 62 def_grid, cmd2_back … … 72 82 boxy = ' ['+boxy+']' 73 83 vargrid = vargrid2 74 IF debug_w THEN print, ' domdef and vargrid : ', boite_plt1d2[0:3], vargrid 84 IF debug_w THEN BEGIN 85 print, ' domdef and vargrid : ', boite_plt1d2[0:3], vargrid 86 ENDIF 75 87 domdef, boite_plt1d2[0:3] 76 88 print, ' Averaging (time serie plot) cmd2.var '+cmd2.var+' in'+boxy 77 IF debug_w THEN print, ' fld2 size', size(fld2) 89 IF debug_w THEN BEGIN 90 print, ' fld2 size', size(fld2) 91 ENDIF 78 92 fld2 = checkfield(fld2, 'plt1d', type = datyp2.hotyp, direc = 'xy', boite = boite_plt1d2, /timearray) 79 93 IF cmd2.trend GT 0 THEN BEGIN … … 86 100 sw_diffg = 0 87 101 jptb = jpt 88 IF debug_w THEN print, ' calling def_grid, cmd1_back in plt_map/yfx ' 102 IF debug_w THEN BEGIN 103 print, ' calling def_grid, cmd1_back in plt_map/yfx ' 104 ENDIF 89 105 cmd1_back.grid = grid1_full 90 106 def_grid, cmd1_back … … 103 119 ; text for plot info in legend_overlay 104 120 coeff_txt = 'Linfit = '+strtrim(string(coeff[1], format = fmt_linfit), 2) 105 IF proberr NE 1.0 THEN print, ' WARNING: proba = ',proberr 121 IF proberr NE 1.0 THEN BEGIN 122 print, ' WARNING: proba = ',proberr 123 ENDIF 106 124 ; divide serie in two domains (on x axis) seperated by linfit_sep (plt_def) 107 125 ; do only if 1m@t412 (if full serie, then separate by season) 108 126 109 IF linfit_sep NE -99999 AND cmd.trend EQ 412 THEN begin127 IF linfit_sep NE -99999 AND cmd.trend EQ 412 THEN BEGIN 110 128 111 129 idx_low = where (fld2 LE linfit_sep) … … 116 134 coeffl = linfit(fld2[idx_low], fld[idx_low], CHISQ = linerrl, PROB = proberrl, SIGMA = sigmaerrl) 117 135 print, ' Linfit coef below ',strtrim(string(linfit_sep), 2),' = ', coeffl[0], coeffl[1], ' errbar = ',sigmaerrl 118 IF proberrl NE 1.0 THEN print, ' *** WARNING: proba lower = ',proberrl 136 IF proberrl NE 1.0 THEN BEGIN 137 print, ' *** WARNING: proba lower = ',proberrl 138 ENDIF 119 139 coefflu_txt = coefflu_txt+strtrim(string(coeffl[1], format = fmt_linfit), 2)+'<'+strtrim(string(linfit_sep, format = '(F4.2)'), 2) 120 140 ENDIF … … 123 143 coeffu = linfit(fld2[idx_up], fld[idx_up], CHISQ = linerru, PROB = proberru, SIGMA = sigmaerru) 124 144 print, ' Linfit coef above ',strtrim(string(linfit_sep), 2),' = ', coeffu[0], coeffu[1], ' errbar = ',sigmaerru 125 IF proberru NE 1.0 THEN print, ' *** WARNING: proba upper = ',proberru 145 IF proberru NE 1.0 THEN BEGIN 146 print, ' *** WARNING: proba upper = ',proberru 147 ENDIF 126 148 coefflu_txt = coefflu_txt+'>'+strtrim(string(coeffu[1], format = fmt_linfit), 2) 127 149 ENDIF … … 194 216 pltcmd = 'pltsc,fldp,fldp2,minc,maxc,minc2,maxc2,varlegend2, boite=boxyfx'+com_strplt+',ov1d='+string[ic]+',COLOR='+string(symbol_color[ic])+', STY1D='+string(symbol_style[ic]-1)+', SYMSIZE='+string(symbol_size) 195 217 printf, nulhis, strcompress(pltcmd) 196 IF debug_w THEN print, ' ',pltcmd 218 IF debug_w THEN BEGIN 219 print, ' ',pltcmd 220 ENDIF 197 221 res = execute(pltcmd) 198 222 ENDIF … … 211 235 212 236 printf, nulhis, strcompress(pltcmd) 213 IF debug_w THEN print, ' ', pltcmd 237 IF debug_w THEN BEGIN 238 print, ' ', pltcmd 239 ENDIF 214 240 res = execute(pltcmd) 215 241 pltcmd = 'pltt,(lincoef-linerro)*'+string(mult_coeff)+', '''+hotyp+''''+minmax+com_strplt+',ov1d=1,COLOR=1, thick=1, STY1D=0' 216 242 printf, nulhis, strcompress(pltcmd) 217 IF debug_w THEN print, ' ',pltcmd 243 IF debug_w THEN BEGIN 244 print, ' ', pltcmd 245 ENDIF 218 246 res = execute(pltcmd) 219 247 pltcmd = 'pltt,(lincoef+linerro)*'+string(mult_coeff)+', '''+hotyp+''''+minmax+com_strplt+',ov1d=1,COLOR=1, thick=1, STY1D=0' 220 248 printf, nulhis, strcompress(pltcmd) 221 IF debug_w THEN print, ' ',pltcmd 249 IF debug_w THEN BEGIN 250 print, ' ',pltcmd 251 ENDIF 222 252 res = execute(pltcmd) 223 253 pltcmd = 'pltt,linerr0, '''+hotyp+''''+minmax+com_strplt+',ov1d=1,COLOR=2, thick=1, STY1D=0' 224 254 printf, nulhis, strcompress(pltcmd) 225 IF debug_w THEN print, ' ',pltcmd 255 IF debug_w THEN BEGIN 256 print, ' ', pltcmd 257 ENDIF 226 258 res = execute(pltcmd) 227 259 ENDIF … … 230 262 coeffm_txt = coeffm_txt+']' 231 263 ENDIF ELSE BEGIN ; one color 232 IF debug_w THEN print, ' ',pltcmdstd 264 IF debug_w THEN BEGIN 265 print, ' ',pltcmdstd 266 ENDIF 233 267 res = execute(pltcmdstd[0]) 234 268 ENDELSE 235 269 ENDIF 236 270 ENDIF ELSE BEGIN ; standard scatter plot 237 IF debug_w THEN print, ' ',pltcmdstd 271 IF debug_w THEN BEGIN 272 print, ' ',pltcmdstd 273 ENDIF 238 274 res = execute(pltcmdstd[0]) 239 275 ENDELSE 240 IF cmd.trend EQ 412 THEN coeffm_txt = '' 276 IF cmd.trend EQ 412 THEN BEGIN 277 coeffm_txt = '' 278 ENDIF 241 279 ; Add slope value 242 280 @legend_overlay … … 276 314 pltcmd = 'pltsc,stdsc,stdsc2,0. ,maxc,0.,maxc2,varlegend2, boite=boxyfx'+com_strplt+',ov1d=1-min(1,sw_ov1d), STY1D=-1, THICKN=3, SYMSIZE='+string(symbol_size)+', FRACTION=fraction' 277 315 printf, nulhis, strcompress(pltcmd) 278 IF debug_w THEN print, pltcmd 316 IF debug_w THEN BEGIN 317 print, pltcmd 318 ENDIF 279 319 res = execute(pltcmd[0]) 280 320 pltcmd = 'xyouts,stdsc2-(maxc2)/(.3*win[0]*win[1]),stdsc,string(long(findgen(12))+1),charsize=1.3,alignment=0.5' 281 321 printf, nulhis, strcompress(pltcmd) 282 IF debug_w THEN print, pltcmd 322 IF debug_w THEN BEGIN 323 print, pltcmd 324 ENDIF 283 325 res = execute(pltcmd[0]) 284 326 ENDIF ELSE BEGIN 285 327 ov1d_val = 0 286 IF mean_sc_only EQ 1 THEN ov1d_val = 1 328 IF mean_sc_only EQ 1 THEN BEGIN 329 ov1d_val = 1 330 ENDIF 287 331 pltcmd = 'pltsc,fldrem_t1,fldrem_t2,minc,maxc,minc2,maxc2,varlegend2, boite=boxyfx'+com_strplt+',ov1d=ov1d_val, STY1D=-1, THICKN=5, SYMSIZE='+string(symbol_size)+', FRACTION=fraction' 288 332 printf, nulhis, strcompress(pltcmd) 289 IF debug_w THEN print, pltcmd 290 IF mean_sc_only NE 0 THEN res = execute(pltcmd[0]) 333 IF debug_w THEN BEGIN 334 print, pltcmd 335 ENDIF 336 IF mean_sc_only NE 0 THEN BEGIN 337 res = execute(pltcmd[0]) 338 ENDIF 291 339 IF mean_sc_only EQ 2 THEN BEGIN 292 340 ; add month info win[0]*win[1] 293 341 pltcmd = 'xyouts,fldrem_t2-(maxc2-minc2)/(0.5*win[0]*win[1]),fldrem_t1,string(long(findgen(12))+1),charsize=1.3,alignment=0.5' 294 342 printf, nulhis, strcompress(pltcmd) 295 IF debug_w THEN print, pltcmd 343 IF debug_w THEN BEGIN 344 print, pltcmd 345 ENDIF 296 346 res = execute(pltcmd[0]) 297 347 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.