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

move deformation out of loop for B grid only #755

Merged
merged 4 commits into from
Sep 22, 2022
Merged
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
107 changes: 58 additions & 49 deletions cicecore/cicedynB/dynamics/ice_dyn_evp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -774,22 +774,6 @@ subroutine evp (dt)
stress12_3(:,:,iblk), stress12_4(:,:,iblk), &
strtmp (:,:,:) )

!-----------------------------------------------------------------
! on last subcycle, save quantities for mechanical redistribution
!-----------------------------------------------------------------
if (ksub == ndte) then
call deformations (nx_block , ny_block , &
icellt (iblk), &
indxti (:,iblk), indxtj (:,iblk), &
uvel (:,:,iblk), vvel (:,:,iblk), &
dxT (:,:,iblk), dyT (:,:,iblk), &
cxp (:,:,iblk), cyp (:,:,iblk), &
cxm (:,:,iblk), cym (:,:,iblk), &
tarear (:,:,iblk), &
shear (:,:,iblk), divu (:,:,iblk), &
rdg_conv(:,:,iblk), rdg_shear(:,:,iblk) )
endif

!-----------------------------------------------------------------
! momentum equation
!-----------------------------------------------------------------
Expand Down Expand Up @@ -819,6 +803,26 @@ subroutine evp (dt)

enddo ! sub cycling

!-----------------------------------------------------------------
! save quantities for mechanical redistribution
!-----------------------------------------------------------------

!$OMP PARALLEL DO PRIVATE(iblk) SCHEDULE(runtime)
do iblk = 1, nblocks
call deformations (nx_block , ny_block , &
icellt (iblk), &
indxti (:,iblk), indxtj (:,iblk), &
uvel (:,:,iblk), vvel (:,:,iblk), &
dxT (:,:,iblk), dyT (:,:,iblk), &
cxp (:,:,iblk), cyp (:,:,iblk), &
cxm (:,:,iblk), cym (:,:,iblk), &
tarear (:,:,iblk), &
shear (:,:,iblk), divu (:,:,iblk), &
rdg_conv(:,:,iblk), rdg_shear(:,:,iblk) )
enddo
!$OMP END PARALLEL DO


elseif (grid_ice == "C") then

do ksub = 1,ndte ! subcycling
Expand Down Expand Up @@ -866,24 +870,6 @@ subroutine evp (dt)
zetax2T (:,:,iblk), etax2T (:,:,iblk), &
stresspT (:,:,iblk), stressmT (:,:,iblk))

!-----------------------------------------------------------------
! on last subcycle, save quantities for mechanical redistribution
!-----------------------------------------------------------------
if (ksub == ndte) then

call deformationsC_T (nx_block , ny_block , &
icellt (iblk), &
indxti (:,iblk), indxtj (:,iblk), &
uvelE (:,:,iblk), vvelE (:,:,iblk), &
uvelN (:,:,iblk), vvelN (:,:,iblk), &
dxN (:,:,iblk), dyE (:,:,iblk), &
dxT (:,:,iblk), dyT (:,:,iblk), &
tarear (:,:,iblk), uarea (:,:,iblk), &
shearU (:,:,iblk), &
shear (:,:,iblk), divu (:,:,iblk), &
rdg_conv(:,:,iblk), rdg_shear(:,:,iblk))

endif
enddo
!$OMP END PARALLEL DO

Expand Down Expand Up @@ -1002,6 +988,26 @@ subroutine evp (dt)

enddo ! subcycling

!-----------------------------------------------------------------
! save quantities for mechanical redistribution
!-----------------------------------------------------------------

!$OMP PARALLEL DO PRIVATE(iblk) SCHEDULE(runtime)
do iblk = 1, nblocks
call deformationsC_T (nx_block , ny_block , &
icellt (iblk), &
indxti (:,iblk), indxtj (:,iblk), &
uvelE (:,:,iblk), vvelE (:,:,iblk), &
uvelN (:,:,iblk), vvelN (:,:,iblk), &
dxN (:,:,iblk), dyE (:,:,iblk), &
dxT (:,:,iblk), dyT (:,:,iblk), &
tarear (:,:,iblk), uarea (:,:,iblk), &
shearU (:,:,iblk), &
shear (:,:,iblk), divu (:,:,iblk), &
rdg_conv(:,:,iblk), rdg_shear(:,:,iblk))
enddo
!$OMP END PARALLEL DO

elseif (grid_ice == "CD") then

do ksub = 1,ndte ! subcycling
Expand All @@ -1021,21 +1027,6 @@ subroutine evp (dt)
stresspT (:,:,iblk), stressmT (:,:,iblk), &
stress12T (:,:,iblk) )

!-----------------------------------------------------------------
! on last subcycle, save quantities for mechanical redistribution
!-----------------------------------------------------------------
if (ksub == ndte) then
call deformationsCD_T (nx_block , ny_block , &
icellt (iblk), &
indxti (:,iblk), indxtj (:,iblk), &
uvelE (:,:,iblk), vvelE (:,:,iblk), &
uvelN (:,:,iblk), vvelN (:,:,iblk), &
dxN (:,:,iblk), dyE (:,:,iblk), &
dxT (:,:,iblk), dyT (:,:,iblk), &
tarear (:,:,iblk), &
shear (:,:,iblk), divu (:,:,iblk), &
rdg_conv(:,:,iblk), rdg_shear(:,:,iblk))
endif
enddo
!$OMP END PARALLEL DO

Expand Down Expand Up @@ -1188,6 +1179,24 @@ subroutine evp (dt)

enddo ! subcycling

!-----------------------------------------------------------------
! save quantities for mechanical redistribution
!-----------------------------------------------------------------

!$OMP PARALLEL DO PRIVATE(iblk)
do iblk = 1, nblocks
call deformationsCD_T (nx_block , ny_block , &
icellt (iblk), &
indxti (:,iblk), indxtj (:,iblk), &
uvelE (:,:,iblk), vvelE (:,:,iblk), &
uvelN (:,:,iblk), vvelN (:,:,iblk), &
dxN (:,:,iblk), dyE (:,:,iblk), &
dxT (:,:,iblk), dyT (:,:,iblk), &
tarear (:,:,iblk), &
shear (:,:,iblk), divu (:,:,iblk), &
rdg_conv(:,:,iblk), rdg_shear(:,:,iblk))
enddo
!$OMP END PARALLEL DO
endif ! grid_ice

call ice_timer_stop(timer_evp_2d)
Expand Down