source: trunk/procs/def_box.pro @ 12

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

Initial import from ~/POST_IT/

File size: 1.3 KB
Line 
1FUNCTION def_box, plt, dimplot, boxdef, stride
2@common
3@com_eg
4;
5; find hovmoeller box in Defaults file
6;
7   plt_test = plt
8   IF strpos(plt, '@') GT 1 THEN BEGIN
9      plt_test = strmid(plt, 0, strpos(plt, '@'))
10   ENDIF
11   CASE strmid(plt_test, 0, 2) OF
12      'xy': boxdef = strmid(plt_test, 3, strlen(plt_test)-3)
13      'z_': boxdef = strmid(plt_test, 2, strlen(plt_test)-2)
14      'zt': boxdef = strmid(plt_test, 3, strlen(plt_test)-3)
15      ELSE: boxdef = strmid(plt_test, dimplot+1, strlen(plt_test)-(dimplot+1))
16   ENDCASE
17
18   IF strmid(boxdef, 0, 1) EQ '#' THEN boxdef = 'default'
19
20   IF boxdef NE 'default' AND boxdef NE '' THEN BEGIN
21
22      file_b = hom_def+'domain_boxes.def'
23     
24      spawn, 'grep -i " '+boxdef+' " '+file_b, line
25      line = strcompress(strtrim(line[0], 2))
26      length = strlen(line)
27     
28      IF length EQ 0 THEN BEGIN
29         
30         print, '  *** Box ', boxdef, ' not found in file '
31         print, file_b
32         return, -1
33         
34      ENDIF ELSE BEGIN 
35         argvar = str_sep(line, ' ')
36         box = argvar[1]
37         box = float(str_sep(argvar[1], '/'))
38         stride = long(argvar[2])
39      ENDELSE
40
41   ENDIF ELSE BEGIN
42      box = box_h
43      stride = def_stride
44   ENDELSE
45     
46   IF boxdef EQ 'default' THEN boxdef = 'global'
47
48   return, box
49END
50   
Note: See TracBrowser for help on using the repository browser.