mbdevpl / transpyle-flash

0 stars 1 forks source link

NotImplementedError in hy_8wv_interpolate (A) #2

Open chaw0023 opened 6 years ago

chaw0023 commented 6 years ago

Error::

NotImplementedError: cannot convert intrinsic call from raw AST: sign(1.0, U[MAGN_VAR, i])

in file: (A) _source/physics/Hydro/HydroMain/split/MHD_8Wave/hy_8wvinterpolate

A test case which uses this file is mhd rotor problem. i.e. ./setup magnetoHD/CurrentSheet -auto -2d -objdir=mhdrotor -site=sauc.xps -gridinterpolation=native -debug

mbdevpl commented 6 years ago

In this kernel I've noticed few things happening in the transpiler with certain literal constants. In each of 3 cases, 1st line is original line and 2nd is transpiler output. Could you tell me if those are ok, or should I work on fixing any of them.

  1. I'm not sure if below is acceptable or not:

    real, PARAMETER :: sqhalf = 0.7071067811865475244
    real, parameter :: sqhalf = 0.7071067811865476
  2. This seems harmless:

    real, PARAMETER :: epsilon = 10E-15
    real, parameter :: epsilon = 1e-14
  3. This also seems harmless (and happens to any number, i.e. ###. gets converted to ###.0) and happens not only in hy_8wv_interpolate, but also in most of other kernels:

    0.
    0.0
chaw0023 commented 6 years ago

I am sorry this query missed my radar somehow. To answer:

  1. The answer will depend on the tolerance levels of convergences. Usually they are all double precision so this change may alter the accuracy of the problem. I would love to have it remain same. Is it difficult to do that? Everything said, it will not change the nature of computations or solution for most problems but it is something that SHOULD be fixed eventually!!

  2. Acceptable

  3. Acceptable