Skip to content

Commit

Permalink
Merge 'CICE-Consortium/main' into EMC/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
NickSzapiro-NOAA committed Jan 23, 2025
2 parents ff7fd76 + bfac934 commit ea4582b
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 60 deletions.
2 changes: 1 addition & 1 deletion cice.setup
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ cp ${rundir}/compile/*.{gcno,gcda} ${testname_base}/codecov_output/
EOF
cat >> ${tsdir}/report_lcov.csh << EOF
lcov --gcov-tool gcov -c -d ${rundir}/compile -o ${testname_base}/lcov.info
lcov --gcov-tool gcov -c --rc geninfo_unexecuted_blocks=1 -d ${rundir}/compile -o ${testname_base}/lcov.info
if (-s ${testname_base}/lcov.info) then
set lcovalist = "\${lcovalist} -a ${testname_base}/lcov.info"
endif
Expand Down
7 changes: 5 additions & 2 deletions cicecore/cicedyn/general/ice_flux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1209,15 +1209,15 @@ subroutine scale_fluxes (nx_block, ny_block, &
real (kind=dbl_kind) :: &
ar, & ! 1/aice
stefan_boltzmann, &
Tffresh
Tffresh, puny

integer (kind=int_kind) :: &
i, j ! horizontal indices

character(len=*), parameter :: subname = '(scale_fluxes)'

call icepack_query_parameters(stefan_boltzmann_out=stefan_boltzmann, &
Tffresh_out=Tffresh)
Tffresh_out=Tffresh, puny_out=puny)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call abort_ice(error_message=subname, &
file=__FILE__, line=__LINE__)
Expand All @@ -1231,6 +1231,9 @@ subroutine scale_fluxes (nx_block, ny_block, &
fsens (i,j) = fsens (i,j) * ar
flat (i,j) = flat (i,j) * ar
fswabs (i,j) = fswabs (i,j) * ar
! Special case where aice_init was zero and aice > 0.
if (flwout(i,j) > -puny) &
flwout (i,j) = -stefan_boltzmann *(Tf(i,j) + Tffresh)**4
flwout (i,j) = flwout (i,j) * ar
evap (i,j) = evap (i,j) * ar
Tref (i,j) = Tref (i,j) * ar
Expand Down
2 changes: 1 addition & 1 deletion cicecore/cicedyn/general/ice_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ subroutine input_data
endif
abort_list = trim(abort_list)//":1"
endif

if (history_format /= 'cdf1' .and. &
history_format /= 'cdf2' .and. &
history_format /= 'cdf5' .and. &
Expand Down
20 changes: 10 additions & 10 deletions cicecore/cicedyn/infrastructure/ice_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -351,20 +351,20 @@ subroutine init_grid1
trim(grid_type) == 'regional' ) then

if (trim(grid_format) == 'nc') then

fieldname='ulat'
call ice_open_nc(grid_file,fid_grid)
call ice_read_global_nc(fid_grid,1,fieldname,work_g1,.true.)
call ice_close_nc(fid_grid)

! mask variable name might be kmt or mask, check both
call ice_open_nc(kmt_file,fid_kmt)
#ifdef USE_NETCDF
if ( my_task==master_task ) then
status = nf90_inq_varid(fid_kmt, 'kmt', varid)
if (status == nf90_noerr) then
mask_fieldname = 'kmt'
else
else
status = nf90_inq_varid(fid_kmt, 'mask', varid)
call ice_check_nc(status, subname//' ERROR: does '//trim(kmt_file)//&
' contain "kmt" or "mask" variable?', file=__FILE__, line=__LINE__)
Expand Down Expand Up @@ -671,7 +671,7 @@ subroutine init_grid2
enddo
enddo
!$OMP END PARALLEL DO
endif
endif

if (trim(grid_type) == 'regional' .and. &
(.not. (l_readCenter))) then
Expand Down Expand Up @@ -799,7 +799,7 @@ subroutine kmtmask
enddo
enddo
!$OMP END PARALLEL DO

if (my_task == master_task) then
close (nu_kmt)
endif
Expand Down Expand Up @@ -888,14 +888,14 @@ subroutine kmtmask_nc
i, j, iblk, &
ilo,ihi,jlo,jhi, & ! beginning and end of physical domain
fid_kmt ! file id for netCDF kmt file

logical (kind=log_kind) :: diag

real (kind=dbl_kind), dimension (nx_block,ny_block,max_blocks) :: &
work1

type (block) :: &
this_block ! block information for current block
this_block ! block information for current block

character(len=*), parameter :: subname = '(kmtmask_nc)'

Expand All @@ -905,7 +905,7 @@ subroutine kmtmask_nc
kmt(:,:,:) = c0

call ice_open_nc(kmt_file,fid_kmt)

call ice_read_nc(fid_kmt,1,mask_fieldname,kmt,diag, &
field_loc=field_loc_center, &
field_type=field_type_scalar)
Expand Down Expand Up @@ -968,7 +968,7 @@ subroutine popgrid_nc
work_g1

integer(kind=int_kind) :: &
varid, status
varid, status

character(len=*), parameter :: subname = '(popgrid_nc)'

Expand All @@ -981,7 +981,7 @@ subroutine popgrid_nc
call ice_open_nc(grid_file,fid_grid)

diag = .true. ! write diagnostic info

!-----------------------------------------------------------------
! lat, lon, angle
!-----------------------------------------------------------------
Expand Down
6 changes: 5 additions & 1 deletion cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,9 @@ subroutine ModelAdvance(gcomp, rc)
character(char_len_long) :: restart_date
character(char_len_long) :: restart_filename
logical :: isPresent, isSet
#ifndef CESMCOUPLED
logical :: write_restartfh
#endif
character(len=*),parameter :: subname=trim(modName)//':(ModelAdvance) '
character(char_len_long) :: msgString
!--------------------------------
Expand Down Expand Up @@ -1301,10 +1303,12 @@ subroutine ModelSetRunClock(gcomp, rc)
character(len=256) :: stop_option ! Stop option units
integer :: stop_n ! Number until stop interval
integer :: stop_ymd ! Stop date (YYYYMMDD)
integer :: dtime
type(ESMF_ALARM) :: stop_alarm
character(len=128) :: name
integer :: alarmcount
#ifndef CESMCOUPLED
integer :: dtime
#endif
character(len=*),parameter :: subname=trim(modName)//':(ModelSetRunClock) '
!--------------------------------

Expand Down
4 changes: 2 additions & 2 deletions cicecore/drivers/nuopc/cmeps/ice_prescribed_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module ice_prescribed_mod
! prescribed. Air/ice fluxes are computed to get surface temperature,
! Ice/ocean fluxes are set to zero, and ice dynamics are not calculated.
! Regridding and data cycling capabilities are included.

! Note (8/8/2024): This code is dependent on CDEPS (to input ice data).
! In the interests of cleaner code, drivers/nuopc/cmeps now is too.
! If problematic, please see https://github.com/CICE-Consortium/CICE/pull/964 for alternatives.
Expand Down Expand Up @@ -215,7 +215,7 @@ subroutine ice_prescribed_init(gcomp, clock, mesh, rc)
! If need initial cice values for coupling
call ice_prescribed_run(idate, msec)
#endif

end if ! end of if prescribed ice mode

end subroutine ice_prescribed_init
Expand Down
2 changes: 1 addition & 1 deletion cicecore/drivers/nuopc/cmeps/ice_shr_methods.F90
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ subroutine alarmInit( clock, alarm, option, &
if (chkerr(rc,__LINE__,u_FILE_u)) return
call ESMF_ClockGetAlarm(clock, alarmname="alarm_stop", alarm=alarm, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call ESMF_AlarmGet(alarm, ringTime=NextAlarm, rc=rc)
call ESMF_AlarmGet(alarm, ringTime=NextAlarm, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

case default
Expand Down
16 changes: 6 additions & 10 deletions configuration/scripts/machines/Macros.derecho_gnu
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,16 @@ FREEFLAGS := -ffree-form
FFLAGS := -fconvert=big-endian -fbacktrace -ffree-line-length-none -fallow-argument-mismatch
FFLAGS_NOOPT:= -O0

ifeq ($(ICE_BLDDEBUG), true)
FFLAGS += -O0 -g -fcheck=bounds -finit-real=nan -fimplicit-none -ffpe-trap=invalid,zero,overflow --std f2008
# FFLAGS += -O0 -g -fcheck=all -finit-real=snan -fimplicit-none -ffpe-trap=invalid,zero,overflow
CFLAGS += -O0
endif

ifeq ($(ICE_COVERAGE), true)
FFLAGS += -O0 -g -fprofile-arcs -ftest-coverage
CFLAGS += -O0 -g -coverage
LDFLAGS += -g -ftest-coverage -fprofile-arcs
endif

ifneq ($(ICE_BLDDEBUG), true)
ifneq ($(ICE_COVERAGE), true)
else
ifeq ($(ICE_BLDDEBUG), true)
FFLAGS += -O0 -g -fcheck=bounds -finit-real=nan -fimplicit-none -ffpe-trap=invalid,zero,overflow --std f2008
# FFLAGS += -O0 -g -fcheck=all -finit-real=snan -fimplicit-none -ffpe-trap=invalid,zero,overflow
CFLAGS += -O0
else
FFLAGS += -O2
CFLAGS += -O2
endif
Expand Down
20 changes: 10 additions & 10 deletions configuration/scripts/machines/env.derecho_gnu
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ if ("$inp" != "-nomodules") then
source ${MODULESHOME}/init/csh

module --force purge
module load ncarenv/23.06
module load ncarenv/24.12
module reset
module load craype
module load gcc/12.2.0
module load gcc/12.4.0
module load ncarcompilers
module load cray-mpich/8.1.25
module load cray-mpich/8.1.29
module load netcdf/4.9.2
#module load hdf5/1.12.2
#module load netcdf-mpi/4.9.2

module load cray-libsci/23.02.1.1
module load cray-libsci/24.03.0

if ($?ICE_IOTYPE) then
if ($ICE_IOTYPE =~ pio*) then
module unload netcdf
module load netcdf-mpi/4.9.2
module load parallel-netcdf/1.12.3
module load parallel-netcdf/1.14.0
if ($ICE_IOTYPE == "pio1") then
module load parallelio/1.10.1
else
module load parallelio/2.6.2
module load parallelio/2.6.3
endif
endif
endif

module load lcov

if ($?ICE_BFBTYPE) then
if ($ICE_BFBTYPE =~ qcchk*) then
module load conda
Expand Down Expand Up @@ -61,7 +61,7 @@ setenv OMP_STACKSIZE 64M
setenv ICE_MACHINE_MACHNAME derecho
setenv ICE_MACHINE_MACHINFO "HPE Cray EX Milan Slingshot 11"
setenv ICE_MACHINE_ENVNAME gnu
setenv ICE_MACHINE_ENVINFO "gcc 12.2.0 20220819, cray-mpich 8.1.25, netcdf4.9.2, pnetcdf1.12.3, pio1.10.1, pio2.6.2"
setenv ICE_MACHINE_ENVINFO "gcc 12.4.0, cray-mpich 8.1.29, netcdf4.9.2, pnetcdf1.14.0, pio1.10.1, pio2.6.3"
setenv ICE_MACHINE_MAKE gmake
setenv ICE_MACHINE_WKDIR /glade/derecho/scratch/$user/CICE_RUNS
setenv ICE_MACHINE_INPUTDATA /glade/campaign/cesm/development/pcwg
Expand Down
12 changes: 6 additions & 6 deletions configuration/scripts/machines/env.perlmutter_cray
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ source ${MODULESHOME}/init/csh
module load cpu
module load PrgEnv-cray
module unload cce
module load cce/15.0.1
module load cce/17.0.0
module unload cray-mpich
module load cray-mpich/8.1.25
module load cray-mpich/8.1.28

module unload cray-netcdf
module unload cray-hdf5
module load cray-hdf5/1.12.2.3
module load cray-netcdf/4.9.0.3
module load cray-hdf5/1.12.2.9
module load cray-netcdf/4.9.0.9

setenv NETCDF_PATH ${NETCDF_DIR}
#setenv NETCDF_PATH ${NETCDF_DIR}
limit coredumpsize unlimited
limit stacksize unlimited
setenv OMP_STACKSIZE 128M
Expand All @@ -38,7 +38,7 @@ endif
setenv ICE_MACHINE_MACHNAME perlmutter
setenv ICE_MACHINE_MACHINFO "HPE Cray EX AMD EPYC 7763 Milan, Slingshot-11 Interconnect"
setenv ICE_MACHINE_ENVNAME cray
setenv ICE_MACHINE_ENVINFO "Cray clang/Fortran 15.0.1, cray-mpich/8.1.25, netcdf/4.9.0.3"
setenv ICE_MACHINE_ENVINFO "Cray clang/Fortran 17.0.0, cray-mpich/8.1.28, netcdf/4.9.0.9"
setenv ICE_MACHINE_MAKE gmake
setenv ICE_MACHINE_WKDIR $SCRATCH/CICE_RUNS
setenv ICE_MACHINE_INPUTDATA /global/cfs/cdirs/e3sm/tcraig/cice-consortium
Expand Down
16 changes: 9 additions & 7 deletions configuration/scripts/machines/env.perlmutter_gnu
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,21 @@ source ${MODULESHOME}/init/csh
#module unload PrgEnv-intel
#module unload PrgEnv-nvidia
#module unload gpu
module unload darshan
module load cpu
module load PrgEnv-gnu
module load PrgEnv-gnu/8.5.0
module unload gcc
module load gcc/11.2.0
module unload gcc-native
module load gcc-native/12.3
module unload cray-mpich
module load cray-mpich/8.1.25
module load cray-mpich/8.1.28

module unload cray-netcdf
module unload cray-hdf5
module load cray-hdf5/1.12.2.3
module load cray-netcdf/4.9.0.3
module load cray-hdf5/1.12.2.9
module load cray-netcdf/4.9.0.9

setenv NETCDF_PATH ${NETCDF_DIR}
#setenv NETCDF_PATH ${NETCDF_DIR}
limit coredumpsize unlimited
limit stacksize unlimited
setenv OMP_STACKSIZE 128M
Expand All @@ -38,7 +40,7 @@ endif
setenv ICE_MACHINE_MACHNAME perlmutter
setenv ICE_MACHINE_MACHINFO "HPE Cray EX AMD EPYC 7763 Milan, Slingshot-11 Interconnect"
setenv ICE_MACHINE_ENVNAME gnu
setenv ICE_MACHINE_ENVINFO "gnu c/fortran 11.2.0 20210728, cray-mpich/8.1.25, netcdf/4.9.0.3"
setenv ICE_MACHINE_ENVINFO "gnu c/fortran 12.3.0, cray-mpich/8.1.28, netcdf/4.9.0.9"
setenv ICE_MACHINE_MAKE gmake
setenv ICE_MACHINE_WKDIR $SCRATCH/CICE_RUNS
setenv ICE_MACHINE_INPUTDATA /global/cfs/cdirs/e3sm/tcraig/cice-consortium
Expand Down
14 changes: 7 additions & 7 deletions configuration/scripts/machines/env.perlmutter_intel
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ source ${MODULESHOME}/init/csh
#module unload PrgEnv-nvidia
#module unload gpu
module load cpu
module load PrgEnv-intel
module load PrgEnv-intel/8.5.0
module unload intel
module load intel/2023.1.0
module load intel/2023.2.0
module unload cray-mpich
module load cray-mpich/8.1.25
module load cray-mpich/8.1.28

module unload cray-netcdf
module unload cray-hdf5
module load cray-hdf5/1.12.2.3
module load cray-netcdf/4.9.0.3
module load cray-hdf5/1.12.2.9
module load cray-netcdf/4.9.0.9

setenv NETCDF_PATH ${NETCDF_DIR}
#setenv NETCDF_PATH ${NETCDF_DIR}
limit coredumpsize unlimited
limit stacksize unlimited
setenv OMP_STACKSIZE 128M
Expand All @@ -38,7 +38,7 @@ endif
setenv ICE_MACHINE_MACHNAME perlmutter
setenv ICE_MACHINE_MACHINFO "HPE Cray EX AMD EPYC 7763 Milan, Slingshot-11 Interconnect"
setenv ICE_MACHINE_ENVNAME intel
setenv ICE_MACHINE_ENVINFO "ifort 2021.9.0 20230302, Intel oneAPI DPC++/C++ 2023.1.0 (2023.1.0.20230320), cray-mpich/8.1.25, netcdf/4.9.0.3"
setenv ICE_MACHINE_ENVINFO "ifort 2021.10.0 20230609, Intel oneAPI DPC++/C++ Compiler 2023.2.0 (2023.2.0.20230622)), cray-mpich/8.1.28, netcdf/4.9.0.9"
setenv ICE_MACHINE_MAKE gmake
setenv ICE_MACHINE_WKDIR $SCRATCH/CICE_RUNS
setenv ICE_MACHINE_INPUTDATA /global/cfs/cdirs/e3sm/tcraig/cice-consortium
Expand Down
2 changes: 1 addition & 1 deletion configuration/scripts/tests/cice.lcov.csh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cp -p -r ${lcovhtmldir} ${lcovrepo}/

cd ${lcovrepo}
set covp0 = `grep message coverage.json | cut -d : -f 2 | cut -d \" -f 2 | cut -d % -f 1`
set covp = `grep -i headerCovTableEntry ${lcovhtmldir}/index.html | grep % | head -1 | cut -d \> -f 2 | cut -d % -f 1`
set covp = `grep -i headerCovTableEntry ${lcovhtmldir}/index.html | grep % | head -1 | cut -d \> -f 2 | cut -d \& -f 1`
set covpi = `echo $covp | cut -d . -f 1`

set lcovhtmlname = "${covpi}%:${report_name}"
Expand Down

0 comments on commit ea4582b

Please sign in to comment.