Opened 7 years ago
Closed 5 years ago
#2080 closed Bug (fixed)
bug in z tilde?
Reported by: | davestorkey | Owned by: | davestorkey |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | OCE | Version: | trunk |
Severity: | minor | Keywords: | |
Cc: |
Description (last modified by nicolasmartin)
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 |
Change History (5)
comment:1 Changed 7 years ago by jchanut
comment:2 Changed 7 years ago by nicolasmartin
- Description modified (diff)
comment:3 Changed 7 years ago by clevy
- Owner set to davestorkey
- Status changed from new to assigned
comment:4 Changed 5 years ago by jchanut
In 11415:
comment:5 Changed 5 years ago by jchanut
- Resolution set to fixed
- Status changed from assigned to closed
I think you're right: baroclinic calculation would be done twice. The only problem I see (apart from inefficiency), is that the filtered divergence calculation (hdiv_lf) is wrong, because it is done twice at each time step.