vic/vic_run/src/penman.c
void
calc_rc_ps(char    Ctype,
           double  MaxCarboxRate,
           double  MaxETransport,
           double  CO2Specificity,
           double *NscaleFactor,
           double  tair,
           double  shortwave,
           double *aPAR,
           double  elevation,
           double  Catm,
           double *CanopLayerBnd,
           double  lai,
           double  gsm_inv,
           double  vpd,
           double *rsLayer,
           double *rc)
{
    extern option_struct     options;
    extern parameters_struct param;

    double                   GPP0; /* aggregate canopy assimilation (photosynthesis)
                                      in absence of soil moisture stress */
    double                   Rdark0; /* aggregate canopy dark respiration in absence of
                                        soil moisture stress */
    double                   Rphoto0; /* aggregate canopy photorespiration in absence of
                                         soil moisture stress */
    double                   Rmaint0; /* aggregate plant maintenance respiration in absence of
                                         soil moisture stress */
    double                   Rgrowth0; /* aggregate plant growth respiration in absence of
                                          soil moisture stress */
    double                   Raut0; /* aggregate plant respiration in absence of
                                       soil moisture stress */
    double                   NPP0; /* aggregate net primary productivity in absence of
                                      soil moisture stress */
    double                   Ci0; /* aggregate canopy leaf-internal CO2 mixing ratio
                                     in absence of soil moisture stress */
    double                   rc0; /* aggregate canopy resistance in absence of
                                     soil moisture stress */
    double                   rcRatio;
    double                   vpdfactor; /* factor for canopy resistance based on vpd */
    size_t                   cidx;

    /* Compute canopy resistance and photosynthetic demand in absence of soil moisture stress */
    canopy_assimilation(Ctype,
                        MaxCarboxRate,
                        MaxETransport,
                        CO2Specificity,
                        NscaleFactor,
                        tair,
                        shortwave,
                        aPAR,
                        elevation,
                        Catm,
                        CanopLayerBnd,
                        lai,
                        "ci",
                        rsLayer,
                        &rc0,
                        &Ci0,
                        &GPP0,
                        &Rdark0,
                        &Rphoto0,
                        &Rmaint0,
                        &Rgrowth0,
                        &Raut0,
                        &NPP0);

    /* calculate vapor pressure deficit factor */
    vpdfactor = 1 - vpd / param.CANOPY_CLOSURE;
    vpdfactor =
        (vpdfactor <
         param.CANOPY_VPDMINFACTOR) ? param.CANOPY_VPDMINFACTOR : vpdfactor;

    /* calculate canopy resistance in presence of soil moisture stress */
    *rc = rc0 / (gsm_inv * vpdfactor);
    *rc = (*rc > param.CANOPY_RSMAX) ? param.CANOPY_RSMAX : *rc;
    rcRatio = *rc / rc0;
    /* this next calculation assumes canopy layers are of equal size */
    for (cidx = 0; cidx < options.Ncanopy; cidx++) {
        rsLayer[cidx] *= rcRatio;
        rsLayer[cidx] =
            (rsLayer[cidx] >
             param.CANOPY_RSMAX) ? param.CANOPY_RSMAX : rsLayer[cidx];
    }
}
/******************************************************************************
 * @brief    Calculate canopy resistance rc as a function of photosynthetic.
 *****************************************************************************/
