I have the following code structure:
module optimization_mod:
module optimization_mod
use specific_funcions_mod
.
.
.
end module optmization_mod
This module solves a optimization problem.
For solving this problem.In this module I load the module
specific_funcions_mod where are defined the particular functions of the
problem that I want to solve(objective funtion,
restriction,Lagrangian,and respective gradient and hessian of some of
those functions,..).
Now If I want to use this optimization module I have only to define my
specific functions inside of the module specific_funcions_mod and to
write a program for using it, for example:
program test_prob
use optimization_mod
use specific_function_mod
.
.
.
end program test_prob
I my case I use the following compilation:
f90 -c optimization.f90
f90 -c specific_funcions.f90
f90 -o test_prob test_prob.f90 optimization.o specific_funcions.o
where
optimization and speficif_functions are the file containing the modules
optimization_mod and specific_function_mod respectively.
So if I want to solve only one problem is inmidiatly, but what about to
solve a lot of test problem in the same way?
prob_1 : specific_function1_mod
prob_2 : specific_function2_mod
prob_3 : specific_function3_mod
.
.
.
prob_n :specific_functionn_mod
Because We have to place the USE statement only at the begining of the
program is not posible to use a kind of bucle for loading each time the
specific module for each problem.
Has someone any idea about how to solve this case?
Thanks in advance,
David
--
--------------------------------
DAVID LEAL
Universidad Carlos III de Madrid
Office: 10.1.02
Tel: (34-1)-624.93.14
Fax: (34-1)-624.98.49
E-mail : [log in to unmask]
http://jupiter.uc3m.es/~david/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|