MODULE Lattice_Network_Optimization USE Precision USE Error_Handling USE System_Monitors USE Initialization_Termination USE Lattice_Geometry USE Network_Geometry USE Network_Graphics USE jj_i_Cost_Parameters USE Network_Spanning_Trees IMPLICIT NONE PRIVATE PUBLIC::InitializeLatticeNetworkProblem,CreateLatticeNetworkProblem,DestroyLatticeNetworkProblem CONTAINS SUBROUTINE InitializeLatticeNetworkProblem() CALL InitializeLattice CALL InitializeNetwork CALL InitializeCostParameters END SUBROUTINE InitializeLatticeNetworkProblem SUBROUTINE CreateLatticeNetworkProblem(create_tree) LOGICAL,INTENT(IN),OPTIONAL::create_tree LOGICAL::allocate_tree allocate_tree=.TRUE. IF(PRESENT(create_tree))allocate_tree=create_tree CALL StartTimer(51) CALL StartTimer(60) CALL CreateLatticeNetwork CALL StopTimer(60) CALL StartTimer(61) CALL CreateNetwork(70) CALL StopTimer(61) CALL StartTimer(62) CALL CreateCostParameters CALL StopTimer(62) IF(allocate_tree)THEN CALL InitializeSpanningTree END IF CALL StopTimer(51) WRITE(message_log_unit,"(A,F10.3)")"Creating the NO problem took (s) :",ReadTimer(51) WRITE(message_log_unit,"(A)")"Composition:____________________________________" WRITE(message_log_unit,"(A,F10.3)")" Lattice creation:",ReadTimer(60) WRITE(message_log_unit,"(A,F10.3)")" Network creation:",ReadTimer(61) WRITE(message_log_unit,"(A,F10.3)")" ______Reordering:",ReadTimer(70) WRITE(message_log_unit,"(A,F10.3)")" Costs creation :",ReadTimer(62) WRITE(message_log_unit,"(A)")"________________________________________________" END SUBROUTINE CreateLatticeNetworkProblem SUBROUTINE DestroyLatticeNetworkProblem(destroy_tree) LOGICAL,INTENT(IN),OPTIONAL::destroy_tree LOGICAL::allocate_tree allocate_tree=.TRUE. IF(PRESENT(destroy_tree))allocate_tree=destroy_tree IF(allocate_tree)THEN CALL DestroySpanningTree END IF CALL DestroyCostParameters CALL DestroyNetwork CALL DestroyLatticeNetwork END SUBROUTINE DestroyLatticeNetworkProblem END MODULE Lattice_Network_Optimization