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 new unit tests sumchk and bcstchk and update tests #606

Merged
merged 6 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
45 changes: 32 additions & 13 deletions cicecore/cicedynB/analysis/ice_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module ice_diagnostics
print_global ! if true, print global data

integer (kind=int_kind), public :: &
debug_model_step = 999999999 ! begin printing at istep1=debug_model_step
debug_model_step = 0 ! begin printing at istep1=debug_model_step

integer (kind=int_kind), parameter, public :: &
npnt = 2 ! total number of points to be printed
Expand Down Expand Up @@ -73,6 +73,12 @@ module ice_diagnostics
integer (kind=int_kind), dimension(npnt), public :: &
piloc, pjloc, pbloc, pmloc ! location of diagnostic points

integer (kind=int_kind), public :: &
debug_model_i = -1, & ! location of debug_model point, local i index
debug_model_j = -1, & ! location of debug_model point, local j index
debug_model_iblk = -1, & ! location of debug_model point, local block number
debug_model_task = -1 ! location of debug_model point, local task number

! for hemispheric water and heat budgets
real (kind=dbl_kind) :: &
totmn , & ! total ice/snow water mass (nh)
Expand Down Expand Up @@ -1432,9 +1438,9 @@ subroutine init_diags
write(nu_diag,*) ' Find indices of diagnostic points '
endif

piloc(:) = 0
pjloc(:) = 0
pbloc(:) = 0
piloc(:) = -1
pjloc(:) = -1
pbloc(:) = -1
pmloc(:) = -999
plat(:) = -999._dbl_kind
plon(:) = -999._dbl_kind
Expand Down Expand Up @@ -1535,16 +1541,29 @@ subroutine debug_ice(iblk, plabeld)
integer (kind=int_kind) :: i, j, m
character(len=*), parameter :: subname='(debug_ice)'

! tcraig, do this only on one point, the first point
! do m = 1, npnt
m = 1
if (istep1 >= debug_model_step .and. &
iblk == pbloc(m) .and. my_task == pmloc(m)) then
i = piloc(m)
j = pjloc(m)
call print_state(plabeld,i,j,iblk)
if (istep1 >= debug_model_step) then

! set debug point to 1st global point if not set as local values
if (debug_model_i < 0 .and. debug_model_j < 0 .and. &
debug_model_iblk < 0 .and. debug_model_task < 0) then
debug_model_i = piloc(1)
debug_model_j = pjloc(1)
debug_model_task = pmloc(1)
debug_model_iblk = pbloc(1)
endif

! if debug point is messed up, abort
if (debug_model_i < 0 .or. debug_model_j < 0 .or. &
debug_model_iblk < 0 .or. debug_model_task < 0) then
call abort_ice (subname//'ERROR: debug_model_[i,j,iblk,mytask] not set correctly')
endif
! enddo

! write out debug info
if (debug_model_iblk == iblk .and. debug_model_task == my_task) then
call print_state(plabeld,debug_model_i,debug_model_j,debug_model_iblk)
endif

endif

end subroutine debug_ice

Expand Down
Loading