The routine Cleanup
closes any remaining open files.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | optional | :: | RC |
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