This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: weird behaviour
- From: Éric Depagne <edepagne at lcogt dot net>
- To: fortran at gcc dot gnu dot org
- Cc: Brooks Moses <brooks dot moses at codesourcery dot com>
- Date: Thu, 2 Aug 2007 21:21:40 -0700
- Subject: Re: weird behaviour
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:reply-to:organization:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id:sender; b=uQHOuu8YOhUzq84ZtC8qHfP3kgj+4nrqpmYRRILYi5v0t0rn2xCn/ZBP9J60XHSf4yjhKa+VnBMhCw+bOBF8Xqrdy6ZUoM4D2cvikUDY7fkXSby3E9989fKAKEPP0TEoiX4wfsp/1y0pK84DvjfYKLqMwMlbckKJBR4x9ve1YSs=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:reply-to:organization:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id:sender; b=t2jKyDk+Ks+h3wd9Nasa6bZGdHICMzZhlSlyGMnUw/NkECKRqbbCz4GoswieOM9NOYf7xVTdU63FGp9QF0goKgQEZa/zWVOYd95sXb/0bvCxFImAEPnE6boKuNWAIsckDiMO0Xp4ZblufSdzmrRX9fZ2WeChiBQV/zJ2wyJpyX4=
- Organization: Las Cumbres Observatory
- References: <200708021931.26155.edepagne@lcogt.net> <200708022026.01478.edepagne@lcogt.net> <46B2A87A.60104@codesourcery.com>
- Reply-to: edepagne at lcogt dot net
Le Thursday 02 August 2007 21:00:58 Brooks Moses, vous avez écrit?:
> Éric Depagne wrote:
> > That's the way I call the function:
> >
> > contrib=LINE(wave,nlo,nup,hlambda,t(k),ne(k),nh1(k),nhe1(k),frac)
>
> How are these variables declared?
Unfortunately, most of them are implicit.
>
> > And that's the first lines of the function:
> > FUNCTION LINE(WAVE,NBLO,NBUP,WAVEH,T,XNE,HNORM,H1FRC,HE1FRC,DOPPLE)
> >
> > REAL KAP0,KAP0RED,KAPRED,KAP0BLUE,KAPBLUE
> > REAL*8 WAVEH,WAVE,WCON,EMERGE,WMERGE,WSHIFT,WTAIL
> > REAL*8 BLUECUT,WLBLUE,REDCUT,WLRED,EMERGEH
> > REAL*8 EHYD(100),CONTH(15)
> > REAL*4 DOPPLE
> > REAL*8 VACAIR
> > real pg
> > LOGICAL FIRST
> > SAVE
>
> In general, it's a good idea to put IMPLICIT NONE at the beginning of
> all declaration blocks, to catch undeclared variables.
I agree, but this code is not mine, and it is rougly 20000 lines long,
splitted in almost 90 files.
And some files are written in pure F77, thus rewriting them so everything is
readable is not ( unfrtunately) an option.
>
> In particular, NBLO, NBUP, T, XNE, HNORM, H1FRC, and HE1FRC are not
> declared here, and thus will get an implicit type. My guess is that
> this does not match the type that they have in the caller, and that the
> mismatch is such that the function's location for DOPPLE is off the end
> of the call stack that the caller supplies.
>
> In any case, reducing this to a minimal complete example should enable
> you to find the problem. (Steve's suggestions for warning options may
> find the problem as well, though I'm not sure of that in this case.)
I'll try his suggestion, hoping it will show the things missing.
Éric.
>
> - Brooks
--
Un clavier azerty en vaut deux
----------------------------------------------------------
Éric Depagne edepagne@lcogt.net
Las Cumbres Observatory
6740 Cortona Dr
Goleta CA, 93117
----------------------------------------------------------