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

deltamin now defined in ice_in #63

Merged
merged 12 commits into from
Mar 5, 2022
72 changes: 29 additions & 43 deletions cicecore/cicedynB/dynamics/ice_dyn_evp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ subroutine evp (dt)
dxe, dxn, dxt, dxu, dye, dyn, dyt, dyu, &
ratiodxN, ratiodxNr, ratiodyE, ratiodyEr, &
dxhy, dyhx, cxp, cyp, cxm, cym, &
tarear, uarear, earear, narear, tinyarea, grid_average_X2Y, tarea, uarea, &
tarear, uarear, earear, narear, grid_average_X2Y, tarea, uarea, &
grid_type, grid_ice, &
grid_atm_dynu, grid_atm_dynv, grid_ocn_dynu, grid_ocn_dynv
use ice_state, only: aice, vice, vsno, uvel, vvel, uvelN, vvelN, &
Expand All @@ -113,7 +113,7 @@ subroutine evp (dt)
ice_timer_start, ice_timer_stop, timer_evp_1d, timer_evp_2d
use ice_dyn_evp_1d, only: ice_dyn_evp_1d_copyin, ice_dyn_evp_1d_kernel, &
ice_dyn_evp_1d_copyout
use ice_dyn_shared, only: evp_algorithm, stack_velocity_field, unstack_velocity_field
use ice_dyn_shared, only: evp_algorithm, stack_velocity_field, unstack_velocity_field, DminTarea

