Silverfrost Forums

Welcome to our forums

Optional output argument error/bug

15 Aug 2007 11:34 #2170

I’m getting the following run-time error in one of my Win32 programs.

*** Error 14, Attempt to alter an actual argument that is a constant, an expression, an INTENT(IN) argument, or a DO variable.

I’ve constructed a small program that demonstrates the error and consists of a Main and a Module as follows.

C ------------------------------------------------------------
C DEMO.FOR
      PROGRAM DEMO

      USE Calc

      CALL DibDob()                      !<<<<<< Line 13

      PRINT *, 'Demo program has run'

      END

! -----------------------------------------------------------
! CALC.F90
MODULE Calc

  PUBLIC :: DibDob

CONTAINS

! ----------------------------------------------------------
  SUBROUTINE DibDob (lVar)                !<<<<<< Line 17
    LOGICAL, OPTIONAL, INTENT(OUT) :: lVar

    IF (PRESENT(lVar)) lVar = .TRUE.

  END SUBROUTINE

END MODULE

I’m using a recently downloaded FTN95 Personal Edition with the options /ISO /IMPLICIT_NONE /NO_SCALAR_TO_ARRAY /RESTRICT_SYNTAX /CHECKMATE /BRIEF and linking with SLINK. The run-time error information is as follows (I’ve flagged the offending lines in the above code).

CALC!DIBDOB - in file calc.f90 at line 17 [+003c] main - in file demo.for at line 13 [+003b]

The problem seems to be with the OPTIONAL argument of INTENT(OUT). Can anyone see why this causes the error?

Keith

16 Aug 2007 8:15 #2171

This bug has already been fixed. It is not a recent fix so the current release (5.10) should be OK. Make sure that you are also using the latest salflibc.dll (use saldiag.exe).

16 Aug 2007 12:16 #2172

Ah – well, there must be something wrong with the download from the Polyhedron web site since I downloaded FTN95 only a few days ago. As I reported earlier, the compiler is declared as version 5.10 on the web site but prints version 4.9.0 on the console when I run it.

I located salflibc.dll with the search tool, saldiag.exe. The dll is Version 7.11.10.11. Is this the correct version? Also, I checked my system to make sure there is no old version that was being picked up.

16 Aug 2007 12:21 #2173

The Polyhedron download appears to be out of date. You should download from the Silverfrost website.

16 Aug 2007 12:45 #2174

Which seems to be down (http://silverfrost.com/ or http://www.silverfrost.com/ - both fail). I’m not having much luck lately.

16 Aug 2007 1:59 #2175

You can grab the latest version from download.com too, the address is:

http://www.download.com/Silverfrost-FTN95/3000-2069_4-10698194.html

16 Aug 2007 4:04 #2176

That did the trick. The problem has disappeared. Thanks Paul, thanks Andrew.

Please login to reply.