This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
error with function declaration
- From: Marcello Vichi <vichi at bo dot ingv dot it>
- To: fortran at gcc dot gnu dot org
- Date: Sat, 25 Aug 2007 01:14:02 +0200
- Subject: error with function declaration
- Organization: CMCC-INGV
Dear all,
hope someone can help me with this problem that's driving me mad...
I am currently porting a scientific software for biogeochemistry
simulations to gfortran. For those of you who are interested in this
stuff, check www.bo.ingv.it/bfm
Compilation is fine both with Portland, ifort (on linux and mac) and F90
compilers on NEC SX machines.
However, I get an error with gfortran (linux and mac) when I have
functions declared in this way
REAL(RLEN) FUNCTION BESS_EXP(X,LAMBDA,FN)
USE global_mem, ONLY:RLEN
USE constants
IMPLICIT NONE
...
where RLEN is declared as
MODULE global_mem
INTEGER, PARAMETER :: RLEN=kind(1.D0)
...
The reported error is:
REAL(RLEN) FUNCTION BESS_EXP(X,LAMBDA,FN)
1
Error: Parameter 'rlen' at (1) has not been declared or is a variable,
which does not reduce to a constant expression
I've never had problems with the other compilers up to now. I can
overcome this by declaring the function name in the preamble
REAL(RLEN) :: BESS_EXP
but I have quite many of them, and moreover this kind of declaration
should be standard since f90
Does anyone have an idea of what I'm doing wrong?
Many thanks in advance
Marcello
--
>>> NOTE THE CHANGE OF ADDRESS AND TELEPHONE NUMBER <<<
Dr Marcello Vichi
Centro Euro-Mediterraneo per i Cambiamenti Climatici (CMCC)
Istituto Nazionale di Geofisica e Vulcanologia (INGV)
Via Aldo Moro 44, 40127 Bologna. Italy
Tel: +39 051 3782631 Fax: +39 051 3782654
Email: marcello.vichi@cmcc.it, vichi@bo.ingv.it
skype: marcello_vichi