Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of functionality for inputting aspect and non-zero slope/aspect effects on radiation, and also a BUG FIX: correcting averageRoutedRunoff in run_oneGRU.f90 and qTimeDelay.f90 #454

Merged
merged 5 commits into from
May 26, 2021

Conversation

andywood
Copy link
Collaborator

@andywood andywood commented Apr 4, 2021

No description provided.

Copy link
Member

@arbennett arbennett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of minor style changes. Could you also add an entry to the docs/whats-new.md?


do iGRU=1,nGRU
do iHRU = 1, gru_struc(iGRU)%hruCount
attrStruct%gru(iGRU)%hru(iHRU)%var(varIndx) = -1._dp ! populate variable with out-of-range value, used later
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be changed to a missing value placeholder from engine/nrtype.f90 so that the intention is clearer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -234,11 +236,21 @@ subroutine derivforce(time_data,forc_data,attr_data,mpar_data,prog_data,diag_dat
dataStep = data_step/secprhour ! time step (hours)
ahour = real(jh,kind(dp)) + real(jmin,kind(dp))/minprhour - data_step/secprhour ! decimal hour (start of the step)

! check slope/aspect intent for radiation calculation
if(aspect == -1)then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be changed to a missing value indicator from engine/nrtype.f90 to be clearer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

scalarTotalRunoff = scalarSurfaceRunoff + scalarAquiferBaseflow

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove empty spaces.

@@ -771,7 +773,7 @@ subroutine computFlux(&

! check if computing aquifer fluxes
if(ixAqWat/=integerMissing)then

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove empty spaces.

@@ -729,7 +729,7 @@ subroutine computFlux(&
message=trim(message)//'expect dBaseflow_dMatric to be nSoil x nSoil'
err=20; return
endif

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove empty spaces.

@@ -152,10 +152,10 @@ subroutine checkPopulated(iStruct,metadata,err,message)

! loop through variables
do iVar=1,size(metadata)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor cleanup, but could you remove empty line spaces?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@andywood
Copy link
Collaborator Author

andywood commented Apr 5, 2021

Made all suggested changes

@arbennett arbennett self-requested a review April 5, 2021 18:04
slope = 0._dp
else
azimuth = aspect ! in degrees
slope = atan(abs(tan_slope))*180.0D0/PI_D ! convert from m/m to degrees
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the slope equation it should be 180._dp instead of 180.0D0

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

! ----- calculate weighted basin (GRU) fluxes --------------------------------------------------------------------------------------

! increment basin total runoff (m s-1)
bvarData%var(iLookBVAR%basin__TotalRunoff)%dat(1) = bvarData%var(iLookBVAR%basin__TotalRunoff)%dat(1) + fluxHRU%hru(iHRU)%var(iLookFLUX%scalarTotalRunoff)%dat(1) * fracHRU
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable will only work when the HRUs within a GRU are disconnected

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this ... could you explain it more? It should be just like the terms below ...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scalarRunoff is the runoff from an HRU. If HRUs are connected, then we only need the lateral flow from the most downslope HRU(s).

build/source/engine/run_oneGRU.f90 Show resolved Hide resolved
build/source/engine/run_oneGRU.f90 Show resolved Hide resolved
build/source/engine/run_oneGRU.f90 Show resolved Hide resolved
build/source/engine/qTimeDelay.f90 Show resolved Hide resolved
…ng basin column outflow rather than soil baseflow
build/source/engine/qTimeDelay.f90 Show resolved Hide resolved
build/source/engine/run_oneGRU.f90 Show resolved Hide resolved
build/source/engine/run_oneGRU.f90 Show resolved Hide resolved
@martynpclark
Copy link
Collaborator

The code looks good. Before merging, can I ask what tests were completed?

@arbennett arbennett merged commit c151a50 into CH-Earth:develop May 26, 2021
@andywood
Copy link
Collaborator Author

andywood commented May 27, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants