Error in `dia_hth_dep` when calculating 26/28 deg isotherm depth
Context
-
Branches impacted: since 4.0.2 -
Reference configuration/test case: -
Computing architecture: -
Dependencies:
Analysis
The calculation of the isotherm depth in dia_hth_dep
has a hardcoded 20.
. This seems to have been left behind after the refactoring of changeset [12276]:
DO_2D( 0, 0, 0, 0 )
!
zzdep = gdepw(ji,jj,mbkt(ji,jj)+1,Kmm) ! depth of the ocean bottom
!
iid = iktem(ji,jj)
IF( iid /= 1 ) THEN
zztmp = gdept(ji,jj,iid ,Kmm) & ! linear interpolation
& + ( gdept(ji,jj,iid+1,Kmm) - gdept(ji,jj,iid,Kmm) ) &
& * ( 20.*tmask(ji,jj,iid+1) - ts(ji,jj,iid,jp_tem,Kmm) ) &
& / ( ts(ji,jj,iid+1,jp_tem,Kmm) - ts(ji,jj,iid,jp_tem,Kmm) + (1.-tmask(ji,jj,1)) )
pdept(ji,jj) = MIN( zztmp , zzdep) * tmask(ji,jj,1) ! bound by the ocean depth
ELSE
pdept(ji,jj) = 0._wp
ENDIF
END_2D
Fix
Replace with ptem
:
- & * ( 20.*tmask(ji,jj,iid+1) - ts(ji,jj,iid,jp_tem,Kmm) ) &
+ & * ( ptem*tmask(ji,jj,iid+1) - ts(ji,jj,iid,jp_tem,Kmm) ) &