diff --git a/src/modglobal.f90 b/src/modglobal.f90 index 0d1547d5..1e5b3eb3 100644 --- a/src/modglobal.f90 +++ b/src/modglobal.f90 @@ -183,8 +183,8 @@ module modglobal real :: courant = -1 real :: peclet = 0.15 integer(kind=longint) :: dt_lim - - + integer(kind=longint) :: ntimesteps = 0 + real :: walltime_stepping integer :: rk3step = 0 integer :: iexpnr = 0 !< * number of the experiment diff --git a/src/program.f90 b/src/program.f90 index 92402537..53fbc4b9 100644 --- a/src/program.f90 +++ b/src/program.f90 @@ -100,8 +100,8 @@ program DALES !!---------------------------------------------------------------- !! 0.0 USE STATEMENTS FOR CORE MODULES !!---------------------------------------------------------------- - use modglobal, only : rk3step,timeleft - use modmpi, only : initmpicomm + use modglobal, only : rk3step,timeleft,ntimesteps,walltime_stepping,imax,jmax,kmax + use modmpi, only : initmpicomm,myid use modstartup, only : startup, writerestartfiles,testwctime,exitmodules use modtimedep, only : timedep use modboundary, only : boundary, grwdamp! JvdD ,tqaver @@ -154,7 +154,7 @@ program DALES use modchem, only : initchem,twostep use modcanopy, only : initcanopy, canopy, exitcanopy use modadvection, only : advection - + use mpi, only : MPI_Wtime implicit none @@ -205,6 +205,7 @@ program DALES !------------------------------------------------------ call testwctime + walltime_stepping = MPI_Wtime() do while (timeleft>0 .or. rk3step < 3) ! Calculate new timestep, and reset tendencies to 0. call tstep_update @@ -312,6 +313,13 @@ program DALES ! END OF TIME LOOP !------------------------------------------------------- +if (myid==0) then + walltime_stepping = MPI_Wtime() - walltime_stepping + write(6,*)'wall time stepping =', walltime_stepping, ' s' + write(6,*)'time steps =', ntimesteps + write(6,*)'wall time / time step =', walltime_stepping / ntimesteps, ' s' + write(6,*)'wall time / grid point step =', walltime_stepping / ntimesteps / (imax*jmax*kmax) * 1e6, ' us' +end if !-------------------------------------------------------- ! 4 FINALIZE ADD ONS AND THE MAIN PROGRAM diff --git a/src/tstep.f90 b/src/tstep.f90 index 0cd078be..d8f375b3 100644 --- a/src/tstep.f90 +++ b/src/tstep.f90 @@ -176,7 +176,7 @@ end subroutine tstep_update subroutine tstep_integrate - use modglobal, only : rdt,rk3step,e12min + use modglobal, only : rdt,rk3step,e12min,ntimesteps use modfields, only : u0,um,up,v0,vm,vp,w0,wm,wp,& thl0,thlm,thlp,qt0,qtm,qtp,& e120,e12m,e12p,sv0,svm,svp @@ -210,6 +210,7 @@ subroutine tstep_integrate e12m = max(e12min,e12m + rk3coef * e12p) e120 = e12m + ntimesteps = ntimesteps + 1 end if end subroutine tstep_integrate end module tstep