diff --git a/LICENSE.pdf b/LICENSE.pdf index d98d3da80..80ae31d51 100644 Binary files a/LICENSE.pdf and b/LICENSE.pdf differ diff --git a/columnphysics/icepack_intfc.F90 b/columnphysics/icepack_intfc.F90 index 3de66016a..d76be4ff8 100644 --- a/columnphysics/icepack_intfc.F90 +++ b/columnphysics/icepack_intfc.F90 @@ -1,8 +1,8 @@ !======================================================================= -! Copyright (c) 2022, Triad National Security, LLC +! Copyright (c) 2023, Triad National Security, LLC ! All rights reserved. ! -! Copyright 2022. Triad National Security, LLC. This software was +! Copyright 2023. Triad National Security, LLC. This software was ! produced under U.S. Government contract DE-AC52-06NA25396 for Los ! Alamos National Laboratory (LANL), which is operated by Triad ! National Security, LLC for the U.S. Department of Energy. The U.S. diff --git a/columnphysics/icepack_parameters.F90 b/columnphysics/icepack_parameters.F90 index 42ce7591b..d59b38319 100644 --- a/columnphysics/icepack_parameters.F90 +++ b/columnphysics/icepack_parameters.F90 @@ -146,8 +146,9 @@ module icepack_parameters ! 2 = mushy layer theory character (char_len), public :: & - conduct = 'bubbly', & ! 'MU71' or 'bubbly' - fbot_xfer_type = 'constant' ! transfer coefficient type for ice-ocean heat flux + conduct = 'bubbly', & ! 'MU71' or 'bubbly' + fbot_xfer_type = 'constant', & ! transfer coefficient type for ice-ocean heat flux + cpl_frazil = 'fresh_ice_correction' ! type of coupling for frazil ice logical (kind=log_kind), public :: & calc_Tsfc = .true. ,&! if true, calculate surface temperature @@ -438,7 +439,8 @@ subroutine icepack_init_parameters( & argcheck_in, puny_in, bignum_in, pi_in, secday_in, & rhos_in, rhoi_in, rhow_in, cp_air_in, emissivity_in, & cp_ice_in, cp_ocn_in, hfrazilmin_in, floediam_in, & - depressT_in, dragio_in, thickness_ocn_layer1_in, iceruf_ocn_in, albocn_in, gravit_in, viscosity_dyn_in, & + depressT_in, dragio_in, thickness_ocn_layer1_in, iceruf_ocn_in, & + albocn_in, gravit_in, viscosity_dyn_in, & Tocnfrz_in, rhofresh_in, zvir_in, vonkar_in, cp_wv_in, & stefan_boltzmann_in, ice_ref_salinity_in, & Tffresh_in, Lsub_in, Lvap_in, Timelt_in, Tsmelt_in, & @@ -452,6 +454,7 @@ subroutine icepack_init_parameters( & qqqice_in, TTTice_in, qqqocn_in, TTTocn_in, & ktherm_in, conduct_in, fbot_xfer_type_in, calc_Tsfc_in, dts_b_in, & update_ocn_f_in, ustar_min_in, hi_min_in, a_rapid_mode_in, & + cpl_frazil_in, & Rac_rapid_mode_in, aspect_rapid_mode_in, & dSdt_slow_mode_in, phi_c_slow_mode_in, & phi_i_mushy_in, shortwave_in, albedo_type_in, albsnowi_in, & @@ -545,8 +548,9 @@ subroutine icepack_init_parameters( & ! 2 = mushy layer theory character (len=*), intent(in), optional :: & - conduct_in, & ! 'MU71' or 'bubbly' - fbot_xfer_type_in ! transfer coefficient type for ice-ocean heat flux + conduct_in, & ! 'MU71' or 'bubbly' + fbot_xfer_type_in, & ! transfer coefficient type for ice-ocean heat flux + cpl_frazil_in ! type of coupling for frazil ice logical (kind=log_kind), intent(in), optional :: & calc_Tsfc_in , &! if true, calculate surface temperature @@ -908,6 +912,7 @@ subroutine icepack_init_parameters( & if (present(conduct_in) ) conduct = conduct_in if (present(fbot_xfer_type_in) ) fbot_xfer_type = fbot_xfer_type_in if (present(calc_Tsfc_in) ) calc_Tsfc = calc_Tsfc_in + if (present(cpl_frazil_in) ) cpl_frazil = cpl_frazil_in if (present(update_ocn_f_in) ) update_ocn_f = update_ocn_f_in if (present(dts_b_in) ) dts_b = dts_b_in if (present(ustar_min_in) ) ustar_min = ustar_min_in @@ -1170,7 +1175,7 @@ subroutine icepack_query_parameters( & saltmax_out, phi_init_out, min_salin_out, salt_loss_out, & Tliquidus_max_out, & min_bgc_out, dSin0_frazil_out, hi_ssl_out, hs_ssl_out, & - awtvdr_out, awtidr_out, awtvdf_out, awtidf_out, & + awtvdr_out, awtidr_out, awtvdf_out, awtidf_out, cpl_frazil_out, & qqqice_out, TTTice_out, qqqocn_out, TTTocn_out, update_ocn_f_out, & Lfresh_out, cprho_out, Cp_out, ustar_min_out, hi_min_out, a_rapid_mode_out, & ktherm_out, conduct_out, fbot_xfer_type_out, calc_Tsfc_out, dts_b_out, & @@ -1276,8 +1281,9 @@ subroutine icepack_query_parameters( & ! 2 = mushy layer theory character (len=*), intent(out), optional :: & - conduct_out, & ! 'MU71' or 'bubbly' - fbot_xfer_type_out ! transfer coefficient type for ice-ocean heat flux + conduct_out, & ! 'MU71' or 'bubbly' + fbot_xfer_type_out, & ! transfer coefficient type for ice-ocean heat flux + cpl_frazil_out ! type of coupling for frazil ice logical (kind=log_kind), intent(out), optional :: & calc_Tsfc_out ,&! if true, calculate surface temperature @@ -1673,6 +1679,7 @@ subroutine icepack_query_parameters( & if (present(conduct_out) ) conduct_out = conduct if (present(fbot_xfer_type_out) ) fbot_xfer_type_out = fbot_xfer_type if (present(calc_Tsfc_out) ) calc_Tsfc_out = calc_Tsfc + if (present(cpl_frazil_out) ) cpl_frazil_out = cpl_frazil if (present(update_ocn_f_out) ) update_ocn_f_out = update_ocn_f if (present(dts_b_out) ) dts_b_out = dts_b if (present(ustar_min_out) ) ustar_min_out = ustar_min @@ -1881,6 +1888,7 @@ subroutine icepack_write_parameters(iounit) write(iounit,*) " conduct = ", trim(conduct) write(iounit,*) " fbot_xfer_type = ", trim(fbot_xfer_type) write(iounit,*) " calc_Tsfc = ", calc_Tsfc + write(iounit,*) " cpl_frazil = ", cpl_frazil write(iounit,*) " update_ocn_f = ", update_ocn_f write(iounit,*) " dts_b = ", dts_b write(iounit,*) " ustar_min = ", ustar_min diff --git a/columnphysics/icepack_therm_itd.F90 b/columnphysics/icepack_therm_itd.F90 index 51cf66b32..e43e0c08e 100644 --- a/columnphysics/icepack_therm_itd.F90 +++ b/columnphysics/icepack_therm_itd.F90 @@ -28,7 +28,7 @@ module icepack_therm_itd use icepack_parameters, only: rhosi, conserv_check, rhosmin, snwredist use icepack_parameters, only: kitd, ktherm use icepack_parameters, only: z_tracers, hfrazilmin, hi_min - use icepack_parameters, only: saltflux_option + use icepack_parameters, only: cpl_frazil, update_ocn_f, saltflux_option use icepack_parameters, only: icepack_chkoptargflag use icepack_tracers, only: ntrcr, nbtrcr @@ -1308,7 +1308,6 @@ subroutine add_new_ice (ncat, nilyr, & aice0, aice, & frzmlt, frazil, & frz_onset, yday, & - update_ocn_f, & fresh, fsalt, & Tf, sss, & salinz, phi_init, & @@ -1381,9 +1380,6 @@ subroutine add_new_ice (ncat, nilyr, & phi_init , & ! initial frazil liquid fraction dSin0_frazil ! initial frazil bulk salinity reduction from sss - logical (kind=log_kind), intent(in) :: & - update_ocn_f ! if true, update fresh water and salt fluxes - ! BGC real (kind=dbl_kind), dimension (nblyr+2), intent(in) :: & bgrid ! biology nondimensional vertical grid points @@ -1619,29 +1615,29 @@ subroutine add_new_ice (ncat, nilyr, & ! is NOT included in fluxes fresh and fsalt. !----------------------------------------------------------------- - if (update_ocn_f) then - dfresh = -rhoi*vi0new/dt + dfresh = c0 + dfsalt = c0 + if (cpl_frazil == 'external') then + ! do nothing here, calculations are in the coupler or elsewhere + else + if (update_ocn_f) then + dfresh = -rhoi*vi0new/dt + elseif (cpl_frazil == 'fresh_ice_correction' .and. ktherm == 2) then + ! correct frazil fluxes for mushy + vi0tmp = fnew*dt / (rhoi*Lfresh) ! ocn/cpl assumes frazil volume is pure, fresh ice + dfresh = -rhoi*(vi0new - vi0tmp)/dt + frazil_diag = frazil - vi0tmp +! else +! do nothing - other correction options could be implemented in the future + endif + if (saltflux_option == 'prognostic') then dfsalt = Si0new*p001*dfresh else dfsalt = ice_ref_salinity*p001*dfresh endif fresh = fresh + dfresh - fsalt = fsalt + dfsalt - else ! update_ocn_f = false - if (ktherm == 2) then ! return mushy-layer frazil to ocean (POP) - vi0tmp = fnew*dt / (rhoi*Lfresh) - dfresh = -rhoi*(vi0new - vi0tmp)/dt - if (saltflux_option == 'prognostic') then - dfsalt = Si0new*p001*dfresh - else - dfsalt = ice_ref_salinity*p001*dfresh - endif - fresh = fresh + dfresh - fsalt = fsalt + dfsalt - frazil_diag = frazil - vi0tmp - ! elseif ktherm==1 do nothing - endif + fsalt = fsalt + dfsalt endif !----------------------------------------------------------------- @@ -2011,6 +2007,8 @@ subroutine icepack_step_therm2 (dt, ncat, nltrcr, & d_afsd_latm, d_afsd_weld, & floe_rad_c, floe_binwidth) + use icepack_parameters, only: icepack_init_parameters + integer (kind=int_kind), intent(in) :: & ncat , & ! number of thickness categories nltrcr , & ! number of zbgc tracers @@ -2021,7 +2019,7 @@ subroutine icepack_step_therm2 (dt, ncat, nltrcr, & integer (kind=int_kind), intent(in), optional :: & nfsd ! number of floe size categories - logical (kind=log_kind), intent(in) :: & + logical (kind=log_kind), intent(in), optional :: & update_ocn_f ! if true, update fresh water and salt fluxes real (kind=dbl_kind), dimension(0:ncat), intent(in) :: & @@ -2141,6 +2139,9 @@ subroutine icepack_step_therm2 (dt, ncat, nltrcr, & ! Check optional arguments and set local values !----------------------------------------------------------------- + if (present(update_ocn_f)) then + call icepack_init_parameters(update_ocn_f_in=update_ocn_f) + endif if (icepack_chkoptargflag(first_call)) then if (tr_iso) then if (.not.(present(fiso_ocn) .and. & @@ -2239,7 +2240,6 @@ subroutine icepack_step_therm2 (dt, ncat, nltrcr, & aice0, aice, & frzmlt, frazil, & frz_onset, yday, & - update_ocn_f, & fresh, fsalt, & Tf, sss, & salinz, phi_init, & diff --git a/columnphysics/version.txt b/columnphysics/version.txt index f31cebc77..739229a40 100644 --- a/columnphysics/version.txt +++ b/columnphysics/version.txt @@ -1 +1 @@ -ICEPACK 1.3.3 +ICEPACK 1.3.4 diff --git a/configuration/driver/icedrv_MAIN.F90 b/configuration/driver/icedrv_MAIN.F90 index 881bb9aac..5c84695f2 100644 --- a/configuration/driver/icedrv_MAIN.F90 +++ b/configuration/driver/icedrv_MAIN.F90 @@ -1,8 +1,8 @@ !======================================================================= -! Copyright (c) 2022, Triad National Security, LLC +! Copyright (c) 2023, Triad National Security, LLC ! All rights reserved. ! -! Copyright 2022. Triad National Security, LLC. This software was +! Copyright 2023. Triad National Security, LLC. This software was ! produced under U.S. Government contract DE-AC52-06NA25396 for Los ! Alamos National Laboratory (LANL), which is operated by Triad ! National Security, LLC for the U.S. Department of Energy. The U.S. diff --git a/configuration/driver/icedrv_flux.F90 b/configuration/driver/icedrv_flux.F90 index 06b0d06d0..39c090818 100644 --- a/configuration/driver/icedrv_flux.F90 +++ b/configuration/driver/icedrv_flux.F90 @@ -19,7 +19,6 @@ module icedrv_flux use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted use icepack_intfc, only: icepack_query_parameters use icepack_intfc, only: icepack_query_tracer_flags, icepack_query_tracer_indices - use icepack_intfc, only: icepack_query_parameters use icedrv_system, only: icedrv_system_abort implicit none @@ -193,7 +192,6 @@ module icedrv_flux scale_factor! scaling factor for shortwave components logical (kind=log_kind), public :: & - update_ocn_f, & ! if true, update fresh water and salt fluxes l_mpond_fresh ! if true, include freshwater feedback from meltponds ! when running in ice-ocean or coupled configuration diff --git a/configuration/driver/icedrv_init.F90 b/configuration/driver/icedrv_init.F90 index 647480efe..c1e738ce6 100644 --- a/configuration/driver/icedrv_init.F90 +++ b/configuration/driver/icedrv_init.F90 @@ -64,7 +64,7 @@ subroutine input_data use icedrv_calendar, only: npt, dt, ndtd, days_per_year, use_leap_years use icedrv_history, only: history_format use icedrv_restart_shared, only: restart, restart_dir, restart_file, restart_format - use icedrv_flux, only: update_ocn_f, l_mpond_fresh, cpl_bgc + use icedrv_flux, only: l_mpond_fresh, cpl_bgc use icedrv_flux, only: default_season use icedrv_forcing, only: precip_units, fyear_init, ycycle use icedrv_forcing, only: atm_data_type, ocn_data_type, bgc_data_type @@ -99,9 +99,10 @@ subroutine input_data natmiter, kitd, kcatbound character (len=char_len) :: shortwave, albedo_type, conduct, fbot_xfer_type, & - tfrz_option, saltflux_option, frzpnd, atmbndy, wave_spec_type, snwredist, snw_aging_table + cpl_frazil, tfrz_option, saltflux_option, & + frzpnd, atmbndy, wave_spec_type, snwredist, snw_aging_table - logical (kind=log_kind) :: sw_redist, use_smliq_pnd, snwgrain + logical (kind=log_kind) :: sw_redist, use_smliq_pnd, snwgrain, update_ocn_f real (kind=dbl_kind) :: sw_frac, sw_dtemp ! Flux convergence tolerance @@ -175,7 +176,7 @@ subroutine input_data formdrag, highfreq, natmiter, & atmiter_conv, calc_dragio, & tfrz_option, saltflux_option, ice_ref_salinity, & - default_season, wave_spec_type, & + default_season, wave_spec_type, cpl_frazil, & precip_units, fyear_init, ycycle, & atm_data_type, ocn_data_type, bgc_data_type, & lateral_flux_type, & @@ -217,7 +218,7 @@ subroutine input_data pndaspect_out=pndaspect, hs1_out=hs1, hp1_out=hp1, & ktherm_out=ktherm, calc_Tsfc_out=calc_Tsfc, & floediam_out=floediam, hfrazilmin_out=hfrazilmin, & - update_ocn_f_out = update_ocn_f, & + update_ocn_f_out = update_ocn_f, cpl_frazil_out = cpl_frazil, & conduct_out=conduct, a_rapid_mode_out=a_rapid_mode, & Rac_rapid_mode_out=Rac_rapid_mode, & aspect_rapid_mode_out=aspect_rapid_mode, & @@ -780,6 +781,7 @@ subroutine input_data if (trim(atm_data_type)=='default') & write(nu_diag,1030) ' default_season = ', trim(default_season) + write(nu_diag,1030) ' cpl_frazil = ', trim(cpl_frazil) write(nu_diag,1010) ' update_ocn_f = ', update_ocn_f write(nu_diag,1010) ' wave_spec = ', wave_spec if (wave_spec) & @@ -971,6 +973,7 @@ subroutine input_data floediam_in=floediam, hfrazilmin_in=hfrazilmin, & ktherm_in=ktherm, calc_Tsfc_in=calc_Tsfc, & conduct_in=conduct, a_rapid_mode_in=a_rapid_mode, & + update_ocn_f_in=update_ocn_f, cpl_frazil_in=cpl_frazil, & Rac_rapid_mode_in=Rac_rapid_mode, & aspect_rapid_mode_in=aspect_rapid_mode, & dSdt_slow_mode_in=dSdt_slow_mode, & diff --git a/configuration/driver/icedrv_step.F90 b/configuration/driver/icedrv_step.F90 index 6bb09a383..dc86ac398 100644 --- a/configuration/driver/icedrv_step.F90 +++ b/configuration/driver/icedrv_step.F90 @@ -437,7 +437,7 @@ subroutine step_therm2 (dt) use icedrv_domain_size, only: ncat, nilyr, nslyr, n_aero, nblyr, & nltrcr, nx, nfsd use icedrv_flux, only: fresh, frain, fpond, frzmlt, frazil, frz_onset - use icedrv_flux, only: update_ocn_f, fsalt, Tf, sss, salinz, fhocn, rside, fside, wlat + use icedrv_flux, only: fsalt, Tf, sss, salinz, fhocn, rside, fside, wlat use icedrv_flux, only: meltl, frazil_diag, flux_bio, faero_ocn, fiso_ocn use icedrv_flux, only: HDO_ocn, H2_16O_ocn, H2_18O_ocn use icedrv_init, only: tmask @@ -505,7 +505,7 @@ subroutine step_therm2 (dt) frzmlt=frzmlt(i), frazil=frazil(i), & frain=frain(i), fpond=fpond(i), & fresh=fresh(i), fsalt=fsalt(i), & - fhocn=fhocn(i), update_ocn_f=update_ocn_f, & + fhocn=fhocn(i), & bgrid=bgrid, cgrid=cgrid, & igrid=igrid, faero_ocn=faero_ocn(i,:), & first_ice=first_ice(i,:), & diff --git a/configuration/scripts/icepack_in b/configuration/scripts/icepack_in index 8b7cd51ac..bbf7a5973 100644 --- a/configuration/scripts/icepack_in +++ b/configuration/scripts/icepack_in @@ -110,6 +110,7 @@ calc_dragio = .false. emissivity = 0.985 fbot_xfer_type = 'constant' + cpl_frazil = 'fresh_ice_correction' update_ocn_f = .false. l_mpond_fresh = .false. tfrz_option = 'mushy' diff --git a/configuration/scripts/machines/Macros.derecho_cray b/configuration/scripts/machines/Macros.derecho_cray new file mode 100644 index 000000000..1ead7f5c8 --- /dev/null +++ b/configuration/scripts/machines/Macros.derecho_cray @@ -0,0 +1,47 @@ +#============================================================================== +# Makefile macros for NCAR derecho, cray compiler +#============================================================================== + +CPP := ftn -e P +CPPDEFS := -DFORTRANUNDERSCORE -DNO_R16 ${ICE_CPPDEFS} +CFLAGS := -c -O2 + +FIXEDFLAGS := -132 +FREEFLAGS := +FFLAGS := -hbyteswapio +FFLAGS_NOOPT:= -O0 + +ifeq ($(ICE_BLDDEBUG), true) + FFLAGS += -O0 -hfp0 -g -Rbcdps -Ktrap=fp +else + FFLAGS += -O2 -hfp0 # -eo +endif + +SCC := cc +SFC := ftn +CC := $(SCC) +FC := $(SFC) +LD := $(FC) + +NETCDF_PATH := $(NETCDF) + +#PIO_CONFIG_OPTS:= --enable-filesystem-hints=gpfs + +#PNETCDF_PATH := $(PNETCDF) +#PNETCDF_PATH := /glade/u/apps/ch/opt/pio/2.2/mpt/2.15f/intel/17.0.1/lib + +INCLDIR := $(INCLDIR) + +LIB_NETCDF := $(NETCDF)/lib +#LIB_PNETCDF := $(PNETCDF_PATH)/lib +#LIB_MPI := $(IMPILIBDIR) + +#SLIBS := -L$(LIB_NETCDF) -lnetcdf -lnetcdff -L$(LIB_PNETCDF) -lpnetcdf -lgptl +SLIBS := -L$(LIB_NETCDF) -lnetcdf -lnetcdff + +ifeq ($(ICE_THREADED), true) + LDFLAGS += -qopenmp + CFLAGS += -qopenmp + FFLAGS += -qopenmp +endif + diff --git a/configuration/scripts/machines/Macros.derecho_gnu b/configuration/scripts/machines/Macros.derecho_gnu new file mode 100644 index 000000000..103ff8cdf --- /dev/null +++ b/configuration/scripts/machines/Macros.derecho_gnu @@ -0,0 +1,47 @@ +#============================================================================== +# Makefile macros for NCAR derecho, gnu compiler +#============================================================================== + +CPP := ftn -E +CPPDEFS := -DFORTRANUNDERSCORE ${ICE_CPPDEFS} +CFLAGS := -c + +FIXEDFLAGS := -ffixed-line-length-132 +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 + +SCC := gcc +SFC := gfortran +CC := $(SCC) +FC := $(SFC) +LD := $(FC) + +NETCDF_PATH := $(NETCDF) + +#PIO_CONFIG_OPTS:= --enable-filesystem-hints=gpfs + +#PNETCDF_PATH := $(PNETCDF) +#PNETCDF_PATH := /glade/u/apps/ch/opt/pio/2.2/mpt/2.15f/intel/17.0.1/lib + +INCLDIR := $(INCLDIR) + +LIB_NETCDF := $(NETCDF)/lib +#LIB_PNETCDF := $(PNETCDF_PATH)/lib +#LIB_MPI := $(IMPILIBDIR) + +#SLIBS := -L$(LIB_NETCDF) -lnetcdf -lnetcdff -L$(LIB_PNETCDF) -lpnetcdf -lgptl +SLIBS := -L$(LIB_NETCDF) -lnetcdf -lnetcdff + +ifeq ($(ICE_THREADED), true) + LDFLAGS += -qopenmp + CFLAGS += -qopenmp + FFLAGS += -qopenmp +endif + diff --git a/configuration/scripts/machines/Macros.derecho_intel b/configuration/scripts/machines/Macros.derecho_intel index 27c9a118c..d8d5efc78 100644 --- a/configuration/scripts/machines/Macros.derecho_intel +++ b/configuration/scripts/machines/Macros.derecho_intel @@ -1,5 +1,5 @@ #============================================================================== -# Makefile macros for NCAR cheyenne, intel compiler +# Makefile macros for NCAR derecho, intel compiler #============================================================================== CPP := fpp diff --git a/configuration/scripts/machines/Macros.derecho_intelclassic b/configuration/scripts/machines/Macros.derecho_intelclassic new file mode 100644 index 000000000..85b2faacb --- /dev/null +++ b/configuration/scripts/machines/Macros.derecho_intelclassic @@ -0,0 +1,49 @@ +#============================================================================== +# Makefile macros for NCAR derecho, intelclassic compiler +#============================================================================== + +CPP := fpp +CPPDEFS := -DFORTRANUNDERSCORE ${ICE_CPPDEFS} +CFLAGS := -c -O2 -fp-model precise -march=core-avx2 + +FIXEDFLAGS := -fixed -132 +FREEFLAGS := -free +FFLAGS := -fp-model precise -convert big_endian -assume byterecl -ftz -traceback -march=core-avx2 +FFLAGS_NOOPT:= -O0 + +ifeq ($(ICE_BLDDEBUG), true) + FFLAGS += -O0 -g -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created -link_mpi=dbg +# FFLAGS += -O0 -g -check all -fpe0 -ftrapuv -fp-model except -check noarg_temp_created -link_mpi=dbg -stand f08 +# FFLAGS += -O0 -g -check all -fpe0 -ftrapuv -fp-model except -check noarg_temp_created -init=snan,arrays -link_mpi=dbg +else + FFLAGS += -O2 +endif + +SCC := icc +SFC := ifort +CC := $(SCC) +FC := $(SFC) +LD := $(FC) + +NETCDF_PATH := $(NETCDF) + +#PIO_CONFIG_OPTS:= --enable-filesystem-hints=gpfs + +#PNETCDF_PATH := $(PNETCDF) +#PNETCDF_PATH := /glade/u/apps/ch/opt/pio/2.2/mpt/2.15f/intel/17.0.1/lib + +INCLDIR := $(INCLDIR) + +LIB_NETCDF := $(NETCDF)/lib +#LIB_PNETCDF := $(PNETCDF_PATH)/lib +#LIB_MPI := $(IMPILIBDIR) + +#SLIBS := -L$(LIB_NETCDF) -lnetcdf -lnetcdff -L$(LIB_PNETCDF) -lpnetcdf -lgptl +SLIBS := -L$(LIB_NETCDF) -lnetcdf -lnetcdff + +ifeq ($(ICE_THREADED), true) + LDFLAGS += -qopenmp + CFLAGS += -qopenmp + FFLAGS += -qopenmp +endif + diff --git a/configuration/scripts/machines/Macros.derecho_inteloneapi b/configuration/scripts/machines/Macros.derecho_inteloneapi new file mode 100644 index 000000000..df7d5b42f --- /dev/null +++ b/configuration/scripts/machines/Macros.derecho_inteloneapi @@ -0,0 +1,49 @@ +#============================================================================== +# Makefile macros for NCAR derecho, inteloneapi compiler +#============================================================================== + +CPP := fpp +CPPDEFS := -DFORTRANUNDERSCORE ${ICE_CPPDEFS} +CFLAGS := -c -O2 -fp-model precise -march=core-avx2 + +FIXEDFLAGS := -fixed -132 +FREEFLAGS := -free +FFLAGS := -fp-model precise -convert big_endian -assume byterecl -ftz -traceback -march=core-avx2 +FFLAGS_NOOPT:= -O0 + +ifeq ($(ICE_BLDDEBUG), true) + FFLAGS += -O0 -g -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created -link_mpi=dbg +# FFLAGS += -O0 -g -check all -fpe0 -ftrapuv -fp-model except -check noarg_temp_created -link_mpi=dbg -stand f08 +# FFLAGS += -O0 -g -check all -fpe0 -ftrapuv -fp-model except -check noarg_temp_created -init=snan,arrays -link_mpi=dbg +else + FFLAGS += -O2 +endif + +SCC := icx +SFC := ifx +CC := $(SCC) +FC := $(SFC) +LD := $(FC) + +NETCDF_PATH := $(NETCDF) + +#PIO_CONFIG_OPTS:= --enable-filesystem-hints=gpfs + +#PNETCDF_PATH := $(PNETCDF) +#PNETCDF_PATH := /glade/u/apps/ch/opt/pio/2.2/mpt/2.15f/intel/17.0.1/lib + +INCLDIR := $(INCLDIR) + +LIB_NETCDF := $(NETCDF)/lib +#LIB_PNETCDF := $(PNETCDF_PATH)/lib +#LIB_MPI := $(IMPILIBDIR) + +#SLIBS := -L$(LIB_NETCDF) -lnetcdf -lnetcdff -L$(LIB_PNETCDF) -lpnetcdf -lgptl +SLIBS := -L$(LIB_NETCDF) -lnetcdf -lnetcdff + +ifeq ($(ICE_THREADED), true) + LDFLAGS += -qopenmp + CFLAGS += -qopenmp + FFLAGS += -qopenmp +endif + diff --git a/configuration/scripts/machines/Macros.derecho_nvhpc b/configuration/scripts/machines/Macros.derecho_nvhpc new file mode 100644 index 000000000..3478b8516 --- /dev/null +++ b/configuration/scripts/machines/Macros.derecho_nvhpc @@ -0,0 +1,53 @@ +#============================================================================== +# Makefile macros for NCAR derecho, nvhpc compiler +#============================================================================== + +CPP := nvc -Mcpp +CPPDEFS := -DFORTRANUNDERSCORE -DNO_R16 ${ICE_CPPDEFS} +CFLAGS := -c -Kieee + +FIXEDFLAGS := -Mfixed +FREEFLAGS := -Mfree +FFLAGS := -Kieee -byteswapio -traceback +FFLAGS_NOOPT:= -O0 + +ifeq ($(ICE_BLDDEBUG), true) +# FFLAGS += -O0 -g -Ktrap=fp -Mbounds -Mchkptr +# FFLAGS += -O0 -g -Ktrap=fp -Mbounds +# FFLAGS += -O0 -Ktrap=fp -Mbounds -Mchkptr + FFLAGS += -O0 -Ktrap=fp + CFLAGS += -O0 +else +# FFLAGS += -O2 -Mnofma -target=zen3 + FFLAGS += -O2 + CFLAGS += -O2 +endif + +SCC := nvc +SFC := nvfortran +CC := $(SCC) +FC := $(SFC) +LD := $(FC) + +NETCDF_PATH := $(NETCDF) + +#PIO_CONFIG_OPTS:= --enable-filesystem-hints=gpfs + +#PNETCDF_PATH := $(PNETCDF) +#PNETCDF_PATH := /glade/u/apps/ch/opt/pio/2.2/mpt/2.15f/intel/17.0.1/lib + +INCLDIR := $(INCLDIR) + +LIB_NETCDF := $(NETCDF)/lib +#LIB_PNETCDF := $(PNETCDF_PATH)/lib +#LIB_MPI := $(IMPILIBDIR) + +#SLIBS := -L$(LIB_NETCDF) -lnetcdf -lnetcdff -L$(LIB_PNETCDF) -lpnetcdf -lgptl +SLIBS := -L$(LIB_NETCDF) -lnetcdf -lnetcdff + +ifeq ($(ICE_THREADED), true) + LDFLAGS += -qopenmp + CFLAGS += -qopenmp + FFLAGS += -qopenmp +endif + diff --git a/configuration/scripts/machines/env.cheyenne_gnu b/configuration/scripts/machines/env.cheyenne_gnu index 7e9f18215..ab08fbcbf 100755 --- a/configuration/scripts/machines/env.cheyenne_gnu +++ b/configuration/scripts/machines/env.cheyenne_gnu @@ -7,21 +7,21 @@ endif if ("$inp" != "-nomodules") then -source /glade/u/apps/ch/opt/lmod/7.2.1/lmod/7.2.1/init/csh +source ${MODULESHOME}/init/csh module purge -module load ncarenv/1.2 -module load gnu/8.3.0 -module load mpt/2.19 +module load ncarenv/1.3 +module load gnu/10.1.0 +module load mpt/2.25 module load ncarcompilers/0.5.0 -module load netcdf/4.6.3 +module load netcdf/4.8.1 endif setenv ICE_MACHINE_MACHNAME cheyenne setenv ICE_MACHINE_MACHINFO "SGI ICE XA Xeon E5-2697V4 Broadwell" setenv ICE_MACHINE_ENVNAME gnu -setenv ICE_MACHINE_ENVINFO "GNU Fortran (GCC) 8.3.0" +setenv ICE_MACHINE_ENVINFO "GNU Fortran (GCC) 10.1.0" setenv ICE_MACHINE_MAKE gmake setenv ICE_MACHINE_WKDIR /glade/scratch/$user/ICEPACK_RUNS setenv ICE_MACHINE_INPUTDATA /glade/p/cesm/pcwg_dev diff --git a/configuration/scripts/machines/env.cheyenne_intel b/configuration/scripts/machines/env.cheyenne_intel index 4aaf7cf26..b9975527b 100755 --- a/configuration/scripts/machines/env.cheyenne_intel +++ b/configuration/scripts/machines/env.cheyenne_intel @@ -7,21 +7,21 @@ endif if ("$inp" != "-nomodules") then -source /glade/u/apps/ch/opt/lmod/7.2.1/lmod/7.2.1/init/csh +source ${MODULESHOME}/init/csh module purge -module load ncarenv/1.2 -module load intel/19.0.2 -module load mpt/2.19 +module load ncarenv/1.3 +module load intel/19.1.1 +module load mpt/2.25 module load ncarcompilers/0.5.0 -module load netcdf/4.6.3 +module load netcdf/4.8.1 endif setenv ICE_MACHINE_MACHNAME cheyenne setenv ICE_MACHINE_MACHINFO "SGI ICE XA Xeon E5-2697V4 Broadwell" setenv ICE_MACHINE_ENVNAME intel -setenv ICE_MACHINE_ENVINFO "ifort 19.0.2.187 20190117" +setenv ICE_MACHINE_ENVINFO "ifort 19.1.1.217 20200306" setenv ICE_MACHINE_MAKE gmake setenv ICE_MACHINE_WKDIR /glade/scratch/$user/ICEPACK_RUNS setenv ICE_MACHINE_INPUTDATA /glade/p/cesm/pcwg_dev diff --git a/configuration/scripts/machines/env.cheyenne_pgi b/configuration/scripts/machines/env.cheyenne_pgi index 51d4d1679..05a902bad 100755 --- a/configuration/scripts/machines/env.cheyenne_pgi +++ b/configuration/scripts/machines/env.cheyenne_pgi @@ -7,21 +7,21 @@ endif if ("$inp" != "-nomodules") then -source /glade/u/apps/ch/opt/lmod/7.2.1/lmod/7.2.1/init/csh +source ${MODULESHOME}/init/csh module purge -module load ncarenv/1.2 -module load pgi/19.9 -module load mpt/2.21 +module load ncarenv/1.3 +module load pgi/20.4 +module load mpt/2.22 module load ncarcompilers/0.5.0 -module load netcdf/4.7.3 +module load netcdf/4.7.4 endif setenv ICE_MACHINE_MACHNAME cheyenne setenv ICE_MACHINE_MACHINFO "SGI ICE XA Xeon E5-2697V4 Broadwell" setenv ICE_MACHINE_ENVNAME pgi -setenv ICE_MACHINE_ENVINFO "pgf90 19.9-0" +setenv ICE_MACHINE_ENVINFO "pgf90 20.4-0" setenv ICE_MACHINE_MAKE gmake setenv ICE_MACHINE_WKDIR /glade/scratch/$user/ICEPACK_RUNS setenv ICE_MACHINE_INPUTDATA /glade/p/cesm/pcwg_dev diff --git a/configuration/scripts/machines/env.derecho_cray b/configuration/scripts/machines/env.derecho_cray new file mode 100644 index 000000000..1fc814594 --- /dev/null +++ b/configuration/scripts/machines/env.derecho_cray @@ -0,0 +1,51 @@ +#!/bin/csh -f + +set inp = "undefined" +if ($#argv == 1) then + set inp = $1 +endif + +if ("$inp" != "-nomodules") then + +source ${MODULESHOME}/init/csh + +module --force purge +module load ncarenv/23.06 +module load craype +module load cce/15.0.1 +module load ncarcompilers +#module load cray-mpich/8.1.25 +#module load hdf5/1.12.2 +module load netcdf/4.9.2 +module load cray-libsci/23.02.1.1 + +# For perftools with mpiexec +# module load perftools-base +# module load perftools +#setenv PALS_TRANSFER FALSE + +endif + +limit coredumpsize unlimited +limit stacksize unlimited +setenv PALS_QUIET TRUE + +# May be needed for OpenMP memory +setenv OMP_STACKSIZE 64M +# OMP runtime diagnostics +#setenv OMP_DISPLAY_ENV TRUE + +setenv ICE_MACHINE_MACHNAME derecho +setenv ICE_MACHINE_MACHINFO "HPE Cray EX Milan Slingshot 11" +setenv ICE_MACHINE_ENVNAME cray +setenv ICE_MACHINE_ENVINFO "cce 15.0.1, netcdf4.9.2" +setenv ICE_MACHINE_MAKE gmake +setenv ICE_MACHINE_WKDIR /glade/derecho/scratch/$user/ICEPACK_RUNS +setenv ICE_MACHINE_INPUTDATA /glade/p/cesm/pcwg_dev +setenv ICE_MACHINE_BASELINE /glade/derecho/scratch/$user/ICEPACK_BASELINE +setenv ICE_MACHINE_SUBMIT "qsub" +setenv ICE_MACHINE_ACCT P00000000 +setenv ICE_MACHINE_QUEUE "main" +setenv ICE_MACHINE_TPNODE 128 +setenv ICE_MACHINE_BLDTHRDS 1 +setenv ICE_MACHINE_QSTAT "qstat " diff --git a/configuration/scripts/machines/env.derecho_gnu b/configuration/scripts/machines/env.derecho_gnu new file mode 100644 index 000000000..3c45d71bf --- /dev/null +++ b/configuration/scripts/machines/env.derecho_gnu @@ -0,0 +1,51 @@ +#!/bin/csh -f + +set inp = "undefined" +if ($#argv == 1) then + set inp = $1 +endif + +if ("$inp" != "-nomodules") then + +source ${MODULESHOME}/init/csh + +module --force purge +module load ncarenv/23.06 +module load craype +module load gcc/12.2.0 +module load ncarcompilers +#module load cray-mpich/8.1.25 +#module load hdf5/1.12.2 +module load netcdf/4.9.2 +module load cray-libsci/23.02.1.1 + +# For perftools with mpiexec +# module load perftools-base +# module load perftools +#setenv PALS_TRANSFER FALSE + +endif + +limit coredumpsize unlimited +limit stacksize unlimited +setenv PALS_QUIET TRUE + +# May be needed for OpenMP memory +setenv OMP_STACKSIZE 64M +# OMP runtime diagnostics +#setenv OMP_DISPLAY_ENV TRUE + +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, netcdf4.9.2" +setenv ICE_MACHINE_MAKE gmake +setenv ICE_MACHINE_WKDIR /glade/derecho/scratch/$user/ICEPACK_RUNS +setenv ICE_MACHINE_INPUTDATA /glade/p/cesm/pcwg_dev +setenv ICE_MACHINE_BASELINE /glade/derecho/scratch/$user/ICEPACK_BASELINE +setenv ICE_MACHINE_SUBMIT "qsub" +setenv ICE_MACHINE_ACCT P00000000 +setenv ICE_MACHINE_QUEUE "main" +setenv ICE_MACHINE_TPNODE 128 +setenv ICE_MACHINE_BLDTHRDS 1 +setenv ICE_MACHINE_QSTAT "qstat " diff --git a/configuration/scripts/machines/env.derecho_intelclassic b/configuration/scripts/machines/env.derecho_intelclassic new file mode 100644 index 000000000..7bd8e5dff --- /dev/null +++ b/configuration/scripts/machines/env.derecho_intelclassic @@ -0,0 +1,51 @@ +#!/bin/csh -f + +set inp = "undefined" +if ($#argv == 1) then + set inp = $1 +endif + +if ("$inp" != "-nomodules") then + +source ${MODULESHOME}/init/csh + +module --force purge +module load ncarenv/23.06 +module load craype +module load intel-classic/2023.0.0 +module load ncarcompilers +#module load cray-mpich/8.1.25 +#module load hdf5/1.12.2 +module load netcdf/4.9.2 +#module load cray-libsci/23.02.1.1 + +# For perftools with mpiexec +# module load perftools-base +# module load perftools +#setenv PALS_TRANSFER FALSE + +endif + +limit coredumpsize unlimited +limit stacksize unlimited +setenv PALS_QUIET TRUE + +# May be needed for OpenMP memory +setenv OMP_STACKSIZE 64M +# OMP runtime diagnostics +#setenv OMP_DISPLAY_ENV TRUE + +setenv ICE_MACHINE_MACHNAME derecho +setenv ICE_MACHINE_MACHINFO "HPE Cray EX Milan Slingshot 11" +setenv ICE_MACHINE_ENVNAME intelclassic +setenv ICE_MACHINE_ENVINFO "icc/ifort 2021.8.0 20221119, netcdf4.9.2" +setenv ICE_MACHINE_MAKE gmake +setenv ICE_MACHINE_WKDIR /glade/derecho/scratch/$user/ICEPACK_RUNS +setenv ICE_MACHINE_INPUTDATA /glade/p/cesm/pcwg_dev +setenv ICE_MACHINE_BASELINE /glade/derecho/scratch/$user/ICEPACK_BASELINE +setenv ICE_MACHINE_SUBMIT "qsub" +setenv ICE_MACHINE_ACCT P00000000 +setenv ICE_MACHINE_QUEUE "main" +setenv ICE_MACHINE_TPNODE 128 +setenv ICE_MACHINE_BLDTHRDS 1 +setenv ICE_MACHINE_QSTAT "qstat " diff --git a/configuration/scripts/machines/env.derecho_inteloneapi b/configuration/scripts/machines/env.derecho_inteloneapi new file mode 100644 index 000000000..09cdf7291 --- /dev/null +++ b/configuration/scripts/machines/env.derecho_inteloneapi @@ -0,0 +1,51 @@ +#!/bin/csh -f + +set inp = "undefined" +if ($#argv == 1) then + set inp = $1 +endif + +if ("$inp" != "-nomodules") then + +source ${MODULESHOME}/init/csh + +module --force purge +module load ncarenv/23.06 +module load craype +module load intel-oneapi/2023.0.0 +module load ncarcompilers +#module load cray-mpich/8.1.25 +#module load hdf5/1.12.2 +module load netcdf/4.9.2 +module load cray-libsci/23.02.1.1 + +# For perftools with mpiexec +# module load perftools-base +# module load perftools +#setenv PALS_TRANSFER FALSE + +endif + +limit coredumpsize unlimited +limit stacksize unlimited +setenv PALS_QUIET TRUE + +# May be needed for OpenMP memory +setenv OMP_STACKSIZE 64M +# OMP runtime diagnostics +#setenv OMP_DISPLAY_ENV TRUE + +setenv ICE_MACHINE_MACHNAME derecho +setenv ICE_MACHINE_MACHINFO "HPE Cray EX Milan Slingshot 11" +setenv ICE_MACHINE_ENVNAME inteloneapi +setenv ICE_MACHINE_ENVINFO "ifx 2023.0.0 20221201, netcdf4.9.2" +setenv ICE_MACHINE_MAKE gmake +setenv ICE_MACHINE_WKDIR /glade/derecho/scratch/$user/ICEPACK_RUNS +setenv ICE_MACHINE_INPUTDATA /glade/p/cesm/pcwg_dev +setenv ICE_MACHINE_BASELINE /glade/derecho/scratch/$user/ICEPACK_BASELINE +setenv ICE_MACHINE_SUBMIT "qsub" +setenv ICE_MACHINE_ACCT P00000000 +setenv ICE_MACHINE_QUEUE "main" +setenv ICE_MACHINE_TPNODE 128 +setenv ICE_MACHINE_BLDTHRDS 1 +setenv ICE_MACHINE_QSTAT "qstat " diff --git a/configuration/scripts/machines/env.derecho_nvhpc b/configuration/scripts/machines/env.derecho_nvhpc new file mode 100644 index 000000000..32f4d1aca --- /dev/null +++ b/configuration/scripts/machines/env.derecho_nvhpc @@ -0,0 +1,51 @@ +#!/bin/csh -f + +set inp = "undefined" +if ($#argv == 1) then + set inp = $1 +endif + +if ("$inp" != "-nomodules") then + +source ${MODULESHOME}/init/csh + +module --force purge +module load ncarenv/23.06 +module load craype +module load nvhpc/23.5 +module load ncarcompilers +#module load cray-mpich/8.1.25 +#module load hdf5/1.12.2 +module load netcdf/4.9.2 +module load cray-libsci/23.02.1.1 + +# For perftools with mpiexec +# module load perftools-base +# module load perftools +#setenv PALS_TRANSFER FALSE + +endif + +limit coredumpsize unlimited +limit stacksize unlimited +setenv PALS_QUIET TRUE + +# May be needed for OpenMP memory +setenv OMP_STACKSIZE 64M +# OMP runtime diagnostics +#setenv OMP_DISPLAY_ENV TRUE + +setenv ICE_MACHINE_MACHNAME derecho +setenv ICE_MACHINE_MACHINFO "HPE Cray EX Milan Slingshot 11" +setenv ICE_MACHINE_ENVNAME nvhpc +setenv ICE_MACHINE_ENVINFO "nvc 23.5-0, netcdf4.9.2" +setenv ICE_MACHINE_MAKE gmake +setenv ICE_MACHINE_WKDIR /glade/derecho/scratch/$user/ICEPACK_RUNS +setenv ICE_MACHINE_INPUTDATA /glade/p/cesm/pcwg_dev +setenv ICE_MACHINE_BASELINE /glade/derecho/scratch/$user/ICEPACK_BASELINE +setenv ICE_MACHINE_SUBMIT "qsub" +setenv ICE_MACHINE_ACCT P00000000 +setenv ICE_MACHINE_QUEUE "main" +setenv ICE_MACHINE_TPNODE 128 +setenv ICE_MACHINE_BLDTHRDS 1 +setenv ICE_MACHINE_QSTAT "qstat " diff --git a/configuration/scripts/options/set_nml.alt04 b/configuration/scripts/options/set_nml.alt04 index ba5a54670..c416a2729 100644 --- a/configuration/scripts/options/set_nml.alt04 +++ b/configuration/scripts/options/set_nml.alt04 @@ -14,6 +14,7 @@ krdg_redist = 0 calc_Tsfc = .true. highfreq = .true. + cpl_frazil = 'internal' update_ocn_f = .true. l_mpond_fresh = .true. restore_ocn = .true. diff --git a/doc/source/conf.py b/doc/source/conf.py index c512c61fa..6a6aa7cc0 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -54,7 +54,7 @@ # General information about the project. project = u'Icepack' -copyright = u'2022, Triad National Security, LLC (code) and National Center for Atmospheric Research (documentation)' +copyright = u'2023, Triad National Security, LLC (code) and National Center for Atmospheric Research (documentation)' author = u'CICE-Consortium' # The version info for the project you're documenting, acts as replacement for @@ -62,9 +62,9 @@ # built documents. # # The short X.Y version. -version = u'1.3.3' +version = u'1.3.4' # The full version, including alpha/beta/rc tags. -version = u'1.3.3' +version = u'1.3.4' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/source/icepack_index.rst b/doc/source/icepack_index.rst index 5bcec1a97..5c01ab388 100755 --- a/doc/source/icepack_index.rst +++ b/doc/source/icepack_index.rst @@ -92,6 +92,7 @@ either Celsius or Kelvin units). Deprecated parameters are listed at the end. "cp_wv", "specific heat of water vapor", "1.81x\ :math:`10^3` J/kg/K" "cp063", "diffuse fresnel reflectivity (above)", "0.063" "cp455", "diffuse fresnel reflectivity (below)", "0.455" + "cpl_frazil", ":math:`\bullet` type of frazil ice coupling", "" "Cs", "fraction of shear energy contributing to ridging", "0.25" "Cstar", "constant in Hibler ice strength formula", "20." "**D**", "", "" diff --git a/doc/source/intro/copyright.rst b/doc/source/intro/copyright.rst index 86b15b8d2..e477d9d57 100755 --- a/doc/source/intro/copyright.rst +++ b/doc/source/intro/copyright.rst @@ -5,7 +5,7 @@ Copyright ============================= -© Copyright 2022, Triad National Security LLC. All rights reserved. +© Copyright 2023, Triad National Security LLC. All rights reserved. This software was produced under U.S. Government contract 89233218CNA000001 for Los Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC for the U.S. Department diff --git a/doc/source/science_guide/sg_boundary_forcing.rst b/doc/source/science_guide/sg_boundary_forcing.rst index 5d99962d3..c7715228d 100755 --- a/doc/source/science_guide/sg_boundary_forcing.rst +++ b/doc/source/science_guide/sg_boundary_forcing.rst @@ -278,9 +278,20 @@ In addition to runoff from rain and melted snow, the fresh water flux and water frozen (a negative flux) or melted at the bottom surface of the ice. This flux is computed as the net change of fresh water in the ice and snow volume over the coupling time step, excluding frazil ice -formation and newly accumulated snow. Setting the namelist option +formation and newly accumulated snow. + +Setting the namelist option ``update_ocn_f`` to true causes frazil ice to be included in the fresh -water and salt fluxes. +water and salt fluxes. Some ocean models compute the frazil ice fluxes, +which then might need to be corrected for consistency with mushy physics. +This behavior is controlled using a combination of ``update_ocn_f``, +``cpl_frazil`` and ``ktherm``. In particular, +``cpl_frazil = 'external'`` assumes that the frazil ice fluxes are +handled entirely outside of Icepack. When ``ktherm=2``, +``cpl_frazil = 'fresh_ice_correction'`` +sends coupling fluxes representing the difference between the mushy frazil +fluxes and fluxes computed assuming the frazil is purely fresh ice. +Otherwise the internally computed frazil fluxes are sent to the coupler. There is a flux of salt into the ocean under melting conditions, and a (negative) flux when sea water is freezing. However, melting sea ice diff --git a/doc/source/user_guide/interfaces.include b/doc/source/user_guide/interfaces.include index cfedb8697..7c8d3589d 100644 --- a/doc/source/user_guide/interfaces.include +++ b/doc/source/user_guide/interfaces.include @@ -794,7 +794,8 @@ icepack_init_parameters argcheck_in, puny_in, bignum_in, pi_in, secday_in, & rhos_in, rhoi_in, rhow_in, cp_air_in, emissivity_in, & cp_ice_in, cp_ocn_in, hfrazilmin_in, floediam_in, & - depressT_in, dragio_in, thickness_ocn_layer1_in, iceruf_ocn_in, albocn_in, gravit_in, viscosity_dyn_in, & + depressT_in, dragio_in, thickness_ocn_layer1_in, iceruf_ocn_in, & + albocn_in, gravit_in, viscosity_dyn_in, & Tocnfrz_in, rhofresh_in, zvir_in, vonkar_in, cp_wv_in, & stefan_boltzmann_in, ice_ref_salinity_in, & Tffresh_in, Lsub_in, Lvap_in, Timelt_in, Tsmelt_in, & @@ -807,6 +808,7 @@ icepack_init_parameters qqqice_in, TTTice_in, qqqocn_in, TTTocn_in, & ktherm_in, conduct_in, fbot_xfer_type_in, calc_Tsfc_in, dts_b_in, & update_ocn_f_in, ustar_min_in, a_rapid_mode_in, & + cpl_frazil_in, & Rac_rapid_mode_in, aspect_rapid_mode_in, & dSdt_slow_mode_in, phi_c_slow_mode_in, & phi_i_mushy_in, shortwave_in, albedo_type_in, albsnowi_in, & @@ -899,8 +901,9 @@ icepack_init_parameters ! 2 = mushy layer theory character (len=*), intent(in), optional :: & - conduct_in, & ! 'MU71' or 'bubbly' - fbot_xfer_type_in ! transfer coefficient type for ice-ocean heat flux + conduct_in, & ! 'MU71' or 'bubbly' + fbot_xfer_type_in, & ! transfer coefficient type for ice-ocean heat flux + cpl_frazil_in ! type of coupling for frazil ice logical (kind=log_kind), intent(in), optional :: & calc_Tsfc_in , &! if true, calculate surface temperature @@ -1209,7 +1212,7 @@ icepack_query_parameters zref_out, hs_min_out, snowpatch_out, rhosi_out, sk_l_out, & saltmax_out, phi_init_out, min_salin_out, salt_loss_out, & min_bgc_out, dSin0_frazil_out, hi_ssl_out, hs_ssl_out, & - awtvdr_out, awtidr_out, awtvdf_out, awtidf_out, & + awtvdr_out, awtidr_out, awtvdf_out, awtidf_out, cpl_frazil_out, & qqqice_out, TTTice_out, qqqocn_out, TTTocn_out, update_ocn_f_out, & Lfresh_out, cprho_out, Cp_out, ustar_min_out, a_rapid_mode_out, & ktherm_out, conduct_out, fbot_xfer_type_out, calc_Tsfc_out, dts_b_out, & @@ -1314,8 +1317,9 @@ icepack_query_parameters ! 2 = mushy layer theory character (len=*), intent(out), optional :: & - conduct_out, & ! 'MU71' or 'bubbly' - fbot_xfer_type_out ! transfer coefficient type for ice-ocean heat flux + conduct_out, & ! 'MU71' or 'bubbly' + fbot_xfer_type_out, & ! transfer coefficient type for ice-ocean heat flux + cpl_frazil_out ! type of coupling for frazil ice logical (kind=log_kind), intent(out), optional :: & calc_Tsfc_out ,&! if true, calculate surface temperature @@ -1990,6 +1994,8 @@ icepack_step_therm2 d_afsd_latm, d_afsd_weld, & floe_rad_c, floe_binwidth) + use icepack_parameters, only: icepack_init_parameters + integer (kind=int_kind), intent(in) :: & ncat , & ! number of thickness categories nltrcr , & ! number of zbgc tracers @@ -2000,7 +2006,7 @@ icepack_step_therm2 integer (kind=int_kind), intent(in), optional :: & nfsd ! number of floe size categories - logical (kind=log_kind), intent(in) :: & + logical (kind=log_kind), intent(in), optional :: & update_ocn_f ! if true, update fresh water and salt fluxes real (kind=dbl_kind), dimension(0:ncat), intent(inout) :: & @@ -2561,7 +2567,7 @@ icepack_init_tracer_flags tr_pond_in , & ! if .true., use melt pond tracer tr_pond_lvl_in , & ! if .true., use level-ice pond tracer tr_pond_topo_in , & ! if .true., use explicit topography-based ponds - tr_snow_in , & ! if .true., use snow metamorphosis tracers + tr_snow_in , & ! if .true., use snow redistribution or metamorphosis tracers tr_fsd_in , & ! if .true., use floe size distribution tracers tr_iso_in , & ! if .true., use isotope tracers tr_aero_in , & ! if .true., use aerosol tracers @@ -2604,7 +2610,7 @@ icepack_query_tracer_flags tr_pond_out , & ! if .true., use melt pond tracer tr_pond_lvl_out , & ! if .true., use level-ice pond tracer tr_pond_topo_out , & ! if .true., use explicit topography-based ponds - tr_snow_out , & ! if .true., use snow metamorphosis tracers + tr_snow_out , & ! if .true., use snow redistribution or metamorphosis tracers tr_fsd_out , & ! if .true., use floe size distribution tr_iso_out , & ! if .true., use isotope tracers tr_aero_out , & ! if .true., use aerosol tracers diff --git a/doc/source/user_guide/ug_case_settings.rst b/doc/source/user_guide/ug_case_settings.rst index 5d34dfc8e..1b286a758 100644 --- a/doc/source/user_guide/ug_case_settings.rst +++ b/doc/source/user_guide/ug_case_settings.rst @@ -377,6 +377,9 @@ forcing_nml "", "``minus1p8``", "constant ocean freezing temperature (:math:`-1.8^{\circ} C`)", "" "", "``mushy``", "matches mushy-layer thermo (ktherm=2)", "" "``trestore``", "integer", "sst restoring time scale (days)", "90" + "``cpl_frazil``", "``external``", "frazil water/salt fluxes are handled outside of Icepack", "``fresh_ice_correction``" + "", "``fresh_ice_correction``", "correct fresh-ice frazil water/salt fluxes for mushy physics", "" + "", "``internal``", "send full frazil water/salt fluxes for mushy physics", "" "``update_ocn_f``", "``.false.``", "do not include frazil water/salt fluxes in ocn fluxes", "``.false.``" "", "``true``", "include frazil water/salt fluxes in ocn fluxes", "" "``ustar_min``", "real", "minimum value of ocean friction velocity in m/s", "0.005"