Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
RBCanelas authored Jul 20, 2018
2 parents 57607ad + 6f72a6e commit 9fc345e
Show file tree
Hide file tree
Showing 24,620 changed files with 877,618 additions and 48 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
105 changes: 105 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
# Maps to Visual Studio solution file (Tutorial.sln)
# The solution will have all targets (exe, lib, dll)
# as Visual Studio projects (.vcproj)

project(MOHIDNumerics)
enable_language(Fortran)

# if build type not specified, default to release
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "release")
endif()

# Turn on the ability to create folders to organize projects (.vcproj)
# It creates "CMakePredefinedTargets" folder by default and adds CMake
# defined projects like INSTALL.vcproj and ZERO_CHECK.vcproj
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

message("Project name " ${CMAKE_PROJECT_NAME})

#SET(CMAKE_VERBOSE_MAKEFILE TRUE)

#################################################################
# BUILD PATHS
#################################################################

SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
SET(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/modules)
INCLUDE_DIRECTORIES(${CMAKE_Fortran_MODULE_DIRECTORY})

message(STATUS "Building paths")
message(STATUS "Executable output path " ${EXECUTABLE_OUTPUT_PATH})
message(STATUS "Library output path " ${LIBRARY_OUTPUT_PATH})
message(STATUS "Modules output path " ${CMAKE_Fortran_MODULE_DIRECTORY})

#################################################################
# CONFIGURATION TYPES & BUILD MODE & BUILD_TESTS
#################################################################

SET(CMAKE_CONFIGURATION_TYPES RELEASE)
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RELEASE CACHE STRING
"Choose the type of build, options are: NONE RELEASE"
FORCE)

SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS NONE RELEASE)
ENDIF(NOT CMAKE_BUILD_TYPE)

#################################################################
# FFLAGS depend on the compiler and the build type
#################################################################

GET_FILENAME_COMPONENT(Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME)

ADD_DEFINITIONS(-D${CMAKE_Fortran_COMPILER_ID})

message(STATUS "COMPILER INFO: ${CMAKE_Fortran_COMPILER_ID} - ${Fortran_COMPILER_NAME}")

