Skip to content

Commit

Permalink
elevate snow/mush enthalpy and salinity profile to interface
Browse files Browse the repository at this point in the history
  • Loading branch information
eclare108213 committed Sep 25, 2023
1 parent baaa3f4 commit 1f0b307
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 31 deletions.
4 changes: 3 additions & 1 deletion columnphysics/icepack_intfc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ module icepack_intfc
use icepack_therm_shared , only: icepack_snow_temperature
use icepack_therm_shared , only: icepack_liquidus_temperature
use icepack_therm_shared , only: icepack_sea_freezing_temperature
use icepack_therm_shared , only: icepack_enthalpy_snow
use icepack_therm_shared , only: icepack_init_thermo
use icepack_therm_shared , only: icepack_salinity_profile
use icepack_therm_shared , only: icepack_init_trcr

use icepack_mushy_physics , only: icepack_enthalpy_snow
use icepack_mushy_physics , only: icepack_enthalpy_mush
use icepack_mushy_physics , only: icepack_mushy_density_brine
use icepack_mushy_physics , only: icepack_mushy_liquid_fraction
use icepack_mushy_physics , only: icepack_mushy_temperature_mush
Expand Down
8 changes: 4 additions & 4 deletions columnphysics/icepack_mushy_physics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module icepack_mushy_physics
public :: &
conductivity_mush_array, &
conductivity_snow_array, &
enthalpy_snow, &
icepack_enthalpy_snow, &
enthalpy_brine, &
icepack_enthalpy_mush, &
enthalpy_mush_liquid_fraction, &
Expand Down Expand Up @@ -143,19 +143,19 @@ end subroutine conductivity_snow_array
!=======================================================================
! Enthalpy of snow from snow temperature

function enthalpy_snow(zTsn) result(zqsn)
function icepack_enthalpy_snow(zTsn) result(zqsn)

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

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

character(len=*),parameter :: subname='(enthalpy_snow)'
character(len=*),parameter :: subname='(icepack_enthalpy_snow)'

zqsn = -rhos * (-cp_ice * zTsn + Lfresh)

end function enthalpy_snow
end function icepack_enthalpy_snow

!=======================================================================
! Temperature of snow from the snow enthalpy
Expand Down
4 changes: 2 additions & 2 deletions columnphysics/icepack_therm_mushy.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module icepack_therm_mushy
use icepack_parameters, only: a_rapid_mode, Rac_rapid_mode
use icepack_parameters, only: aspect_rapid_mode, dSdt_slow_mode, phi_c_slow_mode
use icepack_parameters, only: sw_redist, sw_frac, sw_dtemp
use icepack_mushy_physics, only: icepack_mushy_density_brine, enthalpy_brine, enthalpy_snow
use icepack_mushy_physics, only: icepack_mushy_density_brine, enthalpy_brine, icepack_enthalpy_snow
use icepack_mushy_physics, only: enthalpy_mush_liquid_fraction
use icepack_mushy_physics, only: icepack_mushy_temperature_mush, icepack_mushy_liquid_fraction
use icepack_mushy_physics, only: temperature_snow, temperature_mush_liquid_fraction
Expand Down Expand Up @@ -1802,7 +1802,7 @@ subroutine picard_final(lsnow, &
if (lsnow) then

do k = 1, nslyr
zqsn(k) = enthalpy_snow(zTsn(k))
zqsn(k) = icepack_enthalpy_snow(zTsn(k))
enddo ! k

endif ! lsnow
Expand Down
54 changes: 30 additions & 24 deletions columnphysics/icepack_therm_shared.F90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module icepack_therm_shared

use icepack_mushy_physics, only: icepack_enthalpy_mush
use icepack_mushy_physics, only: temperature_snow
use icepack_mushy_physics, only: enthalpy_snow
use icepack_mushy_physics, only: icepack_mushy_temperature_mush
use icepack_mushy_physics, only: liquidus_temperature_mush

Expand All @@ -30,12 +29,12 @@ module icepack_therm_shared
surface_heat_flux, &
dsurface_heat_flux_dTsf, &
icepack_init_thermo, &
icepack_salinity_profile, &
icepack_init_trcr, &
icepack_ice_temperature, &
icepack_snow_temperature, &
icepack_liquidus_temperature, &
icepack_sea_freezing_temperature, &
icepack_enthalpy_snow, &
adjust_enthalpy

real (kind=dbl_kind), parameter, public :: &
Expand Down Expand Up @@ -226,10 +225,6 @@ subroutine icepack_init_thermo(nilyr, sprofile)

!autodocument_end

real (kind=dbl_kind), parameter :: &
nsal = 0.407_dbl_kind, &
msal = 0.573_dbl_kind

integer (kind=int_kind) :: k ! ice layer index
real (kind=dbl_kind) :: zn ! normalized ice thickness

Expand All @@ -254,7 +249,8 @@ subroutine icepack_init_thermo(nilyr, sprofile)
do k = 1, nilyr
zn = (real(k,kind=dbl_kind)-p5) / &
real(nilyr,kind=dbl_kind)
sprofile(k)=(saltmax/c2)*(c1-cos(pi*zn**(nsal/(msal+zn))))
! sprofile(k)=(saltmax/c2)*(c1-cos(pi*zn**(nsal/(msal+zn))))
sprofile(k)=icepack_salinity_profile(zn)
sprofile(k) = max(sprofile(k), min_salin)
enddo ! k
sprofile(nilyr+1) = saltmax
Expand All @@ -267,6 +263,33 @@ subroutine icepack_init_thermo(nilyr, sprofile)

end subroutine icepack_init_thermo

!=======================================================================
!autodocument_start icepack_salinity_profile
! Initial salinity profile
!
! authors: C. M. Bitz, UW
! William H. Lipscomb, LANL

function icepack_salinity_profile(zn) result(salinity)

real(kind=dbl_kind), intent(in) :: &
zn ! depth

real(kind=dbl_kind) :: &
salinity ! initial salinity profile

!autodocument end

real (kind=dbl_kind), parameter :: &
nsal = 0.407_dbl_kind, &
msal = 0.573_dbl_kind

character(len=*),parameter :: subname='(icepack_init_thermo)'

salinity = (saltmax/c2)*(c1-cos(pi*zn**(nsal/(msal+zn))))

end function icepack_salinity_profile

!=======================================================================
!autodocument_start icepack_init_trcr
!
Expand Down Expand Up @@ -443,23 +466,6 @@ function icepack_snow_temperature(qin) result(Tsn)

end function icepack_snow_temperature

!=======================================================================
!autodocument_start icepack_enthalpy_snow
! compute snow enthalpy

function icepack_enthalpy_snow(zTsn) result(qsn)

real(kind=dbl_kind), intent(in) :: zTsn
real(kind=dbl_kind) :: qsn

!autodocument_end

character(len=*),parameter :: subname='(icepack_enthalpy_snow)'

qsn = enthalpy_snow(zTsn)

end function icepack_enthalpy_snow

!=======================================================================
!
! Conserving energy, compute the new enthalpy of equal-thickness ice
Expand Down

0 comments on commit 1f0b307

Please sign in to comment.