Skip to content

Commit 83686a3

Browse files
mattdturnerapcraig
authored andcommitted
Implement box model test from 2001 JCP paper (#151)
* Add gbox80 grid configuration * Add option files for the box2001 case (Hunke, E.C., 2001. Viscout-plastic sea ice dynamics with the EVP model: linearization issues. J. Comp. Phys. 170, 18-38.) * Modifications and additions to F90 files required for the box2001 case * Update box2001 namelist file to have both N/S and E/W boundary types set to 'open' * modifications to allow for constant coriolis * modifications for updates to namelist file * Update ice_in to include coriolis and x/y_spacing variables * replace x_spacing and y_spacing with dxrect and dyrect in the namelists * Add to the box2001 namelist file * Add new 'thermo' namelist variable to disable thermodynamics. Add code to set coriolis term to zero. Update box2001 namelist option file * Update rectgrid subroutine to set a land mask of 2 grid points around the 80x80 box. * Update user-guide case settings documentation to include the new namelist variables added for the box2001 test case * Fix bug in documentation added in previous commit for box2001 * More updates to user guide case settings for box2001 test case * Remove duplicate namelist definition in user guide testing * Add description of box2001 test to the testing documentation * Typo fix in documentation * Fix indentation * Updates to remove the thermo namelist variable, and instead turn off thermodynamics with kdyn=-1. * Modifications to not call init_flux_* in cice_run if the 2001 test case is run * Add new kridge and ktransport namelist options, as well as conditionals to turn off ridging and transport * Resolve namelist errors that were introduced during the merge conflict resolution * Fix a bug that caused binary data to be written to the log file * Remove unused variables from ice_step * Remove unused variables from ice_forcing file * initialize ice state * replace land_override with close_boundaries. * Replace 'default' with 'latitude' as the default coriolis value * Update documentation to include new namelist variables kridge and ktransport * Re-add dxrect and dyrect as variables in ice_init. This was a bug introduced during merge conflict resolution * correct configuration options * miscellaneous updates, increased run length * use strax,y (input directly) instead of strairx,yT (calculated) and set calc_strair=F
1 parent 4671a1c commit 83686a3

File tree

18 files changed

+406
-128
lines changed

18 files changed

+406
-128
lines changed

cicecore/cicedynB/dynamics/ice_dyn_eap.F90

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ module ice_dyn_eap
2828
use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted
2929
use icepack_intfc, only: icepack_query_parameters
3030
use icepack_intfc, only: icepack_ice_strength
31-
#ifdef CICE_IN_NEMO
32-
use icepack_intfc, only: calc_strair
33-
#endif
3431

3532
implicit none
3633
private
@@ -134,9 +131,6 @@ subroutine eap (dt)
134131
stressp_1, stressp_2, stressp_3, stressp_4, &
135132
stressm_1, stressm_2, stressm_3, stressm_4, &
136133
stress12_1, stress12_2, stress12_3, stress12_4
137-
#ifdef CICE_IN_NEMO
138-
use ice_flux, only: strax, stray
139-
#endif
140134
use ice_grid, only: tmask, umask, dxt, dyt, dxhy, dyhx, cxp, cyp, cxm, cym, &
141135
tarear, uarear, to_ugrid, t2ugrid_vector, u2tgrid_vector
142136
use ice_state, only: aice, vice, vsno, uvel, vvel, divu, shear, &
@@ -183,6 +177,8 @@ subroutine eap (dt)
183177
real (kind=dbl_kind), dimension(nx_block,ny_block,8):: &
184178
strtmp ! stress combinations for momentum equation
185179

180+
logical (kind=log_kind) :: calc_strair
181+
186182
integer (kind=int_kind), dimension (nx_block,ny_block,max_blocks) :: &
187183
icetmask, & ! ice extent mask (T-cell)
188184
halomask ! ice mask for halo update
@@ -259,21 +255,22 @@ subroutine eap (dt)
259255
call to_ugrid(tmass,umass)
260256
call to_ugrid(aice_init, aiu)
261257

262-
#ifdef CICE_IN_NEMO
263258
!----------------------------------------------------------------
264-
! Set wind stress to values supplied via NEMO
259+
! Set wind stress to values supplied via NEMO or other forcing
265260
! This wind stress is rotated on u grid and multiplied by aice
266261
!----------------------------------------------------------------
262+
call icepack_query_parameters(calc_strair_out=calc_strair)
263+
call icepack_warnings_flush(nu_diag)
264+
if (icepack_warnings_aborted()) call abort_ice(error_message=subname, &
265+
file=__FILE__, line=__LINE__)
266+
267267
if (.not. calc_strair) then
268268
strairx(:,:,:) = strax(:,:,:)
269269
strairy(:,:,:) = stray(:,:,:)
270270
else
271-
#endif
272271
call t2ugrid_vector(strairx)
273272
call t2ugrid_vector(strairy)
274-
#ifdef CICE_IN_NEMO
275273
endif
276-
#endif
277274

278275
! tcraig, tcx, turned off this threaded region, in evp, this block and
279276
! the icepack_ice_strength call seems to not be thread safe. more

cicecore/cicedynB/dynamics/ice_dyn_evp.F90

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ module ice_dyn_evp
4545
use ice_exit, only: abort_ice
4646
use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted
4747
use icepack_intfc, only: icepack_ice_strength, icepack_query_parameters
48-
#ifdef CICE_IN_NEMO
49-
use icepack_intfc, only: calc_strair
50-
#endif
5148

5249
implicit none
5350
private
@@ -87,9 +84,6 @@ subroutine evp (dt)
8784
stressp_1, stressp_2, stressp_3, stressp_4, &
8885
stressm_1, stressm_2, stressm_3, stressm_4, &
8986
stress12_1, stress12_2, stress12_3, stress12_4
90-
#ifdef CICE_IN_NEMO
91-
use ice_flux, only: strax, stray
92-
#endif
9387
use ice_grid, only: tmask, umask, dxt, dyt, dxhy, dyhx, cxp, cyp, cxm, cym, &
9488
tarear, uarear, tinyarea, to_ugrid, t2ugrid_vector, u2tgrid_vector, &
9589
grid_type
@@ -134,6 +128,8 @@ subroutine evp (dt)
134128
real (kind=dbl_kind), dimension(nx_block,ny_block,8):: &
135129
strtmp ! stress combinations for momentum equation
136130

131+
logical (kind=log_kind) :: calc_strair
132+
137133
integer (kind=int_kind), dimension (nx_block,ny_block,max_blocks) :: &
138134
icetmask, & ! ice extent mask (T-cell)
139135
halomask ! generic halo mask
@@ -217,21 +213,22 @@ subroutine evp (dt)
217213
call to_ugrid(tmass,umass)
218214
call to_ugrid(aice_init, aiu)
219215

220-
#ifdef CICE_IN_NEMO
221216
!----------------------------------------------------------------
222-
! Set wind stress to values supplied via NEMO
217+
! Set wind stress to values supplied via NEMO or other forcing
223218
! This wind stress is rotated on u grid and multiplied by aice
224219
!----------------------------------------------------------------
220+
call icepack_query_parameters(calc_strair_out=calc_strair)
221+
call icepack_warnings_flush(nu_diag)
222+
if (icepack_warnings_aborted()) call abort_ice(error_message=subname, &
223+
file=__FILE__, line=__LINE__)
224+
225225
if (.not. calc_strair) then
226226
strairx(:,:,:) = strax(:,:,:)
227227
strairy(:,:,:) = stray(:,:,:)
228228
else
229-
#endif
230-
call t2ugrid_vector(strairx)
231-
call t2ugrid_vector(strairy)
232-
#ifdef CICE_IN_NEMO
229+
call t2ugrid_vector(strairx)
230+
call t2ugrid_vector(strairy)
233231
endif
234-
#endif
235232

236233
! tcraig, tcx, threading here leads to some non-reproducbile results and failures in icepack_ice_strength
237234
! need to do more debugging

cicecore/cicedynB/dynamics/ice_dyn_shared.F90

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,14 @@ module ice_dyn_shared
2828
! namelist parameters
2929

3030
integer (kind=int_kind), public :: &
31-
kdyn , & ! type of dynamics ( 1 = evp, 2 = eap )
31+
kdyn , & ! type of dynamics ( -1, 0 = off, 1 = evp, 2 = eap )
32+
kridge , & ! set to "-1" to turn off ridging
33+
ktransport , & ! set to "-1" to turn off transport
3234
ndte ! number of subcycles: ndte=dt/dte
3335

36+
character (len=char_len), public :: &
37+
coriolis ! 'constant', 'zero', or 'latitude'
38+
3439
logical (kind=log_kind), public :: &
3540
revised_evp ! if true, use revised evp procedure
3641

@@ -148,8 +153,13 @@ subroutine init_evp (dt)
148153
rdg_shear(i,j,iblk) = c0
149154

150155
! Coriolis parameter
151-
!! fcor_blk(i,j,iblk) = 1.46e-4_dbl_kind ! Hibler 1979, N. Hem; 1/s
152-
fcor_blk(i,j,iblk) = c2*omega*sin(ULAT(i,j,iblk)) ! 1/s
156+
if (trim(coriolis) == 'constant') then
157+
fcor_blk(i,j,iblk) = 1.46e-4_dbl_kind ! Hibler 1979, N. Hem; 1/s
158+
else if (trim(coriolis) == 'zero') then
159+
fcor_blk(i,j,iblk) = 0.0
160+
else
161+
fcor_blk(i,j,iblk) = c2*omega*sin(ULAT(i,j,iblk)) ! 1/s
162+
endif
153163

154164
! stress tensor, kg/s^2
155165
stressp_1 (i,j,iblk) = c0

cicecore/cicedynB/general/ice_forcing.F90

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module ice_forcing
2929
use ice_timers, only: ice_timer_start, ice_timer_stop, timer_readwrite, &
3030
timer_bound
3131
use ice_arrays_column, only: oceanmixed_ice, restore_bgc
32-
use ice_constants, only: c0, c1, c2, c4, c10, c12, c20, &
32+
use ice_constants, only: c0, c1, c2, c3, c4, c5, c10, c12, c20, &
3333
c180, c365, c1000, c3600
3434
use ice_constants, only: p001, p01, p1, p25, p5, p6
3535
use ice_constants, only: cm_to_m
@@ -240,6 +240,8 @@ subroutine init_forcing_atmo
240240
call oned_files
241241
elseif (trim(atm_data_type) == 'ISPOL') then
242242
call ISPOL_files
243+
elseif (trim(atm_data_type) == 'box') then
244+
call box_data
243245
endif
244246

245247
end subroutine init_forcing_atmo
@@ -530,6 +532,8 @@ subroutine get_forcing_atmo
530532
call monthly_data
531533
elseif (trim(atm_data_type) == 'oned') then
532534
call oned_data
535+
elseif (trim(atm_data_type) == 'box') then
536+
call box_data
533537
else ! default values set in init_flux
534538
return
535539
endif
@@ -4405,8 +4409,96 @@ subroutine ocn_data_ispol_init
44054409

44064410
end subroutine ocn_data_ispol_init
44074411

4412+
!=======================================================================
4413+
!
4414+
subroutine box_data
4415+
4416+
! wind and current fields as in Hunke, JCP 2001
4417+
! authors: Elizabeth Hunke, LANL
4418+
4419+
use ice_domain, only: nblocks
4420+
use ice_constants, only: c0, c1, c2, c3, c4, c5, p2
4421+
use ice_blocks, only: nx_block, ny_block, nghost
4422+
use ice_flux, only: uocn, vocn, uatm, vatm, wind, rhoa, strax, stray
4423+
use ice_fileunits, only: nu_diag, nu_forcing
4424+
use ice_grid, only: uvm
4425+
4426+
! local parameters
4427+
4428+
integer (kind=int_kind) :: &
4429+
iblk, i,j ! loop indices
4430+
4431+
real (kind=dbl_kind) :: &
4432+
secday, pi , c10, c12, c20, puny, period, pi2, tau
4433+
call icepack_query_parameters(pi_out=pi, pi2_out=pi2, puny_out=puny)
4434+
call icepack_query_parameters(secday_out=secday)
4435+
4436+
period = c4*secday
4437+
4438+
do iblk = 1, nblocks
4439+
do j = 1, ny_block
4440+
do i = 1, nx_block
4441+
4442+
! ocean current
4443+
! constant in time, could be initialized in ice_flux.F90
4444+
uocn(i,j,iblk) = p2*real(j-nghost, kind=dbl_kind) &
4445+
/ real(nx_global,kind=dbl_kind) - p1
4446+
vocn(i,j,iblk) = -p2*real(i-nghost, kind=dbl_kind) &
4447+
/ real(ny_global,kind=dbl_kind) + p1
4448+
4449+
uocn(i,j,iblk) = uocn(i,j,iblk) * uvm(i,j,iblk)
4450+
vocn(i,j,iblk) = vocn(i,j,iblk) * uvm(i,j,iblk)
4451+
4452+
! wind components
4453+
uatm(i,j,iblk) = c5 + (sin(pi2*time/period)-c3) &
4454+
* sin(pi2*real(i-nghost, kind=dbl_kind) &
4455+
/real(nx_global,kind=dbl_kind)) &
4456+
* sin(pi *real(j-nghost, kind=dbl_kind) &
4457+
/real(ny_global,kind=dbl_kind))
4458+
vatm(i,j,iblk) = c5 + (sin(pi2*time/period)-c3) &
4459+
* sin(pi *real(i-nghost, kind=dbl_kind) &
4460+
/real(nx_global,kind=dbl_kind)) &
4461+
* sin(pi2*real(j-nghost, kind=dbl_kind) &
4462+
/real(ny_global,kind=dbl_kind))
4463+
! wind stress
4464+
wind(i,j,iblk) = sqrt(uatm(i,j,iblk)**2 + vatm(i,j,iblk)**2)
4465+
tau = rhoa(i,j,iblk) * 0.0012_dbl_kind * wind(i,j,iblk)
4466+
strax(i,j,iblk) = tau * uatm(i,j,iblk)
4467+
stray(i,j,iblk) = tau * vatm(i,j,iblk)
4468+
4469+
! initialization test
4470+
! Diagonal wind vectors 1
4471+
!uatm(i,j,iblk) = c1 *real(j-nghost, kind=dbl_kind) &
4472+
! / real(ny_global,kind=dbl_kind)
4473+
!vatm(i,j,iblk) = c1 *real(j-nghost, kind=dbl_kind) &
4474+
! / real(ny_global,kind=dbl_kind)
4475+
4476+
! Diagonal wind vectors 2
4477+
!uatm(i,j,iblk) = c1 *real(i-nghost, kind=dbl_kind) &
4478+
! / real(nx_global,kind=dbl_kind)
4479+
!vatm(i,j,iblk) = -c1 *real(i-nghost, kind=dbl_kind) &
4480+
! / real(nx_global,kind=dbl_kind)
4481+
4482+
! Wind in x direction
4483+
! uatm(i,j,iblk) = c1 *real(i-nghost, kind=dbl_kind) &
4484+
! / real(nx_global,kind=dbl_kind)
4485+
! vatm(i,j,iblk) = c0
4486+
4487+
! Wind in y direction
4488+
! uatm(i,j,iblk) = c0
4489+
! vatm(i,j,iblk) = c1 *real(j-nghost, kind=dbl_kind) &
4490+
! / real(ny_global,kind=dbl_kind)
4491+
! initialization test
4492+
4493+
enddo
4494+
enddo
4495+
enddo ! nblocks
4496+
4497+
end subroutine box_data
4498+
44084499
!=======================================================================
44094500

44104501
end module ice_forcing
44114502

44124503
!=======================================================================
4504+

0 commit comments

Comments
 (0)