source: trunk/procs/meshes/mesh_from_file.pro @ 2

Last change on this file since 2 was 2, checked in by post_it, 17 years ago

Initial import from ~/POST_IT/

File size: 1.1 KB
Line 
1PRO mesh_from_file, model, file_name, ncdf_db, var_name
2@common
3@com_eg
4;
5; init grid, sf from file_name
6; masks made in data_read
7;
8
9   IF strpos(ncdf_db, ':') GE 1 THEN directory = (str_sep(ncdf_db, ':'))[1] $
10    ELSE directory = ncdf_db
11
12   s_file = directory+file_name
13
14   print,' Model inits for ', model, ' from file', s_file
15
16   sm_file = hom_idl+'grids/grids_'+model+'.nc'
17   res = find(sm_file)
18
19   IF res NE 'NOT FOUND' THEN BEGIN
20
21      initncdf, s_file, GLAMBOUNDARY = glamboundary_box
22
23      IF debug_w THEN print, ' Found mask from ',sm_file
24
25      tmask = byte(read_ncdf('sftlf', 0, 0, /timestep, file = sm_file, /nostruct))
26     
27      idx = where(tmask EQ valmask)
28
29      IF idx(0) NE -1 THEN tmask(idx) = 0.
30      idx =  where(tmask LE 50.)
31      tmask(idx) = 0.
32      tmask =  tmask < 1
33      tmask =  1-tmask
34      triangles=triangule()
35
36   ENDIF ELSE BEGIN
37      initncdf, s_file, USEASMASK = var_name, GLAMBOUNDARY = glamboundary_box, ZAXISNAME = 'depth'
38   ENDELSE
39
40   IF debug_w THEN print, 'vargrid = ',vargrid
41
42   key_offset = [0, 0, 0]
43;
44; indice i pour grille j moyenne zonale
45;
46   diaznl_idx = 1
47
48  return
49END
50
Note: See TracBrowser for help on using the repository browser.