ESMF_CFIOGridDestroy Subroutine

public subroutine ESMF_CFIOGridDestroy(grid, rc)

ESMF_CFIOGridDestroy – destructor for a CFIO grid object

Arguments

Type IntentOptional Attributes Name
type(ESMF_CFIOGrid), intent(inout) :: grid

CFIOGrid object

integer, intent(out), optional :: rc

Error return code:
0 all is well


Called by

proc~~esmf_cfiogriddestroy~~CalledByGraph proc~esmf_cfiogriddestroy ESMF_CFIOGridDestroy proc~esmf_cfiodestroy ESMF_CFIODestroy proc~esmf_cfiodestroy->proc~esmf_cfiogriddestroy proc~esmf_cfiovarinfodestroy ESMF_CFIOVarInfoDestroy proc~esmf_cfiodestroy->proc~esmf_cfiovarinfodestroy proc~esmf_cfiovarinfodestroy->proc~esmf_cfiogriddestroy none~find~31 CFIOCollection%find none~find~31->proc~esmf_cfiodestroy proc~mapl_cfiodestroy MAPL_CFIODestroy proc~mapl_cfiodestroy->proc~esmf_cfiodestroy interface~esmf_iodestroy ESMF_ioDestroy interface~esmf_iodestroy->proc~mapl_cfiodestroy proc~mapl_cfiocreatefromfile MAPL_CFIOCreateFromFile proc~mapl_cfiocreatefromfile->none~find~31 proc~mapl_cfioreadbundleread MAPL_CFIOReadBundleRead proc~mapl_cfioreadbundleread->none~find~31 proc~test_main~3 test_main proc~test_main~3->interface~esmf_iodestroy

Source Code

      subroutine ESMF_CFIOGridDestroy (grid, rc)
!
! !INPUT PARAMETERS:
!
      integer, intent(out), OPTIONAL :: rc      !! Error return code:       
                                                !! 0   all is well
!
! !INPUT/OUTPUT PARAMETERS:
!
      type(ESMF_CFIOGrid), intent(inout) :: grid !! CFIOGrid object

!
!------------------------------------------------------------------------------
      integer :: rtcode = 0

      if (.not. grid%twoDimLat) then
         if ( associated(grid%lon) ) deallocate(grid%lon, stat=rtcode)
         if ( associated(grid%lat) ) deallocate(grid%lat, stat=rtcode)
      end if
      if ( associated(grid%lev) ) deallocate(grid%lev, stat=rtcode)

      if ( associated(grid%ak) ) deallocate(grid%ak, stat=rtcode)
      if ( associated(grid%bk) ) deallocate(grid%bk, stat=rtcode)
      if ( associated(grid%sigma) ) deallocate(grid%sigma, stat=rtcode)

      if ( present(rc) ) rc = rtcode

      end subroutine ESMF_CFIOGridDestroy