pub fn cloud_fraction(
    surface_temp_kelvin: f64,
    smallest_mw_retained: f64,
    equatorial_radius: f64,
    hydrosphere_fraction: f64,
) -> f64 {
    if smallest_mw_retained > WATER_VAPOR {
        return 0.0;
    }

    let surface_area = 4.0 * PI * equatorial_radius.powf(2.0);
    let hydrosphere_mass = hydrosphere_fraction * surface_area * EARTH_WATER_MASS_PER_AREA;
    let water_vapor_in_kg =
        (0.00000001 * hydrosphere_mass) * (Q2_36 * (surface_temp_kelvin - 288.0)).exp();
    let mut fraction = CLOUD_COVERAGE_FACTOR * water_vapor_in_kg / surface_area;

    if fraction >= 1.0 {
        fraction = 1.0;
    }

    fraction
}
/// Given the surface temperature of a planet (in Kelvin), this function  returns the fraction of cloud cover available. This is Fogg's eq.23.
/// See Hart in "Icarus" (vol 33, pp23 - 39, 1978) for an explanation.
/// This equation is Hart's eq.3.
/// It was modified slightly by using constants and relationships from
/// Glass's book "Introduction to Planetary Geology", p.46.
/// The 'CLOUD_COVERAGE_FACTOR' is the amount of surface area on Earth covered by one Kg. of cloud.
Given the surface temperature of a planet (in Kelvin), this function  returns the fraction of cloud cover available.
Given the surface temperature of a planet ( in Kelvin ) this function returns the fraction of cloud cover available .
pub fn cloud_fraction(
    surface_temp_kelvin: f64,
    smallest_mw_retained: f64,
    equatorial_radius: f64,
    hydrosphere_fraction: f64,
) -> f64 {
    if smallest_mw_retained > WATER_VAPOR {
        return 0.0;
    }
    let surface_area = 4.0 * PI * equatorial_radius.powf(2.0);
    let hydrosphere_mass = hydrosphere_fraction * surface_area * EARTH_WATER_MASS_PER_AREA;
    let water_vapor_in_kg =
        (0.00000001 * hydrosphere_mass) * (Q2_36 * (surface_temp_kelvin - 288.0)).exp();
    let mut fraction = CLOUD_COVERAGE_FACTOR * water_vapor_in_kg / surface_area;
    if fraction >= 1.0 {
        fraction = 1.0;
    }
    fraction
}
pub fn cloud_fraction ( surface_temp_kelvin : f64 , smallest_mw_retained : f64 , equatorial_radius : f64 , hydrosphere_fraction : f64 , ) -> f64 { if smallest_mw_retained > WATER_VAPOR { return 0.0 ; } let surface_area = 4.0 * PI * equatorial_radius . powf ( 2.0 ) ; let hydrosphere_mass = hydrosphere_fraction * surface_area * EARTH_WATER_MASS_PER_AREA ; let water_vapor_in_kg = ( 0.00000001 * hydrosphere_mass ) * ( Q2_36 * ( surface_temp_kelvin - 288.0 ) ) . exp ( ) ; let mut fraction = CLOUD_COVERAGE_FACTOR * water_vapor_in_kg / surface_area ; if fraction >= 1.0 { fraction = 1.0 ; } fraction }
Given the surface temperature of a planet (in Kelvin), this function  returns the fraction of cloud cover available.
Given the surface temperature of a planet ( in Kelvin ) this function returns the fraction of cloud cover available .
surface_temp_kelvin
f64
smallest_mw_retained
f64
equatorial_radius
f64
hydrosphere_fraction
f64
surface_temp_kelvin
f64
smallest_mw_retained
f64
equatorial_radius
f64
hydrosphere_fraction
f64