id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc 1305,Wrong maximum level for light penetration in some mpp cases,acc,acc,"The trc_oce_ext_lev function (trc_oce.F90) often computes the wrong maximum level for light penetration in mpp runs. This is because in cases with land-only regions or regions where every wet-point is above the maximum penetration depth, the zem>= zhext test is never true. In these cases the penetration level is returned as jpkm1. This leads to, at best, unnecessary calculations and may be responsible for NaNs arising from uninitialised values in some cases. Rewriting the test from: {{{ ! Level of light extinction pjl = jpkm1 DO jk = jpkm1, 1, -1 zem = MAXVAL( fsdepw(:,:,jk+1) * tmask(:,:,jk) ) IF( zem >= zhext ) pjl = jk ! last T-level reached by Qsr END DO }}} to {{{ ! Level of light extinction pjl = jpkm1 DO jk = jpkm1, 1, -1 IF(SUM(tmask(:,:,jk)) > 0 ) THEN zem = MAXVAL( fsdepw(:,:,jk+1) * tmask(:,:,jk) ) IF( zem >= zhext ) pjl = jk ! last T-level reached by Qsr ELSE pjl = jk ! or regional sea-bed depth ENDIF END DO }}} fixes the problem",Bug,closed,low,,OCE,v3.6,,fixed,,