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

First step in adding Tf #9

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 29 additions & 14 deletions columnphysics/icepack_itd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module icepack_itd

use icepack_kinds
use icepack_parameters, only: c0, c1, c2, c3, c15, c25, c100, p1, p01, p001, p5, puny
use icepack_parameters, only: Lfresh, rhos, ice_ref_salinity, hs_min, cp_ice, Tocnfrz, rhoi
use icepack_parameters, only: Lfresh, rhos, ice_ref_salinity, hs_min, cp_ice, rhoi
use icepack_parameters, only: rhosi, sk_l, hs_ssl, min_salin, rsnw_fall
use icepack_tracers, only: nt_Tsfc, nt_qice, nt_qsno, nt_aero, nt_isosno, nt_isoice
use icepack_tracers, only: nt_apnd, nt_hpnd, nt_fbri, tr_brine, nt_bgc_S, bio_index
Expand Down Expand Up @@ -108,7 +108,7 @@ subroutine rebin (ntrcr, trcr_depend, &
nt_strata, &
aicen, trcrn, &
vicen, vsnon, &
ncat, hin_max )
ncat, hin_max, Tf )

integer (kind=int_kind), intent(in) :: &
ntrcr , & ! number of tracers in use
Expand All @@ -135,6 +135,9 @@ subroutine rebin (ntrcr, trcr_depend, &

real (kind=dbl_kind), dimension(0:ncat), intent(in) :: &
hin_max ! category limits (m)

real (kind=dbl_kind), intent(in) :: &
Tf ! freezing temperature

! local variables

Expand Down Expand Up @@ -221,7 +224,7 @@ subroutine rebin (ntrcr, trcr_depend, &
aicen, trcrn, &
vicen, vsnon, &
hicen, donor, &
daice, dvice )
daice, dvice, Tf )
if (icepack_warnings_aborted(subname)) return

!-----------------------------------------------------------------
Expand Down Expand Up @@ -269,7 +272,7 @@ subroutine rebin (ntrcr, trcr_depend, &
aicen, trcrn, &
vicen, vsnon, &
hicen, donor, &
daice, dvice )
daice, dvice, Tf )
if (icepack_warnings_aborted(subname)) return

!-----------------------------------------------------------------
Expand Down Expand Up @@ -361,7 +364,7 @@ subroutine shift_ice (ntrcr, ncat, &
aicen, trcrn, &
vicen, vsnon, &
hicen, donor, &
daice, dvice )
daice, dvice, Tf )

integer (kind=int_kind), intent(in) :: &
ncat , & ! number of thickness categories
Expand Down Expand Up @@ -396,6 +399,9 @@ subroutine shift_ice (ntrcr, ncat, &
dvice , & ! ice volume transferred across boundary
hicen ! ice thickness for each cat (m)

real (kind=dbl_kind), intent(in) :: &
Tf ! freezing temperature

! local variables

integer (kind=int_kind) :: &
Expand Down Expand Up @@ -663,7 +669,7 @@ subroutine shift_ice (ntrcr, ncat, &
atrcrn(:,n), aicen(n), &
vicen(n), vsnon(n), &
trcr_base, n_trcr_strata, &
nt_strata, trcrn(:,n))
nt_strata, trcrn(:,n), Tf)
if (icepack_warnings_aborted(subname)) return

enddo ! ncat
Expand Down Expand Up @@ -771,8 +777,8 @@ subroutine cleanup_itd (dt, ntrcr, &
fpond, fresh, &
fsalt, fhocn, &
faero_ocn, fiso_ocn, &
fzsal, &
flux_bio, limit_aice_in)
fzsal, &
flux_bio, Tf, limit_aice_in)

integer (kind=int_kind), intent(in) :: &
ncat , & ! number of thickness categories
Expand All @@ -786,6 +792,9 @@ subroutine cleanup_itd (dt, ntrcr, &
real (kind=dbl_kind), intent(in) :: &
dt ! time step

real (kind=dbl_kind), intent(in) :: &
Tf ! Freezing temperature

real (kind=dbl_kind), dimension(0:ncat), intent(in) :: &
hin_max ! category boundaries (m)

Expand Down Expand Up @@ -928,7 +937,7 @@ subroutine cleanup_itd (dt, ntrcr, &
nt_strata, &
aicen, trcrn, &
vicen, vsnon, &
ncat, hin_max )
ncat, hin_max, Tf )
if (icepack_warnings_aborted(subname)) return

endif ! aice > puny
Expand All @@ -953,7 +962,7 @@ subroutine cleanup_itd (dt, ntrcr, &
tr_aero, &
tr_pond_topo, &
first_ice, nbtrcr, &
dfzsal, dflux_bio )
dfzsal, dflux_bio, Tf )

if (icepack_warnings_aborted(subname)) then
write(warnstr,*) subname, 'aice:', aice
Expand Down Expand Up @@ -1049,7 +1058,7 @@ subroutine zap_small_areas (dt, ntrcr, &
tr_aero, &
tr_pond_topo, &
first_ice, nbtrcr, &
dfzsal, dflux_bio )
dfzsal, dflux_bio, Tf)

integer (kind=int_kind), intent(in) :: &
ncat , & ! number of thickness categories
Expand Down Expand Up @@ -1091,6 +1100,9 @@ subroutine zap_small_areas (dt, ntrcr, &
real (kind=dbl_kind), dimension (:), intent(inout) :: &
dflux_bio ! zapped bio tracer flux from biology (mmol/m^2/s)

real (kind=dbl_kind), intent(in) :: &
Tf ! Freezing temperature

logical (kind=log_kind), intent(in) :: &
tr_aero, & ! aerosol flag
tr_pond_topo ! pond flag
Expand Down Expand Up @@ -1208,7 +1220,7 @@ subroutine zap_small_areas (dt, ntrcr, &
aice0 = aice0 + aicen(n)
aicen(n) = c0
vicen(n) = c0
trcrn(nt_Tsfc,n) = Tocnfrz
trcrn(nt_Tsfc,n) = Tf

!-----------------------------------------------------------------
! Zap snow
Expand Down Expand Up @@ -1982,7 +1994,7 @@ subroutine icepack_aggregate (ncat, &
trcr_depend, &
trcr_base, &
n_trcr_strata, &
nt_strata)
nt_strata, Tf)

integer (kind=int_kind), intent(in) :: &
ncat , & ! number of thickness categories
Expand Down Expand Up @@ -2016,6 +2028,9 @@ subroutine icepack_aggregate (ncat, &
real (kind=dbl_kind), dimension (:), intent(out) :: &
trcr ! ice tracers

real (kind=dbl_kind), intent(in) :: &
Tf ! freezing temperature

!autodocument_end

! local variables
Expand Down Expand Up @@ -2077,7 +2092,7 @@ subroutine icepack_aggregate (ncat, &
atrcr, aice, &
vice , vsno, &
trcr_base, n_trcr_strata, &
nt_strata, trcr)
nt_strata, trcr, Tf)
if (icepack_warnings_aborted(subname)) return

deallocate (atrcr)
Expand Down
27 changes: 18 additions & 9 deletions columnphysics/icepack_mechred.F90
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ subroutine ridge_ice (dt, ndtd, &
aparticn, krdgn, &
aredistn, vredistn, &
dardg1ndt, dardg2ndt, &
dvirdgndt, &
dvirdgndt, Tf, &
araftn, vraftn, &
closing_flag,closing )

Expand All @@ -127,6 +127,9 @@ subroutine ridge_ice (dt, ndtd, &
mu_rdg , & ! gives e-folding scale of ridged ice (m^.5)
dt ! time step

real (kind=dbl_kind), intent(in) :: &
Tf ! freezing temperature

real (kind=dbl_kind), dimension(0:ncat), intent(inout) :: &
hin_max ! category limits (m)

Expand Down Expand Up @@ -401,7 +404,7 @@ subroutine ridge_ice (dt, ndtd, &
nslyr, n_aero, &
msnow_mlt, esnow_mlt, &
maero, miso, &
mpond, &
mpond, Tf, &
aredistn, vredistn)
if (icepack_warnings_aborted(subname)) return

Expand Down Expand Up @@ -1088,7 +1091,7 @@ subroutine ridge_shift (ntrcr, dt, &
nslyr, n_aero, &
msnow_mlt, esnow_mlt, &
maero, miso, &
mpond, &
mpond, Tf, &
aredistn, vredistn)

integer (kind=int_kind), intent(in) :: &
Expand All @@ -1101,6 +1104,9 @@ subroutine ridge_shift (ntrcr, dt, &
real (kind=dbl_kind), intent(in) :: &
dt ! time step (s)

real (kind=dbl_kind), intent(in) :: &
Tf ! freezing temperature

integer (kind=int_kind), dimension (:), intent(in) :: &
trcr_depend, & ! = 0 for aicen tracers, 1 for vicen, 2 for vsnon
n_trcr_strata ! number of underlying tracer layers
Expand Down Expand Up @@ -1162,7 +1168,7 @@ subroutine ridge_shift (ntrcr, dt, &

real (kind=dbl_kind), dimension(:), intent(inout) :: &
miso ! isotope mass added to ocean (kg m-2)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space added here

real (kind=dbl_kind), dimension (:), intent(inout), optional :: &
aredistn , & ! redistribution function: fraction of new ridge area
vredistn ! redistribution function: fraction of new ridge volume
Expand Down Expand Up @@ -1575,7 +1581,7 @@ subroutine ridge_shift (ntrcr, dt, &
atrcrn(:,n), aicen(n), &
vicen(n), vsnon(n), &
trcr_base, n_trcr_strata, &
nt_strata, trcrn(:,n))
nt_strata, trcrn(:,n), Tf)
if (icepack_warnings_aborted(subname)) return
enddo

Expand Down Expand Up @@ -1744,11 +1750,14 @@ subroutine icepack_step_ridge (dt, ndtd, &
araftn, vraftn, &
aice, fsalt, &
first_ice, fzsal, &
flux_bio, closing )
flux_bio, closing, Tf )

real (kind=dbl_kind), intent(in) :: &
dt ! time step

real (kind=dbl_kind), intent(in) :: &
Tf ! freezing temperature

integer (kind=int_kind), intent(in) :: &
ncat , & ! number of thickness categories
ndtd , & ! number of dynamics supercycles
Expand Down Expand Up @@ -1885,7 +1894,7 @@ subroutine icepack_step_ridge (dt, ndtd, &
aparticn, krdgn, &
aredistn, vredistn, &
dardg1ndt, dardg2ndt, &
dvirdgndt, &
dvirdgndt, Tf, &
araftn, vraftn, &
l_closing_flag, &
l_closing )
Expand Down Expand Up @@ -1913,8 +1922,8 @@ subroutine icepack_step_ridge (dt, ndtd, &
fpond, fresh, &
fsalt, fhocn, &
faero_ocn, l_fiso_ocn, &
fzsal, &
flux_bio)
fzsal, &
flux_bio, Tf)
if (icepack_warnings_aborted(subname)) return

if (present(fiso_ocn)) fiso_ocn = l_fiso_ocn
Expand Down
3 changes: 3 additions & 0 deletions columnphysics/icepack_parameters.F90
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ module icepack_parameters
character(len=char_len), public :: &
tfrz_option = 'mushy' ! form of ocean freezing temperature
! 'minus1p8' = -1.8 C
! 'constant' = Tocnfrz from namelist
! 'linear_salt' = -depressT * sss
! 'mushy' conforms with ktherm=2

Expand Down Expand Up @@ -554,6 +555,7 @@ subroutine icepack_init_parameters( &
character(len=*), intent(in), optional :: &
tfrz_option_in ! form of ocean freezing temperature
! 'minus1p8' = -1.8 C
! 'constant' = Tocnfrz from namelist
! 'linear_salt' = -depressT * sss
! 'mushy' conforms with ktherm=2

Expand Down Expand Up @@ -1234,6 +1236,7 @@ subroutine icepack_query_parameters( &
character(len=*), intent(out), optional :: &
tfrz_option_out ! form of ocean freezing temperature
! 'minus1p8' = -1.8 C
! 'constant' = Tocnfrz from namelist
! 'linear_salt' = -depressT * sss
! 'mushy' conforms with ktherm=2

Expand Down
11 changes: 7 additions & 4 deletions columnphysics/icepack_therm_itd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ subroutine linear_itd (ncat, hin_max, &
aicen, trcrn, &
vicen, vsnon, &
aice, aice0, &
fpond )
fpond, Tf )

integer (kind=int_kind), intent(in) :: &
ncat , & ! number of thickness categories
Expand All @@ -119,6 +119,9 @@ subroutine linear_itd (ncat, hin_max, &
integer (kind=int_kind), dimension (:,:), intent(in) :: &
nt_strata ! indices of underlying tracer layers

real (kind=dbl_kind), intent(in) :: &
Tf ! freezing temperature

real (kind=dbl_kind), dimension(:), intent(in) :: &
aicen_init, & ! initial ice concentration (before vertical thermo)
vicen_init ! initial ice volume (m)
Expand Down Expand Up @@ -587,7 +590,7 @@ subroutine linear_itd (ncat, hin_max, &
aicen, trcrn, &
vicen, vsnon, &
hicen, donor, &
daice, dvice )
daice, dvice, Tf )
if (icepack_warnings_aborted(subname)) return

! maintain qsno negative definiteness
Expand Down Expand Up @@ -2166,7 +2169,7 @@ subroutine icepack_step_therm2 (dt, ncat, nltrcr, &
vsnon, &
aice , &
aice0 , &
fpond )
fpond, Tf )
if (icepack_warnings_aborted(subname)) return

endif ! aice > puny
Expand Down Expand Up @@ -2272,7 +2275,7 @@ subroutine icepack_step_therm2 (dt, ncat, nltrcr, &
fpond, fresh, &
fsalt, fhocn, &
faero_ocn, l_fiso_ocn, &
fzsal, flux_bio)
fzsal, flux_bio, Tf)
if (icepack_warnings_aborted(subname)) return

