New URL for NEMO forge!   http://forge.nemo-ocean.eu

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.
#1304 ([TOP/PISCES] p4zbio.F90: tra correction for negative tracers concentration) – NEMO

Opened 9 years ago

Closed 8 years ago

Last modified 7 years ago

#1304 closed Bug (fixed)

[TOP/PISCES] p4zbio.F90: tra correction for negative tracers concentration

Reported by: oriche Owned by: nemo
Priority: low Milestone:
Component: TOP Version: v3.4
Severity: Keywords: PISCES
Cc: oriche@…

Description

Hello,

While looking through this part of the code with some colleagues we found that there were some inconsistencies.

The block I am referring to is in TOP/PISCES/(P4Z)/p4zbio.F90:

94 xnegtr(:,:,:) = 1.e0
95 DO jn = jp_pcs0, jp_pcs1
96 DO jk = 1, jpk
97 DO jj = 1, jpj
98 DO ji = 1, jpi
99 IF( ( trn(ji,jj,jk,jn) + tra(ji,jj,jk,jn) ) < 0.e0 ) THEN
100 ztra = ABS( trn(ji,jj,jk,jn) ) / ( ABS( tra(ji,jj,jk,jn) ) + rtrn )
101
102 xnegtr(ji,jj,jk) = MIN( xnegtr(ji,jj,jk), ztra )
103 ENDIF
104 END DO
105 END DO
106 END DO
107 END DO
108 ! ! where at least 1 tracer concentration becomes negative
109 ! !
110 DO jn = jp_pcs0, jp_pcs1
111 trn(:,:,:,jn) = trn(:,:,:,jn) + xnegtr(:,:,:) * tra(:,:,:,jn)
112 END DO

xnegtr is looping through all the tracers (lines 95-107), but only the values for the last updated tracers are used (lines 110-112) since it has only 3 dimensions.

Line 111 should be in the jn loop (lines 95-107) as well as line 94 (xnegtr initialization to 1).
With the last modification line 102 does not seem necessary.

I think this bug has been carried out since version 3.4 (the version we are using) to the lastest version (the copy/paste is directly from https://forge.ipsl.jussieu.fr/nemo/browser/trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zbio.F90)

Cheers,
Olivier

Commit History (0)

(No commits)

Change History (4)

comment:1 Changed 8 years ago by cetlod

Not really a bug. The loop is done through all the tracers to keep mass conservation

comment:2 Changed 8 years ago by cetlod

  • Resolution set to fixed
  • Status changed from new to closed

comment:3 Changed 7 years ago by nicolasmartin

  • Keywords PISCES added; p4zbio.F90 removed

comment:4 Changed 7 years ago by nicolasmartin

  • Keywords xnegtr removed
Note: See TracTickets for help on using tickets.