Re: Passing allocatable arrays as a assumed shape argument?




<mischamegens@xxxxxxxxxxx> wrote in message
news:1193768593.615834.253630@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi all,

I tried to pass a dynamically allocated array as an assumed shape
object to a subroutine, in GFortran:

Is there something obvious that I am overlooking?

Yes, using an assumed-shape array requires the use of an explicit interface.
Make your subroutine an internal procedure to the main program OR put it
into a module that the main program USEs ("Fortran 95/2003 Explained",
Section 6.3).

Regards,

Mike Metcalf


.



Relevant Pages

  • Re: Win32 API and gfortran
    ... Call Win32 API from gfortran is possible, ... SUBROUTINE FortranSub() ... END SUBROUTINE FortranSub ...
    (comp.lang.fortran)
  • Passing allocatable arrays as a assumed shape argument?
    ... I tried to pass a dynamically allocated array as an assumed shape ... object to a subroutine, in GFortran: ... I thought that this would work, but when running (GFortran 4.3.0 on ... without any corrupted stack issues... ...
    (comp.lang.fortran)
  • Re: Allocatable arrays in derived types
    ... The thing that makes me feel a little queasy is that gfortran ... doesn't have the capability to express the stride in units ... subroutine str1 ... character), pointer:: p ...
    (comp.lang.fortran)
  • Re: fortran 90/95 standart
    ... SUBROUTINE eval ... IMPLICIT REAL ... Can you update to a newer compiler 4.0.1 is fairly in gfortran development? ... The previous version was mixing C and fortran subroutines and is not used anymore It is not a good candidate for testing a new compiler! ...
    (comp.lang.fortran)
  • Re: locating numerical differences in g77 to gFortran conversion
    ... The code comprises several hundred thousand lines of ... mostly fortran 77 code, with some ancient fortran, c and c++ thrown in. ... I've managed to build the project with gcc 4 / gFortran. ... Correct argument type on a subroutine or function call. ...
    (comp.lang.fortran)