Skip to content

Commit

Permalink
nan was picked up in pslv field on first pass
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Jul 31, 2024
1 parent 4520051 commit 5adf83a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mediator/med_methods_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2609,6 +2609,7 @@ subroutine med_methods_FB_check_for_nans(FB, maintask, logunit, rc)
do index=1,fieldCount
call med_methods_FB_getNameN(FB, index, fieldname, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

call ESMF_FieldBundleGet(FB, fieldName=fieldname, field=field, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call ESMF_FieldGet(field, rank=fieldrank, name=fieldname, rc=rc)
Expand All @@ -2632,9 +2633,8 @@ subroutine med_methods_FB_check_for_nans(FB, maintask, logunit, rc)
if (nanfound) then
call ESMF_LogWrite('ABORTING JOB', ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
rc = ESMF_FAILURE
return
end if

end subroutine med_methods_FB_check_for_nans

!-----------------------------------------------------------------------------
Expand Down
9 changes: 6 additions & 3 deletions mediator/med_phases_prep_ocn_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ subroutine med_phases_prep_ocn_avg(gcomp, rc)
! local variables
type(InternalState) :: is_local
integer :: ncnt
logical, save :: first_call = .true.
character(len=*),parameter :: subname='(med_phases_prep_ocn_avg)'
!---------------------------------------

Expand Down Expand Up @@ -306,9 +307,10 @@ subroutine med_phases_prep_ocn_avg(gcomp, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

! Check for nans in fields export to ocn
call FB_check_for_nans(is_local%wrap%FBExp(compocn), maintask, logunit, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

if(.not. first_call) then
call FB_check_for_nans(is_local%wrap%FBExp(compocn), maintask, logunit, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
endif
! zero accumulator
is_local%wrap%ExpAccumOcnCnt = 0
call FB_reset(is_local%wrap%FBExpAccumOcn, value=czero, rc=rc)
Expand All @@ -320,6 +322,7 @@ subroutine med_phases_prep_ocn_avg(gcomp, rc)
call ESMF_LogWrite(trim(subname)//": done", ESMF_LOGMSG_INFO)
end if
call t_stopf('MED:'//subname)
first_call = .false.

end subroutine med_phases_prep_ocn_avg

Expand Down

0 comments on commit 5adf83a

Please sign in to comment.