[Difx-users] num_stations limit in difxcalc {External}

Adam Deller adeller at astro.swin.edu.au
Tue Sep 5 19:58:13 EDT 2023


Hi all,

I ran into an error recently where difxcalc was segfaulting on files where
calcif2 ran happily.  After some tedious investigation that I'll spare you
the details of, I believe that line 115 in difxcalc/src/d_out.f is to blame:

      Character*9 Site_c(36)

This seems to be hardcoding a variable related to the number of sites to be
36, while in the cmxst11.i include file there is a variable that seems like
it should be the maximum number of sites that is set to 81:

      Parameter(Max_Stat = 81)

(Actually the number 36 also makes an appearance on line 17 of d_out.f in a
similar variable).

The test I was running had 40 antennas.  If I update these numbers in
d_out.f from 36 to a larger value than the number of antennas in the calc
file, then everything runs happily.

So I was going to update those two lines in d_out.f to be of length
Max_stat rather than hardcoded to 36.  It seems that to do so, I need to
include the cmxst11 file prior to the declaration of the relevant variable
in the subroutine (seems logical).  Just wanted to check from someone who
knows FORTRAN better than me that that was okay, since at the moment it is
being included after all the variable declarations.  I also wondered if we
need to ensure that difxcalc checks to make sure that the number of
requested stations is not greater than max_stat - at the moment, I can't
see that such a check is being made (it certainly wasn't being made against
that hardcoded 36 number).

Cheers,
Adam

-- 
!=============================================================!
Prof. Adam Deller
Centre for Astrophysics & Supercomputing
Swinburne University of Technology
John St, Hawthorn VIC 3122 Australia
phone: +61 3 9214 5307
fax: +61 3 9214 8797
!=============================================================!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listmgr.nrao.edu/pipermail/difx-users/attachments/20230906/6bd089bc/attachment.html>


More information about the Difx-users mailing list