Skip to content

Commit

Permalink
ice_dyn_evp: pass 'grid_location' for LKD seabed stress on C grid
Browse files Browse the repository at this point in the history
When the C grid support was added in 078aab4 (Merge cgridDEV branch
including C grid implementation and other fixes (#715), 2022-05-10),
subroutine ice_dyn_shared::seabed_stress_factor_LKD gained a
'grid_location' optional argument to indicate where to compute
intermediate quantities and the seabed stress itself (originally added
in 0f9f48b (ice_dyn_shared: add optional 'grid_location' argument to
seabed_stress_factor_LKD, 2021-11-17)). This argument was however
forgotten in ice_dyn_evp::evp when this subroutine was adapted for the C
grid in 48c07c6 (ice_dyn_evp: compute seabed stress factor at CD-grid
locations, 2021-11-17), such that currently the seabed stress is not
computed at the correct grid location for the C and CD grids.

Fix that by correctly passing the 'grid_location' argument. Note that
the dummy argument is incorrectly declared as 'intent(inout)' in the
subroutine, so change that to 'intent(in)' so we can pass in character
constants.

Closes: #891
  • Loading branch information
phil-blain committed Oct 23, 2023
1 parent a5bb4f9 commit 9290087
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions cicecore/cicedyn/dynamics/ice_dyn_evp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -763,12 +763,14 @@ subroutine evp (dt)
icellE (iblk), &
indxEi (:,iblk), indxEj(:,iblk), &
vice (:,:,iblk), aice(:,:,iblk), &
hwater(:,:,iblk), TbE (:,:,iblk))
hwater(:,:,iblk), TbE (:,:,iblk), &
grid_location='E')
call seabed_stress_factor_LKD (nx_block , ny_block, &
icellN (iblk), &
indxNi (:,iblk), indxNj(:,iblk), &
vice (:,:,iblk), aice(:,:,iblk), &
hwater(:,:,iblk), TbN (:,:,iblk))
hwater(:,:,iblk), TbN (:,:,iblk), &
grid_location='N')
enddo
!$OMP END PARALLEL DO

Expand Down
2 changes: 1 addition & 1 deletion cicecore/cicedyn/dynamics/ice_dyn_shared.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ subroutine seabed_stress_factor_LKD (nx_block, ny_block, &
real (kind=dbl_kind), dimension (nx_block,ny_block), intent(inout) :: &
TbU ! seabed stress factor at 'grid_location' (N/m^2)

character(len=*), optional, intent(inout) :: &
character(len=*), optional, intent(in) :: &
grid_location ! grid location (U, E, N), U assumed if not present

real (kind=dbl_kind) :: &
Expand Down

0 comments on commit 9290087

Please sign in to comment.