Skip to content

Floating overflow in function flow_depth (hydraulic.f90) #554

@BernardoTeufel

Description

@BernardoTeufel

The following code causes floating overflow crash for extremely small Qin values (e.g., 2.e-114):

Coef1 = (sqrt(S)/n/Qin)**3

Solved by changing the following line to: if (Qin>1.e-50_dp) then

if (Qin>0._dp) then

Choice of 1.e-50_dp was based on the value used here:

if (abs(Qbar)>1.e-50_dp) then

An alternative could be 1.e-10_dp (unused variable so far):

real(dp), parameter,public :: MinPosVal=1.e-10_dp ! minimum value for positive value

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions