Hello all,
I'm working with an optimization program written in Fortran 77 and am interested in exploring the possibilities of Fortran 90 and translating my program. Since it is a rather lengthy and complicated program I'm encountering problems with the use of COMMON blocks to pass constants throughout the program. Now I understood that in Fortran 90 I can define a module e.g. "input" in which I define all constants as parameters. By stating "use input" in any other part of the program I have access to these parameters. However, some of the constants are user supplied before running the program. In the current program I call a subroutine "input" at the start of the program which defines all constants and reads the user supplied constants from an input file. Next I define a set of common blocks to be used in other parts of the program. I understand that I can define all pre-known constants (such as e.g. pi) as parameters, but is there a way to avoid the use of common blocks and still have access to the user supplied constants throughout the program?
Thanks in advance for the help.
I'm working with an optimization program written in Fortran 77 and am interested in exploring the possibilities of Fortran 90 and translating my program. Since it is a rather lengthy and complicated program I'm encountering problems with the use of COMMON blocks to pass constants throughout the program. Now I understood that in Fortran 90 I can define a module e.g. "input" in which I define all constants as parameters. By stating "use input" in any other part of the program I have access to these parameters. However, some of the constants are user supplied before running the program. In the current program I call a subroutine "input" at the start of the program which defines all constants and reads the user supplied constants from an input file. Next I define a set of common blocks to be used in other parts of the program. I understand that I can define all pre-known constants (such as e.g. pi) as parameters, but is there a way to avoid the use of common blocks and still have access to the user supplied constants throughout the program?
Thanks in advance for the help.