real (kind=dbl_kind), intent(in) :: &
dt ! time step
Expand Down Expand Up @@ -705,7 +705,7 @@ subroutine evp (dt)
dxhy (:,:,iblk), dyhx (:,:,iblk), &
cxp (:,:,iblk), cyp (:,:,iblk), &
cxm (:,:,iblk), cym (:,:,iblk), &
tarear (:,:,iblk), tinyarea (:,:,iblk), &
tarear (:,:,iblk), DminTarea(:,:,iblk), &
strength (:,:,iblk), &
stressp_1 (:,:,iblk), stressp_2 (:,:,iblk), &
stressp_3 (:,:,iblk), stressp_4 (:,:,iblk), &
Expand Down Expand Up @@ -751,7 +751,7 @@ subroutine evp (dt)
uvelN (:,:,iblk), vvelN (:,:,iblk), &
dxN (:,:,iblk), dyE (:,:,iblk), &
dxT (:,:,iblk), dyT (:,:,iblk), &
tarear (:,:,iblk), tinyarea (:,:,iblk), &
tarear (:,:,iblk), DminTarea (:,:,iblk), &
strength (:,:,iblk), &
zetax2T (:,:,iblk), etax2T (:,:,iblk), &
stresspT (:,:,iblk), stressmT (:,:,iblk), &
Expand Down Expand Up @@ -1134,7 +1134,7 @@ subroutine stress (nx_block, ny_block, &
dxhy, dyhx, &
cxp, cyp, &
cxm, cym, &
tarear, tinyarea, &
tarear, DminTarea, &
strength, &
stressp_1, stressp_2, &
stressp_3, stressp_4, &
Expand All @@ -1146,7 +1146,8 @@ subroutine stress (nx_block, ny_block, &
rdg_conv, rdg_shear, &
str )

use ice_dyn_shared, only: strain_rates, deformations, viscous_coeffs_and_rep_pressure_T
use ice_dyn_shared, only: strain_rates, deformations, &
viscous_coeffs_and_rep_pressure_T, capping

integer (kind=int_kind), intent(in) :: &
nx_block, ny_block, & ! block dimensions
Expand All @@ -1170,7 +1171,7 @@ subroutine stress (nx_block, ny_block, &
cym , & ! 0.5*HTE - 1.5*HTW
cxm , & ! 0.5*HTN - 1.5*HTS
tarear , & ! 1/tarea
tinyarea ! puny*tarea
DminTarea ! deltaminEVP*tarea

real (kind=dbl_kind), dimension (nx_block,ny_block), intent(inout) :: &
stressp_1, stressp_2, stressp_3, stressp_4 , & ! sigma11+sigma22
Expand Down Expand Up @@ -1210,8 +1211,6 @@ subroutine stress (nx_block, ny_block, &
str12ew, str12we, str12ns, str12sn , &
strp_tmp, strm_tmp, tmp

real(kind=dbl_kind),parameter :: capping = c1 ! of the viscous coef

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

!-----------------------------------------------------------------
Expand Down Expand Up @@ -1248,24 +1247,24 @@ subroutine stress (nx_block, ny_block, &
! viscous coefficients and replacement pressure
!-----------------------------------------------------------------

call viscous_coeffs_and_rep_pressure_T (strength(i,j), tinyarea(i,j),&
Deltane, zetax2ne, &
etax2ne, rep_prsne, &
call viscous_coeffs_and_rep_pressure_T (strength(i,j), DminTarea(i,j),&
Deltane, zetax2ne, &
etax2ne, rep_prsne, &
capping)

call viscous_coeffs_and_rep_pressure_T (strength(i,j), tinyarea(i,j),&
Deltanw, zetax2nw, &
etax2nw, rep_prsnw, &
call viscous_coeffs_and_rep_pressure_T (strength(i,j), DminTarea(i,j),&
Deltanw, zetax2nw, &
etax2nw, rep_prsnw, &
capping)

call viscous_coeffs_and_rep_pressure_T (strength(i,j), tinyarea(i,j),&
Deltasw, zetax2sw, &
etax2sw, rep_prssw, &
call viscous_coeffs_and_rep_pressure_T (strength(i,j), DminTarea(i,j),&
Deltasw, zetax2sw, &
etax2sw, rep_prssw, &
capping)

call viscous_coeffs_and_rep_pressure_T (strength(i,j), tinyarea(i,j),&
Deltase, zetax2se, &
etax2se, rep_prsse, &
call viscous_coeffs_and_rep_pressure_T (strength(i,j), DminTarea(i,j),&
Deltase, zetax2se, &
etax2se, rep_prsse, &
capping)


Expand Down Expand Up @@ -1467,7 +1466,7 @@ subroutine stress_T (nx_block, ny_block, &
uvelN, vvelN, &
dxN, dyE, &
dxT, dyT, &
tarear, tinyarea, &
tarear, DminTarea, &
strength, &
zetax2T, etax2T, &
stresspT, stressmT, &
Expand All @@ -1476,7 +1475,7 @@ subroutine stress_T (nx_block, ny_block, &
rdg_conv, rdg_shear )

use ice_dyn_shared, only: strain_rates_T, deformations_T, &
viscous_coeffs_and_rep_pressure_T
viscous_coeffs_and_rep_pressure_T, capping

integer (kind=int_kind), intent(in) :: &
nx_block, ny_block, & ! block dimensions
Expand All @@ -1487,7 +1486,6 @@ subroutine stress_T (nx_block, ny_block, &
indxti , & ! compressed index in i-direction
indxtj ! compressed index in j-direction


real (kind=dbl_kind), dimension (nx_block,ny_block), intent(in) :: &
uvelE , & ! x-component of velocity (m/s) at the E point
vvelE , & ! y-component of velocity (m/s) at the N point
Expand All @@ -1499,7 +1497,7 @@ subroutine stress_T (nx_block, ny_block, &
dyT , & ! height of T-cell through the middle (m)
strength , & ! ice strength (N/m)
tarear , & ! 1/tarea
tinyarea ! puny*tarea
DminTarea ! deltaminEVP*tarea

real (kind=dbl_kind), dimension (nx_block,ny_block), intent(inout) :: &
zetax2T , & ! zetax2 = 2*zeta (bulk viscous coeff)
Expand All @@ -1523,8 +1521,6 @@ subroutine stress_T (nx_block, ny_block, &
divT, tensionT, shearT, DeltaT, & ! strain rates at T point
rep_prsT ! replacement pressure at T point

real(kind=dbl_kind), parameter :: capping = c1 ! of the viscous coef

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

!-----------------------------------------------------------------
Expand Down Expand Up @@ -1555,8 +1551,7 @@ subroutine stress_T (nx_block, ny_block, &
!-----------------------------------------------------------------

call viscous_coeffs_and_rep_pressure_T (strength(i,j), &
tinyarea(i,j), &
DeltaT, &
DminTarea(i,j), DeltaT, &
zetax2T(i,j),etax2T(i,j),&
rep_prsT, capping )

Expand Down Expand Up @@ -1624,7 +1619,7 @@ subroutine stress_U (nx_block, ny_block, &
use ice_dyn_shared, only: strain_rates_U, &
viscous_coeffs_and_rep_pressure_T2U, &
viscous_coeffs_and_rep_pressure_U, &
visc_coeff_method
visc_coeff_method, deltaminEVP, capping

integer (kind=int_kind), intent(in) :: &
nx_block, ny_block, & ! block dimensions
Expand Down Expand Up @@ -1673,19 +1668,10 @@ subroutine stress_U (nx_block, ny_block, &
real (kind=dbl_kind) :: &
divU, tensionU, shearU, DeltaU, & ! strain rates at U point
zetax2U, etax2U, rep_prsU, & ! replacement pressure at U point
puny, tinyareaU
DminUarea

real(kind=dbl_kind), parameter :: capping = c1 ! of the viscous coef

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

call icepack_query_parameters(puny_out=puny)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) then
call abort_ice(error_message=subname, file=__FILE__, &
line=__LINE__)
end if

do ij = 1, icellu
i = indxui(ij)
j = indxuj(ij)
Expand Down Expand Up @@ -1726,15 +1712,15 @@ subroutine stress_U (nx_block, ny_block, &

elseif (visc_coeff_method == 'avg_strength') then

tinyareaU = puny*uarea(i,j)
DminUarea = deltaminEVP*uarea(i,j)

call viscous_coeffs_and_rep_pressure_U (strength(i ,j ), strength(i ,j+1), &
strength(i+1,j+1), strength(i+1,j ), &
hm (i ,j ) , hm (i ,j+1), &
hm (i+1,j+1) , hm (i+1,j ), &
tarea (i ,j ) , tarea (i ,j+1), &
tarea (i+1,j+1) , tarea (i+1,j ), &
tinyareaU, &
DminUarea, &
DeltaU , capping, &
zetax2U, etax2U, rep_prsU)

Expand Down
76 changes: 32 additions & 44 deletions cicecore/cicedynB/dynamics/ice_dyn_evp_1d.F90
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ subroutine stress_iter(NA_len, ee, ne, se, lb, ub, uvel, vvel, dxt, &
use ice_kinds_mod
use ice_constants, only : p027, p055, p111, p166, p222, p25, &
p333, p5, c1p5, c1
use ice_dyn_shared, only : ecci, denom1, arlx1i, Ktens, revp
use ice_dyn_shared, only : ecci, denom1, arlx1i, Ktens, revp, &
deltaminEVP

implicit none

Expand All @@ -152,7 +153,7 @@ subroutine stress_iter(NA_len, ee, ne, se, lb, ub, uvel, vvel, dxt, &
! local variables

integer(kind=int_kind) :: iw, il, iu
real(kind=dbl_kind) :: puny, divune, divunw, divuse, divusw, &
real(kind=dbl_kind) :: divune, divunw, divuse, divusw, &
tensionne, tensionnw, tensionse, tensionsw, shearne, shearnw, &
shearse, shearsw, Deltane, Deltanw, Deltase, Deltasw, c0ne, &
c0nw, c0se, c0sw, c1ne, c1nw, c1se, c1sw, ssigpn, ssigps, &
Expand All @@ -163,17 +164,10 @@ subroutine stress_iter(NA_len, ee, ne, se, lb, ub, uvel, vvel, dxt, &
csig12se, csig12sw, str12ew, str12we, str12ns, str12sn, &
strp_tmp, strm_tmp, tmp_uvel_ee, tmp_vvel_se, tmp_vvel_ee, &
tmp_vvel_ne, tmp_uvel_ne, tmp_uvel_se, dxhy, dyhx, cxp, cyp, &
cxm, cym, tinyarea,tmparea
cxm, cym, tmparea, DminTarea

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

call icepack_query_parameters(puny_out=puny)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) then
call abort_ice(error_message=subname, file=__FILE__, &
line=__LINE__)
end if

#ifdef _OPENACC
!$acc parallel &
!$acc present(ee, ne, se, strength, uvel, vvel, dxt, dyt, hte, &
Expand All @@ -190,14 +184,14 @@ subroutine stress_iter(NA_len, ee, ne, se, lb, ub, uvel, vvel, dxt, &

if (skiptcell(iw)) cycle

tmparea = dxt(iw) * dyt(iw) ! necessary to split calc of tinyarea. Otherwize not binary identical
tinyarea = puny * tmparea
dxhy = p5 * (hte(iw) - htem1(iw))
dyhx = p5 * (htn(iw) - htnm1(iw))
cxp = c1p5 * htn(iw) - p5 * htnm1(iw)
cyp = c1p5 * hte(iw) - p5 * htem1(iw)
cxm = -(c1p5 * htnm1(iw) - p5 * htn(iw))
cym = -(c1p5 * htem1(iw) - p5 * hte(iw))
tmparea = dxt(iw) * dyt(iw) ! necessary to split calc of DminTarea. Otherwize not binary identical
DminTarea = deltaminEVP * tmparea
dxhy = p5 * (hte(iw) - htem1(iw))
dyhx = p5 * (htn(iw) - htnm1(iw))
cxp = c1p5 * htn(iw) - p5 * htnm1(iw)
cyp = c1p5 * hte(iw) - p5 * htem1(iw)
cxm = -(c1p5 * htnm1(iw) - p5 * htn(iw))
cym = -(c1p5 * htem1(iw) - p5 * hte(iw))

!--------------------------------------------------------------
! strain rates
Expand Down Expand Up @@ -252,10 +246,10 @@ subroutine stress_iter(NA_len, ee, ne, se, lb, ub, uvel, vvel, dxt, &
! save replacement pressure for principal stress calculation
!--------------------------------------------------------------

c0ne = strength(iw) / max(Deltane, tinyarea)
c0nw = strength(iw) / max(Deltanw, tinyarea)
c0sw = strength(iw) / max(Deltasw, tinyarea)
c0se = strength(iw) / max(Deltase, tinyarea)
c0ne = strength(iw) / max(Deltane, DminTarea)
c0nw = strength(iw) / max(Deltanw, DminTarea)
c0sw = strength(iw) / max(Deltasw, DminTarea)
c0se = strength(iw) / max(Deltase, DminTarea)

c1ne = c0ne * arlx1i
c1nw = c0nw * arlx1i
Expand Down Expand Up @@ -408,7 +402,8 @@ subroutine stress_last(NA_len, ee, ne, se, lb, ub, uvel, vvel, dxt, &
use ice_kinds_mod
use ice_constants, only : p027, p055, p111, p166, p222, p25, &
p333, p5, c1p5, c1, c0
use ice_dyn_shared, only : ecci, denom1, arlx1i, Ktens, revp
use ice_dyn_shared, only : ecci, denom1, arlx1i, Ktens, revp,&
deltaminEVP

implicit none

Expand All @@ -429,7 +424,7 @@ subroutine stress_last(NA_len, ee, ne, se, lb, ub, uvel, vvel, dxt, &
! local variables

integer(kind=int_kind) :: iw, il, iu
real(kind=dbl_kind) :: puny, divune, divunw, divuse, divusw, &
real(kind=dbl_kind) :: divune, divunw, divuse, divusw, &
tensionne, tensionnw, tensionse, tensionsw, shearne, shearnw, &
shearse, shearsw, Deltane, Deltanw, Deltase, Deltasw, c0ne, &
c0nw, c0se, c0sw, c1ne, c1nw, c1se, c1sw, ssigpn, ssigps, &
Expand All @@ -440,17 +435,10 @@ subroutine stress_last(NA_len, ee, ne, se, lb, ub, uvel, vvel, dxt, &
csig12se, csig12sw, str12ew, str12we, str12ns, str12sn, &
strp_tmp, strm_tmp, tmp_uvel_ee, tmp_vvel_se, tmp_vvel_ee, &
tmp_vvel_ne, tmp_uvel_ne, tmp_uvel_se, dxhy, dyhx, cxp, cyp, &
cxm, cym, tinyarea, tmparea
cxm, cym, tmparea, DminTarea

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

call icepack_query_parameters(puny_out=puny)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) then
call abort_ice(error_message=subname, file=__FILE__, &
line=__LINE__)
end if

#ifdef _OPENACC
!$acc parallel &
!$acc present(ee, ne, se, strength, uvel, vvel, dxt, dyt, hte, &
Expand All @@ -468,14 +456,14 @@ subroutine stress_last(NA_len, ee, ne, se, lb, ub, uvel, vvel, dxt, &

if (skiptcell(iw)) cycle

tmparea = dxt(iw) * dyt(iw) ! necessary to split calc of tinyarea. Otherwize not binary identical
tinyarea = puny * tmparea
dxhy = p5 * (hte(iw) - htem1(iw))
dyhx = p5 * (htn(iw) - htnm1(iw))
cxp = c1p5 * htn(iw) - p5 * htnm1(iw)
cyp = c1p5 * hte(iw) - p5 * htem1(iw)
cxm = -(c1p5 * htnm1(iw) - p5 * htn(iw))
cym = -(c1p5 * htem1(iw) - p5 * hte(iw))
tmparea = dxt(iw) * dyt(iw) ! necessary to split calc of DminTarea. Otherwize not binary identical
DminTarea = deltaminEVP * tmparea
dxhy = p5 * (hte(iw) - htem1(iw))
dyhx = p5 * (htn(iw) - htnm1(iw))
cxp = c1p5 * htn(iw) - p5 * htnm1(iw)
cyp = c1p5 * hte(iw) - p5 * htem1(iw)
cxm = -(c1p5 * htnm1(iw) - p5 * htn(iw))
cym = -(c1p5 * htem1(iw) - p5 * hte(iw))

!--------------------------------------------------------------
! strain rates
Expand Down Expand Up @@ -545,10 +533,10 @@ subroutine stress_last(NA_len, ee, ne, se, lb, ub, uvel, vvel, dxt, &
! save replacement pressure for principal stress calculation
!--------------------------------------------------------------

c0ne = strength(iw) / max(Deltane, tinyarea)
c0nw = strength(iw) / max(Deltanw, tinyarea)
c0sw = strength(iw) / max(Deltasw, tinyarea)
c0se = strength(iw) / max(Deltase, tinyarea)
c0ne = strength(iw) / max(Deltane, DminTarea)
c0nw = strength(iw) / max(Deltanw, DminTarea)
c0sw = strength(iw) / max(Deltasw, DminTarea)
c0se = strength(iw) / max(Deltase, DminTarea)

c1ne = c0ne * arlx1i
c1nw = c0nw * arlx1i
Expand Down
Loading