This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Question anout intent(out)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]