sw4 icon indicating copy to clipboard operation
sw4 copied to clipboard

Issue with SW4-3.0 and Proj9.3

Open erinwirth opened this issue 1 year ago • 1 comments

We just installed SW4-3.0 (using Proj 9.3) on a new computer system, and I'm running into a problem using my old SW4 input files. The problem seems to be related to Proj.

My input file (I use an rfile) contains:

grid x=154e3 y=164e3 z=70e3 h=2400 lat=46.909 lon=-123.286 proj=utm ellps=WGS84 refinement zmax=30000 refinement zmax=14000 refinement zmax=6000 refinement zmax=2000

and the error I receive is:

  • Processing the grid command...
  • Setting nx to 66 to be consistent with h=2.40000000e+03
  • Setting ny to 70 to be consistent with h=2.40000000e+03
  • Setting nz to 31 to be consistent with h=2.40000000e+03
  • Changing x from 1.54000000e+05 to 1.56000000e+05 to be consistent with h=2.40000000e+03
  • Changing z from 7.00000000e+04 to 7.20000000e+04 to be consistent with h=2.40000000e+03
  • Changing y from 1.64000000e+05 to 1.65600000e+05 to be consistent with h=2.40000000e+03

Assertion violated: m_P

...at line 72 of file /home/software/hovenweep/arc/source/sw4/sw4-3.0/src/GeographicProjection.C.

proj_create: Invalid zone number

Should I be using a different version of Proj for compatibility?

erinwirth avatar Jan 03 '24 18:01 erinwirth

Hi @erinwirth, yes, this is an error from proj. A few things to check: does your installed proj library pass all its tests (ctest)? Are you able to run any other problems with SW4? Can you try removing "proj=utm ellps=WGS84" and run it (they are the same as the SW4 default value)? I have been using proj-9.2.0 since its release last year, I don't know if there is a significant change with the latest proj-9.3.1 version, but it might worth a try.

houjun avatar Jan 03 '24 23:01 houjun