ESMF_CFIOSdfFileClose Subroutine

public subroutine ESMF_CFIOSdfFileClose(cfio, rc)

ESMF_CFIOSdfFileClose – 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 ncclos (file close)


Calls

proc~~esmf_cfiosdffileclose~~CallsGraph proc~esmf_cfiosdffileclose ESMF_CFIOSdfFileClose proc~cfio_close CFIO_Close proc~esmf_cfiosdffileclose->proc~cfio_close ncclos ncclos proc~cfio_close->ncclos proc~err err proc~cfio_close->proc~err

Called by

proc~~esmf_cfiosdffileclose~~CalledByGraph proc~esmf_cfiosdffileclose ESMF_CFIOSdfFileClose proc~esmf_cfiofileclose ESMF_CFIOFileClose proc~esmf_cfiofileclose->proc~esmf_cfiosdffileclose proc~mapl_cfioclose MAPL_CFIOClose proc~mapl_cfioclose->proc~esmf_cfiofileclose proc~mapl_cfiodestroy MAPL_CFIODestroy proc~mapl_cfiodestroy->proc~esmf_cfiofileclose program~test test program~test->proc~esmf_cfiofileclose program~test~10 test program~test~10->proc~esmf_cfiofileclose program~test~11 test program~test~11->proc~esmf_cfiofileclose program~test~12 test program~test~12->proc~esmf_cfiofileclose program~test~14 test program~test~14->proc~esmf_cfiofileclose program~test~2 test program~test~2->proc~esmf_cfiofileclose program~test~3 test program~test~3->proc~esmf_cfiofileclose program~test~4 test program~test~4->proc~esmf_cfiofileclose program~test~5 test program~test~5->proc~esmf_cfiofileclose program~test~6 test program~test~6->proc~esmf_cfiofileclose program~test~7 test program~test~7->proc~esmf_cfiofileclose program~test~8 test program~test~8->proc~esmf_cfiofileclose program~test~9 test program~test~9->proc~esmf_cfiofileclose interface~esmf_iodestroy ESMF_ioDestroy interface~esmf_iodestroy->proc~mapl_cfiodestroy proc~test_main~5 test_main proc~test_main~5->interface~esmf_iodestroy

Source Code

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

       if ( cfio%isOpen ) then
          call CFIO_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_CFIOSdfFileClose