Skip to content

Commit

Permalink
Replaces timenow with time_start and corrects comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-marques committed Aug 16, 2019
1 parent 52225e3 commit b61053b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions config_src/mct_driver/ocn_comp_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
type(mct_aVect) , intent(inout) :: o2x_o !< Fluxes from ocean to coupler, computed by ocean
character(len=*), optional , intent(in) :: NLFilename !< Namelist filename

! local variables
type(time_type) :: time0 !< Model start time
type(time_type) :: timenow !< Model current time
! local variable
type(time_type) :: time0 !< Start time of coupled model's calendar.
type(time_type) :: time_start !< The time at which to initialize the ocean model
type(ESMF_time) :: time_var !< ESMF_time variable to query time
type(ESMF_time) :: time_in_ESMF !< Initial time for ocean
type(ESMF_timeInterval) :: ocn_cpl_interval !< Ocean coupling interval
Expand Down Expand Up @@ -211,7 +211,7 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
! Get current time
call ESMF_ClockGet(EClock, currTime=time_var, rc=rc)
call ESMF_TimeGet(time_var, yy=year, mm=month, dd=day, h=hour, m=minute, s=seconds, rc=rc)
timenow = set_date(year, month, day, hour, minute, seconds, err_msg=err_msg)
time_start = set_date(year, month, day, hour, minute, seconds, err_msg=err_msg)

! Debugging clocks
if (debug .and. is_root_pe()) then
Expand Down Expand Up @@ -285,7 +285,7 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
runtype = get_runtype()
if (runtype == "initial") then
! startup (new run) - 'n' is needed below since we don't specify input_filename in input.nml
call ocean_model_init(glb%ocn_public, glb%ocn_state, time0, timenow, input_restart_file = 'n')
call ocean_model_init(glb%ocn_public, glb%ocn_state, time0, time_start, input_restart_file = 'n')
else ! hybrid or branch or continuos runs
! get output path root
call seq_infodata_GetData( glb%infodata, outPathRoot=restartpath )
Expand All @@ -301,7 +301,7 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
write(glb%stdout,*) 'Reading restart file: ',trim(restartfile)
end if
call shr_file_freeUnit(nu)
call ocean_model_init(glb%ocn_public, glb%ocn_state, time0, timenow, input_restart_file=trim(restartfile))
call ocean_model_init(glb%ocn_public, glb%ocn_state, time0, time_start, input_restart_file=trim(restartfile))
endif
if (is_root_pe()) then
write(glb%stdout,'(/12x,a/)') '======== COMPLETED MOM INITIALIZATION ========'
Expand Down
8 changes: 4 additions & 4 deletions config_src/nuopc_driver/mom_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
type(ocean_internalstate_wrapper) :: ocean_internalstate
type(ocean_grid_type), pointer :: ocean_grid => NULL()
type(time_type) :: Run_len !< length of experiment
type(time_type) :: time0 !< Model start time
type(time_type) :: timenow !< Model current time
type(time_type) :: time0 !< Start time of coupled model's calendar.
type(time_type) :: time_start !< The time at which to initialize the ocean model
type(time_type) :: Time_restart
type(time_type) :: DT
integer :: DT_OCEAN
Expand Down Expand Up @@ -843,7 +843,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
! this ocean connector will be driven at set interval
DT = set_time (DT_OCEAN, 0)
! get current time
timenow = set_date (YEAR,MONTH,DAY,HOUR,MINUTE,SECOND)
time_start = set_date (YEAR,MONTH,DAY,HOUR,MINUTE,SECOND)

if (is_root_pe()) then
write(logunit,*) subname//'current time: y,m,d-',year,month,day,'h,m,s=',hour,minute,second
Expand Down Expand Up @@ -995,7 +995,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
endif

ocean_public%is_ocean_pe = .true.
call ocean_model_init(ocean_public, ocean_state, time0, timenow, input_restart_file=trim(restartfile))
call ocean_model_init(ocean_public, ocean_state, time0, time_start, input_restart_file=trim(restartfile))

call ocean_model_init_sfc(ocean_state, ocean_public)

Expand Down

0 comments on commit b61053b

Please sign in to comment.