Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to advanced snow physics implementation #852

Merged
merged 2 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cicecore/cicedyn/general/ice_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ subroutine input_data
abort_list = trim(abort_list)//":8"
endif

if (snwredist(1:4) /= 'none' .and. .not. tr_snow) then
if (snwredist(1:3) == 'ITD' .and. .not. tr_snow) then
if (my_task == master_task) then
write (nu_diag,*) 'ERROR: snwredist on but tr_snow=F'
write (nu_diag,*) 'ERROR: Use tr_snow=T for snow redistribution'
Expand Down
15 changes: 7 additions & 8 deletions cicecore/cicedyn/general/ice_step_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ subroutine step_therm1 (dt, iblk)

logical (kind=log_kind) :: &
tr_iage, tr_FY, tr_iso, tr_aero, tr_pond, &
tr_pond_lvl, tr_pond_topo, calc_Tsfc, highfreq, tr_snow
tr_pond_lvl, tr_pond_topo, calc_Tsfc, snwgrain

real (kind=dbl_kind) :: &
puny ! a very small number
Expand All @@ -296,13 +296,12 @@ subroutine step_therm1 (dt, iblk)

call icepack_query_parameters(puny_out=puny)
call icepack_query_parameters(calc_Tsfc_out=calc_Tsfc)
call icepack_query_parameters(highfreq_out=highfreq)
call icepack_query_parameters(snwgrain_out=snwgrain)
call icepack_query_tracer_sizes(ntrcr_out=ntrcr)
call icepack_query_tracer_flags( &
tr_iage_out=tr_iage, tr_FY_out=tr_FY, tr_iso_out=tr_iso, &
tr_aero_out=tr_aero, tr_pond_out=tr_pond, &
tr_pond_lvl_out=tr_pond_lvl, tr_pond_topo_out=tr_pond_topo, &
tr_snow_out=tr_snow)
tr_pond_lvl_out=tr_pond_lvl, tr_pond_topo_out=tr_pond_topo)
call icepack_query_tracer_indices( &
nt_apnd_out=nt_apnd, nt_hpnd_out=nt_hpnd, nt_ipnd_out=nt_ipnd, &
nt_alvl_out=nt_alvl, nt_vlvl_out=nt_vlvl, nt_Tsfc_out=nt_Tsfc, &
Expand Down Expand Up @@ -357,15 +356,15 @@ subroutine step_therm1 (dt, iblk)
do j = jlo, jhi
do i = ilo, ihi

if (tr_snow) then
if (snwgrain) then
do n = 1, ncat
do k = 1, nslyr
rsnwn (k,n) = trcrn(i,j,nt_rsnw +k-1,n,iblk)
smicen(k,n) = trcrn(i,j,nt_smice+k-1,n,iblk)
smliqn(k,n) = trcrn(i,j,nt_smliq+k-1,n,iblk)
enddo
enddo
endif ! tr_snow
endif ! snwgrain

if (tr_iso) then ! trcrn(nt_iso*) has units kg/m^3
do n=1,ncat
Expand Down Expand Up @@ -556,15 +555,15 @@ subroutine step_therm1 (dt, iblk)

endif

if (tr_snow) then
if (snwgrain) then
do n = 1, ncat
do k = 1, nslyr
trcrn(i,j,nt_rsnw +k-1,n,iblk) = rsnwn (k,n)
trcrn(i,j,nt_smice+k-1,n,iblk) = smicen(k,n)
trcrn(i,j,nt_smliq+k-1,n,iblk) = smliqn(k,n)
enddo
enddo
endif ! tr_snow
endif ! snwgrain

if (tr_iso) then
do n = 1, ncat
Expand Down
1 change: 1 addition & 0 deletions cicecore/cicedyn/infrastructure/ice_read_write.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,7 @@ subroutine ice_read_nc_xy(fid, nrec, varname, work, diag, &
if (orca_halogrid .and. .not. present(restart_ext)) deallocate(work_g2)

#else
work = c0 ! to satisfy intent(out) attribute
call abort_ice(subname//' ERROR: USE_NETCDF cpp not defined', &
file=__FILE__, line=__LINE__)
#endif
Expand Down
6 changes: 4 additions & 2 deletions configuration/scripts/cice.batch.csh
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ cat >> ${jobfile} <<EOFB
###SBATCH --mail-user [email protected]
EOFB

else if (${ICE_MACHINE} =~ badger*) then
else if (${ICE_MACHINE} =~ chicoma*) then
cat >> ${jobfile} << EOFB
#SBATCH -J ${ICE_CASENAME}
#SBATCH -t ${batchtime}
Expand All @@ -194,7 +194,9 @@ cat >> ${jobfile} << EOFB
#SBATCH -o slurm%j.out
###SBATCH --mail-type END,FAIL
###SBATCH [email protected]
#SBATCH --qos=standby
##SBATCH --qos=debug
#SBATCH --qos=standard
##SBATCH --qos=standby
EOFB

else if (${ICE_MACHINE} =~ fram*) then
Expand Down
4 changes: 2 additions & 2 deletions configuration/scripts/cice.launch.csh
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ EOFR
endif

#=======
else if (${ICE_MACHCOMP} =~ badger*) then
else if (${ICE_MACHCOMP} =~ chicoma*) then
if (${ICE_COMMDIR} =~ serial*) then
cat >> ${jobfile} << EOFR
./cice >&! \$ICE_RUNLOG_FILE
EOFR
else
cat >> ${jobfile} << EOFR
mpirun -np ${ntasks} ./cice >&! \$ICE_RUNLOG_FILE
srun -n ${ntasks} -c ${nthrds} ./cice >&! \$ICE_RUNLOG_FILE
EOFR
endif

Expand Down
56 changes: 0 additions & 56 deletions configuration/scripts/machines/Macros.badger_intel

This file was deleted.

58 changes: 58 additions & 0 deletions configuration/scripts/machines/Macros.chicoma_intel
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#==============================================================================
# Macros file for LANL chicoma, intel compiler
#==============================================================================

CPP := fpp
CPPDEFS := -DFORTRANUNDERSCORE ${ICE_CPPDEFS}
CFLAGS := -c -O2 -fp-model precise -fcommon

FIXEDFLAGS := -132
FREEFLAGS := -FR
FFLAGS := -fp-model precise -convert big_endian -assume byterecl -ftz -traceback
# -mcmodel medium -shared-intel
FFLAGS_NOOPT:= -O0

ifeq ($(ICE_BLDDEBUG), true)
FFLAGS += -O0 -g -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created
# FFLAGS += -O0 -g -check all -fpe0 -ftrapuv -fp-model except -check noarg_temp_created -init=snan,arrays
else
FFLAGS += -O2
endif

SCC := cc
SFC := ftn
MPICC := cc
MPIFC := ftn

ifeq ($(ICE_COMMDIR), mpi)
FC := $(MPIFC)
CC := $(MPICC)
else
FC := $(SFC)
CC := $(SCC)
endif
LD:= $(FC)

# defined by module
#NETCDF_PATH := $(NETCDF_DIR)
NETCDF_PATH := /opt/cray/pe/netcdf-hdf5parallel/4.9.0.1/intel/19.0/
#PNETCDF_PATH := $(PNETCDF)
#PNETCDF_PATH := /glade/apps/opt/pnetcdf/1.3.0/intel/default
#LAPACK_LIBDIR := /glade/apps/opt/lapack/3.4.2/intel/12.1.5/lib

#PIO_CONFIG_OPTS:= --enable-filesystem-hints=gpfs

#INCLDIR := $(INCLDIR)
INCLDIR += -I$(NETCDF_PATH)/include

LIB_NETCDF := $(NETCDF_PATH)/lib
#LIB_PNETCDF := $(PNETCDF_PATH)/lib
#LIB_MPI := $(IMPILIBDIR)
SLIBS := -L$(LIB_NETCDF) -lnetcdf -lnetcdff

ifeq ($(ICE_THREADED), true)
LDFLAGS += -qopenmp
CFLAGS += -qopenmp
FFLAGS += -qopenmp
endif

47 changes: 0 additions & 47 deletions configuration/scripts/machines/env.badger_intel

This file was deleted.

71 changes: 71 additions & 0 deletions configuration/scripts/machines/env.chicoma_intel
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/bin/csh -f

# this works (current defaults with PrgEnv-intel)
#Currently Loaded Modules:
# 1) craype-x86-rome 7) python/3.10-anaconda-2023.03 13) cray-mpich/8.1.21
# 2) libfabric/1.15.0.0 8) craype/2.7.19 14) totalview/2023.1.6
# 3) craype-network-ofi 9) cray-dsmml/0.2.2 15) use.own
# 4) perftools-base/22.09.0 10) cray-libsci/22.11.1.2 16) idl/8.5
# 5) xpmem/2.4.4-2.3_13.8__gff0e1d9.shasta 11) PrgEnv-intel/8.3.3 17) cray-hdf5-parallel/1.12.2.1
# 6) git/2.40.0 12) intel/2022.2.1 18) cray-netcdf-hdf5parallel/4.9.0.1

set inp = "undefined"
if ($#argv == 1) then
set inp = $1
endif

if ("$inp" != "-nomodules") then

#source /opt/modules/default/init/csh

#module unload PrgEnv-cray
#module unload PrgEnv-gnu
#module unload PrgEnv-intel
#module unload PrgEnv-pgi
#module load PrgEnv-intel/8.3.3

#module unload intel
#module load intel/2022.2.1

#module unload cray-mpich
#module unload cray-mpich2
#module load cray-mpich/8.1.21

#module unload netcdf
#module unload cray-netcdf
#module unload cray-hdf5
#module unload cray-hdf5-parallel
#module unload cray-netcdf-hdf5parallel
#module unload cray-parallel-netcdf
#module load cray-hdf5/1.12.2.1
#module load cray-netcdf/4.9.0.1
#module load cray-hdf5-parallel/1.12.2.1
#module load cray-netcdf-hdf5parallel/4.9.0.1

#module unload cray-libsci
#module unload craype-hugepages2M
#module load craype-broadwell

#setenv NETCDF_PATH ${NETCDF_DIR}
#setenv NETCDF_PATH /opt/cray/pe/netcdf/4.9.0.1/intel/19.0
#setenv NETCDF_PATH /opt/cray/pe/netcdf-hdf5parallel/4.9.0.1/intel/19.0
limit coredumpsize unlimited
limit stacksize unlimited
setenv OMP_STACKSIZE 64M

endif

setenv ICE_MACHINE_MACHNAME chicoma
setenv ICE_MACHINE_MACHINFO "HPE Cray EX, AMD EPYC 7H12 processors"
setenv ICE_MACHINE_ENVNAME intel
setenv ICE_MACHINE_ENVINFO "PrgEnv-intel/8.3.3 intel/2022.2.1 cray-mpich/8.1.21 cray-hdf4-parallel/1/12.2.1 cray-netcdf-hdf5parallel/4.9.0.1"
setenv ICE_MACHINE_MAKE gmake
setenv ICE_MACHINE_WKDIR /lustre/scratch5/$user/CICE_RUNS
setenv ICE_MACHINE_INPUTDATA /usr/projects/climate/eclare/DATA/Consortium
setenv ICE_MACHINE_BASELINE /lustre/scratch5/$user/CICE_BASELINE
setenv ICE_MACHINE_SUBMIT "sbatch "
setenv ICE_MACHINE_ACCT t23_cice
setenv ICE_MACHINE_QUEUE "debug"
setenv ICE_MACHINE_TPNODE 128 # tasks per node
setenv ICE_MACHINE_BLDTHRDS 12
setenv ICE_MACHINE_QSTAT "squeue --jobs="
Loading