From 0fe10c92c4d18b604163996a8032058fe7c13212 Mon Sep 17 00:00:00 2001 From: Sergey Osipov Date: Wed, 26 Feb 2025 09:25:27 +0300 Subject: [PATCH 1/2] Fix the bug: photolysis is inactive if simulation starts on 1st Jan 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. --- chem/module_phot_tuv.F | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/chem/module_phot_tuv.F b/chem/module_phot_tuv.F index 0a32c08c00..68eadbe7f3 100644 --- a/chem/module_phot_tuv.F +++ b/chem/module_phot_tuv.F @@ -341,10 +341,11 @@ subroutine tuv_driver( & !----------------------------------------------------------------------------- ! set solar distance factor !----------------------------------------------------------------------------- - if( curjulday /= julday ) then - curjulday = julday - esfact = sundis( julday ) - endif + ! osipov fix the bug. Always calc the distance. Testing for 0 results in True on 1 Jan, keeps the sfact=0 and shutsdown the photolysis for entire day + !if( curjulday /= julday ) then + curjulday = julday + esfact = sundis( julday ) + !endif if( .not. config_flags%scale_o3_to_grnd_exo_coldens ) then if( config_flags%scale_o3_to_du_at_grnd ) then dobsi = max( 0.,config_flags%du_at_grnd ) From cbdb8311f2bbf295cd32ea923a2d1c2e3bdfb16b Mon Sep 17 00:00:00 2001 From: Sergey Osipov Date: Wed, 26 Feb 2025 09:27:04 +0300 Subject: [PATCH 2/2] Fix the bug: photolysis is inactive if simulation starts on 1st Jan 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. --- chem/module_ftuv_driver.F | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/chem/module_ftuv_driver.F b/chem/module_ftuv_driver.F index 0a3c1f6982..69fa086584 100644 --- a/chem/module_ftuv_driver.F +++ b/chem/module_ftuv_driver.F @@ -1308,10 +1308,11 @@ subroutine ftuv_timestep_init( id, julday ) !----------------------------------------------------------------------------- ! set solar distance factor !----------------------------------------------------------------------------- - if( curjulday /= julday ) then - curjulday = julday - call sundis( curjulday, esfact ) - endif + ! osipov fix the bug. Always calc the distance. Testing for 0 results in True on 1 Jan, keeps the sfact=0 and shutsdown the photolysis for entire day + !if( curjulday /= julday ) then + curjulday = julday + call sundis( curjulday, esfact ) + !endif end subroutine ftuv_timestep_init