1 (edited by syoung 2020-05-25 21:18:11)

Topic: module

I'm a relative new user of SF and having problems in compiling a simple module unit. The program is as follows:

  module math_ module
              implicit none
              real, public, parameter:: pi = 3.141592
              real, public, parameter::  e = 2.718281
  end module math_ module

I hope you can help me. Thanks
version f03                     
ERROR: Last command (target.exe) returned bad status

Re: module

I think more of the output when compiling would help, but the code sample you provided isn't a program.  Simply Fortran was attempting to compile an executable, but there is no program in that sample.  You would probably want to create another Fortran file, add it to your project, and have it "use" your module, such as:

program doublepi
use math_module
implicit none

    Print *, "Pi times two is", 2*pi

end program doublepi
Jeff Armstrong
Approximatrix, LLC

Re: module

Thanks Jeff,  I followed your instructions and everything is ok