PaGMO  1.1.5
snfilewrapper_PAGMO.c
1 /* snfilewrapper.f -- translated by f2c (version 20000121).
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 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
9 
10 /* snopenappend snclose snopenread */
11 
12 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
13 /* Subroutine */ int snfilewrapper_(char *name__, integer *ispec, integer *
14  inform__, char *cw, integer *lencw, integer *iw, integer *leniw,
15  doublereal *rw, integer *lenrw, ftnlen name_len, ftnlen cw_len)
16 {
17  /* System generated locals */
18  olist o__1;
19  cllist cl__1;
20 
21  /* Builtin functions */
22  integer f_open(olist *), f_clos(cllist *);
23 
24  /* Local variables */
25  extern /* Subroutine */ int snspec_(integer *, integer *, char *, integer
26  *, integer *, integer *, doublereal *, integer *, ftnlen);
27  static integer iostat;
28 
29 /* ================================================================== */
30 /* Read options for snopt from the file named name. inform .eq 0 if */
31 /* successful. */
32 
33 /* 09 Jan 2000: First version of snfilewrapper. */
34 /* ================================================================== */
35  /* Parameter adjustments */
36  cw -= 8;
37  --iw;
38  --rw;
39 
40  /* Function Body */
41  o__1.oerr = 1;
42  o__1.ounit = *ispec;
43  o__1.ofnmlen = name_len;
44  o__1.ofnm = name__;
45  o__1.orl = 0;
46  o__1.osta = "old";
47  o__1.oacc = 0;
48  o__1.ofm = 0;
49  o__1.oblnk = 0;
50  iostat = f_open(&o__1);
51  if (0 != iostat) {
52  *inform__ = iostat + 2;
53  } else {
54  snspec_(ispec, inform__, cw + 8, lencw, &iw[1], leniw, &rw[1], lenrw,
55  (ftnlen)8);
56  cl__1.cerr = 0;
57  cl__1.cunit = *ispec;
58  cl__1.csta = 0;
59  f_clos(&cl__1);
60  }
61  return 0;
62 } /* snfilewrapper_ */
63 
64 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
65 /* subroutine snfilewrapper */
66 /* Subroutine */ int snopenappend_(integer *iunit, char *name__, integer *
67  inform__, ftnlen name_len)
68 {
69  /* System generated locals */
70  olist o__1;
71 
72  /* Builtin functions */
73  integer f_open(olist *);
74 
75 /* ================================================================== */
76 /* Open file named name to Fortran unit iunit. inform .eq. 0 if */
77 /* sucessful. Although opening for appending is not in the f 77 */
78 /* standard, it is understood by f2c. */
79 
80 /* 09 Jan 2000: First version of snoptopenappend */
81 /* ================================================================== */
82  o__1.oerr = 1;
83  o__1.ounit = *iunit;
84  o__1.ofnmlen = name_len;
85  o__1.ofnm = name__;
86  o__1.orl = 0;
87  o__1.osta = 0;
88  o__1.oacc = "append";
89  o__1.ofm = 0;
90  o__1.oblnk = 0;
91  *inform__ = f_open(&o__1);
92  return 0;
93 } /* snopenappend_ */
94 
95 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
96 /* subroutine snoptopenappend */
97 /* Subroutine */ int snclose_(integer *iunit)
98 {
99  /* System generated locals */
100  cllist cl__1;
101 
102  /* Builtin functions */
103  integer f_clos(cllist *);
104 
105 /* ================================================================== */
106 /* Close unit iunit. */
107 
108 /* 09 Jan 2000: First version of snoptclose */
109 /* ================================================================== */
110  cl__1.cerr = 0;
111  cl__1.cunit = *iunit;
112  cl__1.csta = 0;
113  f_clos(&cl__1);
114  return 0;
115 } /* snclose_ */
116 
117 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
118 /* subroutine snoptclose */
119 /* Subroutine */ int snopenread_(integer *iunit, char *name__, integer *
120  inform__, ftnlen name_len)
121 {
122  /* System generated locals */
123  olist o__1;
124 
125  /* Builtin functions */
126  integer f_open(olist *);
127 
128 /* ================================================================== */
129 /* Open file called name to Fortran unit iunit. inform .eq. 0 if */
130 /* sucessful. Although opening for appending is not in the f77 */
131 /* standard, it is understood by f2c. */
132 
133 /* 09 Jan 2000: First version of npopenread */
134 /* ================================================================== */
135  o__1.oerr = 1;
136  o__1.ounit = *iunit;
137  o__1.ofnmlen = name_len;
138  o__1.ofnm = name__;
139  o__1.orl = 0;
140  o__1.osta = "OLD";
141  o__1.oacc = 0;
142  o__1.ofm = "FORMATTED";
143  o__1.oblnk = 0;
144  *inform__ = f_open(&o__1);
145  return 0;
146 } /* snopenread_ */
147