Skip to content

Commit

Permalink
Merge 328766d into 06acdc8
Browse files Browse the repository at this point in the history
  • Loading branch information
junwang-noaa authored Aug 18, 2023
2 parents 06acdc8 + 328766d commit 3a0b235
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions config_src/drivers/nuopc_cap/mom_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ module MOM_cap_mod
type(ESMF_GeomType_Flag) :: geomtype
#endif
character(len=8) :: restart_mode = 'alarms'
real(8) :: timere

contains

Expand Down Expand Up @@ -230,6 +231,8 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc)
integer :: iostat
character(len=64) :: value, logmsg
character(len=*),parameter :: subname='(MOM_cap:InitializeP0)'
type(ESMF_VM) :: vm
integer :: mype

rc = ESMF_SUCCESS

Expand Down Expand Up @@ -422,9 +425,11 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
! (same as restartfile if single restart file)
character(len=*), parameter :: subname='(MOM_cap:InitializeAdvertise)'
character(len=32) :: calendar
real(8) :: MPI_Wtime, timeiads
!--------------------------------

rc = ESMF_SUCCESS
timeiads = MPI_Wtime()

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

Expand Down Expand Up @@ -774,7 +779,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
call NUOPC_Advertise(exportState, standardName=fldsFrOcn(n)%stdname, name=fldsFrOcn(n)%shortname, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
enddo
if(is_root_pe()) write(stdout,*) 'InitializeAdvertise complete'
if(is_root_pe()) write(stdout,*) 'In ',trim(subname),' time ', MPI_Wtime()-timeiads

end subroutine InitializeAdvertise

!> Called by NUOPC to realize import and export fields. "Realizing" a field
Expand Down Expand Up @@ -856,9 +862,11 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
real(ESMF_KIND_R8) :: min_areacor_glob(2)
real(ESMF_KIND_R8) :: max_areacor_glob(2)
character(len=*), parameter :: subname='(MOM_cap:InitializeRealize)'
real(8) :: MPI_Wtime, timeirls
!--------------------------------

rc = ESMF_SUCCESS
timeirls = MPI_Wtime()

call shr_log_setLogUnit (stdout)

Expand Down Expand Up @@ -1350,6 +1358,9 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
! timeslice=1, relaxedFlag=.true., rc=rc)
!if (ChkErr(rc,__LINE__,u_FILE_u)) return

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

end subroutine InitializeRealize

!> TODO
Expand Down Expand Up @@ -1378,8 +1389,11 @@ subroutine DataInitialize(gcomp, rc)
type(ESMF_Field) :: field
character(len=64),allocatable :: fieldNameList(:)
character(len=*),parameter :: subname='(MOM_cap:DataInitialize)'
real(8) :: MPI_Wtime, timedis
!--------------------------------

timedis = MPI_Wtime()

! query the Component for its clock, importState and exportState
call ESMF_GridCompGet(gcomp, clock=clock, importState=importState, exportState=exportState, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
Expand Down Expand Up @@ -1440,6 +1454,8 @@ subroutine DataInitialize(gcomp, rc)
enddo
endif

if(is_root_pe()) write(stdout,*) 'In ',trim(subname),' time ', MPI_Wtime()-timedis

end subroutine DataInitialize

!> Called by NUOPC to advance the model a single timestep.
Expand Down Expand Up @@ -1490,9 +1506,12 @@ subroutine ModelAdvance(gcomp, rc)
character(len=*),parameter :: subname='(MOM_cap:ModelAdvance)'
character(len=8) :: suffix
integer :: num_rest_files
real(8) :: MPI_Wtime, timers

rc = ESMF_SUCCESS
if(profile_memory) call ESMF_VMLogMemInfo("Entering MOM Model_ADVANCE: ")
timers = MPI_Wtime()
if(timere>0. .and. is_root_pe()) write(stdout,*) 'In MOM6, time since last time step ',timers-timere

call shr_log_setLogUnit (stdout)

Expand Down Expand Up @@ -1726,6 +1745,9 @@ subroutine ModelAdvance(gcomp, rc)
enddo
endif

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

if(profile_memory) call ESMF_VMLogMemInfo("Leaving MOM Model_ADVANCE: ")

end subroutine ModelAdvance
Expand Down Expand Up @@ -1928,11 +1950,13 @@ subroutine ocean_model_finalize(gcomp, rc)
character(len=64) :: timestamp
logical :: write_restart
character(len=*),parameter :: subname='(MOM_cap:ocean_model_finalize)'
real(8) :: MPI_Wtime, timefs

if (is_root_pe()) then
write(stdout,*) 'MOM: --- finalize called ---'
endif
rc = ESMF_SUCCESS
timefs = MPI_Wtime()

call ESMF_GridCompGetInternalState(gcomp, ocean_internalstate, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
Expand Down Expand Up @@ -1961,9 +1985,7 @@ subroutine ocean_model_finalize(gcomp, rc)
call io_infra_end()
call MOM_infra_end()

if (is_root_pe()) then
write(stdout,*) 'MOM: --- completed ---'
endif
if(is_root_pe()) write(stdout,*) 'In ',trim(subname),' time ', MPI_Wtime()-timefs

end subroutine ocean_model_finalize

Expand Down

0 comments on commit 3a0b235

Please sign in to comment.