Skip to content

Commit

Permalink
add run time info
Browse files Browse the repository at this point in the history
  • Loading branch information
junwang-noaa committed Jun 27, 2023
1 parent 5840cd1 commit bd0ee2c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ module ice_comp_nuopc
character(*), parameter :: modName = "(ice_comp_nuopc)"
character(*), parameter :: u_FILE_u = &
__FILE__
real(8) :: timers, timere

!=======================================================================
contains
Expand Down Expand Up @@ -243,8 +244,11 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
character(len=char_len) :: tfrz_option ! tfrz_option from cice namelist
character(len=char_len) :: tfrz_option_driver ! tfrz_option from cice namelist
character(len=*), parameter :: subname=trim(modName)//':(InitializeAdvertise) '
real(8) :: MPI_Wtime(), timeiads
!--------------------------------

timeiads = MPI_Wtime()

call NUOPC_CompAttributeGet(gcomp, name="ScalarFieldName", value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (isPresent .and. isSet) then
Expand Down Expand Up @@ -699,6 +703,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
end if

call t_stopf ('cice_init_total')
if(mastertask) write(stdout,*) 'In ', trim(subname),' time', MPI_Wtime()-timeiads

end subroutine InitializeAdvertise

Expand Down Expand Up @@ -730,9 +735,11 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
character(len=char_len_long) :: single_column_lnd_domainfile
character(len=char_len_long) , pointer :: lfieldnamelist(:) => null()
character(len=*), parameter :: subname=trim(modName)//':(InitializeRealize) '
real(8) :: MPI_Wtime(), timeirls
!--------------------------------

rc = ESMF_SUCCESS
timeirls = MPI_Wtime()
if (dbug > 5) call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO)

!----------------------------------------------------------------------------
Expand Down Expand Up @@ -912,6 +919,10 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)

call flush_fileunit(nu_diag)

timers = 0.
timere = 0.
if(mastertask) write(stdout,*) 'In ', trim(subname),' time', MPI_Wtime()-timeirls

end subroutine InitializeRealize

!===============================================================================
Expand Down Expand Up @@ -954,9 +965,12 @@ subroutine ModelAdvance(gcomp, rc)
logical :: isPresent, isSet
character(len=*),parameter :: subname=trim(modName)//':(ModelAdvance) '
character(char_len_long) :: msgString
real(8) :: MPI_Wtime
!--------------------------------

rc = ESMF_SUCCESS
timers = MPI_Wtime()
if(mastertask) write(stdout,*) 'In CICE, time since last step ', timers - timere

call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO)

Expand Down Expand Up @@ -1177,6 +1191,9 @@ subroutine ModelAdvance(gcomp, rc)

if (dbug > 5) call ESMF_LogWrite(subname//' done', ESMF_LOGMSG_INFO)

timere = MPI_Wtime()
if(mastertask) write(stdout,*) 'In ', trim(subname),' time ', timere-timers

end subroutine ModelAdvance

!===============================================================================
Expand Down Expand Up @@ -1318,9 +1335,11 @@ subroutine ModelFinalize(gcomp, rc)
! local variables
character(*), parameter :: F91 = "('(ice_comp_nuopc) ',73('-'))"
character(len=*),parameter :: subname=trim(modName)//':(ModelFinalize) '
real(8) :: MPI_Wtime, timefs
!--------------------------------

rc = ESMF_SUCCESS
timefs = MPI_Wtime()
if (dbug > 5) call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO)
if (my_task == master_task) then
write(nu_diag,F91)
Expand All @@ -1329,6 +1348,8 @@ subroutine ModelFinalize(gcomp, rc)
end if
if (dbug > 5) call ESMF_LogWrite(subname//' done', ESMF_LOGMSG_INFO)

if(mastertask) write(stdout,*) 'In ', trim(subname),' time ', MPI_Wtime()-timefs

end subroutine ModelFinalize

!===============================================================================
Expand Down

0 comments on commit bd0ee2c

Please sign in to comment.