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

Fastice #52

Merged
merged 15 commits into from
Dec 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 18 additions & 2 deletions cicecore/cicedynB/analysis/ice_history.F90
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ subroutine init_hist (dt)
use ice_exit, only: abort_ice
use ice_fileunits, only: nu_nml, nml_filename, nu_diag, &
get_fileunit, release_fileunit
use ice_flux, only: mlt_onset, frz_onset, albcnt
use ice_flux, only: mlt_onset, frz_onset, albcnt, taubx, tauby
use ice_history_shared ! everything
use ice_history_mechred, only: init_hist_mechred_2D, init_hist_mechred_3Dc
use ice_history_pond, only: init_hist_pond_2D, init_hist_pond_3Dc
Expand Down Expand Up @@ -279,6 +279,8 @@ subroutine init_hist (dt)
call broadcast_scalar (f_strocny, master_task)
call broadcast_scalar (f_strintx, master_task)
call broadcast_scalar (f_strinty, master_task)
call broadcast_scalar (f_taubx, master_task)
call broadcast_scalar (f_tauby, master_task)
call broadcast_scalar (f_strength, master_task)
call broadcast_scalar (f_divu, master_task)
call broadcast_scalar (f_shear, master_task)
Expand Down Expand Up @@ -725,6 +727,16 @@ subroutine init_hist (dt)
"internal ice stress (y)", &
"positive is y direction on U grid", c1, c0, &
ns1, f_strinty)

call define_hist_field(n_taubx,"taubx","N/m^2",ustr2D, ucstr, &
"basal (seabed) stress (x)", &
"positive is x direction on U grid", c1, c0, &
ns1, f_taubx)

call define_hist_field(n_tauby,"tauby","N/m^2",ustr2D, ucstr, &
"basal (seabed) stress (y)", &
"positive is y direction on U grid", c1, c0, &
ns1, f_tauby)

call define_hist_field(n_strength,"strength","N/m",tstr2D, tcstr, &
"compressive ice strength", &
Expand Down Expand Up @@ -1175,7 +1187,7 @@ subroutine accum_hist (dt)
melts, meltb, meltt, meltl, fresh, fsalt, fresh_ai, fsalt_ai, &
fhocn, fhocn_ai, uatm, vatm, fbot, &
fswthru_ai, strairx, strairy, strtltx, strtlty, strintx, strinty, &
strocnx, strocny, fm, daidtt, dvidtt, daidtd, dvidtd, fsurf, &
taubx, tauby, strocnx, strocny, fm, daidtt, dvidtt, daidtd, dvidtd, fsurf, &
fcondtop, fsurfn, fcondtopn, flatn, fsensn, albcnt, prs_sig, &
stressp_1, stressm_1, stress12_1, &
stressp_2, stressm_2, stress12_2, &
Expand Down Expand Up @@ -1481,6 +1493,10 @@ subroutine accum_hist (dt)
call accum_hist_field(n_strintx, iblk, strintx(:,:,iblk), a2D)
if (f_strinty(1:1) /= 'x') &
call accum_hist_field(n_strinty, iblk, strinty(:,:,iblk), a2D)
if (f_taubx(1:1) /= 'x') &
call accum_hist_field(n_taubx, iblk, taubx(:,:,iblk), a2D)
if (f_tauby(1:1) /= 'x') &
call accum_hist_field(n_tauby, iblk, tauby(:,:,iblk), a2D)
if (f_strength(1:1)/= 'x') &
call accum_hist_field(n_strength,iblk, strength(:,:,iblk), a2D)

Expand Down
3 changes: 3 additions & 0 deletions cicecore/cicedynB/analysis/ice_history_shared.F90
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ module ice_history_shared
f_strcorx = 'm', f_strcory = 'm', &
f_strocnx = 'm', f_strocny = 'm', &
f_strintx = 'm', f_strinty = 'm', &
f_taubx = 'm', f_tauby = 'm', &
f_strength = 'm', &
f_divu = 'm', f_shear = 'm', &
f_sig1 = 'm', f_sig2 = 'm', &
Expand Down Expand Up @@ -308,6 +309,7 @@ module ice_history_shared
f_strcorx, f_strcory , &
f_strocnx, f_strocny , &
f_strintx, f_strinty , &
f_taubx, f_tauby , &
f_strength, &
f_divu, f_shear , &
f_sig1, f_sig2 , &
Expand Down Expand Up @@ -412,6 +414,7 @@ module ice_history_shared
n_strcorx , n_strcory , &
n_strocnx , n_strocny , &
n_strintx , n_strinty , &
n_taubx , n_tauby , &
n_strength , &
n_divu , n_shear , &
n_sig1 , n_sig2 , &
Expand Down
35 changes: 32 additions & 3 deletions cicecore/cicedynB/dynamics/ice_dyn_eap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ subroutine eap (dt)
use ice_domain, only: nblocks, blocks_ice, halo_info, maskhalo_dyn
use ice_dyn_shared, only: fcor_blk, ndte, dtei, a_min, m_min, &
cosw, sinw, denom1, uvel_init, vvel_init, arlx1i, &
evp_prep1, evp_prep2, stepu, evp_finish
evp_prep1, evp_prep2, stepu, evp_finish, &
basal_stress_coeff, basalstress
use ice_flux, only: rdg_conv, rdg_shear, prs_sig, strairxT, strairyT, &
strairx, strairy, uocn, vocn, ss_tltx, ss_tlty, iceumask, fm, &
strtltx, strtlty, strocnx, strocny, strintx, strinty, &
strocnxT, strocnyT, strax, stray, &
Cbu, taubx, tauby, hwater, &
stressp_1, stressp_2, stressp_3, stressp_4, &
stressm_1, stressm_2, stressm_3, stressm_4, &
stress12_1, stress12_2, stress12_3, stress12_4
Expand Down Expand Up @@ -269,7 +271,8 @@ subroutine eap (dt)
stress12_1(:,:,iblk), stress12_2(:,:,iblk), &
stress12_3(:,:,iblk), stress12_4(:,:,iblk), &
uvel_init (:,:,iblk), vvel_init (:,:,iblk), &
uvel (:,:,iblk), vvel (:,:,iblk))
uvel (:,:,iblk), vvel (:,:,iblk), &
Cbu (:,:,iblk))

!-----------------------------------------------------------------
! Initialize structure tensor
Expand Down Expand Up @@ -387,6 +390,21 @@ subroutine eap (dt)
strtmp (:,:,:))
! call ice_timer_stop(timer_tmp1) ! dynamics

!-----------------------------------------------------------------
! basal stress calculation (landfast ice)
!-----------------------------------------------------------------

if (basalstress) then
call basal_stress_coeff (nx_block, ny_block, &
icellu (iblk), &
indxui(:,iblk), indxuj(:,iblk), &
vice(:,:,iblk), aice(:,:,iblk), &
hwater(:,:,iblk), &
uvel(:,:,iblk), vvel(:,:,iblk), &
Cbu(:,:,iblk))
endif


!-----------------------------------------------------------------
! momentum equation
!-----------------------------------------------------------------
Expand All @@ -403,7 +421,8 @@ subroutine eap (dt)
strocnx (:,:,iblk), strocny (:,:,iblk), &
strintx (:,:,iblk), strinty (:,:,iblk), &
uvel_init(:,:,iblk), vvel_init(:,:,iblk),&
uvel (:,:,iblk), vvel (:,:,iblk))
uvel (:,:,iblk), vvel (:,:,iblk), &
Cbu (:,:,iblk))

! load velocity into array for boundary updates
fld2(:,:,1,iblk) = uvel(:,:,iblk)
Expand Down Expand Up @@ -453,6 +472,16 @@ subroutine eap (dt)
!$OMP END PARALLEL DO

