Skip to content

Commit

Permalink
Merge remote-tracking branch 'Consortium/master' into feature/updcice
Browse files Browse the repository at this point in the history
  • Loading branch information
DeniseWorthen committed Aug 31, 2021
2 parents 31a575d + 34c8e68 commit 29ee0ce
Show file tree
Hide file tree
Showing 24 changed files with 605 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-icepack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
- name: run suite
run: |
cd $HOME/icepack
./icepack.setup -m conda -e ${{ matrix.envdef }} --suite travis_suite --testid ${{ matrix.os }}
./icepack.setup -m conda -e ${{ matrix.envdef }} --suite travis_suite,io_suite --testid ${{ matrix.os }}
- name: write output
run: |
cd $HOME/icepack
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ script:
- "./icepack.setup --case trcase --mach travisCI --env gnu --pes 1x1 -s diag1 && sleep 4"
- "./icepack.setup --test smoke --testid trtest --mach travisCI --env gnu
--pes 1x1 -s diag1 && sleep 4"
- "./icepack.setup --suite travis_suite --testid travisCItest
- "./icepack.setup --suite travis_suite,io_suite --testid travisCItest
--mach travisCI --env gnu &&
cd testsuite.travisCItest &&
./results.csh"
Expand Down
2 changes: 1 addition & 1 deletion columnphysics/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ICEPACK 1.2.5
ICEPACK 1.3.0
11 changes: 10 additions & 1 deletion configuration/driver/icedrv_RunMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ subroutine icedrv_run
use icedrv_forcing, only: get_forcing, get_wave_spec
use icedrv_forcing_bgc, only: faero_default, fiso_default, get_forcing_bgc
use icedrv_flux, only: init_flux_atm_ocn
use icedrv_history, only: history_cdf, history_close

logical (kind=log_kind) :: skl_bgc, z_tracers, tr_aero, tr_zaero, &
wave_spec, tr_fsd, tr_iso
Expand All @@ -61,7 +62,10 @@ subroutine icedrv_run

call calendar(time) ! at the end of the timestep

if (stop_now >= 1) exit timeLoop
if (stop_now >= 1) then
if (history_cdf) call history_close()
exit timeLoop
endif

call icepack_query_parameters(skl_bgc_out=skl_bgc, z_tracers_out=z_tracers,&
wave_spec_out=wave_spec)
Expand Down Expand Up @@ -97,6 +101,7 @@ subroutine ice_step
use icedrv_diagnostics_bgc, only: hbrine_diags, zsal_diags, bgc_diags
use icedrv_flux, only: init_history_therm, init_history_bgc, &
daidtt, daidtd, dvidtt, dvidtd, dagedtt, dagedtd, init_history_dyn
use icedrv_history, only: history_cdf, history_write
use icedrv_restart, only: dumpfile, final_restart
use icedrv_restart_bgc, only: write_restart_bgc
use icedrv_step, only: prep_radiation, step_therm1, step_therm2, &
Expand Down Expand Up @@ -219,6 +224,10 @@ subroutine ice_step
if (skl_bgc .or. z_tracers) call bgc_diags
if (tr_brine) call hbrine_diags
endif

if (history_cdf) then
call history_write()
endif

if (write_restart == 1) then
call dumpfile ! core variables for restarting
Expand Down
2 changes: 2 additions & 0 deletions configuration/driver/icedrv_calendar.F90
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ module icedrv_calendar
real (kind=dbl_kind), public :: &
dt , & ! thermodynamics timestep (s)
dt_dyn , & ! dynamics/transport/ridging timestep (s)
time0 , & ! total elapsed time at istep0 for idate0 (s)
time , & ! total elapsed time (s)
time_forc , & ! time of last forcing update (s)
yday , & ! day of the year
Expand Down Expand Up @@ -123,6 +124,7 @@ subroutine init_calendar
!-----------------------------------------------------------------

istep = 0 ! local timestep number
time0=istep0*dt ! start time
time=istep0*dt ! s
yday=c0 ! absolute day number
mday=0 ! day of the month
Expand Down
423 changes: 423 additions & 0 deletions configuration/driver/icedrv_history.F90

Large diffs are not rendered by default.

109 changes: 84 additions & 25 deletions configuration/driver/icedrv_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ subroutine input_data
use icedrv_calendar, only: year_init, istep0
use icedrv_calendar, only: dumpfreq, diagfreq, dump_last
use icedrv_calendar, only: npt, dt, ndtd, days_per_year, use_leap_years
use icedrv_history, only: history_cdf
use icedrv_restart_shared, only: restart, restart_dir, restart_file
use icedrv_flux, only: update_ocn_f, l_mpond_fresh, cpl_bgc
use icedrv_flux, only: default_season
Expand Down Expand Up @@ -129,7 +130,7 @@ subroutine input_data
dt, npt, ndtd, dump_last, &
ice_ic, restart, restart_dir, restart_file, &
dumpfreq, diagfreq, diag_file, cpl_bgc, &
conserv_check
conserv_check, history_cdf

namelist /grid_nml/ &
kcatbound
Expand Down Expand Up @@ -248,6 +249,7 @@ subroutine input_data
restart = .false. ! if true, read restart files for initialization
restart_dir = './' ! write to executable dir for default
restart_file = 'iced' ! restart file name prefix
history_cdf = .false. ! history netcdf file flag
ice_ic = 'default' ! initial conditions are specified in the code
! otherwise, the filename for reading restarts
ndtd = 1 ! dynamic time steps per thermodynamic time step
Expand Down Expand Up @@ -292,55 +294,111 @@ subroutine input_data

open (nu_nml, file=nml_filename, status='old',iostat=nml_error)
if (nml_error /= 0) then
nml_error = -1
else
nml_error = 1
write(ice_stdout,*) 'error opening namelist file '//trim(nml_filename)
call icedrv_system_abort(file=__FILE__,line=__LINE__)
endif
close(nu_nml)

do while (nml_error > 0)
print*,'Reading namelist file ',nml_filename
print*,'Reading namelist file ',nml_filename

print*,'Reading setup_nml'
open (nu_nml, file=nml_filename, status='old',iostat=nml_error)
nml_error = 1
print*,'Reading setup_nml'
do while (nml_error > 0)
read(nu_nml, nml=setup_nml,iostat=nml_error)
if (nml_error /= 0) exit
end do
if (nml_error /= 0) then
write(ice_stdout,*) 'error reading namelist'
call icedrv_system_abort(file=__FILE__,line=__LINE__)
endif
close(nu_nml)

print*,'Reading grid_nml'
open (nu_nml, file=nml_filename, status='old',iostat=nml_error)
nml_error = 1
print*,'Reading grid_nml'
do while (nml_error > 0)
read(nu_nml, nml=grid_nml,iostat=nml_error)
if (nml_error /= 0) exit
end do
if (nml_error /= 0) then
write(ice_stdout,*) 'error reading namelist'
call icedrv_system_abort(file=__FILE__,line=__LINE__)
endif
close(nu_nml)

print*,'Reading tracer_nml'
open (nu_nml, file=nml_filename, status='old',iostat=nml_error)
nml_error = 1
print*,'Reading tracer_nml'
do while (nml_error > 0)
read(nu_nml, nml=tracer_nml,iostat=nml_error)
if (nml_error /= 0) exit
end do
if (nml_error /= 0) then
write(ice_stdout,*) 'error reading namelist'
call icedrv_system_abort(file=__FILE__,line=__LINE__)
endif
close(nu_nml)

print*,'Reading thermo_nml'
open (nu_nml, file=nml_filename, status='old',iostat=nml_error)
nml_error = 1
print*,'Reading thermo_nml'
do while (nml_error > 0)
read(nu_nml, nml=thermo_nml,iostat=nml_error)
if (nml_error /= 0) exit
end do
if (nml_error /= 0) then
write(ice_stdout,*) 'error reading namelist'
call icedrv_system_abort(file=__FILE__,line=__LINE__)
endif
close(nu_nml)

print*,'Reading shortwave_nml'
open (nu_nml, file=nml_filename, status='old',iostat=nml_error)
nml_error = 1
print*,'Reading shortwave_nml'
do while (nml_error > 0)
read(nu_nml, nml=shortwave_nml,iostat=nml_error)
if (nml_error /= 0) exit
end do
if (nml_error /= 0) then
write(ice_stdout,*) 'error reading namelist'
call icedrv_system_abort(file=__FILE__,line=__LINE__)
endif
close(nu_nml)

print*,'Reading ponds_nml'
open (nu_nml, file=nml_filename, status='old',iostat=nml_error)
nml_error = 1
print*,'Reading ponds_nml'
do while (nml_error > 0)
read(nu_nml, nml=ponds_nml,iostat=nml_error)
if (nml_error /= 0) exit
end do
if (nml_error /= 0) then
write(ice_stdout,*) 'error reading namelist'
call icedrv_system_abort(file=__FILE__,line=__LINE__)
endif
close(nu_nml)

if (tr_snow) then
print*,'Reading snow_nml'
if (tr_snow) then
open (nu_nml, file=nml_filename, status='old',iostat=nml_error)
nml_error = 1
print*,'Reading snow_nml'
do while (nml_error > 0)
read(nu_nml, nml=snow_nml,iostat=nml_error)
if (nml_error /= 0) exit
end do
if (nml_error /= 0) then
write(ice_stdout,*) 'error reading namelist'
call icedrv_system_abort(file=__FILE__,line=__LINE__)
endif
close(nu_nml)
endif

