diff --git a/build/source/engine/layerMerge.f90 b/build/source/engine/layerMerge.f90 index 9b4726261..d1b35bc70 100644 --- a/build/source/engine/layerMerge.f90 +++ b/build/source/engine/layerMerge.f90 @@ -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 diff --git a/build/source/engine/systemSolv.f90 b/build/source/engine/systemSolv.f90 index 6cec6d3c0..6cf213d25 100644 --- a/build/source/engine/systemSolv.f90 +++ b/build/source/engine/systemSolv.f90 @@ -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... ! -------------------------------------------- @@ -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 (-) @@ -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) @@ -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 diff --git a/build/source/engine/time_utils.f90 b/build/source/engine/time_utils.f90 index f897af7da..8be0e4bf9 100644 --- a/build/source/engine/time_utils.f90 +++ b/build/source/engine/time_utils.f90 @@ -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