/////////////////////////////////////////////////////////////////////////////////////// /// \file bvoc.cpp /// \brief The BVOC module /// /// Calculation of VOC production and emission by vegetation. /// /// \author Guy Schurgers (using Almut's previous attempts) /// $Date: 2013-04-30 11:05:01 +0200 (Tue, 30 Apr 2013) $ /// /////////////////////////////////////////////////////////////////////////////////////// // WHAT SHOULD THIS FILE CONTAIN? // Module source code files should contain, in this order: // (1) a "#include" directive naming the framework header file. The framework // header file should define all classes used as arguments to functions in // the present module. It may also include declarations of global functions, // constants and types, accessible throughout the model code; // (2) other #includes, including header files for other modules accessed by // the present one; // (3) type definitions, constants and file scope global variables for use // within the present module only; // (4) declarations of functions defined in this file, if needed; // (5) definitions of all functions. Functions that are to be accessible to // other modules or to the calling framework should be declared in the module // header file. // // PORTING MODULES BETWEEN FRAMEWORKS: // Modules should be structured so as to be fully portable between models // (frameworks). When porting between frameworks, the only change required // should normally be in the "#include" directive referring to the framework // header file. #include "config.h" #include "bvoc.h" #include "canexch.h" const double CO2 = 370; // standard CO2 concentration const double Tstand = 30; // standard temperature, oC void initbvoc(){ // initialising the VOC calculations: calculating the fraction of electrones // available for isoprene production from the isoprene and monoterpene // emission capacities (at T = 30oC and Q = 1000 umol m-2 s-1) as given by e.g. // Guenther et al. (1997) for all PFTs const double Qstand = 1e-3; // radiation, mol m-2 s-1 const double Cfrac = 0.5; // mass fraction of C in leaves const double frabs_Q = 0.35; // fraction of light absorbed in the first // canopy layer (for standard measurements), // 25% to 35% (Almut) const double daylength = 12; PhotosynthesisResult phot; pftlist.firstobj(); while (pftlist.isobj) { Pft& pft = pftlist.getobj(); double par = frabs_Q * Qstand * 3600 * daylength / alphaa(pft) / CQ; // par for the standard condition, J m-2 d-1 photosynthesis(CO2, Tstand, par, daylength, 1.0, pft.lambda_max, pft, 1.0, false, phot, -1); double coeff = 1e-3 / (phot.je + phot.rd_g/24) / pft.sla / Cfrac; // electron fraction assigned to isoprene and monoterpenes for the // standard case pft.eps_iso *= coeff; for(int im=0;im0){ double f_co2 = CO2/co2; // CO2 scaling factor double f_temp = min(f_tempmax, exp(epsT*(temp-Tstand))); // temp scaling factor double coeff = phot.je * daylength + phot.rd_g; // isoprene production, g C m-2 d-1 indiv.iso = pft.eps_iso * f_co2 * f_temp * indiv.fvocseas * coeff; // monoterpene production, g C m-2 d-1 // (only the production part is given here) for(im=0;im