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

Bug fixed 1d evp #568

Merged
merged 41 commits into from
Aug 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
0ba9ddf
Initialization of global HTE and HTN arrays with ghost cells on maste…
srethmeier Mar 1, 2021
f5c1c1f
Reverted configuration/scripts/cice.batch.csh to resolve bad auto mer…
srethmeier Mar 2, 2021
17d48d8
Merge pull request #13 from TillRasmussen/evp-1d
TillRasmussen Mar 2, 2021
b4bf34b
Spell error corrected (https://github.com/CICE-Consortium/CICE/pull/5…
srethmeier Mar 12, 2021
4b702b8
Redundant initializations to default values removed (https://github.c…
srethmeier Mar 12, 2021
a711bdc
Subroutine primary_grid_lengths_global_ext moved from ice_grid module…
srethmeier Mar 13, 2021
d669c8d
Merge pull request #14 from TillRasmussen/evp-1d
TillRasmussen Mar 14, 2021
aabb12f
Added 1d solver to be fully integrated. Removed kevp=102 bypass.
TillRasmussen Mar 16, 2021
1194e0c
General cleanup of ice_dyn_evp_1d module (https://github.com/CICE-Con…
srethmeier Mar 21, 2021
6f11797
Modified documentation in order to comply with modifications of evp 1d
Mar 23, 2021
462e7f0
Uncommenting of numainit parallelization removed and domp_init moved …
srethmeier Mar 23, 2021
8b02825
Merge pull request #15 from TillRasmussen/evp-1d
TillRasmussen Mar 23, 2021
bc79443
renamed set_nml.evp_algorithm to set_nml.evp1d
Mar 23, 2021
d0d3523
Merge branch 'master' of github.com:TillRasmussen/CICE
Mar 23, 2021
5bb4cba
rm set_nml.kevp102
Mar 23, 2021
37f42d9
Merge branch 'master' of https://github.com/cice-consortium/CICE into…
srethmeier Mar 24, 2021
0a5f938
Merge branch 'evp-1d'
srethmeier Mar 24, 2021
f624275
Merge remote-tracking branch 'upstream/master'
TillRasmussen Mar 25, 2021
09be327
Naming of variable se is not logical. Changed to sse which is the same
TillRasmussen Apr 6, 2021
bdc65bd
Alignment of NUMA-aware array splitting between threads
srethmeier Apr 7, 2021
3b8f6c7
Initialization of global HTE and HTN arrays with ghost cells on maste…
srethmeier Mar 1, 2021
ec162b2
Reverted configuration/scripts/cice.batch.csh to resolve bad auto mer…
srethmeier Mar 2, 2021
cbc4832
Spell error corrected (https://github.com/CICE-Consortium/CICE/pull/5…
srethmeier Mar 12, 2021
c3663ec
Redundant initializations to default values removed (https://github.c…
srethmeier Mar 12, 2021
bbe2e13
Subroutine primary_grid_lengths_global_ext moved from ice_grid module…
srethmeier Mar 13, 2021
15a4e9c
Added 1d solver to be fully integrated. Removed kevp=102 bypass.
TillRasmussen Mar 16, 2021
8e7970c
General cleanup of ice_dyn_evp_1d module (https://github.com/CICE-Con…
srethmeier Mar 21, 2021
6cccdaa
Modified documentation in order to comply with modifications of evp 1d
Mar 23, 2021
462ed9e
Uncommenting of numainit parallelization removed and domp_init moved …
srethmeier Mar 23, 2021
6b97cf0
renamed set_nml.evp_algorithm to set_nml.evp1d
Mar 23, 2021
08debdc
rm set_nml.kevp102
Mar 23, 2021
2f849ed
Naming of variable se is not logical. Changed to sse which is the same
TillRasmussen Apr 6, 2021
e3b00e4
Alignment of NUMA-aware array splitting between threads
srethmeier Apr 7, 2021
e2f49f9
Merge branch 'master' of github.com:TillRasmussen/CICE
TillRasmussen Apr 14, 2021
e4bedb4
Fix bad scaling of calculation of tinyarea. Different order of multip…
TillRasmussen Jul 11, 2021
fb2b3ed
Merge branch 'master' into master
TillRasmussen Jul 11, 2021
3eb47b2
Merge branch 'master' into master
srethmeier Jul 16, 2021
1262455
Fix evp 1d masking issues
apcraig Jul 16, 2021
064bc47
Merge pull request #17 from apcraig/evp1da
srethmeier Jul 17, 2021
1869e93
Some minor revisions in the documentation as suggested by @apcraig (h…
srethmeier Jul 17, 2021
92c49bb
Merge branch 'master' of https://github.com/TillRasmussen/CICE
srethmeier Jul 17, 2021
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
215 changes: 106 additions & 109 deletions cicecore/cicedynB/dynamics/ice_dyn_evp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
module ice_dyn_evp

use ice_kinds_mod
use ice_communicate, only: my_task
use ice_communicate, only: my_task, master_task
use ice_constants, only: field_loc_center, field_loc_NEcorner, &
field_type_scalar, field_type_vector
use ice_constants, only: c0, p027, p055, p111, p166, &
Expand Down Expand Up @@ -88,14 +88,14 @@ subroutine evp (dt)
stress12_1, stress12_2, stress12_3, stress12_4
use ice_grid, only: tmask, umask, dxt, dyt, dxhy, dyhx, cxp, cyp, cxm, cym, &
tarear, uarear, tinyarea, to_ugrid, t2ugrid_vector, u2tgrid_vector, &
grid_type, HTE, HTN
grid_type
use ice_state, only: aice, vice, vsno, uvel, vvel, divu, shear, &
aice_init, aice0, aicen, vicen, strength
use ice_timers, only: timer_dynamics, timer_bound, &
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: kevp_kernel, stack_velocity_field, unstack_velocity_field
use ice_dyn_shared, only: evp_algorithm, stack_velocity_field, unstack_velocity_field

real (kind=dbl_kind), intent(in) :: &
dt ! time step
Expand Down Expand Up @@ -331,7 +331,7 @@ subroutine evp (dt)

if (seabed_stress) then

!$OMP PARALLEL DO PRIVATE(iblk)
!$OMP PARALLEL DO PRIVATE(iblk)
do iblk = 1, nblocks

if ( seabed_stress_method == 'LKD' ) then
Expand All @@ -351,118 +351,115 @@ subroutine evp (dt)
hwater(:,:,iblk), Tbu(:,:,iblk))
endif

enddo
enddo
!$OMP END PARALLEL DO
endif

call ice_timer_start(timer_evp_2d)
if (kevp_kernel > 0) then
if (first_time .and. my_task == 0) then
write(nu_diag,'(2a,i6)') subname,' Entering kevp_kernel version ',kevp_kernel
first_time = .false.
endif
if (trim(grid_type) == 'tripole') then
call abort_ice(trim(subname)//' Kernel not tested on tripole grid. Set kevp_kernel=0')
endif
call ice_dyn_evp_1d_copyin( &
nx_block,ny_block,nblocks,nx_global+2*nghost,ny_global+2*nghost, &
HTE,HTN, &
!v1 dxhy,dyhx,cyp,cxp,cym,cxm,tinyarea, &
!v1 waterx,watery, &
icetmask, iceumask, &
cdn_ocn,aiu,uocn,vocn,forcex,forcey,Tbu, &
umassdti,fm,uarear,tarear,strintx,strinty,uvel_init,vvel_init,&
strength,uvel,vvel,dxt,dyt, &
stressp_1 ,stressp_2, stressp_3, stressp_4, &
stressm_1 ,stressm_2, stressm_3, stressm_4, &
stress12_1,stress12_2,stress12_3,stress12_4 )
if (kevp_kernel == 2) then
call ice_timer_start(timer_evp_1d)
call ice_dyn_evp_1d_kernel()
call ice_timer_stop(timer_evp_1d)
!v1 else if (kevp_kernel == 1) then
!v1 call evp_kernel_v1()
else
if (my_task == 0) write(nu_diag,*) subname,' ERROR: kevp_kernel = ',kevp_kernel
call abort_ice(subname//' kevp_kernel not supported.')
endif
call ice_dyn_evp_1d_copyout( &
nx_block,ny_block,nblocks,nx_global+2*nghost,ny_global+2*nghost,&
!strocn uvel,vvel, strocnx,strocny, strintx,strinty, &
uvel,vvel, strintx,strinty, &
stressp_1, stressp_2, stressp_3, stressp_4, &
stressm_1, stressm_2, stressm_3, stressm_4, &
stress12_1,stress12_2,stress12_3,stress12_4, &
divu,rdg_conv,rdg_shear,shear,taubx,tauby )

else ! kevp_kernel == 0 (Standard CICE)

do ksub = 1,ndte ! subcycling

!-----------------------------------------------------------------
! stress tensor equation, total surface stress
!-----------------------------------------------------------------

!$TCXOMP PARALLEL DO PRIVATE(iblk,strtmp)
do iblk = 1, nblocks

! if (trim(yield_curve) == 'ellipse') then
call stress (nx_block, ny_block, &
ksub, icellt(iblk), &
indxti (:,iblk), indxtj (:,iblk), &
uvel (:,:,iblk), vvel (:,:,iblk), &
dxt (:,:,iblk), dyt (:,:,iblk), &
dxhy (:,:,iblk), dyhx (:,:,iblk), &
cxp (:,:,iblk), cyp (:,:,iblk), &
cxm (:,:,iblk), cym (:,:,iblk), &
tarear (:,:,iblk), tinyarea (:,:,iblk), &
strength (:,:,iblk), &
stressp_1 (:,:,iblk), stressp_2 (:,:,iblk), &
stressp_3 (:,:,iblk), stressp_4 (:,:,iblk), &
stressm_1 (:,:,iblk), stressm_2 (:,:,iblk), &
stressm_3 (:,:,iblk), stressm_4 (:,:,iblk), &
stress12_1(:,:,iblk), stress12_2(:,:,iblk), &
stress12_3(:,:,iblk), stress12_4(:,:,iblk), &
shear (:,:,iblk), divu (:,:,iblk), &
rdg_conv (:,:,iblk), rdg_shear (:,:,iblk), &
strtmp (:,:,:) )
! endif ! yield_curve

!-----------------------------------------------------------------
! 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), &
strintx (:,:,iblk), strinty (:,:,iblk), &
taubx (:,:,iblk), tauby (:,:,iblk), &
uvel_init(:,:,iblk), vvel_init(:,:,iblk),&
uvel (:,:,iblk), vvel (:,:,iblk), &
Tbu (:,:,iblk))
enddo
!$TCXOMP END PARALLEL DO
if (evp_algorithm == "shared_mem_1d" ) then

call stack_velocity_field(uvel, vvel, fld2)
call ice_timer_start(timer_bound)
if (maskhalo_dyn) then
call ice_HaloUpdate (fld2, halo_info_mask, &
field_loc_NEcorner, field_type_vector)
else
call ice_HaloUpdate (fld2, halo_info, &
field_loc_NEcorner, field_type_vector)
if (first_time .and. my_task == master_task) then
write(nu_diag,'(3a)') subname,' Entering evp_algorithm version ',evp_algorithm
first_time = .false.
endif
call ice_timer_stop(timer_bound)
call unstack_velocity_field(fld2, uvel, vvel)
if (trim(grid_type) == 'tripole') then
call abort_ice(trim(subname)//' &
& Kernel not tested on tripole grid. Set evp_algorithm=standard_2d')
endif

call ice_dyn_evp_1d_copyin( &
nx_block,ny_block,nblocks,nx_global+2*nghost,ny_global+2*nghost, &
icetmask, iceumask, &
cdn_ocn,aiu,uocn,vocn,forcex,forcey,Tbu, &
umassdti,fm,uarear,tarear,strintx,strinty,uvel_init,vvel_init,&
strength,uvel,vvel,dxt,dyt, &
stressp_1 ,stressp_2, stressp_3, stressp_4, &
stressm_1 ,stressm_2, stressm_3, stressm_4, &
stress12_1,stress12_2,stress12_3,stress12_4 )
call ice_timer_start(timer_evp_1d)
call ice_dyn_evp_1d_kernel()
call ice_timer_stop(timer_evp_1d)
call ice_dyn_evp_1d_copyout( &
nx_block,ny_block,nblocks,nx_global+2*nghost,ny_global+2*nghost,&
!strocn uvel,vvel, strocnx,strocny, strintx,strinty, &
uvel,vvel, strintx,strinty, &
stressp_1, stressp_2, stressp_3, stressp_4, &
stressm_1, stressm_2, stressm_3, stressm_4, &
stress12_1,stress12_2,stress12_3,stress12_4, &
divu,rdg_conv,rdg_shear,shear,taubx,tauby )

else ! evp_algorithm == standard_2d (Standard CICE)

do ksub = 1,ndte ! subcycling

!-----------------------------------------------------------------
! stress tensor equation, total surface stress
!-----------------------------------------------------------------

!$TCXOMP PARALLEL DO PRIVATE(iblk,strtmp)
do iblk = 1, nblocks

! if (trim(yield_curve) == 'ellipse') then
call stress (nx_block, ny_block, &
ksub, icellt(iblk), &
indxti (:,iblk), indxtj (:,iblk), &
uvel (:,:,iblk), vvel (:,:,iblk), &
dxt (:,:,iblk), dyt (:,:,iblk), &
dxhy (:,:,iblk), dyhx (:,:,iblk), &
cxp (:,:,iblk), cyp (:,:,iblk), &
cxm (:,:,iblk), cym (:,:,iblk), &
tarear (:,:,iblk), tinyarea (:,:,iblk), &
strength (:,:,iblk), &
stressp_1 (:,:,iblk), stressp_2 (:,:,iblk), &
stressp_3 (:,:,iblk), stressp_4 (:,:,iblk), &
stressm_1 (:,:,iblk), stressm_2 (:,:,iblk), &
stressm_3 (:,:,iblk), stressm_4 (:,:,iblk), &
stress12_1(:,:,iblk), stress12_2(:,:,iblk), &
stress12_3(:,:,iblk), stress12_4(:,:,iblk), &
shear (:,:,iblk), divu (:,:,iblk), &
rdg_conv (:,:,iblk), rdg_shear (:,:,iblk), &
strtmp (:,:,:) )
! endif ! yield_curve

!-----------------------------------------------------------------
! 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), &
strintx (:,:,iblk), strinty (:,:,iblk), &
taubx (:,:,iblk), tauby (:,:,iblk), &
uvel_init(:,:,iblk), vvel_init(:,:,iblk),&
uvel (:,:,iblk), vvel (:,:,iblk), &
Tbu (:,:,iblk))

enddo
!$TCXOMP END PARALLEL DO

call stack_velocity_field(uvel, vvel, fld2)
call ice_timer_start(timer_bound)
if (maskhalo_dyn) then
call ice_HaloUpdate (fld2, halo_info_mask, &
field_loc_NEcorner, field_type_vector)
else
call ice_HaloUpdate (fld2, halo_info, &
field_loc_NEcorner, field_type_vector)
endif
call ice_timer_stop(timer_bound)
call unstack_velocity_field(fld2, uvel, vvel)

enddo ! subcycling
endif ! kevp_kernel
enddo ! subcycling
endif ! evp_algorithm

call ice_timer_stop(timer_evp_2d)

deallocate(fld2)
Expand Down
Loading