Skip to content

Commit

Permalink
Removed comments with prefix !KO
Browse files Browse the repository at this point in the history
  • Loading branch information
slevis-lmwg committed Nov 12, 2024
1 parent 268ad5a commit d07fd9d
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 66 deletions.
3 changes: 0 additions & 3 deletions src/biogeochem/CNPhenologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,7 @@ subroutine CNPhenology (bounds, num_soilc, filter_soilc, num_soilp, &
soilstate_inst, temperature_inst, atm2lnd_inst, wateratm2lndbulk_inst, cnveg_state_inst, &
cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst)

!KO if (num_pcropp > 0 .and. .not. is_first_step()) then
!KO
if (num_pcropp > 0) then
!KO
call CropPhenology(num_pcropp, filter_pcropp, &
waterdiagnosticbulk_inst, temperature_inst, crop_inst, canopystate_inst, cnveg_state_inst, &
cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, &
Expand Down
8 changes: 0 additions & 8 deletions src/biogeochem/CNVegetationFacade.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1285,11 +1285,7 @@ subroutine EndOfTimeStepVegDynamics(this, bounds, num_natvegp, filter_natvegp, &
! Call dv (dynamic vegetation) at last time step of year

call t_startf('d2dgvm')
!KO if (is_end_curr_year() .and. .not. is_first_step()) then
!KO
! is_first_step check no longer necessary since there is no nstep=0
if (is_end_curr_year()) then
!KO

! Get date info. kyr is used in lpj(). At end of first year, kyr = 2.
call get_curr_date(yr, mon, day, sec)
Expand Down Expand Up @@ -1341,11 +1337,7 @@ subroutine WriteHistory(this, bounds)

! Write to CNDV history buffer if appropriate
if (use_cndv) then
!KO if (is_end_curr_year() .and. .not. is_first_step()) then
!KO
! is_first_step check no longer necessary since there is no nstep=0
if (is_end_curr_year()) then
!KO
call t_startf('clm_drv_io_hdgvm')
call CNDVHist( bounds, this%dgvs_inst )
if (masterproc) write(iulog,*) 'Annual CNDV calculations are complete'
Expand Down
4 changes: 0 additions & 4 deletions src/biogeochem/CropType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -930,11 +930,7 @@ subroutine CropIncrementYear (this, num_pcropp, filter_pcropp)
! Update nyrs when it's the end of the year (unless it's the very start of the
! run). This assumes that, if this patch is active at the end of the year, then it was
! active for the whole year.
!KO if ((kmo == 1 .and. kda == 1 .and. mcsec == 0) .and. .not. is_first_step()) then
!KO
! is_first_step check no longer necessary since there is no nstep=0
if ((kmo == 1 .and. kda == 1 .and. mcsec == 0)) then
!KO
do fp = 1, num_pcropp
p = filter_pcropp(fp)

Expand Down
4 changes: 0 additions & 4 deletions src/biogeochem/dynCNDVMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,7 @@ subroutine dynCNDV_interp( bounds, dgvs_inst)
patch%wtcol(p) = dgvs_inst%fpcgrid_patch(p) + &
wt1 * (dgvs_inst%fpcgridold_patch(p) - dgvs_inst%fpcgrid_patch(p))

!KO ! I don't think this is necessary since there no longer an nstep=0
!KO if (mon==1 .and. day==1 .and. sec==dtime .and. nstep>0) then
!KO
if (mon==1 .and. day==1 .and. sec==dtime) then
!KO
dgvs_inst%fpcgridold_patch(p) = dgvs_inst%fpcgrid_patch(p)
end if
end if
Expand Down
1 change: 0 additions & 1 deletion src/biogeophys/WaterStateType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,6 @@ subroutine Restart(this, bounds, ncid, flag, &

! If initial run -- ensure that water is properly bounded (read only)
if (flag == 'read' ) then
!KO ! I think leaving this in here is still necessary even though is_first_step is now based on nstep=1
if ( is_first_step() .and. bound_h2osoi) then
do c = bounds%begc, bounds%endc
l = col%landunit(c)
Expand Down
50 changes: 23 additions & 27 deletions src/main/clm_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
! are passed to CLM in initialization, then this code block can be removed.
! ========================================================================

!KO I think leaving this in here is still necessary even though is_first_step is now based on nstep=1
need_glacier_initialization = is_first_step()

if (need_glacier_initialization) then
Expand Down Expand Up @@ -1369,41 +1368,38 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
! FIX(SPM, 082814) - in the fates branch RF and I commented out the if(.not.
! use_fates) then statement ... double check if this is required and why

! I don't think this is necessary since there no longer an nstep=0
!KO if (nstep > 0) then
call t_startf('accum')
call t_startf('accum')

call atm2lnd_inst%UpdateAccVars(bounds_proc)
call atm2lnd_inst%UpdateAccVars(bounds_proc)

call temperature_inst%UpdateAccVars(bounds_proc, crop_inst)
call temperature_inst%UpdateAccVars(bounds_proc, crop_inst)

call canopystate_inst%UpdateAccVars(bounds_proc)
call canopystate_inst%UpdateAccVars(bounds_proc)

call water_inst%UpdateAccVars(bounds_proc)
call water_inst%UpdateAccVars(bounds_proc)

call energyflux_inst%UpdateAccVars(bounds_proc)
call energyflux_inst%UpdateAccVars(bounds_proc)

! COMPILER_BUG(wjs, 2014-11-30, pgi 14.7) For pgi 14.7 to be happy when
! compiling this threaded, I needed to change the dummy arguments to be
! pointers, and get rid of the explicit bounds in the subroutine call.
! call bgc_vegetation_inst%UpdateAccVars(bounds_proc, &
! t_a10_patch=temperature_inst%t_a10_patch(bounds_proc%begp:bounds_proc%endp), &
! t_ref2m_patch=temperature_inst%t_ref2m_patch(bounds_proc%begp:bounds_proc%endp))
call bgc_vegetation_inst%UpdateAccVars(bounds_proc, &
t_a10_patch=temperature_inst%t_a10_patch, &
t_ref2m_patch=temperature_inst%t_ref2m_patch)
! COMPILER_BUG(wjs, 2014-11-30, pgi 14.7) For pgi 14.7 to be happy when
! compiling this threaded, I needed to change the dummy arguments to be
! pointers, and get rid of the explicit bounds in the subroutine call.
! call bgc_vegetation_inst%UpdateAccVars(bounds_proc, &
! t_a10_patch=temperature_inst%t_a10_patch(bounds_proc%begp:bounds_proc%endp), &
! t_ref2m_patch=temperature_inst%t_ref2m_patch(bounds_proc%begp:bounds_proc%endp))
call bgc_vegetation_inst%UpdateAccVars(bounds_proc, &
t_a10_patch=temperature_inst%t_a10_patch, &
t_ref2m_patch=temperature_inst%t_ref2m_patch)

if (use_crop) then
call crop_inst%CropUpdateAccVars(bounds_proc, &
temperature_inst%t_ref2m_patch, temperature_inst%t_soisno_col)
end if
if (use_crop) then
call crop_inst%CropUpdateAccVars(bounds_proc, &
temperature_inst%t_ref2m_patch, temperature_inst%t_soisno_col)
end if

if(use_fates) then
call clm_fates%UpdateAccVars(bounds_proc)
end if
if(use_fates) then
call clm_fates%UpdateAccVars(bounds_proc)
end if

call t_stopf('accum')
!KO end if
call t_stopf('accum')

! ============================================================================
! Update history buffer
Expand Down
10 changes: 0 additions & 10 deletions src/main/histFileMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2662,10 +2662,7 @@ subroutine htape_timeconst3D(t, &
! !DESCRIPTION:
! Write time constant 3D variables to history tapes.
! Only write out when this subroutine is called (normally only for
!KO ! primary history files at very first time-step, nstep=0).
!KO
! primary history files at very first time-step, nstep=1).
!KO
! Issue the required netcdf wrapper calls to define the history file
! contents.
!
Expand Down Expand Up @@ -4140,13 +4137,6 @@ subroutine hist_htapes_wrapup( rstwr, nlend, bounds, &
cycle
end if

!KO ! Should no longer be needed
!KO ! Skip nstep=0 if monthly average
!KO
!KO if (nstep==0 .and. tape(t)%nhtfrq==0) then
!KO cycle
!KO end if

! Determine if end of history interval
tape(t)%is_endhist = .false.
if (tape(t)%nhtfrq==0) then !monthly average
Expand Down
3 changes: 0 additions & 3 deletions src/utils/AnnualFluxDribbler.F90
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,8 @@ subroutine set_curr_delta(this, bounds, delta)
do i = beg_index, end_index
this%amount_from_this_timestep(i) = delta(i)
end do
!KO if (.not. this%allows_non_annual_delta .and. .not. is_first_step()) then
!KO
! is_first_step check no longer necessary since there is no nstep=0
if (.not. this%allows_non_annual_delta) then
!KO
do i = beg_index, end_index
if (this%amount_from_this_timestep(i) /= 0._r8) then
write(iulog,*) subname//' ERROR: found unexpected non-zero delta mid-year'
Expand Down
7 changes: 1 addition & 6 deletions src/utils/clm_time_manager.F90
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,8 @@ subroutine timemgr_init( )
tm_perp_date = TimeSetymd( perpetual_ymd, 0, "tm_perp_date" )
end if

!KO
! Advance time step to start at nstep=1 (instead of nstep=0)
! Advance time step to start at nstep=1
call advance_timestep()
!KO

! Print configuration summary to log file (stdout).

Expand Down Expand Up @@ -1750,10 +1748,7 @@ logical function is_first_step()
call ESMF_ClockGet( tm_clock, advanceCount=step_no, rc=rc )
call chkrc(rc, sub//': error return from ESMF_ClockGet')
nstep = step_no
!KO is_first_step = (nstep == 0)
!KO
is_first_step = (nstep == 1)
!KO

end function is_first_step
!=========================================================================================
Expand Down

0 comments on commit d07fd9d

Please sign in to comment.