Skip to content

Commit

Permalink
Use umask for uvel,vvel initialization for boxslotcyl and change grid…
Browse files Browse the repository at this point in the history
… avg type from S to A in init_state
  • Loading branch information
JFLemieux73 committed Jun 19, 2023
1 parent 3d26d4c commit f93d322
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 25 deletions.
12 changes: 0 additions & 12 deletions cicecore/cicedyn/dynamics/ice_transport_remap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -384,18 +384,6 @@ subroutine horizontal_remap (dt, ntrace, &
character (len=char_len_long), intent(in) :: &
grid_ice ! ice grid, B, C, etc

!-------------------------------------------------------------------
! If l_fixed_area is true, the area of each departure region is
! computed in advance (e.g., by taking the divergence of the
! velocity field and passed to locate_triangles. The departure
! regions are adjusted to obtain the desired area.
! If false, edgearea is computed in locate_triangles and passed out.
!-------------------------------------------------------------------

! logical, intent(in) :: &
! l_fixed_area ! if true, edgearea_e and edgearea_n are prescribed
! if false, edgearea is computed here and passed out

integer (kind=int_kind), dimension (ntrace), intent(in) :: &
tracer_type , & ! = 1, 2, or 3 (see comments above)
depend ! tracer dependencies (see above)
Expand Down
34 changes: 21 additions & 13 deletions cicecore/cicedyn/general/ice_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2532,7 +2532,7 @@ subroutine init_state
use ice_domain, only: nblocks, blocks_ice, halo_info
use ice_domain_size, only: ncat, nilyr, nslyr, n_iso, n_aero, nfsd
use ice_flux, only: sst, Tf, Tair, salinz, Tmltz
use ice_grid, only: tmask, ULON, TLAT, grid_ice, grid_average_X2Y
use ice_grid, only: tmask, umask, ULON, TLAT, grid_ice, grid_average_X2Y
use ice_boundary, only: ice_HaloUpdate
use ice_constants, only: field_loc_Nface, field_loc_Eface, field_type_scalar
use ice_state, only: trcr_depend, aicen, trcrn, vicen, vsnon, &
Expand Down Expand Up @@ -2720,6 +2720,7 @@ subroutine init_state
ilo, ihi, jlo, jhi, &
iglob, jglob, &
ice_ic, tmask(:,:, iblk), &
umask(:,:, iblk), &
ULON (:,:, iblk), &
TLAT (:,:, iblk), &
Tair (:,:, iblk), sst (:,:, iblk), &
Expand All @@ -2742,10 +2743,10 @@ subroutine init_state

if (grid_ice == 'CD' .or. grid_ice == 'C') then

call grid_average_X2Y('S',uvel,'U',uvelN,'N')
call grid_average_X2Y('S',vvel,'U',vvelN,'N')
call grid_average_X2Y('S',uvel,'U',uvelE,'E')
call grid_average_X2Y('S',vvel,'U',vvelE,'E')
call grid_average_X2Y('A',uvel,'U',uvelN,'N')
call grid_average_X2Y('A',vvel,'U',vvelN,'N')
call grid_average_X2Y('A',uvel,'U',uvelE,'E')
call grid_average_X2Y('A',vvel,'U',vvelE,'E')

! Halo update on North, East faces
call ice_HaloUpdate(uvelN, halo_info, &
Expand All @@ -2760,7 +2761,6 @@ subroutine init_state

endif


!-----------------------------------------------------------------
! compute aggregate ice state and open water area
!-----------------------------------------------------------------
Expand Down Expand Up @@ -2819,8 +2819,9 @@ subroutine set_state_var (nx_block, ny_block, &
ilo, ihi, jlo, jhi, &
iglob, jglob, &
ice_ic, tmask, &
ULON, &
TLAT, &
umask, &
ULON, &
TLAT, &
Tair, sst, &
Tf, &
salinz, Tmltz, &
Expand All @@ -2845,7 +2846,8 @@ subroutine set_state_var (nx_block, ny_block, &
ice_ic ! method of ice cover initialization

logical (kind=log_kind), dimension (nx_block,ny_block), intent(in) :: &
tmask ! true for ice/ocean cells
tmask , & ! true for ice/ocean cells
umask ! for U points

real (kind=dbl_kind), dimension (nx_block,ny_block), intent(in) :: &
ULON , & ! longitude of velocity pts (radians)
Expand Down Expand Up @@ -3293,13 +3295,19 @@ subroutine set_state_var (nx_block, ny_block, &
domain_length = dxrect*cm_to_m*nx_global
period = c12*secday ! 12 days rotational period
max_vel = pi*domain_length/period

do j = 1, ny_block
do i = 1, nx_block

uvel(i,j) = c2*max_vel*(real(jglob(j), kind=dbl_kind) - p5) &
/ real(ny_global - 1, kind=dbl_kind) - max_vel
vvel(i,j) = -c2*max_vel*(real(iglob(i), kind=dbl_kind) - p5) &
/ real(nx_global - 1, kind=dbl_kind) + max_vel
if (umask(i,j)) then
uvel(i,j) = c2*max_vel*(real(jglob(j), kind=dbl_kind) - p5) &
/ real(ny_global - 1, kind=dbl_kind) - max_vel
vvel(i,j) = -c2*max_vel*(real(iglob(i), kind=dbl_kind) - p5) &
/ real(nx_global - 1, kind=dbl_kind) + max_vel
else
uvel(i,j) = c0
vvel(i,j) = c0
endif
enddo ! j
enddo ! i
else
Expand Down

0 comments on commit f93d322

Please sign in to comment.