Opened 5 years ago
Closed 5 years ago
#842 closed bug (Fixed)
VERY IMPORTANT: Corrected bug in MPDATA
Reported by: | arango | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | Release ROMS/TOMS 3.9 |
Component: | Nonlinear | Version: | 3.9 |
Keywords: | Cc: |
Description
In src:ticket:839 coupled of bugs were introduced to the MPDATA tracer advection in routine step3d_t.F. The following I-loop the wrong range:
! ! If MPDATA, time-step horizontal advection for intermediate diffusive ! tracer, Ta. Otherwise, time-step horizontal advection term. ! Advective fluxes have units of Tunits m3/s. The new tracer has ! units of m Tunits. ! IF (Hadvection(itrc,ng)%MPDATA) THEN DO j=JstrVm2,Jendp2i DO i=IstrUm2,IstrUm2 ... ... END DO END DO
We need to have instead:
IF (Hadvection(itrc,ng)%MPDATA) THEN DO j=JstrVm2,Jendp2i DO i=IstrUm2,Iendp2i ... END DO END DO
The I-range needs to be IstrUm2:Iendp2i. It is a copying and pasting typo. Many thanks to Chuning Wang for reporting this bug.
The second bug is due to a combination of CPP option and logical switch in the vertical diffusion term when SPLINES_VDIFF is activated. If MPDATA, the conditional logic is wrong, and the vertical diffusion term is not included. We need to have instead:
! !----------------------------------------------------------------------- ! Time-step vertical diffusion term. !----------------------------------------------------------------------- ! J_LOOP2 : DO j=Jstr,Jend ! start pipelined J-loop DO itrc=1,NT(ng) ltrc=MIN(NAT,itrc) # ifdef SPLINES_VDIFF IF (.not.((Hadvection(itrc,ng)%MPDATA).and. & & (Vadvection(itrc,ng)%MPDATA))) THEN ... ELSE # endif ... # ifdef SPLINES_VDIFF END IF # endif END DO END DO J_LOOP2
Again, many thanks to Chuning Wang for reporting for bringing this logic problem to my attention. There is a wrong combination of the CPP option and IF-conditional.
Made similar changes to the TLM, RPM, ADM versions of step3d_t.F. Luckily, the MPDATA is not supported in the adjoint-based algorithms.