From 335a4f6e55d94f239dd4a3d9f91f1a600de89342 Mon Sep 17 00:00:00 2001 From: anton-seaice Date: Fri, 6 Dec 2024 16:29:11 +1100 Subject: [PATCH] Update to CICE 6.6.0 with access-nri branch with reading MOM supergrid and rpointer fix CICE 2025.01.0 from access-nri fork --- .gitmodules | 4 +- CICE/CICE | 2 +- CICE/CMakeLists.txt | 7 +-- CICE/patches/ice_distribution.F90.patch | 16 ----- CICE/patches/ice_domain.F90.patch | 83 ------------------------- CICE/patches/ice_init.F90.patch | 13 ---- 6 files changed, 6 insertions(+), 119 deletions(-) delete mode 100644 CICE/patches/ice_distribution.F90.patch delete mode 100644 CICE/patches/ice_domain.F90.patch delete mode 100644 CICE/patches/ice_init.F90.patch diff --git a/.gitmodules b/.gitmodules index 4d18ee5..28899af 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ [submodule "MOM6/MOM6"] path = MOM6/MOM6 - url = https://github.com/ACCESS-NRI/mom6 + url = https://github.com/ACCESS-NRI/MOM6 [submodule "CICE6/CICE6"] path = CICE/CICE - url = https://github.com/ESCOMP/CICE + url = https://github.com/ACCESS-NRI/CICE [submodule "CMEPS/CMEPS"] path = CMEPS/CMEPS url = https://github.com/ESCOMP/CMEPS diff --git a/CICE/CICE b/CICE/CICE index 12dd204..e68e05b 160000 --- a/CICE/CICE +++ b/CICE/CICE @@ -1 +1 @@ -Subproject commit 12dd204349090058a66715163932ae3243f9632c +Subproject commit e68e05b7962fc926c8a35397bca464d6b1e06ab9 diff --git a/CICE/CMakeLists.txt b/CICE/CMakeLists.txt index 1c5e7c4..25c67cf 100644 --- a/CICE/CMakeLists.txt +++ b/CICE/CMakeLists.txt @@ -26,6 +26,7 @@ target_sources(OM3_cice PRIVATE CICE/cicecore/shared/ice_arrays_column.F90 CICE/cicecore/shared/ice_calendar.F90 CICE/cicecore/shared/ice_constants.F90 + CICE/cicecore/shared/ice_distribution.F90 CICE/cicecore/shared/ice_domain_size.F90 CICE/cicecore/shared/ice_fileunits.F90 CICE/cicecore/shared/ice_init_column.F90 @@ -61,11 +62,13 @@ target_sources(OM3_cice PRIVATE CICE/cicecore/cicedyn/general/ice_flux_bgc.F90 CICE/cicecore/cicedyn/general/ice_forcing.F90 CICE/cicecore/cicedyn/general/ice_forcing_bgc.F90 + CICE/cicecore/cicedyn/general/ice_init.F90 CICE/cicecore/cicedyn/general/ice_state.F90 CICE/cicecore/cicedyn/general/ice_step_mod.F90 # Infrastructure CICE/cicecore/cicedyn/infrastructure/ice_blocks.F90 + CICE/cicecore/cicedyn/infrastructure/ice_domain.F90 CICE/cicecore/cicedyn/infrastructure/ice_grid.F90 CICE/cicecore/cicedyn/infrastructure/ice_memusage.F90 CICE/cicecore/cicedyn/infrastructure/ice_memusage_gptl.c @@ -152,10 +155,6 @@ elseif(OM3_CICE_IO MATCHES "Binary") ) endif() -add_patched_source(OM3_cice CICE/cicecore/cicedyn/infrastructure/ice_domain.F90) -add_patched_source(OM3_cice CICE/cicecore/shared/ice_distribution.F90) -add_patched_source(OM3_cice CICE/cicecore/cicedyn/general/ice_init.F90) - ### Install and Export ## Library diff --git a/CICE/patches/ice_distribution.F90.patch b/CICE/patches/ice_distribution.F90.patch deleted file mode 100644 index fccefe2..0000000 --- a/CICE/patches/ice_distribution.F90.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/cicecore/shared/ice_distribution.F90 b/cicecore/shared/ice_distribution.F90 -old mode 100644 -new mode 100755 -index 0f3f6c1..6e06069 ---- a/cicecore/shared/ice_distribution.F90 -+++ b/cicecore/shared/ice_distribution.F90 -@@ -41,7 +41,8 @@ module ice_distribution - ice_distributionGet, & - ice_distributionGetBlockLoc, & - ice_distributionGetBlockID, & -- create_local_block_ids -+ create_local_block_ids, & -+ proc_decomposition - - character (char_len), public :: & - processor_shape ! 'square-pop' (approx) POP default config diff --git a/CICE/patches/ice_domain.F90.patch b/CICE/patches/ice_domain.F90.patch deleted file mode 100644 index f769ddd..0000000 --- a/CICE/patches/ice_domain.F90.patch +++ /dev/null @@ -1,83 +0,0 @@ -diff --git a/cicecore/cicedyn/infrastructure/ice_domain.F90 b/cicecore/cicedyn/infrastructure/ice_domain.F90 -index 8b680f2..47a0f00 100644 ---- a/cicecore/cicedyn/infrastructure/ice_domain.F90 -+++ b/cicecore/cicedyn/infrastructure/ice_domain.F90 -@@ -101,7 +101,7 @@ subroutine init_domain_blocks - ! This routine reads in domain information and calls the routine - ! to set up the block decomposition. - -- use ice_distribution, only: processor_shape -+ use ice_distribution, only: processor_shape, proc_decomposition - use ice_domain_size, only: ncat, nilyr, nslyr, max_blocks, & - nx_global, ny_global, block_size_x, block_size_y - use ice_fileunits, only: goto_nml -@@ -112,7 +112,8 @@ subroutine init_domain_blocks - !---------------------------------------------------------------------- - - integer (int_kind) :: & -- nml_error ! namelist read error flag -+ nml_error, & ! namelist read error flag -+ nprocs_x, nprocs_y ! procs decomposed into blocks - - character(len=char_len) :: nml_name ! text namelist name - character(len=char_len_long) :: tmpstr2 ! for namelist check -@@ -216,21 +217,33 @@ subroutine init_domain_blocks - call broadcast_scalar(maskhalo_bound, master_task) - call broadcast_scalar(add_mpi_barriers, master_task) - call broadcast_scalar(debug_blocks, master_task) -- if (my_task == master_task) then -- if (max_blocks < 1) then -- max_blocks=( ((nx_global-1)/block_size_x + 1) * & -- ((ny_global-1)/block_size_y + 1) - 1) / nprocs + 1 -- max_blocks=max(1,max_blocks) -- write(nu_diag,'(/,a52,i6,/)') & -- '(ice_domain): max_block < 1: max_block estimated to ',max_blocks -- endif -- endif - call broadcast_scalar(max_blocks, master_task) - call broadcast_scalar(block_size_x, master_task) - call broadcast_scalar(block_size_y, master_task) - call broadcast_scalar(nx_global, master_task) - call broadcast_scalar(ny_global, master_task) - -+ ! Set nprocs if not set in namelist -+ if (nprocs == -1) then -+ nprocs = get_num_procs() -+ else if (nprocs /= get_num_procs()) then -+ write(nu_diag,*) subname,' ERROR: nprocs, get_num_procs = ',nprocs,get_num_procs() -+ call abort_ice(subname//' ERROR: Input nprocs not same as system request', file=__FILE__, line=__LINE__) -+ endif -+ -+ ! Determine max_blocks if not set -+ if (max_blocks < 1) then -+ call proc_decomposition(nprocs, nprocs_x, nprocs_y) -+ max_blocks=((nx_global-1)/block_size_x/nprocs_x+1) * & -+ ((ny_global-1)/block_size_y/nprocs_y+1) -+ max_blocks=max(1,max_blocks) -+ if (my_task == master_task) then -+ write(nu_diag,'(/,a52,i6,/)') & -+ '(ice_domain): max_block < 1: max_block estimated to ',max_blocks -+ endif -+ endif -+ -+ - !---------------------------------------------------------------------- - ! - ! perform some basic checks on domain -@@ -242,16 +255,6 @@ subroutine init_domain_blocks - !*** domain size zero or negative - !*** - call abort_ice(subname//' ERROR: Invalid domain: size < 1', file=__FILE__, line=__LINE__) ! no domain -- else if (nprocs /= get_num_procs()) then -- !*** -- !*** input nprocs does not match system (eg MPI) request -- !*** --#if (defined CESMCOUPLED) -- nprocs = get_num_procs() --#else -- write(nu_diag,*) subname,' ERROR: nprocs, get_num_procs = ',nprocs,get_num_procs() -- call abort_ice(subname//' ERROR: Input nprocs not same as system request', file=__FILE__, line=__LINE__) --#endif - else if (nghost < 1) then - !*** - !*** must have at least 1 layer of ghost cells diff --git a/CICE/patches/ice_init.F90.patch b/CICE/patches/ice_init.F90.patch deleted file mode 100644 index 3f89ccb..0000000 --- a/CICE/patches/ice_init.F90.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/cicecore/cicedyn/general/ice_init.F90 b/cicecore/cicedyn/general/ice_init.F90 -index 24ac40db..4ad296aa 100644 ---- a/cicecore/cicedyn/general/ice_init.F90 -+++ b/cicecore/cicedyn/general/ice_init.F90 -@@ -872,7 +872,7 @@ subroutine input_data - ! runid and runtype are obtained from the driver, not from the namelist - - if (my_task == master_task) then -- history_file = trim(runid) // ".cice" // trim(inst_suffix) //".h" -+ history_file = trim(runid) // ".cice" // trim(inst_suffix) - restart_file = trim(runid) // ".cice" // trim(inst_suffix) //".r" - incond_file = trim(runid) // ".cice" // trim(inst_suffix) //".i" - ! Note by tcraig - this if test is needed because the nuopc cap sets