New URL for NEMO forge!

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
#2080 (bug in z tilde?) – NEMO

Opened 6 years ago

Closed 4 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:

Description (last modified by nicolasmartin)


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)?





Commit History (1)


#2080, correct conditional statement

Change History (5)

comment:1 Changed 6 years ago by jchanut

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.  

comment:2 Changed 6 years ago by nicolasmartin

  • Description modified (diff)

comment:3 Changed 6 years ago by clevy

  • Owner set to davestorkey
  • Status changed from new to assigned

comment:4 Changed 4 years ago by jchanut

In 11415:

Error: Failed to load processor CommitTicketReference
No macro or processor named 'CommitTicketReference' found

comment:5 Changed 4 years ago by jchanut

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.