Skip to content

Commit 4587504

Browse files
authored
Update Machine Ports, Add CPPs NO_CDF2, NO_CDF5 (#956)
These changes are associated with the multi-machine pre-release testing for CICE. Update Hera port, new compiler version Add NO_CDF2, NO_CDF5, and NO_HDF5 CPP options to model to support older/other versions of netcdf. Several machines with only netcdf 4.4 do not support cdf5 format. Sometimes netcdf is not built with hdf5. We need a CPP to avoid that part of the code to allow the model to build on those machines. Set NO_CDF5 for gaffney, koehr, mustang machines Set NO_HDF5 for compy Update documentation
1 parent 969a76d commit 4587504

File tree

13 files changed

+71
-11
lines changed

13 files changed

+71
-11
lines changed

cicecore/cicedyn/infrastructure/io/io_netcdf/ice_history_write.F90

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,26 @@ subroutine ice_write_hist (ns)
152152
if (history_format == 'cdf1') then
153153
iflag = nf90_clobber
154154
elseif (history_format == 'cdf2') then
155+
#ifdef NO_CDF2
156+
call abort_ice(subname//' ERROR: history_format cdf2 not available ', &
157+
file=__FILE__, line=__LINE__)
158+
#else
155159
iflag = ior(nf90_clobber,nf90_64bit_offset)
160+
#endif
156161
elseif (history_format == 'cdf5') then
162+
#ifdef NO_CDF5
163+
call abort_ice(subname//' ERROR: history_format cdf5 not available ', &
164+
file=__FILE__, line=__LINE__)
165+
#else
157166
iflag = ior(nf90_clobber,nf90_64bit_data)
167+
#endif
158168
elseif (history_format == 'hdf5') then
169+
#ifdef NO_HDF5
170+
call abort_ice(subname//' ERROR: history_format hdf5 not available ', &
171+
file=__FILE__, line=__LINE__)
172+
#else
159173
iflag = ior(nf90_clobber,nf90_netcdf4)
174+
#endif
160175
else
161176
call abort_ice(subname//' ERROR: history_format not allowed for '//trim(history_format), &
162177
file=__FILE__, line=__LINE__)
@@ -1192,6 +1207,12 @@ subroutine ice_hist_field_def(ncid, hfield, lprecision, dimids, ns)
11921207
status = nf90_def_var(ncid, hfield%vname, lprecision, dimids, varid)
11931208
call ice_check_nc(status, subname//' ERROR: defining var '//trim(hfield%vname),file=__FILE__,line=__LINE__)
11941209

1210+
#ifdef NO_HDF5
1211+
if (history_format=='hdf5') then
1212+
call abort_ice(subname//' ERROR: history_format hdf5 not available ', &
1213+
file=__FILE__, line=__LINE__)
1214+
endif
1215+
#else
11951216
if (history_format=='hdf5' .and. size(dimids)>1) then
11961217
if (dimids(1)==imtid .and. dimids(2)==jmtid) then
11971218
chunks(1)=history_chunksize(1)
@@ -1208,6 +1229,7 @@ subroutine ice_hist_field_def(ncid, hfield, lprecision, dimids, ns)
12081229
status = nf90_def_var_deflate(ncid, varid, shuffle=0, deflate=1, deflate_level=history_deflate)
12091230
call ice_check_nc(status, subname//' ERROR deflating var '//trim(hfield%vname), file=__FILE__, line=__LINE__)
12101231
endif
1232+
#endif
12111233

12121234
! add attributes
12131235
status = nf90_put_att(ncid,varid,'units', hfield%vunit)
@@ -1335,6 +1357,12 @@ subroutine ice_hist_coord_def(ncid, coord, lprecision, dimids, varid)
13351357
status = nf90_def_var(ncid, coord%short_name, lprecision, dimids, varid)
13361358
call ice_check_nc(status, subname//' ERROR: defining coord '//coord%short_name,file=__FILE__,line=__LINE__)
13371359

1360+
#ifdef NO_HDF5
1361+
if (history_format=='hdf5') then
1362+
call abort_ice(subname//' ERROR: history_format hdf5 not available ', &
1363+
file=__FILE__, line=__LINE__)
1364+
endif
1365+
#else
13381366
if (history_format=='hdf5' .and. size(dimids)>1) then
13391367
if (dimids(1)==imtid .and. dimids(2)==jmtid) then
13401368
chunks(1)=history_chunksize(1)
@@ -1351,6 +1379,7 @@ subroutine ice_hist_coord_def(ncid, coord, lprecision, dimids, varid)
13511379
status=nf90_def_var_deflate(ncid, varid, shuffle=0, deflate=1, deflate_level=history_deflate)
13521380
call ice_check_nc(status, subname//' ERROR deflating var '//trim(coord%short_name), file=__FILE__, line=__LINE__)
13531381
endif
1382+
#endif
13541383

13551384
status = nf90_put_att(ncid,varid,'long_name',trim(coord%long_name))
13561385
call ice_check_nc(status, subname// ' ERROR: defining long_name for '//coord%short_name, &

cicecore/cicedyn/infrastructure/io/io_netcdf/ice_restart.F90

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,26 @@ subroutine init_restart_write(filename_spec)
221221
if (restart_format == 'cdf1') then
222222
iflag = nf90_clobber
223223
elseif (restart_format == 'cdf2') then
224+
#ifdef NO_CDF2
225+
call abort_ice(subname//' ERROR: restart_format cdf2 not available ', &
226+
file=__FILE__, line=__LINE__)
227+
#else
224228
iflag = ior(nf90_clobber,nf90_64bit_offset)
229+
#endif
225230
elseif (restart_format == 'cdf5') then
231+
#ifdef NO_CDF5
232+
call abort_ice(subname//' ERROR: restart_format cdf5 not available ', &
233+
file=__FILE__, line=__LINE__)
234+
#else
226235
iflag = ior(nf90_clobber,nf90_64bit_data)
236+
#endif
227237
elseif (restart_format == 'hdf5') then
238+
#ifdef NO_HDF5
239+
call abort_ice(subname//' ERROR: restart_format hdf5 not available ', &
240+
file=__FILE__, line=__LINE__)
241+
#else
228242
iflag = ior(nf90_clobber,nf90_netcdf4)
243+
#endif
229244
else
230245
call abort_ice(subname//' ERROR: restart_format not allowed for '//trim(restart_format), &
231246
file=__FILE__, line=__LINE__)
@@ -894,6 +909,12 @@ subroutine define_rest_field(ncid, vname, dims)
894909
status = nf90_def_var(ncid,trim(vname),nf90_double,dims,varid)
895910
call ice_check_nc(status, subname//' ERROR: def var '//trim(vname), file=__FILE__, line=__LINE__)
896911

912+
#ifdef NO_HDF5
913+
if (restart_format=='hdf5') then
914+
call abort_ice(subname//' ERROR: restart_format hdf5 not available ', &
915+
file=__FILE__, line=__LINE__)
916+
endif
917+
#else
897918
if (restart_format=='hdf5' .and. size(dims)>1) then
898919
if (dims(1)==dimid_ni .and. dims(2)==dimid_nj) then
899920
chunks(1)=restart_chunksize(1)
@@ -910,6 +931,7 @@ subroutine define_rest_field(ncid, vname, dims)
910931
status=nf90_def_var_deflate(ncid, varid, shuffle=0, deflate=1, deflate_level=restart_deflate)
911932
call ice_check_nc(status, subname//' ERROR deflating var '//trim(vname), file=__FILE__, line=__LINE__)
912933
endif
934+
#endif
913935

914936
#else
915937
call abort_ice(subname//' ERROR: USE_NETCDF cpp not defined', &

configuration/scripts/machines/Macros.compy_intel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#==============================================================================
44

55
CPP := fpp
6-
CPPDEFS := -DFORTRANUNDERSCORE ${ICE_CPPDEFS}
6+
CPPDEFS := -DFORTRANUNDERSCORE -DNO_HDF5 ${ICE_CPPDEFS}
77
CFLAGS := -c -O2 -fp-model precise -xHost
88

99
FIXEDFLAGS := -132

configuration/scripts/machines/Macros.gaffney_gnu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#==============================================================================
44

55
CPP := ftn -E
6-
CPPDEFS := -DFORTRANUNDERSCORE ${ICE_CPPDEFS}
6+
CPPDEFS := -DFORTRANUNDERSCORE -DNO_CDF5 ${ICE_CPPDEFS}
77
CFLAGS := -c
88

99
FIXEDFLAGS := -ffixed-line-length-132

configuration/scripts/machines/Macros.gaffney_intel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#==============================================================================
44

55
CPP := fpp
6-
CPPDEFS := -DFORTRANUNDERSCORE ${ICE_CPPDEFS}
6+
CPPDEFS := -DFORTRANUNDERSCORE -DNO_CDF5 ${ICE_CPPDEFS}
77
CFLAGS := -c -O2 -fp-model precise -xHost
88

99
FIXEDFLAGS := -132

configuration/scripts/machines/Macros.koehr_intel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#==============================================================================
44

55
CPP := fpp
6-
CPPDEFS := -DFORTRANUNDERSCORE ${ICE_CPPDEFS}
6+
CPPDEFS := -DFORTRANUNDERSCORE -DNO_CDF5 ${ICE_CPPDEFS}
77
CFLAGS := -c -O2 -fp-model precise -xHost
88

99
FIXEDFLAGS := -132

configuration/scripts/machines/Macros.mustang_intel18

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#==============================================================================
44

55
CPP := fpp
6-
CPPDEFS := -DFORTRANUNDERSCORE ${ICE_CPPDEFS}
6+
CPPDEFS := -DFORTRANUNDERSCORE -DNO_CDF5 ${ICE_CPPDEFS}
77
CFLAGS := -c -O2 -fp-model precise -xHost
88

99
FIXEDFLAGS := -132

configuration/scripts/machines/Macros.mustang_intel19

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#==============================================================================
44

55
CPP := fpp
6-
CPPDEFS := -DFORTRANUNDERSCORE ${ICE_CPPDEFS}
6+
CPPDEFS := -DFORTRANUNDERSCORE -DNO_CDF5 ${ICE_CPPDEFS}
77
CFLAGS := -c -O2 -fp-model precise -xHost
88

99
FIXEDFLAGS := -132

configuration/scripts/machines/Macros.mustang_intel20

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#==============================================================================
44

55
CPP := fpp
6-
CPPDEFS := -DFORTRANUNDERSCORE ${ICE_CPPDEFS}
6+
CPPDEFS := -DFORTRANUNDERSCORE -DNO_CDF5 ${ICE_CPPDEFS}
77
CFLAGS := -c -O2 -fp-model precise -xHost
88

99
FIXEDFLAGS := -132

configuration/scripts/machines/env.hera_intel

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ if ("$inp" != "-nomodules") then
1010
source /etc/profile.d/modules.csh
1111
#module list
1212
module purge
13-
module load intel/18.0.5.274
14-
module load impi/2018.0.4
13+
module load gnu/13.2.0
14+
module load intel/2023.2.0
15+
module load impi/2023.2.0
1516
module load netcdf/4.7.0
1617
#module list
1718

@@ -23,7 +24,7 @@ setenv OMP_STACKSIZE 64M
2324
setenv ICE_MACHINE_MACHNAME hera
2425
setenv ICE_MACHINE_MACHINFO "Cray CS500 Intel SkyLake 2.4GHz, Infiniband HDR"
2526
setenv ICE_MACHINE_ENVNAME intel
26-
setenv ICE_MACHINE_ENVINFO "ifort 18.0.5 20180823, intelmpi/2018.0.4, netcdf/4.7.0"
27+
setenv ICE_MACHINE_ENVINFO "icc/ifort 2021.10.0 20230609, intelmpi/2023.2.0, netcdf/4.7.0"
2728
setenv ICE_MACHINE_MAKE gmake
2829
setenv ICE_MACHINE_WKDIR $HOME/scratch/CICE_RUNS
2930
setenv ICE_MACHINE_INPUTDATA /home/Anthony.Craig/scratch/CICE_INPUTDATA

0 commit comments

Comments
 (0)