source: trunk/SRC/ToBeReviewed/TRIANGULATION/tracecote.pro @ 327

Last change on this file since 327 was 327, checked in by pinsard, 17 years ago

modification of headers : mainly blanks around = sign for keywords in declaration of function and pro

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1;+
2;
3; @file_comments
4; Draw coasts in plt.
5;
6; @categories
7; Graphics
8;
9; @keyword SURFACE_COASTLINE
10; To draw the surface coast line instead of
11; the coast line at level firstz[tw]. Useful only for deep
12; plots!
13;
14; @keyword _EXTRA
15; Used to pass keywords
16;
17; @uses
18; common.pro
19;
20; @history
21; Sebastien Masson (smasson\@lodyc.jussieu.fr)
22;                      30/9/1999
23;
24; @version
25; $Id$
26;
27;-
28PRO tracecote, SURFACE_COASTLINE=surface_coastline, _EXTRA=ex
29;
30  compile_opt idl2, strictarrsubs
31;
32@cm_4data
33@cm_4mesh
34  IF NOT keyword_set(key_forgetold) THEN BEGIN
35@updatenew
36  ENDIF
37;--------------------------------------------------------------
38   tempsun = systime(1)         ; For key_performance
39   if n_elements(key_gridtype) EQ 0 then key_gridtype = 'c'
40;
41; We enlarge a bit the frame defined by firsts..., lasts... in order to
42; recuperate edges of the coast which are in the edging of the domain.
43;
44   tempdeux = systime(1)        ; For key_performance =2
45   firstx = 0 > (min([firstxt, firstxf])-1)
46   lastx = (max([lastxt, lastxf])+1) < (jpi-1)
47   firsty = 0 > (min([firstyt, firstyf])-1)
48   lasty = (max([lastyt, lastyf])+1) < (jpj-1)
49   nx = lastx-firstx+1
50   ny = lasty-firsty+1
51; Which vertical level choose?
52   IF keyword_set(surface_coastline) THEN firstz = 0 ELSE $
53     IF strupcase(vargrid) eq 'W' THEN firstz = firstzw ELSE firstz = firstzt
54; Attribution of the mask and of coordinates  delimiting limits of the land (coordinates f).
55   mask = tmask[firstx:lastx, firsty:lasty, firstz]
56   xf = glamf[firstx:lastx, firsty:lasty]
57   yf = gphif[firstx:lastx, firsty:lasty] ;
58   IF testvar(var = key_performance) EQ 2 THEN $
59    print, 'temps tracecote: determiner mask xf yf', systime(1)-tempdeux
60;
61   if key_gridtype EQ 'e' then onemore = xf[0, 0] gT xf[0, 1]
62; We pass in normalized coordinates to be able to become independant from the projection's
63; type choosen and from the support on which we do the drawing (screen or postscript)
64   z = convert_coord(xf[*],yf[*],/data,/to_normal)
65   xf = reform(z[0, *], nx, ny)
66   yf = reform(z[1, *], nx, ny)
67   tempvar = SIZE(TEMPORARY(z))
68;
69; Beware, following the projection, some points x or y can become NaN (see point
70; behind the earth in an orthographic projection).
71;
72; We put points to be eliminated at a very big value so that they will not pass the
73; test with distanceseuil (see further).
74;
75   if (!map.projection LE 7 AND !map.projection NE 0) $
76    OR !map.projection EQ 14 OR !map.projection EQ 15 OR !map.projection EQ 18 then begin
77      ind = where(finite(xf*yf) EQ 0)
78      IF ind[0] NE -1 THEN BEGIN
79         xf[ind] = 1e5
80         yf[ind] = 1e5
81      ENDIF
82   ENDIF
83   ind = where(xf LT !p.position[0] OR xf GT !p.position[2])
84   IF ind[0] NE -1 THEN xf[ind] = 1e5
85   ind = where(yf LT !p.position[1] OR yf GT !p.position[3])
86   IF ind[0] NE -1 THEN yf[ind] = 1e5
87   tempvar = SIZE(TEMPORARY(ind)) ; we delete ind
88;
89   case strmid(key_gridtype, 0, 1) of
90      'c':drawcoast_c, mask, xf, yf, nx, ny, _extra = ex
91      'e':drawcoast_e, mask, xf, yf, nx, ny, onemore = onemore, _extra = ex
92   endcase
93   if keyword_set(key_performance) THEN print, 'temps tracecote', systime(1)-tempsun
94   return
95end
Note: See TracBrowser for help on using the repository browser.