From a0ef0eaaebf7ff8103081b21756258a99a1ea853 Mon Sep 17 00:00:00 2001 From: anton-seaice Date: Fri, 6 Feb 2026 09:19:01 +1100 Subject: [PATCH 1/3] Update debug flags per https://github.com/ACCESS-NRI/ACCESS-OM3/issues/94 and make it run --- cicecore/cicedyn/infrastructure/ice_domain.F90 | 6 +++--- cicecore/cicedyn/infrastructure/ice_grid.F90 | 4 ++-- cicecore/drivers/nuopc/cmeps/ice_import_export.F90 | 2 +- configuration/scripts/cmake/CMakeLists.txt | 4 +++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cicecore/cicedyn/infrastructure/ice_domain.F90 b/cicecore/cicedyn/infrastructure/ice_domain.F90 index 86d6a1939..93092fc7d 100644 --- a/cicecore/cicedyn/infrastructure/ice_domain.F90 +++ b/cicecore/cicedyn/infrastructure/ice_domain.F90 @@ -606,9 +606,9 @@ subroutine init_domain_distribution(KMTG,ULATG,grid_ice) work_per_block = 0 end where if (my_task == master_task) then - write(nu_diag,'(2a,4i9)') subname,' work_unit = ',work_unit, max_work_unit - write(nu_diag,'(2a,4i9)') subname,' nocn = ',minval(nocn),maxval(nocn),sum(nocn) - write(nu_diag,'(2a,4i9)') subname,' work_per_block = ',minval(work_per_block),maxval(work_per_block),sum(work_per_block) + write(nu_diag,'(2a,2i9)') subname,' work_unit = ',work_unit, max_work_unit + write(nu_diag,'(2a,3i16)') subname,' nocn = ',minval(nocn),maxval(nocn),sum(nocn) + write(nu_diag,'(2a,3i9)') subname,' work_per_block = ',minval(work_per_block),maxval(work_per_block),sum(work_per_block) endif deallocate(nocn) diff --git a/cicecore/cicedyn/infrastructure/ice_grid.F90 b/cicecore/cicedyn/infrastructure/ice_grid.F90 index eb2d22411..9aac92758 100644 --- a/cicecore/cicedyn/infrastructure/ice_grid.F90 +++ b/cicecore/cicedyn/infrastructure/ice_grid.F90 @@ -1616,8 +1616,8 @@ subroutine mom_corners_global(work_mom, G_U, G_T, G_E, G_N) select case (trim(ns_boundary_type)) case ('tripole') do i = 1, nx_global+1 - G_T(i,ny_global+1) = G_T(nx_global+1-i, ny_global) - G_E(i,ny_global+1) = G_E(nx_global+1-i, ny_global) + G_T(i,ny_global+1) = G_T(nx_global+2-i, ny_global) + G_E(i,ny_global+1) = G_E(nx_global+2-i, ny_global) enddo case ('cyclic') G_T(:,ny_global+1) = G_T(:,1) diff --git a/cicecore/drivers/nuopc/cmeps/ice_import_export.F90 b/cicecore/drivers/nuopc/cmeps/ice_import_export.F90 index 412b2cce5..ca59a9bb7 100644 --- a/cicecore/drivers/nuopc/cmeps/ice_import_export.F90 +++ b/cicecore/drivers/nuopc/cmeps/ice_import_export.F90 @@ -1063,7 +1063,7 @@ subroutine ice_export( exportState, rc ) endif ! Create a temporary field - allocate(tempfld(nx_block,ny_block,nblocks)) + allocate(tempfld(nx_block,ny_block,max_blocks)) ! Fractions and mask call state_setexport(exportState, 'Si_ifrac', input=ailohi, rc=rc) diff --git a/configuration/scripts/cmake/CMakeLists.txt b/configuration/scripts/cmake/CMakeLists.txt index aaafbcb4e..d046cbee8 100644 --- a/configuration/scripts/cmake/CMakeLists.txt +++ b/configuration/scripts/cmake/CMakeLists.txt @@ -59,11 +59,13 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch") endif() set(CMAKE_Fortran_FLAGS_RELEASE "-O") + set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-O -g") set(CMAKE_Fortran_FLAGS_DEBUG "-g -Wall -Og -ffpe-trap=zero,overflow -fcheck=bounds") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qno-opt-dynamic-align -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model precise") set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -debug minimal") - set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created") + set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-O2 -g") + set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -check all -fpe0 -check noarg_temp_created") else() message(WARNING "Fortran compiler with ID ${CMAKE_Fortran_COMPILER_ID} will be used with CMake default options") endif() From b58024c5a329720ed00c1ef63bb7158eb8df166b Mon Sep 17 00:00:00 2001 From: anton-seaice Date: Tue, 24 Feb 2026 10:21:26 +1100 Subject: [PATCH 2/3] set -grecord-gcc-switches per https://github.com/ACCESS-NRI/ACCESS-OM3/issues/199 --- configuration/scripts/cmake/CMakeLists.txt | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/configuration/scripts/cmake/CMakeLists.txt b/configuration/scripts/cmake/CMakeLists.txt index d046cbee8..d5fe2ed00 100644 --- a/configuration/scripts/cmake/CMakeLists.txt +++ b/configuration/scripts/cmake/CMakeLists.txt @@ -54,30 +54,28 @@ include(FortranLib) # Common compiler flags and definitions if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbacktrace -fconvert=big-endian -ffree-line-length-none -ffixed-line-length-none") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbacktrace -fconvert=big-endian -ffree-line-length-none -ffixed-line-length-none -g -grecord-gcc-switches") if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch") endif() set(CMAKE_Fortran_FLAGS_RELEASE "-O") - set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-O -g") - set(CMAKE_Fortran_FLAGS_DEBUG "-g -Wall -Og -ffpe-trap=zero,overflow -fcheck=bounds") + set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Og -ffpe-trap=zero,overflow -fcheck=bounds") elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qno-opt-dynamic-align -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model precise") - set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -debug minimal") - set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-O2 -g") - set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -check all -fpe0 -check noarg_temp_created") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qno-opt-dynamic-align -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model precise -g -grecord-gcc-switches") + set(CMAKE_Fortran_FLAGS_RELEASE "-O2") + set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check all -fpe0 -check noarg_temp_created") else() message(WARNING "Fortran compiler with ID ${CMAKE_Fortran_COMPILER_ID} will be used with CMake default options") endif() if(CMAKE_C_COMPILER_ID MATCHES "GNU") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -g -grecord-gcc-switches") set(CMAKE_C_FLAGS_RELEASE "-O") - set(CMAKE_C_FLAGS_DEBUG "-g -Wall -Og -fbacktrace -ffpe-trap=invalid,zero,overflow -fcheck=bounds") + set(CMAKE_C_FLAGS_DEBUG "-Wall -Og -fbacktrace -ffpe-trap=invalid,zero,overflow -fcheck=bounds") elseif(CMAKE_C_COMPILER_ID MATCHES "Intel") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -traceback -qno-opt-dynamic-align -fp-model precise -std=gnu99") - set(CMAKE_C_FLAGS_RELEASE "-O2 -debug minimal") - set(CMAKE_C_FLAGS_DEBUG "-O0 -g") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -traceback -qno-opt-dynamic-align -fp-model precise -std=gnu99 -g -grecord-gcc-switches") + set(CMAKE_C_FLAGS_RELEASE "-O2") + set(CMAKE_C_FLAGS_DEBUG "-O0") else() message(WARNING "C compiler with ID ${CMAKE_C_COMPILER_ID} will be used with CMake default options") endif() From d8ca4454769186245910d5c84773a45f36d8b7e1 Mon Sep 17 00:00:00 2001 From: anton-seaice Date: Wed, 4 Mar 2026 16:26:16 +1100 Subject: [PATCH 3/3] set NO_SNICARHC to remove large unused table (https://github.com/ACCESS-NRI/CICE/issues/37) --- configuration/scripts/cmake/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/configuration/scripts/cmake/CMakeLists.txt b/configuration/scripts/cmake/CMakeLists.txt index d5fe2ed00..64ba71d34 100644 --- a/configuration/scripts/cmake/CMakeLists.txt +++ b/configuration/scripts/cmake/CMakeLists.txt @@ -83,6 +83,7 @@ endif() if (CICE_ACCESS3) add_compile_definitions( CESMCOUPLED + NO_SNICARHC ) endif()