diff --git a/src/LIB/SURCOUCHE/src/modd_netcdf.f90 b/src/LIB/SURCOUCHE/src/modd_netcdf.f90
index 814e2c98d04e3625d4b641807dd97b07a7aafc32..21c49d645dbc590d1bd65b4bfefc38597ad020f3 100644
--- a/src/LIB/SURCOUCHE/src/modd_netcdf.f90
+++ b/src/LIB/SURCOUCHE/src/modd_netcdf.f90
@@ -40,7 +40,12 @@ end type tdimsnc
 
 contains
 
+#if defined(__GNUC__) && (__GNUC__ == 13) && ((__GNUC_MINOR__ == 1) || (__GNUC_MINOR__ == 2))
+!Workaround for compiler bug impacting GCC 13.1 and 13.2 (corrected in 13.3, does not seem to concern other versions)
+impure elemental subroutine tdimsnc_destructor( tpdimsnc)
+#else
 elemental subroutine tdimsnc_destructor( tpdimsnc)
+#endif
   type(tdimsnc), intent(inout) :: tpdimsnc
 
   if ( associated( tpdimsnc%tdims     ) ) deallocate( tpdimsnc%tdims     )