-
Notifications
You must be signed in to change notification settings - Fork 731
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
Fix the bug: TUV photolysis is inactive if simulation starts on 1st Jan #2171
base: release-v4.7.0
Are you sure you want to change the base?
Conversation
TYPE: bug fix KEYWORDS: TUV, distance to sun, 1 January, julian day SOURCE: Sergey Osipov (KAUST) DESCRIPTION OF CHANGES: Problem: TUV and FTUV fail to initialize the distance to Sun properly if the simulation starts on 1 Jan. The multiplication factor remains uninitialized at 0, which zeros out photolysis rate calculations (see line 745 @ module_phot_tuv.F. On a next day the distance is recalculated normally. Solution: Given that calculation of sun distance is trivial, if check was disabled ISSUE: LIST OF MODIFIED FILES: chem/module_phot_tuv.F chem/module_ftuv_driver.F TESTS CONDUCTED: 1. Do mods fix problem? How can that be demonstrated, and was that test conducted? 2. Are the Jenkins tests all passing? RELEASE NOTE: Include a stand-alone message suitable for the inclusion in the minor and annual releases. A publication citation is appropriate.
TYPE: bug fix KEYWORDS: TUV, distance to sun, 1 January, julian day SOURCE: Sergey Osipov (KAUST) DESCRIPTION OF CHANGES: Problem: TUV and FTUV fail to initialize the distance to Sun properly if the simulation starts on 1 Jan. The multiplication factor remains uninitialized at 0, which zeros out photolysis rate calculations (see line 745 @ module_phot_tuv.F. On a next day the distance is recalculated normally. Solution: Given that calculation of sun distance is trivial, if check was disabled ISSUE: LIST OF MODIFIED FILES: chem/module_phot_tuv.F chem/module_ftuv_driver.F TESTS CONDUCTED: 1. Do mods fix problem? How can that be demonstrated, and was that test conducted? 2. Are the Jenkins tests all passing? RELEASE NOTE: Include a stand-alone message suitable for the inclusion in the minor and annual releases. A publication citation is appropriate.
The regression test results:
|
@jordanschnell Just wondering if you could help review this PR? Thanks! |
Hi Sergey, thanks for this fix. Instead of commenting out the check such that it is called each time, what about including a check for julday = 0? |
Hi Jordan, good to hear from you. Julday is zero if the simulation start date is 1st Jan. At least, this is what I saw in the DDT debugger on our supercomputer. An alternative is to initialize the curjulday with -1 (or -999) instead of 0, which is used as a cache for the last calculation. Overall, the sundist calculation is very trivial and only involves trigonometric functions, meaning that the computatinal overhead is negligeble. IMHO, this is a good trade-off to avoid the hard-to-predict bugs like the 1st January case. Best, Sergey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK with me. Approved.
The base branch was changed.
Fix the bug: photolysis is inactive if simulation starts on 1st Jan
TYPE: bug fix
KEYWORDS: TUV, distance to the sun, 1 January, Julian day
SOURCE: Sergey Osipov (KAUST)
DESCRIPTION OF CHANGES:
Problem:
TUV and FTUV fail to initialize the distance to the Sun properly if the simulation starts on 1 Jan. The multiplication factor remains uninitialized at 0, which zeros out photolysis rate calculations (see line 745 @ module_phot_tuv.F. On the next day, the distance is recalculated normally and photolysis rates are calculated properly.
Solution:
Given that the calculation of sun distance is trivial, the if check was disabled
ISSUE:
LIST OF MODIFIED FILES:
chem/module_phot_tuv.F
chem/module_ftuv_driver.F
TESTS CONDUCTED:
RELEASE NOTE: Include a stand-alone message suitable for the inclusion in the minor and annual releases. A publication citation is appropriate.