-
Notifications
You must be signed in to change notification settings - Fork 134
Description
MFC is filled with lines like this:
MFC/src/simulation/m_hypoelastic.f90
Lines 30 to 32 in a39962c
| real(kind(0d0)), allocatable, dimension(:, :, :) :: du_dx, du_dy, du_dz | |
| real(kind(0d0)), allocatable, dimension(:, :, :) :: dv_dx, dv_dy, dv_dz | |
| real(kind(0d0)), allocatable, dimension(:, :, :) :: dw_dx, dw_dy, dw_dz |
where the precision is declared via kind(0d0).
We also have a ton of this
MFC/src/simulation/m_riemann_solvers.fpp
Lines 547 to 556 in a39962c
| rho_L = 0d0 | |
| gamma_L = 0d0 | |
| pi_inf_L = 0d0 | |
| rho_R = 0d0 | |
| gamma_R = 0d0 | |
| pi_inf_R = 0d0 | |
| alpha_L_sum = 0d0 | |
| alpha_R_sum = 0d0 |
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 and kind(0d0) and replace them with a constant declared in the common/ 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.