[comp.lang.fortran] Read dimension, corrected

u714092@mustang.larc.nasa.gov (prichard devon ) (02/26/91)

sorry, my last article got scrambled; network problems here ...
here is what I meant to post;

      xiaofei@acsu.buffalo.edu (Xiaofei Wang) writes:

      >main program 
      >parameter(m=10,n=5)
      >real a(m,n)
      >call subroutine(a,b)
      >end

      >I don't want to put m=10 n=5 to the program, I would like to
      >read into the program. so that I don't have to change program
      >every time. However a(m,n) has to be defined before read. 
      >-- 

   the method suggested by local computer folk is to have a Fortran
   main program call a C function which dynamically allocates an array,
   then calls a Fortran program.  the main Fortran program is needed to get
   Fortran I/O and other utility code loaded and accessible run-time.

   I haven't tried this yet, but it oughta work.  its definitely the simplest
   method for dynamic array allocation I've seen.  of course, there may be
   funny memory conflicts due to linking Fortran and C code...


--
 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 | Devon Prichard                "The atrocious crime of being a young  |
 | u714092@eagle.larc.nasa.gov,   man... I shall neither attempt to     |
 | prichard@ias.larc.nasa.gov     palliate nor deny."                   |
 |                                William Pitt, House of Commons, 1741  |
 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||