Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add equation of time correction to local time for sw radiation calculation #1172

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

weiwangncar
Copy link
Contributor

This PR adds equation of time correction to the local time for computing shortwave radiation. The EOT adds a max of 16 min in Nov, and a min of -14 min in Feb. This correction has been added to WRF since 2014.

The PR improves accuracy of shortwave radiation, but relatively small overall effects are expected.

@mgduda
Copy link
Contributor

mgduda commented May 29, 2024

@weiwangncar It seems like there are quite a few magic numbers in the new code:

       da=6.2831853071795862*(julian-1.)/365.
       eot=(0.000075+0.001868*cos(da)-0.032077*sin(da) &
            -0.014615*cos(2*da)-0.04089*sin(2*da))*(229.18)
       xt24 = mod(xtime+radt*0.5,1440.)+eot

Could some of these be defined as parameters with descriptive names? For example, it seems like 6.2831853071795862 could be twopi or 2.0 * pi. I have no idea what 0.032077, 0.001868, etc. represent.

@weiwangncar
Copy link
Contributor Author

@mgduda I will see if we can find the original contributor on the WRF side.

@dudhia
Copy link

dudhia commented May 29, 2024

Yes, that is 2*pi. The other numbers are a fit to an annual cycle. They describe the phase.

@mgduda
Copy link
Contributor

mgduda commented May 29, 2024

Yes, that is 2*pi. The other numbers are a fit to an annual cycle. They describe the phase.

If we can't create descriptively named parameters for the numbers, would it at least be possible to lay out the equation with an explanation of the parameters in a comment block?

@dudhia
Copy link

dudhia commented May 30, 2024

It's a simple harmonic function fit based on the day of the year. The numbers are empirical fit coefficients.

@weiwangncar
Copy link
Contributor Author

Will revisit at a later time.

@weiwangncar weiwangncar closed this Jun 4, 2024
@weiwangncar
Copy link
Contributor Author

Here is a reference for the equation used, the second equation on the first page. Would this help with this PR?

@weiwangncar weiwangncar reopened this Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants