Skip to content

Another divide-by-zero (caught by CESM in debug mode) #69

@mnlevy1981

Description

@mnlevy1981

In cvmix_kpp.F90, when running MatchBoth and computing the derivative of the shape function at the boundary layer depth, one of the terms is

second_term = real(5,cvmix_r8)*surf_buoy/(surf_fric**4)

This term is only included in derivative computation if the column is stable, but it is computed regardless (and when surf_fric=0 debug mode aborts because of the divide by zero). Our proposed fix was to change this to

if (lstable) then
  second_term = real(5,cvmix_r8)*surf_buoy/(surf_fric**4)
else
  second_term = cvmix_zero
end if

But we probably also want a check to make sure surf_fric.ne.cvmix_zero in the lstable=.true. case.

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