Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build/source/engine/layerMerge.f90
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ subroutine layer_combine(mpar_data,prog_data,diag_data,flux_data,indx_data,iSnow
prog_data%var(iLookPROG%mLayerVolFracIce)%dat(iSnow) = cVolFracIce
prog_data%var(iLookPROG%mLayerVolFracLiq)%dat(iSnow) = cVolFracLiq

print*, 'nSnow = ', nSnow
! ***** adjust coordinate variables
call calcHeight(&
! input/output: data structures
Expand Down
8 changes: 4 additions & 4 deletions build/source/engine/systemSolv.f90
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,6 @@ subroutine systemSolv(&
err,cmessage) ! intent(out): error control
if(err/=0)then; message=trim(message)//trim(cmessage); return; endif ! (check for errors)


! -----
! * compute the initial function evaluation...
! --------------------------------------------
Expand Down Expand Up @@ -2867,9 +2866,11 @@ function checkConv(rVec,xInc,xVec,soilWatbalErr)
canopy_max = real(abs(rVec(ixVegWat)), dp)*iden_water
energy_max = real(maxval(abs( (/rVec(ixCasNrg), rVec(ixVegNrg), rVec(ixSnowSoilNrg)/) ) ), dp)
energy_loc = maxloc(abs( (/rVec(ixCasNrg), rVec(ixVegNrg), rVec(ixSnowSoilNrg)/) ) )
canopyConv = (canopy_max < absConvTol_watbal) ! absolute error in canopy water balance (m)
else
energy_max = real(maxval(abs( rVec(ixSnowSoilNrg) ) ), dp)
energy_loc = maxloc(abs( rVec(ixSnowSoilNrg) ) )
canopyConv = .true. ! don't check canopy convergence if not computing the vegetation flux (canopy is buried by snow or canopy non-existent)
endif

! check convergence based on the residuals for volumetric liquid water content (-)
Expand All @@ -2883,7 +2884,6 @@ function checkConv(rVec,xInc,xVec,soilWatbalErr)
matric_loc = maxloc(abs( xInc(ixSoilOnlyHyd)/psiScale ) )

! convergence check
canopyConv = (canopy_max < absConvTol_watbal) ! absolute error in canopy water balance (m)
watbalConv = (soilWatbalErr < absConvTol_watbal) ! absolute error in total soil water balance (m)
matricConv = (matric_max(1) < absConvTol_matric) ! NOTE: based on iteration increment
liquidConv = (liquid_max(1) < absConvTol_liquid) ! (based on the residual)
Expand All @@ -2892,8 +2892,8 @@ function checkConv(rVec,xInc,xVec,soilWatbalErr)
! print progress towards solution
if(printFlag)then
print*, 'iter, dt = ', iter, dt
write(*,'(a,1x,4(e15.5,1x),3(i4,1x),3(L1,1x))') 'fNew, matric_max(1), liquid_max(1), energy_max(1), matric_loc(1), liquid_loc(1), energy_loc(1), matricConv, liquidConv, energyConv = ', &
fNew, matric_max(1), liquid_max(1), energy_max(1), matric_loc(1), liquid_loc(1), energy_loc(1), matricConv, liquidConv, energyConv
write(*,'(a,1x,4(e15.5,1x),3(i4,1x),5(L1,1x))') 'fNew, matric_max(1), liquid_max(1), energy_max(1), matric_loc(1), liquid_loc(1), energy_loc(1), matricConv, liquidConv, energyConv, watbalConv, canopyConv = ', &
fNew, matric_max(1), liquid_max(1), energy_max(1), matric_loc(1), liquid_loc(1), energy_loc(1), matricConv, liquidConv, energyConv, watbalConv, canopyConv
endif

! final convergence check
Expand Down
4 changes: 2 additions & 2 deletions build/source/engine/time_utils.f90
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ subroutine compcalday(julday, & !input
if(julday<=0)then;err=10;message=trim(message)//"no negative julian days/"; return; endif

! step 1
step_1a = 4*julday+b
step_1a = 4*int(julday)+b
step_1b = step_1a/146097
step_1c = step_1b*3
step_1d = step_1c/4

f = julday+j+step_1d+c
f = int(julday)+j+step_1d+c

! step 2
e = r * f + v
Expand Down