Skip to content

visc_rem initialization bit regression / sensititive with -O2 if built without -fp-model #988

@marshallward

Description

@marshallward

The refactored j/i/k tridiagonal solvers of MOM_vert_friction.F90 show a regression in vertvisc_remnant() if built with -O2 but without -fp-model source (or similar FP model).

Answers are restored if we explicitly initialize visc_rem_[uv](:,:,:) to zero, including over land.

Formally this should not be needed, since we mask all visc_rem_[uv] values over land. But there must be either something wrong with this statement, or we have an aggressive optimizer that found a loophole that we missed.

This is not urgent, since we all build with -fp-model, but we may want to investigate further if we are interested in pursuing more optimizations without -fp-model.

Relevant PR:
#973

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions