This is a tricky one: I have to maintain 2 versions of an F90 code consisting of ~11000 lines. The only difference between those versions is as follows:
Main program of version A contains an IF block which checks existence or non-existence of a certain file, opens the file, reads it and checks its conten and finally closes the file again. Something like this:
Now to the weird problem: Version B which does _NOT_ include the above statements crashes in a subroutine where arrays are allocated, some allocate statements return istat/=0. The above code has NOTHING to do with the array, in fact it has NOTHING to do with the remainder of the code at all.
Any help would be greatly appreciated.
Main program of version A contains an IF block which checks existence or non-existence of a certain file, opens the file, reads it and checks its conten and finally closes the file again. Something like this:
Code:
ex = .false.
INQUIRE (file = installdir(1:length)//'some_file',exist=ex)
IF (.NOT.ex) THEN
PRINT*,' ERROR 1007: some_file missing'
ELSE
OPEN (33,FILE=installdir(1:length)//'some_file',STATUS='old',ACTION='read')
READ (33,'(A)') TestString
CLOSE (33)
IF (TestString .NE. 'teststring') THEN
PRINT*,' ERROR 1008: some_file invalid'
ENDIF
ENDIF
Now to the weird problem: Version B which does _NOT_ include the above statements crashes in a subroutine where arrays are allocated, some allocate statements return istat/=0. The above code has NOTHING to do with the array, in fact it has NOTHING to do with the remainder of the code at all.
Any help would be greatly appreciated.