Skip to content

Switching to modern and modular precision declaration #42

Closed
@sbryngelson

Description

@sbryngelson

MFC is filled with lines like this:

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions