Skip to content

Commit

Permalink
mask restoring variables (CICE-Consortium#149)
Browse files Browse the repository at this point in the history
* mask restoring variables

* change tmask to hm
  • Loading branch information
eclare108213 authored and apcraig committed Jun 19, 2018
1 parent 837b3bf commit f309506
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
26 changes: 23 additions & 3 deletions cicecore/cicedynB/infrastructure/ice_restoring.F90
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ subroutine ice_HaloRestore_init
use ice_communicate, only: my_task, master_task
use ice_domain, only: ew_boundary_type, ns_boundary_type, &
nblocks, blocks_ice
use ice_grid, only: tmask
use ice_grid, only: tmask, hm
use ice_flux, only: sst, Tf, Tair, salinz, Tmltz
use ice_restart_shared, only: restart_ext

Expand Down Expand Up @@ -86,8 +86,8 @@ subroutine ice_HaloRestore_init
if (icepack_warnings_aborted()) call abort_ice(error_message="subname", &
file=__FILE__, line=__LINE__)

if (ew_boundary_type == 'open' .and. &
ns_boundary_type == 'open' .and. .not.(restart_ext)) then
if ((ew_boundary_type == 'open' .or. &
ns_boundary_type == 'open') .and. .not.(restart_ext)) then
if (my_task == master_task) write (nu_diag,*) 'ERROR: restart_ext=F and open boundaries'
call abort_ice(error_message="subname"//'open boundary and restart_ext=F', &
file=__FILE__, line=__LINE__)
Expand Down Expand Up @@ -254,6 +254,26 @@ subroutine ice_HaloRestore_init

endif ! restore_ic

!-----------------------------------------------------------------
! Impose land mask
!-----------------------------------------------------------------

do iblk = 1, nblocks
do n = 1, ncat
do j = 1, ny_block
do i = 1, nx_block
aicen_rest(i,j,n,iblk) = aicen_rest(i,j,n,iblk) * hm(i,j,iblk)
vicen_rest(i,j,n,iblk) = vicen_rest(i,j,n,iblk) * hm(i,j,iblk)
vsnon_rest(i,j,n,iblk) = vsnon_rest(i,j,n,iblk) * hm(i,j,iblk)
do nt = 1, ntrcr
trcrn_rest(i,j,nt,n,iblk) = trcrn_rest(i,j,nt,n,iblk) &
* hm(i,j,iblk)
enddo
enddo
enddo
enddo
enddo

if (my_task == master_task) &
write (nu_diag,*) 'ice restoring timescale = ',trestore,' days'

Expand Down
2 changes: 1 addition & 1 deletion configuration/scripts/options/set_nml.boxrestore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ice_ic = 'default'
restart = .false.
restart_ext = .false.
restart_ext = .true.
use_leap_years = .true.
ndtd = 2
kcatbound = 1
Expand Down

0 comments on commit f309506

Please sign in to comment.