Bug in PHMDGEO

There is an (undocumented) limitation in the length of lines in an AgSTAR geometry file.  Any line longer than 122 characters is trucacted at 122 characters.  Violation of this limit is frequently uncovered when the line gets split in a place which creates a syntax error... e.g. in the middle of a variable, in an expression enclosed in parentheses etc...  In the PMD geometry, we got unlucky.  There are two lines which exceed 122 characters, and in both cases the truncated lines are pefectly legal mortran statements.  These lines are:

0231 |                if (Itype==1) xpos=xpos + xsize + SizeN(pmdg_Ny(Itype))- 11.*pmdg_boundary/(4.*root32)-pmdg_CELL_RADIUS*2./3.  
0301 |                if (Itype==5) xpos1 = xpos1+2.*xsize1-xsize+ SizeN(pmdg_Mx(Itype-1))/2.-ysize +3*pmdg_boundary*root32+2.25*pmdg_th_air 

The line number is on the far left.  The part of the lines which get truncated are highlighted in RED.

This results in two volumes in the PMD being shifted with-respect to their intended location.  There is at least one clear overlap introduced.

AgML does _not_ respect the formatting of the original files (whitespace, indentation, etc...), and is therefore incapable of reproducing the bug with the original source code.  The two lines have been edited in the AgML files, along with some comments explaining the difference from the original file.

 

Here is a list of the geometry files and the maximum line width for each of them.  For those with width > 122, I will check what the line is and determine if there is a problem or not...

bbcmgeo.g 94
btofgeo.g 82
btofgeo1.g 82
btofgeo2.g 94
btofgeo3.g 94
btofgeo4.g 160 ==> Due to Fortran end of line comment (!)
btofgeo5.g 109
btofgeo6.g 111
btofgeo7.g 111
calbgeo.g 82
calbgeo1.g 80
calbgeo2.g 101
calbpar.g 79
etsphit.g 79
cavegeo.g 122
dummgeo.g 80
ecalgeo.g 83
ecalgeo6.g 158 ==> comments and/or whitespace
fgtdgeo.g 100
fgtdgeo1.g 120
fgtdgeo2.g 106
fgtdgeo3.g 104
fhcmgeo.g 99
ffpdstep.g 76
fpdmgeo.g 104
fpdmgeo1.g 99
fpdmgeo2.g 99
fpdmgeo3.g 128 ==> comments and/or whitespace
fscegeo.g 108
fstdgeo.g 102
ftpcgeo.g 80
ftpcgeo1.g 80
ftrogeo.g 96
gembgeo.g 99
geometry.g 135  ==> comments and/or whitespace
hpdtgeo.g 106
igtdgeo.g 100
istbgeo.g 91
istbgeo00.g 96
istbgeo1.g 190  ==> in POSITION statement which is handled differently
istbgeo2.g 190
istbgeo3.g 190
istbgeo4.g 190
istbgeo5.g 190
istbgeo6.g 190
itspgeo.g 93
magpgeo.g 81
mflddat.g 81
mfldgeo.g 80
mfldmap.g 65
mutdgeo.g 103
mutdgeo2.g 100
mutdgeo3.g 117
mutdgeo4.g 106
phmdgeo.g 128   ==> The subject of this note...
pipegeo.g 91
pipegeo00.g 88
pixlgeo.g 93
pixlgeo00.g 85
pixlgeo1.g 93
pixlgeo2.g 93
pixlgeo3.g 106
quadgeo.g 96
richgeo.g 84
scongeo.g 93
shldgeo.g 95
sisdgeo.g 109
sisdgeo1.g 111
sisdgeo2.g 114
sisdgeo3.g 114
sisdgeo4.g 114
sisdgeo5.g 114
sisdgeo6.g 114
supogeo.g 84
supogeo1.g 84
svttgeo.g 81
svttgeo1.g 81
svttgeo10.g 115
svttgeo11.g 120
svttgeo2.g 106
svttgeo3.g 106
svttgeo4.g 106
svttgeo5.g 106
svttgeo6.g 111
svttgeo7.g 110
svttgeo9.g 106
tpcegeo.g 96
tpcegeo1.g 96
tpcegeo2.g 96
tpcegeo3.g 164   ==> comments
tpcegeo3a.g 123  ==> comments
upstgeo.g 80
vpddgeo.g 100
vpddgeo1.g 100
vpddgeo2.g 173 ==> comments
wallgeo.g 134  ==> comments
zcalgeo.g 78

 

Soo... looks like only the PMD geometry got unlucky with this bug.