Skip to content

Possibly-missing error handling #78

@maresb

Description

@maresb

This is unlikely to cause an actual issue in practice, but I noticed that here we set IFL from the result of the environmental CAPE, but shortly thereafter we reassign it to the nominal value of 1 without actually handling the case where it's not 1.

I say this is unlikely to cause an actual issue because this is just one of many CAPE computations, so the probability of a failure here but not elsewhere is not particularly high.

In my browser, I have to scroll down to see the reassignment IFL=int(1):

tcpyPI/src/tcpyPI/pi.py

Lines 585 to 598 in 3c1d4ef

# if the CAPE function tripped a flag, set the output IFL to it
if (IFLAG != 1):
IFL=int(IFLAG)
#
# *** Begin iteration to find mimimum pressure ***
#
# set loop counter and initial condition
NP=0 # loop counter
PM=970.0
PMOLD=PM # initial condition from minimum pressure
PNEW=0.0 # initial condition from minimum pressure
IFL=int(1) # Default flag for CAPE calculation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions