Opened 6 years ago
Last modified 5 years ago
#2080 closed Bug
bug in z tilde? — at Initial Version
Reported by: | davestorkey | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | OCE | Version: | trunk |
Severity: | minor | Keywords: | |
Cc: |
Description
Context
I think the IF test in line 327 of domvvl.F90 might be wrong. (I'm looking at the dev_merge_2017 branch). In fortran AND has precedence over OR, so the line
IF( ln_vvl_ztilde .OR. ln_vvl_layer .AND. ll_do_bclinic ) THEN
is the same as
IF( ln_vvl_ztilde .OR. ( ln_vvl_layer .AND. ll_do_bclinic ) ) THEN
But I think it should be
IF( ( ln_vvl_ztilde .OR. ln_vvl_layer ) .AND. ll_do_bclinic ) THEN
If ln_vvl_ztilde is true and kcall=2 then ll_do_bclinic is set to false. But ( ln_vvl_ztilde .OR. ln_vvl_layer .AND. ll_do_bclinic ) evaluates as true in this case so it will still do the baroclinic calculation even though ll_do_bclinic is false. I don't know if this will give a wrong result or if it just an inefficiency - a repeated calculation.
I haven't tested z tilde. I'm just reading the code. Could someone confirm that they agree with me (or disagree with me)?
Analysis
...
Fix
...
Commit History (1)
Changeset | Author | Time | ChangeLog |
---|---|---|---|
11415 | jchanut | 2019-08-07T11:05:58+02:00 | #2080, correct conditional statement |