lanl / FEHM

Finite Element Heat and Mass Transfer Code
https://fehm.lanl.gov
Other
52 stars 18 forks source link

fehmpytests fails for transport3D #69

Open millerta opened 2 weeks ago

millerta commented 2 weeks ago

fehmpytests fails for transport3D (under construction).

3d_trac_rlp.trc 6 columns of data, the file in compare has 3. The version in VV has a complicated set of perl drivers, so I suspect the input files need to be adjusted for this test.

Also, the python scripts do not fail gracefully:

es19:% python fehmpytests.py /project/eesdev/FEHM/FEHM_FORK/FEHM_gaz-linux/src_release/xfehm transport3d
transport3d (__main__.fehmTest.transport3d)
**Test transport3d** ... Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG
ERROR

======================================================================
ERROR: transport3d (__main__.fehmTest.transport3d)
**Test transport3d**
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/project/eesdev/FEHM/FEHM-fehmpy/fehmpytests/fpost.py", line 1634, in fdiff
    if np.allclose(data1_flat, data2_flat, rtol=rtol, atol=atol, equal_nan=True):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<__array_function__ internals>", line 200, in allclose
  File "/n/modules/Ubuntu-20.04-x86_64/anaconda-python/2023.09-0/lib/python3.11/site-packages/numpy/core/numeric.py", line 2270, in allclose
    res = all(isclose(a, b, rtol=rtol, atol=atol, equal_nan=equal_nan))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<__array_function__ internals>", line 200, in isclose
  File "/n/modules/Ubuntu-20.04-x86_64/anaconda-python/2023.09-0/lib/python3.11/site-packages/numpy/core/numeric.py", line 2380, in isclose
    return within_tol(x, y, atol, rtol)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/n/modules/Ubuntu-20.04-x86_64/anaconda-python/2023.09-0/lib/python3.11/site-packages/numpy/core/numeric.py", line 2361, in within_tol
    return less_equal(abs(x-y), atol + rtol * abs(y))
                          ~^~
ValueError: operands could not be broadcast together with shapes (18120,) (22630,)

----------------------------------------------------------------------
Ran 1 test in 95.106s

FAILED (errors=1)
millerta commented 2 weeks ago

/project/eesdev/FEHM/VV_TESTS/VERIFICATION_V3.3.0lnx/transport3D very different from VERIFICATION_V3.4win_64bit_runs_050724/transport3d

Copying the directory to lnx VV does not work, perl scripts fail. Will need to construct fehmpytests using gaz windows that can run either win or linux

millerta commented 2 weeks ago

This test fails because linux and windows write different formats for the *.trc files. Linux v3.6 and old fehm v3.4 write 6 values in a single line. Windows v3.6 writes 6 values in double lines.

For instance comparing the last values written by xfehm v3.6 linux and windows:

==> out_v3.6_linux/3d_trac_rlp.trc <==
2826250.0000000000                3   Np-237
   1.2007296726736700E-003   8.0606903746677176E-003  0.11818645654013919        8.6120469867951230E-002   7.9579742263118335E-003   8.2279789534130988E-004

==> out_v3.6_win/3d_trac_rlp.trc <==
      2826250.00000000                3   Np-237
  1.200729672673670E-003  8.060690374667718E-003  0.118186456540139
  8.612046986795123E-002  7.957974226311833E-003  8.227978953413099E-004

I have not found where the trc values are written, I suspect the error is a problem with a format statement or how an expression is evaluated when a format is determined. Note: New george code (may 2024) replaces write_avs_node_mat.f with write_avs_node_mat_s.f Old calls to subroutine write_avs_node_mat are commented out.

millerta commented 6 days ago

We checked previous VV tests and fehm versions and the WIN .trc files has always used double spacing, and the Linux has always been single space for the 6 values.

I suggest we do not change the format since users will be used to whichever format it has been in the past. Instead, we can modify the fehmpytests transport3d compare scripts to work for 6 values single or double. For now, I will have 2 compare directories compare_lnx and compare_win so we can at least compare by running a solo test. The tester will have to copy the appropriate files into the /compare directory.

If we want to make any changes, Phil suggested looking at plotc1 which Writes the solute information to the .trc