Skip to content

Commit 205095a

Browse files
committed
new scripts to run the metabolism model incl diffusion
1 parent 8791d68 commit 205095a

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/odem_min_indexed_sed.stan

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ transformed parameters {
143143
mineral[i] = MIN[i_Param[i]] * theta0[i-1];
144144
//sed2[i] = SED2[i_Param[i]] * (fmax((DO_tot[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_tot[i-1]*tau+mu),1e-06))) * theta0[i-1] / mean_depth + DO_tot[i-1] * diff_mol/z_dbl * theta0[i-1] / mean_depth;
145145
sed_monod[i] = (SED2[i_Param[i]] * theta0[i-1] )/ mean_depth; //fmax(fmax((DO_tot[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_tot[i-1]*tau+mu),1e-06)),1e-06) *
146-
// fmax((DO_tot[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_tot[i-1]*tau+mu),1e-06))
146+
// fmax((DO_tot[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_tot[i-1]*tau+mu),1e-06))
147147
// sed_first[i] = fmax(fmax((DO_tot[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_tot[i-1]*tau+mu),1e-06)),1e-06) * (fmax((DO_tot[i-1]*tau + mu),1e-06) * diff_mol/z_dbl * theta0[i-1]) / fmax((volume_tot[i-1]/area_epi[i-1]),1);
148148
sed_first[i] = ((fmax((DO_tot[i-1]*tau + mu),1e-06) * diff_mol[i-1]/(z_dbl * max_depth) * theta0[i-1]))/tau;
149149
sed2[i] = sed_monod[i] + sed_first[i];
@@ -183,7 +183,7 @@ transformed parameters {
183183
mineral[i] = MIN[i_Param[i]] * theta2[i-1];
184184
//sed2[i] = (SED2[i_Param[i]] * (fmax((DO_hyp[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_hyp[i-1]*tau+mu),1e-06))) * theta2[i-1]) / fmax((volume_hyp[i-1]/area_hyp[i-1]),1) + (DO_hyp[i-1] * diff_mol/z_dbl* theta2[i-1]) / fmax((volume_hyp[i-1]/area_hyp[i-1]),1);
185185
sed_monod[i] = (SED2[i_Param[i]] * theta2[i-1]) / fmax((volume_hyp[i-1]/area_hyp[i-1]),1);// fmax(fmax((DO_hyp[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_hyp[i-1]*tau+mu),1e-06)),1e-06) *
186-
// fmax((DO_hyp[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_hyp[i-1]*tau+mu),1e-06))
186+
// fmax((DO_hyp[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_hyp[i-1]*tau+mu),1e-06))
187187
// sed_first[i] =fmax(fmax((DO_hyp[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_hyp[i-1]*tau+mu),1e-06)),1e-06) * (fmax((DO_hyp[i-1]*tau + mu),1e-06) * diff_mol/z_dbl* theta2[i-1]) / fmax((volume_hyp[i-1]/area_hyp[i-1]),1);
188188
sed_first[i] = ((fmax((DO_hyp[i-1]*tau + mu),1e-06) * diff_mol[i-1]/(fmax((volume_hyp[i-1]/area_hyp[i-1]),1)*z_dbl) * theta2[i-1]) ) /tau;
189189
sed2[i] = sed_monod[i] + sed_first[i];

src/odem_min_indexed_sed_south.stan

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ transformed parameters {
143143
mineral[i] = MIN[i_Param[i]] * theta0[i-1];
144144
//sed2[i] = SED2[i_Param[i]] * (fmax((DO_tot[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_tot[i-1]*tau+mu),1e-06))) * theta0[i-1] / mean_depth + DO_tot[i-1] * diff_mol/z_dbl * theta0[i-1] / mean_depth;
145145
sed_monod[i] = (SED2[i_Param[i]] * theta0[i-1] )/ mean_depth; //fmax(fmax((DO_tot[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_tot[i-1]*tau+mu),1e-06)),1e-06) *
146-
// fmax((DO_tot[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_tot[i-1]*tau+mu),1e-06))
146+
// fmax((DO_tot[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_tot[i-1]*tau+mu),1e-06))
147147
// sed_first[i] = fmax(fmax((DO_tot[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_tot[i-1]*tau+mu),1e-06)),1e-06) * (fmax((DO_tot[i-1]*tau + mu),1e-06) * diff_mol/z_dbl * theta0[i-1]) / fmax((volume_tot[i-1]/area_epi[i-1]),1);
148148
sed_first[i] = ((fmax((DO_tot[i-1]*tau + mu),1e-06) * diff_mol[i-1]/(z_dbl * max_depth) * theta0[i-1]))/tau;
149149
sed2[i] = sed_monod[i] + sed_first[i];
@@ -183,7 +183,7 @@ transformed parameters {
183183
mineral[i] = MIN[i_Param[i]] * theta2[i-1];
184184
//sed2[i] = (SED2[i_Param[i]] * (fmax((DO_hyp[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_hyp[i-1]*tau+mu),1e-06))) * theta2[i-1]) / fmax((volume_hyp[i-1]/area_hyp[i-1]),1) + (DO_hyp[i-1] * diff_mol/z_dbl* theta2[i-1]) / fmax((volume_hyp[i-1]/area_hyp[i-1]),1);
185185
sed_monod[i] = (SED2[i_Param[i]] * theta2[i-1]) / fmax((volume_hyp[i-1]/area_hyp[i-1]),1);// fmax(fmax((DO_hyp[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_hyp[i-1]*tau+mu),1e-06)),1e-06) *
186-
// fmax((DO_hyp[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_hyp[i-1]*tau+mu),1e-06))
186+
// fmax((DO_hyp[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_hyp[i-1]*tau+mu),1e-06))
187187
// sed_first[i] =fmax(fmax((DO_hyp[i-1]*tau+mu),1e-06)/(khalf + fmax((DO_hyp[i-1]*tau+mu),1e-06)),1e-06) * (fmax((DO_hyp[i-1]*tau + mu),1e-06) * diff_mol/z_dbl* theta2[i-1]) / fmax((volume_hyp[i-1]/area_hyp[i-1]),1);
188188
sed_first[i] = ((fmax((DO_hyp[i-1]*tau + mu),1e-06) * diff_mol[i-1]/(fmax((volume_hyp[i-1]/area_hyp[i-1]),1)*z_dbl) * theta2[i-1]) ) /tau;
189189
sed2[i] = sed_monod[i] + sed_first[i];

src/run_odem_chtc_sed.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ for (i in 2:nParamEstimates){
106106
}
107107

108108

109-
buoy.freq <- sqrt((get_dens(in1yr$temperature_hypo,0) - get_dens(in1yr$temperature_epi,0))/(in1yr$lower_meta - in1yr$upper_meta)* 9.81/998.2)
109+
buoy.freq <- ((get_dens(in1yr$temperature_hypo,0) - get_dens(in1yr$temperature_epi,0))/(in1yr$lower_meta - in1yr$upper_meta)* 9.81/998.2)
110110
buoy.freq[which(buoy.freq<7e-5)] = 7e-5
111111
kz = 0.00706 * (mean(in1yr$area_surface))^(0.56) * buoy.freq^(-0.43)
112112
kz[which(is.na(kz))] = 1e-10

src/run_odem_chtc_sed_south.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ for (i in 2:nParamEstimates){
106106
}
107107

108108

109-
buoy.freq <- sqrt((get_dens(in1yr$temperature_hypo,0) - get_dens(in1yr$temperature_epi,0))/(in1yr$lower_meta - in1yr$upper_meta)* 9.81/998.2)
109+
buoy.freq <- ((get_dens(in1yr$temperature_hypo,0) - get_dens(in1yr$temperature_epi,0))/(in1yr$lower_meta - in1yr$upper_meta)* 9.81/998.2)
110110
buoy.freq[which(buoy.freq<7e-5)] = 7e-5
111111
kz = 0.00706 * (mean(in1yr$area_surface))^(0.56) * buoy.freq^(-0.43)
112112
kz[which(is.na(kz))] = 1e-10

0 commit comments

Comments
 (0)