Is isrfsg a function, or is it an array?
0_ouvrage will be printed regardless of the value of mod92, as it is outside
the if construct.
At most only one of the executable blocks in the if construct will be
executed.
If you are seeing 3_ouvrage it means that mod92 == .false. and isrfsg(n)
.gt. 0 == .false..
Yet you say that mod92 is .true.. Is it possible that mod92 is being
changed as a side effect of a function in the line that prints 0_ouvrage? I
would try moving the write(cmod... line to after the 0_ouvrage line, and
testing again.
I notice also that your mailer has wrapped the lines in the program. Some
lines are longer than 72 chars, but the program looks like it is written in
fixed form. I don't know what the absoft compiler does with lines that are
longer than 72 characters in fixed form, but this can be a nasty source of
bugs if the compiler takes only the first 72 characters and discards the
rest.
The fact that 'static save' seems to fix the problem suggests that maybe you
have an uninitialised variable somewhere. I wonder what the internal file
write does if mod92 is not initialised?
--
!--------------------------------------------------------------------------!
! Dr Andrej Panjkov, Analyst/Programmer !
! Numerical Modelling Project, Coal Mine Engineering Group !
! CSIRO Division of Exploration and Mining !
! Queensland Centre for Advanced Technologies Tel: +61 7 3212 4693 !
! PO Box 883, Kenmore (Brisbane), Fax: +61 7 3212 4455 !
! Queensland, Australia, 4069 Mobile: 0417 551 435 !
!--------------------------------------------------------------------------!
! [log in to unmask] [log in to unmask] !
!--------------------------------------------------------------------------!
! This email is formatted for 76 character displays, using fixed fonts. !
!--------------------------------------------------------------------------!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|