dynamic allocation in fortran90



I try to build mex files using Fortran90 computational
routines. It all works fine until I try to do

real*8,allocatable,dimension(:)::myvariable
....
allocate (myvariable(100)) !or something like that
which causes run-time crashes. The Fortran compiler is g95 and
gcc4.2.2 is used, OS being CentOS 4.4 x86_64. First, I assumed
that there were compatibility issues btw the compiler and
the gcc-version, but then I found a suggestion that dynamic
allocation in subroutines should be avoided when using f90
and mex.
Does anyone have relevant experiences/suggestions?

Cheers, Martin
.



Relevant Pages

  • Re: dynamic allocation in fortran90
    ... allocate )!or something like that ... The Fortran compiler is g95 and ... it not being in the Matlab doc on Fortran mex-files. ...
    (comp.soft-sys.matlab)
  • allocatable function return
    ... Is it legal or sensible to declare (array) function results as ... I was curious, as I'm implementing a Fortran compiler, ... allocate(a(sz)) ... end function zot ...
    (comp.lang.fortran)
  • Fortran Compiler Access in Matlab
    ... I want convert few fortran fils in mex files so that I can ... I typed mex -setup which detects the ... Fortran Compiler which i have already installed on my ...
    (comp.soft-sys.matlab)
  • MEX file
    ... My program involves using 2 MEX files. ... Since I couldn't allocate such a huge matrix size, I have used the following method: ... When executing I get segmentation violation error randomly. ...
    (comp.soft-sys.matlab)