Changeset 9 for trunk/procs/meshes/mesh_from_file.pro
- Timestamp:
- 11/27/07 17:13:57 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/procs/meshes/mesh_from_file.pro
r2 r9 6 6 ; masks made in data_read 7 7 ; 8 IF debug_w THEN print, ' ENTER mesh_from_file...' 8 9 9 10 IF strpos(ncdf_db, ':') GE 1 THEN directory = (str_sep(ncdf_db, ':'))[1] $ … … 12 13 s_file = directory+file_name 13 14 14 print,' Model inits for ', model, ' from file', s_file15 print,' Model inits for ', model, ' from file: ', s_file 15 16 16 17 sm_file = hom_idl+'grids/grids_'+model+'.nc' … … 21 22 initncdf, s_file, GLAMBOUNDARY = glamboundary_box 22 23 23 IF debug_w THEN print, 'Found mask from ',sm_file24 print, ' Found mask from ',sm_file 24 25 25 26 tmask = byte(read_ncdf('sftlf', 0, 0, /timestep, file = sm_file, /nostruct)) … … 35 36 36 37 ENDIF ELSE BEGIN 37 initncdf, s_file, USEASMASK = var_name, GLAMBOUNDARY = glamboundary_box, ZAXISNAME = 'depth' 38 CASE var_name OF 39 '@@voenergy': var_local = 'so' 40 ELSE: var_local = var_read_grd_file 41 ENDCASE 42 43 ; find valmask 44 cdfidl=ncdf_open(s_file) 45 contient=ncdf_inquire(cdfidl) 46 varidl = ncdf_varid(cdfidl, var_local) 47 varcontient=ncdf_varinq(cdfidl, var_local) 48 valmask = 1.e20 49 FOR i = 0, varcontient.natts-1 DO BEGIN 50 att_txt = ncdf_attname(cdfidl, varidl, i) 51 IF att_txt EQ 'missing_value' OR att_txt EQ 'mask value' OR att_txt EQ '_FillValue' THEN ncdf_attget, cdfidl, varidl, att_txt, valmask 52 IF debug_w THEN print, 'valmask found = ',valmask 53 ENDFOR 54 ncdf_close, cdfidl 55 ; read grid 56 initncdf, s_file, USEASMASK = var_local, missing_value = valmask, GLAMBOUNDARY = glamboundary_box, ZAXISNAME = 'depth' 57 38 58 ENDELSE 39 40 IF debug_w THEN print, 'vargrid = ',vargrid41 59 42 60 key_offset = [0, 0, 0] … … 45 63 ; 46 64 diaznl_idx = 1 65 IF debug_w THEN print, ' ...EXIT mesh_from_file' 47 66 48 67 return
Note: See TracChangeset
for help on using the changeset viewer.