pub fn opacity(molecular_weight: f64, surface_pressure_bar: f64) -> f64 {
    let mut optical_depth = 0.0;

    if (0.0..10.0).contains(&molecular_weight) {
        optical_depth += 3.0;
    }
    if (10.0..20.0).contains(&molecular_weight) {
        optical_depth += 2.34;
    }
    if (20.0..30.0).contains(&molecular_weight) {
        optical_depth += 1.0;
    }
    if (30.0..45.0).contains(&molecular_weight) {
        optical_depth += 0.15;
    }
    if (45.0..100.0).contains(&molecular_weight) {
        optical_depth += 0.05;
    }

    if surface_pressure_bar >= 0.07 {
        optical_depth *= 8.333;
    } else if surface_pressure_bar >= 0.05 {
        optical_depth *= 6.666;
    } else if surface_pressure_bar >= 0.03 {
        optical_depth *= 3.333;
    } else if surface_pressure_bar >= 0.01 {
        optical_depth *= 2.0;
    } else if surface_pressure_bar >= 0.005 {
        optical_depth *= 1.5;
    }

    optical_depth
}
/// This function returns the dimensionless quantity of optical depth, which is useful in determining the amount of greenhouse effect on a planet.
This function returns the dimensionless quantity of optical depth, which is useful in determining the amount of greenhouse effect on a planet.
This function returns the dimensionless quantity of optical depth which is useful in determining the amount of greenhouse effect on a planet .
pub fn opacity(molecular_weight: f64, surface_pressure_bar: f64) -> f64 {
    let mut optical_depth = 0.0;
    if (0.0..10.0).contains(&molecular_weight) {
        optical_depth += 3.0;
    }
    if (10.0..20.0).contains(&molecular_weight) {
        optical_depth += 2.34;
    }
    if (20.0..30.0).contains(&molecular_weight) {
        optical_depth += 1.0;
    }
    if (30.0..45.0).contains(&molecular_weight) {
        optical_depth += 0.15;
    }
    if (45.0..100.0).contains(&molecular_weight) {
        optical_depth += 0.05;
    }
    if surface_pressure_bar >= 0.07 {
        optical_depth *= 8.333;
    } else if surface_pressure_bar >= 0.05 {
        optical_depth *= 6.666;
    } else if surface_pressure_bar >= 0.03 {
        optical_depth *= 3.333;
    } else if surface_pressure_bar >= 0.01 {
        optical_depth *= 2.0;
    } else if surface_pressure_bar >= 0.005 {
        optical_depth *= 1.5;
    }
    optical_depth
}
pub fn opacity ( molecular_weight : f64 , surface_pressure_bar : f64 ) -> f64 { let mut optical_depth = 0.0 ; if ( 0.0 .. 10.0 ) . contains ( & molecular_weight ) { optical_depth += 3.0 ; } if ( 10.0 .. 20.0 ) . contains ( & molecular_weight ) { optical_depth += 2.34 ; } if ( 20.0 .. 30.0 ) . contains ( & molecular_weight ) { optical_depth += 1.0 ; } if ( 30.0 .. 45.0 ) . contains ( & molecular_weight ) { optical_depth += 0.15 ; } if ( 45.0 .. 100.0 ) . contains ( & molecular_weight ) { optical_depth += 0.05 ; } if surface_pressure_bar >= 0.07 { optical_depth *= 8.333 ; } else if surface_pressure_bar >= 0.05 { optical_depth *= 6.666 ; } else if surface_pressure_bar >= 0.03 { optical_depth *= 3.333 ; } else if surface_pressure_bar >= 0.01 { optical_depth *= 2.0 ; } else if surface_pressure_bar >= 0.005 { optical_depth *= 1.5 ; } optical_depth }
This function returns the dimensionless quantity of optical depth, which is useful in determining the amount of greenhouse effect on a planet.
This function returns the dimensionless quantity of optical depth which is useful in determining the amount of greenhouse effect on a planet .
molecular_weight
f64
surface_pressure_bar
f64
molecular_weight
f64
surface_pressure_bar
f64