print*,'Reading forcing_nml'
open (nu_nml, file=nml_filename, status='old',iostat=nml_error)
nml_error = 1
print*,'Reading forcing_nml'
do while (nml_error > 0)
read(nu_nml, nml=forcing_nml,iostat=nml_error)
if (nml_error /= 0) exit
end do
if (nml_error == 0) close(nu_nml)
if (nml_error /= 0) then
write(ice_stdout,*) 'error reading namelist'
call icedrv_system_abort(file=__FILE__,line=__LINE__)
endif
close(nu_nml)

!-----------------------------------------------------------------
! set up diagnostics output and resolve conflicts
!-----------------------------------------------------------------
Expand Down Expand Up @@ -558,6 +616,7 @@ subroutine input_data
trim(restart_dir)
write(nu_diag,*) ' restart_file = ', &
trim(restart_file)
write(nu_diag,1010) ' history_cdf = ', history_cdf
write(nu_diag,*) ' ice_ic = ', &
trim(ice_ic)
write(nu_diag,1010) ' conserv_check = ', conserv_check
Expand Down
8 changes: 4 additions & 4 deletions configuration/driver/icedrv_init_column.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1008,20 +1008,20 @@ subroutine init_zbgc

open (nu_nml, file=trim(nml_filename), status='old',iostat=nml_error)
if (nml_error /= 0) then
nml_error = -1
else
nml_error = 1
print*,'error opening zbgc namelist file '//trim(nml_filename)
call icedrv_system_abort(file=__FILE__,line=__LINE__)
endif

nml_error = 1
print*,'Reading zbgc_nml'
do while (nml_error > 0)
read(nu_nml, nml=zbgc_nml,iostat=nml_error)
end do
if (nml_error == 0) close(nu_nml)
if (nml_error /= 0) then
print*,'error reading zbgc namelist'
call icedrv_system_abort(file=__FILE__,line=__LINE__)
endif
close(nu_nml)

!-----------------------------------------------------------------
! resolve conflicts
Expand Down
16 changes: 9 additions & 7 deletions configuration/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ OBJS := $(addsuffix .o, $(sort $(basename $(notdir $(SRCS)))))
DEPS := $(addsuffix .d, $(sort $(basename $(notdir $(SRCS)))))
INCS := $(patsubst %,-I%, $(VPATH) )
RM := rm
MODDIR:= -I.

.SUFFIXES:
.SUFFIXES: .F90 .F .c .o
Expand Down Expand Up @@ -95,15 +96,16 @@ db_files:
@echo "* VPATH := $(VPATH)"
@echo "* SRCFILE := $(SRCFILE)"
@echo "* INCS := $(INCS)"
@echo "* MODDIR := $(MODDIR)"
@echo "* SRCS := $(SRCS)"
@echo "* OBJS := $(OBJS)"
@echo "* DEPS := $(DEPS)"
db_flags:
@echo " "
@echo "* cpp := $(CPP) $(CPPFLAGS) $(CPPDEFS) $(INCS) $(INCLDIR)"
@echo "* cc := cc -c $(CFLAGS) $(INCS) $(INCLDIR)"
@echo "* .F.o := $(FC) -c $(FFLAGS) $(FIXEDFLAGS) $(INCS) $(INCLDIR)"
@echo "* .F90.o := $(FC) -c $(FFLAGS) $(FREEFLAGS) $(INCS) $(INCLDIR)"
@echo "* cpp := $(CPP) $(CPPFLAGS) $(CPPDEFS) $(INCLDIR)"
@echo "* cc := $(CC) -c $(CFLAGS) $(INCLDIR)"
@echo "* .F.o := $(FC) -c $(FFLAGS) $(FIXEDFLAGS) $(INCLDIR)"
@echo "* .F90.o := $(FC) -c $(FFLAGS) $(FREEFLAGS) $(MODDIR) $(INCLDIR)"

#-------------------------------------------------------------------------------
# build rule for makdep: MACFILE, cmd-line, or env vars must provide
Expand All @@ -121,13 +123,13 @@ $(EXEC): $(OBJS)
$(LD) -o $(EXEC) $(LDFLAGS) $(OBJS) $(ULIBS) $(SLIBS)

.c.o:
cc $(CFLAGS) $(CPPDEFS) $(INCS) $(INCLDIR) $<
$(CC) $(CFLAGS) $(CPPDEFS) $(INCLDIR) $<

.F.o:
$(FC) -c $(FFLAGS) $(FIXEDFLAGS) $(CPPDEFS) $(INCS) $(INCLDIR) $<
$(FC) -c $(FFLAGS) $(FIXEDFLAGS) $(CPPDEFS) $(INCLDIR) $<

