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

Ayumi Fujisaki's implementation of NEMS CICE #80

Draft
wants to merge 4 commits into
base: master-deprecated
Choose a base branch
from
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion ADCIRC
82 changes: 82 additions & 0 deletions CICE/Macros.rhino_intel
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#==============================================================================
# Makefile macros for generic test machine, intel compiler
#==============================================================================

CPP := fpp
CPPDEFS := -DFORTRANUNDERSCORE -DNO_R16 -DHAVE_F2008_CONTIGUOUS -DLINUX -DCPRINTEL ${ICE_CPPDEFS}
#CFLAGS := -c -g -traceback -check bounds -fp-model precise
CFLAGS := -c -O3 -fp-model precise
#CFLAGS := -c -O3 -fp-model precise -xHost

FIXEDFLAGS := -132
FREEFLAGS := -FR
#FFLAGS := -g -traceback -check bounds -fp-model precise -assume byterecl -ftz
FFLAGS := -fp-model precise -convert big_endian -assume byterecl -ftz -traceback
#FFLAGS := -fp-model precise -convert big_endian -assume byterecl -ftz -traceback -xHost
FFLAGS_NOOPT:= -O0

ifeq ($(ICE_BLDDEBUG), true)
FFLAGS += -O0 -g -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created
else
FFLAGS += -O3
endif

ifeq ($(ICE_COMMDIR), mpi)
FC := mpif90
else
FC := ifort
endif

MPICC:= mpicc

MPIFC:= mpif90
LD:= $(MPIFC)

LDFLAGS +=-L/mnt/projects/hpc/fujisaki/local/gptl/lib
INCLDIR +=-I/mnt/projects/hpc/fujisaki/local/gptl/include

NETCDF :=/mnt/projects/hpc/fujisaki/local/netcdf/
NETCDF_PATH := $(NETCDF)
#NETCDF_PATH := /mnt/projects/hpc/fujisaki/fvcom/codes/FVCOM4.3.1_icealbedo/FVCOM_source/libs/install/

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

PNETCDF := /mnt/projects/hpc/fujisaki/local/pnetcdf/
PNETCDF_PATH := $(PNETCDF)
#PNETCDF_PATH := /glade/u/apps/ch/opt/pio/2.2/mpt/2.15f/intel/17.0.1/lib

#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 -L$(LIB_PNETCDF) -lpnetcdf -lgptl

SCC:= icc

SFC:= ifort

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

ifeq ($(DITTO), yes)
CPPDEFS := $(CPPDEFS) -DREPRODUCIBLE
endif

### if using parallel I/O, load all 3 libraries. PIO must be first!
ifeq ($(IO_TYPE), pio)
PIO_PATH:=/glade/u/apps/ch/opt/pio/2.2/mpt/2.15f/intel/17.0.1/lib
INCLDIR += -I/glade/u/apps/ch/opt/pio/2.2/mpt/2.15f/intel/17.0.1/include
SLIBS := $(SLIBS) -L$(PIO_PATH) -lpiof

CPPDEFS := $(CPPDEFS) -Dncdf
endif

ifeq ($(IO_TYPE), netcdf)
CPPDEFS := $(CPPDEFS) -Dncdf
endif
168 changes: 168 additions & 0 deletions CICE/cice.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
#! /bin/csh -f

#====================================
# If the cice binary is passed as an argument and the file exists,
# copy it into the run directory and don't build the model.

