The main program with too many subroutines and functions is existed. Some of the subroutines and functions also use subroutines, functions, and modules. I decided to write them in independent files due to clarity in the main program. Then I created an independent file as a module to collect them with the include command.
Now I have one main program and one independent file for the module. I compile the program but it shows an error. The error is about missing mentioned subroutine in the above independent file.
My question in general is: If you have a program with one main program and a number of sub-programs (subroutines, functions, and modules), which also they have sub-programs, what method do you use to assemble and run it?
I write my code in PLATO as a fortran95.
I will appreciate any comments that give me a little help and forgive me for writing shortcomings
What is the problem?
Consider the following structure. On the independent file as the main program:
MAIN PROGRAM
CALL A
CALL B
CALL C
END PROGRAM
On the independent file as the subroutine A:
SUBROUTINE A
...
END SUBROUTINE
On the independent file as the subroutine B:
SUBROUTINE B
CALL B1
CALL B2
END SUBROUTINE
---------------
SUBROUTINE B1
...
END SUBROUTINE
--------------
FUNCTION B2
...
END FUNCTION
On the independent file as the subroutine C:
SUBROUTINE C
USE C1
CALL C2
END SUBROUTINE
---------------
SUBROUTINE C1
...
END SUBROUTINE
On the independent file as the module C1:
MODULE C1
CONTAINS
SUBROUTINE C1-1
SUBROUTINE C1-2
SUBROUTINE C1-3
...
END MODULE
What I did:
I created an independent file as Module:
MODUL D
CONTAINS
INCLUDE A.F95
INCLUDE B.F95
INCLUDE C.F95
END MODULE
Consequently, for the main program:
MAIN PROGRAM
USE D
CALL A
CALL B
CALL C
END PROGRAM
What is the Error:
Warning: Missing A (File address), Missing B (File address), Missing C (File address)