.F90.o:
$(FC) -c $(FFLAGS) $(FREEFLAGS) $(CPPDEFS) $(INCS) $(INCLDIR) $<
$(FC) -c $(FFLAGS) $(FREEFLAGS) $(CPPDEFS) $(MODDIR) $(INCLDIR) $<

mostlyclean:
$(RM) -f *.f *.f90
Expand Down
4 changes: 4 additions & 0 deletions configuration/scripts/icepack.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ cd ${ICE_OBJDIR}

setenv ICE_CPPDEFS "${ICE_CPPDEFS} -DNXGLOB=${ICE_NXGLOB} -DNICELYR=${NICELYR} -DNSNWLYR=${NSNWLYR} -DNICECAT=${NICECAT} -DNFSDCAT=${NFSDCAT} -DTRAGE=${TRAGE} -DTRFY=${TRFY} -DTRLVL=${TRLVL} -DTRPND=${TRPND} -DTRSNOW=${TRSNOW} -DTRBRI=${TRBRI} -DNTRISO=${NTRISO} -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} "

if (${ICE_IOTYPE} == 'netcdf') then
setenv ICE_CPPDEFS "${ICE_CPPDEFS} -DUSE_NETCDF"
endif

### List of source code directories (in order of importance).
cat >! Filepath << EOF
${ICE_SANDBOX}/configuration/driver
Expand Down
1 change: 1 addition & 0 deletions configuration/scripts/icepack_in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
dump_last = .false.
diagfreq = 24
diag_file = 'ice_diag'
history_cdf = .false.
cpl_bgc = .false.
conserv_check = .false.
/
Expand Down
13 changes: 4 additions & 9 deletions configuration/scripts/machines/Macros.badger_intel
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,23 @@ CC := $(SCC)
FC := $(SFC)
LD := $(FC)

# set in Macros file
NETCDF_PATH := /usr/projects/climate/SHARED_CLIMATE/software/conejo/netcdf/3.6.3/intel-13.0.1
PNETCDF_PATH := /usr/projects/climate/SHARED_CLIMATE/software/conejo/parallel-netcdf/1.3.1/intel-13.0.1/openmpi-1.6.3
#LAPACK_LIBDIR := /glade/apps/opt/lapack/3.4.2/intel/12.1.5/lib
NETCDF_PATH := /usr/projects/hpcsoft/toss3/common/netcdf/4.4.0_intel-18.0.5
PNETCDF_PATH := /usr/projects/hpcsoft/toss3/badger/netcdf/4.4.0_intel-18.0.5_openmpi-2.1.2

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

ifeq ($(ICE_IOTYPE), netcdf)
INCLDIR := $(INCLDIR) -I$(NETCDF_PATH)/include
# INCLDIR := $(INCLDIR) -I/usr/projects/climate/SHARED_CLIMATE/software/conejo/netcdf/3.6.3/intel-13.0.1/include
INCLDIR := $(INCLDIR) -I$(NETCDF_PATH)/include -I$(PNETCDF_PATH)/include

LIB_NETCDF := $(NETCDF_PATH)/lib
LIB_PNETCDF := $(PNETCDF_PATH)/lib
LIB_MPI := $(IMPILIBDIR)

#SLIBS := -L$(LIB_NETCDF) -lnetcdf -L$(LIB_PNETCDF) -lpnetcdf -L$(LAPACK_LIBDIR) -llapack -lblas
SLIBS := -L$(LIB_NETCDF) -lnetcdf -L$(LIB_PNETCDF) -lpnetcdf
SLIBS := -L$(LIB_NETCDF) -lnetcdf -L$(LIB_PNETCDF) -lnetcdff
else
SLIBS :=
endif


ifeq ($(ICE_THREADED), true)
LDFLAGS += -qopenmp
CFLAGS += -qopenmp
Expand Down
6 changes: 6 additions & 0 deletions configuration/scripts/machines/Macros.conda_macos
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ CC := $(SCC)
FC := $(SFC)
LD := $(FC)

# Location of the compiled Fortran modules (NetCDF)
MODDIR += -I$(CONDA_PREFIX)/include

# Location of the system C header files (required on recent macOS to compile makdep)
SDKPATH = $(shell xcrun --show-sdk-path)
ifeq ($(strip $(SDKPATH)),)
Expand All @@ -35,6 +38,9 @@ else
LD += -L$(SDKPATH)/usr/lib
endif

# Libraries to be passed to the linker
SLIBS := -L$(CONDA_PREFIX)/lib -lnetcdf -lnetcdff

# Necessary flag to compile with OpenMP support
ifeq ($(ICE_THREADED), true)
LDFLAGS += -fopenmp
Expand Down
Loading

0 comments on commit 29ee0ce

Please sign in to comment.