-
Notifications
You must be signed in to change notification settings - Fork 0
/
Subsidence Analysis S.R
376 lines (334 loc) · 14 KB
/
Subsidence Analysis S.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
library(propagate)
#importing data and parameters with their errors ....
###### IMPORT SOUTHERN COASTAL RANGE
#for porosity-depth functions
PoFun = read.csv('Backstripping/Pofun.csv')
#for sea level change
deltaSL = read.csv('Sealevel/SL_Unit_S.csv')
#for stratigraphy data
Strat = read.csv('Thickness/Ages_S_new.csv')
#lithology
Litho <- read.csv('Thickness/Litho_S.csv')
#Paleobathymetry
PB <- read.csv('Thickness/PB_Unit_S.csv')
###### FUNCTIONS
#porosity-depth function ....
porosity_depth <- function(depth, porosity_0, decayC) {
po_result <- porosity_0 * exp(-depth/decayC)
return(po_result)
}
#Decompaction ...
decompaction <- function(D0, D0_err, Di, Di_err, T0, T0_err, porosity_0, porosity_0_err, decayC, decayC_err) {
#D0, D0err are the original "depth" and its s.e. of the top of unit i
#Di, Dierr are the backstripped "depth" and its s.e. of the top of unit i
#T0, T0err are the un-decompacted thickness and its s.e. of unit i
#porosity_0, porosity_0err are the surface porosity and its s.e. for certain lithology
#decayC, decayCerr are the decay constant and its s.e. for certain lithology
#calculate decompacted thickness
K1 <- (-1)*decayC*porosity_0*exp(-(Di/decayC))
K2 <- (decayC*porosity_0*exp(-(D0/decayC))*(exp(-(T0/decayC))-1)) + T0 - K1
decompacted_T <- T0
repeat{
test_T <- K1*exp(-(decompacted_T/decayC)) + K2
if (abs(test_T-decompacted_T) < 1e-6 | is.na(test_T)) break
decompacted_T <- test_T
}
oD <- c(D0, D0_err)
dD <- c(Di, Di_err)
oT <- c(T0, T0_err)
dT <- c(decompacted_T, abs(decompacted_T-T0)+2*T0_err) #approximate its error as the absolute error plus T0_err
P <- c(porosity_0, porosity_0_err)
C <- c(decayC, decayC_err)
DF <- cbind(oD, dD, oT, dT, P, C)
if (!is.na(Di) & !is.na(Di_err)){
Ti <- propagate(expr = expression(((-1)*C*P*exp(-(dD/C)))*exp(-(dT/C))
+ ((C*P*exp(-(oD/C))*(exp(-(oT/C))-1))
+ oT - (-1)*C*P*exp(-(dD/C))))
, data = DF, type = "stat",
do.sim = F, verbose = TRUE)
Tiextracted <- c(unname(Ti$prop[1]),unname(Ti$prop[3]))
}
else{
Tiextracted <- c(NA, NA)
}
#results <- c(decompacted_T, ERR)
return(Tiextracted)
#Ouputs: propagated mean1 and se.1
}
#Mass for unit i at certain time ....
Mass <- function(Di, Di_err, Ti, Ti_err, rho_w, rho_w_err, rho_g, rho_g_err, porosity_0, porosity_0_err, decayC, decayC_err) {
dD <- c(Di, Di_err)
dT <- c(Ti, Ti_err)
rhoW <- c(rho_w, rho_w_err)
rhoG <- c(rho_g, rho_g_err)
P <- c(porosity_0, porosity_0_err)
C <- c(decayC, decayC_err)
DF <- cbind(dD, dT, rhoW, rhoG, P, C)
#find the 1-D mass for unit i
if (!is.na(Di) & !is.na(Di_err)){
MassS <- propagate(expr = expression(rhoG*dT + (rhoW - rhoG)*C*P*exp(-(dD/C))*(1 - exp(-(dT/C))))
, data = DF, type = "stat",
do.sim = F, verbose = TRUE)
MassSextracted <- c(unname(MassS$prop[1]),unname(MassS$prop[3]))
}
else{
MassSextracted <- c(NA,NA)
}
return(MassSextracted)
#Ouputs: propagated meano and se.1
}
#assuming no error for the density of marine water (rho_w = 1025 +- 0)
#Getting density of each unit by dividing the Mass by Ti (but in calculating total)
#calculate Di, depth of t0
Depth <- function(Ti, Ti_err) {
Di <- c()
Di_err <- c()
for (i in 1:length(Ti)) {
#for unit i-1
if (i == 1){
Di[i] <- 0
Di_err[i] <- 0
}
else{
Di[i] <- Di[i-1] + Ti[i-1]
Di_err[i] <- sqrt(Ti_err[i-1]^2 + Di_err[i-1]^2)
}
}
Diextracted <- data.frame(Di,Di_err)
return(Diextracted)
}
#Airy Tectonic subsidence function
TectZ <- function(Si, Si_err, Wi, Wi_err, dSL, dSL_err, rho_w, rho_w_err, rho_a, rho_a_err, rho_s, rho_s_err) {
S <- c(Si, Si_err)
W <- c(Wi, Wi_err)
SL <- c(dSL, dSL_err)
rhoW <- c(rho_w, rho_w_err)
rhoA <- c(rho_a, rho_a_err)
rhoS <- c(rho_s, rho_s_err)
DF <- cbind(S, W, SL, rhoW, rhoA, rhoS)
#find the 1-D mass for unit i
if (!is.na(rho_s) & !is.na(rho_s_err)){
Z <- propagate(expr = expression(S*((rhoA-rhoS)/(rhoA - rhoW))+W-SL*(rhoA/(rhoA-rhoW)))
, data = DF, type = "stat",
do.sim = F, verbose = TRUE)
Zextracted <- c(unname(Z$prop[1]),unname(Z$prop[3]))
}
else{
Zextracted <- c(NA,NA)
}
return(Zextracted)
#Ouputs: propagated meano and se.1
}
###### INITIAL PARAMETERS
#parameters
T0 = Strat$oT
T0_err = Strat$T0_err
age = Strat$Age
age_err = Strat$Age_err
unitno = Strat$Units
rho_w = 1025
rho_w_err = 2
rho_a = 3300
rho_a_err = 0
rho_g = c(t(PoFun$rho_g)) #"Mdt","Sst","AvgMS"
rho_g_err = c(t(PoFun$rho_g_err)) #"Mdt","Sst","AvgMS"
porosity_0 = c(t(PoFun$Porosity_0)) #"Mdt","Sst","AvgMS"
porosity_0_err = c(t(PoFun$Porosity_0_err)) #"Mdt","Sst","AvgMS"
decayC = c(t(PoFun$DecayC)) #"Mdt","Sst","AvgMS"
decayC_err = c(t(PoFun$DecayC_err)) #"Mdt","Sst","AvgMS"
dSL = deltaSL$dSL
dSL_err = deltaSL$dSLerr
W = PB$W
W_err = PB$Werr
D0 <- Depth(T0,T0_err)[,1]
D0_err <- Depth(T0,T0_err)[,2]
Stu <- c()
Stu_err <- c()
Su <- c()
Su_err <- c()
MaxElev = 1682/2
MaxElev_err = 1682/2
#non-decompacted total sediment thickness and subsidencebasement depth
for (i in 1:length(unitno)) {
Stu[i] <- max(D0)-sum(T0[1:i-1])
Stu_err[i] <- sqrt(sum(T0_err[i:length(unitno)]^2))
Su[i] <- (max(D0)-sum(T0[1:i-1]))+W[i]-dSL[i]
Su_err[i] <- sqrt(sum(T0_err[i:length(unitno)]^2)+W_err[i]^2+dSL_err[i]^2)
}
#Decompaction and backstripping ....
N = length(unitno)
for (i in 1:N) { #for time i to max_i
#reset tempt vectors
Ti <- c()
Ti_err <- c()
Titempt <- c()
Ti_k <- c()
Ti_k_err <- c()
Mi <- c()
Mi_err <- c()
Mtemp <- c()
Mi_k <- c()
Mi_k_err <- c()
if (i == 1) {
Di <- 0
Di_err <- 0
Ti <- c()
Ti_err <- c()
Diall <- c()
Diall_err <- c()
Tiall <- c()
Tiall_err <- c()
Stiall <- c()
Stiall_err <-c()
Siall <- c()
Siall_err <-c()
rhoiall <- c()
rhoiall_err <- c()
}
for (j in i:N) { #for the unit j
for (k in 1:length(Litho[1,2:5])) { #for various lithology
#fraction of certain lithology
FL = Litho[1,k+1]
#calculate decompacted thickness
Titempt = decompaction(D0[j], D0_err[j], Di[j], Di_err[j], T0[j], T0_err[j], porosity_0[k], porosity_0_err[k], decayC[k], decayC_err[k])
Ti_k[k] <- Titempt[1]*FL
Ti_k_err[k] <- Titempt[2]*FL
}
Ti[j] <- sum(Ti_k, na.rm = TRUE)
if (i == 1){
Ti_err[j] <- T0_err[j]
}
else {
Ti_err[j] <- sum(Ti_k_err, na.rm = TRUE)
}
if (j <= N-1){
Di[j+1] <- Di[j] + Ti[j]
Di_err[j+1] <- sqrt(Di_err[j]^2+Ti_err[j]^2)
}
for (k in 1:length(Litho[1,2:5])) { #for various lithology
#fraction of certain lithology
FL = Litho[1,k+1]
#calculate decompacted mass
Mtempt = Mass(Di[j], Di_err[j], Ti[j], Ti_err[j], rho_w, rho_w_err, rho_g[k], rho_g_err[k], porosity_0[k], porosity_0_err[k], decayC[k], decayC_err[k])
Mi_k[k] <- FL*Mtempt[1]
Mi_k_err[k] <- FL*Mtempt[2]
}
Mi[j] <- sum(Mi_k)
Mi_err[j] <- sum(Mi_k_err)
#compile results
}
Tiall <- cbind(Tiall, Ti)
Diall <- cbind(Diall, Di)
Tiall_err <- cbind(Tiall_err, Ti_err)
Diall_err <- cbind(Diall_err, Di_err)
#total decompacted thickness
Stiall <- append(Stiall, max(Di, na.rm = TRUE), after = length(Stiall))
Stiall_err <-append(Stiall_err, max(Di_err, na.rm = TRUE), after = length(Stiall_err))
#total subsidence
Siall <- append(Siall, (max(Di, na.rm=TRUE)+W[i]-dSL[i]), after = length(Siall))
Siall_err <-append(Siall_err, (sqrt(max(Di_err, na.rm=TRUE)^2+W_err[i]^2+dSL_err[i]^2)), after = length(Siall_err))
#compile results
if (i == N){
rhoiall <- append(rhoiall, 0 , after = length(rhoiall))
rhoiall_err <- append(rhoiall_err, 0, after = length(rhoiall_err))
}
else{
rhoiall <- append(rhoiall, sum(Mi, na.rm = TRUE)/max(Di, na.rm = TRUE) , after = length(rhoiall))
rhoiall_err <- append(rhoiall_err
, (sum(Mi, na.rm = TRUE)/max(Di, na.rm = TRUE))
* sqrt((sqrt(sum(Mi_err^2, na.rm = TRUE))/sum(Mi, na.rm = TRUE))^2
+ (max(Di_err, na.rm = TRUE)/max(Di, na.rm = TRUE))^2)
, after = length(rhoiall_err))
}
#reset
Di <- c()
Di_err <- c()
Di[i+1] <- 0
Di_err[i+1] <- 0
}
#calculate Tectonic subsidence
Zitempt <- c()
Zi <- c()
Zi_err <- c()
N = length(unitno)
for (i in 1:N) { #for the unit j
#calculate decompacted thickness
Zitempt = TectZ(Stiall[i], Stiall_err[i], W[i], W_err[i], dSL[i], dSL_err[i], rho_w, rho_w_err, rho_a, rho_a_err, rhoiall[i], rhoiall_err[i])
Zi[i] <- Zitempt[1]
Zi_err[i] <- Zitempt[2]
}
#####
#plotting SOUTHERN COASTAL RANGE
pdf("Figures/Subsidence_S.pdf", width=3.5, height=3,pointsize = 9)
#background
plot(Su[2:length(Su)]~age[2:length(age)], type="l", xlab="Age (Ma)", ylab="Depth, Elevation (m)", main="Southern Coastal Range",xlim=rev(c(0,5)), ylim=rev(c(-2000,9000)))
grid(nx = -2:8, ny = NULL, col = "grey", lty = "dotted",lwd = par("lwd"), equilogs = TRUE)
rug(seq(0, 5, by=0.2), ticksize = -0.02, side = 1)
rug(seq(-2000, 9000, by=5000), ticksize = -0.02, side = 2)
#paleobathymetry
lines(W[1:length(W)] ~ age[1:length(W)], col="#69CEEC")
arrows(age-age_err, W, age+age_err, W, length=0, angle=0, code=1, lwd=1, col="#69CEEC")
arrows(age, (W-W_err), age, (W+W_err), length=0, angle=0, code=1, lwd=1, col="#69CEEC")
points(W[2:length(W)]~age[2:length(age)], pch=16, cex=.6, col="#69CEEC")
points(W[1]~age[1], pch=7, cex=.6, col="#69CEEC")
#Tectonic subsidence
lines(Zi[2:length(Zi)]~age[2:length(Zi)], col="red")
arrows(age-age_err, Zi, age+age_err, Zi, length=0, angle=0, code=1, lwd=1, col="red")
arrows(age, (Zi-Zi_err), age, (Zi+Zi_err), length=0, angle=0, code=1, lwd=1, col="red")
points(Zi[2:length(Zi)]~age[2:length(age)], pch=16, cex=.6, col="red")
points(Zi[1]~age[1], pch=7, cex=.6, col="red")
lines(c(age[1:2]),c(Zi[1:2]),lty = "longdash",col="red")
#un-decompacted curve
arrows(age-age_err, Su, age+age_err, Su, length=0, angle=0, code=1, lwd=1)
arrows(age, (Su-Su_err), age, (Su+Su_err), length=0, angle=0, code=1, lwd=1)
points(Su[2:length(Su)]~age[2:length(age)], pch=16, cex=.6)
points(Su[1]~age[1], pch=7, cex=.6)
lines(c(age[1:2]),c(Su[1:2]),lty = "longdash")
#plot total subsidence curve
points(Siall[2:length(Siall)]~age[2:length(age)], type="l", col="blue")
arrows(age[1:(length(Siall)-1)]-age_err[1:(length(Siall)-1)], Siall[1:(length(Siall)-1)], age[1:(length(Siall)-1)]+age_err[1:(length(Siall)-1)], Siall[1:(length(Siall)-1)], length=0, angle=0, code=3, lwd=1, col="blue")
arrows(age[1:(length(Siall)-1)], (Siall[1:(length(Siall)-1)]-Siall_err[1:(length(Siall)-1)]), age[1:(length(Siall)-1)], (Siall[1:(length(Siall)-1)]+Siall_err[1:(length(Siall)-1)]), length=0, angle=0, code=1, lwd=1, col="blue")
points(Siall[2:(length(Siall)-1)]~age[2:(length(age)-1)], pch=16, cex=.6, col="blue")
points(Siall[1]~age[1], pch=7, cex=.6, col="blue")
lines(c(age[1:2]),c(Siall[1:2]),lty = "longdash", col="blue")
lines(c(0,age[1]),c(-MaxElev, Siall[1]),lty = "dashed", col="blue")
lines(c(0,age[2]),c(-MaxElev, Siall[2]),lty = "dashed",col="#b8baff")
#Assumed basement uplift history
arrows(c(mean(c(5.53,4.31)),mean(c(3.82,3.35))), c(200-100,0-100), c(mean(c(5.53,4.31)),mean(c(3.82,3.35))), c(200+100,0+100), length=0, angle=0, code=3, lwd=1,col="grey")
arrows(c(mean(c(5.53,4.31))-(5.53-4.31)/2,mean(c(3.82,3.35))-(3.82-3.35)/2), c(200,0), c(mean(c(5.53,4.31))+(5.53-4.31)/2,mean(c(3.82,3.35))+(3.82-3.35)/2), c(200,0), length=0, angle=0, code=3, lwd=1,col="grey")
points(c(200,0)~c(mean(c(5.53,4.31)),mean(c(3.82,3.35))), pch=2, cex=.6,col="grey")
lines(c(mean(c(5.53,4.31)),mean(c(3.82,3.35))),c(200, 0),lty = "dashed",col="#808080")
#MAX ELEVATION
points( c(-MaxElev) ~ c(0), pch=1, cex=.6)
arrows(c(0), -(MaxElev-MaxElev_err), c(0), -(MaxElev+MaxElev_err), length=0, angle=0, code=3, lwd=1)
#Legend
legend(5, 5500, legend=c("Non-decompacted total subsidence", "Decompacted total subsidence", "Tectonic subsidence","Paleobathymetry"), col=c("black","blue","red","#69CEEC"), lty=1, cex=.6, lwd=1.5)
#calculating uplift rates
MaxUrate = ((Siall[1]+MaxElev)/age[1])/1000
MaxUrate_err = MaxUrate*sqrt((sqrt(Siall_err[1]^2+MaxElev_err^2)/(Siall[1]+MaxElev))^2 + (age_err[1]/age[1])^2)
MinUrate = ((Siall[2]+MaxElev)/age[2])/1000
MinUrate_err = MinUrate*sqrt((sqrt(Siall_err[2]^2+MaxElev_err^2)/(Siall[2]+MaxElev))^2 + (age_err[2]/age[2])^2)
text(0.15, 6500, paste(format(MaxUrate,digits=3) ,"\u00b1",format(MaxUrate_err,digits=2)), col="blue", cex = .6)
text(0.2, 7000, paste("mm/yr"), col="blue", cex = .6)
text(.6, 1700, paste(format(MinUrate,digits=2) ,"\u00b1",format(MinUrate_err,digits=1)), col="#b8baff", cex = .6)
text(.6, 2200, paste("mm/yr"), col="#b8baff", cex = .6)
#calculating subsidence rates
Srate_2 = ((Siall[2]-Siall[15])/abs(age[2]-age[15]))/1000
Srate_2_err = Srate_2 * sqrt((sqrt(Siall_err[2]^2+Siall_err[15]^2)/(Siall[2]-Siall[15]))^2 + (sqrt(age_err[2]^2+age_err[15]^2)/(age[2]-age[15]))^2)
text(2.5, 3700, paste(format(Srate_2,digits=2) ,"\u00b1",format(Srate_2_err,digits=1)), col="blue", cex = .6)
text(2.5, 4200, paste("mm/yr"), col="blue", cex = .6)
dev.off()
######
Results <- data.frame(Unit = unitno, Age = age, Age_err = age_err, T0 = T0, T0_err = T0_err,
PB = W, PB_err = W_err, dSL = dSL, dSLerr = dSL_err
, undecompactedTotalS = Su, undecompactedTotalS_err = Su_err
, TotalS = Siall, TotalS_err = Siall_err
, TectS = Zi, TectS_err = Zi_err, RhoS = rhoiall, RhoS_err = rhoiall_err)
print(Results)
write.csv(Results, "Subsidence results_S.csv", row.names = FALSE)
Results2 <- data.frame(SubRate = Srate_2, SubRate_err = Srate_2_err,
Elev = MaxElev, Elev_err = MaxElev_err,
MinUpRate = MinUrate, MinUpRate_err = MinUrate_err,
EstUpRate = MaxUrate, EstUpRate_err = MaxUrate_err)
print(Results2)
write.csv(Results2, "vertical rates_S.csv", row.names = FALSE)