Cleanup Subroutine

public subroutine Cleanup(RC)

The routine Cleanup closes any remaining open files.

History

  • 09 Jan 2016 - S. D. Eastham - Initial version

Arguments

Type IntentOptional Attributes Name
integer, optional :: RC

Calls

proc~~cleanup~~CallsGraph proc~cleanup Cleanup nf90_close nf90_close proc~cleanup->nf90_close

Called by

proc~~cleanup~~CalledByGraph proc~cleanup Cleanup proc~assert Assert proc~assert->proc~cleanup proc~readtilefile readTileFile proc~readtilefile->proc~assert proc~readtilefilenc_file readTileFileNC_file proc~readtilefilenc_file->proc~assert proc~set_fid Set_fID proc~set_fid->proc~assert none~initialize_subclass~2 TilingRegridder%initialize_subclass none~initialize_subclass~2->proc~readtilefilenc_file proc~readtilefilenc readTileFileNC proc~readtilefilenc->proc~readtilefilenc_file none~initialize~18 AbstractRegridder%initialize none~initialize~18->none~initialize_subclass~2

Source Code

      Subroutine Cleanup(RC)
!
! !USES:
!
!      Use Precision_Mod, Only: f4

!
! !INPUT PARAMETERS:
!
      Integer, Optional                    :: RC
!
! !OUTPUT PARAMETERS:
!
      !Real(kind=sp), Intent(Out) :: TestOut
!
!-----------------------------------------------------------------------
!
! !LOCAL VARIABLES:
!
      !=================================================================
      ! Cleanup starts here!
      !=================================================================

      If (fIDInLocal.gt.-1) Then
         RC = NF90_CLOSE(ncid=fIDInLocal)
         Write(6,'(a,I0.3)') 'Closed input file.  Result: ', RC
      End If

      If (fIDOutLocal.gt.-1) Then
         RC = NF90_CLOSE(ncid=fIDOutLocal)
         Write(6,'(a,I0.3)') 'Closed output file. Result: ', RC
      End If

      ! Tile file variables
      If (Allocated(II_In))    Deallocate(II_In)
      If (Allocated(JJ_In))    Deallocate(JJ_In)
      If (Allocated(II_Out))   Deallocate(II_Out)
      If (Allocated(JJ_Out))   Deallocate(JJ_Out)
      If (Allocated(W))        Deallocate(W)
      If (Allocated(outSum))   Deallocate(outSum)

      End Subroutine Cleanup