1 /*  -- translated by f2c (version 20100827).
2    You must link the resulting object file with libf2c:
3 	on Microsoft Windows system, link with libf2c.lib;
4 	on Linux or Unix systems, link with .../path/to/libf2c.a -lm
5 	or, if you install libf2c.a in a standard place, with -lf2c -lm
6 	-- in that order, at the end of the command line, as in
7 		cc *.o -lf2c -lm
8 	Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
9 
10 		http://www.netlib.org/f2c/libf2c.zip
11 */
12 
13 #include "libtinyf2c.h"
14 
15 /* Table of constant values */
16 
17 static integer c__9 = 9;
18 static integer c__1 = 1;
19 static integer c__3 = 3;
20 static real c_b11 = .15f;
21 static real c_b12 = .85f;
22 static integer c__51 = 51;
23 static integer c__15 = 15;
24 static logical c_true = TRUE_;
25 static real c_b36 = 0.f;
26 
27 /* ----------------------------------------------------------------------- */
28 /*     Copyright (C) 2000-2004 GFD Dennou Club. All rights reserved. */
29 /* ----------------------------------------------------------------------- */
MAIN__(void)30 /* Main program */ int MAIN__(void)
31 {
32     /* System generated locals */
33     real r__1;
34 
35     /* Builtin functions */
36     double exp(doublereal);
37     integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen),
38 	    e_wsle(void), s_rsle(cilist *), e_rsle(void);
39 
40     /* Local variables */
41     static integer i__, j;
42     static real z__[225]	/* was [15][15] */, cx[225]	/* was [15][
43 	    15] */, cy[225]	/* was [15][15] */, ux[15], uy[15];
44     static integer iws;
45     static real uxw[15], uyw[15];
46     extern /* Subroutine */ int grcls_(void), grfrm_(void);
47     static real cxmin, cymin, cxmax, cymax;
48     extern /* Subroutine */ int gropn_(integer *), sgplu_(integer *, real *,
49 	    real *), g2qctm_(real *, real *, real *, real *), g2sctr_(integer
50 	    *, integer *, real *, real *, real *, real *);
51     static real rundef;
52     extern /* Subroutine */ int glrget_(char *, real *, ftnlen), uetone_(real
53 	    *, integer *, integer *, integer *), uelset_(char *, logical *,
54 	    ftnlen), grswnd_(real *, real *, real *, real *), grstrf_(void),
55 	    usdaxs_(void), uwsgxa_(real *, integer *), grstrn_(integer *),
56 	    uwsgya_(real *, integer *), sgpwsn_(void), grsvpt_(real *, real *,
57 	     real *, real *), uxsttl_(char *, char *, real *, ftnlen, ftnlen);
58     static real terrain[15];
59 
60     /* Fortran I/O blocks */
61     static cilist io___9 = { 0, 6, 0, 0, 0 };
62     static cilist io___10 = { 0, 5, 0, 0, 0 };
63 
64 
65 /*     / SET PARAMETERS / */
66     glrget_("RUNDEF", &rundef, (ftnlen)6);
67     for (i__ = 1; i__ <= 15; ++i__) {
68 	ux[i__ - 1] = (i__ - 1.f) / 14.f - .5f;
69 /* Computing 2nd power */
70 	r__1 = ux[i__ - 1];
71 	terrain[i__ - 1] = exp(r__1 * r__1 * -24) * .1f;
72 /* L10: */
73     }
74     for (j = 1; j <= 15; ++j) {
75 	uy[j - 1] = (j - 1.f) / 14.f;
76 /* L15: */
77     }
78     cx[0] = rundef;
79     for (j = 1; j <= 15; ++j) {
80 	for (i__ = 1; i__ <= 15; ++i__) {
81 	    cy[i__ + j * 15 - 16] = uy[j - 1] * (1.f - terrain[i__ - 1]) +
82 		    terrain[i__ - 1];
83 /* L20: */
84 	}
85 /* L25: */
86     }
87 /*     / GRAPHIC / */
88     s_wsle(&io___9);
89     do_lio(&c__9, &c__1, " WORKSTATION ID (I) ? ;", (ftnlen)23);
90     e_wsle();
91     sgpwsn_();
92     s_rsle(&io___10);
93     do_lio(&c__3, &c__1, (char *)&iws, (ftnlen)sizeof(integer));
94     e_rsle();
95     gropn_(&iws);
96     grfrm_();
97     grsvpt_(&c_b11, &c_b12, &c_b11, &c_b12);
98     grswnd_(ux, &ux[14], uy, &uy[14]);
99     grstrn_(&c__51);
100     g2sctr_(&c__15, &c__15, ux, uy, cx, cy);
101     grstrf_();
102 /*     / TONE / */
103     for (j = 1; j <= 15; ++j) {
104 	for (i__ = 1; i__ <= 15; ++i__) {
105 	    z__[i__ + j * 15 - 16] = ux[i__ - 1] * (1 - uy[j - 1]);
106 /* L30: */
107 	}
108 /* L35: */
109     }
110     uelset_("LTONE", &c_true, (ftnlen)5);
111     uwsgxa_(ux, &c__15);
112     uwsgya_(uy, &c__15);
113     uetone_(z__, &c__15, &c__15, &c__15);
114 /*     / GRID LINES / */
115     for (j = 1; j <= 15; ++j) {
116 	for (i__ = 1; i__ <= 15; ++i__) {
117 	    uyw[i__ - 1] = uy[j - 1];
118 /* L40: */
119 	}
120 	sgplu_(&c__15, ux, uyw);
121 /* L45: */
122     }
123     for (i__ = 1; i__ <= 15; ++i__) {
124 	for (j = 1; j <= 15; ++j) {
125 	    uxw[j - 1] = ux[i__ - 1];
126 /* L50: */
127 	}
128 	sgplu_(&c__15, uxw, uy);
129 /* L55: */
130     }
131 /*     / AXES  (Switch to ITR==1) / */
132     g2qctm_(&cxmin, &cxmax, &cymin, &cymax);
133     grswnd_(&cxmin, &cxmax, &cymin, &cymax);
134     grstrn_(&c__1);
135     grstrf_();
136     usdaxs_();
137     uxsttl_("T", "TERRAIN FOLLOWING", &c_b36, (ftnlen)1, (ftnlen)17);
138     grcls_();
139     return 0;
140 } /* MAIN__ */
141 
g2pk02_()142 /* Main program alias */ int g2pk02_ () { MAIN__ (); return 0; }
143