@@ -57,7 +57,7 @@ PROGRAM ActiveContractionExample
5757
5858 INTEGER (CMISSIntg) :: EquationsSetIndex
5959 INTEGER (CMISSIntg) :: NumberOfComputationalNodes,NumberOfDomains,ComputationalNodeNumber
60- INTEGER (CMISSIntg) :: D, E, N, I
60+ INTEGER (CMISSIntg) :: D, E, N, I, num_args, ix
6161
6262 REAL (CMISSRP) :: TMP
6363 REAL (CMISSRP), DIMENSION (1 :7 ) :: COSTA_PARAMS = [ 0.2 , 30.0 , 12.0 , 14.0 , 14.0 , 10.0 , 18.0 ] ! a bff bfs bfn bss bsn bnn
@@ -87,6 +87,8 @@ PROGRAM ActiveContractionExample
8787 TYPE (cmfe_NodesType) :: CMNodes
8888 TYPE (cmfe_ControlLoopType) :: ControlLoop
8989
90+ character (len= 256 ), dimension (:), allocatable :: args
91+
9092 ! Generic CMISS variables
9193 INTEGER (CMISSIntg) :: Err
9294
@@ -104,12 +106,27 @@ PROGRAM ActiveContractionExample
104106 CALL cmfe_ComputationEnvironment_WorldNodeNumberGet(computationEnvironment,computationalNodeNumber,Err)
105107
106108
107- ! open(unit = 2, file = "./input/hollowcylq-221.in")
108- ! open(unit = 3, file = "./input/hollowcylq-221.in.gpactiv")
109- open (unit = 2 , file = " ./lvq-842.in" )
110- open (unit = 3 , file = " ./lvq-842.in.gpactiv" )
111- call read_mesh(2 , Elements, Nodes, DirichletConditions, Fibers)
112- call read_activation_times(3 , ActivationTimes)
109+ num_args = command_argument_count()
110+ allocate (args(num_args))
111+
112+ DO ix = 1 , num_args
113+ CALL get_command_argument(ix,args(ix))
114+ END DO
115+
116+ IF (num_args .gt. 0 ) THEN
117+ open (unit = 2 , file = args(1 ))
118+ ELSE
119+ ! open(unit = 2, file = "./input/hollowcylq-221.in")
120+ open (unit = 2 , file = " ./lvq-842.in" )
121+ ENDIF
122+ IF (num_args .gt. 1 ) THEN
123+ open (unit = 3 , file = args(2 ))
124+ ELSE
125+ ! open(unit = 3, file = "./input/hollowcylq-221.in.gpactiv")
126+ open (unit = 3 , file = " ./lvq-842.in.gpactiv" )
127+ ENDIF
128+ CALL read_mesh(2 , Elements, Nodes, DirichletConditions, Fibers)
129+ CALL read_activation_times(3 , ActivationTimes)
113130 close (2 )
114131 close (3 )
115132
0 commit comments