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

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

improvements/corrections of some *.pro headers

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