Commit 81cd36fa authored by Marco Govoni's avatar Marco Govoni
Browse files

Added strings, changed clocks.

parent 506d9a85
......@@ -65,11 +65,12 @@ MODULE westin
!
SAVE
!
CHARACTER(LEN=256) :: outdir ! main directory
CHARACTER(LEN=256) :: west_prefix
CHARACTER(LEN=256) :: outdir
CHARACTER(LEN=256) :: qe_prefix
!
CHARACTER(LEN=256) :: main_input_file, main_output_file
CHARACTER(LEN=256) :: savedir ! outdir/west_prefix.code.save
CHARACTER(LEN=256) :: main_input_file ! input file (json format)
CHARACTER(LEN=256) :: logfile ! savedir/logfile.json
!
END MODULE
!
......@@ -102,7 +103,6 @@ MODULE wstat_center
! Common workspace
!
COMPLEX(DP) :: alphapv_dfpt
!CHARACTER(LEN=256) :: wstat_dirname
CHARACTER(LEN=256) :: wstat_save_dir
CHARACTER(LEN=256) :: wstat_output_dir
CHARACTER(LEN=256) :: wstat_restart_dir
......
......@@ -13,12 +13,14 @@ IFLAGS=
TOOLS_OBJS = \
io_push.o \
strings.o \
fetch_input.o \
set_dirs.o \
west_print_clocks.o \
exx_go.o \
exx_ungo.o \
report_dynamical_memory.o \
parse_command_arguments.o \
set_dirs.o \
do_setup.o \
linear_algebra_kernel.o \
human_readable_time.o \
......
......@@ -11,7 +11,7 @@
! Marco Govoni
!
!-----------------------------------------------------------------------
SUBROUTINE fetch_input( num_drivers, driver )
SUBROUTINE fetch_input( num_drivers, driver, verbose )
!-----------------------------------------------------------------------
!
USE json_module, ONLY : json_file
......@@ -30,6 +30,7 @@ SUBROUTINE fetch_input( num_drivers, driver )
!
INTEGER, INTENT(IN) :: num_drivers
INTEGER, INTENT(IN) :: driver(num_drivers)
LOGICAL, INTENT(IN) :: verbose
!
! Workspace
!
......@@ -44,6 +45,7 @@ SUBROUTINE fetch_input( num_drivers, driver )
REAL(DP) :: rval
INTEGER :: ival
LOGICAL :: lval
INTEGER :: iunit
!
CALL start_clock('fetch_input')
!
......@@ -226,11 +228,9 @@ SUBROUTINE fetch_input( num_drivers, driver )
!
ENDIF
!
! BCAST and REPORT
! BCAST & CHECKS
!
IF ( ANY(driver(:)==1) ) THEN
!
! BCAST
!
CALL mp_bcast(qe_prefix,root,world_comm)
prefix=qe_prefix
......@@ -238,22 +238,9 @@ SUBROUTINE fetch_input( num_drivers, driver )
tmp_dir = trimcheck (outdir)
CALL mp_bcast(tmp_dir,root,world_comm)
!
! REPORT
!
CALL io_push_title("I/O Summary : input_west")
!
numsp = 14
CALL io_push_c256('qe_prefix',qe_prefix,numsp)
CALL io_push_c256('west_prefix',qe_prefix,numsp)
CALL io_push_c256('outdir',outdir,numsp)
!
CALL io_push_bar()
!
ENDIF
!
IF ( ANY(driver(:)==2) ) THEN
!
! BCAST
!
CALL mp_bcast(wstat_calculation,root,world_comm)
CALL mp_bcast(n_pdep_eigen,root,world_comm)
......@@ -268,26 +255,6 @@ SUBROUTINE fetch_input( num_drivers, driver )
CALL mp_bcast(l_minimize_exx_if_active,root,world_comm)
CALL mp_bcast(l_use_ecutrho,root,world_comm)
!
! REPORT
!
CALL io_push_title('I/O Summary : wstat_control')
!
numsp=30
CALL io_push_value('wstat_calculation',wstat_calculation,numsp)
CALL io_push_value('n_pdep_eigen',n_pdep_eigen,numsp)
CALL io_push_value('n_pdep_times',n_pdep_times,numsp)
CALL io_push_value('n_pdep_maxiter',n_pdep_maxiter,numsp)
CALL io_push_value('n_dfpt_maxiter',n_dfpt_maxiter,numsp)
CALL io_push_value('n_pdep_read_from_file',n_pdep_read_from_file,numsp)
CALL io_push_es0('trev_pdep',trev_pdep,numsp)
CALL io_push_es0('trev_pdep_rel',trev_pdep_rel,numsp)
CALL io_push_es0('tr2_dfpt',tr2_dfpt,numsp)
CALL io_push_value('l_kinetic_only',l_kinetic_only,numsp)
CALL io_push_value('l_minimize_exx_if_active',l_minimize_exx_if_active,numsp)
CALL io_push_value('l_use_ecutrho',l_use_ecutrho,numsp)
!
CALL io_push_bar()
!
! CHECKS
!
SELECT CASE(wstat_calculation)
......@@ -310,8 +277,6 @@ SUBROUTINE fetch_input( num_drivers, driver )
ENDIF
!
IF ( ANY(driver(:)==3) ) THEN
!
! BCAST
!
CALL mp_bcast(wfreq_calculation,root,world_comm)
CALL mp_bcast(n_pdep_eigen_to_use,root,world_comm)
......@@ -332,34 +297,6 @@ SUBROUTINE fetch_input( num_drivers, driver )
CALL mp_bcast(ecut_spectralf,root,world_comm)
CALL mp_bcast(n_spectralf,root,world_comm)
!
! DISPLAY
!
CALL io_push_title('I/O Summary : wfreq_control')
!
numsp=40
CALL io_push_value('wfreq_calculation',wfreq_calculation,numsp)
CALL io_push_value('n_pdep_eigen_to_use',n_pdep_eigen_to_use,numsp)
CALL io_push_value('qp_bandrange(1)',qp_bandrange(1),numsp)
CALL io_push_value('qp_bandrange(2)',qp_bandrange(2),numsp)
CALL io_push_value('macropol_calculation',macropol_calculation,numsp)
CALL io_push_value('n_lanczos',n_lanczos,numsp)
CALL io_push_value('n_imfreq',n_imfreq,numsp)
CALL io_push_value('n_refreq',n_refreq,numsp)
CALL io_push_value('ecut_imfreq [Ry]',ecut_imfreq,numsp)
CALL io_push_value('ecut_refreq [Ry]',ecut_refreq,numsp)
CALL io_push_value('wfreq_eta [Ry]',wfreq_eta,numsp)
CALL io_push_value('n_secant_maxiter',n_secant_maxiter,numsp)
CALL io_push_value('trev_secant [Ry]',trev_secant,numsp)
CALL io_push_value('l_enable_lanczos',l_enable_lanczos,numsp)
CALL io_push_value('l_enable_gwetot',l_enable_gwetot,numsp)
CALL io_push_value('div_kind_hf',div_kind_hf,numsp)
CALL io_push_value('o_restart_time [min]',o_restart_time,numsp)
CALL io_push_value('ecut_spectralf(1) [Ry]',ecut_spectralf(1),numsp)
CALL io_push_value('ecut_spectralf(2) [Ry]',ecut_spectralf(2),numsp)
CALL io_push_value('n_spectralf',n_spectralf,numsp)
!
CALL io_push_bar()
!
! CHECKS
!
IF( n_lanczos < 2 ) CALL errore('fetch_input','Err: n_lanczos<2',1)
......@@ -386,8 +323,6 @@ SUBROUTINE fetch_input( num_drivers, driver )
ENDIF
!
IF ( ANY(driver(:)==4) ) THEN
!
! BCAST
!
CALL mp_bcast(westpp_calculation,root,world_comm)
CALL mp_bcast(westpp_range,root,world_comm)
......@@ -399,26 +334,6 @@ SUBROUTINE fetch_input( num_drivers, driver )
CALL mp_bcast(westpp_rmax,root,world_comm)
CALL mp_bcast(westpp_epsinfty,root,world_comm)
!
! REPORT
!
CALL io_push_title('I/O Summary : westpp_control')
!
numsp=40
CALL io_push_value('westpp_calculation',westpp_calculation,numsp)
CALL io_push_value('westpp_range(1)',westpp_range(1),numsp)
CALL io_push_value('westpp_range(2)',westpp_range(2),numsp)
CALL io_push_value('westpp_format',westpp_format,numsp)
CALL io_push_value('westpp_sign',westpp_sign,numsp)
CALL io_push_value('westpp_n_pdep_eigen_to_use',westpp_n_pdep_eigen_to_use,numsp)
CALL io_push_value('westpp_r0(1)',westpp_r0(1),numsp)
CALL io_push_value('westpp_r0(2)',westpp_r0(2),numsp)
CALL io_push_value('westpp_r0(3)',westpp_r0(3),numsp)
CALL io_push_value('westpp_nr',westpp_nr,numsp)
CALL io_push_value('westpp_rmax',westpp_rmax,numsp)
CALL io_push_value('westpp_epsinfty',westpp_epsinfty,numsp)
!
CALL io_push_bar()
!
! CHECKS
!
IF( westpp_range(1) < 1 ) CALL errore('fetch_input','Err: westpp_range(1)<1',1)
......@@ -431,6 +346,163 @@ SUBROUTINE fetch_input( num_drivers, driver )
!
ENDIF
!
! REPORT
!
IF ( verbose ) THEN
!
CALL json%initialize()
!
CALL json%load_file(filename=TRIM(logfile))
!
IF ( ANY(driver(:)==1) ) THEN
!
! REPORT
!
CALL io_push_title("I/O Summary : input_west")
!
numsp = 14
CALL io_push_c256('qe_prefix',qe_prefix,numsp)
CALL io_push_c256('west_prefix',qe_prefix,numsp)
CALL io_push_c256('outdir',outdir,numsp)
!
CALL io_push_bar()
!
CALL json%add('input.input_west.qe_prefix',TRIM(qe_prefix))
CALL json%add('input.input_west.west_prefix',TRIM(west_prefix))
CALL json%add('input.input_west.outdir',TRIM(outdir))
!
ENDIF
!
IF ( ANY(driver(:)==2) ) THEN
!
! REPORT
!
CALL io_push_title('I/O Summary : wstat_control')
!
numsp=30
CALL io_push_value('wstat_calculation',wstat_calculation,numsp)
CALL io_push_value('n_pdep_eigen',n_pdep_eigen,numsp)
CALL io_push_value('n_pdep_times',n_pdep_times,numsp)
CALL io_push_value('n_pdep_maxiter',n_pdep_maxiter,numsp)
CALL io_push_value('n_dfpt_maxiter',n_dfpt_maxiter,numsp)
CALL io_push_value('n_pdep_read_from_file',n_pdep_read_from_file,numsp)
CALL io_push_es0('trev_pdep',trev_pdep,numsp)
CALL io_push_es0('trev_pdep_rel',trev_pdep_rel,numsp)
CALL io_push_es0('tr2_dfpt',tr2_dfpt,numsp)
CALL io_push_value('l_kinetic_only',l_kinetic_only,numsp)
CALL io_push_value('l_minimize_exx_if_active',l_minimize_exx_if_active,numsp)
CALL io_push_value('l_use_ecutrho',l_use_ecutrho,numsp)
!
CALL io_push_bar()
!
CALL json%add('input.wstat_control.wstat_calculation',TRIM(wstat_calculation))
CALL json%add('input.wstat_control.n_pdep_eigen',n_pdep_eigen)
CALL json%add('input.wstat_control.n_pdep_times',n_pdep_times)
CALL json%add('input.wstat_control.n_pdep_maxiter',n_pdep_maxiter)
CALL json%add('input.wstat_control.n_dfpt_maxiter',n_dfpt_maxiter)
CALL json%add('input.wstat_control.n_pdep_read_from_file',n_pdep_read_from_file)
CALL json%add('input.wstat_control.trev_pdep',trev_pdep)
CALL json%add('input.wstat_control.trev_pdep_rel',trev_pdep_rel)
CALL json%add('input.wstat_control.tr2_dfpt',tr2_dfpt)
CALL json%add('input.wstat_control.l_kinetic_only',l_kinetic_only)
CALL json%add('input.wstat_control.l_minimize_exx_if_active',l_minimize_exx_if_active)
CALL json%add('input.wstat_control.l_use_ecutrho',l_use_ecutrho)
!
ENDIF
!
IF ( ANY(driver(:)==3) ) THEN
!
! REPORT
!
CALL io_push_title('I/O Summary : wfreq_control')
!
numsp=40
CALL io_push_value('wfreq_calculation',wfreq_calculation,numsp)
CALL io_push_value('n_pdep_eigen_to_use',n_pdep_eigen_to_use,numsp)
CALL io_push_value('qp_bandrange(1)',qp_bandrange(1),numsp)
CALL io_push_value('qp_bandrange(2)',qp_bandrange(2),numsp)
CALL io_push_value('macropol_calculation',macropol_calculation,numsp)
CALL io_push_value('n_lanczos',n_lanczos,numsp)
CALL io_push_value('n_imfreq',n_imfreq,numsp)
CALL io_push_value('n_refreq',n_refreq,numsp)
CALL io_push_value('ecut_imfreq [Ry]',ecut_imfreq,numsp)
CALL io_push_value('ecut_refreq [Ry]',ecut_refreq,numsp)
CALL io_push_value('wfreq_eta [Ry]',wfreq_eta,numsp)
CALL io_push_value('n_secant_maxiter',n_secant_maxiter,numsp)
CALL io_push_value('trev_secant [Ry]',trev_secant,numsp)
CALL io_push_value('l_enable_lanczos',l_enable_lanczos,numsp)
CALL io_push_value('l_enable_gwetot',l_enable_gwetot,numsp)
CALL io_push_value('div_kind_hf',div_kind_hf,numsp)
CALL io_push_value('o_restart_time [min]',o_restart_time,numsp)
CALL io_push_value('ecut_spectralf(1) [Ry]',ecut_spectralf(1),numsp)
CALL io_push_value('ecut_spectralf(2) [Ry]',ecut_spectralf(2),numsp)
CALL io_push_value('n_spectralf',n_spectralf,numsp)
!
CALL io_push_bar()
!
CALL json%add('input.wfreq_control.wfreq_calculation',TRIM(wfreq_calculation))
CALL json%add('input.wfreq_control.n_pdep_eigen_to_use',n_pdep_eigen_to_use)
CALL json%add('input.wfreq_control.qp_bandrange',qp_bandrange)
CALL json%add('input.wfreq_control.macropol_calculation',macropol_calculation)
CALL json%add('input.wfreq_control.n_lanczos',n_lanczos)
CALL json%add('input.wfreq_control.n_imfreq',n_imfreq)
CALL json%add('input.wfreq_control.n_refreq',n_refreq)
CALL json%add('input.wfreq_control.ecut_imfreq',ecut_imfreq)
CALL json%add('input.wfreq_control.ecut_refreq',ecut_refreq)
CALL json%add('input.wfreq_control.wfreq_eta',wfreq_eta)
CALL json%add('input.wfreq_control.n_secant_maxiter',n_secant_maxiter)
CALL json%add('input.wfreq_control.trev_secant',trev_secant)
CALL json%add('input.wfreq_control.l_enable_lanczos',l_enable_lanczos)
CALL json%add('input.wfreq_control.l_enable_gwetot',l_enable_gwetot)
CALL json%add('input.wfreq_control.div_kind_hf',div_kind_hf)
CALL json%add('input.wfreq_control.o_restart_time',o_restart_time)
CALL json%add('input.wfreq_control.ecut_spectralf',ecut_spectralf)
CALL json%add('input.wfreq_control.n_spectralf',n_spectralf)
!
ENDIF
!
IF ( ANY(driver(:)==4) ) THEN
!
! REPORT
!
CALL io_push_title('I/O Summary : westpp_control')
!
numsp=40
CALL io_push_value('westpp_calculation',westpp_calculation,numsp)
CALL io_push_value('westpp_range(1)',westpp_range(1),numsp)
CALL io_push_value('westpp_range(2)',westpp_range(2),numsp)
CALL io_push_value('westpp_format',westpp_format,numsp)
CALL io_push_value('westpp_sign',westpp_sign,numsp)
CALL io_push_value('westpp_n_pdep_eigen_to_use',westpp_n_pdep_eigen_to_use,numsp)
CALL io_push_value('westpp_r0(1)',westpp_r0(1),numsp)
CALL io_push_value('westpp_r0(2)',westpp_r0(2),numsp)
CALL io_push_value('westpp_r0(3)',westpp_r0(3),numsp)
CALL io_push_value('westpp_nr',westpp_nr,numsp)
CALL io_push_value('westpp_rmax',westpp_rmax,numsp)
CALL io_push_value('westpp_epsinfty',westpp_epsinfty,numsp)
!
CALL io_push_bar()
!
CALL json%add('input.westpp_control.westpp_calculation',TRIM(westpp_calculation))
CALL json%add('input.westpp_control.westpp_range',westpp_range)
CALL json%add('input.westpp_control.westpp_format',TRIM(westpp_format))
CALL json%add('input.westpp_control.westpp_sign',westpp_sign)
CALL json%add('input.westpp_control.westpp_n_pdep_eigen_to_use',westpp_n_pdep_eigen_to_use)
CALL json%add('input.westpp_control.westpp_r0',westpp_r0)
CALL json%add('input.westpp_control.westpp_nr',westpp_nr)
CALL json%add('input.westpp_control.westpp_rmax',westpp_rmax)
CALL json%add('input.westpp_control.westpp_epsinfty',westpp_epsinfty)
!
ENDIF
!
OPEN( NEWUNIT=iunit, FILE=TRIM(logfile) )
CALL json%print_file( iunit )
CLOSE( iunit )
!
CALL json%destroy()
!
ENDIF
!
CALL stop_clock('fetch_input')
!
END SUBROUTINE
......@@ -14,7 +14,7 @@
SUBROUTINE parse_command_arguments( )
!-----------------------------------------------------------------------
!
USE westcom, ONLY : main_input_file, main_output_file
USE westcom, ONLY : main_input_file !, main_output_file
!
IMPLICIT NONE
!
......
!
! Copyright (C) 2015-2016 M. Govoni
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
! This file is part of WEST.
!
! Contributors to this file:
! Marco Govoni
!
!-----------------------------------------------------------------------
PURE FUNCTION to_upper_case (str) RESULT (string)
!-----------------------------------------------------------------------
!
IMPLICIT NONE
CHARACTER(*), INTENT(IN) :: str
CHARACTER(LEN(str)) :: string
!
INTEGER :: ic, i
!
CHARACTER(26), PARAMETER :: cap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
CHARACTER(26), PARAMETER :: low = 'abcdefghijklmnopqrstuvwxyz'
!
! Capitalize each letter if it is low
string = str
DO i = 1, LEN_TRIM(str)
ic = INDEX(low, str(i:i))
IF (ic > 0) string(i:i) = cap(ic:ic)
ENDDO
!
END FUNCTION
!
!-----------------------------------------------------------------------
PURE FUNCTION to_lower_case (str) RESULT (string)
!-----------------------------------------------------------------------
!
IMPLICIT NONE
CHARACTER(*), INTENT(IN) :: str
CHARACTER(LEN(str)) :: string
!
INTEGER :: ic, i
!
CHARACTER(26), PARAMETER :: cap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
CHARACTER(26), PARAMETER :: low = 'abcdefghijklmnopqrstuvwxyz'
!
! Lower case each letter if it is capital
string = str
DO i = 1, LEN_TRIM(str)
ic = INDEX(cap, str(i:i))
IF (ic > 0) string(i:i) = low(ic:ic)
ENDDO
!
END FUNCTION
......@@ -31,9 +31,10 @@ CONTAINS
!
SUBROUTINE west_environment_start( code )
!
USE kinds, ONLY: DP
USE io_files, ONLY: crash_file, nd_nmbr
USE mp_images, ONLY: me_image, my_image_id, root_image, nimage
USE kinds, ONLY : DP
USE io_files, ONLY : crash_file, nd_nmbr
USE mp_images, ONLY : me_image, my_image_id, root_image, nimage
USE westcom, ONLY : savedir, logfile, outdir, west_prefix
!
CHARACTER(LEN=*), INTENT(IN) :: code
!
......@@ -42,6 +43,7 @@ CONTAINS
CHARACTER(LEN=6), EXTERNAL :: int_to_char
INTEGER :: ios, crashunit
INTEGER, EXTERNAL :: find_free_unit
CHARACTER(LEN=9),EXTERNAL :: to_lower_case
!
! ... Intel compilers v .ge.8 allocate a lot of stack space
! ... Stack limit is often small, thus causing SIGSEGV and crash
......@@ -53,7 +55,11 @@ CONTAINS
! Input from (-i), output from (-o)
!
CALL parse_command_arguments()
CALL fetch_input(1,(/1/))
CALL fetch_input(1,(/1/),.FALSE.)
!
savedir = TRIM(outdir) // trim(west_prefix) // "." // TRIM(to_lower_case(code)) // ".save/"
CALL my_mkdir( savedir )
logfile = TRIM(savedir) // "logfile.json"
!
! ... use ".FALSE." to disable all clocks except the total cpu time clock
! ... use ".TRUE." to enable clocks
......@@ -144,6 +150,7 @@ CONTAINS
USE global_version, ONLY : version_number, svn_revision
USE west_version, ONLY : west_version_number, west_svn_revision
USE mp_world, ONLY : mpime,root
USE westcom, ONLY : logfile
!
! I/O
!
......@@ -191,8 +198,7 @@ CONTAINS
CALL json%add('init.qeversion', TRIM(version_number) )
IF( TRIM (svn_revision) /= "unknown" ) CALL json%add('init.qesvn', TRIM(svn_revision) )
!
!OPEN(UNIT=4000,FILE=TRIM(ADJUSTL(west_output_dir))//"/summary.json")
OPEN( NEWUNIT=iunit,FILE="summary.json" )
OPEN( NEWUNIT=iunit, FILE=TRIM(logfile) )
CALL json%print_file( iunit )
CLOSE( iunit )
!
......@@ -237,6 +243,7 @@ CONTAINS
USE mp_global, ONLY : nimage,npool,nbgrp,nproc_image,nproc_pool,nproc_bgrp
USE mp_world, ONLY : nproc,mpime,root
USE io_push, ONLY : io_push_title,io_push_bar
USE westcom, ONLY : logfile
!
IMPLICIT NONE
!
......@@ -283,7 +290,7 @@ CONTAINS
!
CALL json%initialize()
!
CALL json%load_file(filename='summary.json')
CALL json%load_file(filename=TRIM(logfile))
!
CALL json%add('parallel.nranks', nproc )
CALL json%add('parallel.nimage', nimage )
......@@ -295,7 +302,7 @@ CONTAINS
CALL json%add('parallel.nthreads', nth )
#endif
!
OPEN( NEWUNIT=iunit,FILE="summary.json" )
OPEN( NEWUNIT=iunit,FILE=TRIM(logfile) )
CALL json%print_file( iunit )
CLOSE( iunit )
!
......
!
! Copyright (C) 2015-2016 M. Govoni
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
! This file is part of WEST.
!
! Contributors to this file:
! Marco Govoni
!
!-----------------------------------------------------------------------
SUBROUTINE west_print_clocks( )
!----------------------------------------------------------------------------
!
USE json_module, ONLY : json_file
USE io_global, ONLY : stdout
USE kinds, ONLY : DP
USE mytime, ONLY : nclock, clock_label, cputime, walltime, &
notrunning, called, t0cpu, t0wall
USE westcom, ONLY : logfile
!
IMPLICIT NONE
!
INTEGER :: n
REAL(DP) :: elapsed_cpu_time, elapsed_wall_time
TYPE(json_file) :: json
INTEGER :: iunit, nmax
REAL(DP), EXTERNAL :: scnds, cclock
!
CALL json%initialize()
!
CALL json%load_file(filename=TRIM(logfile))
!
DO n = 1, nclock
!
CALL print_this_clock( n )
!
IF ( t0cpu(n) == notrunning ) THEN
!
! ... clock stopped, print the stored value for the cpu time
!
elapsed_cpu_time = cputime(n)
elapsed_wall_time= walltime(n)
!
ELSE
!
! ... clock not stopped, print the current value of the cpu time
!
elapsed_cpu_time = cputime(n) + scnds() - t0cpu(n)
elapsed_wall_time = walltime(n) + cclock() - t0wall(n)
called(n) = called(n) + 1
!
ENDIF
!
nmax = called(n)
!
CALL json%add('timing.'//TRIM(clock_label(n))//'.cpu',elapsed_cpu_time)
CALL json%add('timing.'//TRIM(clock_label(n))//'.wall',elapsed_wall_time)
CALL json%add('timing.'//TRIM(clock_label(n))//'.nocalls',nmax)
!
ENDDO
!
OPEN( NEWUNIT=iunit,FILE=TRIM(logfile))
CALL json%print_file( iunit )
CLOSE( iunit )
!
CALL json%destroy()
!
!
END SUBROUTINE
......@@ -59,14 +59,10 @@ PROGRAM westpp
!
CALL clean_scratchfiles( )
!
CALL print_clock(' ')
CALL west_print_clocks( )
!
CALL west_environment_end( code )
!
CALL mp_global_end()
!
STOP