enddo ! subcycling

! calculate basal stress component for outputs
if ( basalstress ) then
!$OMP PARALLEL DO PRIVATE(iblk)
do iblk = 1, nblocks
taubx(:,:,iblk) = Cbu(:,:,iblk)*uvel(:,:,iblk)
tauby(:,:,iblk) = Cbu(:,:,iblk)*vvel(:,:,iblk)
enddo
!$OMP END PARALLEL DO
endif

deallocate(fld2)
if (maskhalo_dyn) call ice_HaloDestroy(halo_info_mask)
Expand Down
63 changes: 45 additions & 18 deletions cicecore/cicedynB/dynamics/ice_dyn_evp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module ice_dyn_evp
use ice_kinds_mod
use ice_dyn_shared, only: stepu, evp_prep1, evp_prep2, evp_finish, &
ndte, yield_curve, ecci, denom1, arlx1i, fcor_blk, uvel_init, &
vvel_init
vvel_init, basal_stress_coeff, basalstress, Ktens

implicit none
private
Expand Down Expand Up @@ -77,6 +77,7 @@ subroutine evp (dt)
strairx, strairy, uocn, vocn, ss_tltx, ss_tlty, iceumask, fm, &
strtltx, strtlty, strocnx, strocny, strintx, strinty, &
strocnxT, strocnyT, strax, stray, &
Cbu, taubx, tauby, hwater, &
stressp_1, stressp_2, stressp_3, stressp_4, &
stressm_1, stressm_2, stressm_3, stressm_4, &
stress12_1, stress12_2, stress12_3, stress12_4
Expand Down Expand Up @@ -263,7 +264,8 @@ subroutine evp (dt)
stress12_1(:,:,iblk), stress12_2(:,:,iblk), &
stress12_3(:,:,iblk), stress12_4(:,:,iblk), &
uvel_init (:,:,iblk), vvel_init (:,:,iblk), &
uvel (:,:,iblk), vvel (:,:,iblk))
uvel (:,:,iblk), vvel (:,:,iblk), &
Cbu (:,:,iblk))

!-----------------------------------------------------------------
! ice strength
Expand Down Expand Up @@ -347,6 +349,20 @@ subroutine evp (dt)
strtmp (:,:,:) )
! endif ! yield_curve

!-----------------------------------------------------------------
! basal stress calculation (landfast ice)
!-----------------------------------------------------------------

if (basalstress) then
call basal_stress_coeff (nx_block, ny_block, &
icellu (iblk), &
indxui(:,iblk), indxuj(:,iblk), &
vice(:,:,iblk), aice(:,:,iblk), &
hwater(:,:,iblk), &
uvel(:,:,iblk), vvel(:,:,iblk), &
Cbu(:,:,iblk))
endif

!-----------------------------------------------------------------
! momentum equation
!-----------------------------------------------------------------
Expand All @@ -363,7 +379,8 @@ subroutine evp (dt)
strocnx (:,:,iblk), strocny (:,:,iblk), &
strintx (:,:,iblk), strinty (:,:,iblk), &
uvel_init(:,:,iblk), vvel_init(:,:,iblk),&
uvel (:,:,iblk), vvel (:,:,iblk))
uvel (:,:,iblk), vvel (:,:,iblk), &
Cbu (:,:,iblk))

! load velocity into array for boundary updates
fld2(:,:,1,iblk) = uvel(:,:,iblk)
Expand All @@ -388,8 +405,18 @@ subroutine evp (dt)
vvel(:,:,iblk) = fld2(:,:,2,iblk)
enddo
!$OMP END PARALLEL DO

enddo ! subcycling

