Skip to content

Commit

Permalink
Merge pull request #6 from JoaoBSobrinho/Staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
JoaoBSobrinho authored Aug 21, 2018
2 parents 38f4063 + 1916b17 commit 9fbabf5
Show file tree
Hide file tree
Showing 45 changed files with 30,182 additions and 21,394 deletions.
9 changes: 8 additions & 1 deletion Software/ConvertToHDF5/ConvertToHDF5.F90
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ program ConvertToHDF5
use ModuleMOG2DFormat
use ModuleIHRadarFormat
#endif
use ModuleDelft3D_2_Mohid

implicit none

Expand Down Expand Up @@ -109,6 +110,8 @@ program ConvertToHDF5
character(len = StringLength), parameter:: GluesHD5Files = 'GLUES HDF5 FILES'
character(len = StringLength), parameter:: PatchHD5Files = 'PATCH HDF5 FILES'
character(len = StringLength), parameter:: ConvertIHRadarFormatToHDF5 = 'CONVERT IH RADAR FORMAT'

character(len = StringLength), parameter:: ConvertDelft3DFormatToHDF5 = 'CONVERT DELFT3D FORMAT'

logical :: WatchPassedAsArgument = .false.
logical :: Watch = .false.
Expand Down Expand Up @@ -263,7 +266,7 @@ subroutine ReadOptions
if (DataFile == null_str) then

!Read input file name from nomfich file
call ReadFileName('IN_MODEL', DataFile, "Convert2netcdf", STAT = STAT_CALL)
call ReadFileName('IN_MODEL', DataFile, "ConvertToHDF5", STAT = STAT_CALL)

if (STAT_CALL == FILE_NOT_FOUND_ERR_) then
DataFile = 'ConvertToHDF5Action.dat'
Expand Down Expand Up @@ -525,6 +528,10 @@ subroutine ReadOptions
call ConvertIHRadarFormat(ObjEnterData, ClientNumber, STAT = STAT_CALL)
if(STAT_CALL .ne. SUCCESS_) stop 'ReadOptions - ConvertToHDF5 - ERR270'
#endif

case (ConvertDelft3DFormatToHDF5)

call ConvertDelft3D_2_Mohid(ObjEnterData, ClientNumber, STAT = STAT_CALL)

case default

Expand Down
245 changes: 216 additions & 29 deletions Software/ConvertToHDF5/ModuleDelft3D_2_Mohid.F90

Large diffs are not rendered by default.

694 changes: 519 additions & 175 deletions Software/ConvertToHDF5/ModuleGlueHDF5Files.F90

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Software/ConvertToHDF5/ModuleHDF5ToASCIIandBIN.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ subroutine OutputSwanASCII(PropName, TimeName, Aux2D, l, p)
if (len_trim(Me%OutputListFolderName) == 0) then
write(Me%UnitProps(p),'(A30)') Filename
else
aux = trim(Me%OutputListFolderName) // "\" // trim(Filename)
aux = trim(Me%OutputListFolderName) //backslash// trim(Filename)
write(Me%UnitProps(p),'(A100)') aux
endif

Expand Down Expand Up @@ -1239,7 +1239,7 @@ subroutine OutputSwanASCIIVectorial(PropName, NextTime, l, p)
if (len_trim(Me%OutputListFolderName) == 0) then
write(Me%UnitProps(p),'(A30)') Filename
else
aux = trim(Me%OutputListFolderName) // "\" // trim(Filename)
aux = trim(Me%OutputListFolderName) //backslash// trim(Filename)
write(Me%UnitProps(p),'(A100)') aux
endif

Expand Down
14 changes: 7 additions & 7 deletions Software/ConvertToHDF5/ModuleNetCDFCF_2_HDF5MOHID.F90
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ subroutine WriteComputeIntensity
if (.not. Found) stop 'WriteComputeIntensity - ModuleNetCDFCF_2_HDF5MOHID - ERR20'


do i=1, Me%Date%TotalInst
do i=1, Me%Date%TotalInstOut
!Read component X

if (Me%Field(iPx)%Dim==2) then
Expand Down Expand Up @@ -492,7 +492,7 @@ subroutine WriteComputeDirection
if (.not. Found) stop 'WriteComputeDirection - ModuleNetCDFCF_2_HDF5MOHID - ERR20'


do i=1, Me%Date%TotalInst
do i=1, Me%Date%TotalInstOut
!Read component X

if (Me%Field(iPx)%Dim==2) then
Expand Down Expand Up @@ -590,7 +590,7 @@ subroutine WriteBeaufort
enddo
if (.not. Found) stop 'WriteBeaufort - ModuleNetCDFCF_2_HDF5MOHID - ERR10'

do i=1, Me%Date%TotalInst
do i=1, Me%Date%TotalInstOut
!Read component X
if (Me%Field(iPx)%Dim==2) then
allocate(Me%Field(iPx)%Value2DOut(Me%Size%ILB:Me%Size%IUB,Me%Size%JLB:Me%Size%JUB))
Expand Down Expand Up @@ -688,7 +688,7 @@ subroutine WriteRelativeHumidity
enddo
if (.not. Found) stop 'WriteComputeIntensity - ModuleNetCDFCF_2_HDF5MOHID - ERR30'

do i=1, Me%Date%TotalInst
do i=1, Me%Date%TotalInstOut
!Read temperature

if (Me%Field(iPt)%Dim/=2) then
Expand Down Expand Up @@ -794,7 +794,7 @@ subroutine WriteAverageInDepth
if (.not. Found) stop 'WriteAverageInDepth - ModuleNetCDFCF_2_HDF5MOHID - ERR10'


