Loading src/base/ctemDriver.F90 +1 −1 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ contains use disturbance_scheme, only : disturbance use heterotrophicRespirationMod, only : heterotrophicRespiration, updatePoolsHetResp use peatlandsMod, only : peatDayEnd, peatDepth, peatStorage use mossMod, only : mossGDD, updateMossC use mossMod, only : updateMossC use ctemUtilities, only : genSortIndex use autotrophicRespiration, only : mainres use balanceCarbon, only : balcar, prepBalanceC Loading src/driver/metModule.f90 +8 −8 Original line number Diff line number Diff line Loading @@ -606,7 +606,7 @@ contains !> \ingroup metdisaggmodule_daylightIndices !! @{ !> Find day lengths depending on zenith angles function daylightIndices (zenithAngles, countr) function daylightIndices (zenAngles, countr) use classicParams, only : delt Loading @@ -614,7 +614,7 @@ contains integer :: i, daylightCount integer, intent(in) :: countr real, intent(in) :: zenithAngles(:) real, intent(in) :: zenAngles(:) integer, allocatable :: daylightIndices(:) real :: zenithCos real :: dayLength Loading @@ -622,7 +622,7 @@ contains allocate(daylightIndices(countr)) daylightCount = 0 do i = 1,countr zenithCos = cos(zenithAngles(i)) zenithCos = cos(zenAngles(i)) if (zenithCos >= 0) then daylightCount = daylightCount + 1 daylightIndices(i) = i Loading @@ -640,13 +640,13 @@ contains !> \ingroup metdisaggmodule_distributeDiurnally !! @{ !> Determines correction for input values based on daylight indices and zenith angles function distributeDiurnally (zenithAngles, daylightIndices, zenithNoon, swMean, countr) function distributeDiurnally (zenAngles, daylightInd, zenithNoon, swMean, countr) implicit none integer, intent(in) :: countr real, intent(in) :: zenithAngles(:), zenithNoon, swMean integer, intent(in) :: daylightIndices(:) real, intent(in) :: zenAngles(:), zenithNoon, swMean integer, intent(in) :: daylightInd(:) real, allocatable :: distributeDiurnally(:) real, allocatable :: diurnalDistrib(:) integer :: i, daylightIndex Loading @@ -656,9 +656,9 @@ contains vsum = 0.0 do i = 1,countr daylightIndex = daylightIndices(i) ! check with daylight_indices to see if it there is daylight at the time, daylightIndex = daylightInd(i) ! check with daylight_indices to see if it there is daylight at the time, if (daylightIndex > 0) then ! if there is find the value for s diurnalDistrib(i) = swMean * pi / 2. * cos((zenithAngles(daylightIndex) - zenithNoon) & diurnalDistrib(i) = swMean * pi / 2. * cos((zenAngles(daylightIndex) - zenithNoon) & / (pi / 2. - zenithNoon) * pi / 2.) else ! else set it to 0 diurnalDistrib(i) = 0 Loading Loading
src/base/ctemDriver.F90 +1 −1 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ contains use disturbance_scheme, only : disturbance use heterotrophicRespirationMod, only : heterotrophicRespiration, updatePoolsHetResp use peatlandsMod, only : peatDayEnd, peatDepth, peatStorage use mossMod, only : mossGDD, updateMossC use mossMod, only : updateMossC use ctemUtilities, only : genSortIndex use autotrophicRespiration, only : mainres use balanceCarbon, only : balcar, prepBalanceC Loading
src/driver/metModule.f90 +8 −8 Original line number Diff line number Diff line Loading @@ -606,7 +606,7 @@ contains !> \ingroup metdisaggmodule_daylightIndices !! @{ !> Find day lengths depending on zenith angles function daylightIndices (zenithAngles, countr) function daylightIndices (zenAngles, countr) use classicParams, only : delt Loading @@ -614,7 +614,7 @@ contains integer :: i, daylightCount integer, intent(in) :: countr real, intent(in) :: zenithAngles(:) real, intent(in) :: zenAngles(:) integer, allocatable :: daylightIndices(:) real :: zenithCos real :: dayLength Loading @@ -622,7 +622,7 @@ contains allocate(daylightIndices(countr)) daylightCount = 0 do i = 1,countr zenithCos = cos(zenithAngles(i)) zenithCos = cos(zenAngles(i)) if (zenithCos >= 0) then daylightCount = daylightCount + 1 daylightIndices(i) = i Loading @@ -640,13 +640,13 @@ contains !> \ingroup metdisaggmodule_distributeDiurnally !! @{ !> Determines correction for input values based on daylight indices and zenith angles function distributeDiurnally (zenithAngles, daylightIndices, zenithNoon, swMean, countr) function distributeDiurnally (zenAngles, daylightInd, zenithNoon, swMean, countr) implicit none integer, intent(in) :: countr real, intent(in) :: zenithAngles(:), zenithNoon, swMean integer, intent(in) :: daylightIndices(:) real, intent(in) :: zenAngles(:), zenithNoon, swMean integer, intent(in) :: daylightInd(:) real, allocatable :: distributeDiurnally(:) real, allocatable :: diurnalDistrib(:) integer :: i, daylightIndex Loading @@ -656,9 +656,9 @@ contains vsum = 0.0 do i = 1,countr daylightIndex = daylightIndices(i) ! check with daylight_indices to see if it there is daylight at the time, daylightIndex = daylightInd(i) ! check with daylight_indices to see if it there is daylight at the time, if (daylightIndex > 0) then ! if there is find the value for s diurnalDistrib(i) = swMean * pi / 2. * cos((zenithAngles(daylightIndex) - zenithNoon) & diurnalDistrib(i) = swMean * pi / 2. * cos((zenAngles(daylightIndex) - zenithNoon) & / (pi / 2. - zenithNoon) * pi / 2.) else ! else set it to 0 diurnalDistrib(i) = 0 Loading