1 /* zzaxxx.f -- translated by f2c (version 19961017).
2 You must link the resulting object file with the libraries:
3 -lf2c -lm (in that order)
4 */
5
6 #include "f2c.h"
7
8 /* Common Block Declarations */
9
10 extern struct {
11 real xpgmin, ypgmin, xpgmax, ypgmax, xclbot, yclbot, xcltop, ycltop, xbot,
12 ybot, xtop, ytop, xmin, ymin, xmax, ymax;
13 integer ixcoor, iycoor;
14 real alphxx, betaxx, alphyy, betayy, tmajx, tminx, tmajy, tminy;
15 integer majrx, minrx, majry, minry, isizx, isizy;
16 real xphold, yphold;
17 } zzzplt_;
18
19 #define zzzplt_1 zzzplt_
20
21 extern struct {
22 real xphmax, yphmax;
23 integer ixpmax, iypmax;
24 real xpscal, ypscal;
25 integer iflip, nplotr;
26 char cfile[64];
27 } zzpltr_;
28
29 #define zzpltr_1 zzpltr_
30
31 /* Table of constant values */
32
33 static integer c__1 = 1;
34 static integer c__0 = 0;
35
36 /* ======================================================================= */
37 /* Routines that start with ZZ are internal utility routines: */
38
39
40
zzaxxx_(real * x1,real * x2,real * y,integer * iside,integer * ilab)41 /* Subroutine */ int zzaxxx_(real *x1, real *x2, real *y, integer *iside,
42 integer *ilab)
43 {
44 /* Format strings */
45 static char fmt_101[] = "(\0021.E\002,i2)";
46 static char fmt_102[] = "(\0021.E\002,i3)";
47
48 /* System generated locals */
49 integer i__1, i__2;
50 real r__1, r__2;
51 static char equiv_0[10];
52
53 /* Builtin functions */
54 integer s_wsfi(icilist *), do_fio(integer *, char *, ftnlen), e_wsfi(void)
55 ;
56
57 /* Local variables */
58 static integer ndec, nlab;
59 #define buf10 (equiv_0)
60 static real ylab, temp, dxlab;
61 static integer nchar, il;
62 static real xv, xx, yy;
63 extern /* Subroutine */ int zzlgin_(real *, real *, integer *);
64 static integer nl1, nl2;
65 extern /* Subroutine */ int zzlabl_(real *, char *, integer *, ftnlen);
66 static integer npower;
67 extern /* Subroutine */ int pwritf_(real *, real *, char *, integer *,
68 integer *, integer *, integer *, ftnlen), zzlogx_(real *, real *,
69 real *, integer *, real *, real *), zzlinx_(real *, real *, real *
70 , integer *, real *, integer *, real *);
71 static real xv1, xv2, xx1, xx2;
72 extern /* Subroutine */ int zzphys_(real *, real *);
73 #define buf (equiv_0)
74 static real dxv;
75
76 /* Fortran I/O blocks */
77 static icilist io___20 = { 0, buf10, 0, fmt_101, 10, 1 };
78 static icilist io___21 = { 0, buf10, 0, fmt_102, 10, 1 };
79
80
81
82 /* Draw an axis in the x-direction from (X1,Y) to (X2,Y) [user coords]
83 */
84 /* with the specified divisions and tics. If ISIDE is positive, the */
85 /* tic marks appear in the +y direction and the labels in the -y */
86 /* direction from the axis. If ILAB = 0, no labels are drawn. */
87 /* .......................................................................
88 */
89
90 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
91 */
92
93 /* Internal Data for PLOTPAK */
94
95 if (*x1 == *x2) {
96 goto L8000;
97 }
98
99 xv1 = dmin(*x1,*x2);
100 xv2 = dmax(*x1,*x2);
101
102 /* For log x-axis, must push lower value of X down and upper value of */
103 /* X up to powers of 10. */
104
105 if (zzzplt_1.ixcoor < 0) {
106 zzlgin_(&xv1, &xv1, &nl1);
107 temp = xv2;
108 zzlgin_(&temp, &xv2, &nl2);
109 if (xv2 <= temp * .999f) {
110 xv2 *= 10.f;
111 ++nl2;
112 }
113 ndec = nl2 - nl1;
114 if (ndec <= 0) {
115 goto L8000;
116 }
117 }
118 /* .......................................................................
119 */
120 /* Convert to physical coordinates and plot axes */
121
122 xx1 = xv1;
123 xx2 = xv2;
124 yy = *y;
125 zzphys_(&xx1, &temp);
126 zzphys_(&xx2, &yy);
127
128 if (zzzplt_1.ixcoor >= 0) {
129 r__1 = *iside * zzzplt_1.tmajx;
130 r__2 = *iside * zzzplt_1.tminx;
131 zzlinx_(&xx1, &xx2, &yy, &zzzplt_1.majrx, &r__1, &zzzplt_1.minrx, &
132 r__2);
133 } else {
134 r__1 = *iside * zzzplt_1.tmajx;
135 r__2 = *iside * zzzplt_1.tminx;
136 zzlogx_(&xx1, &xx2, &yy, &ndec, &r__1, &r__2);
137 }
138 /* .......................................................................
139 */
140 /* Plot labels */
141
142 if (*ilab == 0) {
143 goto L8000;
144 }
145
146 if (zzzplt_1.ixcoor >= 0) {
147 nlab = zzzplt_1.majrx;
148 } else {
149 nlab = ndec;
150 }
151
152 dxlab = (xx2 - xx1) / nlab;
153 ylab = yy - *iside * .0011f * zzzplt_1.isizx * (zzzplt_1.xpgmax -
154 zzzplt_1.xpgmin);
155
156 if (zzzplt_1.ixcoor >= 0) {
157 dxv = (xv2 - xv1) / nlab;
158 }
159
160 i__1 = nlab;
161 for (il = 0; il <= i__1; ++il) {
162 if (zzzplt_1.ixcoor >= 0) {
163 xv = xv1 + il * dxv;
164 /* Computing MIN */
165 r__1 = dabs(xv1), r__2 = dabs(xv2);
166 if (dabs(xv) <= dmin(r__1,r__2) * 1e-5f) {
167 xv = 0.f;
168 }
169 zzlabl_(&xv, buf, &nchar, 1L);
170 } else {
171 npower = nl1 + il;
172 if (abs(npower) < 10) {
173 s_wsfi(&io___20);
174 do_fio(&c__1, (char *)&npower, (ftnlen)sizeof(integer));
175 e_wsfi();
176 nchar = 5;
177 } else {
178 s_wsfi(&io___21);
179 do_fio(&c__1, (char *)&npower, (ftnlen)sizeof(integer));
180 e_wsfi();
181 nchar = 6;
182 }
183 if (*(unsigned char *)&buf[3] == ' ') {
184 *(unsigned char *)&buf[3] = '+';
185 }
186 }
187 xx = xx1 + il * dxlab;
188 i__2 = -nchar;
189 pwritf_(&xx, &ylab, buf, &i__2, &zzzplt_1.isizx, &c__0, &c__0, 1L);
190 /* L100: */
191 }
192 /* .......................................................................
193 */
194 L8000:
195 return 0;
196 } /* zzaxxx_ */
197
198 #undef buf
199 #undef buf10
200
201
202