Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1b7526c

Browse files
Added MUSLE and APLE linkages.
1 parentf479455 commit1b7526c

29 files changed

+795
-194
lines changed

‎DESCRIPTION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: VFS
22
Title: Vegetated Filter Strip and Erosion Model
3-
Version: 0.9.3
3+
Version: 0.9.3-1
44
Date: 2018-09-06
55
Authors@R: c(person("Sarah", "Goslee", role = c("aut", "cre"),
66
email = "Sarah.Goslee@ars.usda.gov"),

‎R/APLE.R‎

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# APLE short form
2+
3+
APLE<-function(soilP,clay,OM,precip,runoff,erosion,manureP=25,manureSolids=25,manureWEP=50,manureIn=40,fertP=10,fertIn=40) {
4+
5+
## Inputs
6+
7+
# soilP: soil test Mehlich 3 (mg / kg)
8+
# clay: soil clay (%)
9+
# OM: soil organic matter (%)
10+
# precip: annual precipitation (in)
11+
# runoff: annual runoff (in)
12+
# erosion: annual erosion (ton / ac)
13+
# manureP: manure P applied (kg / ha): default 25
14+
# manureSolids: manure solids (%): default 50
15+
# manureWEP: manure WEP / TP (%): default 50
16+
# manureIn: manure incorporated (%): default 40
17+
# fertP: fertilizer P applied (kg / ha): default 10
18+
# fertIn: fertilizer incorporated (%): default 40
19+
20+
21+
22+
## Conversions and coefficients
23+
24+
# runoff (L / ha)
25+
runoffL<- (runoff*25.4)/10*100^4/1000
26+
27+
# erosion (kg / ha)
28+
erosion<-erosion*2000/2.205*2.471
29+
30+
# erosion enrichment ratio
31+
eer<- ifelse(erosion==0,0, max(exp(2.2-0.25* log(erosion)),1))
32+
33+
# soil dissolved P extraction coefficient: default 0.005
34+
Pcoef<-0.005
35+
36+
# soil organic carbon (%)
37+
SOC<-OM*0.58
38+
39+
# soil PSP
40+
soilPSP<- min(0.9, max(0.05, (-0.053* log(clay)+0.001* (soilP/2)-0.029*SOC+0.42)))
41+
42+
# soil labile P (mg / kg)
43+
soilPlabile<-soilP/2
44+
45+
# soil active P (mg / kg)
46+
soilPactive<-soilPlabile* (1-soilPSP)/soilPSP
47+
48+
# soil stable P (mg / kg)
49+
soilPstable<-soilPactive*4
50+
51+
# soil organic P (mg / kg)
52+
soilPorganic<-SOC*10000/8/14
53+
54+
# soil total P (mg / kg)
55+
soilPtotal<-soilPlabile+soilPactive+soilPstable+soilPorganic
56+
57+
58+
# AB manure WEP mineralized (kg / ha)
59+
manureWEPmineral<- (ifelse(manureSolids<15, (manureP* (1- (manureWEP/100))* ((100-manureIn)/100)*0.4), (manureP* (1- (manureWEP/100))* ((100-manureIn)/100))))*0.15
60+
61+
# AC manure WEP available (kg / ha)
62+
manureWEPavail<- ifelse(manureSolids<15, (manureP* (manureWEP/100)* ((100-manureIn)/100)*0.4), (manureP* (manureWEP/100)* ((100-manureIn)/100)))+manureWEPmineral
63+
64+
# AD manure PD factor
65+
manurePD<- (runoff/precip)^0.225
66+
67+
# AE fertilizer P available (kg / ha)
68+
fertPavail<- (fertP* ((100-fertIn)/100))
69+
70+
# AF fertilizer PD factor
71+
fertPD<-0.034* exp((runoff/precip)*3.4)
72+
73+
74+
# AH soil erosion P loss (kg / ha)
75+
lossErosion<-erosion*soilPtotal*eer/1000000
76+
77+
# AI soil dissolved P loss (kg / ha)
78+
lossDissolvedSoil<-soilP*0.5*Pcoef*runoffL/1000000
79+
80+
# AJ manure dissolved P loss (kg / ha)
81+
lossDissolvedManure<-manureWEPavail*runoff/precip*manurePD
82+
83+
# AK fertilizer dissolved P loss (kg / ha)
84+
lossDissolvedFert<-fertPavail*runoff/precip*fertPD
85+
86+
# AL total P loss (kg / ha)
87+
lossTotal<-lossErosion+lossDissolvedSoil+lossDissolvedManure+lossDissolvedFert
88+
89+
90+
list(lossErosion=lossErosion,lossDissolvedSoil=lossDissolvedSoil,lossDissolvedManure=lossDissolvedManure,lossDissolvedFert=lossDissolvedFert,lossTotal=lossTotal)
91+
92+
}
93+
94+

‎R/MUSLE.R‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Daily MUSLE sediment loss
2+
3+
MUSLE<-function(Q,qp,A,C=0.085,P=0.40,K,LS) {
4+
5+
# Q: runoff volume - m3/day
6+
# qp: runoff peak discharge m3/s
7+
# A: field area (ha)
8+
# returns S: Sediment yield - t/day
9+
10+
11+
11.8* (Q*qp*A)^0.56* (C*P*K*LS)
12+
13+
}
14+

‎R/MUSLEfactors.R‎

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
MUSLE.K<-function(fc,fm,ff) {
2+
# PTF from Goslee, unpublished data (manuscript in review)
3+
Sa<-fc*100
4+
Si<-fm*100
5+
Cl<-ff*100
6+
7+
Sa2<-Sa^2
8+
SaI<-1/Sa
9+
SaL<- log(Sa)
10+
Si<-Si
11+
SiI<-1/Si
12+
SiL<- log(Si)
13+
Cl<-Cl
14+
Cl2<-Cl^2
15+
ClL<- log(Cl)
16+
17+
18+
Kf<-0.93721+-0.00007*Sa2+-0.06562*SaI+-0.04880*SaL+-0.00239*Si+0.01337*SiI+0.00534*SiL+-0.01202*Cl+0.00004*Cl2+0.00762*ClL
19+
20+
21+
if(Kf<0.30)Kf<-0.03
22+
if(Kf>0.69)Kf<-0.69
23+
24+
Kf
25+
}
26+
27+
####
28+
29+
30+
MUSLE.LS<-function(FieldLength,FieldSlope) {
31+
32+
slopelength<-FieldLength# ft
33+
slopeanglep<-100*FieldSlope# percent
34+
slopeangled<- atan(FieldSlope)* (360/ (2*pi))# degrees
35+
36+
37+
m<-NA
38+
if(slopeanglep>5)m<-0.5
39+
if(slopeanglep>3&slopeanglep<=5)m<-0.4
40+
if(slopeanglep>1&slopeanglep<=3)m<-0.3
41+
if(slopeanglep<=1)m<-0.2
42+
43+
44+
LS<- (slopelength/72.6)^m* (65.41* sin(slopeangled* (2*pi)/360)^2+4.56* sin(slopeangled* (2*pi)/360)+0.065)
45+
46+
LS
47+
}
48+
49+
###
50+
51+
peak<-function(intensity,area,c=0.25) {
52+
# intensity: mm/hr
53+
# area: ha
54+
55+
intensity<-intensity/25.4# convert intensity to inch/hour
56+
area<-area*2.47105# convert drainage area to acres
57+
58+
peakd<-c*intensity*area# cfs
59+
60+
peakd*0.0283168# return m3/second
61+
}
62+
63+

R/VFSsim.R renamed to R/VFS.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VFSsim<-
1+
VFS<-
22
function(nyears=1000,thissoil,thisbuffer,rain,temperature,Duration=2,FieldArea=4000,VFSwidth=10.7,VFSslope=0.02,FieldSlope,z=1000,a=1,b= c(.5,1,1.5,2.5),carrysoilwater=TRUE,runoffcalc=TRUE) {
33

44
# nyears: number of years to simulate
@@ -32,8 +32,8 @@ function(nyears = 1000, thissoil, thisbuffer, rain, temperature, Duration = 2, F
3232
VFSwidth<-3.28084*VFSwidth
3333

3434
## Assume a square field
35-
FieldLength<- sqrt(FieldArea)
36-
FieldLength<-3.28084*FieldLength
35+
FieldLength<- sqrt(FieldArea)#m2
36+
FieldLength<-3.28084*FieldLength# ft
3737

3838
## If field slope isn't specified, use VFS slope
3939
if(missing(FieldSlope))FieldSlope<-VFSslope

‎R/VFSAPLE.R‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
VFSAPLE<-function(x,soilP,OM,manureP=25,manureSolids=25,manureWEP=50,manureIn=40,fertP=10,fertIn=40) {
2+
if(!inherits(x,"VFS")) {
3+
stop("VFSAPLE requires the output of VFS\n")
4+
}
5+
6+
# mean annual rainfall in mm
7+
precip<-x$AnnualRainfall[,1]
8+
precip<-precip/25.4# inches
9+
10+
# mean annual runoff in mm
11+
runoff<-x$AnnualRunoff[,1]
12+
runoff<-runoff/25.4# inches
13+
14+
# field characteristics
15+
clay<-100*x$field[["clay"]]# percent
16+
17+
# mean annual erosion BEFORE vegetated filter strip t/ha
18+
erosionPre<-x$AnnualLoadInMUSLE[,1]
19+
erosionPre<-erosionPre*0.44609
20+
21+
# mean annual erosion AFTER vegetated filter strip t/ha
22+
erosionPost<-x$AnnualLoadOutMUSLE[,1]
23+
erosionPost<-erosionPost*0.44609
24+
25+
26+
27+
preVFS<- APLE(soilP,clay,OM,precip,runoff,erosionPre,manureP=25,manureSolids=25,manureWEP=50,manureIn=40,fertP=10,fertIn=40)
28+
29+
postVFS<- APLE(soilP,clay,OM,precip,runoff,erosionPost,manureP=25,manureSolids=25,manureWEP=50,manureIn=40,fertP=10,fertIn=40)
30+
31+
32+
# percent change in erosion P and in total P losses
33+
pErosion<-100* (preVFS$lossErosion-postVFS$lossErosion)/postVFS$lossErosion
34+
pTotal<-100* (preVFS$lossTotal-postVFS$lossTotal)/postVFS$lossTotal
35+
36+
list(preVFS=preVFS,postVFS=postVFS,pErosion=pErosion,pTotal=pTotal)
37+
38+
}
39+
40+

‎data/weather.rda‎

113 KB
Binary file not shown.

‎man/APLE.Rd‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
\name{APLE}
2+
\alias{APLE}
3+
\title{
4+
AgriculturalPhosphorusLossEstimator
5+
}
6+
\description{
7+
AgriculturallossofphosphorusbasedonsoilP,additionsoffertilizerandmanure,anderosion..
8+
}
9+
\usage{
10+
APLE(soilP,clay,OM,precip,runoff,erosion,manureP=25,manureSolids=25,
11+
manureWEP=50,manureIn=40,fertP=10,fertIn=40)
12+
}
13+
\arguments{
14+
\item{soilP}{
15+
%%~~Describe \code{soilP}here~~
16+
}
17+
\item{clay}{
18+
%%~~Describe \code{clay}here~~
19+
}
20+
\item{OM}{
21+
%%~~Describe \code{OM}here~~
22+
}
23+
\item{precip}{
24+
%%~~Describe \code{precip}here~~
25+
}
26+
\item{runoff}{
27+
%%~~Describe \code{runoff}here~~
28+
}
29+
\item{erosion}{
30+
%%~~Describe \code{erosion}here~~
31+
}
32+
\item{manureP}{
33+
%%~~Describe \code{manureP}here~~
34+
}
35+
\item{manureSolids}{
36+
%%~~Describe \code{manureSolids}here~~
37+
}
38+
\item{manureWEP}{
39+
%%~~Describe \code{manureWEP}here~~
40+
}
41+
\item{manureIn}{
42+
%%~~Describe \code{manureIn}here~~
43+
}
44+
\item{fertP}{
45+
%%~~Describe \code{fertP}here~~
46+
}
47+
\item{fertIn}{
48+
%%~~Describe \code{fertIn}here~~
49+
}
50+
}
51+
\details{
52+
%%~~Ifnecessary,moredetailsthanthedescriptionabove~~
53+
}
54+
\value{
55+
%%~Describethevaluereturned
56+
%%IfitisaLIST,use
57+
%% \item{comp1 }{Descriptionof'comp1'}
58+
%% \item{comp2 }{Descriptionof'comp2'}
59+
%%...
60+
}
61+
\references{
62+
%%~putreferencestotheliterature/websitehere~
63+
}
64+
\author{
65+
SarahGoslee
66+
}
67+
68+
69+
\seealso{
70+
\code{\link{VFSAPLE}}
71+
}
72+
\examples{
73+
}
74+

‎man/MUSLE.K.Rd‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
\name{MUSLE.K}
2+
\alias{MUSLE.K}
3+
\title{
4+
EstimatesoilerodibilityfactorK.
5+
}
6+
\description{
7+
EstimatesMUSLEsoilerodibilityfromamultipleregressionmodelofsoiltexture.
8+
}
9+
\usage{
10+
MUSLE.K(fc,fm,ff)
11+
}
12+
\arguments{
13+
\item{fc}{
14+
Fractionofcoarse material (sand)inthe soil (0-1).
15+
}
16+
\item{fm}{
17+
Fractionofmedium material (silt)inthe soil (0-1).
18+
}
19+
\item{ff}{
20+
Fractionoffine material (clay)inthe soil (0-1).
21+
}
22+
}
23+
\details{
24+
IfKisnotavailablefromothersources,itcanbeestimatedfromsoil texture (Goslee,inreview).
25+
}
26+
\value{
27+
ReturnsthesoilerodibilityfactorK.
28+
}
29+
\references{
30+
Wischmeier,W.H.,andSmith,D.D.1978.Predictingrainfallerosionlosses-aguidetoconservationplanning.U.S.DepartmentofAgriculture,AgricultureHandbookNo.537.
31+
}
32+
\author{
33+
SarahGoslee
34+
}
35+
36+
\seealso{
37+
\code{\link{MUSLE}}
38+
}
39+
\examples{
40+
41+
Kf<- MUSLE.K(.3,.5,.2)
42+
43+
}
44+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp