The routine readTileFileNC
reads a Tempest NetCDF tile file
and stores the relevant data in module variables for later use.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | TFDir | |||
character(len=*), | intent(in) | :: | gridIn | |||
character(len=*), | intent(in) | :: | gridOut | |||
integer, | optional | :: | RC |
subroutine readTileFileNC(TFDir,gridIn,gridOut,RC) ! ! !USES: ! ! Use Precision_Mod, Only: f4 ! ! !INPUT PARAMETERS: ! Character(Len=*), Intent(In) :: TFDir Character(Len=*), Intent(In) :: gridIn Character(Len=*), Intent(In) :: gridOut Integer, Optional :: RC ! ! !OUTPUT PARAMETERS: ! !Real(kind=sp), Intent(Out) :: TestOut ! !----------------------------------------------------------------------- ! ! !LOCAL VARIABLES: ! Character(Len=255) :: fName Logical :: Found Integer :: status !================================================================= ! readTileFileNC starts here! !================================================================= ! Assemble the full tile file name Write(fName,'(a,a,a,a)') Trim(gridIn),'_',Trim(gridOut),'.nc' fName = Trim(TFDir) // '/' // Trim(fName) Inquire(File=fName,Exist=Found) If (.not.Found) Then ! Try the reverse name Write(fName,'(a,a,a,a)') Trim(gridOut),'_',Trim(gridIn),'.nc' fName = Trim(TFDir) // '/' // Trim(fName) Inquire(File=fName,Exist=Found) If (.not.Found) Then Write(6,'(a,a)') ' --- Could not find NetCDF tile file ',Trim(fName) RC = -1 Return End If End If call readTileFileNC_file(fName, rc=status) if (present(rc)) rc = status end subroutine readTileFileNC