trcopt diagnostics output at the wrong size
Context
When coupling NEMO light to BGC model's Chlorophyll using trcopt
, the model would crash if we ask for the diagnostics calculated inside the subroutine here :
!
IF( lk_iomput ) THEN
IF( iom_use( "Heup" ) ) THEN
ALLOCATE( zw2d(A2D(0)) )
zw2d(A2D(0)) = heup(A2D(0)) * tmask(A2D(0),1)
CALL iom_put( "Heup", zw2d ) ! Euphotic layer depth
DEALLOCATE( zw2d )
ENDIF
IF( iom_use( "xbla" ) ) THEN
ALLOCATE( zw3d(A2D(0),jpk)) ; zw3d(A2D(0),jpk) = 0._wp
zw3d(A2D(0),1:jpkm1) = zeps(A2D(0),1:jpkm1) * tmask(A2D(0),1:jpkm1)
CALL iom_put( "xbla", zw3d ) ! Euphotic layer depth
DEALLOCATE( zw3d )
ENDIF
ENDIF
-
Branches impacted: current release and/or main -
engines involved TOP
Analysis
The problem here is the size of the array, should be T2D(0) instead of A2D(0)
not tested yet, but look like being the problem.
the debug options point to the iom_put
lines above.
all other diag output in the code use T2D when using a temporary arrays.