Skip to content

Commit

Permalink
Merge pull request #24 from apcraig/icep230524
Browse files Browse the repository at this point in the history
Update Icepack from Consortium main #6703bc5 May 24, 2023
  • Loading branch information
eclare108213 authored May 26, 2023
2 parents e3e36a7 + c0719d8 commit 2fc81b4
Show file tree
Hide file tree
Showing 16 changed files with 317 additions and 88 deletions.
29 changes: 29 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.7"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/source/conf.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
# formats:
# - pdf

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: doc/requirements.txt
3 changes: 3 additions & 0 deletions columnphysics/icepack_kinds.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#ifdef CCSMCOUPLED
#define CESMCOUPLED
#endif
!=======================================================================

! Defines variable precision for all common data types
Expand Down
68 changes: 31 additions & 37 deletions columnphysics/icepack_mushy_physics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,10 @@ module icepack_mushy_physics
!=======================================================================
! Physical Quantities
!=======================================================================
! Detemine the conductivity of the mush from enthalpy and salinity

subroutine conductivity_mush_array(nilyr, zqin, zSin, km)

! detemine the conductivity of the mush from enthalpy and salinity

integer (kind=int_kind), intent(in) :: &
nilyr ! number of ice layers

Expand Down Expand Up @@ -101,17 +100,19 @@ subroutine conductivity_mush_array(nilyr, zqin, zSin, km)
end subroutine conductivity_mush_array

!=======================================================================
!autodocument_start icepack_mushy_density_brine
! Compute density of brine from brine salinity

function icepack_mushy_density_brine(Sbr) result(rho)

! density of brine from brine salinity

real(kind=dbl_kind), intent(in) :: &
Sbr ! brine salinity (ppt)

real(kind=dbl_kind) :: &
rho ! brine density (kg m-3)

!autodocument_end

real(kind=dbl_kind), parameter :: &
a = 1000.3_dbl_kind , & ! zeroth empirical coefficient
b = 0.78237_dbl_kind , & ! linear empirical coefficient
Expand All @@ -126,11 +127,10 @@ end function icepack_mushy_density_brine
!=======================================================================
! Snow
!=======================================================================
! Heat conductivity of the snow

subroutine conductivity_snow_array(ks)

! heat conductivity of the snow

real(kind=dbl_kind), dimension(:), intent(out) :: &
ks ! snow layer conductivity (W m-1 K-1)

Expand All @@ -141,11 +141,10 @@ subroutine conductivity_snow_array(ks)
end subroutine conductivity_snow_array

!=======================================================================
! Enthalpy of snow from snow temperature

function enthalpy_snow(zTsn) result(zqsn)

! enthalpy of snow from snow temperature

real(kind=dbl_kind), intent(in) :: &
zTsn ! snow layer temperature (C)

Expand All @@ -159,11 +158,10 @@ function enthalpy_snow(zTsn) result(zqsn)
end function enthalpy_snow

!=======================================================================
! Temperature of snow from the snow enthalpy

function temperature_snow(zqsn) result(zTsn)

! temperature of snow from the snow enthalpy

real(kind=dbl_kind), intent(in) :: &
zqsn ! snow layer enthalpy (J m-3)

Expand All @@ -182,12 +180,11 @@ end function temperature_snow
!=======================================================================
! Mushy Layer Formulation - Assur (1958) liquidus
!=======================================================================
! Liquidus relation: equilibrium brine salinity as function of temperature
! based on empirical data from Assur (1958)

function liquidus_brine_salinity_mush(zTin) result(Sbr)

! liquidus relation: equilibrium brine salinity as function of temperature
! based on empirical data from Assur (1958)

real(kind=dbl_kind), intent(in) :: &
zTin ! ice layer temperature (C)

Expand Down Expand Up @@ -223,12 +220,11 @@ function liquidus_brine_salinity_mush(zTin) result(Sbr)
end function liquidus_brine_salinity_mush

!=======================================================================
! Liquidus relation: equilibrium temperature as function of brine salinity
! based on empirical data from Assur (1958)

function liquidus_temperature_mush(Sbr) result(zTin)

! liquidus relation: equilibrium temperature as function of brine salinity
! based on empirical data from Assur (1958)

real(kind=dbl_kind), intent(in) :: &
Sbr ! ice brine salinity (ppt)

Expand Down Expand Up @@ -264,11 +260,10 @@ function liquidus_temperature_mush(Sbr) result(zTin)
end function liquidus_temperature_mush

!=======================================================================
! Enthalpy of mush from mush temperature and bulk salinity

function enthalpy_mush(zTin, zSin) result(zqin)

! enthalpy of mush from mush temperature and bulk salinity

real(kind=dbl_kind), intent(in) :: &
zTin, & ! ice layer temperature (C)
zSin ! ice layer bulk salinity (ppt)
Expand All @@ -289,11 +284,10 @@ function enthalpy_mush(zTin, zSin) result(zqin)
end function enthalpy_mush

!=======================================================================
! Enthalpy of mush from mush temperature and liquid fraction

function enthalpy_mush_liquid_fraction(zTin, phi) result(zqin)

! enthalpy of mush from mush temperature and bulk salinity

real(kind=dbl_kind), intent(in) :: &
zTin, & ! ice layer temperature (C)
phi ! liquid fraction
Expand All @@ -309,12 +303,11 @@ function enthalpy_mush_liquid_fraction(zTin, phi) result(zqin)
end function enthalpy_mush_liquid_fraction

!=======================================================================
! Enthalpy of melting of mush from bulk salinity
! Energy needed to fully melt mush (T < 0)

function enthalpy_of_melting(zSin) result(qm)

! enthalpy of melting of mush
! energy needed to fully melt mush (T < 0)

real(kind=dbl_kind), intent(in) :: &
zSin ! ice layer bulk salinity (ppt)

Expand All @@ -328,11 +321,10 @@ function enthalpy_of_melting(zSin) result(qm)
end function enthalpy_of_melting

!=======================================================================
! Enthalpy of brine (fully liquid) from temperature

function enthalpy_brine(zTin) result(qbr)

! enthalpy of brine (fully liquid)

real(kind=dbl_kind), intent(in) :: &
zTin ! ice layer temperature (C)

Expand All @@ -346,18 +338,20 @@ function enthalpy_brine(zTin) result(qbr)
end function enthalpy_brine

!=======================================================================
!autodocument_start icepack_mushy_temperature_mush
! Temperature of mush from mush enthalpy and bulk salinity

function icepack_mushy_temperature_mush(zqin, zSin) result(zTin)

! temperature of mush from mush enthalpy

real(kind=dbl_kind), intent(in) :: &
zqin , & ! ice enthalpy (J m-3)
zSin ! ice layer bulk salinity (ppt)

real(kind=dbl_kind) :: &
zTin ! ice layer temperature (C)

!autodocument_end

real(kind=dbl_kind) :: &
qb , & ! liquidus break enthalpy
q0 , & ! fully melted enthalpy
Expand Down Expand Up @@ -454,11 +448,10 @@ function icepack_mushy_temperature_mush(zqin, zSin) result(zTin)
end function icepack_mushy_temperature_mush

!=======================================================================
! Temperature of mush from mush enthalpy and liquid fraction

function temperature_mush_liquid_fraction(zqin, phi) result(zTin)

! temperature of mush from mush enthalpy

real(kind=dbl_kind), intent(in) :: &
zqin , & ! ice enthalpy (J m-3)
phi ! liquid fraction
Expand All @@ -474,11 +467,10 @@ function temperature_mush_liquid_fraction(zqin, phi) result(zTin)
end function temperature_mush_liquid_fraction

!=======================================================================
! Mush heat conductivity from mush temperature and bulk salinity

function heat_conductivity(zTin, zSin) result(km)

! msuh heat conductivity from mush temperature and bulk salinity

real(kind=dbl_kind), intent(in) :: &
zTin , & ! ice layer temperature (C)
zSin ! ice layer bulk salinity (ppt)
Expand All @@ -497,18 +489,22 @@ function heat_conductivity(zTin, zSin) result(km)

end function heat_conductivity

!=======================================================================
!=======================================================================
!autodocument_start icepack_mushy_liquid_fraction
! Liquid fraction of mush from mush temperature and bulk salinity

function icepack_mushy_liquid_fraction(zTin, zSin) result(phi)

! liquid fraction of mush from mush temperature and bulk salinity

real(kind=dbl_kind), intent(in) :: &
zTin, & ! ice layer temperature (C)
zSin ! ice layer bulk salinity (ppt)

real(kind=dbl_kind) :: &
phi , & ! liquid fraction
phi ! liquid fraction

!autodocument_end

real(kind=dbl_kind) :: &
Sbr ! brine salinity (ppt)

character(len=*),parameter :: subname='(icepack_mushy_liquid_fraction)'
Expand All @@ -521,5 +517,3 @@ end function icepack_mushy_liquid_fraction
!=======================================================================

end module icepack_mushy_physics


