156 INTEGER(INTG),
INTENT(OUT) :: ERR
159 INTEGER(INTG) :: loop_idx
162 enters(
"CONTROL_LOOP_CREATE_FINISH",err,error,*999)
164 IF(
ASSOCIATED(control_loop))
THEN 165 IF(control_loop%CONTROL_LOOP_FINISHED)
THEN 166 CALL flagerror(
"Control loop has already been finished.",err,error,*999)
169 IF(control_loop%NUMBER_OF_SUB_LOOPS>0)
THEN 170 DO loop_idx=1,control_loop%NUMBER_OF_SUB_LOOPS
171 control_loop2=>control_loop%SUB_LOOPS(loop_idx)%PTR
176 control_loop%CONTROL_LOOP_FINISHED=.true.
179 CALL flagerror(
"Control loop is not associated.",err,error,*999)
182 exits(
"CONTROL_LOOP_CREATE_FINISH")
184 999 errorsexits(
"CONTROL_LOOP_CREATE_FINISH",err,error)
198 INTEGER(INTG),
INTENT(OUT) :: ERR
201 INTEGER(INTG) :: DUMMY_ERR
204 enters(
"CONTROL_LOOP_CREATE_START",err,error,*998)
206 IF(
ASSOCIATED(problem))
THEN 207 IF(
ASSOCIATED(control_loop))
THEN 208 CALL flagerror(
"Control loop is already associated.",err,error,*998)
210 NULLIFY(control_loop)
212 control_loop=>problem%CONTROL_LOOP
215 CALL flagerror(
"Problem is not associated.",err,error,*998)
218 exits(
"CONTROL_LOOP_CREATE_START")
221 998 errorsexits(
"CONTROL_LOOP_CREATE_START",err,error)
234 REAL(DP),
INTENT(OUT) :: CURRENT_TIME
235 REAL(DP),
INTENT(OUT) :: TIME_INCREMENT
236 INTEGER(INTG),
INTENT(OUT) :: ERR
241 INTEGER(INTG),
POINTER :: CONTROL_LOOP_LEVEL
244 enters(
"CONTROL_LOOP_CURRENT_TIMES_GET",err,error,*999)
246 IF(
ASSOCIATED(control_loop))
THEN 247 IF(control_loop%CONTROL_LOOP_FINISHED)
THEN 248 control_loop_level=>control_loop%CONTROL_LOOP_LEVEL
249 parent_loop=>control_loop
250 DO i=control_loop_level,1,-1
251 IF(control_loop_level==0)
THEN 252 CALL flagerror(
"The specified control loop is not a time control loop.",err,error,*999)
255 time_loop=>parent_loop%TIME_LOOP
256 IF(
ASSOCIATED(time_loop))
THEN 257 current_time=time_loop%CURRENT_TIME
258 time_increment=time_loop%TIME_INCREMENT
260 CALL flagerror(
"Control loop time loop is not associated.",err,error,*999)
264 parent_loop=>parent_loop%PARENT_LOOP
269 CALL flagerror(
"Control loop has not been finished.",err,error,*999)
272 CALL flagerror(
"Control loop is not associated.",err,error,*999)
275 exits(
"CONTROL_LOOP_CURRENT_TIMES_GET")
277 999 errorsexits(
"CONTROL_LOOP_CURRENT_TIMES_GET",err,error)
291 INTEGER(INTG),
INTENT(OUT) :: ERR
295 enters(
"CONTROL_LOOP_DESTROY",err,error,*999)
297 IF(
ASSOCIATED(control_loop))
THEN 300 CALL flagerror(
"Control loop is not associated.",err,error,*999)
303 exits(
"CONTROL_LOOP_DESTROY")
305 999 errorsexits(
"CONTROL_LOOP_DESTROY",err,error)
318 INTEGER(INTG),
INTENT(OUT) :: ERR
321 INTEGER(INTG) :: loop_idx
324 enters(
"CONTROL_LOOP_FINALISE",err,error,*999)
326 IF(
ASSOCIATED(control_loop))
THEN 328 IF(control_loop%NUMBER_OF_SUB_LOOPS>0)
THEN 329 DO loop_idx=1,control_loop%NUMBER_OF_SUB_LOOPS
330 control_loop2=>control_loop%SUB_LOOPS(loop_idx)%PTR
333 DEALLOCATE(control_loop%SUB_LOOPS)
336 IF(
ASSOCIATED(control_loop%SOLVERS))
CALL solvers_destroy(control_loop%SOLVERS,err,error,*999)
338 control_loop%LABEL=
"" 344 DEALLOCATE(control_loop)
347 exits(
"CONTROL_LOOP_FINALISE")
349 999 errorsexits(
"CONTROL_LOOP_FINALISE",err,error)
362 INTEGER(INTG),
INTENT(OUT) :: ERR
365 INTEGER(INTG) :: DUMMY_ERR
368 enters(
"CONTROL_LOOP_INITIALISE",err,error,*998)
370 IF(
ASSOCIATED(problem))
THEN 371 IF(
ASSOCIATED(problem%CONTROL_LOOP))
THEN 372 CALL flagerror(
"Control loop is already associated for this problem.",err,error,*998)
374 ALLOCATE(problem%CONTROL_LOOP,stat=err)
375 IF(err/=0)
CALL flagerror(
"Could not allocate problem control loop.",err,error,*999)
376 problem%CONTROL_LOOP%PROBLEM=>problem
377 NULLIFY(problem%CONTROL_LOOP%PARENT_LOOP)
378 problem%CONTROL_LOOP%CONTROL_LOOP_FINISHED=.false.
379 problem%CONTROL_LOOP%LABEL=
" " 381 problem%CONTROL_LOOP%CONTROL_LOOP_LEVEL=1
382 problem%CONTROL_LOOP%SUB_LOOP_INDEX=0
384 NULLIFY(problem%CONTROL_LOOP%SIMPLE_LOOP)
385 NULLIFY(problem%CONTROL_LOOP%FIXED_LOOP)
386 NULLIFY(problem%CONTROL_LOOP%TIME_LOOP)
387 NULLIFY(problem%CONTROL_LOOP%WHILE_LOOP)
388 NULLIFY(problem%CONTROL_LOOP%LOAD_INCREMENT_LOOP)
389 problem%CONTROL_LOOP%NUMBER_OF_SUB_LOOPS=0
390 NULLIFY(problem%CONTROL_LOOP%SOLVERS)
394 CALL flagerror(
"Problem is not associated.",err,error,*998)
397 exits(
"CONTROL_LOOP_INITIALISE")
400 998 errorsexits(
"CONTROL_LOOP_INITIALISE",err,error)
413 INTEGER(INTG),
INTENT(OUT) :: ERR
417 enters(
"CONTROL_LOOP_FIXED_FINALISE",err,error,*999)
419 IF(
ASSOCIATED(fixed_loop))
THEN 420 DEALLOCATE(fixed_loop)
423 exits(
"CONTROL_LOOP_FIXED_FINALISE")
425 999 errorsexits(
"CONTROL_LOOP_FIXED_FINALISE",err,error)
434 SUBROUTINE control_loop_get_0(CONTROL_LOOP_ROOT,CONTROL_LOOP_IDENTIFIER,CONTROL_LOOP,ERR,ERROR,*)
438 INTEGER(INTG),
INTENT(IN) :: CONTROL_LOOP_IDENTIFIER
441 INTEGER(INTG),
INTENT(OUT) :: ERR
445 enters(
"CONTROL_LOOP_GET_0",err,error,*999)
447 CALL control_loop_get_1(control_loop_root,[control_loop_identifier],control_loop,err,error,*999)
449 exits(
"CONTROL_LOOP_GET_0")
451 999 errorsexits(
"CONTROL_LOOP_GET_0",err,error)
460 SUBROUTINE control_loop_get_1(CONTROL_LOOP_ROOT,CONTROL_LOOP_IDENTIFIER,CONTROL_LOOP,ERR,ERROR,*)
464 INTEGER(INTG),
INTENT(IN) :: CONTROL_LOOP_IDENTIFIER(:)
467 INTEGER(INTG),
INTENT(OUT) :: ERR
470 INTEGER(INTG) :: control_loop_idx
473 enters(
"CONTROL_LOOP_GET_1",err,error,*998)
475 IF(
ASSOCIATED(control_loop_root))
THEN 477 IF(
ASSOCIATED(control_loop))
THEN 478 CALL flagerror(
"Control loop is already associated.",err,error,*998)
480 NULLIFY(control_loop)
482 IF(control_loop_identifier(
SIZE(control_loop_identifier,1))==
control_loop_node)
THEN 483 control_loop=>control_loop_root
484 DO control_loop_idx=1,
SIZE(control_loop_identifier,1)
488 IF(control_loop_identifier(control_loop_idx)>0.AND. &
489 & control_loop_identifier(control_loop_idx)<=control_loop%NUMBER_OF_SUB_LOOPS)
THEN 490 control_loop=>control_loop%SUB_LOOPS(control_loop_identifier(control_loop_idx))%PTR
491 IF(.NOT.
ASSOCIATED(control_loop))
THEN 492 local_error=
"Control sub loop number "// &
495 &
" is not associated." 496 CALL flagerror(local_error,err,error,*999)
499 local_error=
"Invalid control loop identifier. The identifier at index "// &
502 &
". The identifier must be between 1 and "// &
504 CALL flagerror(local_error,err,error,*999)
509 local_error=
"Invalid control loop identifier. The last value in the identifier vector is "// &
510 &
trim(
number_to_vstring(control_loop_identifier(
SIZE(control_loop_identifier,1)),
"*",err,error))// &
512 CALL flagerror(local_error,err,error,*999)
515 local_error=
"Invalid control loop identifier. The control loop identifier has "// &
517 &
" control loop node identifiers and it should only have 1." 518 CALL flagerror(local_error,err,error,*999)
525 CALL flagerror(
"Control loop root is not associated.",err,error,*998)
528 exits(
"CONTROL_LOOP_GET_1")
530 999
NULLIFY(control_loop)
531 998 errorsexits(
"CONTROL_LOOP_GET_1",err,error)
544 INTEGER(INTG),
INTENT(OUT) :: ERR
547 INTEGER(INTG) :: DUMMY_ERR
550 enters(
"CONTROL_LOOP_FIXED_INITIALISE",err,error,*998)
552 IF(
ASSOCIATED(control_loop))
THEN 553 IF(
ASSOCIATED(control_loop%FIXED_LOOP))
THEN 554 CALL flagerror(
"The fixed loop is already associated for this control loop.",err,error,*998)
556 ALLOCATE(control_loop%FIXED_LOOP,stat=err)
557 IF(err/=0)
CALL flagerror(
"Could not allocate fixed loop for the control loop.",err,error,*999)
558 control_loop%FIXED_LOOP%CONTROL_LOOP=>control_loop
559 control_loop%FIXED_LOOP%ITERATION_NUMBER=0
560 control_loop%FIXED_LOOP%START_ITERATION=1
561 control_loop%FIXED_LOOP%STOP_ITERATION=100
562 control_loop%FIXED_LOOP%ITERATION_INCREMENT=1
565 CALL flagerror(
"Control loop is not associated.",err,error,*998)
568 exits(
"CONTROL_LOOP_FIXED_INITIALISE")
571 998 errorsexits(
"CONTROL_LOOP_FIXED_INITIALISE",err,error)
584 INTEGER(INTG),
INTENT(IN) :: START_ITERATION
585 INTEGER(INTG),
INTENT(IN) :: STOP_ITERATION
586 INTEGER(INTG),
INTENT(IN) :: ITERATION_INCREMENT
587 INTEGER(INTG),
INTENT(OUT) :: ERR
593 enters(
"CONTROL_LOOP_ITERATIONS_SET",err,error,*999)
595 IF(
ASSOCIATED(control_loop))
THEN 596 IF(control_loop%CONTROL_LOOP_FINISHED)
THEN 597 CALL flagerror(
"Control loop has been finished.",err,error,*999)
600 fixed_loop=>control_loop%FIXED_LOOP
601 IF(
ASSOCIATED(fixed_loop))
THEN 602 IF(iteration_increment==0)
THEN 603 local_error=
"The specified time increment of "//
trim(
number_to_vstring(iteration_increment,
"*",err,error))// &
604 &
" is invalid. The iteration increment must not be zero." 605 CALL flagerror(local_error,err,error,*999)
607 IF(iteration_increment>0)
THEN 608 IF(stop_iteration<=start_iteration)
THEN 609 local_error=
"The specified stop iteration of "//
trim(
number_to_vstring(stop_iteration,
"*",err,error))// &
610 &
" is incompatiable with a specified start increment of "// &
612 &
". For a positive iteration increment the stop iteration must be > than the start iteration." 613 CALL flagerror(local_error,err,error,*999)
616 IF(start_iteration<=stop_iteration)
THEN 617 local_error=
"The specified start iteration of "//
trim(
number_to_vstring(start_iteration,
"*",err,error))// &
618 &
" is incompatiable with a specified stop iteration of "// &
620 &
". For a negative iteration increment the stop iteration must be < than the start iteration." 621 CALL flagerror(local_error,err,error,*999)
625 fixed_loop%START_ITERATION=start_iteration
626 fixed_loop%STOP_ITERATION=stop_iteration
627 fixed_loop%ITERATION_INCREMENT=iteration_increment
629 CALL flagerror(
"Control loop fixed loop is not associated.",err,error,*999)
632 CALL flagerror(
"The specified control loop is not a fixed control loop.",err,error,*999)
636 CALL flagerror(
"Control loop is not associated.",err,error,*999)
639 exits(
"CONTROL_LOOP_ITERATIONS_SET")
641 999 errorsexits(
"CONTROL_LOOP_ITERATIONS_SET",err,error)
654 CHARACTER(LEN=*),
INTENT(OUT) :: LABEL
655 INTEGER(INTG),
INTENT(OUT) :: ERR
658 INTEGER(INTG) :: C_LENGTH,VS_LENGTH
660 enters(
"CONTROL_LOOP_LABEL_GET_C",err,error,*999)
662 IF(
ASSOCIATED(control_loop))
THEN 664 vs_length=
len_trim(control_loop%LABEL)
665 IF(c_length>vs_length)
THEN 666 label=
char(control_loop%LABEL,vs_length)
668 label=
char(control_loop%LABEL,c_length)
671 CALL flagerror(
"Control loop is not associated.",err,error,*999)
674 exits(
"CONTROL_LOOP_LABEL_GET_C")
676 999 errorsexits(
"CONTROL_LOOP_LABEL_GET_C",err,error)
691 INTEGER(INTG),
INTENT(OUT) :: ERR
695 enters(
"CONTROL_LOOP_LABEL_GET_VS",err,error,*999)
697 IF(
ASSOCIATED(control_loop))
THEN 700 CALL flagerror(
"Control loop is not associated.",err,error,*999)
703 exits(
"CONTROL_LOOP_LABEL_GET_VS")
705 999 errorsexits(
"CONTROL_LOOP_LABEL_GET_VS",err,error)
719 CHARACTER(LEN=*),
INTENT(IN) :: LABEL
720 INTEGER(INTG),
INTENT(OUT) :: ERR
724 enters(
"CONTROL_LOOP_LABEL_SET_C",err,error,*999)
726 IF(
ASSOCIATED(control_loop))
THEN 727 IF(control_loop%CONTROL_LOOP_FINISHED)
THEN 728 CALL flagerror(
"Control loop has been finished.",err,error,*999)
730 control_loop%LABEL=label
733 CALL flagerror(
"Control loop is not associated.",err,error,*999)
736 exits(
"CONTROL_LOOP_LABEL_SET_C")
738 999 errorsexits(
"CONTROL_LOOP_LABEL_SET_C",err,error)
753 INTEGER(INTG),
INTENT(OUT) :: ERR
757 enters(
"CONTROL_LOOP_LABEL_SET_VS",err,error,*999)
759 IF(
ASSOCIATED(control_loop))
THEN 760 IF(control_loop%CONTROL_LOOP_FINISHED)
THEN 761 CALL flagerror(
"Control loop has been finished.",err,error,*999)
763 control_loop%LABEL=label
766 CALL flagerror(
"Control loop is not associated.",err,error,*999)
769 exits(
"CONTROL_LOOP_LABEL_SET_VS")
771 999 errorsexits(
"CONTROL_LOOP_LABEL_SET_VS",err,error)
785 INTEGER(INTG),
INTENT(IN) :: MAXIMUM_ITERATIONS
786 INTEGER(INTG),
INTENT(OUT) :: ERR
793 enters(
"CONTROL_LOOP_MAXIMUM_ITERATIONS_SET",err,error,*999)
795 IF(
ASSOCIATED(control_loop))
THEN 796 IF(control_loop%CONTROL_LOOP_FINISHED)
THEN 799 load_increment_loop=>control_loop%LOAD_INCREMENT_LOOP
800 IF(
ASSOCIATED(load_increment_loop))
THEN 801 IF(maximum_iterations<=0)
THEN 802 local_error=
"The specified maximum number of iterations of "// &
804 &
" is invalid. The maximum number of iterations must be greater than zero." 805 CALL flagerror(local_error,err,error,*999)
807 load_increment_loop%MAXIMUM_NUMBER_OF_ITERATIONS=maximum_iterations
809 CALL flagerror(
"Control loop load incremented loop is not associated.",err,error,*999)
812 CALL flagerror(
"Control loop has been finished.",err,error,*999)
816 while_loop=>control_loop%WHILE_LOOP
817 IF(
ASSOCIATED(while_loop))
THEN 818 IF(maximum_iterations<=0)
THEN 819 local_error=
"The specified maximum number of iterations of "// &
821 &
" is invalid. The maximum number of iterations must be greater than zero." 822 CALL flagerror(local_error,err,error,*999)
824 while_loop%MAXIMUM_NUMBER_OF_ITERATIONS=maximum_iterations
826 CALL flagerror(
"Control loop while loop is not associated.",err,error,*999)
829 load_increment_loop=>control_loop%LOAD_INCREMENT_LOOP
830 IF(
ASSOCIATED(load_increment_loop))
THEN 831 IF(maximum_iterations<=0)
THEN 832 local_error=
"The specified maximum number of iterations of "// &
834 &
" is invalid. The maximum number of iterations must be greater than zero." 835 CALL flagerror(local_error,err,error,*999)
837 load_increment_loop%MAXIMUM_NUMBER_OF_ITERATIONS=maximum_iterations
839 CALL flagerror(
"Control loop load increment loop is not associated.",err,error,*999)
842 CALL flagerror(
"The specified control loop is not a while or load increment control loop.",err,error,*999)
846 CALL flagerror(
"Control loop is not associated.",err,error,*999)
849 exits(
"CONTROL_LOOP_MAXIMUM_ITERATIONS_SET")
851 999 errorsexits(
"CONTROL_LOOP_MAXIMUM_ITERATIONS_SET",err,error)
864 INTEGER(INTG),
INTENT(IN) :: OUTPUT_FREQUENCY
865 INTEGER(INTG),
INTENT(OUT) :: ERR
870 enters(
"CONTROL_LOOP_LOAD_OUTPUT_SET",err,error,*999)
872 IF(
ASSOCIATED(control_loop))
THEN 873 IF(control_loop%CONTROL_LOOP_FINISHED)
THEN 874 CALL flagerror(
"Control loop has been finished.",err,error,*999)
877 load_increment_loop=>control_loop%LOAD_INCREMENT_LOOP
878 IF(
ASSOCIATED(load_increment_loop))
THEN 879 load_increment_loop%OUTPUT_NUMBER=output_frequency
881 CALL flagerror(
"Control loop load increment loop is not associated.",err,error,*999)
884 CALL flagerror(
"The specified control loop is not a load increment control loop.",err,error,*999)
888 CALL flagerror(
"Control loop is not associated.",err,error,*999)
891 exits(
"CONTROL_LOOP_LOAD_OUTPUT_SET")
893 999 errorsexits(
"CONTROL_LOOP_LOAD_OUTPUT_SET",err,error)
906 REAL(DP),
INTENT(IN) :: absoluteTolerance
907 INTEGER(INTG),
INTENT(OUT) :: err
913 enters(
"ControlLoop_AbsoluteToleranceSet",err,error,*999)
915 IF(
ASSOCIATED(controlloop))
THEN 916 IF(controlloop%CONTROL_LOOP_FINISHED)
THEN 917 CALL flagerror(
"Control loop has been finished.",err,error,*999)
920 whileloop=>controlloop%WHILE_LOOP
921 IF(
ASSOCIATED(whileloop))
THEN 922 IF(absolutetolerance<=0)
THEN 923 localerror=
"The specified absolute tolerance of "// &
925 &
" is invalid for a while loop. The tolerance must be greater than zero." 926 CALL flagerror(localerror,err,error,*999)
928 whileloop%ABSOLUTE_TOLERANCE=absolutetolerance
930 CALL flagerror(
"Control loop while loop is not associated.",err,error,*999)
935 CALL flagerror(
"Control loop is not associated.",err,error,*999)
938 exits(
"ControlLoop_AbsoluteToleranceSet")
940 999 errorsexits(
"ControlLoop_AbsoluteToleranceSet",err,error)
954 INTEGER(INTG),
INTENT(IN) :: NUMBER_OF_ITERATIONS
955 INTEGER(INTG),
INTENT(OUT) :: ERR
961 enters(
"CONTROL_LOOP_NUMBER_OF_ITERATIONS_SET",err,error,*999)
963 IF(
ASSOCIATED(control_loop))
THEN 965 time_loop=>control_loop%TIME_LOOP
966 IF(
ASSOCIATED(time_loop))
THEN 967 IF(number_of_iterations<0)
THEN 968 local_error=
"The specified number of iterations of "//
trim(
number_to_vstring(number_of_iterations,
"*",err,error))// &
969 &
" is invalid. The number must be non-negative." 970 CALL flagerror(local_error,err,error,*999)
972 time_loop%NUMBER_OF_ITERATIONS=number_of_iterations
975 IF (ceiling((time_loop%STOP_TIME-time_loop%START_TIME)/time_loop%TIME_INCREMENT) &
976 & /= time_loop%NUMBER_OF_ITERATIONS)
THEN 977 time_loop%TIME_INCREMENT = (time_loop%STOP_TIME-time_loop%START_TIME)/time_loop%NUMBER_OF_ITERATIONS
981 CALL flagerror(
"Control loop time loop is not associated.",err,error,*999)
984 CALL flagerror(
"The specified control loop is not a time control loop.",err,error,*999)
987 CALL flagerror(
"Control loop is not associated.",err,error,*999)
990 exits(
"CONTROL_LOOP_NUMBER_OF_ITERATIONS_SET")
992 999 errorsexits(
"CONTROL_LOOP_NUMBER_OF_ITERATIONS_SET",err,error)
1005 INTEGER(INTG),
INTENT(OUT) :: NUMBER_OF_ITERATIONS
1006 INTEGER(INTG),
INTENT(OUT) :: ERR
1012 enters(
"CONTROL_LOOP_NUMBER_OF_ITERATIONS_GET",err,error,*999)
1014 IF(
ASSOCIATED(control_loop))
THEN 1016 time_loop=>control_loop%TIME_LOOP
1017 IF(
ASSOCIATED(time_loop))
THEN 1018 number_of_iterations=time_loop%NUMBER_OF_ITERATIONS
1020 CALL flagerror(
"Control loop time loop is not associated.",err,error,*999)
1023 CALL flagerror(
"The specified control loop is not a time control loop.",err,error,*999)
1026 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1029 exits(
"CONTROL_LOOP_NUMBER_OF_ITERATIONS_GET")
1031 999 errorsexits(
"CONTROL_LOOP_NUMBER_OF_ITERATIONS_GET",err,error)
1044 INTEGER(INTG),
INTENT(OUT) :: NUMBER_OF_SUB_LOOPS
1045 INTEGER(INTG),
INTENT(OUT) :: ERR
1049 enters(
"CONTROL_LOOP_NUMBER_OF_SUB_LOOPS_GET",err,error,*999)
1051 IF(
ASSOCIATED(control_loop))
THEN 1052 IF(control_loop%CONTROL_LOOP_FINISHED)
THEN 1053 CALL flagerror(
"Control loop has already been finished.",err,error,*999)
1055 number_of_sub_loops=control_loop%NUMBER_OF_SUB_LOOPS
1058 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1061 exits(
"CONTROL_LOOP_NUMBER_OF_SUB_LOOPS_GET")
1063 999 errorsexits(
"CONTROL_LOOP_NUMBER_OF_SUB_LOOPS_GET",err,error)
1076 INTEGER(INTG),
INTENT(IN) :: NUMBER_OF_SUB_LOOPS
1077 INTEGER(INTG),
INTENT(OUT) :: ERR
1080 INTEGER(INTG) :: loop_idx
1084 enters(
"CONTROL_LOOP_NUMBER_OF_SUB_LOOPS_SET",err,error,*999)
1086 IF(
ASSOCIATED(control_loop))
THEN 1087 IF(control_loop%CONTROL_LOOP_FINISHED)
THEN 1088 CALL flagerror(
"Control loop has already been finished.",err,error,*999)
1090 IF(number_of_sub_loops>=0)
THEN 1091 IF(number_of_sub_loops/=control_loop%NUMBER_OF_SUB_LOOPS)
THEN 1092 IF(control_loop%NUMBER_OF_SUB_LOOPS>0)
THEN 1093 ALLOCATE(old_sub_loops(control_loop%NUMBER_OF_SUB_LOOPS),stat=err)
1094 IF(err/=0)
CALL flagerror(
"Could not allocate old sub loops.",err,error,*999)
1095 DO loop_idx=1,control_loop%NUMBER_OF_SUB_LOOPS
1096 old_sub_loops(loop_idx)%PTR=>control_loop%SUB_LOOPS(loop_idx)%PTR
1098 DEALLOCATE(control_loop%SUB_LOOPS)
1100 ALLOCATE(control_loop%SUB_LOOPS(number_of_sub_loops),stat=err)
1101 IF(err/=0)
CALL flagerror(
"Could not allocate control loop sub loops.",err,error,*999)
1102 IF(number_of_sub_loops>control_loop%NUMBER_OF_SUB_LOOPS)
THEN 1103 DO loop_idx=1,control_loop%NUMBER_OF_SUB_LOOPS
1104 control_loop%SUB_LOOPS(loop_idx)%PTR=>old_sub_loops(loop_idx)%PTR
1106 DO loop_idx=control_loop%NUMBER_OF_SUB_LOOPS+1,number_of_sub_loops
1107 ALLOCATE(control_loop%SUB_LOOPS(loop_idx)%PTR,stat=err)
1108 IF(err/=0)
CALL flagerror(
"Could not allocate sub loops control loop.",err,error,*999)
1109 control_loop%SUB_LOOPS(loop_idx)%PTR%PROBLEM=>control_loop%PROBLEM
1110 control_loop%SUB_LOOPS(loop_idx)%PTR%PARENT_LOOP=>control_loop
1111 control_loop%SUB_LOOPS(loop_idx)%PTR%CONTROL_LOOP_FINISHED=.false.
1113 control_loop%SUB_LOOPS(loop_idx)%PTR%CONTROL_LOOP_LEVEL=control_loop%CONTROL_LOOP_LEVEL+1
1114 control_loop%SUB_LOOPS(loop_idx)%PTR%SUB_LOOP_INDEX=loop_idx
1115 NULLIFY(control_loop%SUB_LOOPS(loop_idx)%PTR%SIMPLE_LOOP)
1116 NULLIFY(control_loop%SUB_LOOPS(loop_idx)%PTR%FIXED_LOOP)
1117 NULLIFY(control_loop%SUB_LOOPS(loop_idx)%PTR%TIME_LOOP)
1118 NULLIFY(control_loop%SUB_LOOPS(loop_idx)%PTR%WHILE_LOOP)
1119 NULLIFY(control_loop%SUB_LOOPS(loop_idx)%PTR%LOAD_INCREMENT_LOOP)
1120 control_loop%SUB_LOOPS(loop_idx)%PTR%NUMBER_OF_SUB_LOOPS=0
1121 NULLIFY(control_loop%SUB_LOOPS(loop_idx)%PTR%SOLVERS)
1125 DO loop_idx=1,number_of_sub_loops
1126 control_loop%SUB_LOOPS(loop_idx)%PTR=>old_sub_loops(loop_idx)%PTR
1128 DO loop_idx=number_of_sub_loops+1,control_loop%NUMBER_OF_SUB_LOOPS
1132 IF(
ALLOCATED(old_sub_loops))
DEALLOCATE(old_sub_loops)
1133 control_loop%NUMBER_OF_SUB_LOOPS=number_of_sub_loops
1136 local_error=
"The given number of sub loops of "//
trim(
number_to_vstring(number_of_sub_loops,
"*",err,error))// &
1137 &
" is invalid. The number of sub loops must be >= 0." 1138 CALL flagerror(local_error,err,error,*999)
1142 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1145 exits(
"CONTROL_LOOP_NUMBER_OF_SUB_LOOPS_SET")
1147 999
IF(
ALLOCATED(old_sub_loops))
DEALLOCATE(old_sub_loops)
1148 errorsexits(
"CONTROL_LOOP_NUMBER_OF_SUB_LOOPS_SET",err,error)
1161 INTEGER(INTG),
INTENT(OUT) :: OUTPUT_TYPE
1162 INTEGER(INTG),
INTENT(OUT) :: ERR
1166 enters(
"CONTROL_LOOP_OUTPUT_TYPE_GET",err,error,*999)
1168 IF(
ASSOCIATED(control_loop))
THEN 1169 IF(control_loop%CONTROL_LOOP_FINISHED)
THEN 1170 output_type=control_loop%OUTPUT_TYPE
1172 CALL flagerror(
"Control loop has not been finished.",err,error,*999)
1175 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1178 exits(
"CONTROL_LOOP_OUTPUT_TYPE_GET")
1180 999 errorsexits(
"CONTROL_LOOP_OUTPUT_TYPE_GET",err,error)
1193 INTEGER(INTG),
INTENT(IN) :: OUTPUT_TYPE
1194 INTEGER(INTG),
INTENT(OUT) :: ERR
1199 enters(
"CONTROL_LOOP_OUTPUT_TYPE_SET",err,error,*999)
1201 IF(
ASSOCIATED(control_loop))
THEN 1202 IF(control_loop%CONTROL_LOOP_FINISHED)
THEN 1203 CALL flagerror(
"Control loop has already been finished.",err,error,*999)
1205 SELECT CASE(output_type)
1213 local_error=
"The specified control loop output type of "// &
1215 CALL flagerror(local_error,err,error,*999)
1219 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1222 exits(
"CONTROL_LOOP_OUTPUT_TYPE_SET")
1224 999 errorsexits(
"CONTROL_LOOP_OUTPUT_TYPE_SET",err,error)
1238 INTEGER(INTG),
INTENT(OUT) :: ERR
1242 enters(
"CONTROL_LOOP_SIMPLE_FINALISE",err,error,*999)
1244 IF(
ASSOCIATED(simple_loop))
THEN 1245 DEALLOCATE(simple_loop)
1248 exits(
"CONTROL_LOOP_SIMPLE_FINALISE")
1250 999 errorsexits(
"CONTROL_LOOP_SIMPLE_FINALISE",err,error)
1263 INTEGER(INTG),
INTENT(OUT) :: ERR
1266 INTEGER(INTG) :: DUMMY_ERR
1269 enters(
"CONTROL_LOOP_SIMPLE_INITIALISE",err,error,*998)
1271 IF(
ASSOCIATED(control_loop))
THEN 1272 IF(
ASSOCIATED(control_loop%SIMPLE_LOOP))
THEN 1273 CALL flagerror(
"The simple loop is already associated for this control loop.",err,error,*998)
1275 ALLOCATE(control_loop%SIMPLE_LOOP,stat=err)
1276 IF(err/=0)
CALL flagerror(
"Could not allocate simple loop for the control loop.",err,error,*999)
1277 control_loop%SIMPLE_LOOP%CONTROL_LOOP=>control_loop
1280 CALL flagerror(
"Control loop is not associated.",err,error,*998)
1283 exits(
"CONTROL_LOOP_SIMPLE_INITIALISE")
1286 998 errorsexits(
"CONTROL_LOOP_SIMPLE_INITIALISE",err,error)
1299 INTEGER(INTG),
INTENT(OUT) :: ERR
1302 INTEGER(INTG) :: loop_idx
1305 enters(
"CONTROL_LOOP_SOLVERS_DESTROY",err,error,*999)
1307 IF(
ASSOCIATED(control_loop))
THEN 1309 IF(control_loop%NUMBER_OF_SUB_LOOPS>0)
THEN 1310 DO loop_idx=1,control_loop%NUMBER_OF_SUB_LOOPS
1311 control_loop2=>control_loop%SUB_LOOPS(loop_idx)%PTR
1316 IF(
ASSOCIATED(control_loop%SOLVERS))
CALL solvers_destroy(control_loop%SOLVERS,err,error,*999)
1318 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1321 exits(
"CONTROL_LOOP_SOLVERS_DESTROY")
1323 999 errorsexits(
"CONTROL_LOOP_SOLVERS_DESTROY",err,error)
1338 INTEGER(INTG),
INTENT(OUT) :: ERR
1342 enters(
"CONTROL_LOOP_SOLVERS_GET",err,error,*999)
1344 IF(
ASSOCIATED(control_loop))
THEN 1345 IF(
ASSOCIATED(solvers))
THEN 1346 CALL flagerror(
"Solvers is already associated.",err,error,*999)
1348 solvers=>control_loop%SOLVERS
1349 IF(.NOT.
ASSOCIATED(solvers))
CALL flagerror(
"Solvers is not associated.",err,error,*999)
1352 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1355 exits(
"CONTROL_LOOP_SOLVERS_GET")
1357 999 errorsexits(
"CONTROL_LOOP_SOLVERS_GET",err,error)
1371 INTEGER(INTG),
INTENT(OUT) :: ERR
1374 INTEGER(INTG) :: loop_idx,solver_idx
1379 enters(
"CONTROL_LOOP_SOLVER_EQUATIONS_DESTROY",err,error,*999)
1381 IF(
ASSOCIATED(control_loop))
THEN 1383 IF(control_loop%NUMBER_OF_SUB_LOOPS>0)
THEN 1384 DO loop_idx=1,control_loop%NUMBER_OF_SUB_LOOPS
1385 control_loop2=>control_loop%SUB_LOOPS(loop_idx)%PTR
1390 IF(
ASSOCIATED(control_loop%SOLVERS))
THEN 1391 DO solver_idx=1,control_loop%SOLVERS%NUMBER_OF_SOLVERS
1392 solver=>control_loop%SOLVERS%SOLVERS(solver_idx)%PTR
1393 IF(
ASSOCIATED(solver))
THEN 1394 solver_equations=>solver%SOLVER_EQUATIONS
1397 CALL flagerror(
"Solver is not associated.",err,error,*999)
1402 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1405 exits(
"CONTROL_LOOP_SOLVER_EQUATIONS_DESTROY")
1407 999 errorsexits(
"CONTROL_LOOP_SOLVER_EQUATIONS_DESTROY",err,error)
1420 INTEGER(INTG),
INTENT(IN) :: SUB_LOOP_INDEX
1423 INTEGER(INTG),
INTENT(OUT) :: ERR
1428 enters(
"CONTROL_LOOP_SUB_LOOP_GET",err,error,*999)
1430 IF(
ASSOCIATED(control_loop))
THEN 1431 IF(
ASSOCIATED(sub_loop))
THEN 1432 CALL flagerror(
"Sub loop is already associated.",err,error,*999)
1435 IF(sub_loop_index>0.AND.sub_loop_index<=control_loop%NUMBER_OF_SUB_LOOPS)
THEN 1436 sub_loop=>control_loop%SUB_LOOPS(sub_loop_index)%PTR
1438 local_error=
"The specified sub loop index of "//
trim(
number_to_vstring(sub_loop_index,
"*",err,error))// &
1439 &
" is invalid. The sub loop index must be > 0 and <= "// &
1441 CALL flagerror(local_error,err,error,*999)
1445 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1448 exits(
"CONTROL_LOOP_SUB_LOOP_GET")
1450 999 errorsexits(
"CONTROL_LOOP_SUB_LOOP_GET",err,error)
1463 INTEGER(INTG),
INTENT(OUT) :: ERR
1467 enters(
"CONTROL_LOOP_TIME_FINALISE",err,error,*999)
1469 IF(
ASSOCIATED(time_loop))
THEN 1470 DEALLOCATE(time_loop)
1473 exits(
"CONTROL_LOOP_TIME_FINALISE")
1475 999 errorsexits(
"CONTROL_LOOP_TIME_FINALISE",err,error)
1488 INTEGER(INTG),
INTENT(OUT) :: ERR
1491 INTEGER(INTG) :: DUMMY_ERR
1494 enters(
"CONTROL_LOOP_TIME_INITIALISE",err,error,*998)
1496 IF(
ASSOCIATED(control_loop))
THEN 1497 IF(
ASSOCIATED(control_loop%TIME_LOOP))
THEN 1498 CALL flagerror(
"The time loop is already associated for this control loop.",err,error,*998)
1500 ALLOCATE(control_loop%TIME_LOOP,stat=err)
1501 IF(err/=0)
CALL flagerror(
"Could not allocate time loop for the control loop.",err,error,*999)
1502 control_loop%TIME_LOOP%CONTROL_LOOP=>control_loop
1503 control_loop%TIME_LOOP%ITERATION_NUMBER=0
1504 control_loop%TIME_LOOP%NUMBER_OF_ITERATIONS=0
1505 control_loop%TIME_LOOP%GLOBAL_ITERATION_NUMBER=0
1506 control_loop%TIME_LOOP%CURRENT_TIME=0.0_dp
1507 control_loop%TIME_LOOP%START_TIME=0.0_dp
1508 control_loop%TIME_LOOP%STOP_TIME=1.0_dp
1509 control_loop%TIME_LOOP%TIME_INCREMENT=0.01_dp
1510 control_loop%TIME_LOOP%OUTPUT_NUMBER=0
1511 control_loop%TIME_LOOP%INPUT_NUMBER=0
1514 CALL flagerror(
"Control loop is not associated.",err,error,*998)
1517 exits(
"CONTROL_LOOP_TIME_INITIALISE")
1520 998 errorsexits(
"CONTROL_LOOP_TIME_INITIALISE",err,error)
1531 & current_loop_iteration,output_iteration_number,err,error,*)
1535 REAL(DP),
INTENT(OUT) :: START_TIME
1536 REAL(DP),
INTENT(OUT) :: STOP_TIME
1537 REAL(DP),
INTENT(OUT) :: CURRENT_TIME
1538 REAL(DP),
INTENT(OUT) :: TIME_INCREMENT
1539 INTEGER(INTG),
INTENT(OUT) :: CURRENT_LOOP_ITERATION
1540 INTEGER(INTG),
INTENT(OUT) :: OUTPUT_ITERATION_NUMBER
1541 INTEGER(INTG),
INTENT(OUT) :: ERR
1546 INTEGER(INTG),
POINTER :: CONTROL_LOOP_LEVEL
1549 enters(
"CONTROL_LOOP_TIMES_GET",err,error,*999)
1551 IF(
ASSOCIATED(control_loop))
THEN 1552 IF(control_loop%CONTROL_LOOP_FINISHED)
THEN 1553 control_loop_level=>control_loop%CONTROL_LOOP_LEVEL
1554 parent_loop=>control_loop
1555 DO i=control_loop_level,1,-1
1556 IF(control_loop_level==0)
THEN 1557 CALL flagerror(
"The specified control loop is not a time control loop.",err,error,*999)
1560 time_loop=>parent_loop%TIME_LOOP
1561 IF(
ASSOCIATED(time_loop))
THEN 1562 start_time=time_loop%START_TIME
1563 stop_time=time_loop%STOP_TIME
1564 current_time=time_loop%CURRENT_TIME
1565 time_increment=time_loop%TIME_INCREMENT
1566 current_loop_iteration=time_loop%ITERATION_NUMBER
1567 output_iteration_number=time_loop%OUTPUT_NUMBER
1569 CALL flagerror(
"Control loop time loop is not associated.",err,error,*999)
1573 parent_loop=>parent_loop%PARENT_LOOP
1578 CALL flagerror(
"Control loop has not been finished.",err,error,*999)
1581 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1584 exits(
"CONTROL_LOOP_TIMES_GET")
1586 999 errorsexits(
"CONTROL_LOOP_TIMES_GET",err,error)
1599 REAL(DP),
INTENT(IN) :: START_TIME
1600 REAL(DP),
INTENT(IN) :: STOP_TIME
1601 REAL(DP),
INTENT(IN) :: TIME_INCREMENT
1602 INTEGER(INTG),
INTENT(OUT) :: ERR
1608 enters(
"CONTROL_LOOP_TIMES_SET",err,error,*999)
1610 IF(
ASSOCIATED(control_loop))
THEN 1612 time_loop=>control_loop%TIME_LOOP
1613 IF(
ASSOCIATED(time_loop))
THEN 1614 IF(abs(time_increment)<=zero_tolerance)
THEN 1615 local_error=
"The specified time increment of "//
trim(
number_to_vstring(time_increment,
"*",err,error))// &
1616 &
" is invalid. The time increment must not be zero." 1617 CALL flagerror(local_error,err,error,*999)
1619 IF(time_increment>0.0_dp)
THEN 1620 IF(stop_time<=start_time)
THEN 1622 &
" is incompatiable with a specified start time of "//
trim(
number_to_vstring(start_time,
"*",err,error))// &
1623 &
". For a positive time increment the stop time must be > than the start time." 1624 CALL flagerror(local_error,err,error,*999)
1627 IF(start_time<=stop_time)
THEN 1629 &
" is incompatiable with a specified stop time of "//
trim(
number_to_vstring(stop_time,
"*",err,error))// &
1630 &
". For a negative time increment the stop time must be < than the start time." 1631 CALL flagerror(local_error,err,error,*999)
1635 time_loop%START_TIME=start_time
1636 time_loop%STOP_TIME=stop_time
1637 time_loop%TIME_INCREMENT=time_increment
1638 time_loop%NUMBER_OF_ITERATIONS=0
1640 CALL flagerror(
"Control loop time loop is not associated.",err,error,*999)
1643 CALL flagerror(
"The specified control loop is not a time control loop.",err,error,*999)
1646 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1649 exits(
"CONTROL_LOOP_TIMES_SET")
1651 999 errorsexits(
"CONTROL_LOOP_TIMES_SET",err,error)
1664 INTEGER(INTG) :: OUTPUT_FREQUENCY
1665 INTEGER(INTG),
INTENT(OUT) :: ERR
1670 enters(
"CONTROL_LOOP_TIME_OUTPUT_SET",err,error,*999)
1672 IF(
ASSOCIATED(control_loop))
THEN 1673 IF(control_loop%CONTROL_LOOP_FINISHED)
THEN 1674 CALL flagerror(
"Control loop has been finished.",err,error,*999)
1677 time_loop=>control_loop%TIME_LOOP
1678 IF(
ASSOCIATED(time_loop))
THEN 1679 IF(output_frequency>=0)
THEN 1680 time_loop%OUTPUT_NUMBER=output_frequency
1682 CALL flagerror(
"Invalid output frequency. The frequency should be greater than or equal to zero, but is "// &
1686 CALL flagerror(
"Control loop time loop is not associated.",err,error,*999)
1689 CALL flagerror(
"The specified control loop is not a time control loop.",err,error,*999)
1693 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1696 exits(
"CONTROL_LOOP_TIME_OUTPUT_SET")
1698 999 errorsexits(
"CONTROL_LOOP_TIME_OUTPUT_SET",err,error)
1711 INTEGER(INTG) :: INPUT_OPTION
1712 INTEGER(INTG),
INTENT(OUT) :: ERR
1717 enters(
"CONTROL_LOOP_TIME_INPUT_SET",err,error,*999)
1719 IF(
ASSOCIATED(control_loop))
THEN 1720 IF(control_loop%CONTROL_LOOP_FINISHED)
THEN 1721 CALL flagerror(
"Control loop has been finished.",err,error,*999)
1724 time_loop=>control_loop%TIME_LOOP
1725 IF(
ASSOCIATED(time_loop))
THEN 1726 time_loop%INPUT_NUMBER=input_option
1728 CALL flagerror(
"Control loop time loop is not associated.",err,error,*999)
1731 CALL flagerror(
"The specified control loop is not a time control loop.",err,error,*999)
1735 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1738 exits(
"CONTROL_LOOP_TIME_INPUT_SET")
1740 999 errorsexits(
"CONTROL_LOOP_TIME_INPUT_SET",err,error)
1753 INTEGER(INTG),
INTENT(IN) :: LOOP_TYPE
1754 INTEGER(INTG),
INTENT(OUT) :: ERR
1759 enters(
"CONTROL_LOOP_TYPE_SET",err,error,*999)
1761 IF(
ASSOCIATED(control_loop))
THEN 1762 IF(control_loop%CONTROL_LOOP_FINISHED)
THEN 1763 CALL flagerror(
"Control loop has already been finished.",err,error,*999)
1765 IF(loop_type/=control_loop%LOOP_TYPE)
THEN 1767 SELECT CASE(loop_type)
1780 CALL flagerror(local_error,err,error,*999)
1783 SELECT CASE(control_loop%LOOP_TYPE)
1795 local_error=
"The control loop type of "//
trim(
number_to_vstring(control_loop%LOOP_TYPE,
"*",err,error))//
" is invalid." 1796 CALL flagerror(local_error,err,error,*999)
1798 control_loop%LOOP_TYPE=loop_type
1802 CALL flagerror(
"Control loop is not associated.",err,error,*999)
1805 exits(
"CONTROL_LOOP_TYPE_SET")
1807 999 errorsexits(
"CONTROL_LOOP_TYPE_SET",err,error)
1820 INTEGER(INTG),
INTENT(OUT) :: ERR
1824 enters(
"CONTROL_LOOP_WHILE_FINALISE",err,error,*999)
1826 IF(
ASSOCIATED(while_loop))
THEN 1827 DEALLOCATE(while_loop)
1830 exits(
"CONTROL_LOOP_WHILE_FINALISE")
1832 999 errorsexits(
"CONTROL_LOOP_WHILE_FINALISE",err,error)
1845 INTEGER(INTG),
INTENT(OUT) :: ERR
1848 INTEGER(INTG) :: DUMMY_ERR
1851 enters(
"CONTROL_LOOP_WHILE_INITIALISE",err,error,*998)
1853 IF(
ASSOCIATED(control_loop))
THEN 1854 IF(
ASSOCIATED(control_loop%WHILE_LOOP))
THEN 1855 CALL flagerror(
"The while loop is already associated for this control loop.",err,error,*998)
1857 ALLOCATE(control_loop%WHILE_LOOP,stat=err)
1858 IF(err/=0)
CALL flagerror(
"Could not allocate while loop for the control loop.",err,error,*999)
1859 control_loop%WHILE_LOOP%CONTROL_LOOP=>control_loop
1860 control_loop%WHILE_LOOP%ITERATION_NUMBER=0
1861 control_loop%WHILE_LOOP%MAXIMUM_NUMBER_OF_ITERATIONS=100
1862 control_loop%WHILE_LOOP%ABSOLUTE_TOLERANCE=1.0e-5_dp
1863 control_loop%WHILE_LOOP%CONTINUE_LOOP=.true.
1866 CALL flagerror(
"Control loop is not associated.",err,error,*998)
1869 exits(
"CONTROL_LOOP_WHILE_INITIALISE")
1872 998 errorsexits(
"CONTROL_LOOP_WHILE_INITIALISE",err,error)
1885 INTEGER(INTG),
INTENT(OUT) :: ERR
1889 enters(
"CONTROL_LOOP_LOAD_INCREMENT_FINALISE",err,error,*999)
1891 IF(
ASSOCIATED(load_increment_loop))
THEN 1892 DEALLOCATE(load_increment_loop)
1895 exits(
"CONTROL_LOOP_LOAD_INCREMENT_FINALISE")
1897 999 errorsexits(
"CONTROL_LOOP_LOAD_INCREMENT_FINALISE",err,error)
1910 INTEGER(INTG),
INTENT(OUT) :: ERR
1913 INTEGER(INTG) :: DUMMY_ERR
1916 enters(
"CONTROL_LOOP_LOAD_INCREMENT_INITIALISE",err,error,*998)
1918 IF(
ASSOCIATED(control_loop))
THEN 1919 IF(
ASSOCIATED(control_loop%LOAD_INCREMENT_LOOP))
THEN 1920 CALL flagerror(
"The load increment loop is already associated for this control loop.",err,error,*998)
1922 ALLOCATE(control_loop%LOAD_INCREMENT_LOOP,stat=err)
1923 IF(err/=0)
CALL flagerror(
"Could not allocate load increment loop for the control loop.",err,error,*999)
1924 control_loop%LOAD_INCREMENT_LOOP%CONTROL_LOOP=>control_loop
1925 control_loop%LOAD_INCREMENT_LOOP%ITERATION_NUMBER=0
1926 control_loop%LOAD_INCREMENT_LOOP%MAXIMUM_NUMBER_OF_ITERATIONS=1
1927 control_loop%LOAD_INCREMENT_LOOP%OUTPUT_NUMBER=0
1930 CALL flagerror(
"Control loop is not associated.",err,error,*998)
1933 exits(
"CONTROL_LOOP_LOAD_INCREMENT_INITIALISE")
1936 998 errorsexits(
"CONTROL_LOOP_LOAD_INCREMENT_INITIALISE",err,error)
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
integer(intg), parameter, public control_loop_progress_output
Progress output from control loop.
subroutine control_loop_while_initialise(CONTROL_LOOP, ERR, ERROR,)
Initialises a while loop for a control loop.
subroutine control_loop_label_get_c(CONTROL_LOOP, LABEL, ERR, ERROR,)
Returns the label of a control loop.
integer(intg), parameter, public solver_timing_output
Timing output from the solver routines plus below.
integer(intg), parameter problem_control_time_loop_type
Time control loop.
Contains information on a time iteration control loop.
recursive subroutine, public control_loop_solver_equations_destroy(CONTROL_LOOP, ERR, ERROR,)
Recursively destroys the solver equations for a control loop and all sub control loops.
subroutine control_loop_time_finalise(TIME_LOOP, ERR, ERROR,)
Finalises a time control loop and deallocates all memory.
This module handles all problem wide constants.
integer(intg), parameter, public control_loop_node
The identifier for a each "leaf" node in a control loop.
subroutine control_loop_load_increment_finalise(LOAD_INCREMENT_LOOP, ERR, ERROR,)
Finalises a load increment loop and deallocates all memory.
subroutine, public control_loop_maximum_iterations_set(CONTROL_LOOP, MAXIMUM_ITERATIONS, ERR, ERROR,)
Sets the maximum number of iterations for a while or load increment control loop. ...
Converts a number to its equivalent varying string representation.
subroutine, public control_loop_sub_loop_get(CONTROL_LOOP, SUB_LOOP_INDEX, SUB_LOOP, ERR, ERROR,)
Gets/returns a pointer to the sub loops as specified by the sub loop index for a control loop...
Contains information on the type of solver to be used.
subroutine, public control_loop_time_output_set(CONTROL_LOOP, OUTPUT_FREQUENCY, ERR, ERROR,)
Sets the output parameters for a time control loop.
subroutine, public control_loop_number_of_sub_loops_get(CONTROL_LOOP, NUMBER_OF_SUB_LOOPS, ERR, ERROR,)
Gets the number of sub loops for a control loop.
integer(intg), parameter problem_control_fixed_loop_type
Fixed iteration control loop.
This module contains all string manipulation and transformation routines.
Contains information on the solvers to be used in a control loop.
integer(intg), parameter problem_control_simple_type
Simple, one iteration control loop.
subroutine, public control_loop_load_output_set(CONTROL_LOOP, OUTPUT_FREQUENCY, ERR, ERROR,)
Sets/changes the output for a load incremented control loop identified by an object.
Contains information on a simple (execute once) control loop.
subroutine, public control_loop_current_times_get(CONTROL_LOOP, CURRENT_TIME, TIME_INCREMENT, ERR, ERROR,)
Gets the current time parameters for a time control loop.
Contains information on a control loop.
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
Contains information on a load-increment control loop.
subroutine, public control_loop_output_type_get(CONTROL_LOOP, OUTPUT_TYPE, ERR, ERROR,)
Gets the output type for a control loop.
subroutine, public control_loop_times_get(CONTROL_LOOP, START_TIME, STOP_TIME, CURRENT_TIME, TIME_INCREMENT, CURRENT_LOOP_ITERATION, OUTPUT_ITERATION_NUMBER, ERR, ERROR,)
Gets the current time parameters for a time control loop.
integer(intg), parameter, public control_loop_no_output
No output from the control loop.
subroutine, public exits(NAME)
Records the exit out of the named procedure.
recursive subroutine, public control_loop_solvers_get(CONTROL_LOOP, SOLVERS, ERR, ERROR,)
Returns a pointer to the solvers for a control loop.
subroutine control_loop_fixed_finalise(FIXED_LOOP, ERR, ERROR,)
Finalises a fixed control loop and deallocates all memory.
This module contains all type definitions in order to avoid cyclic module references.
subroutine, public control_loop_time_input_set(CONTROL_LOOP, INPUT_OPTION, ERR, ERROR,)
Sets the input parameters for a time control loop.
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
subroutine control_loop_load_increment_initialise(CONTROL_LOOP, ERR, ERROR,)
Initialises a load increment loop for a control loop.
subroutine, public controlloop_absolutetoleranceset(controlLoop, absoluteTolerance, err, error,)
Sets the absolute tolerance (convergence condition tolerance) for a while control loop...
Returns the specified control loop as indexed by the control loop identifier from the control loop ro...
subroutine, public control_loop_type_set(CONTROL_LOOP, LOOP_TYPE, ERR, ERROR,)
Sets/changes the control loop type.
subroutine control_loop_get_1(CONTROL_LOOP_ROOT, CONTROL_LOOP_IDENTIFIER, CONTROL_LOOP, ERR, ERROR,)
Returns the specified control loop as indexed by the control loop identifier from the control loop ro...
Contains information on a do-while control loop.
subroutine, public solver_equations_destroy(SOLVER_EQUATIONS, ERR, ERROR,)
Destroys the solver equations.
Contains information about the solver equations for a solver.
subroutine control_loop_get_0(CONTROL_LOOP_ROOT, CONTROL_LOOP_IDENTIFIER, CONTROL_LOOP, ERR, ERROR,)
Returns the specified control loop as indexed by the control loop identifier from the control loop ro...
subroutine control_loop_while_finalise(WHILE_LOOP, ERR, ERROR,)
Finalises a while control loop and deallocates all memory.
subroutine control_loop_simple_finalise(SIMPLE_LOOP, ERR, ERROR,)
Finalises a simple control loop and deallocates all memory.
Contains information for a problem.
integer(intg), parameter, public solver_progress_output
Progress output from solver routines.
subroutine, public control_loop_destroy(CONTROL_LOOP, ERR, ERROR,)
Destroy a control loop.
This module handles all solver routines.
recursive subroutine control_loop_finalise(CONTROL_LOOP, ERR, ERROR,)
Finalise a control loop and deallocate all memory.
subroutine, public solvers_destroy(SOLVERS, ERR, ERROR,)
Destroys the solvers.
subroutine control_loop_simple_initialise(CONTROL_LOOP, ERR, ERROR,)
Initialises a simple loop for a control loop.
subroutine control_loop_initialise(PROBLEM, ERR, ERROR,)
Initialise the control for a problem.
subroutine, public control_loop_create_start(PROBLEM, CONTROL_LOOP, ERR, ERROR,)
Start the process of creating a control loop for a problem.
subroutine control_loop_label_get_vs(CONTROL_LOOP, LABEL, ERR, ERROR,)
Returns the label of a control loop.
subroutine control_loop_label_set_c(CONTROL_LOOP, LABEL, ERR, ERROR,)
Sets the label of a control loop.
recursive subroutine, public control_loop_solvers_destroy(CONTROL_LOOP, ERR, ERROR,)
Recursively destroys the solvers for a control loop and all sub control loops.
subroutine, public control_loop_output_type_set(CONTROL_LOOP, OUTPUT_TYPE, ERR, ERROR,)
Sets/changes the output type for a control loop.
A buffer type to allow for an array of pointers to a CONTROL_LOOP_TYPE.
integer(intg), parameter problem_control_load_increment_loop_type
Load increment control loop.
Contains information on a fixed iteration control loop.
subroutine, public control_loop_times_set(CONTROL_LOOP, START_TIME, STOP_TIME, TIME_INCREMENT, ERR, ERROR,)
Sets the time parameters for a time control loop.
subroutine, public control_loop_iterations_set(CONTROL_LOOP, START_ITERATION, STOP_ITERATION, ITERATION_INCREMENT, ERR, ERROR,)
Sets the iteration parameters for a fixed control loop.
This module handles all control loop routines.
subroutine control_loop_fixed_initialise(CONTROL_LOOP, ERR, ERROR,)
Initialises a fixed loop for a control loop.
integer(intg), parameter, public control_loop_timing_output
Timing output from the control loop.
subroutine, public control_loop_number_of_iterations_get(CONTROL_LOOP, NUMBER_OF_ITERATIONS, ERR, ERROR,)
Gets the number of iterations for a time type control loop. If the value is not set to something /=0...
recursive subroutine, public control_loop_create_finish(CONTROL_LOOP, ERR, ERROR,)
Finish the process of creating a control loop.
subroutine control_loop_time_initialise(CONTROL_LOOP, ERR, ERROR,)
Initialises a time loop for a control loop.
subroutine, public control_loop_number_of_iterations_set(CONTROL_LOOP, NUMBER_OF_ITERATIONS, ERR, ERROR,)
Sets the number of iterations for a time type control loop. If set to 0 (default), it will be computed by start and stop time and time increment.
subroutine, public control_loop_number_of_sub_loops_set(CONTROL_LOOP, NUMBER_OF_SUB_LOOPS, ERR, ERROR,)
Sets/changes the number of sub loops in a control loop.
subroutine control_loop_label_set_vs(CONTROL_LOOP, LABEL, ERR, ERROR,)
Sets the label of a control loop.
Flags an error condition.
integer(intg), parameter problem_control_while_loop_type
While control loop.
This module contains all kind definitions.