diaar5: Suspicious use of INTEGER in the ocean Volume computation
Hello, The problem I mentioned in the title of this issue is related to the way vol0 and thick0(:,:) are calculated in dia_ar5_init in diaar5.F90 :
SUBROUTINE dia_ar5_init
!!----------------------------------------------------------------------
!! *** ROUTINE dia_ar5_init ***
!!
!! ** Purpose : initialization for AR5 diagnostic computation
!!----------------------------------------------------------------------
INTEGER :: inum
INTEGER :: ik, idep
INTEGER :: ji, jj, jk ! dummy loop indices
REAL(wp) :: zztmp
REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) :: zsaldta ! Jan/Dec levitus salinity
REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zvol0
..........
area_tot = glob_sum( 'diaar5', e1e2t(:,:) )
ALLOCATE( zvol0(jpi,jpj) )
zvol0 (:,:) = 0._wp
thick0(:,:) = 0._wp
DO_3D( 1, 1, 1, 1, 1, jpkm1 ) ! interpolation of salinity at the last ocean level (i.e. the partial step)
idep = tmask(ji,jj,jk) * e3t_0(ji,jj,jk)
zvol0 (ji,jj) = zvol0 (ji,jj) + idep * e1e2t(ji,jj)
thick0(ji,jj) = thick0(ji,jj) + idep
END_3D
vol0 = glob_sum( 'diaar5', zvol0 )
DEALLOCATE( zvol0 )
.....
Using idep (integer) truncate e3t_0 to an integer value.
I do not capture the rationale for that (if any).
The impact is just that vol0 and thick0(:,:) are not computed accurately...
This idep has been introduced in NEMO between 4.0.1 and 4.0.2
Edited by Jean-Marc Molines