Skip to content

Commit deed70c

Browse files
authored
Merge Master and ACCESS-ESM1.6 branches (#68)
This pull request merges the access-esm1.6 branch of CICE5 into the master branch. The access driver is used for access-esm1.6, whilst the auscom driver is used for access-om2
2 parents f73ff08 + 0def883 commit deed70c

43 files changed

Lines changed: 4926 additions & 1365 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/build-ci/data/standard.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"intel_compiler": "intel@2021.10.0",
44
"oneapi_compiler": "oneapi@2025.2.0",
55
"om2_1deg": "build_system=cmake model=access-om2 nxglob=360 nyglob=300 blckx=15 blcky=300 mxblcks=1",
6+
"esm1p6": "build_system=cmake model=access-esm1.6 nxglob=360 nyglob=300 blckx=30 blcky=300 mxblcks=1",
67
"target": "x86_64"
78
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
spack:
2+
specs:
3+
- 'cice5@git.{{ ref }}=stable {{ esm1p6 }} ^openmpi@4'
4+
- 'cice5@git.{{ ref }}=stable {{ esm1p6 }} ^openmpi@5'
5+
- 'cice5@git.{{ ref }}=stable build_type=Debug {{ esm1p6 }}'
6+
packages:
7+
gcc-runtime:
8+
require:
9+
'%gcc'
10+
all:
11+
require:
12+
- '%{{ oneapi_compiler }}'
13+
- 'target={{ target }}'
14+
concretizer:
15+
unify: false
16+
view: false

.github/build-ci/manifests/oneapi-cice5-cmake.spack.yaml.j2 renamed to .github/build-ci/manifests/oneapi-cice5-cmake-om2.spack.yaml.j2

File renamed without changes.

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ endif()
131131
if(CICE_DRIVER MATCHES "auscom")
132132
add_compile_definitions(AusCOM coupled)
133133
elseif(CICE_DRIVER MATCHES "access")
134-
add_compile_defitions(ACCESS AusCOM coupled)
134+
add_compile_definitions(ACCESS AusCOM coupled)
135135
endif()
136136

137137
#[==============================================================================[
@@ -169,8 +169,12 @@ set(CICE_DRIVER_SOURCE "${CMAKE_SOURCE_DIR}/drivers/${CICE_DRIVER}")
169169

170170
add_executable(cice ${CICE_DRIVER_SOURCE}/CICE.F90)
171171

172+
if(CICE_DRIVER MATCHES "auscom")
173+
find_package(LIBACCESSOM2)
174+
target_link_libraries(cice PUBLIC libaccessom2::accessom2 )
175+
endif()
176+
172177
target_link_libraries(cice
173-
PUBLIC libaccessom2::accessom2
174178
PRIVATE
175179
MPI::MPI_Fortran
176180
PkgConfig::OASIS3PSMILE PkgConfig::OASIS3MCT PkgConfig::OASIS3MPEU PkgConfig::OASIS3SCRIP
@@ -260,6 +264,7 @@ if(CICE_DRIVER MATCHES "access")
260264
${CICE_DRIVER_SOURCE}/CICE_FinalMod.F90
261265
${CICE_DRIVER_SOURCE}/cpl_interface.F90
262266
${CICE_DRIVER_SOURCE}/ice_constants.F90
267+
${CICE_DRIVER_SOURCE}/ice_coupling.F90
263268
${CICE_DRIVER_SOURCE}/CICE_InitMod.F90
264269
${CICE_DRIVER_SOURCE}/cpl_arrays_setup.F90
265270
${CICE_DRIVER_SOURCE}/cpl_netcdf_setup.F90

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
## Overview
2-
This repository contains the access/cosima/auscom fork of cice5 used in the ACCESS-OM2/CM2 coupled models. It was forked from https://github.com/CICE-Consortium/CICE-svn-trunk/ which in turn captured the trunk from the subversion (svn) repository of the Los Alamos Sea Ice Model, CICE, including release tags through version 5.1.2.
2+
This repository contains the access/auscom fork of cice5 used in the ACCESS-ESM1.6 and ACCESS-OM2. It was forked from https://github.com/CICE-Consortium/CICE-svn-trunk/ which in turn captured the trunk from the subversion (svn) repository of the Los Alamos Sea Ice Model, CICE, including release tags through version 5.1.2.
3+
4+
ACCESS-ESM1.6 related code came from https://code.metoffice.gov.uk/trac/cice/browser/main/branches/pkg/Config/vn5.1.2_GSI8.1_package_branch/cice?order=name&rev=334#source (MOSRS account required)
35

46
More recent versions are found in the [CICE](https://github.com/CICE-Consortium/CICE) and [Icepack](https://github.com/CICE-Consortium/Icepack) repositories, which are maintained by the CICE Consortium.
57

68
If you expect to make any changes to the code, we recommend that you work in the CICE and Icepack repositories. Changes made to code in this repository will not be accepted, other than critical bug fixes.
79

8-
There is [PDF documentation](https://github.com/ACCESS-NRI/cice5/blob/master/doc/cicedoc.pdf) available for CICE 5.1.2, however some changes were made to this fork to support coupling with ACCESS-OM2 and CM2, Parallel IO, ERA5 Forcing, BGC modelling and for other updates. Some of these changes are described in the [ACCESS-OM2 Technical Report](https://github.com/COSIMA/ACCESS-OM2-1-025-010deg-report).
10+
There is [PDF documentation](https://github.com/ACCESS-NRI/cice5/blob/master/doc/cicedoc.pdf) available for CICE 5.1.2, however some changes were made to this fork to support coupling with ACCESS-OM2 and ACCESS-ESM1.6, Parallel IO, ERA5 Forcing, BGC modelling and for other updates. Some of these changes are described in the [ACCESS-OM2 Technical Report](https://github.com/COSIMA/ACCESS-OM2-1-025-010deg-report).
911

1012
## Useful links
1113
* **Wiki**: https://github.com/CICE-Consortium/CICE-svn-trunk/wiki
@@ -18,4 +20,4 @@ There is [PDF documentation](https://github.com/ACCESS-NRI/cice5/blob/master/doc
1820

1921
* **Resource Index**: https://github.com/CICE-Consortium/About-Us/wiki/Resource-Index
2022

21-
List of resources for information about the Consortium and its repositories as well as model documentation, testing, and development.
23+
List of resources for information about the Consortium and its repositories as well as model documentation, testing, and development.

bld/Macros.Linux.raijin-185

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ FC := mpifort
2626
ifeq ($(DEBUG), yes)
2727
FFLAGS := -r8 -i4 -O0 -g -align all -w -ftz -convert big_endian -assume byterecl -no-vec -mcmodel=medium -xHost -fp-model precise
2828
else
29-
FFLAGS := -r8 -i4 -O2 -align all -w -ftz -convert big_endian -assume byterecl -no-vec -mcmodel=medium -xHost -fp-model precise
29+
FFLAGS := -r8 -i4 -O2 -align all -w -ftz -convert big_endian -assume byterecl -no-vec -mcmodel=medium -xHost -fp-model precise -assume buffered_io -check noarg_temp_created
3030
endif
3131
MOD_SUFFIX := mod
3232
LD := $(FC)

drivers/access/CICE_InitMod.F90

Lines changed: 94 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ module CICE_InitMod
2020
use cpl_parameters
2121
use cpl_forcing_handler
2222
use cpl_interface
23-
!ars599: 27032014: defind my_task
24-
use ice_communicate, only: my_task
23+
use ice_communicate, only: my_task, master_task
2524
#endif
2625

2726
implicit none
@@ -68,9 +67,9 @@ subroutine cice_init
6867
use ice_algae, only: get_forcing_bgc
6968
use ice_calendar, only: dt, dt_dyn, time, istep, istep1, write_ic, &
7069
init_calendar, calendar, idate, month
71-
!ars599: 27032014
7270
use ice_communicate, only: MPI_COMM_ICE
7371
use ice_communicate, only: init_communicate
72+
use ice_coupling, only: top_layer_Tandk_init
7473
use ice_diagnostics, only: init_diags
7574
use ice_domain, only: init_domain_blocks
7675
use ice_dyn_eap, only: init_eap
@@ -89,6 +88,7 @@ subroutine cice_init
8988
use ice_restoring, only: ice_HaloRestore_init
9089
use ice_shortwave, only: init_shortwave
9190
use ice_state, only: tr_aero
91+
use ice_therm_shared, only: calc_Tsfc, heat_capacity
9292
use ice_therm_vertical, only: init_thermo_vertical
9393
use ice_timers, only: timer_total, init_ice_timers, ice_timer_start
9494
use ice_transport_driver, only: init_transport
@@ -100,6 +100,7 @@ subroutine cice_init
100100

101101
#ifdef AusCOM
102102
integer(kind=int_kind) :: idate_save
103+
character (char_len_long) :: filename
103104
#endif
104105

105106
call init_communicate ! initial setup for message passing
@@ -108,13 +109,13 @@ subroutine cice_init
108109
MPI_COMM_ICE = il_commlocal
109110
! call init_cpl ! initialize message passing
110111
call get_cpl_timecontrol
111-
write(il_out,*)' CICE (cice_init) 1 jobnum = ',jobnum
112-
write(il_out,*)' CICE (cice_init) 1 inidate = ',inidate
113-
write(il_out,*)' CICE (cice_init) 1 init_date = ',init_date
114-
write(il_out,*)' CICE (cice_init) 1 runtime0 = ',runtime0
115-
write(il_out,*)' CICE (cice_init) 1 runtime = ',runtime
116-
write(il_out,*)' CICE (cice_init) 1 idate = ',my_task, idate
117-
!write(il_out,*)' CICE (cice_init) 1 runtype = ',runtype
112+
if (my_task == master_task) then
113+
write(il_out,*)' CICE (cice_init) 1 jobnum = ',jobnum
114+
write(il_out,*)' CICE (cice_init) 1 init_date = ',init_date
115+
write(il_out,*)' CICE (cice_init) 1 runtime = ',runtime
116+
write(il_out,*)' CICE (cice_init) 1 idate = ',my_task, idate
117+
!write(il_out,*)' CICE (cice_init) 1 runtype = ',runtype
118+
end if
118119
#endif
119120
call init_fileunits ! unit numbers
120121

@@ -145,7 +146,7 @@ subroutine cice_init
145146
call sst_sss ! POP data for CICE initialization
146147
#endif
147148
call init_thermo_vertical ! initialize vertical thermodynamics
148-
call init_itd ! initialize ice thickness distribution
149+
call init_itd(heat_capacity)! initialize ice thickness distribution
149150
call calendar(time) ! determine the initial date
150151

151152
!ars599: 11042014: remove most of the lines based on cice4.1_fm
@@ -175,14 +176,19 @@ subroutine cice_init
175176
call init_restart ! initialize restart variables
176177

177178
#ifdef AusCOM
178-
write(il_out,*) 'CICE (cice_init) 2 time = ', my_task, time
179-
write(il_out,*) 'CICE (cice_init) 2 runtime0 = ', my_task, runtime0
180-
write(il_out,*) 'CICE (cice_init) 2 idate = ', my_task, idate
179+
if (my_task == master_task) then
180+
write(il_out,*) 'CICE (cice_init) 2 time = ', my_task, time
181+
write(il_out,*) 'CICE (cice_init) 2 runtime0 = ', my_task, runtime0
182+
!write(il_out,*) 'CICE (cice_init) 2 idate = ', my_task, idate
183+
end if
181184

182185
if (jobnum == 1 ) then
183186
time = 0.0 !NOTE, the first job must be set back to 0 and
184187
idate = idate_save !idate back to the 'initial' value, in any case
185-
endif
188+
runtime0 = 0.0
189+
else !BX: 20160720
190+
runtime0 = time ! Record initial time read from init_restart
191+
endif
186192
#endif
187193

188194
call init_diags ! initialize diagnostic output points
@@ -203,10 +209,15 @@ subroutine cice_init
203209
#else
204210
!ars599: 26032014 original code
205211
! call calendar(time) ! at the end of the first timestep
206-
call calendar(time-runtime0)
207-
write(il_out,*) 'CICE (cice_init) 3 time = ', my_task, time
208-
write(il_out,*) 'CICE (cice_init) 3 runtime0 = ', my_task, runtime0
209-
write(il_out,*) 'CICE (cice_init) 3 idate = ', my_task, idate
212+
call calendar(time-runtime0)
213+
if (my_task == master_task) then
214+
write(il_out,*) 'CICE (cice_init) 3 time = ', my_task, time
215+
write(il_out,*) 'CICE (cice_init) 3 runtime0 = ', my_task, runtime0
216+
write(il_out,*) 'CICE (cice_init) 3 iniyear = ', my_task, iniyear
217+
write(il_out,*) 'CICE (cice_init) 3 inimon = ', my_task, inimon
218+
write(il_out,*) 'CICE (cice_init) 3 iniday = ', my_task, iniday
219+
write(il_out,*) 'CICE (cice_init) 3 idate = ', my_task, idate
220+
end if
210221
#endif
211222

212223
!--------------------------------------------------------------------
@@ -234,6 +245,10 @@ subroutine cice_init
234245
call init_flux_ocn ! initialize ocean fluxes sent to coupler
235246
!#endif
236247

248+
if (.not. calc_Tsfc .and. heat_capacity) &
249+
call top_layer_Tandk_init ! initialise top layer temperature and
250+
! effective conductivity
251+
237252
!ars599: 11042014: ice_write_hist is no longer there now change to accum_hist
238253
! so wrapup this line n use the new code
239254
!dhb599 20111128: this call is moved here from 'downstair', because it *re-initilaise*
@@ -249,45 +264,67 @@ subroutine cice_init
249264
! for continue runs, need restart o2i forcing fields and time-averaged ice
250265
! variables ('mice')saved at the end of last run from ice models;
251266
! for initial run, pre-processed o2i (and maybe mice) fields are required.
252-
! call get_restart_o2i('o2i.nc')
253-
call get_restart_o2i(trim(restartdir)//'/o2i.nc')
254-
255-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
256-
!if no lag for ice to atm coupling, then cice has to read restart file i2a.nc and
257-
!put the data to atm. the call is not needed if there is lag for ice2atm coupling
258-
!must call after get_restart_o2i(), by which the ocn_sst ect are read in and re-used by put_restart_i2a()
259-
! call put_restart_i2a('i2a.nc', 0)
260-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
261-
262-
! if ( file_exist('CICE_restart/mice.nc') ) then
263-
if ( file_exist(trim(restartdir)//'/mice.nc') ) then
264-
!for continue runs, mice data MUST be available.
265-
! call get_restart_mice('CICE_restart/mice.nc')
266-
call get_restart_mice(trim(restartdir)//'/mice.nc')
267-
else
268-
write(6,*)'*** CICE WARNING: No initial mice.nc data available here! **'
269-
write(6,*)'*** CICE WARNING: ALL mice variables will be set to ZERO! **'
270-
write(6,*)'*** CICE WARNING: This is allowed for the init run ONLY ! **'
267+
if ( trim(runtype) == 'continue' ) then
268+
write(il_out,*)' calling get_restart_o2i at time_sec = ',0
269+
filename = trim(restartdir)//'/o2i.nc'
270+
if ( file_exist(filename) ) then
271+
call get_restart_o2i(filename)
272+
else
273+
call abort_ice('file NOT found: '//filename //&
274+
" This is allowed for runtype='initial' ONLY")
275+
endif
276+
!if no lag for ice to atm coupling, then cice has to read restart file i2a.nc and
277+
!put the data to atm. the call is not needed if there is lag for ice2atm coupling
278+
!must call after get_restart_o2i(), by which the ocn_sst ect are read in and re-used by put_restart_i2a()
279+
! call put_restart_i2a('i2a.nc', 0)
280+
filename = trim(restartdir)//'/mice.nc'
281+
if ( file_exist(filename) ) then
282+
!for continue runs, mice data MUST be available.
283+
call get_restart_mice(filename)
284+
else
285+
call abort_ice("file NOT found: "//filename//&
286+
" This is allowed for runtype='initial' ONLY")
287+
endif
271288
endif
272289
if (use_core_runoff) then
273-
! call get_core_runoff('CICE_input/core_runoff_regrid.nc',&
274-
call get_core_runoff(trim(inputdir)//'/core_runoff_regrid.nc',&
275-
'runoff',1)
290+
call get_core_runoff(trim(inputdir)//'/core_runoff_regrid.nc',&
291+
'runoff',1)
276292
endif
277293

278-
write(il_out,*)' calling ave_ocn_fields_4_i2a at time_sec = ',0 !time_sec
279-
call time_average_ocn_fields_4_i2a !accumulate/average ocn fields needed for IA coupling
294+
if (my_task == master_task) then
295+
write(il_out,*)' calling ave_ocn_fields_4_i2a time_sec = ',0 !time_sec
296+
endif
297+
call time_average_ocn_fields_4_i2a
298+
!accumulate/average ocn fields needed for IA coupling
280299

281-
!get a2i fields and then set up initial SBC for ice
282-
!call from_atm(0)
283-
!call get_sbc_ice
284-
!now "most of" the IC of this run are 'proper' for "call ice_write_hist"
285300
#endif
286301

287-
!ars599: 11042014: ice_write_hist is no longer there now change to accum_hist
288-
! so wrapup this line n markout
289-
!dhb599: 20111128: the following call is moved 'upstair'
290-
! if (write_ic) call accum_hist(dt) ! write initial conditions
302+
!20171024: read in mask for land ice discharge into ocean off Antarctica and Greenland.
303+
#ifdef ACCESS
304+
!!! options for land ice discharged as iceberg melting around AA and Gnld
305+
! 0: "even" distribution as for u-ar676;
306+
!================== for ESM1.5/1.6, "0" option is NOT used ===============!
307+
! 1: use AC2 data but GC3.1 iceberg climatological pattern, each month takes
308+
! the total discharge as that diagnosed in u-ar676 (yrs2-101);
309+
! 2: use GC3 iceberg climatological pattern, each month enhanced by ac2/gc3
310+
! annual ratio of land ice discharge to make sure the annual total
311+
! discharge is same as case 1;
312+
! 3: as case 1 but use annual mean
313+
! 4: as case 2 but use annual mean
314+
!!! Note 3 and 4 are similar but NOT the same; 1-4 cases should have identical annual
315+
!!! discharge of land ice (as iceberg) into ocean.
316+
317+
filename = trim(inputdir)//'/lice_discharge_iceberg.nc'
318+
if ( file_exist(filename) ) then
319+
call get_lice_discharge(filename)
320+
else
321+
if (my_task == master_task) then
322+
write(6,*)'* CICE stopped -- iceberg datafile missing.*'
323+
endif
324+
call abort_ice ('ice: land ice discharge iceberg datafile missing: '//&
325+
filename //' *')
326+
endif
327+
#endif
291328

292329
end subroutine cice_init
293330

@@ -329,7 +366,12 @@ subroutine init_restart
329366
call restartfile() ! given by pointer in ice_in
330367
!ars599: 11042014: markout call calendar
331368
! according to dhb599 initmod at cice4.1_fm
332-
call calendar(time) ! update time parameters
369+
! TODO: 'time' argument in the calendar call below affects frz_onset output.
370+
! Hardcoding time=0.0 gives the same results as the older CM2 based calendar
371+
! initialisation.
372+
! See https://github.com/ACCESS-NRI/cice5/issues/49
373+
! and https://github.com/ACCESS-NRI/cice5/pull/48 for details.
374+
call calendar(0.0) ! update time parameters
333375
if (kdyn == 2) call read_restart_eap ! EAP
334376
else if (restart) then ! ice_ic = core restart file
335377
call restartfile (ice_ic) ! or 'default' or 'none'

0 commit comments

Comments
 (0)