[ghemical-devel] about symtrz.f

Tommi Hassinen Tommi.Hassinen at uku.fi
Thu Aug 7 02:41:30 EDT 2008


> compile this line:
>
>       DATA TOLER,IFRA /  0.1, '????'/
>
> because it involves assignment of a string value '????' into an
> integer-type variable.

This assignment is not a problem. Only the assignment between NAMES and
IFRA (character) and JX/NAMO (integers) creates a problem.


Yes that's right. The IFRA string appears also in other subroutines in symtrz.f but there are no conflicts there. Perhaps the code was originally copy-pasted from an another subroutine and the error was left unspotted. It is also possible, if we are lucky enough, that the next line shown below:

>       IF(J1.EQ.1) NAMES=JX(1,1)

will always initialize NAMES correctly. This is just a guess, but the fact that the error has remained unfixed for 15+ years in a widely used program supports it (only a tiny bit).

Yesterday I tried to collect different versions of mopac7 source form the net but this didn't help much : I got a few different versions but there's no differences in R00010 subroutine. Also mopac6 source is too old, the source file symtrz.f does not even exist there.


> This is accepted by both g77 and gfortran (at least this version:)

Hm. But instead to comment all the lines, simply do a:

INTEGER NAMES
DATA TOLER,IFRA / 0.1, 0 /

IFRA seems to be a local variable. This is the solution I attach as
symtrz_f_1.patch.

However, there could be a different solution. From reading the source I
get the impression, that just a few other variables need to be defined
as characters too, e.g. NAMO and JX. See the other subroutines in
symtrz.f. For this case, I attached symtrz_f_2.patch.

With both patches, gfortran is satisfied and compiles.


Thanks for the patches ; I will try to find some test cases in which the R00010 subroutine really is executed, and then I will test all these possible solutions.


> $ gfortran --version
> GNU Fortran 95 (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

That's probably too old. I'm running Sid and my gfortran complains about
your code too.


Ok, then we need to fix all the complaints.

Thanks,
Tommi



More information about the ghemical-devel mailing list