Skip to content

Commit 78a733e

Browse files
authored
Merge branch 'master' into pkgdown
2 parents 6db27df + a1b73a3 commit 78a733e

File tree

7 files changed

+265
-12
lines changed

7 files changed

+265
-12
lines changed

NAMESPACE

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ export(EMISSIONS_SO2)
5454
export(FFI_EMISSIONS)
5555
export(FLUX_INTERIOR)
5656
export(FLUX_MIXED)
57+
export(F_LITTERD)
58+
export(F_LUCD)
59+
export(F_LUCV)
60+
export(F_NPPD)
61+
export(F_NPPV)
5762
export(GETDATA)
5863
export(GLOBAL_TEMP)
5964
export(GLOBAL_TEMPEQ)

R/RcppExports.R

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,36 @@ BETA <- function() {
706706
.Call('_hector_BETA', PACKAGE = 'hector')
707707
}
708708

709+
#' @describeIn parameters NPP fraction to vegetation (\code{"(unitless)"})
710+
#' @export
711+
F_NPPV <- function() {
712+
.Call('_hector_F_NPPV', PACKAGE = 'hector')
713+
}
714+
715+
#' @describeIn parameters NPP fraction to detritus (\code{"(unitless)"})
716+
#' @export
717+
F_NPPD <- function() {
718+
.Call('_hector_F_NPPD', PACKAGE = 'hector')
719+
}
720+
721+
#' @describeIn parameters Litter fraction to detritus (\code{"(unitless)"})
722+
#' @export
723+
F_LITTERD <- function() {
724+
.Call('_hector_F_LITTERD', PACKAGE = 'hector')
725+
}
726+
727+
#' @describeIn parameters LUC fraction to vegetation (\code{"(unitless)"})
728+
#' @export
729+
F_LUCV <- function() {
730+
.Call('_hector_F_LUCV', PACKAGE = 'hector')
731+
}
732+
733+
#' @describeIn parameters LUC fraction to detritus (\code{"(unitless)"})
734+
#' @export
735+
F_LUCD <- function() {
736+
.Call('_hector_F_LUCD', PACKAGE = 'hector')
737+
}
738+
709739
#' @rdname so2
710740
#' @export
711741
NATURAL_SO2 <- function() {

man/parameters.Rd

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/RcppExports.cpp

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,56 @@ BEGIN_RCPP
11751175
return rcpp_result_gen;
11761176
END_RCPP
11771177
}
1178+
// F_NPPV
1179+
String F_NPPV();
1180+
RcppExport SEXP _hector_F_NPPV() {
1181+
BEGIN_RCPP
1182+
Rcpp::RObject rcpp_result_gen;
1183+
Rcpp::RNGScope rcpp_rngScope_gen;
1184+
rcpp_result_gen = Rcpp::wrap(F_NPPV());
1185+
return rcpp_result_gen;
1186+
END_RCPP
1187+
}
1188+
// F_NPPD
1189+
String F_NPPD();
1190+
RcppExport SEXP _hector_F_NPPD() {
1191+
BEGIN_RCPP
1192+
Rcpp::RObject rcpp_result_gen;
1193+
Rcpp::RNGScope rcpp_rngScope_gen;
1194+
rcpp_result_gen = Rcpp::wrap(F_NPPD());
1195+
return rcpp_result_gen;
1196+
END_RCPP
1197+
}
1198+
// F_LITTERD
1199+
String F_LITTERD();
1200+
RcppExport SEXP _hector_F_LITTERD() {
1201+
BEGIN_RCPP
1202+
Rcpp::RObject rcpp_result_gen;
1203+
Rcpp::RNGScope rcpp_rngScope_gen;
1204+
rcpp_result_gen = Rcpp::wrap(F_LITTERD());
1205+
return rcpp_result_gen;
1206+
END_RCPP
1207+
}
1208+
// F_LUCV
1209+
String F_LUCV();
1210+
RcppExport SEXP _hector_F_LUCV() {
1211+
BEGIN_RCPP
1212+
Rcpp::RObject rcpp_result_gen;
1213+
Rcpp::RNGScope rcpp_rngScope_gen;
1214+
rcpp_result_gen = Rcpp::wrap(F_LUCV());
1215+
return rcpp_result_gen;
1216+
END_RCPP
1217+
}
1218+
// F_LUCD
1219+
String F_LUCD();
1220+
RcppExport SEXP _hector_F_LUCD() {
1221+
BEGIN_RCPP
1222+
Rcpp::RObject rcpp_result_gen;
1223+
Rcpp::RNGScope rcpp_rngScope_gen;
1224+
rcpp_result_gen = Rcpp::wrap(F_LUCD());
1225+
return rcpp_result_gen;
1226+
END_RCPP
1227+
}
11781228
// NATURAL_SO2
11791229
String NATURAL_SO2();
11801230
RcppExport SEXP _hector_NATURAL_SO2() {
@@ -1511,6 +1561,11 @@ static const R_CallMethodDef CallEntries[] = {
15111561
{"_hector_LUC_EMISSIONS", (DL_FUNC) &_hector_LUC_EMISSIONS, 0},
15121562
{"_hector_Q10_RH", (DL_FUNC) &_hector_Q10_RH, 0},
15131563
{"_hector_BETA", (DL_FUNC) &_hector_BETA, 0},
1564+
{"_hector_F_NPPV", (DL_FUNC) &_hector_F_NPPV, 0},
1565+
{"_hector_F_NPPD", (DL_FUNC) &_hector_F_NPPD, 0},
1566+
{"_hector_F_LITTERD", (DL_FUNC) &_hector_F_LITTERD, 0},
1567+
{"_hector_F_LUCV", (DL_FUNC) &_hector_F_LUCV, 0},
1568+
{"_hector_F_LUCD", (DL_FUNC) &_hector_F_LUCD, 0},
15141569
{"_hector_NATURAL_SO2", (DL_FUNC) &_hector_NATURAL_SO2, 0},
15151570
{"_hector_Y2000_SO2", (DL_FUNC) &_hector_Y2000_SO2, 0},
15161571
{"_hector_EMISSIONS_SO2", (DL_FUNC) &_hector_EMISSIONS_SO2, 0},

src/rcpp_constants.cpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,40 @@ String BETA() {
872872
return D_BETA;
873873
}
874874

875+
//' @describeIn parameters NPP fraction to vegetation (\code{"(unitless)"})
876+
//' @export
877+
// [[Rcpp::export]]
878+
String F_NPPV() {
879+
return D_F_NPPV;
880+
}
881+
882+
//' @describeIn parameters NPP fraction to detritus (\code{"(unitless)"})
883+
//' @export
884+
// [[Rcpp::export]]
885+
String F_NPPD() {
886+
return D_F_NPPD;
887+
}
888+
889+
//' @describeIn parameters Litter fraction to detritus (\code{"(unitless)"})
890+
//' @export
891+
// [[Rcpp::export]]
892+
String F_LITTERD() {
893+
return D_F_LITTERD;
894+
}
895+
896+
//' @describeIn parameters LUC fraction to vegetation (\code{"(unitless)"})
897+
//' @export
898+
// [[Rcpp::export]]
899+
String F_LUCV() {
900+
return D_F_LUCV;
901+
}
902+
903+
//' @describeIn parameters LUC fraction to detritus (\code{"(unitless)"})
904+
//' @export
905+
// [[Rcpp::export]]
906+
String F_LUCD() {
907+
return D_F_LUCD;
908+
}
875909

876910
/* SLR component */
877911
// // Apparently not yet implemented

src/simpleNbox.cpp

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ void SimpleNbox::init( Core* coreptr ) {
7070
core->registerInput(D_PREINDUSTRIAL_CO2, getComponentName());
7171
core->registerInput(D_BETA, getComponentName());
7272
core->registerInput(D_Q10_RH, getComponentName());
73+
core->registerInput(D_F_NPPV, getComponentName());
74+
core->registerInput(D_F_NPPD, getComponentName());
75+
core->registerInput(D_F_LITTERD, getComponentName());
76+
core->registerInput(D_F_LUCV, getComponentName());
77+
core->registerInput(D_F_LUCD, getComponentName());
7378
}
7479

7580
//------------------------------------------------------------------------------
@@ -159,23 +164,23 @@ void SimpleNbox::setData( const std::string &varName,
159164
// Partitioning
160165
else if( varNameParsed == D_F_NPPV ) {
161166
H_ASSERT( data.date == Core::undefinedIndex() , "date not allowed" );
162-
f_nppv = data.getUnitval(U_UNDEFINED);
167+
f_nppv = data.getUnitval(U_UNITLESS);
163168
}
164169
else if( varNameParsed == D_F_NPPD ) {
165170
H_ASSERT( data.date == Core::undefinedIndex() , "date not allowed" );
166-
f_nppd = data.getUnitval(U_UNDEFINED);
171+
f_nppd = data.getUnitval(U_UNITLESS);
167172
}
168173
else if( varNameParsed == D_F_LITTERD ) {
169174
H_ASSERT( data.date == Core::undefinedIndex() , "date not allowed" );
170-
f_litterd = data.getUnitval(U_UNDEFINED);
175+
f_litterd = data.getUnitval(U_UNITLESS);
171176
}
172177
else if( varNameParsed == D_F_LUCV ) {
173178
H_ASSERT( data.date == Core::undefinedIndex() , "date not allowed" );
174-
f_lucv = data.getUnitval(U_UNDEFINED);
179+
f_lucv = data.getUnitval(U_UNITLESS);
175180
}
176181
else if( varNameParsed == D_F_LUCD ) {
177182
H_ASSERT( data.date == Core::undefinedIndex() , "date not allowed" );
178-
f_lucd = data.getUnitval(U_UNDEFINED);
183+
f_lucd = data.getUnitval(U_UNITLESS);
179184
}
180185

181186
// Initial fluxes
@@ -436,6 +441,25 @@ unitval SimpleNbox::getData(const std::string& varName,
436441
} else if( varName == D_RF_T_ALBEDO ) {
437442
H_ASSERT( date != Core::undefinedIndex(), "Date required for albedo forcing" );
438443
returnval = Ftalbedo.get( date );
444+
445+
// Partitioning parameters.
446+
// For now, only global values are supported.
447+
// TODO Biome-specific versions of all of these
448+
} else if(varName == D_F_NPPV) {
449+
H_ASSERT(date == Core::undefinedIndex(), "Date not allowed for vegetation NPP fraction");
450+
returnval = unitval(f_nppv, U_UNITLESS);
451+
} else if(varName == D_F_NPPD) {
452+
H_ASSERT(date == Core::undefinedIndex(), "Date not allowed for detritus NPP fraction");
453+
returnval = unitval(f_nppd, U_UNITLESS);
454+
} else if(varName == D_F_LITTERD) {
455+
H_ASSERT(date == Core::undefinedIndex(), "Date not allowed for litter-detritus fraction");
456+
returnval = unitval(f_litterd, U_UNITLESS);
457+
} else if(varName == D_F_LUCV) {
458+
H_ASSERT(date == Core::undefinedIndex(), "Date not allowed for LUC vegetation fraction");
459+
returnval = unitval(f_lucv, U_UNITLESS);
460+
} else if(varName == D_F_LUCD) {
461+
H_ASSERT(date == Core::undefinedIndex(), "Date not allowed for LUC detritus fraction");
462+
returnval = unitval(f_lucd, U_UNITLESS);
439463

440464
} else if( varName == D_EARTHC ) {
441465
if(date == Core::undefinedIndex())

0 commit comments

Comments
 (0)