Skip to content

Commit

Permalink
Update the rectangular (box) grid configurations. (#1006)
Browse files Browse the repository at this point in the history
- Fix bug where left hand side of rectangular grids had incorrect longitudes
  and latitudes computed.  This changes answers in some box configurations.
- Update the box resolutions.  dxrect and dyrect were hardwired to 30km for
  all box resolutions.  Now adjust dxrect and dyrect depending on the number
  of gridcells so it always covers an area of about 3 degrees by 3 degrees.
  This means gbox12 is 30km resolution, gbox80 is 5km, gbox128 is 3 km, and
  gbox180 is 2 km.  Reduce the gbox180 timestep to 1800s for stability.
  This changes answers for some box configurations.
- Remove u masking from box2001 ocean forcing, bit-for-bit.
- Remove 50W check associated with box2001 initial conditions, bit-for-bit.
- Add rectangular grid diagnostics
- Minor update to the box2001 documentation

Explicitly set npt_unit in all set_nml files that have npt set.  Improves robustness
where one option sets npt and another sets npt_unit.
  • Loading branch information
apcraig authored Feb 12, 2025
1 parent a19e5ca commit 51a438c
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 28 deletions.
4 changes: 0 additions & 4 deletions cicecore/cicedyn/general/ice_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5202,7 +5202,6 @@ subroutine box2001_data_ocn
use ice_domain, only: nblocks, blocks_ice
use ice_blocks, only: block, get_block, nx_block, ny_block, nghost
use ice_flux, only: uocn, vocn
use ice_grid, only: uvm

! local parameters

Expand Down Expand Up @@ -5235,9 +5234,6 @@ subroutine box2001_data_ocn
vocn(i,j,iblk) = -p2*real(iglob(i), kind=dbl_kind) &
/ real(nx_global,kind=dbl_kind) + p1

uocn(i,j,iblk) = uocn(i,j,iblk) * uvm(i,j,iblk)
vocn(i,j,iblk) = vocn(i,j,iblk) * uvm(i,j,iblk)

enddo
enddo
enddo ! nblocks
Expand Down
32 changes: 13 additions & 19 deletions cicecore/cicedyn/general/ice_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1967,7 +1967,12 @@ subroutine input_data
write(nu_diag,1030) ' grid_ocn_dynu = ',trim(grid_ocn_dynu)
write(nu_diag,1030) ' grid_ocn_dynv = ',trim(grid_ocn_dynv)
write(nu_diag,1030) ' kmt_type = ',trim(kmt_type)
if (trim(grid_type) /= 'rectangular') then
if (trim(grid_type) == 'rectangular') then
write(nu_diag,1004) 'lon/lat refrect = ',lonrefrect,latrefrect
write(nu_diag,1004) 'dx/dy rect (cm) = ',dxrect,dyrect
write(nu_diag,1010) 'scale_dxdy = ',scale_dxdy
write(nu_diag,1004) 'dx/dy scale = ',dxscale,dyscale
else
if (use_bathymetry) then
tmpstr2 = ' : bathymetric input data is used'
else
Expand Down Expand Up @@ -2759,7 +2764,8 @@ subroutine input_data

1000 format (a20,1x,f13.6,1x,a) ! float
1002 format (a20,5x,f9.2,1x,a)
1003 format (a20,1x,G13.4,1x,a)
1003 format (a20,1x,g13.4,1x,a)
1004 format (a20,1x,2g13.4,1x,a)
1009 format (a20,1x,d13.6,1x,a)
1010 format (a20,8x,l6,1x,a) ! logical
1011 format (a20,1x,l6)
Expand Down Expand Up @@ -3318,23 +3324,9 @@ subroutine set_state_var (nx_block, ny_block, &
! location of ice
!---------------------------------------------------------

if (trim(ice_data_type) == 'box2001') then
icells = 0

! place ice on left side of domain
icells = 0
do j = jlo, jhi
do i = ilo, ihi
if (tmask(i,j)) then
if (ULON(i,j) < -50./rad_to_deg) then
icells = icells + 1
indxi(icells) = i
indxj(icells) = j
endif ! ULON
endif ! tmask
enddo ! i
enddo ! j

elseif (trim(ice_data_type) == 'boxslotcyl') then
if (trim(ice_data_type) == 'boxslotcyl') then

! Geometric configuration of the slotted cylinder
diam = p3 *dxrect*(nx_global-1)
Expand Down Expand Up @@ -3366,8 +3358,10 @@ subroutine set_state_var (nx_block, ny_block, &
enddo
enddo

elseif (trim(ice_data_type) == 'uniform') then
elseif (trim(ice_data_type) == 'uniform' .or. trim(ice_data_type) == 'box2001') then
! all cells not land mask are ice
! box2001 used to have a check for west of 50W, this was changed, so now box2001 is
! the same as uniform. keep box2001 option for backwards compatibility.
icells = 0
do j = jlo, jhi
do i = ilo, ihi
Expand Down
9 changes: 6 additions & 3 deletions cicecore/cicedyn/infrastructure/ice_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,8 @@ subroutine init_grid2
!$OMP END PARALLEL DO
endif

if (trim(grid_type) == 'regional' .and. &
if ((trim(grid_type) == 'regional' .or. &
trim(grid_type) == 'rectangular') .and. &
(.not. (l_readCenter))) then
! for W boundary extrapolate from interior
!$OMP PARALLEL DO PRIVATE(iblk,i,j,ilo,ihi,jlo,jhi,this_block)
Expand Down Expand Up @@ -2329,7 +2330,8 @@ subroutine Tlatlon
enddo ! iblk
!$OMP END PARALLEL DO

if (trim(grid_type) == 'regional') then
if (trim(grid_type) == 'regional' .or. &
trim(grid_type) == 'rectangular') then
! for W boundary extrapolate from interior
!$OMP PARALLEL DO PRIVATE(iblk,i,j,ilo,ihi,jlo,jhi,this_block)
do iblk = 1, nblocks
Expand Down Expand Up @@ -2479,7 +2481,8 @@ subroutine NElatlon
enddo ! iblk
!$OMP END PARALLEL DO

if (trim(grid_type) == 'regional') then
if (trim(grid_type) == 'regional' .or. &
trim(grid_type) == 'rectangular') then
! for W boundary extrapolate from interior
!$OMP PARALLEL DO PRIVATE(iblk,i,j,ilo,ihi,jlo,jhi,this_block)
do iblk = 1, nblocks
Expand Down
1 change: 1 addition & 0 deletions configuration/scripts/options/set_nml.bgcsklclim
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ n_fed = 1
n_fep = 1
year_init = 2005
istep0 = 0
npt_unit = '1'
npt = 168
ice_ic = 'none'
tr_brine = .true.
Expand Down
1 change: 1 addition & 0 deletions configuration/scripts/options/set_nml.box2001
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ grid_atm = 'B'
grid_ocn = 'B'
days_per_year = 360
use_leap_years = .false.
npt_unit = '1'
npt = 240
ice_ic = 'internal'
restart_ext = .true.
Expand Down
1 change: 1 addition & 0 deletions configuration/scripts/options/set_nml.boxnodyn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ nilyr = 1
ice_ic = 'internal'
days_per_year = 360
use_leap_years = .false.
npt_unit = '1'
npt = 72
dumpfreq = 'd'
dumpfreq_n = 2
Expand Down
1 change: 1 addition & 0 deletions configuration/scripts/options/set_nml.boxopen
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
npt_unit = '1'
npt = 48
ice_ic = 'internal'
use_leap_years = .false.
Expand Down
1 change: 1 addition & 0 deletions configuration/scripts/options/set_nml.boxslotcyl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ nilyr = 1
ice_ic = 'internal'
restart_ext = .false.
dt = 3600.0
npt_unit = '1'
npt = 288
grid_type = 'rectangular'
kmt_type = 'default'
Expand Down
1 change: 1 addition & 0 deletions configuration/scripts/options/set_nml.boxwallblock
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
days_per_year = 360
use_leap_years = .false.
npt_unit = '1'
npt = 240
ice_ic = 'internal'
restart_ext = .true.
Expand Down
2 changes: 2 additions & 0 deletions configuration/scripts/options/set_nml.gbox12
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dxrect = 30.e5
dyrect = 30.e5
ice_ic = 'internal'
grid_type = 'rectangular'
kmt_type = 'default'
Expand Down
2 changes: 2 additions & 0 deletions configuration/scripts/options/set_nml.gbox128
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dxrect = 3.e5
dyrect = 3.e5
grid_ocn = 'B'
ice_ic = 'internal'
grid_type = 'rectangular'
Expand Down
3 changes: 3 additions & 0 deletions configuration/scripts/options/set_nml.gbox180
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
dxrect = 2.e5
dyrect = 2.e5
dt = 1800.0
ice_ic = 'internal'
grid_type = 'rectangular'
kmt_type = 'default'
Expand Down
2 changes: 2 additions & 0 deletions configuration/scripts/options/set_nml.gbox80
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dxrect = 5.e5
dyrect = 5.e5
ice_ic = 'internal'
grid_type = 'rectangular'
kmt_type = 'default'
Expand Down
4 changes: 2 additions & 2 deletions doc/source/user_guide/ug_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,11 @@ Ocean stresses are computed as in :cite:`Hunke01` where they are circular and ce
in the square domain. The ice distribution is fixed, with a constant 2 meter ice
thickness and a concentration field that varies linearly in the x-direction from ``0``
to ``1`` and is constant in the y-direction. No islands are included in this
configuration. The test is configured to run on a single processor.
configuration.

To run the test::

./cice.setup -m <machine> --test smoke -s box2001 --testid <test_id> --grid gbox80 --acct <queue manager account> -p 1x1
./cice.setup -m <machine> --test smoke -s box2001 --testid <test_id> --grid gbox80 --acct <queue manager account>

.. _boxslotcyl:

Expand Down

0 comments on commit 51a438c

Please sign in to comment.