Skip to content

Commit

Permalink
NemoLite2D add more timing sections in the algorithm layer
Browse files Browse the repository at this point in the history
  • Loading branch information
sergisiso committed Apr 14, 2022
1 parent 5ccef6a commit e1a7e93
Showing 1 changed file with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ program gocean2d

!> GOcean2d is a Horizontal 2D hydrodynamic ocean model initially developed
!! by Hedong Liu, UK National Oceanography Centre (NOC), which:
!! 1) using structured grid
!! 2) using direct data addressing structures
!! 1) uses structured grid
!! 2) uses direct data addressing structures

implicit none

Expand Down Expand Up @@ -50,6 +50,11 @@ program gocean2d
!! read in model parameters and configure the model grid
CALL model_init(model_grid)

! Start timer for initialisation section (this must be after model_init
! because dl_timer::timer_init() is called inside it)
CALL timer_start(itimer0, label='Initialise', &
num_repeats=INT(1,kind=i_def64) )

! Create fields on this grid

! Sea-surface height now (current time step)
Expand Down Expand Up @@ -89,7 +94,10 @@ program gocean2d
model_grid%subdomain%global%ystop
call model_write_log("((A))", TRIM(log_str))

! Start timer for time-stepping section
! Stop the timer for the initialisation section
call timer_stop(itimer0)

! Start timer for warm-up section
CALL timer_start(itimer0, label='Warm up', &
num_repeats=INT(warmup_iterations,kind=i_def64) )

Expand All @@ -101,7 +109,7 @@ program gocean2d
hu_fld, hv_fld, ht_fld)
enddo

! Stop the timer for the time-stepping section
! Stop the timer for the warm-up section
call timer_stop(itimer0)
! Start timer for time-stepping section
CALL timer_start(itimer0, label='Time-stepping', &
Expand All @@ -124,12 +132,19 @@ program gocean2d
! Stop the timer for the time-stepping section
call timer_stop(itimer0)

! Start timer for checksum section
CALL timer_start(itimer0, label='Checksum reductions', &
num_repeats=INT(1,kind=i_def64) )

! Compute and output some checksums for error checking
call model_write_log("('ua checksum = ', E16.8)", &
field_checksum(ua_fld))
call model_write_log("('va checksum = ', E16.8)", &
field_checksum(va_fld))

! Stop the timer for the checksum section
call timer_stop(itimer0)

!! finalise the model run
call model_finalise()

Expand Down

0 comments on commit e1a7e93

Please sign in to comment.