1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
|
include <time.h>
include "debug.h"
# DG_DCATDAT - Dump catalog data symbol table
procedure dg_dcatdat (label, ctable, nvars)
char label[ARB] # string label
pointer ctable # catalog data symbol table
int nvars # number of catalog variables
int n
int fd
pointer sym
bool clgetb()
int open()
pointer sthead(), stnext(), stname()
begin
# Debug ?
if (!clgetb ("debug.cattable"))
return
# Open the dump file.
iferr (fd = open (DUMPFILE, APPEND, TEXT_FILE))
return
# Log the time.
call dg_ptime (fd, label)
# Test the pointer.
if (ctable == NULL) {
call fprintf (fd, "dg_dcatat: Null table pointer\n")
call close (fd)
return
}
# Print the title.
call fprintf (fd, "dg_dcatdat: (ctable=%d) (nvars=%d)\n")
call pargi (ctable)
call pargi (nvars)
# Print the values in reverse order.
sym = sthead (ctable)
while (sym != NULL) {
# Print the matching name.
call fprintf (fd, "%d: (%s) ")
call pargi (sym)
call pargstr (Memc[stname (ctable, sym)])
# Print the indices.
do n = 1, nvars {
call fprintf (fd, "%g ")
call pargr (Memr[P2R(sym + n - 1)])
}
# Skip one line.
call fprintf (fd, "\n")
# Advance to the next symbol.
sym = stnext (ctable, sym)
}
# Close the file.
call close (fd)
end
# DG_DCATOBS - Dump the catalog observation table.
procedure dg_dcatobs (label, otable)
char label[ARB] # string label
pointer otable # observation table
int fd
int row, col
bool clgetb()
int open()
int mct_nrows(), mct_maxcol(), mct_ncols()
real mct_getr()
begin
# Debug ?
if (!clgetb ("debug.obstable"))
return
# Open the dump file.
iferr (fd = open (DUMPFILE, APPEND, TEXT_FILE))
return
# Log the time.
call dg_ptime (fd, label)
# Test the table pointer.
if (otable == NULL) {
call fprintf (fd, "dg_dcatobs: Null observation table pointer\n")
call close (fd)
return
}
# Print the title.
call fprintf (fd,
"dg_dcatobs: (otable=%d) (maxcols=%d) (nrows=%d) (ncols=%d\n")
call pargi (otable)
call pargi (mct_maxcol (otable))
call pargi (mct_nrows (otable))
call pargi (mct_ncols (otable))
# Loop over all data in the table.
do row = 1, mct_nrows (otable) {
# Print the running number.
call fprintf (fd, "%3d : ")
call pargi (row)
# Print the values.
do col = 1, mct_maxcol (otable) {
call fprintf (fd, "%g ")
call pargr (mct_getr (otable, row, col))
}
# Skip one line.
call fprintf (fd, "\n")
}
# Close the file.
call close (fd)
end
# DG_DREF - Dump the reference table.
procedure dg_dref (label, rtable)
char label[ARB] # string label
pointer rtable # reference table
int n
int fd
bool clgetb()
int open()
int mct_nrows(), mct_maxcol(), mct_ncols()
real mct_getr()
begin
# Debug ?
if (!clgetb ("debug.reftable"))
return
# Open the dump file.
iferr (fd = open (DUMPFILE, APPEND, TEXT_FILE))
return
# Log the time.
call dg_ptime (fd, label)
# Test the pointer.
if (rtable == NULL) {
call fprintf (fd, "dg_dref: Null reference table pointer\n")
call close (fd)
return
}
# Print the title.
call fprintf (fd,
"dg_dref: (rtable=%d) (maxcols=%d) (nrows=%d) (ncols=%d)\n")
call pargi (rtable)
call pargi (mct_maxcol (rtable))
call pargi (mct_nrows (rtable))
call pargi (mct_ncols (rtable))
# Print the values.
do n = 1, mct_nrows (rtable) {
call fprintf (fd, "%d: %g\n")
call pargi (n)
call pargr (mct_getr (rtable, n, 1))
}
# Close the file.
call close (fd)
end
# DG_DWEIGHTS - Dump the weight table.
procedure dg_dweights (label, wtable)
char label[ARB] # string label
pointer wtable # weight table
int n
int fd
bool clgetb()
int open()
int mct_nrows(), mct_maxcol(), mct_ncols()
real mct_getr()
begin
# Debug ?
if (!clgetb ("debug.wtstable"))
return
# Open the dump file.
iferr (fd = open (DUMPFILE, APPEND, TEXT_FILE))
return
# Log the time.
call dg_ptime (fd, label)
# Test the table pointer.
if (wtable == NULL) {
call fprintf (fd, "dg_dweight: Null weight table pointer\n")
call close (fd)
return
}
# Print the title.
call fprintf (fd,
"dg_dweight: (wtable=%d) (maxcols=%d) (nrows=%d) (ncols=%d)\n")
call pargi (wtable)
call pargi (mct_maxcol (wtable))
call pargi (mct_nrows (wtable))
call pargi (mct_ncols (wtable))
# Print the values.
do n = 1, mct_nrows (wtable) {
call fprintf (fd, "%d: %g\n")
call pargi (n)
call pargr (mct_getr (wtable, n, 1))
}
# Close the file.
call close (fd)
end
|