if (present(fiso_ocn)) then
Expand Down
4 changes: 2 additions & 2 deletions columnphysics/icepack_therm_shared.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module icepack_therm_shared

use icepack_kinds

use icepack_parameters, only: c0, c1, c2, c4, p5, pi, puny
use icepack_parameters, only: c0, c1, c2, c4, p5, pi, puny, Tocnfrz
use icepack_parameters, only: cp_ocn, cp_ice, rhoi, rhos, Tffresh, TTTice, qqqice
use icepack_parameters, only: stefan_boltzmann, emissivity, Lfresh, Tsmelt
use icepack_parameters, only: saltmax, min_salin, depressT
Expand Down Expand Up @@ -398,7 +398,7 @@ function icepack_sea_freezing_temperature(sss) result(Tf)

else

Tf = -1.8_dbl_kind
Tf = Tocnfrz

endif

Expand Down
9 changes: 6 additions & 3 deletions columnphysics/icepack_tracers.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
module icepack_tracers

use icepack_kinds
use icepack_parameters, only: c0, c1, puny, Tocnfrz, rhos, rsnw_fall
use icepack_parameters, only: c0, c1, puny, rhos, rsnw_fall
use icepack_warnings, only: warnstr, icepack_warnings_add
use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted

Expand Down Expand Up @@ -1207,7 +1207,7 @@ subroutine icepack_compute_tracers (ntrcr, trcr_depend, &
atrcrn, aicen, &
vicen, vsnon, &
trcr_base, n_trcr_strata, &
nt_strata, trcrn)
nt_strata, trcrn, Tf)

integer (kind=int_kind), intent(in) :: &
ntrcr ! number of tracers in use
Expand All @@ -1234,6 +1234,9 @@ subroutine icepack_compute_tracers (ntrcr, trcr_depend, &
real (kind=dbl_kind), dimension (ntrcr), intent(out) :: &
trcrn ! ice tracers

real (kind=dbl_kind), intent(in) :: &
Tf ! Freezing point

!autodocument_end

! local variables
Expand Down Expand Up @@ -1266,7 +1269,7 @@ subroutine icepack_compute_tracers (ntrcr, trcr_depend, &
trcrn(it) = atrcrn(it) / aicen
else
trcrn(it) = c0
if (it == nt_Tsfc) trcrn(it) = Tocnfrz ! surface temperature
if (it == nt_Tsfc) trcrn(it) = Tf ! surface temperature
endif

else
Expand Down
Loading