This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Question anout intent(out)
- From: dominiq at lps dot ens dot fr (Dominique Dhumieres)
- To: fortran at gcc dot gnu dot org
- Date: Mon, 09 Jun 2014 19:41:18 +0200
- Subject: Question anout intent(out)
- Authentication-results: sourceware.org; auth=none
Hi all,
Compiling the following code (extracted from SMOKE v3.5) with gfortran
SUBROUTINE RDDATAORLFR( LINE, READDATA, READPOL, NDATPERLN,
& IYEAR, DESC, SIC, MACT, CTYPE,
& LAT, LON, HDRFLAG, EFLAG )
integer, parameter :: IOVLEN3 = 3
CHARACTER(2) CRLF
INTEGER FINDC
EXTERNAL CRLF, FINDC
CHARACTER(*), INTENT (IN) :: LINE ! input line
CHARACTER(*), INTENT (OUT) :: READDATA( NDATPERLN,NPTPPOL3 )! array of data values
CHARACTER(IOVLEN3), INTENT (OUT) :: READPOL( NDATPERLN ) ! array of pollutant names
INTEGER, INTENT (OUT) :: NDATPERLN ! number of data values per line
end
gives the following errors (twice, a bug in itself)
rddatantifr.f:11.51:
CHARACTER(*), INTENT (OUT) :: READDATA( NDATPERLN,NPTPPOL3 )
1
Error: Dummy argument 'ndatperln' at (1) cannot be INTENT(OUT)
rddatantifr.f:12.52:
CHARACTER(IOVLEN3), INTENT (OUT) :: READPOL( NDATPERLN )
1
Error: Dummy argument 'ndatperln' at (1) cannot be INTENT(OUT)
g95 gives a similar error, but not pgf. AFAIU intent(out) NDATPERLN is
undefined when entering the subroutine, thus cannot be used as a dimension
for READDATA and READPOL. Is this correct?
TIA
Dominique