ESMF_CFIOEosFileClose Subroutine

public subroutine ESMF_CFIOEosFileClose(cfio, rc)

ESMF_CFIOEosFileClose – close an open CFIO stream.

Arguments

Type IntentOptional Attributes Name
type(ESMF_CFIO), intent(inout) :: cfio

CFIO object

integer, intent(out), optional :: rc

Error return code: 0 all is well -54 error from NF90_CLOSE (file close)


Calls

proc~~esmf_cfioeosfileclose~~CallsGraph proc~esmf_cfioeosfileclose ESMF_CFIOEosFileClose eos_close eos_close proc~esmf_cfioeosfileclose->eos_close

Source Code

      subroutine ESMF_CFIOEosFileClose (cfio, rc)
!
! !OUTPUT PARAMETERS:
!
      integer, intent(out), OPTIONAL :: rc      !! Error return code:
                                       !! 0   all is well
                                       !! -54  error from NF90_CLOSE (file close)
!
! !INPUT/OUTPUT PARAMETERS:
!
      type(ESMF_CFIO), intent(inout) :: cfio       !! CFIO object
!
!------------------------------------------------------------------------------
       integer :: rtcode

       if ( cfio%isOpen ) then
          call EOS_Close(cfio%fid, rtcode)
          if (rtcode .ne. 0) then
             print *, "CFIO_Close failed"
          else
             cfio%isOpen = .false.
          end if

       else
          rtcode = 0
       end if

       if ( present(rc) ) rc = rtcode

      end subroutine ESMF_CFIOEosFileClose