CEMPD / SMOKE

Create emissions inputs for multiple air quality modeling systems with unmatched speed and flexibility
https://www.cmascenter.org/smoke/
45 stars 21 forks source link

STKFLW Error #49

Closed barronh closed 2 years ago

barronh commented 2 years ago

Currently, the STKFLW property of any "stack groups" file is incorrect. The value in STKFLW is consistently the stack flow as if stack diameter and velocity were equal to those of the last stack in the file.

The error can be seen on line 1039 of elevpoint.f.[1] On that line, GRPFL is being set using DMVAL and VEVAL. Note that GRPDM and GRPVE do not use DMVAL or VEVAL, which is why they are unaffected. DMVAL was last set on line 705[2] within another loop over sources. As a result, DMVAL is the last diameter of any give set of sources. The same is true for VEVAL[3], which is set one line later than DMVAL.

The fix is to either reset DMVAL and VEVAL before use on line 1039. I have not tested this fix, so this is just my hypothesis.

[1] https://github.com/CEMPD/SMOKE/blob/84eaa07256f363118577a15b31166399c4c4a275/src/point/elevpoint.f#L1039 [2] https://github.com/CEMPD/SMOKE/blob/84eaa07256f363118577a15b31166399c4c4a275/src/point/elevpoint.f#L705 [3] https://github.com/CEMPD/SMOKE/blob/84eaa07256f363118577a15b31166399c4c4a275/src/point/elevpoint.f#L706

christos-e commented 2 years ago

I have added the reset for DMVAL and VEVAL and the code is working in my test runs. Thanks for providing clear documentation!