Skip to content

Commit

Permalink
Merge pull request #4 from Mohid-Water-Modelling-System/master
Browse files Browse the repository at this point in the history
Fork master update
  • Loading branch information
RBCanelas authored Jul 20, 2018
2 parents 6f72a6e + 9fc345e commit d9737c1
Show file tree
Hide file tree
Showing 26 changed files with 1,262 additions and 580 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.

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
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
2 changes: 1 addition & 1 deletion Software/MOHIDBase1/ModuleEnterData.F90
Original file line number Diff line number Diff line change
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.
!----------------------------------------------------------------------------------------------------------


2 changes: 1 addition & 1 deletion Software/MOHIDBase1/ModuleFunctions.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11822,7 +11822,7 @@ subroutine CheckAlternativeTidalCompNames (TidalName, MohidTidalName)
MohidTidalName = 'NU2'
endif

if (TidalName(1:il) == 'La2' .or. TidalName(1:il) == 'LAMDA2') then
if (TidalName(1:il) == 'La2' .or. TidalName(1:il) == 'LAMDA2' .or. TidalName(1:il) == 'LA2') then
MohidTidalName = 'LDA2'
endif

Expand Down
6 changes: 6 additions & 0 deletions Software/MOHIDBase1/ModuleGlobalData.F90
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ Module ModuleGlobalData
integer, parameter :: NOT_ASSOCIATE_ = 20
integer, parameter :: FILE_EXISTS_ERR_ = 21
integer, parameter :: OUT_OF_BOUNDS_ERR_ = 22 !Add to use with ModulePhreeqC

!MOHID LAND AND MOHID WATER and MOHID RIVER
integer, parameter :: MOHIDLAND_ = 1
integer, parameter :: MOHIDWATER_ = 2
integer, parameter :: MOHIDRIVER_ = 3


!Types of coordinates
integer, parameter :: GEOG_ = 1 !Coordenadas Geograficas
Expand Down
13 changes: 11 additions & 2 deletions Software/MOHIDBase2/ModuleAtmosphere.F90
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ Module ModuleAtmosphere
type T_Atmosphere
integer :: InstanceID = null_int !initialization: Jauch
character(PathLength) :: ModelName = null_str !initialization: Jauch
integer :: ModelType = MOHIDLAND_
type(T_Size2D) :: Size
type(T_Size2D) :: WorkSize
type(T_External) :: ExternalVar
Expand Down Expand Up @@ -347,6 +348,7 @@ Module ModuleAtmosphere


subroutine StartAtmosphere(ModelName, &
ModelType, &
AtmosphereID, &
TimeID, &
GridDataID, &
Expand All @@ -357,6 +359,7 @@ subroutine StartAtmosphere(ModelName, &

!Arguments--------------------------------------------------------------
character(Len=*) :: ModelName
integer :: ModelType
integer :: AtmosphereID
integer :: TimeID
integer :: GridDataID
Expand Down Expand Up @@ -392,7 +395,8 @@ subroutine StartAtmosphere(ModelName, &
call AllocateInstance

Me%ModelName = ModelName

Me%ModelType = ModelType

!Associates External Instances
Me%ObjTime = AssociateInstance (mTIME_, TimeID )
Me%ObjGridData = AssociateInstance (mGRIDDATA_, GridDataID )
Expand Down Expand Up @@ -633,7 +637,12 @@ subroutine ConstructGlobalVariables
STAT = STAT_CALL)
if (STAT_CALL /= SUCCESS_) stop 'ConstructGlobalVariables - ModuleAtmosphere - ERR60'

if (trim(Me%ModelName) == 'MOHID Land Model') then
!This can not be a string that is set by the user.
!In operational models this value is not 'MOHID Land Model'
!so that the timeseries are saved with a correct model name
!This was changed to a integer that is not changed by the user
!if (trim(Me%ModelName) == 'MOHID Land Model') then
if (Me%ModelType == MOHIDLAND_) then
defValue = 2
else
defValue = 1
Expand Down
Loading

0 comments on commit d9737c1

Please sign in to comment.