Admin message

The forge.nemo-ocean.eu server will be down for maintenance on Monday 15 June from 9h to 10h am CEST. Sorry for the inconvenience.

Several diagnostic issues in branch_4.2
#### Context - [x] Branches impacted: branch_4.2 - [x] Reference configuration/test case: ORCA2 - [ ] Computing architecture - [x] Dependencies: 1. Any diagnostic activating the `l_ar5` conditional in `dia_ar5_init` (e.g. `masscello`) 2. Any turbulent closure activating the `l_zdfsh2` conditional in `zdf_phy` (e.g. `ln_zdftke = .TRUE.`), `ln_tile = .TRUE.` 3. `ln_zdftke = .TRUE.`, `ln_tile = .TRUE.` 4. `ln_tile = .TRUE.`, `iom_put` called for tiled array without halo points #### Analysis 1. `z3d` is not allocated in [dia_ar5](https://forge.nemo-ocean.eu/nemo/nemo/-/blob/9f0c75ecdfbbf0ffd7b93de52d55031ab3e9706d/src/OCE/DIA/diaar5.F90#L81). XIOS fails with an 'unexpected array shape' error (`SHAPE(z3d)` returns 0). 2. The `eshear_k` diagnostic in [zdf_phy](https://forge.nemo-ocean.eu/nemo/nemo/-/blob/9f0c75ecdfbbf0ffd7b93de52d55031ab3e9706d/src/OCE/ZDF/zdfphy.F90#L384) is calculated in a way that causes a conformance error when the tiling is active (arrays `zsh2` and `wmask` have different shapes), leading to different results. 3. The `ediss_k` diagnostic in [zdf_tke](https://forge.nemo-ocean.eu/nemo/nemo/-/blob/9f0c75ecdfbbf0ffd7b93de52d55031ab3e9706d/src/OCE/ZDF/zdftke.F90#L464) is calculated prior to the addition of the `nn_etau` contribution to `en`. Because this is calculated on halo points, the `nn_etau` contribution is added to the internal parts of adjacent tiles and is therefore included in the `ediss_k` diagnostic for those tiles. The tiling therefore gives different results for this diagnostic. 4. The definition of the 'inner'-type XIOS grids (those without halo points in the source data) in [set_grid](https://forge.nemo-ocean.eu/nemo/nemo/-/blob/9f0c75ecdfbbf0ffd7b93de52d55031ab3e9706d/src/OCE/IOM/iom.F90#L2289) is incorrect for tile-sized arrays- `tile_data*` should not include halo points. For diagnostics defined on these grids, the tiling will give different results. #### Fix These issues were all resolved (directly or indirectly) by 16443a0b; we just need fixes for branch_4.2. 1. Allocate the array! 2. Define `eshear_k` on the `grid_W_3D_inner` grid in field_def.xml and calculate the diagnostic only on the inner domain, i.e. ```diff - CALL iom_put( 'eshear_k', zsh2 * wmask ) + CALL iom_put( 'eshear_k', zsh2(A2D(0),:) * wmask(A2D(0),:) ) ``` All halo points must be excluded, as there is no support in branch_4.2 for diagnostic arrays with 1 row of halo points when `nn_hls = 2` (but this is in the main). 3. Define `ztmp` on the MPI domain (using `SAVE` to preserve the result) and populate the array with each tile, then send the array to XIOS when all tiles are finished. This method is used to solve a similar issue in `zdf_evd`. ```fortran IF( iom_use('ediss_k') ) THEN IF( .NOT. l_istiled .OR. ntile == 1 ) THEN ALLOCATE( ztmp(jpi,jpj,jpk) ) ztmp(:,:,:) = 0._wp ENDIF DO_3D_OVR( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 1, jpkm1 ) ztmp(ji,jj,jk) = zfact3 * dissl(ji,jj,jk) * en(ji,jj,jk) * wmask(ji,jj,jk) END_3D IF( .NOT. l_istiled .OR. ntile == nijtile ) THEN CALL iom_put( 'ediss_k', ztmp ) DEALLOCATE( ztmp ) ENDIF ENDIF ``` Note that the array is zeroed to avoid potential 'numerical conversion' type errors in XIOS. 4. Make the following change in `set_grid` in `iom.F90` ```diff + idb(:) = 0 CALL iom_set_domain_attr("grid_"//cdgrd//"_inner", ntiles=nijtile, & - & tile_ibegin=ntsi_a(1:nijtile) + idb(:) - 1, tile_jbegin=ntsj_a(1:nijtile) + idb(:) - 1, & + & tile_ibegin=ntsi_a(1:nijtile) - nn_hls - 1, tile_jbegin=ntsj_a(1:nijtile) - nn_hls - 1, & & tile_ni=ini(:), tile_nj=inj(:), & & tile_data_ibegin=idb(:), tile_data_jbegin=idb(:), & & tile_data_ni=ini(:) - 2 * idb(:), tile_data_nj=inj(:) - 2 * idb(:)) ```
issue