set ciceexe = "UnDEFineD"
if ($#argv == 1) then
set ciceexe = $1
echo "${0}: ciceexe = ${ciceexe}"
if (-e ${ciceexe}) then

source ./cice.settings
source ${ICE_CASEDIR}/env.${ICE_MACHCOMP} -nomodules || exit 2
if !(-d ${ICE_RUNDIR}) mkdir -p ${ICE_RUNDIR}
cp -p ${ciceexe} ${ICE_RUNDIR}/cice

echo "`date` ${0}:${ICE_CASENAME} build copied ${ciceexe}" >> ${ICE_CASEDIR}/README.case
if ( ${ICE_TEST} != ${ICE_SPVAL} ) then
echo "#---" >! ${ICE_CASEDIR}/test_output
echo "COPY ${ICE_TESTNAME} build" >> ${ICE_CASEDIR}/test_output
echo "PEND ${ICE_TESTNAME} run" >> ${ICE_CASEDIR}/test_output
endif

exit 0

endif
endif

#====================================

source ./cice.settings
source ${ICE_CASEDIR}/env.${ICE_MACHCOMP} || exit 2

if (${ICE_MACHINE} != ${ICE_MACHINE_ENVNAME}) then
echo "WARNING, is ICE_MACHINE setting OK, ${ICE_MACHINE}, ${ICE_MACHINE_ENVNAME}"
endif

if (${ICE_COMPILER} != ${ICE_MACHINE_COMPILER}) then
echo "WARNING, is ICE_COMPILER setting OK, ${ICE_COMPILER}, ${ICE_MACHINE_COMPILER}"
endif

echo " "
echo "${0}:"

set stamp = `date '+%y%m%d-%H%M%S'`
set ICE_BLDLOG_FILE = "cice.bldlog.${stamp}"
set quiet = ${ICE_QUIETMODE}

if (${ICE_CLEANBUILD} == 'true') then
echo "cleaning objdir"
rm -r -f ${ICE_OBJDIR}
endif
if !(-d ${ICE_OBJDIR}) mkdir -p ${ICE_OBJDIR}
cd ${ICE_OBJDIR}

#setenv ICE_CPPDEFS "-DNXGLOB=${ICE_NXGLOB} -DNYGLOB=${ICE_NYGLOB} -DBLCKX=${ICE_BLCKX} -DBLCKY=${ICE_BLCKY} -DMXBLCKS=${ICE_MXBLCKS} -DNICELYR=${NICELYR} -DNSNWLYR=${NSNWLYR} -DNICECAT=${NICECAT} -DTRAGE=${TRAGE} -DTRFY=${TRFY} -DTRLVL=${TRLVL} -DTRPND=${TRPND} -DTRBRI=${TRBRI} -DNTRAERO=${NTRAERO} -DTRZS=${TRZS} -DNBGCLYR=${NBGCLYR} -DTRALG=${TRALG} -DTRBGCZ=${TRBGCZ} -DTRDOC=${TRDOC} -DTRDOC=${TRDOC} -DTRDIC=${TRDIC} -DTRDON=${TRDON} -DTRFED=${TRFED} -DTRFEP=${TRFEP} -DTRZAERO=${TRZAERO} -DTRBGCS=${TRBGCS} -DNUMIN=${NUMIN} -DNUMAX=${NUMAX}"
#setenv ICE_CPPDEFS "-DNICELYR=${NICELYR} -DNSNWLYR=${NSNWLYR} -DNICECAT=${NICECAT} -DTRAGE=${TRAGE} -DTRFY=${TRFY} -DTRLVL=${TRLVL} -DTRPND=${TRPND} -DTRBRI=${TRBRI} -DNTRAERO=${NTRAERO} -DTRZS=${TRZS} -DNBGCLYR=${NBGCLYR} -DTRALG=${TRALG} -DTRBGCZ=${TRBGCZ} -DTRDOC=${TRDOC} -DTRDOC=${TRDOC} -DTRDIC=${TRDIC} -DTRDON=${TRDON} -DTRFED=${TRFED} -DTRFEP=${TRFEP} -DTRZAERO=${TRZAERO} -DTRBGCS=${TRBGCS} -DNUMIN=${NUMIN} -DNUMAX=${NUMAX}"
#setenv ICE_CPPDEFS "-DNUMIN=${NUMIN} -DNUMAX=${NUMAX}"
setenv ICE_CPPDEFS " "

if ($DITTO == 'yes') then
setenv ICE_CPPDEFS "${ICE_CPPDEFS} -DREPRODUCIBLE"
endif

if (${ICE_IOTYPE} == 'netcdf') then
set IODIR = io_netcdf
setenv ICE_CPPDEFS "${ICE_CPPDEFS} -Dncdf"
else if (${ICE_IOTYPE} == 'pio') then
set IODIR = io_pio
setenv ICE_CPPDEFS "${ICE_CPPDEFS} -Dncdf"
else
set IODIR = io_binary
endif

### List of source code directories (in order of importance).
cat >! Filepath << EOF
${ICE_SANDBOX}/cicecore/drivers/${ICE_DRVOPT}
${ICE_SANDBOX}/cicecore/cicedynB/dynamics
${ICE_SANDBOX}/cicecore/cicedynB/general
${ICE_SANDBOX}/cicecore/cicedynB/analysis
${ICE_SANDBOX}/cicecore/cicedynB/infrastructure
${ICE_SANDBOX}/cicecore/cicedynB/infrastructure/io/$IODIR
${ICE_SANDBOX}/cicecore/cicedynB/infrastructure/comm/${ICE_COMMDIR}
${ICE_SANDBOX}/icepack/columnphysics
${ICE_SANDBOX}/cicecore/shared
${ICE_SANDBOX}/cicecore/nuopc
EOF

echo " "
echo ICE_GRID = ${ICE_GRID}
echo ICE_NTASK = ${ICE_NTASKS}
echo ICE_NTHRD = ${ICE_NTHRDS}
echo "ICE_CPPDEFS = ${ICE_CPPDEFS}"
echo "Filepath = "
cat ${ICE_OBJDIR}/Filepath
echo " "

echo "building makdep"
cc -o makdep ${ICE_CASEDIR}/makdep.c || exit 2

echo "building cice > ${ICE_OBJDIR}/${ICE_BLDLOG_FILE}"

if !(-d ${ICE_RUNDIR}) mkdir -p ${ICE_RUNDIR}
if !($?ICE_MACHINE_BLDTHRDS) then
set ICE_MACHINE_BLDTHRDS = 1
endif
if (-e ${ICE_BLDLOG_FILE}) rm ${ICE_BLDLOG_FILE}

if (${ICE_CLEANBUILD} == 'true') then
echo "gmake clean"
if (${quiet} == "true") then
${ICE_MACHINE_MAKE} VPFILE=Filepath EXEC=${ICE_RUNDIR}/cice \
CPPDEFS="${ICE_CPPDEFS}" \
-f ${ICE_CASEDIR}/Makefile MACFILE=${ICE_CASEDIR}/Macros.${ICE_MACHCOMP} clean >& ${ICE_BLDLOG_FILE}
else
${ICE_MACHINE_MAKE} VPFILE=Filepath EXEC=${ICE_RUNDIR}/cice \
CPPDEFS="${ICE_CPPDEFS}" \
-f ${ICE_CASEDIR}/Makefile MACFILE=${ICE_CASEDIR}/Macros.${ICE_MACHCOMP} clean | tee ${ICE_BLDLOG_FILE}
endif
endif

echo "gmake cice"
if (${quiet} == "true") then
echo " quiet mode on... patience"
${ICE_MACHINE_MAKE} -j ${ICE_MACHINE_BLDTHRDS} VPFILE=Filepath EXEC=${ICE_RUNDIR}/cice \
CPPDEFS="${ICE_CPPDEFS}" \
-f ${ICE_CASEDIR}/Makefile MACFILE=${ICE_CASEDIR}/Macros.${ICE_MACHCOMP} >& ${ICE_BLDLOG_FILE}
set bldstat = ${status}
else
${ICE_MACHINE_MAKE} -j ${ICE_MACHINE_BLDTHRDS} VPFILE=Filepath EXEC=${ICE_RUNDIR}/cice \
CPPDEFS="${ICE_CPPDEFS}" \
-f ${ICE_CASEDIR}/Makefile MACFILE=${ICE_CASEDIR}/Macros.${ICE_MACHCOMP} | tee ${ICE_BLDLOG_FILE}
set bldstat = ${status}
endif

if !(-d ${ICE_LOGDIR}) mkdir -p ${ICE_LOGDIR}
cp -p ${ICE_BLDLOG_FILE} ${ICE_LOGDIR}/

if (${bldstat} != 0) then
echo "${0}: COMPILE FAILED, see"
echo " cat ${ICE_OBJDIR}/${ICE_BLDLOG_FILE}"
if (${quiet} == "true") then
tail -10 ${ICE_OBJDIR}/${ICE_BLDLOG_FILE}
endif
if ( ${ICE_TEST} != ${ICE_SPVAL} ) then
# This is a test case. Write output to test_output file
echo "#---" >! ${ICE_CASEDIR}/test_output
echo "FAIL ${ICE_TESTNAME} build" >> ${ICE_CASEDIR}/test_output
echo "FAIL ${ICE_TESTNAME} run" >> ${ICE_CASEDIR}/test_output
endif
exit 99
endif

echo "`date` ${0}:${ICE_CASENAME} build completed ${ICE_BLDLOG_FILE}" >> ${ICE_CASEDIR}/README.case
echo "${0}: COMPILE SUCCESSFUL, ${ICE_LOGDIR}/${ICE_BLDLOG_FILE}"
if ( ${ICE_TEST} != ${ICE_SPVAL} ) then
echo "#---" >! ${ICE_CASEDIR}/test_output
echo "PASS ${ICE_TESTNAME} build" >> ${ICE_CASEDIR}/test_output
echo "PEND ${ICE_TESTNAME} run" >> ${ICE_CASEDIR}/test_output
endif

#cd ${ICE_OBJDIR}
#ar rc libcice.a ./*.o
#cd ${ICE_CASEDIR}
#echo '.............. libcice.a built.'


47 changes: 47 additions & 0 deletions CICE/cice.settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#! /bin/csh -f

setenv ICEDIR `pwd`

setenv ICE_CASENAME wak_nems
setenv ICE_SANDBOX ${ICEDIR}
setenv ICE_MACHINE rhino
setenv ICE_COMPILER intel
setenv ICE_MACHCOMP rhino_intel
setenv ICE_SCRIPTS ${ICE_SANDBOX}/configuration/scripts
setenv ICE_CASEDIR ${ICE_SANDBOX}/wak_nems
setenv ICE_RUNDIR ${ICE_SANDBOX}/wak_nems/run
setenv ICE_OBJDIR ${ICE_RUNDIR}/compile
setenv ICE_RSTDIR ${ICE_RUNDIR}/restart
setenv ICE_HSTDIR ${ICE_RUNDIR}/history
setenv ICE_LOGDIR ${ICE_CASEDIR}/logs
setenv ICE_DRVOPT cice
setenv ICE_IOTYPE netcdf # set to none if netcdf library is unavailable
setenv ICE_CLEANBUILD true
setenv ICE_QUIETMODE false
setenv ICE_GRID wak
setenv ICE_NTASKS 24 #16
setenv ICE_NTHRDS 1
setenv ICE_TEST UnDeFiNeD
setenv ICE_TESTNAME UnDeFiNeD
setenv ICE_BASELINE ${ICE_SANDBOX}/wak_nems/CICE_BASELINE
setenv ICE_BASEGEN UnDeFiNeD
setenv ICE_BASECOM UnDeFiNeD
setenv ICE_BFBCOMP UnDeFiNeD
setenv ICE_SPVAL UnDeFiNeD
setenv ICE_RUNLENGTH 0
setenv ICE_ACCOUNT P0000000
setenv ICE_QUEUE default

#======================================================

setenv ICE_THREADED true
if (${ICE_NTHRDS} > 1) setenv ICE_THREADED true
setenv ICE_COMMDIR mpi
if (${ICE_NTASKS} == 1) setenv ICE_COMMDIR serial

### Specialty code
setenv CAM_ICE no # set to yes for CAM runs (single column)
setenv DITTO no # reproducible diagnostics
setenv BARRIERS no # prevent MPI buffer overflow during gather/scatter
setenv ICE_BLDDEBUG false # build debug flags

45 changes: 45 additions & 0 deletions CICE/cice.settings.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#! /bin/csh -f

setenv ICE_CASENAME wak_nems
setenv ICE_SANDBOX /mnt/projects/hpc/fujisaki/NEMS/test_20210616/ADC-WW3-NWM-NEMS_adc_from_guoming/CICE
setenv ICE_MACHINE rhino
setenv ICE_COMPILER intel
setenv ICE_MACHCOMP rhino_intel
setenv ICE_SCRIPTS /mnt/projects/hpc/fujisaki/NEMS/test_20210616/ADC-WW3-NWM-NEMS_adc_from_guoming/CICE/configuration/scripts
setenv ICE_CASEDIR /mnt/projects/hpc/fujisaki/NEMS/test_20210616/ADC-WW3-NWM-NEMS_adc_from_guoming/CICE/wak_nems
setenv ICE_RUNDIR /mnt/projects/hpc/fujisaki/NEMS/test_20210616/ADC-WW3-NWM-NEMS_adc_from_guoming/wak_nems/run
setenv ICE_OBJDIR ${ICE_RUNDIR}/compile
setenv ICE_RSTDIR ${ICE_RUNDIR}/restart
setenv ICE_HSTDIR ${ICE_RUNDIR}/history
setenv ICE_LOGDIR ${ICE_CASEDIR}/logs
setenv ICE_DRVOPT cice
setenv ICE_IOTYPE netcdf # set to none if netcdf library is unavailable
setenv ICE_CLEANBUILD true
setenv ICE_QUIETMODE false
setenv ICE_GRID wak
setenv ICE_NTASKS 24 #16
setenv ICE_NTHRDS 1
setenv ICE_TEST UnDeFiNeD
setenv ICE_TESTNAME UnDeFiNeD
setenv ICE_BASELINE /mnt/projects/hpc/fujisaki/NEMS/test_cice/ADC-WW3-NWM-NEMS/CICE/wak_nems/CICE_BASELINE
setenv ICE_BASEGEN UnDeFiNeD
setenv ICE_BASECOM UnDeFiNeD
setenv ICE_BFBCOMP UnDeFiNeD
setenv ICE_SPVAL UnDeFiNeD
setenv ICE_RUNLENGTH 0
setenv ICE_ACCOUNT P0000000
setenv ICE_QUEUE default

#======================================================

setenv ICE_THREADED true
if (${ICE_NTHRDS} > 1) setenv ICE_THREADED true
setenv ICE_COMMDIR mpi
if (${ICE_NTASKS} == 1) setenv ICE_COMMDIR serial

### Specialty code
setenv CAM_ICE no # set to yes for CAM runs (single column)
setenv DITTO no # reproducible diagnostics
setenv BARRIERS no # prevent MPI buffer overflow during gather/scatter
setenv ICE_BLDDEBUG false # build debug flags

Loading