Question anout intent(out)

Dominique Dhumieres dominiq@lps.ens.fr
Mon Jun 9 17:41:00 GMT 2014


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



More information about the Fortran mailing list