Skip to content

Commit

Permalink
Pass return code from diagnose_cplFields back to caller
Browse files Browse the repository at this point in the history
  • Loading branch information
DusanJovic-NOAA committed Jul 3, 2024
1 parent b2288be commit c39e6e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cpl/module_cap_cpl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ module module_cap_cpl
!-----------------------------------------------------------------------------

subroutine diagnose_cplFields(gcomp, clock_fv3, fcstpe, &
statewrite_flag, stdiagnose_flag, state_tag)
statewrite_flag, stdiagnose_flag, state_tag, rc)

type(ESMF_GridComp), intent(in) :: gcomp
type(ESMF_Clock),intent(in) :: clock_fv3
logical, intent(in) :: fcstpe
logical, intent(in) :: statewrite_flag
integer, intent(in) :: stdiagnose_flag
character(len=*), intent(in) :: state_tag !< "import" or "export".
integer, intent(out) :: rc

character(len=*),parameter :: subname='(module_cap_cpl:diagnose_cplFields)'
type(ESMF_Time) :: currTime
type(ESMF_State) :: state
character(len=240) :: timestr
character(len=160) :: nuopcMsg
character(len=160) :: filename
integer :: rc
!
call ESMF_ClockGet(clock_fv3, currTime=currTime, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
Expand Down
6 changes: 4 additions & 2 deletions fv3_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,8 @@ subroutine ModelAdvance_phase1(gcomp, rc)
if( dbug > 0 .or. cplprint_flag ) then
fcstpe = .false.
if( mype < num_pes_fcst ) fcstpe = .true.
call diagnose_cplFields(gcomp, clock, fcstpe, cplprint_flag, dbug, 'import')
call diagnose_cplFields(gcomp, clock, fcstpe, cplprint_flag, dbug, 'import', rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
endif

timep1re = MPI_Wtime()
Expand Down Expand Up @@ -1235,7 +1236,8 @@ subroutine ModelAdvance_phase2(gcomp, rc)
if( dbug > 0 .or. cplprint_flag ) then
fcstpe = .false.
if( mype < num_pes_fcst ) fcstpe = .true.
call diagnose_cplFields(gcomp, clock_out, fcstpe, cplprint_flag, dbug, 'export')
call diagnose_cplFields(gcomp, clock_out, fcstpe, cplprint_flag, dbug, 'export', rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
end if

timep2re = MPI_Wtime()
Expand Down

0 comments on commit c39e6e5

Please sign in to comment.