Changeset 83
- Timestamp:
- 04/04/08 16:08:47 (16 years ago)
- Location:
- branches/procs-read
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/procs-read/com_eg.pro
r41 r83 4 4 ; attributs horizontal+vertical means 5 5 ; 6 COMMON zm_att, box_h, depth_z, zoom_z, diaznl_idx, box_plot, legbox, hpa_max, hpa_min, max_spec, spec_win, vert_type, vert_mean, vert_switch, glamboundary_box, msf_mean, name_level6 COMMON zm_att, box_h, depth_z, zoom_z, diaznl_idx, box_plot, legbox, pres_max, pres_min, max_spec, spec_win, vert_type, vert_mean, vert_switch, glamboundary_box, msf_mean, name_level 7 7 ; 8 8 ; attributs hoevmoeller -
branches/procs-read/data_read.pro
r81 r83 91 91 ENDIF 92 92 93 ; define horizontal domain 94 ; if needed, vertical domain will be defined in the call of read_ncdf93 ; define horizontal domain and vertical domain if needed (used in 94 ; read_ncdf and update_data) 95 95 box_plot = def_box(cmd.plt, dimplot, legbox, time_stride) 96 ;domdef, [box_plot[0:3], vert_mean], /MEMEINDICES97 ;domdef, box_plot[0:3], /MEMEINDICES98 96 CASE n_elements(box_plot) OF 99 97 4 : IF vert_switch GE 1 THEN box_plot = [box_plot, vert_mean] 100 6 : IF vert_switch GE 1 THEN box_plot = [box_plot[0:3], vert_mean]98 6 : IF vert_switch GE 1 THEN box_plot = [box_plot[0:3], vert_mean] ELSE box_plot = box_plot[0:3] 101 99 ENDCASE 100 ; Exceptions : need to read all the vertical data (and not a subset) 101 ; for the pltz case. Other cases ? 102 IF plttyp EQ 'pltz' THEN box_plot = box_plot[0:3] 102 103 103 104 ; define timetsteps time1 and time2 104 IF hotyp NE '-' THEN BEGIN 105 time1 = delta_t1 106 timearr = compute_time(cmd.timave, cmd.date1, cmd.spec) 107 time2 = timearr.count+delta_t1 108 ENDIF ELSE BEGIN 109 IF strpos(cmd.timave, 'mm') NE -1 THEN time1 = delta_t1+long(strmid(cmd.date1, 0, 2)) $ 110 ELSE time1 = delta_t1 111 time2 = time1 112 ENDELSE 105 IF hotyp NE '-' THEN BEGIN 106 time1 = delta_t1+1 107 timearr = compute_time(cmd.timave, cmd.date1, cmd.spec) 108 time2 = timearr.count+delta_t1 109 time = timearr.scale 110 ENDIF ELSE BEGIN 111 IF strpos(cmd.timave, 'mm') NE -1 THEN time1 = delta_t1+long(strmid(cmd.date1, 0, 2)) $ 112 ELSE time1 = delta_t1+1 113 time2 = time1 114 time = time1 115 ENDELSE 113 116 114 117 ; IF hotyp NE '-' THEN BEGIN ; time serie … … 193 196 idx = strpos(cmd.var, '=f(') 194 197 var1 = strmid(cmd.var, 0, idx) 195 fldr1 = nc_read(file_name, var1, ncdf_db, $198 fldr1 = nc_read(file_name, var1, ncdf_db, BOXZOOM = box_plot, $ 196 199 TIME_1 = time1, TIME_2 = time2, ALL_DATA = all_data, _extra = ex) 197 200 file_name1 = file_name … … 204 207 IF strpos(cmd.var, '=f(next)') EQ -1 THEN BEGIN ; type 1 y=f(x) on 1 line 205 208 var2 = strmid(cmd.var, idx+3, strlen(cmd.var)-idx-4) 206 fldr2 = nc_read(file_name, var2, ncdf_db, $209 fldr2 = nc_read(file_name, var2, ncdf_db, BOXZOOM = box_plot, $ 207 210 TIME_1 = time1, TIME_2 = time2, ALL_DATA = all_data, _extra = ex) 208 211 datyp2 = datyp … … 336 339 ENDCASE 337 340 338 ; Pb with varexp which is always updated in read_ncdf 339 ; For Seb, varexp is the name of the file 340 ; For Eric, varexp is the name of the experiment 341 varexp = cmd.exp 341 ; Redefinition of time because it is updated in read_ncdf 342 ; Useful for pltt routine 343 IF hotyp NE '-' THEN BEGIN 344 time = timearr.scale 345 ENDIF ELSE BEGIN 346 time = time1 347 ENDELSE 342 348 343 349 ; if tkeavt, take log … … 379 385 print, ' Date1 = ', cmd.date1 380 386 sfild = fldr 381 bin_sigma, cmd, sfild 387 bin_sigma, cmd, sfild, BOXZOOM = box_plot, ALL_DATA = all_data ;;;;;;;;;;;;;; prob 382 388 cumulative = cumulative + sfild.data 383 389 ENDFOR … … 394 400 print, 'data_read: Performing monthly bining. Indices: first, last, current = 0,', timedim-1, i 395 401 sfild2 = {name: sfild.name, data: sfild.data(*, *, *, i), legend: sfild.legend, units: sfild.units, origin: sfild.origin, dim: sfild.dim-1} 396 bin_sigma, cmd, sfild2 402 bin_sigma, cmd, sfild2, BOXZOOM = box_plot, ALL_DATA = all_data 397 403 fldrd(*, *, *, i)= sfild2.data 398 404 ENDFOR … … 400 406 ENDIF ELSE BEGIN 401 407 sfild = fldr 402 bin_sigma, cmd, sfild 408 bin_sigma, cmd, sfild, BOXZOOM = box_plot, ALL_DATA = all_data 409 ;;bin_sigma, cmd, sfild, ALL_DATA = all_data 403 410 fldr = sfild 404 411 ENDELSE … … 438 445 439 446 ; perform difference 440 441 447 diff = fldr.data-field2.data 442 448 IF (where(fldr.data EQ valmask))[0] NE -1 THEN $ … … 455 461 456 462 ; read field2 457 458 463 field2 = data_read(cmd, hotyp, plttyp, dimplot, iover, ALL_DATA = all_data, _extra = ex) 459 464 IF n_elements(field2.data) EQ 1 THEN return, field2 … … 496 501 497 502 ; decode field2 498 499 503 argvar = strsplit(cmdl, '/', /EXTRACT) 500 504 … … 507 511 508 512 ; read field2 509 510 513 field2 = data_read(cmd2, hotyp, plttyp, dimplot, iover, ALL_DATA = all_data, _extra = ex) 511 514 IF n_elements(field2.data) EQ 1 THEN return, field2 512 515 513 516 ; perform difference 514 515 517 diff = fldr.data-field2.data 516 518 IF (where(fldr.data EQ valmask))[0] NE -1 THEN $ … … 533 535 ENDELSE 534 536 537 ; Pb with varexp which is always updated in read_ncdf 538 ; For Seb, varexp is the name of the file. For Eric, varexp is the name of the experiment 539 varexp = cmd.exp 540 535 541 IF debug_w THEN print, ' varexp before exit in data_read = ', varexp 536 542 IF debug_w THEN print, ' ...EXIT data_read' -
branches/procs-read/macros/make_depth.pro
r68 r83 1 1 ;------------------------------------------------------------ 2 2 ;------------------------------------------------------------ 3 FUNCTION make_depth, file_name, ncdf_db, TIME_1 = time_1, TIME_2 = time_2, ZMTYP = zmtyp 3 FUNCTION make_depth, file_name, ncdf_db, TIME_1 = time_1, TIME_2 = time_2, ZMTYP = zmtyp, _EXTRA = ex 4 4 ; 5 5 @common -
branches/procs-read/macros/make_eos.pro
r81 r83 57 57 ; Read T and S 58 58 ; 59 tn = nc_read(file_name,'votemper', ncdf_db, BOXZOOM = boxzoom, TIME_1 = time_1, TIME_2 = time_2, no_mean = 1)60 sn = nc_read(file_name,'vosaline', ncdf_db, BOXZOOM = boxzoom, TIME_1 = time_1, TIME_2 = time_2, no_mean = 1)61 59 tn = nc_read(file_name,'votemper', ncdf_db, BOXZOOM = boxzoom, TIME_1 = time_1, TIME_2 = time_2, ALL_DATA = all_data, no_mean = 1) 60 sn = nc_read(file_name,'vosaline', ncdf_db, BOXZOOM = boxzoom, TIME_1 = time_1, TIME_2 = time_2, ALL_DATA = all_data, no_mean = 1) 61 stop 62 62 ; declarations 63 63 ; -
branches/procs-read/macros/make_msf.pro
r81 r83 14 14 ; 15 15 file_nam = strmid(file_name, 0, strlen(file_name)-4) 16 v = nc_read(file_nam+'V.nc','vomecrty', ncdf_db, BOXZOOM = boxzoom, TIME_1 = time_1, TIME_2 = time_2 )16 v = nc_read(file_nam+'V.nc','vomecrty', ncdf_db, BOXZOOM = boxzoom, TIME_1 = time_1, TIME_2 = time_2, ALL_DATA = all_data, _extra = ex) 17 17 18 18 idx = where(v.data EQ valmask) -
branches/procs-read/mask_z.pro
r2 r83 169 169 CASE strmid(cmd.plt, 1, 1) OF 170 170 't': boite_pltz = box_h 171 ELSE : boite_pltz = [box_h, hpa_min, hpa_max ]171 ELSE : boite_pltz = [box_h, pres_min, pres_max ] 172 172 ENDCASE 173 173 ENDIF … … 191 191 CASE strmid(cmd.plt, 1, 1) OF 192 192 't': boite_pltz = zbox 193 ELSE : IF n_elements(boite_pltz) EQ 4 THEN boite_pltz = [zbox, hpa_min, hpa_max]193 ELSE : IF n_elements(boite_pltz) EQ 4 THEN boite_pltz = [zbox, pres_min, pres_max] 194 194 ENDCASE 195 195 ENDIF -
branches/procs-read/msf_simple.pro
r2 r83 45 45 ; integration zonale du flux ! 46 46 ; 47 fm = total(z, 1 )47 fm = total(z, 1, /NAN) 48 48 ; 49 49 ; calcul de la msf en integrant depuis le fond -
branches/procs-read/nc_read.pro
r81 r83 197 197 ; IF debug_w THEN print, ' ' 198 198 199 ; Find the variable's attribute 199 200 ncdf_getatt, directory+file_name, var_name, add_offset = add_offset, scale_factor = scale_factor, $ 200 201 missing_value = missing_value, units = units, calendar = calendar, long_name = long_name 201 202 202 203 ; By default units for the Z axis are meters 203 IF n_elements(gdept) GT 1 AND name_level NE '-' THEN BEGIN 204 ncdf_getatt, directory+file_name, name_level, units = units_depth 205 ENDIF ELSE units_depth = 'm' 204 IF n_elements(gdept) GT 1 THEN BEGIN 205 IF name_level NE '-' THEN $ 206 ncdf_getatt, directory+file_name, name_level, units = units_depth ELSE units_depth = 'm' 207 ENDIF ELSE units_depth = '' 208 209 ; Check consistency between time_2 computed from param in cmdline and the max number 210 ; of time steps found in the file. 211 jpt_max = find_jptmax(file_name, IODIRECTORY = directory) 212 IF time_2-time_1+1 GT jpt_max THEN time_2 = time_1+jpt_max-1 206 213 207 214 ; Read the data with a call to read_ncdf … … 213 220 ZINVAR = zinvar, ZINDEX = zindex) 214 221 215 print, 'zinvar', zinvar 216 222 IF debug_w THEN print, ' zinvar=', zinvar 217 223 IF debug_w THEN print, ' ' 218 224 ; IF debug_w THEN print, ' key=', key … … 227 233 IF debug_w THEN print, ' key_shift in nc_read=', key_shift 228 234 ; IF debug_w THEN print, ' key_yreverse, firsty, lasty',key_yreverse, firsty, lasty 229 IF debug_w THEN print, ' key_yreverse ',key_yreverse235 IF debug_w THEN print, ' key_yreverse=',key_yreverse 230 236 IF debug_w THEN print, ' ' 231 237 … … 603 609 ; IF att_txt EQ 'missing_value' OR att_txt EQ 'mask value' OR att_txt EQ '_FillValue' THEN ncdf_attget, cdfid, varid, att_txt, valmask 604 610 ; ENDFOR 605 valmask = missing_value 606 ; set valmask to 1.e20 607 611 612 IF size(missing_value, /TYPE) EQ 4 OR size(missing_value, /TYPE) EQ 5 THEN BEGIN 613 valmask = missing_value 608 614 ; ensure valmask is positive 609 610 IF valmask LT 0 THEN BEGIN611 print, ' *** Warning valmask is negative - changing sign: ', valmask612 idx_t = where (field.data EQ valmask)613 IF idx_t(0) NE -1 THEN field.data(idx_t)= -valmask614 valmask = -valmask615 idx_t=0 ; free memory615 IF valmask LT 0 THEN BEGIN 616 print, ' *** Warning valmask is negative - changing sign: ', valmask 617 idx_t = where (field.data EQ valmask) 618 IF idx_t(0) NE -1 THEN field.data(idx_t) = -valmask 619 valmask = -valmask 620 idx_t=0 ; free memory 621 ENDIF 616 622 ENDIF 617 623 -
branches/procs-read/plt_map.pro
r70 r83 598 598 ENDELSE 599 599 END 600 'atm': BEGIN & type_yz = ',type_yz='' hPa''' & zoom_txt = ', zoom='+string(hpa_max) & END600 'atm': BEGIN & type_yz = ',type_yz=''Pa''' & zoom_txt = ', zoom='+string(pres_max) & END 601 601 ELSE:type_yz = '' 602 602 ENDCASE … … 802 802 IF vecplot EQ 0 THEN BEGIN 803 803 804 IF cmd.var EQ 'vozonbsf' THEN xindstr = ', /xindex' ELSE xindstr = '' 804 IF cmd.var EQ 'vozonbsf' THEN xindstr = ', /xindex' ELSE xindstr = '' 805 805 806 806 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 -
branches/procs-read/trends.pro
r81 r83 375 375 ENDELSE 376 376 ENDIF 377 378 return, fld379 377 380 378 IF debug_w THEN print, ' Vargrid : ', vargrid 381 379 IF debug_w THEN print, ' Leaving trends.pro' 382 380 381 return, fld 382 383 383 END 384 384 -
branches/procs-read/update_data.pro
r81 r83 18 18 END 19 19 20 ;; fichier 2d : surface ( dimz= 0 or 1)20 ;; fichier 2d : surface (n_elements(gdept) = 0 or 1) 21 21 2: BEGIN 22 22 print, ' Found ', vname, ' (2D data) from file' … … 38 38 END 39 39 40 ;; fichier 3d : 2 cas = 1/ 2d espace + temps 2/ 3d espace ( dimz> 1)40 ;; fichier 3d : 2 cas = 1/ 2d espace + temps 2/ 3d espace (n_elements(gdept) > 1) 41 41 3: BEGIN 42 42 IF jpt EQ 1 THEN BEGIN … … 79 79 CASE vert_type OF 80 80 'z': BEGIN 81 zmean = grossemoyenne(tab, 'z', boite = vert_mean, /NAN)81 zmean = grossemoyenne(tab, 'z', boite = boxzoom, /NAN) 82 82 suffix = ' averaged in ['+strtrim(string(long(vert_mean(0))), 2)+zunits+','+strtrim(string(long(vert_mean(1))), 2)+zunits+']' 83 83 END 84 84 'level': BEGIN ; case level (zindex) 85 zmean = grossemoyenne(temporary(tab), 'z', boite = vert_mean, /zindex, /NAN)85 zmean = grossemoyenne(temporary(tab), 'z', boite = boxzoom, /zindex, /NAN) 86 86 suffix = ' averaged in '+vert_type+' ['+strtrim(string(long(vert_mean(0))), 2)+','+strtrim(string(long(vert_mean(1))), 2)+']' 87 87 END -
branches/procs-read/yfx.pro
r71 r83 35 35 IF debug_w THEN print, ' cmd1_back = ', cmd1_back 36 36 IF debug_w THEN print, ' cmd2_back = ', cmd2_back 37 IF debug_w THEN print, ' grid1_full = ', grid1_full38 IF debug_w THEN print, ' grid2_full = ', grid2_full37 IF debug_w AND sw_diffg THEN print, ' grid1_full = ', grid1_full 38 IF debug_w AND sw_diffg THEN print, ' grid2_full = ', grid2_full 39 39 IF sw_diffg EQ 1 THEN BEGIN 40 40 jptb = jpt
Note: See TracChangeset
for help on using the changeset viewer.