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

Add single grid channel capability and test for C-grid #875

Merged
merged 4 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
17 changes: 16 additions & 1 deletion cicecore/cicedyn/dynamics/ice_transport_remap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,8 @@ subroutine locate_triangles (nx_block, ny_block, &
endif

!-------------------------------------------------------------------
! Compute mask for edges with nonzero departure areas
! Compute mask for edges with nonzero departure areas and for
! one grid-cell wide channels
!-------------------------------------------------------------------

icellsd = 0
Expand All @@ -2011,6 +2012,13 @@ subroutine locate_triangles (nx_block, ny_block, &
icellsd = icellsd + 1
indxid(icellsd) = i
indxjd(icellsd) = j
else ! temp comment: dont need if (l_fixed_area) because edgearea=0 when F
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean here and the other places with temp comment.

We should keep the comment:
! 1 grid-cell wide channel: dpx,y = 0, edgearea /= 0

! temp comment: do we need cond if ( umask(i-1,j) = F and umask(i,j) =F and abs(edgearea(i,j)) > c0 )
if ( abs(edgearea(i,j)) > c0 ) then ! 1 grid-cell wide channel: dpx,y = 0, edgearea /= 0
icellsd = icellsd + 1
indxid(icellsd) = i
indxjd(icellsd) = j
endif
endif
enddo
enddo
Expand All @@ -2023,6 +2031,13 @@ subroutine locate_triangles (nx_block, ny_block, &
icellsd = icellsd + 1
indxid(icellsd) = i
indxjd(icellsd) = j
else ! temp comment: dont need if (l_fixed_area) because edgearea=0 when F
! temp comment: do we need cond if ( umask(i-1,j) = F and umask(i,j) =F and abs(edgearea(i,j)) > c0 )
if ( abs(edgearea(i,j)) > c0 ) then ! 1 grid-cell wide channel: dpx,y = 0, edgearea /= 0
icellsd = icellsd + 1
indxid(icellsd) = i
indxjd(icellsd) = j
endif
endif
enddo
enddo
Expand Down
4 changes: 3 additions & 1 deletion cicecore/cicedyn/general/ice_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2446,6 +2446,8 @@ subroutine input_data

if (kmt_type /= 'file' .and. &
kmt_type /= 'channel' .and. &
kmt_type /= 'channel_oneeast' .and. &
kmt_type /= 'channel_onenorth' .and. &
kmt_type /= 'wall' .and. &
kmt_type /= 'default' .and. &
kmt_type /= 'boxislands') then
Expand Down Expand Up @@ -3135,7 +3137,7 @@ subroutine set_state_var (nx_block, ny_block, &
enddo
enddo

elseif (trim(ice_data_type) == 'channel') then
elseif (ice_data_type(1:7) == 'channel') then
! channel ice in center of domain in i direction
icells = 0
do j = jlo, jhi
Expand Down
16 changes: 16 additions & 0 deletions cicecore/cicedyn/infrastructure/ice_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1489,6 +1489,22 @@ subroutine rectgrid
enddo
enddo

elseif (trim(kmt_type) == 'channel_oneeast') then

do j = ny_global/2,ny_global/2 ! one channel wide
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if ny_global is odd?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't matter, it'll just round down. ny_global/2 is always a well defined integer value. The channel will be created at j=ny_global/2, whether ny_global is odd or even. We could have chosen j=2 or j=ny_global/4 or anything really would work. ny_global/2 is probably safest. If ny_global is a relatively small integer, it'll create the channel away from the edge as much as possible. I guess we run into a problem if ny_global is less than 4, but that's not a particularly useful grid, and I don't think we need to worry about that.

do i = 1,nx_global ! open sides
work_g1(i,j) = c1 ! NOTE nx_global > 5
enddo
enddo

elseif (trim(kmt_type) == 'channel_onenorth') then

do j = 1,ny_global ! open sides
do i = nx_global/2,nx_global/2 ! one channel wide
work_g1(i,j) = c1 ! NOTE nx_global > 5
enddo
enddo

elseif (trim(kmt_type) == 'wall') then

do j = 1,ny_global ! open except
Expand Down
55 changes: 55 additions & 0 deletions configuration/scripts/options/set_nml.boxchan1e
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
days_per_year = 360
use_leap_years = .false.
npt_unit = 'd'
npt = 5
ice_ic = 'internal'
restart_ext = .true.
histfreq = 'd','1','x','x','x'
grid_type = 'rectangular'
kmt_type = 'channel_oneeast'
dxrect = 16.e5
dyrect = 16.e5
close_boundaries = .false.
ew_boundary_type = 'cyclic'
ns_boundary_type = 'open'
tr_iage = .false.
tr_FY = .false.
tr_lvl = .false.
tr_pond_lvl = .false.
ktherm = -1
atmbndy = 'constant'
atm_data_type = 'uniform_east'
ocn_data_type = 'calm'
ice_data_type = 'block'
ice_data_conc = 'p5'
ice_data_dist = 'uniform'
calc_strair = .false.
rotate_wind = .false.
restore_ice = .false.
f_aice = 'd1'
f_hi = 'd1'
f_hs = 'd'
f_Tsfc = 'd'
f_uvel = 'd1'
f_vvel = 'd1'
f_uatm = 'd'
f_vatm = 'd'
f_uocn = 'd'
f_vocn = 'd'
f_strairx = 'd1'
f_strairy = 'd1'
f_strtltx = 'd1'
f_strtlty = 'd1'
f_strcorx = 'd1'
f_strcory = 'd1'
f_strocnx = 'd1'
f_strocny = 'd1'
f_strintx = 'd1'
f_strinty = 'd1'
f_taubx = 'd1'
f_tauby = 'd1'
f_divu = 'd1'
f_sig1 = 'd1'
f_sig2 = 'd1'
f_sigP = 'd1'
f_dvidtd = 'd1'
55 changes: 55 additions & 0 deletions configuration/scripts/options/set_nml.boxchan1n
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
days_per_year = 360
use_leap_years = .false.
npt_unit = 'd'
npt = 5
ice_ic = 'internal'
restart_ext = .true.
histfreq = 'd','1','x','x','x'
grid_type = 'rectangular'
kmt_type = 'channel_onenorth'
dxrect = 16.e5
dyrect = 16.e5
close_boundaries = .false.
ew_boundary_type = 'open'
ns_boundary_type = 'cyclic'
tr_iage = .false.
tr_FY = .false.
tr_lvl = .false.
tr_pond_lvl = .false.
ktherm = -1
atmbndy = 'constant'
atm_data_type = 'uniform_north'
ocn_data_type = 'calm'
ice_data_type = 'block'
ice_data_conc = 'p5'
ice_data_dist = 'uniform'
calc_strair = .false.
rotate_wind = .false.
restore_ice = .false.
f_aice = 'd1'
f_hi = 'd1'
f_hs = 'd'
f_Tsfc = 'd'
f_uvel = 'd1'
f_vvel = 'd1'
f_uatm = 'd'
f_vatm = 'd'
f_uocn = 'd'
f_vocn = 'd'
f_strairx = 'd1'
f_strairy = 'd1'
f_strtltx = 'd1'
f_strtlty = 'd1'
f_strcorx = 'd1'
f_strcory = 'd1'
f_strocnx = 'd1'
f_strocny = 'd1'
f_strintx = 'd1'
f_strinty = 'd1'
f_taubx = 'd1'
f_tauby = 'd1'
f_divu = 'd1'
f_sig1 = 'd1'
f_sig2 = 'd1'
f_sigP = 'd1'
f_dvidtd = 'd1'
27 changes: 18 additions & 9 deletions configuration/scripts/tests/gridsys_suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ smoke gx3 8x2 diag1,run5day
smoke gx3 8x4 diag1,run5day,debug
restart gx3 4x2 debug,diag1
restart2 gx1 16x2 debug,diag1
restart tx1 40x2 diag1
smoke gbox12 1x1x12x12x1 boxchan
smoke gbox80 4x2 boxchan1e
smoke gbox80 8x1 boxchan1n
smoke gbox80 1x1 box2001
smoke gbox80 2x2 boxwallblock
smoke gbox80 1x1 boxslotcyl
smoke gbox80 2x4 boxnodyn
smoke gbox80 4x2 boxclosed,boxforcee,run1day
smoke gbox80 4x1 boxclosed,boxforcene,run1day,kmtislands
smoke gbox80 4x2 boxopen,kmtislands,boxforcee,run1day
smoke gbox80 4x2 boxclosed,boxforcee,run1day
smoke gbox80 4x1 boxclosed,boxforcene,run1day,kmtislands
smoke gbox80 4x2 boxopen,kmtislands,boxforcee,run1day
smoke gbox80 2x2 boxclosed,boxforcen,run1day,vargrid
smoke gx3 1x1x25x29x16 reprosum,run10day,dwblockall smoke_gx3_1x1x100x116x1_reprosum_run10day
smoke gx3 1x1x5x4x580 reprosum,run10day,dwblockall smoke_gx3_1x1x100x116x1_reprosum_run10day
Expand All @@ -30,14 +33,17 @@ smoke gx3 8x2 diag1,run5day,gridcd
smoke gx3 8x4 diag1,run5day,debug,gridcd
restart gx3 4x2 debug,diag1,gridcd
restart2 gx1 16x2 debug,diag1,gridcd
restart tx1 40x2 diag1,gridcd
smoke gbox12 1x1x12x12x1 boxchan,gridcd
smoke gbox80 4x2 boxchan1e,gridcd
smoke gbox80 8x1 boxchan1n,gridcd
smoke gbox80 1x1 box2001,gridcd
smoke gbox80 2x2 boxwallblock,gridcd
smoke gbox80 1x1 boxslotcyl,gridcd
smoke gbox80 2x4 boxnodyn,gridcd
smoke gbox80 4x2 boxclosed,boxforcee,run1day,gridcd
smoke gbox80 4x1 boxclosed,boxforcene,run1day,kmtislands,gridcd
smoke gbox80 4x2 boxopen,kmtislands,boxforcee,run1day,gridcd
smoke gbox80 4x2 boxclosed,boxforcee,run1day,gridcd
smoke gbox80 4x1 boxclosed,boxforcene,run1day,kmtislands,gridcd
smoke gbox80 4x2 boxopen,kmtislands,boxforcee,run1day,gridcd
smoke gbox80 2x2 boxclosed,boxforcen,run1day,vargrid,gridcd
smoke gx3 1x1x25x29x16 reprosum,run10day,dwblockall,gridcd smoke_gx3_1x1x100x116x1_gridcd_reprosum_run10day
smoke gx3 1x1x5x4x580 reprosum,run10day,dwblockall,gridcd smoke_gx3_1x1x100x116x1_gridcd_reprosum_run10day
Expand All @@ -50,14 +56,17 @@ smoke gx3 8x2 diag1,run5day,gridc
smoke gx3 8x4 diag1,run5day,debug,gridc
restart gx3 4x2 debug,diag1,gridc
restart2 gx1 16x2 debug,diag1,gridc
restart tx1 40x2 diag1,gridc
smoke gbox12 1x1x12x12x1 boxchan,gridc
smoke gbox80 4x2 boxchan1e,gridc
smoke gbox80 8x1 boxchan1n,gridc
smoke gbox80 1x1 box2001,gridc
smoke gbox80 2x2 boxwallblock,gridc
smoke gbox80 1x1 boxslotcyl,gridc
smoke gbox80 2x4 boxnodyn,gridc
smoke gbox80 4x2 boxclosed,boxforcee,run1day,gridc
smoke gbox80 4x1 boxclosed,boxforcene,run1day,kmtislands,gridc
smoke gbox80 4x2 boxopen,kmtislands,boxforcee,run1day,gridc
smoke gbox80 4x2 boxclosed,boxforcee,run1day,gridc
smoke gbox80 4x1 boxclosed,boxforcene,run1day,kmtislands,gridc
smoke gbox80 4x2 boxopen,kmtislands,boxforcee,run1day,gridc
smoke gbox80 2x2 boxclosed,boxforcen,run1day,vargrid,gridc
smoke gx3 1x1x25x29x16 reprosum,run10day,dwblockall,gridc smoke_gx3_1x1x100x116x1_gridc_reprosum_run10day
smoke gx3 1x1x5x4x580 reprosum,run10day,dwblockall,gridc smoke_gx3_1x1x100x116x1_gridc_reprosum_run10day
Expand Down