Silverfrost Forums

Welcome to our forums

error 1148 when building a .NET-DLL

17 Aug 2017 11:54 #20029

When trying to build a .NET DLL, at the export of the following subroutine I got the message: error 1148 - Array PROPTOT is not of assumed shape, and so cannot appear as an argument to a routine containing an ASSEMBLY_INTERFACE, the subroutine starts with the following code:

SUBROUTINE STPFLASH(TIN,PIN,X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,
     &   X11,X12,X13,X14,X15,X16,X17,X18,X19,X20,X21,IUNITIN,
     &   FRAC,HTOT,STOT,UTOT,VTOT,PROPTOT,XL,XV,PROPL,PROPV,
     &   FUGL,FUGV,FUGAL,FUGAV)
C***********************************************************************
      ASSEMBLY_INTERFACE(NAME='STPFLASH')
      IMPLICIT REAL*8 (A-H,O-Z)
C      INTEGER*4 IUNITIN
      PARAMETER (MAXC=21,NAUX=16)
      PARAMETER (NPROP=24)
      DIMENSION XVEC(MAXC) , LIST(MAXC) , ZFEED(MAXC)
      DIMENSION X(MAXC) , Y(MAXC) , AUXX(NAUX) , AUXY(NAUX)
      DIMENSION FGX(MAXC) , FGY(MAXC)
      DIMENSION PROPL(NPROP) , PROPV(NPROP) , PROPTOT(NPROP)
      DIMENSION HSUVTOT(5)
      DIMENSION XL(MAXC) , XV(MAXC) , FUGL(MAXC) , FUGV(MAXC) ,
     &          FUGAL(MAXC) , FUGAV(MAXC)
C
The same error message were given for the arrays XL,XV,PROPL,PROPV,FUGL,FUGV,FUGAL,FUGAV

with the same code it was no problem to build a Win32-DLL. Any idea?
17 Aug 2017 2:06 #20031

I have had a quick look at this but I can't see what is wrong.

It might work if you make these arrays 'star-sized'. For example:

DIMENSION XL(*)
17 Aug 2017 2:33 #20032

It doesn't changed anything, if I made all those arrays star-sized, I get the error 1148 message furthermore

17 Aug 2017 4:28 #20033

The compiler is checking for assumed shape arrays of the form PROPTOT(:) or, for example, PROPTOT(1:). So this appears to be a requirement for .NET.

17 Aug 2017 4:58 #20034

I really don't understand what do you mean with (:). Is it possible to change the code for acceptance by the compiler or seems it impossible to use arrays in the parameter list of a subroutine if building a .NET-DLL?

17 Aug 2017 9:10 #20035

Yes you can modify the code to use 'assumed shape' arrays. This is a feature of the FORTRAN 90 standard. Just type 'FORTRAN assumed shape' into Google to find out what it means. Otherwise perhaps one of the Fortran experts on this forum will provide the details.

Please login to reply.