Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

Commit

Permalink
Merge PR #1417 'akturner/framework/forcing_multiple_blocks' into develop
Browse files Browse the repository at this point in the history
The mpas_shift_time_levs routines do their own loop over blocks so it is
a bug for the outer block loop in forcing_shift_data forcing routine.
This bug prevents bfb results with multiple blocks on processors.
  • Loading branch information
mark-petersen committed Oct 2, 2017
2 parents 9116da3 + a21c682 commit 86d50c5
Showing 1 changed file with 38 additions and 42 deletions.
80 changes: 38 additions & 42 deletions src/framework/mpas_forcing.F
Original file line number Diff line number Diff line change
Expand Up @@ -2401,59 +2401,55 @@ subroutine forcing_shift_data(&!{{{

FORCING_DEBUG_WRITE('-- Forcing: forcing_shift_data pool: '//trim(poolnameInput)//" field: "//trim(fieldnameInput))

! loop over blocks
! No need to loop over blocks since mpas_shift_time_levs does this
block => domain % blocklist
do while (associated(block))

call MPAS_pool_get_subpool(block % structs, trim(poolnameInput), forcingPoolInput)
call MPAS_pool_get_subpool(block % structs, trim(poolnameInput), forcingPoolInput)

forcingFieldInput => pool_get_member(forcingPoolInput, trim(fieldnameInput), MPAS_POOL_FIELD)
forcingFieldInput => pool_get_member(forcingPoolInput, trim(fieldnameInput), MPAS_POOL_FIELD)

if (forcingFieldInput % contentsTimeLevs < 2) then
FORCING_ERROR_WRITE('-- Forcing: forcing_shift_data: too few timelevels Pool: '//trim(poolnameInput)//' Field: '//trim(fieldnameInput))
call mpas_log_write('Forcing: forcing_shift_data: too few timelevels in Pool: '//trim(poolnameInput)// &
' Field: '//trim(fieldnameInput), MPAS_LOG_CRIT)
endif
if (forcingFieldInput % contentsTimeLevs < 2) then
FORCING_ERROR_WRITE('-- Forcing: forcing_shift_data: too few timelevels Pool: '//trim(poolnameInput)//' Field: '//trim(fieldnameInput))
call mpas_log_write('Forcing: forcing_shift_data: too few timelevels in Pool: '//trim(poolnameInput)// &
' Field: '//trim(fieldnameInput), MPAS_LOG_CRIT)
endif

if (forcingFieldInput % contentsType == MPAS_POOL_REAL) then
if (forcingFieldInput % contentsType == MPAS_POOL_REAL) then

select case (forcingFieldInput % contentsDims)
case (0)
FORCING_DEBUG_WRITE('-- Forcing: forcing_shift_data: v1: ' COMMA forcingFieldInput % r0a(1) % scalar)
FORCING_DEBUG_WRITE('-- Forcing: forcing_shift_data: v2: ' COMMA forcingFieldInput % r0a(2) % scalar)
call mpas_shift_time_levs(forcingFieldInput % r0a)
FORCING_DEBUG_WRITE('-- Forcing: forcing_shift_data: v1: ' COMMA forcingFieldInput % r0a(1) % scalar)
FORCING_DEBUG_WRITE('-- Forcing: forcing_shift_data: v2: ' COMMA forcingFieldInput % r0a(2) % scalar)
case (1)
call mpas_shift_time_levs(forcingFieldInput % r1a)
case (2)
call mpas_shift_time_levs(forcingFieldInput % r2a)
case (3)
call mpas_shift_time_levs(forcingFieldInput % r3a)
case (4)
call mpas_shift_time_levs(forcingFieldInput % r4a)
case (5)
call mpas_shift_time_levs(forcingFieldInput % r5a)
end select
select case (forcingFieldInput % contentsDims)
case (0)
FORCING_DEBUG_WRITE('-- Forcing: forcing_shift_data: v1: ' COMMA forcingFieldInput % r0a(1) % scalar)
FORCING_DEBUG_WRITE('-- Forcing: forcing_shift_data: v2: ' COMMA forcingFieldInput % r0a(2) % scalar)
call mpas_shift_time_levs(forcingFieldInput % r0a)
FORCING_DEBUG_WRITE('-- Forcing: forcing_shift_data: v1: ' COMMA forcingFieldInput % r0a(1) % scalar)
FORCING_DEBUG_WRITE('-- Forcing: forcing_shift_data: v2: ' COMMA forcingFieldInput % r0a(2) % scalar)
case (1)
call mpas_shift_time_levs(forcingFieldInput % r1a)
case (2)
call mpas_shift_time_levs(forcingFieldInput % r2a)
case (3)
call mpas_shift_time_levs(forcingFieldInput % r3a)
case (4)
call mpas_shift_time_levs(forcingFieldInput % r4a)
case (5)
call mpas_shift_time_levs(forcingFieldInput % r5a)
end select

else if (forcingFieldInput % contentsType == MPAS_POOL_INTEGER) then
else if (forcingFieldInput % contentsType == MPAS_POOL_INTEGER) then

select case (forcingFieldInput % contentsDims)
case (0)
call mpas_shift_time_levs(forcingFieldInput % i0a)
case (1)
call mpas_shift_time_levs(forcingFieldInput % i1a)
case (2)
call mpas_shift_time_levs(forcingFieldInput % i2a)
case (3)
call mpas_shift_time_levs(forcingFieldInput % i3a)
end select
select case (forcingFieldInput % contentsDims)
case (0)
call mpas_shift_time_levs(forcingFieldInput % i0a)
case (1)
call mpas_shift_time_levs(forcingFieldInput % i1a)
case (2)
call mpas_shift_time_levs(forcingFieldInput % i2a)
case (3)
call mpas_shift_time_levs(forcingFieldInput % i3a)
end select

endif

block => block % next
end do

forcingField => forcingField % next
end do

Expand Down

0 comments on commit 86d50c5

Please sign in to comment.