The HARRY_READ_ME.txt file

Part 33

33. So, as expected.. I'm gonna have to write in clauses to make use of the log, act and mat files. I so do
not want to do this.. but not as much as I don't want to do a day's interacting again!!

Got it to work.. sort of. Turns out I had included enough information in the ACT file, and so was able to
write auminmaxresync.for. A few teething troubles, but two new databases ('tm[n|x].0707301343.dtb')
created with 13654 stations in each. And yes - the headers are identical :-)

[edit: see below - the 'final' databases are tm*.0708071548.dtb]

Here are the header counts, demonstrating that something's still not quite right..

Original:
14355 tmn.0707021605.dtb.heads

New:
13654 tmn.0707301343.dtb.heads

Lost/merged:
14318 tmn.0707021605.dtb.lost.heads (should be 14355-13654-37 = 664?)
37 tmn.0707021605.dtb.merg.heads (seems low)

Original:
14315 tmx.0702091313.dtb.heads

New:
13654 tmx.0707301343.dtb.heads

Lost/merged:
14269 tmx.0702091313.dtb.lost.heads (should be 14315-13654-46 = 615?)
46 tmx.0702091313.dtb.merg.heads (seems low)

In fact, looking at the original ACT file that we used:

crua6[/cru/cruts/version_3_0/db/dtr] grep 'usermerg' act.0707241721.dat | wc -l
258
crua6[/cru/cruts/version_3_0/db/dtr] grep 'automerg' act.0707241721.dat | wc -l
889

..so will have to look at how the db1/2xref arrays are prepped and set in the program. Nonetheless the
construction of the new databases looks pretty good. There's aminor problem where the external reference
field is sometimes -999.00 and sometimes 0. Not sure which is best, probably 0, as the field will usually
be used for reference numbers/characters rather than real data values. Used an inline perl command to fix.

..after some rudimentary corrections:

uealogin1[/cru/cruts/version_3_0/db/dtr] wc -l *.heads
14355 tmn.0707021605.dtb.heads
122 tmn.0707021605.dtb.lost.heads
579 tmn.0707021605.dtb.merg.heads
13654 tmn.0708062250.dtb.heads
14315 tmx.0702091313.dtb.heads
93 tmx.0702091313.dtb.lost.heads
570 tmx.0702091313.dtb.merg.heads
13654 tmx.0708062250.dtb.heads

Almost perfect! But unfortunately, there is a slight discrepancy, and they have a habit of being tips of
icebergs. If you add up the header/station counts of the new tmin database, merg and lost files, you get
13654 + 579 + 122 = 14355, the original station count. If you try the same check for tmax, however, you get
13654 + 570 + 93 = 14317, two more than the original count! I suspected a couple of stations were being
counted twice, so using 'comm' I looked for identical headers. Unfortunately there weren't any!! So I have
invented two stations, hmm. Got the program to investigate, and found two stations in the cross-reference
array which had cross refs *and* merge flags:

ERROR: db2xref( 126) = 127 -14010 :
126> 9596400 -4110 14680 3 LOW HEAD AUSTRALIA 2000 2006 -999 91293
14010> 9596900 -4170 14710 150 CRESSY RESEARCH STAT AUSTRALIA 1971 2006 -999 91306

and

ERROR: db2xref(13948) = 227 -226 :
13948> 9570600 -3470 14650 145 NARRANDERA AIRPORT AUSTRALIA 1971 2006 -999 0
226> 0 -3570 14560 110 FINLEY (CSIRO) AUSTRALIA 2000 2001 -999 0

So in the first case, LOW HEAD has been merged with another station (#14010) AND paired with #127.
Similarly, NARRANDERA AIRPORT has been mreged with #226 and paired with #227. However, these apparent
merges are false! As we see in the first case, 14010 is not LOW HEAD. Similarly for the second case.

Looking in the relevant match file from the process (mat.0707241721.dat) we find:

AUTO MERGE FROM CHAIN:
TMax Stn 1: 0 -4110 14680 3 LOW HEAD AUSTRALIA 2000 2006 -999 -999.00
TMax Stn 2: 0 -4105 14678 4 LOW HEAD AUSTRALIA 2000 2004 -999 -999.00
New Header: 0 -4110 14680 3 LOW HEAD AUSTRALIA 2000 2006 -999 0
Note: Stn 1 data overwrote Stn 2 data

MANUAL PAIRING FROM CHAIN:
TMin: 9596400 -4110 14680 3 LOW HEAD AUSTRALIA 2000 2006 -999 91293
TMax: 0 -4110 14680 3 LOW HEAD AUSTRALIA 2000 2006 -999 0
New Header: 9596400 -4110 14680 3 LOW HEAD AUSTRALIA 2000 2006 -999 91293

and

AUTO MERGE FROM CHAIN:
TMax Stn 1: 0 -3470 14650 145 NARRANDERA AIRPORT AUSTRALIA 2000 2006 -999 -999.00
TMax Stn 2: 9570600 -3471 14651 145 NARRANDERA AIRPORT AUSTRALIA 1972 1980 -999 -999.00
New Header: 9570600 -3470 14650 145 NARRANDERA AIRPORT AUSTRALIA 1972 2006 -999 0
Note: Stn 2 data overwrote Stn 1 data

MANUAL PAIRING FROM CHAIN:
TMin: 9570600 -3470 14650 145 NARRANDERA AIRPORT AUSTRALIA 1971 2003 -999 0
TMax: 9570600 -3470 14650 145 NARRANDERA AIRPORT AUSTRALIA 1972 2006 -999 0
New Header: 9570600 -3470 14650 145 NARRANDERA AIRPORT AUSTRALIA 1971 2006 -999 0

Found the problem - mistyping of an assignment.. and so:

crua6[/cru/cruts/version_3_0/db/dtr] wc -l *.heads

14355 tmn.0707021605.dtb.heads
122 tmn.0707021605.dtb.lost.heads
579 tmn.0707021605.dtb.merg.heads
13654 tmn.0708071548.dtb.heads

14315 tmx.0702091313.dtb.heads
93 tmx.0702091313.dtb.lost.heads
568 tmx.0702091313.dtb.merg.heads
13654 tmx.0708071548.dtb.heads

Phew! Well the headers are identical for the two new databases:

crua6[/cru/cruts/version_3_0/db/dtr] cmp tmn.0708071548.dtb.heads tmx.0708071548.dtb.heads |wc -l
0


Go on to part 34, back to index or Email search