do i=1, Me%Date%TotalInst
do i=1, Me%Date%TotalInstOut
!Read 3D property

if (Me%Field(iPt)%Dim/=3) then
Expand Down Expand Up @@ -873,7 +873,7 @@ subroutine WriteReflectivity2Precipitation
if (.not. Found) stop 'WriteReflectivity2Precipitation - ModuleNetCDFCF_2_HDF5MOHID - ERR10'


do i=1, Me%Date%TotalInst
do i=1, Me%Date%TotalInstOut
!Read 2D property

if (Me%Field(iPt)%Dim/=2) then
Expand Down Expand Up @@ -1015,7 +1015,7 @@ subroutine WriteRotation
if (.not. Found) stop 'WriteRotation - ModuleNetCDFCF_2_HDF5MOHID - ERR50'


do i=1, Me%Date%TotalInst
do i=1, Me%Date%TotalInstOut
!Read component X

if (Me%Field(iPx)%Dim==2) then
Expand Down
2 changes: 1 addition & 1 deletion Software/DDC/DDCWorker/DDCWorker.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1852,7 +1852,7 @@ integer function ReturnOnlyFileName(FileNamePlusPath, OnlyFileName)
j = 1

do i=n,1,-1
if (FileNamePlusPath(i:i)=='/' .or. FileNamePlusPath(i:i)=='\') then
if (FileNamePlusPath(i:i)=='/' .or. FileNamePlusPath(i:i)=="\") then
j = i+1
exit
endif
Expand Down
16 changes: 8 additions & 8 deletions Software/DomainDecompositionConsolidation/ModuleDDC.F90
Original file line number Diff line number Diff line change
Expand Up @@ -308,30 +308,30 @@ end function ModelLevel
!--------------------------------------------------------------------------

character(len=PathLength) pure function ModelPath (AuxString, Level)

!Arguments-------------------------------------------------------------
character(len=*), intent(in) :: AuxString
integer, intent(in) :: Level

!Local-----------------------------------------------------------------
integer :: position

!------------------------------------------------------------------------

position = scan(AuxString, "/", back = .true.)
if (position == 0) then
position = scan(AuxString, "\", back = .true.)
if (position == 0) then
position = scan(AuxString, backslash, back = .true.)
endif
if (position == 0) then
ModelPath = "../res"
else
ModelPath = AuxString(Level+1:position)//"res"
endif
endif
!------------------------------------------------------------------------

end function ModelPath


!--------------------------------------------------------------------------

function AllocateDirectoryList(ModelPath)
Expand Down
13 changes: 12 additions & 1 deletion Software/HDF5Exporter/ModuleHDF5Exporter.f90
Original file line number Diff line number Diff line change
Expand Up @@ -980,11 +980,22 @@ subroutine ReadGlobalData
call GetData(Me%ExportType, Me%ObjEnterData, iflag, &
keyword = 'EXPORT_TYPE', &
SearchType = FromFile, &
Default = 1, &
!1
Default = ExportCellToTimeseries, &
ClientModule = 'ExportToTimeSerie', &
STAT = STAT_CALL)
if (STAT_CALL /= SUCCESS_) &
stop 'ReadGlobalData - ModuleExportHDF5ToTimeSerie - ERR010'


if (Me%ExportType /= ExportCellToTimeseries .and. &
Me%ExportType /= ExportAreaToTimeseries) then
write (*,*) " wrong option EXPORT_TYPE =", Me%ExportType
write (*,*) " valid options are:"
write (*,*) " 1 - extract a time series from a point in a cell"
write (*,*) " 2 - extract a time series from a polygon intersecting a set of cells"
stop 'ReadGlobalData - ModuleExportHDF5ToTimeSerie - ERR015'
endif


! Obtain the start and end times for the Time Serie
Expand Down
1 change: 1 addition & 0 deletions Software/HDF5Extractor/ModuleHDF5Extractor.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1638,6 +1638,7 @@ recursive subroutine InquireSubGroup (ID, GroupName, Level)
!(for time dependent itens assumed that data type equal for all fields)
!Opens data set
call h5dopen_f(ID, trim(adjustl(obj_name)), dset_id, STAT_CALL)

!Gets datatype
call h5dget_type_f (dset_id, datatype_id, STAT_CALL)
!call h5tget_size_f (datatype_id, size, STAT_CALL)
Expand Down
4 changes: 2 additions & 2 deletions Software/MOHIDBase1/ModuleEnterData.F90
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ subroutine ReadFileName(KEYWORD, FILE_NAME, Message, TIME_END, Extension, FilesI
iFN = len_trim(FILE_NAME)
ipath = 0
do i = iFN, 1, -1
if (FILE_NAME(i:i) == '/' .or. FILE_NAME(i:i) == '\') then
if (FILE_NAME(i:i) == '/' .or. FILE_NAME(i:i) == backslash) then
ipath = i
exit
endif
Expand Down Expand Up @@ -4854,7 +4854,7 @@ end module ModuleEnterData

!----------------------------------------------------------------------------------------------------------
!MOHID Water Modelling System.
!Copyright (C) 1985, 1998, 2002, 2005. Instituto Superior Técnico, Technical University of Lisbon.
!Copyright (C) 1985, 1998, 2002, 2005. Instituto Superior Técnico, Technical University of Lisbon.
!----------------------------------------------------------------------------------------------------------


Loading

0 comments on commit 9fbabf5

Please sign in to comment.