-1

I have been given the task of making a gui for a fortran 77 program. To do so I am using a Lahey Fujitsu compiler and wisk, which is essentially a bare bones version of winteracter . Now i am coding the gui portion in 90, to be honest right now i am coding nothing and just using the code the wisk wizard is spitting out, and am having a problem with the gui portion talking to the 77 portion.

The program consists of a main program and 14 subroutine files. The main program makes calls to all of the other subroutines, processes calculations and writes the final result to a text file. What i would like to do is make the main program a subroutine and call it from the gui or fortran 90 portion of the program, thus making the gui the main program. Is it possible to do this since much of the fortran 77 is declared implicit double precision while the fortran 90 code is implicit none? Further more in the gui portion would i have to call all of the subroutines or will the main program, that will be coverted into a subroutine, handle this?

Any help/advice would be appreciated.

If any of this is not clear, which I am sure is the case since my fortran skills are still limited, just ask me to clarify what i mean.

Thanks, Christian

wp78de
  • 18,207
  • 7
  • 43
  • 71

1 Answers1

0

I am part of a team working on a program that is written largely in Fortran 77, and that makes copious use of implicit real etc. There are, however, module files that have been added at a later stage, and those are written in Fortran 90, and they use implicit none. I don't know whether all of this can be considered good practice or not, but at least it works, and the presence of those two Fortran dialects has so far never posed any problems (or none that I can remember...). Therefore I doubt that the mix of 90 and 77 is going to give you a headache. (Just FYI, we use the Intel compiler)

I may now be overlooking something obvious, but at first glance I don't see anything wrong with your idea of turning the current main program into a subroutine of the GUI, and calling it with a number of arguments that "tell it what to do". If you go down that road, best leave as much of the old code untouched as you possibly can - have the old main program do the subroutine calling etc.

Would it not be possible, though, to construct some sort of wrapper for the old program, i.e. leave it as it is, create a separate GUI, and have that GUI call the program with the appropriate parameters? I don't have much experience in the field of GUI programming and wrapper creation though, so I cannot tell you which approach would be preferable, but this sounds like the route for which you'd have to modify least, and the old program could still be used as a standalone command line tool, which may be preferable in some cases.

canavanin
  • 2,559
  • 3
  • 25
  • 36