10 changes: 5 additions & 5 deletions columnphysics/icepack_therm_itd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ subroutine lateral_melt (dt, ncat, &
real (kind=dbl_kind), intent(in) :: &
rside , & ! fraction of ice that melts laterally
wlat ! lateral melt rate (m/s)

real (kind=dbl_kind), intent(inout) :: &
fside ! lateral heat flux (W/m^2)

Expand Down Expand Up @@ -983,7 +983,7 @@ subroutine lateral_melt (dt, ncat, &
f_flx !

real (kind=dbl_kind) :: &
sicen, &
sicen, &
etot, & ! column energy per itd cat, for FSD code
elapsed_t, & ! FSD subcycling
subdt ! FSD timestep (s)
Expand Down Expand Up @@ -1066,8 +1066,8 @@ subroutine lateral_melt (dt, ncat, &
do k = 1, nilyr
etot = etot + trcrn(nt_qice+k-1,n) * vicen(n)/real(nilyr,kind=dbl_kind)
enddo ! nilyr
! lateral heat flux, fside < 0

! lateral heat flux, fside < 0
fside = fside + rsiden(n)*etot/dt

enddo ! ncat
Expand Down Expand Up @@ -1247,7 +1247,7 @@ subroutine lateral_melt (dt, ncat, &
if (tr_fsd) then

trcrn(nt_fsd:nt_fsd+nfsd-1,:) = afsdn

call icepack_cleanup_fsd (ncat, nfsd, trcrn(nt_fsd:nt_fsd+nfsd-1,:) )
if (icepack_warnings_aborted(subname)) return

Expand Down
15 changes: 9 additions & 6 deletions configuration/driver/icedrv_RunMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ subroutine ice_step
use icedrv_restart_bgc, only: write_restart_bgc
use icedrv_step, only: prep_radiation, step_therm1, step_therm2, &
update_state, step_dyn_ridge, step_snow, step_radiation, &
biogeochemistry, step_dyn_wave
biogeochemistry, step_dyn_wave, step_lateral_flux_scm

integer (kind=int_kind) :: &
k ! dynamics supercycling index
Expand Down Expand Up @@ -178,12 +178,15 @@ subroutine ice_step

do k = 1, ndtd

! ridging
call step_dyn_ridge (dt_dyn, ndtd)
! horizontal advection of ice or open water into the single column
call step_lateral_flux_scm(dt_dyn)

! clean up, update tendency diagnostics
offset = c0
call update_state (dt_dyn, daidtd, dvidtd, dagedtd, offset)
! ridging
call step_dyn_ridge (dt_dyn, ndtd)

! clean up, update tendency diagnostics
offset = c0
call update_state (dt_dyn, daidtd, dvidtd, dagedtd, offset)

enddo

Expand Down
1 change: 1 addition & 0 deletions configuration/driver/icedrv_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ module icedrv_forcing
atm_data_type, & ! 'default', 'clim', 'CFS'
ocn_data_type, & ! 'default', 'SHEBA'
bgc_data_type, & ! 'default', 'ISPOL', 'NICE'
lateral_flux_type, & ! 'uniform_ice', 'open_water'
atm_data_file, & ! atmospheric forcing data file
ocn_data_file, & ! ocean forcing data file
ice_data_file, & ! ice forcing data file
Expand Down
7 changes: 6 additions & 1 deletion configuration/driver/icedrv_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ subroutine input_data
use icedrv_forcing, only: atm_data_format, ocn_data_format, bgc_data_format
use icedrv_forcing, only: data_dir
use icedrv_forcing, only: oceanmixed_ice, restore_ocn, trestore
use icedrv_forcing, only: snw_ssp_table
use icedrv_forcing, only: snw_ssp_table, lateral_flux_type

! local variables

Expand Down Expand Up @@ -178,6 +178,7 @@ subroutine input_data
default_season, wave_spec_type, &
precip_units, fyear_init, ycycle, &
atm_data_type, ocn_data_type, bgc_data_type, &
lateral_flux_type, &
atm_data_file, ocn_data_file, bgc_data_file, &
ice_data_file, &
atm_data_format, ocn_data_format, bgc_data_format, &
Expand Down Expand Up @@ -278,6 +279,8 @@ subroutine input_data
ocn_data_type = 'default' ! source of ocean forcing data
ocn_data_file = ' ' ! ocean forcing data file
ice_data_file = ' ' ! ice forcing data file (opening, closing)
lateral_flux_type = 'uniform_ice' ! if 'uniform_ice' assume closing
! fluxes in uniform ice
bgc_data_format = 'bin' ! file format ('bin'=binary or 'nc'=netcdf)
bgc_data_type = 'default' ! source of BGC forcing data
bgc_data_file = ' ' ! biogeochemistry forcing data file
Expand Down Expand Up @@ -762,6 +765,8 @@ subroutine input_data
write(nu_diag,1030) ' ocn_data_type = ', trim(ocn_data_type)
write(nu_diag,1030) ' bgc_data_type = ', trim(bgc_data_type)

write(nu_diag,*) ' lateral_flux_type = ', trim(lateral_flux_type)

write(nu_diag,1030) ' atm_data_file = ', trim(atm_data_file)
write(nu_diag,1030) ' ocn_data_file = ', trim(ocn_data_file)
write(nu_diag,1030) ' bgc_data_file = ', trim(bgc_data_file)
Expand Down
Loading

0 comments on commit 2fc81b4

Please sign in to comment.