Skip to content

Commit

Permalink
Update fhzero global attribute at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
DusanJovic-NOAA committed Jan 29, 2024
1 parent c9d5fc2 commit 3a74291
Show file tree
Hide file tree
Showing 3 changed files with 220 additions and 160 deletions.
13 changes: 13 additions & 0 deletions fv3_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,8 @@ subroutine ModelAdvance_phase2(gcomp, rc)

real(kind=8) :: MPI_Wtime, timep2rs

character(len=ESMF_MAXSTR) :: fb_name
type(ESMF_Info) :: info
!-----------------------------------------------------------------------------

rc = ESMF_SUCCESS
Expand Down Expand Up @@ -1124,6 +1126,17 @@ subroutine ModelAdvance_phase2(gcomp, rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
end if

! Update fcstFB attributes from fcst PEs to all PEs in this VM
! This is needed in case some attributes are updated during run time
call ESMF_FieldBundleGet(fcstFB(j), name=fb_name, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
if (fb_name(1:8) /= "restart_") then
call ESMF_InfoGetFromHost(fcstFB(j), info=info, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
call ESMF_InfoBroadcast(info, rootPet=fcstPetList(1), rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
endif

enddo

call ESMF_VMEpochExit(rc=rc)
Expand Down
Loading

0 comments on commit 3a74291

Please sign in to comment.