gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
dc_clock.f90
Go to the documentation of this file.
1! -*- mode: f90; coding: utf-8 -*-
2!-----------------------------------------------------------------------
3! Copyright (c) 2006-2026 Gtool Development Group. All rights reserved.
4!-----------------------------------------------------------------------
86 use dc_types, only: string, dp
89 ! MPI ライブラリ
90 ! MPI library
91 !
92 use mpi
93 implicit none
94 private
95 public:: clock
98 public:: operator(+), operator(-)
100 !-----------------------------------------------
101 ! 後方互換用
102 ! For backward compatibility
103 public:: create, Close, start, stop, putline, result, set_name
104 public:: get, evalsec, tochar, predict
118 type clock
119 private
120 character(STRING):: name
121 real(dp):: start_time ! 計測を開始した時間
122 ! (計測の一時停止中には負の値が設定される)
123 real(dp):: elapsed_time ! 経過時間の累計値
124 type(dc_datetime):: start_date ! 計測を開始した日時
125 logical:: initialized = .false. ! CLOCK 構造体の初期化チェック用フラグ
126 end type clock
128 module procedure dcclockcreate0
129 end interface
130 interface dcclockclose
131 module procedure dcclockclose0
132 end interface
133 interface dcclockstart
134 module procedure dcclockstart0
135 end interface
136 interface dcclockstop
137 module procedure dcclockstop0
138 end interface
140 module procedure dcclockputline0
141 end interface
142 interface dcclockget
143 module procedure dcclockgetr
144 module procedure dcclockgetd
145 end interface
147 module procedure dcclockevalsecd
148 end interface
150 module procedure dcclocktochar0
151 end interface
153 module procedure dcclockresult0
154 end interface
155 interface operator(+)
156 module procedure dcclockadd
157 end interface
158 interface operator(-)
159 module procedure dcclocksubtract
160 end interface
162 module procedure dcclocksetname0
163 end interface
165 module procedure dcclockpredict0
166 end interface
167 !-----------------------------------------------
168 ! 後方互換用
169 ! For backward compatibility
170 interface create
171 module procedure dcclockcreate0
172 end interface
173 interface close
174 module procedure dcclockclose0
175 end interface
176 interface start
177 module procedure dcclockstart0
178 end interface
179 interface stop
180 module procedure dcclockstop0
181 end interface
182 interface putline
183 module procedure dcclockputline0
184 end interface
185 interface get
186 module procedure dcclockgetr
187 module procedure dcclockgetd
188 end interface
189 interface evalsec
190 module procedure dcclockevalsecd
191 end interface
192 interface tochar
193 module procedure dcclocktochar0
194 end interface
195 interface result
196 module procedure dcclockresult0
197 end interface
198 interface set_name
199 module procedure dcclocksetname0
200 end interface
201 interface predict
202 module procedure dcclockpredict0
203 end interface
204 character(*), parameter:: version = &
205 & '$Name: $' // &
206 & '$Id: dc_clock.F90,v 1.1 2009-03-20 09:09:53 morikawa Exp $'
207contains
227 subroutine dcclockcreate0(clk, name)
228 use dc_message, only: messagenotify
229 use dc_date, only: dcdatetimecreate
230 implicit none
231 type(clock), intent(out):: clk
232 character(*), intent(in):: name
233 character(*), parameter:: subname = 'DCClockCreate'
234 continue
235 call beginsub(subname, 'name=%c', c1=trim(name), version=version)
236 if (clk % initialized) then
237 call messagenotify('W', subname, 'This argument (type CLOCK) is already initialized.')
238 call dbgmessage('already initialized')
239 goto 999
240 end if
241 clk % name = name
242 clk % elapsed_time = 0.0
243 clk % start_time = - 1.0
244 clk % initialized = .true.
245 call dcdatetimecreate(clk % start_date)
246 call dbgmessage('normal initialized')
247999 continue
248 call endsub(subname)
249 end subroutine dcclockcreate0
265 subroutine dcclockclose0(clk)
266 implicit none
267 type(clock), intent(inout):: clk
268 character(*), parameter:: subname = 'DCClockClose'
269 continue
270 call beginsub(subname)
271 if (clk % initialized) then
272 clk % initialized = .false.
273 clk % name = ''
274 end if
275 call endsub(subname)
276 end subroutine dcclockclose0
301 subroutine dcclockstart0(clk, err)
302 use dc_message, only: messagenotify
303 use dc_string, only: tochar
305 use dc_date, only: evalsec
306 !$ use omp_lib
307 implicit none
308 type(clock), intent(inout):: clk
309 logical, intent(out), optional:: err
310 character(STRING):: cause_c
311 integer:: stat
312 character(*), parameter:: subname = 'DCClockStart'
313 continue
314 call beginsub(subname)
315 stat = dc_noerr
316 cause_c = 'CLOCK'
317 if (.not. clk % initialized) then
318 call messagenotify('W', subname, 'Call Create before Start in dc_clock.')
319 call dbgmessage('Ignored because input argument was not initialized.')
320 stat = dc_enotinit
321 goto 999
322 end if
323 call cpu_time(clk % start_time) ! (out)
324 !$ clk % start_time = omp_get_wtime()
325 call dbgmessage('name=%c, cpu_time=%f', &
326 & c1=trim(clk % name), d=(/clk % start_time/) )
327999 continue
328 call storeerror(stat, subname, err, cause_c)
329 call endsub(subname)
330 end subroutine dcclockstart0
355 subroutine dcclockstop0(clk, err)
356 use dc_message, only: messagenotify
357 use dc_string, only: tochar
359 use dc_date, only: evalsec, operator(+), operator(-)
360 use dc_date_types, only: dc_difftime
361 use dc_types, only: dp
362 !$ use omp_lib
363 implicit none
364 type(clock), intent(inout):: clk
365 logical, intent(out), optional:: err
366 character(STRING):: cause_c
367 real(DP):: stop_time
368 integer:: stat
369 character(*), parameter:: subname = 'DCClockStop'
370 continue
371 call beginsub(subname)
372 stat = dc_noerr
373 cause_c = 'CLOCK'
374 if (.not. clk % initialized) then
375 call messagenotify('W', subname, 'Call Create before Stop in dc_clock.')
376 call dbgmessage('Ignored because input argument was not initialized.')
377 stat = dc_enotinit
378 goto 999
379 elseif (clk % start_time < 0.0_dp) then
380 call messagenotify('W', subname, 'Call Start before Stop in dc_clock.')
381 call dbgmessage('Ignored because input argument was not started.')
382 goto 999
383 end if
384 call cpu_time(stop_time)
385 !$ stop_time = omp_get_wtime()
386 clk % elapsed_time = clk % elapsed_time + stop_time - clk % start_time
387 clk % start_time = - 1.0
388 call dbgmessage('name=%c, cpu_time=%f, elapsed_time=%f', &
389 & c1=trim(clk % name), d=(/stop_time, clk % elapsed_time/))
390999 continue
391 call storeerror(stat, subname, err, cause_c)
392 call endsub(subname)
393 end subroutine dcclockstop0
420 subroutine dcclockgetr(clk, sec, err) !:doc-priority 40:
421 use dc_message, only: messagenotify
422 use dc_date, only: evalsec
423 use dc_string, only: cprintft
425 implicit none
426 type(clock), intent(in):: clk
427 real, intent(out):: sec
428 logical, intent(out), optional:: err
429 character(STRING):: cause_c
430 integer:: stat
431 character(*), parameter:: subname = 'DCClockGetR'
432 continue
433 call beginsub(subname)
434 stat = dc_noerr
435 cause_c = 'CLOCK'
436 if (.not. clk % initialized) then
437 call messagenotify('W', subname, 'Call Create before Get in dc_clock.')
438 call dbgmessage('Ignored because input argument was not initialized.')
439 stat = dc_enotinit
440 goto 999
441 end if
442 sec = real(clk % elapsed_time, kind=kind(sec))
443 call dbgmessage('name=%c, return sec=<%r>', &
444 & c1=trim(clk % name), r=(/sec/))
445999 continue
446 call storeerror(stat, subname, err, cause_c)
447 call endsub(subname)
448 end subroutine dcclockgetr
475 subroutine dcclockgetd(clk, sec, err) !:doc-priority 60:
476 use dc_types, only: dp
477 use dc_string, only: cprintf
478 use dc_message, only: messagenotify
479 use dc_date, only: evalsec
481 implicit none
482 type(clock), intent(in):: clk
483 real(DP), intent(out):: sec
484 logical, intent(out), optional:: err
485 character(STRING):: cause_c
486 integer:: stat
487 character(*), parameter:: subname = 'DCClockGetD'
488 continue
489 call beginsub(subname)
490 stat = dc_noerr
491 cause_c = 'CLOCK'
492 if (.not. clk % initialized) then
493 call messagenotify('W', subname, 'Call Create before Get in dc_clock.')
494 call dbgmessage('Ignored because input argument was not initialized.')
495 stat = dc_enotinit
496 goto 999
497 end if
498 sec = clk % elapsed_time
499 call dbgmessage('name=%c, return sec=<%f>', &
500 & c1=trim(clk % name), d=(/sec/))
501999 continue
502 call storeerror(stat, subname, err, cause_c)
503 call endsub(subname)
504 end subroutine dcclockgetd
525 function dcclockevalsecd(clk) result(result)
526 use dc_types, only: dp
527 implicit none
528 type(clock), intent(in):: clk
529 real(dp):: result
530 logical:: err
531 continue
532 call dcclockgetd(clk, result, err)
533 if (err) result = -1.0_dp
534 end function dcclockevalsecd
555 function dcclocktochar0(clk) result(result)
556 use dc_string, only: cprintf
557 use dc_date, only: evalsec
558 implicit none
559 type(clock), intent(in):: clk
560 character(STRING):: result
561 character(20):: clk_name
562 integer:: name_len
563 continue
564 clk_name = ''
565 name_len = min(len(clk_name), len_trim(clk % name))
566 if (name_len > 0) then
567 clk_name(1:name_len) = clk % name(1:name_len)
568 end if
569 if (clk % initialized) then
570 result = cprintf(' %c%c %c', c1 = clk_name, &
571 & c2=trim(result_value_form(clk % elapsed_time)), &
572 & c3=trim(fit_unit_value(clk % elapsed_time)))
573 else
574 result = ''
575 end if
576 end function dcclocktochar0
608 subroutine dcclockputline0(clk, unit, indent, err)
609 use dc_types, only: stdout
610 use dc_message, only: messagenotify
611 use dc_string, only: printf, tochar, cprintf
612 use dc_date, only: evalsec, evalday, tochar
614 use dc_types, only: dp
615 implicit none
616 type(clock), intent(in):: clk
617 integer, intent(in), optional:: unit
618 character(*), intent(in), optional:: indent
619 logical, intent(out), optional:: err
620 integer:: out_unit
621 character(STRING):: cause_c
622 integer:: stat
623 integer:: indent_len
624 character(STRING):: indent_str
625 character(*), parameter:: subname = 'DCClockPutLine'
626 continue
627 call beginsub(subname)
628 stat = dc_noerr
629 cause_c = 'CLOCK'
630 if (.not. clk % initialized) then
631 call messagenotify('W', subname, 'Call Create before PutLine in dc_clock.')
632 call dbgmessage('Ignored because input argument was not initialized.')
633 stat = dc_enotinit
634 goto 999
635 end if
636 if (present(unit)) then
637 out_unit = unit
638 else
639 out_unit = stdout
640 end if
641 indent_len = 0
642 indent_str = ''
643 if (present(indent)) then
644 if (len(indent) /= 0) then
645 indent_len = len(indent)
646 indent_str(1:indent_len) = indent
647 end if
648 end if
649 call printf(out_unit, &
650 & indent_str(1:indent_len) // &
651 & '#<CLOCK:: @name=%c @clocking=%y @elapsed_time=%f sec. %c @start_date=%c>', &
652 & c1=trim(clk % name), l=(/clk % start_time > 0.0_dp/), &
653 & d=(/clk % elapsed_time/), &
654 & c2=trim(fit_unit_value(clk % elapsed_time)), &
655 & c3=trim(tochar(clk % start_date)))
656 call dbgmessage('name=%c, output to device number %d', &
657 & c1=trim(clk % name), i=(/out_unit/))
658999 continue
659 call storeerror(stat, subname, err, cause_c)
660 call endsub(subname)
661 end subroutine dcclockputline0
716 subroutine dcclockresult0(clks, unit, total_auto, clk_total, total_name, err)
717 use dc_types, only: stdout, string, dp
718 use dc_message, only: messagenotify
719 use dc_string, only: printf, tochar, cprintf
720 use dc_date, only: evalsec
722 implicit none
723 type(clock), intent(in):: clks(:)
724 integer, intent(in), optional:: unit
725 logical, intent(in), optional:: total_auto
726 type(clock), intent(in), optional:: clk_total
727 logical, intent(out), optional:: err
728 character(*), intent(in), optional:: total_name
729 integer:: out_unit, i, clks_size, ra
730 character(20):: clk_name
731 integer:: name_len
732 character(STRING):: cause_c
733 character(STRING):: total_name_work
734 type(clock):: clk_auto_total
735 logical:: total_print_complete
736 real(DP):: elapsed_time_val_cor
737 integer:: stat
738 character(*), parameter:: total_time_mes = ' TOTAL TIME = '
739 logical:: initflag_mpi
740 integer:: err_mpi
741 integer:: myrank_mpi, nprocs_mpi
742 character(*), parameter:: subname = 'DCClockResult'
743 continue
744 call beginsub(subname)
745 stat = dc_noerr
746 cause_c = 'CLOCK'
747 clks_size = size(clks)
748 do i = 1, clks_size
749 if (.not. clks(i) % initialized) then
750 call messagenotify('W', subname, 'Call Create before Result in dc_clock.')
751 call dbgmessage('Ignored because input argument was not initialized.')
752 stat = dc_enotinit
753 goto 999
754 end if
755 end do
756 if (present(unit)) then
757 out_unit = unit
758 else
759 out_unit = stdout
760 end if
761 if (present(total_name)) then
762 total_name_work = ' (' // trim(total_name) // ')'
763 else
764 total_name_work = ''
765 end if
766 myrank_mpi = -1
767 nprocs_mpi = 1
768 call mpi_initialized(initflag_mpi, err_mpi)
769 if ( initflag_mpi ) then
770 call mpi_comm_rank(mpi_comm_world, myrank_mpi, err_mpi)
771 call mpi_comm_size(mpi_comm_world, nprocs_mpi, err_mpi)
772 end if
773 do ra = 0, nprocs_mpi - 1
774 if ( initflag_mpi ) call mpi_barrier(mpi_comm_world, err_mpi)
775 if ( myrank_mpi > -1 .and. ra /= myrank_mpi ) cycle
776 call printf(out_unit, '')
777 if ( myrank_mpi < 0 ) then
778 call printf(out_unit, &
779 & ' ############## CPU TIME SUMMARY%c################', &
780 & c1=trim(total_name_work) // ' ')
781 else
782 call printf(out_unit, &
783 & ' ####### CPU TIME SUMMARY%c#### [rank=%06d] ####', &
784 & c1=trim(total_name_work) // ' ', &
785 & i = (/myrank_mpi/) )
786 end if
787 do i = 1, clks_size
788 clk_name = ''
789 name_len = min(len(clk_name), len_trim(clks(i) % name))
790 if (name_len > 0) then
791 clk_name(1:name_len) = clks(i) % name(1:name_len)
792 end if
793 elapsed_time_val_cor = clks(i) % elapsed_time
794 if (elapsed_time_val_cor < 0.0_dp) elapsed_time_val_cor = 0.0_dp
795 call printf(out_unit, &
796 & ' %c%c %c', c1=clk_name, &
797 & c2=trim(result_value_form(elapsed_time_val_cor)), &
798 & c3=trim(fit_unit_value(clks(i) % elapsed_time)))
799 end do
800 total_print_complete = .false.
801 if (present(clk_total)) then
802 if (clk_total % initialized) then
803 call printf(out_unit, &
804 & ' ------------------------------------------------')
805 elapsed_time_val_cor = clk_total % elapsed_time
806 if (elapsed_time_val_cor < 0.0_dp) elapsed_time_val_cor = 0.0_dp
807 call printf(out_unit, &
808 & ' %c%c %c', c1=total_time_mes, &
809 & c2=trim(result_value_form(elapsed_time_val_cor)), &
810 & c3=trim(fit_unit_value(clk_total % elapsed_time)))
811 total_print_complete = .true.
812 end if
813 end if
814 if (present(total_auto) .and. .not. total_print_complete) then
815 if (total_auto) then
816 clk_auto_total = clks(1)
817 if (clks_size > 1) then
818 do i = 2, clks_size
819 clk_auto_total = clk_auto_total + clks(i)
820 end do
821 end if
822 call printf(out_unit, &
823 & ' ------------------------------------------------')
824 elapsed_time_val_cor = clk_auto_total % elapsed_time
825 if (elapsed_time_val_cor < 0.0_dp) elapsed_time_val_cor = 0.0_dp
826 call printf(out_unit, &
827 & ' %c%c %c', c1=total_time_mes, &
828 & c2=trim(result_value_form(elapsed_time_val_cor)), &
829 & c3=trim(fit_unit_value(clk_auto_total % elapsed_time)))
830 end if
831 end if
832 call dbgmessage('total results, output to device number %d', &
833 & i=(/out_unit/))
834 end do
835999 continue
836 call storeerror(stat, subname, err, cause_c)
837 call endsub(subname)
838 end subroutine dcclockresult0
842 function result_value_form(value) result(result)
843 use dc_types, only: dp, token
844 implicit none
845 character(TOKEN):: result
846 real(DP), intent(in):: value
847 continue
848 write(result, "(e15.6)") value
849 end function result_value_form
858 function fit_unit_value(sec, diff) result(result)
859 use dc_types, only: dp, token
860 use dc_date_types, only: dc_difftime
861 use dc_date, only: dcdifftimecreate, evalday, evalhour, evalmin, evalsec
862 implicit none
863 character(TOKEN):: result
864 real(DP), intent(in):: sec
865 type(dc_difftime), intent(in), optional:: diff
866 type(dc_difftime):: diffw
867 character(TOKEN):: unit
868 real(DP):: value
869 character(TOKEN):: cval
870 continue
871 if ( present(diff) ) then
872 diffw = diff
873 else
874 call dcdifftimecreate( diffw, sec = sec )
875 end if
876 if (evalday(diffw) > 1.0_dp) then
877 unit = ' days'
878 value = evalday(diffw)
879 elseif (evalhour(diffw) > 1.0_dp) then
880 unit = ' hrs.'
881 value = evalhour(diffw)
882 elseif (evalmin(diffw) > 1.0_dp) then
883 unit = ' minutes'
884 value = evalmin(diffw)
885 else
886 result = ''
887 return
888 end if
889 cval = printf_g5_2(value)
890 result = '(' // trim(adjustl(cval)) // trim(unit) // ')'
891 end function fit_unit_value
897 function printf_g5_2(value) result(result)
898 use dc_types, only: dp, token
899 use dc_string, only: cprintft
900 implicit none
901 character(TOKEN):: result
902 real(DP), intent(in):: value
903 character(TOKEN):: int_part, dem_part
904 integer:: dem_int
905 continue
906 write(int_part, "(i20)") int(value)
907 dem_int = nint((value - int(value)) * 100)
908 if (dem_int < 0) dem_int = - dem_int
909 if (dem_int == 100) then
910 dem_int = 0
911 write(int_part, "(i20)") int(value) + 1
912 end if
913 dem_part = cprintft('%02d', i=(/dem_int/))
914 result = trim(adjustl(int_part)) // '.' // trim(dem_part)
915 end function printf_g5_2
940 function dcclockadd(clk1, clk2) result(clk_total)
941 use dc_string, only: cprintf
942 use dc_date, only: operator(+), operator(<)
943 implicit none
944 type(clock), intent(in):: clk1
945 type(clock), intent(in):: clk2
946 type(clock):: clk_total
947 continue
948 if (.not. clk1 % initialized .or. .not. clk2 % initialized) then
949 clk_total % initialized = .false.
950 return
951 end if
952 clk_total % name = cprintf('%c+%c', &
953 & c1=trim(clk1 % name), c2=trim(clk2 % name))
954 clk_total % start_time = - 1.0
955 clk_total % initialized = .true.
956 clk_total % elapsed_time = 0.0
957 if (clk1 % start_date < clk2 % start_date) then
958 clk_total % start_date = clk1 % start_date
959 else
960 clk_total % start_date = clk2 % start_date
961 end if
962 clk_total % elapsed_time = &
963 & clk1 % elapsed_time + clk2 % elapsed_time
964 end function dcclockadd
989 function dcclocksubtract(clk1, clk2) result(clk_total)
990 use dc_string, only: cprintf
991 use dc_date, only: operator(-), operator(<)
992 implicit none
993 type(clock), intent(in):: clk1
994 type(clock), intent(in):: clk2
995 type(clock):: clk_total
996 continue
997 if (.not. clk1 % initialized .or. .not. clk2 % initialized) then
998 clk_total % initialized = .false.
999 return
1000 end if
1001 clk_total % name = cprintf('%c-%c', &
1002 & c1=trim(clk1 % name), c2=trim(clk2 % name))
1003 clk_total % start_time = - 1.0
1004 clk_total % initialized = .true.
1005 clk_total % elapsed_time = 0.0
1006 if (clk1 % start_date < clk2 % start_date) then
1007 clk_total % start_date = clk1 % start_date
1008 else
1009 clk_total % start_date = clk2 % start_date
1010 end if
1011 clk_total % elapsed_time = &
1012 & clk1 % elapsed_time - clk2 % elapsed_time
1013 end function dcclocksubtract
1042 subroutine dcclocksetname0(clk, name, err)
1043 use dc_message, only: messagenotify
1044 use dc_string, only: tochar, cprintf
1046 implicit none
1047 type(clock), intent(inout):: clk
1048 character(*), intent(in):: name
1049 logical, intent(out), optional:: err
1050 character(STRING):: cause_c
1051 integer:: stat
1052 character(*), parameter:: subname = 'DCClockSetName'
1053 continue
1054 call beginsub(subname)
1055 stat = dc_noerr
1056 cause_c = 'CLOCK'
1057 if (.not. clk % initialized) then
1058 call messagenotify('W', subname, 'Call Create before Set_Name in dc_clock.')
1059 call dbgmessage('Ignored because input argument was not initialized.')
1060 stat = dc_enotinit
1061 goto 999
1062 end if
1063 clk % name = name
1064 call dbgmessage('set new name "%c"', c1=trim(clk % name))
1065999 continue
1066 call storeerror(stat, subname, err, cause_c)
1067 call endsub(subname)
1068 end subroutine dcclocksetname0
1137 subroutine dcclockpredict0(clk, progress, unit, err)
1138 use dc_types, only: stdout, dp
1139 use dc_message, only: messagenotify
1140 use dc_string, only: tochar, cprintf, printf
1143 use dc_date, only: operator(+), dcdatetimecreate, tochar, evalsec, &
1144 & dcdifftimecreate
1145 implicit none
1146 type(clock), intent(in):: clk
1147 real, intent(in):: progress
1148 integer, intent(in), optional:: unit
1149 logical, intent(out), optional:: err
1150 character(STRING):: cause_c
1151 integer:: stat, out_unit
1152 type(dc_difftime):: remain_diff
1153 type(dc_datetime):: comp_date, cur_date
1154 character(7):: prog_percent
1155 character(25):: prog_bar
1156 integer:: prog_bar_ptr
1157 real:: prog_valid
1158 logical:: initflag_mpi
1159 integer:: err_mpi, myrank_mpi
1160 character(*), parameter:: subname = 'DCClockPredict'
1161 continue
1162 call beginsub(subname)
1163 stat = dc_noerr
1164 cause_c = 'CLOCK'
1165 if (.not. clk % initialized) then
1166 call messagenotify('W', subname, 'Call Create before Predict in dc_clock.')
1167 call dbgmessage('Ignored because input argument was not initialized.')
1168 stat = dc_enotinit
1169 goto 999
1170 end if
1171 if (progress <= 0.0) then
1172 call messagenotify('W', subname, 'Specify 0.0 -- 1.0 value to "progress"')
1173 return
1174 elseif (progress > 1.0) then
1175 call messagenotify('W', subname, 'Over 1.0 value to "progress" was modified to 1.0')
1176 prog_valid = 1.0
1177 else
1178 prog_valid = progress
1179 end if
1180 if (present(unit)) then
1181 out_unit = unit
1182 else
1183 out_unit = stdout
1184 end if
1185 call dcdifftimecreate( remain_diff, &
1186 & sec = real(nint(evalsec(clk) / prog_valid * (1.0 - prog_valid)), dp) )
1187 call dcdatetimecreate(cur_date)
1188 comp_date = cur_date + remain_diff
1189 prog_percent = ''
1190 prog_percent = adjustr(trim(printf_g5_2(real(prog_valid * 100, dp))) // '%')
1191 prog_bar = ''
1192 prog_bar_ptr = int(prog_valid * 25)
1193 if (prog_bar_ptr > 0) prog_bar(1:prog_bar_ptr) = '*************************'
1194 call mpi_initialized(initflag_mpi, err_mpi)
1195 if ( initflag_mpi ) then
1196 call mpi_comm_rank(mpi_comm_world, myrank_mpi, err_mpi)
1197 if ( myrank_mpi /= 0 ) goto 999
1198 end if
1199 call printf(out_unit, '')
1200 call printf(out_unit, &
1201 & ' ########## PREDICTION OF CALCULATION ###########')
1202 call printf(out_unit, &
1203 & ' Start Date %c', c1=trim(tochar(clk % start_date)))
1204 call printf(out_unit, &
1205 & ' Current Date %c', c1=trim(tochar(cur_date)))
1206 call printf(out_unit, &
1207 & ' Progress %c [%c]', c1=prog_percent, c2=prog_bar)
1208 call printf(out_unit, &
1209 & ' Remaining CPU TIME %c %c', &
1210 & c1=trim(result_value_form(evalsec(remain_diff))), &
1211 & c2=trim(fit_unit_value(0.0_dp, remain_diff)))
1212 call printf(out_unit, &
1213 & ' Completion Date %c', c1=trim(tochar(comp_date)))
1214999 continue
1215 call storeerror(stat, subname, err, cause_c)
1216 call endsub(subname)
1217 end subroutine dcclockpredict0
1219end module dc_clock
Monitor of CPU TIME.
Definition dc_clock.f90:85
Derived types and parameters for date and time.
Date and time manipulation module.
Definition dc_date.f90:57
Error handling module.
Definition dc_error.f90:454
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition dc_error.f90:891
integer, parameter, public dc_noerr
Error storage variables
Definition dc_error.f90:468
integer, parameter, public dc_enotinit
-400 or less: DC utilities errors
Definition dc_error.f90:534
Message output module.
Handling character types.
Definition dc_string.f90:83
Debug tracing module.
Definition dc_trace.f90:150
subroutine, public dbgmessage(fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:680
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
Definition dc_trace.f90:476
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:599
Provides kind type parameter values.
Definition dc_types.f90:55
integer, parameter, public stdout
Unit number for Standard OUTPUT
Definition dc_types.f90:117
integer, parameter, public token
Character length for word, token
Definition dc_types.f90:128
integer, parameter, public dp
Double Precision Real number
Definition dc_types.f90:92
integer, parameter, public string
Character length for string
Definition dc_types.f90:137