Question: How do I use Fortran array in MATFOR programs? Answer: To use Fortran Arrays in MATFOR programs, you only need to make mfArray equivalent to Fortran Arrays by calling mfEquiv(). For example real(8) :: A(3,3) type (mfArray) :: mA mA= mfEquiv(A) ... call msPlot(mA,...) The idea is that the two variables will share the same memory location but under conditions where Fortran variable is explicitly declared (not a temporary variable) and the restricted mfArray cannot be used as a returned argument in functions or subroutines. You may call msFreeArgs() to deallocate mfArray, but Fortran variable will still be valid and usable. (The use of traditional assignment operator `=` often leads to stack memory overflow for insufficiently allocated stack memory. MATFOR caters to the needs of programmers who work interchangeably between mfArray and Fortran Arrays.) |