diff --git a/cpl/module_cap_cpl.F90 b/cpl/module_cap_cpl.F90 index 0a2d677e0..80a84130a 100644 --- a/cpl/module_cap_cpl.F90 +++ b/cpl/module_cap_cpl.F90 @@ -17,7 +17,7 @@ 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 @@ -25,6 +25,7 @@ subroutine diagnose_cplFields(gcomp, clock_fv3, 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 @@ -32,7 +33,6 @@ subroutine diagnose_cplFields(gcomp, clock_fv3, fcstpe, & 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 diff --git a/fv3_cap.F90 b/fv3_cap.F90 index 20c2bcc7a..b90692270 100644 --- a/fv3_cap.F90 +++ b/fv3_cap.F90 @@ -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() @@ -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()