Changeset 100 for trunk/procs/meshes


Ignore:
Timestamp:
05/08/08 22:10:27 (16 years ago)
Author:
ericg
Message:

Update of mesh_from_file and mesh_orca following merge with r86 (new nc_read)

Location:
trunk/procs/meshes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/procs/meshes/mesh_from_file.pro

    r86 r100  
    1 PRO mesh_from_file, model, file_name, ncdf_db, var_name 
     1PRO mesh_from_file, model, file_name, ncdf_db, var_name, ALL_DATA = all_data 
    22@common 
    33@com_eg 
     
    77; 
    88   IF debug_w THEN print, '  ENTER mesh_from_file...' 
     9   IF debug_w AND keyword_set(all_data)  THEN print, '        All_data = ', all_data  
    910 
    1011   IF strpos(ncdf_db, ':') GE 1 THEN directory = (strsplit(ncdf_db, ':', /EXTRACT))[1] $ 
     
    1516   print,'    Model inits for ', model, ' from file: ', s_file 
    1617 
    17 ;   sm_file = hom_idl+'grids/grids_'+model+'.nc'  
    18 ;   res = find(sm_file) 
     18   sm_file = hom_idl+'grids/grids_'+model+'.nc'  
     19   res = find(sm_file) 
    1920   varexpp = varexp 
    20 ;   IF res NE 'NOT FOUND' THEN BEGIN  
    21 ; 
    22 ;      initncdf, s_file, GLAMBOUNDARY = glamboundary_box 
    23 ; 
    24 ;      print, '    Found mask from ',sm_file  
    25 ; 
    26 ;      tmask = byte(read_ncdf('sftlf', 0, 0, /timestep, file = sm_file, /nostruct)) 
    27 ;       
    28 ;      idx = where(tmask EQ valmask) 
    29 ; 
    30 ;      IF idx(0) NE -1 THEN tmask(idx) = 0. 
    31 ;      idx =  where(tmask LE 50.) 
    32 ;      tmask(idx) = 0. 
    33 ;      tmask =  tmask < 1 
    34 ;      tmask =  1-tmask 
    35 ;      triangles=triangule() 
    36 ; 
    37 ;   ENDIF ELSE BEGIN  
     21   IF res NE 'NOT FOUND' THEN BEGIN  
     22 
     23      IF keyword_set(ALL_DATA) THEN BEGIN  
     24         initncdf, s_file, GLAMBOUNDARY = glamboundary_box, PLAIN = 1 
     25      ENDIF ELSE initncdf, s_file, GLAMBOUNDARY = glamboundary_box 
     26 
     27      print, '    Found mask from ',sm_file  
     28 
     29      tmask = byte(read_ncdf('sftlf', 0, 0, /timestep, file = sm_file, /nostruct)) 
     30       
     31      idx = where(tmask EQ valmask) 
     32 
     33      IF idx(0) NE -1 THEN tmask(idx) = 0. 
     34      idx =  where(tmask LE 50.) 
     35      tmask(idx) = 0. 
     36      tmask =  tmask < 1 
     37      tmask =  1-tmask 
     38      triangles=triangule() 
     39 
     40   ENDIF ELSE BEGIN  
    3841      CASE var_name OF 
    39          '@@voenergy': var_local = 'so' 
     42         '@@voenergy': BEGIN  
     43            CASE cmd1_back.grid OF 
     44               'T': var_local = 'votemper' 
     45               'T05': var_local = 'votemper' 
     46               'T05#': var_local = 'votemper' 
     47               ELSE: var_local = 'so' 
     48            ENDCASE  
     49            END  
    4050         ELSE: var_local = var_read_grd_file 
    4151      ENDCASE  
     
    6373      ; build grid 
    6474      CASE mesh_type of 
    65          'atm': BEGIN 
    66             ;;initncdf, s_file, USEASMASK = var_local, missing_value = valmask, GLAMBOUNDARY = glamboundary_box, ZAXISNAME = name_level 
    67             initncdf, s_file, GLAMBOUNDARY = glamboundary_box, ZAXISNAME = name_level 
    68          END 
    69          ELSE: initncdf, s_file, USEASMASK = var_local, missing_value = valmask, GLAMBOUNDARY = glamboundary_box, ZAXISNAME = 'depth' 
     75         'atm':  BEGIN  
     76            IF keyword_set(ALL_DATA) THEN BEGIN  
     77               initncdf, s_file, GLAMBOUNDARY = glamboundary_box, ZAXISNAME = name_level, PLAIN = 1 
     78            ENDIF ELSE initncdf, s_file, GLAMBOUNDARY = glamboundary_box, ZAXISNAME = name_level  
     79         END  
     80         ELSE: BEGIN  
     81            IF keyword_set(ALL_DATA) THEN BEGIN  
     82               initncdf, s_file, USEASMASK = var_local, missing_value = valmask, GLAMBOUNDARY = glamboundary_box, ZAXISNAME = 'depth', PLAIN = 1 
     83            ENDIF ELSE initncdf, s_file, USEASMASK = var_local, missing_value = valmask, GLAMBOUNDARY = glamboundary_box, ZAXISNAME = 'depth' 
     84         END  
    7085      ENDCASE  
    7186      IF debug_w THEN print,  '     Grid info after initncdf :' 
     
    7489      IF debug_w THEN print,  '     gdept :', size(gdept) 
    7590       
    76 ;   ENDELSE  
     91   ENDELSE  
    7792 
    7893   varexp = varexpp 
  • trunk/procs/meshes/mesh_orca.pro

    r89 r100  
    44@com_eg 
    55; 
     6 
     7   ; temporary 
     8 
     9   IF h_config EQ 'ORCA05' THEN v_config = 'L46' 
     10   IF h_config EQ 'ORCA_R2' THEN v_config = 'L30' 
    611 
    712   IF NOT keyword_set(H_CONFIG) THEN h_config = 'ORCA_R2' 
Note: See TracChangeset for help on using the changeset viewer.