Silverfrost Forums

Welcome to our forums

Error message when using Modules - array size?

6 Apr 2011 6:00 #8037

I am using the Express edition of ftn95 and looking to update some old FORTRAN77 code to ftn95.

My old programs, which contain subroutines, used COMMON blocks for common storage areas, but I understand that MODULES are the way to go.

Whilst the code compiles successfully as either COMMON or MODULE, when trying to run the program via debug, I get the error message 'Unable to launch application for this file'.

The problem seems to lie in the size of arrays I'm declaring in either the COMMON block or MODULE.

In my module I have:

  MODULE DATA_MODULE
     REAL :: Array1(10), B, Array2(3500)
     INTEGER :: Count = 0
     INTEGER, PARAMETER :: Order = 10
  END MODULE DATA_MODULE

and in the main program, the first lines of code are:

  PROGRAM ModTest
  USE DATA_MODULE

If I reduce the size of Array2 to, say, 1,000, then the program runs ok. I can also put very large arrays in the main program and it runs ok.

Assistance on where the problem lies would be much appreciated.

7 Apr 2011 12:34 #8042

The error should not relate to the size of 'Array2' as the examples you have given are very small. The problem probably relates more to errors in your code which effect the creation of the .exe file. Check your compile errors, as the link may not be taking place. Can you select to create a .map file when linking ? Also check the date stamp on the files to ensure thay are being recreated.

10 Apr 2011 5:47 #8063

Hi John,

Thanks for your prompt response and help on this. Solved the problem by switching from .NET to Win32 compiler.

Now I can use arrays of the size I need.

Please login to reply.