! calculate basal stress component for outputs
if ( basalstress ) then
!$OMP PARALLEL DO PRIVATE(iblk)
do iblk = 1, nblocks
taubx(:,:,iblk) = Cbu(:,:,iblk)*uvel(:,:,iblk)
tauby(:,:,iblk) = Cbu(:,:,iblk)*vvel(:,:,iblk)
enddo
!$OMP END PARALLEL DO
endif

deallocate(fld2)
if (maskhalo_dyn) call ice_HaloDestroy(halo_info_mask)
Expand Down Expand Up @@ -521,7 +548,7 @@ subroutine stress (nx_block, ny_block, &
str )

use ice_constants, only: c0, c4, p027, p055, p111, p166, &
p2, p222, p25, p333, p5, puny
p2, p222, p25, p333, p5, puny, c1

integer (kind=int_kind), intent(in) :: &
nx_block, ny_block, & ! block dimensions
Expand Down Expand Up @@ -683,24 +710,24 @@ subroutine stress (nx_block, ny_block, &
! (1) northeast, (2) northwest, (3) southwest, (4) southeast
!-----------------------------------------------------------------

stressp_1(i,j) = (stressp_1(i,j) + c1ne*(divune - Deltane)) &
stressp_1(i,j) = (stressp_1(i,j) + c1ne*(divune*(c1+Ktens) - Deltane*(c1-Ktens))) &
* denom1
stressp_2(i,j) = (stressp_2(i,j) + c1nw*(divunw - Deltanw)) &
stressp_2(i,j) = (stressp_2(i,j) + c1nw*(divunw*(c1+Ktens) - Deltanw*(c1-Ktens))) &
* denom1
stressp_3(i,j) = (stressp_3(i,j) + c1sw*(divusw - Deltasw)) &
stressp_3(i,j) = (stressp_3(i,j) + c1sw*(divusw*(c1+Ktens) - Deltasw*(c1-Ktens))) &
* denom1
stressp_4(i,j) = (stressp_4(i,j) + c1se*(divuse - Deltase)) &
stressp_4(i,j) = (stressp_4(i,j) + c1se*(divuse*(c1+Ktens) - Deltase*(c1-Ktens))) &
* denom1

stressm_1(i,j) = (stressm_1(i,j) + c0ne*tensionne) * denom1
stressm_2(i,j) = (stressm_2(i,j) + c0nw*tensionnw) * denom1
stressm_3(i,j) = (stressm_3(i,j) + c0sw*tensionsw) * denom1
stressm_4(i,j) = (stressm_4(i,j) + c0se*tensionse) * denom1
stress12_1(i,j) = (stress12_1(i,j) + c0ne*shearne*p5) * denom1
stress12_2(i,j) = (stress12_2(i,j) + c0nw*shearnw*p5) * denom1
stress12_3(i,j) = (stress12_3(i,j) + c0sw*shearsw*p5) * denom1
stress12_4(i,j) = (stress12_4(i,j) + c0se*shearse*p5) * denom1
stressm_1(i,j) = (stressm_1(i,j) + c0ne*tensionne*(c1+Ktens)) * denom1
stressm_2(i,j) = (stressm_2(i,j) + c0nw*tensionnw*(c1+Ktens)) * denom1
stressm_3(i,j) = (stressm_3(i,j) + c0sw*tensionsw*(c1+Ktens)) * denom1
stressm_4(i,j) = (stressm_4(i,j) + c0se*tensionse*(c1+Ktens)) * denom1

stress12_1(i,j) = (stress12_1(i,j) + c0ne*shearne*p5*(c1+Ktens)) * denom1
stress12_2(i,j) = (stress12_2(i,j) + c0nw*shearnw*p5*(c1+Ktens)) * denom1
stress12_3(i,j) = (stress12_3(i,j) + c0sw*shearsw*p5*(c1+Ktens)) * denom1
stress12_4(i,j) = (stress12_4(i,j) + c0se*shearse*p5*(c1+Ktens)) * denom1

!-----------------------------------------------------------------
! Eliminate underflows.
Expand Down
Loading