IF (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU" OR Fortran_COMPILER_NAME MATCHES "gfortran*")
# gfortran
set(FORTRAN_FLAGS "-fdefault-real-8 -ffree-line-length-0 -cpp -Wimplicit-interface ${EXTRA_FLAGS} ")
set (CMAKE_Fortran_FLAGS "${FORTRAN_FLAGS} ${MACROS} ${INCLUDES} " CACHE STRING "" FORCE)
set (CMAKE_Fortran_FLAGS_RELEASE "-O3 ${EXTRA_FLAGS} " CACHE STRING "" FORCE)
set (CMAKE_Fortran_FLAGS_DEBUG "-g -fbacktrace -fbounds-check -fprofile-arcs -ftest-coverage -Wimplicit-interface ${EXTRA_FLAGS} " CACHE STRING "" FORCE)
ELSEIF (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel" OR Fortran_COMPILER_NAME MATCHES "ifort*")
# ifort
set(FORTRAN_FLAGS " -fpp ${EXTRA_FLAGS} ")
set (CMAKE_Fortran_FLAGS "${FORTRAN_FLAGS} ${MACROS} ${INCLUDES}" CACHE STRING "" FORCE)
set (CMAKE_Fortran_FLAGS_RELEASE "-O3 ${EXTRA_FLAGS} " CACHE STRING "" FORCE)
set (CMAKE_Fortran_FLAGS_DEBUG "-traceback -debug all -check all -ftrapuv -warn nointerfaces ${EXTRA_FLAGS} " CACHE STRING "" FORCE)
# A partir de CMake 3.1
# -prof-gen:srcpos -prof-dir${PROJECT_BINARY_DIR}

ELSEIF (${CMAKE_Fortran_COMPILER_ID} STREQUAL "XL" OR Fortran_COMPILER_NAME MATCHES "xlf*")
# xlf (untested)
set(FORTRAN_FLAGS "-q64 -qrealsize=8 -qsuffix=f=f90:cpp=f90 ${EXTRA_FLAGS} ")
set (CMAKE_Fortran_FLAGS "${FORTRAN_FLAGS} ${MACROS} ${INCLUDES}" CACHE STRING "" FORCE)
set (CMAKE_Fortran_FLAGS_RELEASE "-O3 -qstrict ${EXTRA_FLAGS} " CACHE STRING "" FORCE)
set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -qfullpath -qkeepparm ${EXTRA_FLAGS} " CACHE STRING "" FORCE)
ELSE ()
message ("No optimized Fortran compiler flags are known, we just try -O2...")
set (CMAKE_Fortran_FLAGS_RELEASE "-O2")
set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g")
ENDIF ()

#SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--allow-multiple-definition")
#SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--allow-multiple-definition")

message (STATUS "CMAKE_Fortran_COMPILER full path: " ${CMAKE_Fortran_COMPILER})
message (STATUS "CMAKE_Fortran_FLAGS: " ${CMAKE_Fortran_FLAGS})
message (STATUS "CMAKE_Fortran_FLAGS_RELEASE: " ${CMAKE_Fortran_FLAGS_RELEASE})

#################################################################
# ADD SOURCE SUBDIRS
#################################################################

SET(LIBRARY_SOURCE_PATH ${CMAKE_SOURCE_DIR}/src/lib)
SET(APP_SOURCE_PATH ${CMAKE_SOURCE_DIR}/src/app)

message(STATUS "Library source path " ${LIBRARY_SOURCE_PATH})
message(STATUS "Application source path " ${APP_SOURCE_PATH})

ADD_SUBDIRECTORY(${LIBRARY_SOURCE_PATH})
ADD_SUBDIRECTORY(${APP_SOURCE_PATH})
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
20 changes: 11 additions & 9 deletions Software/DomainDecompositionConsolidation/ModuleDDC.F90
Original file line number Diff line number Diff line change
Expand Up @@ -307,30 +307,32 @@ end function ModelLevel

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

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

!<@cond scan
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.)
!position = scan(AuxString, "/", back = .true.)
if (position == 0) then
!position = scan(AuxString, "\", back = .true.)
endif
if (position == 0) then
ModelPath = "../res"
else
ModelPath = AuxString(Level+1:position)//"res"
endif

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

end function ModelPath

!<@endcond

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

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.
!----------------------------------------------------------------------------------------------------------


2 changes: 1 addition & 1 deletion Software/MOHIDBase1/ModuleSedimentQuality.F90
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ subroutine ConstructAsciiOutPut
Number = ' '
write(Number, fmt='(i4)')Counter
open(UNIT = Me%Files%AsciiUnit, &
FILE = '..\res\SQ_Situation_'//trim(adjustl(Number))//'.log', &
FILE = '..'//backslash//'res'//backslash//'SQ_Situation_'//trim(adjustl(Number))//'.log', &
STATUS = "REPLACE", &
IOSTAT = STAT_CALL)
if (STAT_CALL == SUCCESS_) then
Expand Down
38 changes: 19 additions & 19 deletions Software/MOHIDBase2/ModuleHorizontalGrid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4778,15 +4778,15 @@ end subroutine DefinesBorderPoly

!***********************************************************************
! *
! Esta subroutina calcula 2 vectores e um escalar para a convers�o *
! de coordenadas geod�sicas em UTM: *
! Esta subroutina calcula 2 vectores e um escalar para a conversão *
! de coordenadas geodésicas em UTM: *
! *
! comprimento do fuso: DLZONE(I) *
! n� do fuso: IZONE1(J) *
! n� do fuso de origem: IZONE_ORIG *
! do fuso: IZONE1(J) *
! do fuso de origem: IZONE_ORIG *
! *
! O meridiano de Greenwich est� no fuso 31. Considera-se como origem *
! o �nicio do 1� fuso da malha. Cada fuso tem 6 graus e h� 60 fusos. *
! O meridiano de Greenwich está no fuso 31. Considera-se como origem *
! o ínicio do fuso da malha. Cada fuso tem 6 graus e 60 fusos. *
! *
! *
! AIRES: 30/6/1977 *
Expand Down Expand Up @@ -8127,7 +8127,7 @@ subroutine Add_MPI_ID_2_Filename(HorizontalGridID, FileName, STAT)
iFN = len_trim(Filename)
ipath = 0
do i = iFN, 1, -1
if (Filename(i:i) == '/' .or. Filename(i:i) == "\") then
if (Filename(i:i) == '/' .or. Filename(i:i) == backslash) then
ipath = i
exit
endif
Expand Down Expand Up @@ -8315,7 +8315,7 @@ subroutine GetHorizontalGrid(HorizontalGridID, XX_IE, YY_IE, XX_Z, YY_Z,
real, dimension(: ), pointer, optional :: XX_Z, YY_Z, XX_U, YY_U, XX_V, YY_V, XX_Cross, YY_Cross
real, dimension(:, :), pointer, optional :: DXX, DYY, DZX, DZY
real, dimension(:, :), pointer, optional :: DUX, DUY, DVX, DVY
integer, dimension(:, :), pointer, optional :: IV, JV !Jo�o Sobrinho
integer, dimension(:, :), pointer, optional :: IV, JV !João Sobrinho
real, dimension(: ), pointer, optional :: XX, YY
integer, optional, intent(OUT) :: STAT

Expand Down Expand Up @@ -12742,13 +12742,13 @@ subroutine WriteHorizontalGrid (HorizontalGridID, ObjHDF5, OutputNumber, WorkSiz
STAT = STAT_CALL)
if (STAT_CALL /= SUCCESS_) stop 'WriteHorizontalGrid - HorizontalGrid - ERR04'

call HDF5WriteData (ObjHDF5, "/Grid/Longitude", "Longitude", "", &
call HDF5WriteData (ObjHDF5, "/Grid/Longitude", "Longitude", "º", &
Array2D = Me%LongitudeConn, &
OutputNumber = OutputNumber, &
STAT = STAT_CALL)
if (STAT_CALL /= SUCCESS_) stop 'WriteHorizontalGrid - HorizontalGrid - ERR05'

call HDF5WriteData (ObjHDF5, "/Grid/Latitude", "Latitude", "", &
call HDF5WriteData (ObjHDF5, "/Grid/Latitude", "Latitude", "º", &
Array2D = Me%LatitudeConn, &
OutputNumber = OutputNumber, &
STAT = STAT_CALL)
Expand Down Expand Up @@ -12777,12 +12777,12 @@ subroutine WriteHorizontalGrid (HorizontalGridID, ObjHDF5, OutputNumber, WorkSiz
STAT = STAT_CALL)
if (STAT_CALL /= SUCCESS_) stop 'WriteHorizontalGrid - HorizontalGrid - ERR04'

call HDF5WriteData (ObjHDF5, "/Grid", "Longitude", "", &
call HDF5WriteData (ObjHDF5, "/Grid", "Longitude", "º", &
Array2D = Me%LongitudeConn, &
STAT = STAT_CALL)
if (STAT_CALL /= SUCCESS_) stop 'WriteHorizontalGrid - HorizontalGrid - ERR05'

call HDF5WriteData (ObjHDF5, "/Grid", "Latitude", "", &
call HDF5WriteData (ObjHDF5, "/Grid", "Latitude", "º", &
Array2D = Me%LatitudeConn, &
STAT = STAT_CALL)
if (STAT_CALL /= SUCCESS_) stop 'WriteHorizontalGrid - HorizontalGrid - ERR06'
Expand Down Expand Up @@ -12916,7 +12916,7 @@ subroutine WriteHorizontalGrid (HorizontalGridID, ObjHDF5, OutputNumber, WorkSiz

if (STAT_CALL /= SUCCESS_) then
!linux path
AuxFile = trim(adjustl(Me%DDecomp%ModelPath))//"\"//trim(adjustl(Me%DDecomp%FilesListName))
AuxFile = trim(adjustl(Me%DDecomp%ModelPath))//backslash//trim(adjustl(Me%DDecomp%FilesListName))

open(file = AuxFile, &
unit = Me%DDecomp%FilesListID, &
Expand All @@ -12938,7 +12938,7 @@ subroutine WriteHorizontalGrid (HorizontalGridID, ObjHDF5, OutputNumber, WorkSiz
iFile = 1
ilen = len_trim(FileName)
do i = ilen,1,-1
if (FileName(i:i) == '/' .or. FileName(i:i) == "\") then
if (FileName(i:i) == '/' .or. FileName(i:i) == backslash) then
iFile = i+1
exit
endif
Expand Down Expand Up @@ -13034,7 +13034,7 @@ subroutine WriteHorizontalGrid_UV (HorizontalGridID, ObjHDF5, WorkSize, STAT)
Aux2D(WorkIUB+2 , WorkJLB:WorkJUB+1) = Me%LongitudeConn(WorkIUB+1 , WorkJLB:WorkJUB+1)
Aux2D(WorkILB:WorkIUB+2, WorkJUB+2) = Aux2D (WorkILB:WorkIUB+2, WorkJUB+1)

call HDF5WriteData (ObjHDF5, "/Grid", "Longitude", "", &
call HDF5WriteData (ObjHDF5, "/Grid", "Longitude", "º", &
Array2D = Aux2D, &
STAT = STAT_CALL)
if (STAT_CALL /= SUCCESS_) stop 'WriteHorizontalGrid_UV - HorizontalGrid - ERR40'
Expand All @@ -13043,7 +13043,7 @@ subroutine WriteHorizontalGrid_UV (HorizontalGridID, ObjHDF5, WorkSize, STAT)
Aux2D(WorkIUB+2 , WorkJLB:WorkJUB+1) = Me%LatitudeConn(WorkIUB+1 , WorkJLB:WorkJUB+1)
Aux2D(WorkILB:WorkIUB+2, WorkJUB+2) = Aux2D (WorkILB:WorkIUB+2, WorkJUB+1)

call HDF5WriteData (ObjHDF5, "/Grid", "Latitude", "", &
call HDF5WriteData (ObjHDF5, "/Grid", "Latitude", "º", &
Array2D = Aux2D, &
STAT = STAT_CALL)
if (STAT_CALL /= SUCCESS_) stop 'WriteHorizontalGrid_UV - HorizontalGrid - ERR50'
Expand Down Expand Up @@ -13140,7 +13140,7 @@ subroutine WriteHorizontalGrid_UV (HorizontalGridID, ObjHDF5, WorkSize, STAT)

if (STAT_CALL /= SUCCESS_) then
!linux path
AuxFile = trim(adjustl(Me%DDecomp%ModelPath))//"\"//trim(adjustl(Me%DDecomp%FilesListName))
AuxFile = trim(adjustl(Me%DDecomp%ModelPath))//backslash//trim(adjustl(Me%DDecomp%FilesListName))

open(file = AuxFile, &
unit = Me%DDecomp%FilesListID, &
Expand All @@ -13162,7 +13162,7 @@ subroutine WriteHorizontalGrid_UV (HorizontalGridID, ObjHDF5, WorkSize, STAT)
iFile = 1
ilen = len_trim(FileName)
do i = ilen,1,-1
if (FileName(i:i) == '/' .or. FileName(i:i) == "\") then
if (FileName(i:i) == '/' .or. FileName(i:i) == backslash) then
iFile = i+1
exit
endif
Expand Down Expand Up @@ -17565,7 +17565,7 @@ end module ModuleHorizontalGrid

!----------------------------------------------------------------------------------------------------------
!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/MOHIDLand/ModulePorousMedia.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2262,7 +2262,7 @@ subroutine ConstructAsciiOutPut
Number = ' '
write(Number, fmt='(i4)')Counter
open(UNIT = Me%Files%AsciiUnit, &
! FILE = '..\res\iter.soi_'//trim(adjustl(Number))//'.log', &
! FILE = '..'//backslash//'res'//backslash//'iter.soi_'//trim(adjustl(Number))//'.log', &
FILE = Me%Files%ASCFile, &
STATUS = "REPLACE", &
IOSTAT = STAT_CALL)
Expand Down
Loading

0 comments on commit 9fc345e

Please sign in to comment.