id summary reporter owner description type status priority milestone component version severity resolution keywords cc 1304 [TOP/PISCES] p4zbio.F90: tra correction for negative tracers concentration oriche nemo "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" Bug closed low TOP v3.4 fixed PISCES oriche@…