Open sbryngelson opened 1 year ago
note this from the miniweather app:
an important thing to notice is that if one switches to single precision, you have to switch the MPI kind as well (notice all the MPI_DOUBLE_PRECISION business in m_mpi_proxy.f90
).
Update: We would probably only update the precision for a few variables, so it seems rather unlikely to touch m_mpi_proxy or MPI types.
Bump to top as the PR #119 was closed
MFC is filled with lines like this:
https://github.com/MFlowCode/MFC/blob/a39962ca7378fab292380a0e8694cc953f38b7e9/src/simulation/m_hypoelastic.f90#L30-L32
where the precision is declared via
kind(0d0)
. We also have a ton of thishttps://github.com/MFlowCode/MFC/blob/a39962ca7378fab292380a0e8694cc953f38b7e9/src/simulation/m_riemann_solvers.fpp#L547-L556
where inline constants have precision declared in a "hard-coded" way.
What is better is declaring a separate constant that we can change as needed, like this example, though there are many others.
A fix for this issue would remove all cases of
0d0
andkind(0d0)
and replace them with a constant declared in thecommon/
directory. I think this is a suitable task for @anshgupta1234 .I realize one can force precision via compiler variables, but I believe we should avoid this because there is an established language standard.