#2110 closed Defect (fixed)
Bug in traadv_fct.F90
Reported by: | acc | Owned by: | acc |
---|---|---|---|
Priority: | low | Milestone: | 2018 release-4.0 |
Component: | OCE | Version: | trunk |
Severity: | minor | Keywords: | OPA v4.0 |
Cc: |
Description (last modified by nicolasmartin)
A minor bug exists in the interpolation scheme for the FCT 4th order vertical scheme. The bug was introduced when the code was adapted to cope with the under ice shelf cavities but affects all runs using this option. It manifests as spurious temperatures outside the initial range early in runs of the OVERFLOW test case. Even with the fix shown below, spurious values still occur with this test but much later in the run (> 3000 time steps) and these are in response to excessive vertical velocities which stop the run after 3329 time steps.
Note the pre-ISF enabled version is still in the code (as interp_4th_cpt_org) but is not used. It can be removed subject to successful testing of the new version in an ISF case.
Context
The wrong index is used when setting the bottom boundary condition. The use of jk does not stray out of bounds because jk has a residual valid value from an earlier loop but the boundary condition will be wrong for anything other than flat-bottomed cases.
Analysis
The fix is simple:
-
src/OCE/TRA/traadv_fct.F90
555 555 zwd (ji,jj,ikt) = 1._wp ! top 556 556 zwi (ji,jj,ikt) = 0._wp 557 557 zws (ji,jj,ikt) = 0._wp 558 zwrm(ji,jj,ikt) = 0.5_wp * ( pt_in(ji,jj, jk-1) + pt_in(ji,jj,jk) )558 zwrm(ji,jj,ikt) = 0.5_wp * ( pt_in(ji,jj,ikt-1) + pt_in(ji,jj,ikt) ) 559 559 ! 560 560 zwd (ji,jj,ikb) = 1._wp ! bottom 561 561 zwi (ji,jj,ikb) = 0._wp 562 562 zws (ji,jj,ikb) = 0._wp 563 zwrm(ji,jj,ikb) = 0.5_wp * ( pt_in(ji,jj, jk-1) + pt_in(ji,jj,jk) )563 zwrm(ji,jj,ikb) = 0.5_wp * ( pt_in(ji,jj,ikb-1) + pt_in(ji,jj,ikb) ) 564 564 END DO 565 565 END DO
Recommendation
Commit History (1)
Changeset | Author | Time | ChangeLog |
---|---|---|---|
9901 | acc | 2018-07-09T13:32:57+02:00 | Bug fix in traadv_fct.F90. See ticket #2110 |
Change History (4)
comment:1 Changed 7 years ago by acc
comment:2 Changed 7 years ago by acc
- Resolution set to fixed
- Status changed from new to closed
Final fix also includes code to set level 2 zwd values in the ice cavity case which could be left unset for thick ice shelves and pose a risk of generating Nans. Extra code is simply:
IF ( ln_isfcav ) THEN ! set level two values which may not be set in ISF case zwd(:,:,2) = 1._wp ; zwi(:,:,2) = 0._wp ; zws(:,:,2) = 0._wp ; zwrm(:,:,2) = 0._wp END IF
comment:3 Changed 7 years ago by nicolasmartin
- Description modified (diff)
comment:4 Changed 3 years ago by nemo
- Keywords OPA v4.0 added
In 9901: