Closed cseppan closed 2 years ago
Coded with alternative options found here but results remain the same:
https://www.cmascenter.org/ioapi/documentation/all_versions/html/SETSPHERE.html
It looks like you need to explicitly call the function INITSPHERES() before using XY2XY(). This should read the environment variable and then XY2XY will automatically use the value. I'd suggest adding the call to smkreport.f, right after the existing initialization functions:
I added an IF THEN statement from /src/emmod/modgrdlib.f that seems to be doing that in wrrepout.f and fixes the issue.
When running Smkreport with the AERMOD NONPOINT instruction, Smkreport will output the grid cell coordinates in lat-lon. These coordinates aren't matching what would be expected based on the Lambert coordinates and spheroid.
James Beidler will provide examples of correct inputs and outputs.
Here's the section of code that does the coordinate conversions:
https://github.com/CEMPD/SMOKE/blob/ffa9e3cb0356f2294845a903384fe5fca4c8973f/src/emqa/wrrepout.f#L815-L849
According to the IOAPI documentation, the XY2XY method should take the environment variable IOAPI_ISPH into account: https://www.cmascenter.org/ioapi/documentation/all_versions/html/XY2XY.html
I suggest creating a simple Fortran program that calls XY2XY to see what the output values are, using James' example data.