Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Compiler error passing user-defined array to a subroutine

$
0
0

I'm having a Fortran 77 problem passing an allocated  user-defined Type array to a subroutine.  The subroutine compiles first without errors.  The calling program complains that the actual argument differs from the dummy argument.  The array has the same Type structure in both the sub and calling program. I'm using compiler v16.0.  I'd appreciate your help with this.  

Calling program:
          type bounds
             real*8::fromth=0d0,toth=0d0,fromph=0d0,toph=0d0
          end type
          type(bounds),dimension(:),allocatable::elbounds
          integer num
          num=100
          allocate (elbounds(num))
          call sub(num,elbounds)

Subroutine:
          subroutine sub(num,elbounds)
          integer num
          type bounds
             real*8::fromth=0d0,toth=0d0,fromph=0d0,toph=0d0
          end type
       type (bounds)::elbounds(num)   


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>