vic/vic_run/src/massrelease.c
void
MassRelease(double *InterceptedSnow,
            double *TempInterceptionStorage,
            double *ReleasedMass,
            double *Drip)
{
    extern parameters_struct param;

    double                   TempDrip;
    double                   TempReleasedMass;
    double                   Threshold;
    double                   MaxRelease;

    /* If the amount of snow in the canopy is greater than some minimum
       value, MIN_INTERCEPTION_STORAGE, then calculte mass release and Drip */

    if (*InterceptedSnow > param.VEG_MIN_INTERCEPTION_STORAGE) {
        Threshold = 0.10 * *InterceptedSnow;
        MaxRelease = 0.17 * *InterceptedSnow;

        /* If the amount of snow_melt after interception, snow_melt, is >= the
           theshhold then there is mass release.  If snow_melt is < the treshhold
           then there is no mass release but that water remains in
         * TempInterceptionStorage which will be augmented during the next
           compute period */

        if ((*TempInterceptionStorage) >= Threshold) {
            *Drip += Threshold;
            *InterceptedSnow -= Threshold;
            *TempInterceptionStorage -= Threshold;
            if (*InterceptedSnow < param.VEG_MIN_INTERCEPTION_STORAGE) {
                TempReleasedMass = 0.0;
            }
            else {
                TempReleasedMass =
                    min((*InterceptedSnow - param.VEG_MIN_INTERCEPTION_STORAGE),
                        MaxRelease);
            }
            *ReleasedMass += TempReleasedMass;
            *InterceptedSnow -= TempReleasedMass;
            MassRelease(InterceptedSnow, TempInterceptionStorage, ReleasedMass,
                        Drip);
        }
        else {
            TempDrip = min(*TempInterceptionStorage, *InterceptedSnow);
            *Drip += TempDrip;
            *InterceptedSnow -= TempDrip;
        }
    }

    /* (*InterceptedSnow < MIN_INTERCEPTION_STORAGE) If the amount of snow in
       the canopy is less than some minimum value, MIN_INTERCEPTION_STORAGE,
       then only melt can occur and there is no mass release. */

    else {
        TempDrip = min(*TempInterceptionStorage, *InterceptedSnow);
        *Drip += TempDrip;
        *InterceptedSnow -= TempDrip;
        *TempInterceptionStorage = 0.0;
    }
}
/******************************************************************************
 * @brief    Calculates mass release of snow from canopy.
 *****************************************************************************/
@brief    Calculates mass release of snow from canopy.
@brief Calculates mass release of snow from canopy .
void
MassRelease(double *InterceptedSnow,
            double *TempInterceptionStorage,
            double *ReleasedMass,
            double *Drip)
{
    extern parameters_struct param;
    double                   TempDrip;
    double                   TempReleasedMass;
    double                   Threshold;
    double                   MaxRelease;
    if (*InterceptedSnow > param.VEG_MIN_INTERCEPTION_STORAGE) {
        Threshold = 0.10 * *InterceptedSnow;
        MaxRelease = 0.17 * *InterceptedSnow;
        if ((*TempInterceptionStorage) >= Threshold) {
            *Drip += Threshold;
            *InterceptedSnow -= Threshold;
            *TempInterceptionStorage -= Threshold;
            if (*InterceptedSnow < param.VEG_MIN_INTERCEPTION_STORAGE) {
                TempReleasedMass = 0.0;
            }
            else {
                TempReleasedMass =
                    min((*InterceptedSnow - param.VEG_MIN_INTERCEPTION_STORAGE),
                        MaxRelease);
            }
            *ReleasedMass += TempReleasedMass;
            *InterceptedSnow -= TempReleasedMass;
            MassRelease(InterceptedSnow, TempInterceptionStorage, ReleasedMass,
                        Drip);
        }
        else {
            TempDrip = min(*TempInterceptionStorage, *InterceptedSnow);
            *Drip += TempDrip;
            *InterceptedSnow -= TempDrip;
        }
    }
    else {
        TempDrip = min(*TempInterceptionStorage, *InterceptedSnow);
        *Drip += TempDrip;
        *InterceptedSnow -= TempDrip;
        *TempInterceptionStorage = 0.0;
    }
}
void MassRelease ( double * InterceptedSnow , double * TempInterceptionStorage , double * ReleasedMass , double * Drip ) { extern parameters_struct param ; double TempDrip ; double TempReleasedMass ; double Threshold ; double MaxRelease ; if ( * InterceptedSnow > param . VEG_MIN_INTERCEPTION_STORAGE ) { Threshold = 0.10 * * InterceptedSnow ; MaxRelease = 0.17 * * InterceptedSnow ; if ( ( * TempInterceptionStorage ) >= Threshold ) { * Drip += Threshold ; * InterceptedSnow -= Threshold ; * TempInterceptionStorage -= Threshold ; if ( * InterceptedSnow < param . VEG_MIN_INTERCEPTION_STORAGE ) { TempReleasedMass = 0.0 ; } else { TempReleasedMass = min ( ( * InterceptedSnow - param . VEG_MIN_INTERCEPTION_STORAGE ) , MaxRelease ) ; } * ReleasedMass += TempReleasedMass ; * InterceptedSnow -= TempReleasedMass ; MassRelease ( InterceptedSnow , TempInterceptionStorage , ReleasedMass , Drip ) ; } else { TempDrip = min ( * TempInterceptionStorage , * InterceptedSnow ) ; * Drip += TempDrip ; * InterceptedSnow -= TempDrip ; } } else { TempDrip = min ( * TempInterceptionStorage , * InterceptedSnow ) ; * Drip += TempDrip ; * InterceptedSnow -= TempDrip ; * TempInterceptionStorage = 0.0 ; } }
@brief    Calculates mass release of snow from canopy.
@brief Calculates mass release of snow from canopy .
/* If the amount of snow in the canopy is greater than some minimum
       value, MIN_INTERCEPTION_STORAGE, then calculte mass release and Drip */ /* If the amount of snow_melt after interception, snow_melt, is >= the
           theshhold then there is mass release.  If snow_melt is < the treshhold
           then there is no mass release but that water remains in
         * TempInterceptionStorage which will be augmented during the next
           compute period */ /* (*InterceptedSnow < MIN_INTERCEPTION_STORAGE) If the amount of snow in
       the canopy is less than some minimum value, MIN_INTERCEPTION_STORAGE,
       then only melt can occur and there is no mass release. */