FGD trace dump is screwed up
Brought to you by:
billmenger,
seismick
FGD does a trace header dump of 100 traces. As it dumps too many headers to fit in 132 columns, it does 2 groups of headers.
The first group I call headers 2 to 59 is mostly coordinates. The second group I call 7 to 47 is mostly grid locations and shotpoints.
The first (2-59) is not aligned with the annotation. The second group (7-47) is aligned. On closer examination it is actually dumping
the headers 2-59 twice, so that is why it does not match the annotation which is for 7-47.
fgd.f90 uses some of the routines in tdmp.f90 for this, and I do not know which source file has the bug.
FGD is innocent. I blame and shame TDMP. FGD calls TDMP twice. A job with 2 TDMP processes has the same symptoms. The output is repeated using parameters of the second call to TDMP.
Now TDMP used to work 5 years ago! Why? The comments in tdmp.f90 of 2011/6/9 note:
"Removed fortran I/O and replaced with cpsio"
Well, Fortran creates different filenames for scratch files. Now there is a fixed filename for the scratch file. So the scratch file is overwritten, then copied twice to stdout in wrapup phase. So we need distinct filenames. It also appears the getlun() for dump_lun was commented out. The bug can be patched by opening the scratch files like this:
Replace these lines:
with these:
The above is in the subroutine tdmp_update between the execute_only comments. Also need to declare "lunc" as character(LEN=3).
After editing tdmp.f90, make icps then make cfe.
And rejoice, TDMP and FGD will dump headers properly again.
This was fixed years ago and can be closed.