-
Notifications
You must be signed in to change notification settings - Fork 22
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
SMOKE Array Out of Bound #85
Comments
Details on issue with src/emqa/bldrepidx.f (SMKREPORT module) Array out of bound issue is found for variable OUTDNAME which is first allocated with where the 1st dimension MXOUTDAT is the number of species of which names are to be write out in the smoke report table header, and value of MXOUTDAT depends on the report configuration REPCONFIG file. in the following code block, OUTDNAME is de-allocated and re-allocated when an condition is met: Taking this REPCONFIG with the following content as example: /CREATE REPORT/ /NEWFILE/ REPORT2 /CREATE REPORT/ /NEWFILE/ REPORT3 /CREATE REPORT/ For REPORT1 and REPORT2, SPECIATION MASS is requested and MXOUTDAT = 77 (77 chemical species). As SMKREPORT process to REPORT3, the In subsequence subroutine WRREPHDR (src/emqa/wrrephdr.f), array out-of-bound occurs causing segmentation fault when OUTDNAM is accessed beyond its 1st allocated dimension WRREPHDR does it own thing to figure out STIDX = 1 and EDIDX = 77 in this example, and as J increases above 19, array out-of-bound occurs. If SMOKE was compiled with gfortran or with ifort '-check bounds', segmentation fault occured and no smoke report file is created. The issue with OUTDNAM is found to be only affect the header of smoke report table; values of the table are handled by different subroutine and therefore is not affected by this issue. Mitigation approach: Fixed in commit 5bb27fd |
Details on issues with src/smkinven/wrpdemis.f
This issue seems only applicable to ptegu when processing the daily emission processing script (after the onetime processing script was executed). |
Details on issues with src/emqa/rdssup.f
Fixed in commit 5bb27fd |
Three issues were found in subroutine WRPDEMIS that caused array out of bound errors. Two issues were fixed by rearrange variable values when processing CEM data. The 3rd issue was related to treatment of special data variable when processing CEM data: variable CODEA record special data 9006 which represents FLOWPOS (position of flow rate in CEM data format). CODEA variable carries indexes to inventory pollutant names (EANAM), and when value 9006 was called as index of EANAM, out-of-bound error occurred. Code lines 271 - 316 are currently not well constructed with many value re-assignments of V and POLNAM variables when processing CEMS. |
Several subroutines in SMOKE are found to have array out of bound issue when SMOKE was compiled with gfortran compiler. The issue was also detected if SMOKE was compiled with intel compiler and with flag "-check bounds" activate in Makeinclude file (which is not enabled in the standard distributed package)
List of subroutines that having the issue (will be updated as more of them are found):
Details on the issue in each of the above subroutines are their mitigations are discussed in the below sections.
The text was updated successfully, but these errors were encountered: