You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A typo in calculating Julian date leads to an incorrect simulation length and raises an error for simulation that spans across 2 centuries, e.g. from 2099 to 2100. Fortunately, the case from 1999 to 2000 is unaffected.
I discovered the typo in julday_mod.F upon checking with the original algorithm in the literature.
Description
My colleague encounters this error when he runs a simulation from 01-Dec-2099 to 01-Jan-2100:
GEOS-Chem ERROR: No diagnostic output will be created for collection:
"Restart"! Make sure that the length of the simulation as specified in
"input.geos" (check the start and end times) is not shorter than the frequency
setting in HISTORY.rc! For example, if the frequency is 010000 (1 hour) but
the simulation is set up to run for only 20 minutes, then this error will occur.
-> at History_ReadCollectionData (in module History/history_mod.F90)
-> ERROR occurred at (or near) line 67 of the HISTORY.rc file
and, in our case, gives 2592000 seconds (=30 days) instead of 2678400 seconds (= 31 days). Meanwhile the FileWriteAlarm remains correct (31 days), so it gives the following error message:
IF ( SimLengthSec < Container%FileWriteAlarm ) THEN
! Construct error message
ErrMsg = &
'No diagnostic output will be created for collection: "'// &
TRIM( CollectionName(C) ) //'"! Make sure that the '// &
'length of the simulation as specified in "input.geos" '// &
'(check the start and end times) is not shorter than '// &
'the frequency setting in HISTORY.rc! For example, if '// &
'the frequency is 010000 (1 hour) but the simulation '// &
'is set up to run for only 20 minutes, then this error '// &
'will occur.'
When will this bug lead to simulation failure?
I think this bug only affects simulation that spans across different centuries, e.g. from 1899 to 1900, 2099 to 2100, 2199 to 2200. But fortunately, the case 1999 to 2000 is unaffected because of the calculation of "B" term: B = 2 - A + INT( A/4 ) is exactly the same as if the bug was not there. Therefore, most simulation would not encounter this issue.
GEOS-CHEM UNIT TEST SIMULATION: merra2_2x25_tropchem
------------------------+------------------------------------------------------
%%% SIMULATION MENU %%% :
Start YYYYMMDD, hhmmss : 20991201 000000
End YYYYMMDD, hhmmss : 21000101 000000
Run directory : ./
Root data directory : /project/TGABI/GEOS-Chem/ExtData
Global offsets I0, J0 : 0 0
------------------------+------------------------------------------------------
Best regards,
Joey
02 Sep 2019
The text was updated successfully, but these errors were encountered:
joeylamcy
changed the title
Typo in julday_mod.F which may lead to failure when year of simulation is 2100 or larger
Typo in julday_mod.F which may lead to failure when year of simulation crosses 2 centuries
Sep 2, 2019
joeylamcy
changed the title
Typo in julday_mod.F which may lead to failure when year of simulation crosses 2 centuries
Typo in julday_mod.F which may lead to failure when year of simulation spans across 2 centuries
Sep 2, 2019
This issue is described in the Github issue:
#48
The fix is to simply change this line of code:
X1 = DBLE( YYYY ) / 100.0d0
to:
X1 = DBLE( YEAR1 ) / 100.0d0
This commit passes a geosfp_4x5_benchmark difference test.
Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
msulprizio
changed the title
Typo in julday_mod.F which may lead to failure when year of simulation spans across 2 centuries
[BUG/ISSUE] Typo in julday_mod.F which may lead to failure when year of simulation spans across 2 centuries
Sep 4, 2019
Hi all,
TL;DR
A typo in calculating Julian date leads to an incorrect simulation length and raises an error for simulation that spans across 2 centuries, e.g. from 2099 to 2100. Fortunately, the case from 1999 to 2000 is unaffected.
I discovered the typo in julday_mod.F upon checking with the original algorithm in the literature.
Description
My colleague encounters this error when he runs a simulation from 01-Dec-2099 to 01-Jan-2100:
Julian date algorithm
Upon investigation, I checked the book "Practical Astronomy With Your Calculator", Third Edition, by Peter Duffett-Smith (1992). Here is the relevant algorithm used in calculating Julian date:
![Screenshot 2019-09-02 at 3 43 36 PM](https://user-images.githubusercontent.com/41887185/64105997-df3d1480-cda9-11e9-87a5-e6fd774a1987.png)
Typo in calculating Julian date
The bug is in line 110 of GeosUtil/julday_mod.F:
geos-chem/GeosUtil/julday_mod.F
Lines 100 to 111 in 075d55e
YYYY
(equivalent toy
in the book) in Line 110 should instead beYEAR1
(equivalent toy'
in the book), i.e.This affects the calculation of
SimLengthSec
in History/history_mod.F90:geos-chem/History/history_mod.F90
Lines 634 to 641 in 075d55e
and, in our case, gives 2592000 seconds (=30 days) instead of 2678400 seconds (= 31 days). Meanwhile the FileWriteAlarm remains correct (31 days), so it gives the following error message:
geos-chem/History/history_mod.F90
Lines 1241 to 1258 in 075d55e
When will this bug lead to simulation failure?
I think this bug only affects simulation that spans across different centuries, e.g. from 1899 to 1900, 2099 to 2100, 2199 to 2200. But fortunately, the case 1999 to 2000 is unaffected because of the calculation of "B" term:
B = 2 - A + INT( A/4 )
is exactly the same as if the bug was not there. Therefore, most simulation would not encounter this issue.Relevant configurations
GEOS-Chem version 12.2.0
Excerpt from HISTORY.rc:
Excerpt from input.geos:
Best regards,
Joey
02 Sep 2019
The text was updated successfully, but these errors were encountered: