Skip to content

Zenith angle treatment in the biog/hrbeis* #120

@cjcoats

Description

@cjcoats

The original (late-1980's) biogenics code had a computation of the form:

Compute COSZEN = cos( zenith angle ) in terms of latitude, longitude,
and time

Compute ZEN = arccos( COSZEN )

Compute vertical attenuation VATTEN in terms of ambient conditions

Attenuation ATTEN = VATTEN / COS( ZEN )

The PhD mathematician who wrote the original SMOKE noticed this,
together with the fact that unneccessary cos( arccos ( COSZEN ) )
adds only extra round-off error, extra computational cost, and some
degree of obscurity. He simplified this code to:

Compute COSZEN = cos( zenith angle ) in terms of latitude, longitude,
and time

Compute vertical attenuation VATTEN in terms of ambient conditions

Attenuation ATTEN = VATTEN / COSZEN

In all of the current biog/hrbeis routines, someone has replaced this formulation by the following:

Compute COSZEN = cos( zenith angle ) in terms of latitude, longitude,
and time

Compute ZEN = arccos( COSZEN )

Compute vertical attenuation VATTEN in terms of ambient conditions

Attenuation ATTEN = VATTEN * SQRT( 1.0 + TAN( ZEN ) )

Note for this last, that one of the most obscure Pythagorean identities from
trigonometry is

1/cos(A)^2 = 1 + tan(A)^2

so that this last step is mathematically equivalent to ATTEN = VATTEN / COSZEN.
Not only is this new form much worse for round-off error and computational cost,
it is also much more obscure. It needs to be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions