comp1_sg_final Subroutine

public subroutine comp1_sg_final(gcomp, istate, ostate, clock, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_GridComp) :: gcomp
type(ESMF_State) :: istate
type(ESMF_State) :: ostate
type(ESMF_Clock) :: clock
integer, intent(out) :: rc

Source Code

subroutine comp1_sg_final(gcomp, istate, ostate, clock, rc)
    type(ESMF_GridComp)  :: gcomp
    type(ESMF_State)     :: istate, ostate
    type(ESMF_Clock)     :: clock
    integer, intent(out) :: rc

    type(ESMF_Field) :: field1, field2

    print *, "i am comp1_sg_final"

    call ESMF_StateGet(istate, "Field_sg1", field1, rc=rc)
    if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
      line=__LINE__, &
      file=FILENAME)) &
      return  ! bail out

    call ESMF_FieldDestroy(field1, rc=rc)
    if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
      line=__LINE__, &
      file=FILENAME)) &
      return  ! bail out

    call ESMF_StateGet(istate, "Field_sg2", field2, rc=rc)
    if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
      line=__LINE__, &
      file=FILENAME)) &
      return  ! bail out

    call ESMF_FieldDestroy(field2, rc=rc)
    if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
      line=__LINE__, &
      file=FILENAME)) &
      return  ! bail out

end subroutine comp1_sg_final