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

Modif to basal stress calculation for computational efficiency (NEW one) #144

Merged
merged 1 commit into from
Jun 1, 2018
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
52 changes: 22 additions & 30 deletions cicecore/cicedynB/dynamics/ice_dyn_eap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ subroutine eap (dt)
basal_stress_coeff, basalstress
use ice_flux, only: rdg_conv, rdg_shear, strairxT, strairyT, &
strairx, strairy, uocn, vocn, ss_tltx, ss_tlty, iceumask, fm, &
strtltx, strtlty, strocnx, strocny, strintx, strinty, &
strtltx, strtlty, strocnx, strocny, strintx, strinty, taubx, tauby, &
strocnxT, strocnyT, strax, stray, &
Cbu, taubx, tauby, hwater, &
Tbu, 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,6 +269,7 @@ subroutine eap (dt)
strtltx (:,:,iblk), strtlty (:,:,iblk), &
strocnx (:,:,iblk), strocny (:,:,iblk), &
strintx (:,:,iblk), strinty (:,:,iblk), &
taubx (:,:,iblk), tauby (:,:,iblk), &
waterx (:,:,iblk), watery (:,:,iblk), &
forcex (:,:,iblk), forcey (:,:,iblk), &
stressp_1 (:,:,iblk), stressp_2 (:,:,iblk), &
Expand All @@ -279,7 +280,7 @@ subroutine eap (dt)
stress12_3(:,:,iblk), stress12_4(:,:,iblk), &
uvel_init (:,:,iblk), vvel_init (:,:,iblk), &
uvel (:,:,iblk), vvel (:,:,iblk), &
Cbu (:,:,iblk))
Tbu (:,:,iblk))

!-----------------------------------------------------------------
! Initialize structure tensor
Expand Down Expand Up @@ -356,6 +357,20 @@ subroutine eap (dt)
call ice_HaloMask(halo_info_mask, halo_info, halomask)
endif

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

if (basalstress) then
do iblk = 1, nblocks
call basal_stress_coeff (nx_block, ny_block, &
icellu (iblk), &
indxui(:,iblk), indxuj(:,iblk), &
vice(:,:,iblk), aice(:,:,iblk), &
hwater(:,:,iblk), Tbu(:,:,iblk))
enddo
endif

do ksub = 1,ndte ! subcycling

!-----------------------------------------------------------------
Expand Down Expand Up @@ -400,39 +415,26 @@ 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
!-----------------------------------------------------------------

call stepu (nx_block, ny_block, &
icellu (iblk), Cdn_ocn (:,:,iblk), &
indxui (:,iblk), indxuj (:,iblk), &
ksub, &
aiu (:,:,iblk), strtmp (:,:,:), &
uocn (:,:,iblk), vocn (:,:,iblk), &
waterx (:,:,iblk), watery (:,:,iblk), &
forcex (:,:,iblk), forcey (:,:,iblk), &
umassdti (:,:,iblk), fm (:,:,iblk), &
uarear (:,:,iblk), &
strocnx (:,:,iblk), strocny (:,:,iblk), &
strintx (:,:,iblk), strinty (:,:,iblk), &
strintx (:,:,iblk), strinty (:,:,iblk), &
taubx (:,:,iblk), tauby (:,:,iblk), &
uvel_init(:,:,iblk), vvel_init(:,:,iblk),&
uvel (:,:,iblk), vvel (:,:,iblk), &
Cbu (:,:,iblk))
Tbu (:,:,iblk))

! load velocity into array for boundary updates
fld2(:,:,1,iblk) = uvel(:,:,iblk)
Expand Down Expand Up @@ -482,16 +484,6 @@ 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
53 changes: 23 additions & 30 deletions cicecore/cicedynB/dynamics/ice_dyn_evp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ subroutine evp (dt)
use ice_domain_size, only: max_blocks, ncat
use ice_flux, only: rdg_conv, rdg_shear, strairxT, strairyT, &
strairx, strairy, uocn, vocn, ss_tltx, ss_tlty, iceumask, fm, &
strtltx, strtlty, strocnx, strocny, strintx, strinty, &
strtltx, strtlty, strocnx, strocny, strintx, strinty, taubx, tauby, &
strocnxT, strocnyT, strax, stray, &
Cbu, taubx, tauby, hwater, &
Tbu, 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 @@ -260,6 +260,7 @@ subroutine evp (dt)
strtltx (:,:,iblk), strtlty (:,:,iblk), &
strocnx (:,:,iblk), strocny (:,:,iblk), &
strintx (:,:,iblk), strinty (:,:,iblk), &
taubx (:,:,iblk), tauby (:,:,iblk), &
waterx (:,:,iblk), watery (:,:,iblk), &
forcex (:,:,iblk), forcey (:,:,iblk), &
stressp_1 (:,:,iblk), stressp_2 (:,:,iblk), &
Expand All @@ -270,7 +271,7 @@ subroutine evp (dt)
stress12_3(:,:,iblk), stress12_4(:,:,iblk), &
uvel_init (:,:,iblk), vvel_init (:,:,iblk), &
uvel (:,:,iblk), vvel (:,:,iblk), &
Cbu (:,:,iblk))
Tbu (:,:,iblk))

!-----------------------------------------------------------------
! ice strength
Expand Down Expand Up @@ -326,6 +327,20 @@ subroutine evp (dt)
call ice_HaloMask(halo_info_mask, halo_info, halomask)
endif

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

if (basalstress) then
do iblk = 1, nblocks
call basal_stress_coeff (nx_block, ny_block, &
icellu (iblk), &
indxui(:,iblk), indxuj(:,iblk), &
vice(:,:,iblk), aice(:,:,iblk), &
hwater(:,:,iblk), Tbu(:,:,iblk))
enddo
endif

do ksub = 1,ndte ! subcycling

!-----------------------------------------------------------------
Expand Down Expand Up @@ -357,38 +372,26 @@ 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
!-----------------------------------------------------------------

call stepu (nx_block, ny_block, &
icellu (iblk), Cdn_ocn (:,:,iblk), &
indxui (:,iblk), indxuj (:,iblk), &
indxui (:,iblk), indxuj (:,iblk), &
ksub, &
aiu (:,:,iblk), strtmp (:,:,:), &
uocn (:,:,iblk), vocn (:,:,iblk), &
waterx (:,:,iblk), watery (:,:,iblk), &
forcex (:,:,iblk), forcey (:,:,iblk), &
umassdti (:,:,iblk), fm (:,:,iblk), &
uarear (:,:,iblk), &
strocnx (:,:,iblk), strocny (:,:,iblk), &
strintx (:,:,iblk), strinty (:,:,iblk), &
strintx (:,:,iblk), strinty (:,:,iblk), &
taubx (:,:,iblk), tauby (:,:,iblk), &
uvel_init(:,:,iblk), vvel_init(:,:,iblk),&
uvel (:,:,iblk), vvel (:,:,iblk), &
Cbu (:,:,iblk))
Tbu (:,:,iblk))

! load velocity into array for boundary updates
fld2(:,:,1,iblk) = uvel(:,:,iblk)
Expand All @@ -415,16 +418,6 @@ subroutine evp (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
Loading