@brief    Calculate canopy resistance rc as a function of photosynthetic.
@brief Calculate canopy resistance rc as a function of photosynthetic .
void
calc_rc_ps(char    Ctype,
           double  MaxCarboxRate,
           double  MaxETransport,
           double  CO2Specificity,
           double *NscaleFactor,
           double  tair,
           double  shortwave,
           double *aPAR,
           double  elevation,
           double  Catm,
           double *CanopLayerBnd,
           double  lai,
           double  gsm_inv,
           double  vpd,
           double *rsLayer,
           double *rc)
{
    extern option_struct     options;
    extern parameters_struct param;
    double                   GPP0; 
    double                   Rdark0; 
    double                   Rphoto0; 
    double                   Rmaint0; 
    double                   Rgrowth0; 
    double                   Raut0; 
    double                   NPP0; 
    double                   Ci0; 
    double                   rc0; 
    double                   rcRatio;
    double                   vpdfactor; 
    size_t                   cidx;
    canopy_assimilation(Ctype,
                        MaxCarboxRate,
                        MaxETransport,
                        CO2Specificity,
                        NscaleFactor,
                        tair,
                        shortwave,
                        aPAR,
                        elevation,
                        Catm,
                        CanopLayerBnd,
                        lai,
                        "ci",
                        rsLayer,
                        &rc0,
                        &Ci0,
                        &GPP0,
                        &Rdark0,
                        &Rphoto0,
                        &Rmaint0,
                        &Rgrowth0,
                        &Raut0,
                        &NPP0);
    vpdfactor = 1 - vpd / param.CANOPY_CLOSURE;
    vpdfactor =
        (vpdfactor <
         param.CANOPY_VPDMINFACTOR) ? param.CANOPY_VPDMINFACTOR : vpdfactor;
    *rc = rc0 / (gsm_inv * vpdfactor);
    *rc = (*rc > param.CANOPY_RSMAX) ? param.CANOPY_RSMAX : *rc;
    rcRatio = *rc / rc0;
    for (cidx = 0; cidx < options.Ncanopy; cidx++) {
        rsLayer[cidx] *= rcRatio;
        rsLayer[cidx] =
            (rsLayer[cidx] >
             param.CANOPY_RSMAX) ? param.CANOPY_RSMAX : rsLayer[cidx];
    }
}
void calc_rc_ps ( char Ctype , double MaxCarboxRate , double MaxETransport , double CO2Specificity , double * NscaleFactor , double tair , double shortwave , double * aPAR , double elevation , double Catm , double * CanopLayerBnd , double lai , double gsm_inv , double vpd , double * rsLayer , double * rc ) { extern option_struct options ; extern parameters_struct param ; double GPP0 ; double Rdark0 ; double Rphoto0 ; double Rmaint0 ; double Rgrowth0 ; double Raut0 ; double NPP0 ; double Ci0 ; double rc0 ; double rcRatio ; double vpdfactor ; size_t cidx ; canopy_assimilation ( Ctype , MaxCarboxRate , MaxETransport , CO2Specificity , NscaleFactor , tair , shortwave , aPAR , elevation , Catm , CanopLayerBnd , lai , " " , rsLayer , & rc0 , & Ci0 , & GPP0 , & Rdark0 , & Rphoto0 , & Rmaint0 , & Rgrowth0 , & Raut0 , & NPP0 ) ; vpdfactor = 1 - vpd / param . CANOPY_CLOSURE ; vpdfactor = ( vpdfactor < param . CANOPY_VPDMINFACTOR ) ? param . CANOPY_VPDMINFACTOR : vpdfactor ; * rc = rc0 / ( gsm_inv * vpdfactor ) ; * rc = ( * rc > param . CANOPY_RSMAX ) ? param . CANOPY_RSMAX : * rc ; rcRatio = * rc / rc0 ; for ( cidx = 0 ; cidx < options . Ncanopy ; cidx ++ ) { rsLayer [ cidx ] *= rcRatio ; rsLayer [ cidx ] = ( rsLayer [ cidx ] > param . CANOPY_RSMAX ) ? param . CANOPY_RSMAX : rsLayer [ cidx ] ; } }
@brief    Calculate canopy resistance rc as a function of photosynthetic.
@brief Calculate canopy resistance rc as a function of photosynthetic .
/* aggregate canopy assimilation (photosynthesis)
                                      in absence of soil moisture stress */ /* aggregate canopy dark respiration in absence of
                                        soil moisture stress */ /* aggregate canopy photorespiration in absence of
                                         soil moisture stress */ /* aggregate plant maintenance respiration in absence of
                                         soil moisture stress */ /* aggregate plant growth respiration in absence of
                                          soil moisture stress */ /* aggregate plant respiration in absence of
                                       soil moisture stress */ /* aggregate net primary productivity in absence of
                                      soil moisture stress */ /* aggregate canopy leaf-internal CO2 mixing ratio
                                     in absence of soil moisture stress */ /* aggregate canopy resistance in absence of
                                     soil moisture stress */ /* factor for canopy resistance based on vpd */ /* Compute canopy resistance and photosynthetic demand in absence of soil moisture stress */ /* calculate vapor pressure deficit factor */ /* calculate canopy resistance in presence of soil moisture stress */ /* this next calculation assumes canopy layers are of equal size */