Hello,
I am having a very strange problem :
OS : Win98
Compiler : Absoft ProFortran 6.0
Code :
FUNCTION WVanne(Time,N,Mod92)
C==============================================================================
C--categorie : ouvrages
C
C POSITION DES SINGULARITES EN FONCTION DU TEMPS
C==============================================================================
USE Parametres, only: Long,NSSup, zero
USE DATAW, only: ITM=>ITW,JTM=>JTW
USE SINGULARITES, only: ISS,NSS,IUV, ISRFSG, UV, CVAR
IMPLICIT NONE
C -- Le Prototype --
REAL(kind=Long) :: WVanne
REAL(kind=Long),INTENT(in) :: Time
INTEGER,INTENT(in) :: N
LOGICAL,INTENT(in) :: Mod92
C -- Les Variables --
INTEGER :: IR,IRec1,IRec2,NW
INTEGER,SAVE :: NAP=0
REAL(kind=Long),DIMENSION(NSSup),SAVE :: DWN,WN,T1,T2
character :: cmod92*1
C---------------------------------------------------------------------------
.................. cut ........
write(cmod92,'(L1)') mod92
write(9,'(3a,3e14.6,L3,i3)') ' 0_Ouvrage ',cvar(n),' :
',t1(n),time,t2(n), Mod92,isrfsg(n)
c if (cmod92.eq.'T') then
if (Mod92) then
T2(N)=-1.675E+20_Long
write(9,'(3a,3e14.6,L3,i3)') ' 1_Ouvrage ',cvar(n),' :
',t1(n),time,t2(n), Mod92,isrfsg(n)
else if (isrfsg(n).GT.0) then
T2(N)=-1.675E+20_Long
write(9,'(3a,3e14.6,L3,i3)') ' 2_Ouvrage ',cvar(n),' :
',t1(n),time,t2(n), Mod92,isrfsg(n)
else
write(9,'(3a,3e14.6,L3,i3)') ' 3_Ouvrage ',cvar(n),' :
',t1(n),time,t2(n), Mod92,isrfsg(n)
endif
............. cut .........
If I test Mod92 the code runs but does not the job correctly : it produces
the writing "0_Ouvrage ...." and "3_Ouvrage ..." even when Mod92 is true
and t2(n) keeps always the same value.
If I test (cmod92.eq.'T') the code runs well.
NB : original test is : if (mod92 .OR. (isrfsg(n).GT.0)) then ...
The only solution I have found which make the code running well is to
compile with the "static storage" option.
The change of heap or stack value does not correct the problem.
There is no problem with arrays in the write statments, the the printing
are correct.
Another solution is to test .not.Mod92 in place of Mod92 !!!
Of course the code is compiled with all optimizations turned off.
I suspect I may have some error in my code as array index overflow but the
code doesn't produce any compiler nor runtime error message and I don't no
which kind of error I have to search.
Thank you for any advice.
---------------------------------------------------------------------------
Jean-Baptiste FAURE Cemagref : Unité de Recherche Hydrologie-Hydraulique
Institut de recherche pour l’ingénierie de l’agriculture et de l’environnement
Email: [log in to unmask] -Web: http://www.lyon.cemagref.fr
Tel direct : 04 72 20 87 76 Fax : 04 78 47 78 75
Cemagref-Lyon 3bis, quai Chauveau C.P.220 69336 Lyon cedex09 FRANCE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|