Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated query of git version string, Updated vs-build contents #45

Merged
16 commits merged into from
Sep 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ build/**/*
install/*
ctest-build/*

vs-build
# vs-build specific folders and files
vs-build/*


build
.DS_Store
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
include(GetGitRevisionDescription)
git_describe(GIT_DESCRIBE)
add_definitions(-DGIT_COMMIT_HASH="${GIT_DESCRIBE}")
add_definitions(-DGIT_VERSION_INFO="${GIT_DESCRIBE}")

# CMake Configuration variables
if (NOT CMAKE_BUILD_TYPE)
Expand Down
1 change: 0 additions & 1 deletion modules-ext/icefloe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ generate_f90_types(src/interfaces/FAST/IceFloe_FASTRegistry.inp


set(ICEFLOE_LIBS_SOURCES
src/ranlux/RANLUX.f90

src/icefloe/IceFlexBase.F90
src/icefloe/IceFlexIEC.f90
Expand Down
2 changes: 1 addition & 1 deletion modules-ext/icefloe/src/icefloe/intermittentCrushing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ subroutine initInterCrushing (iceInput, myIceParams, iceLog)
call getIceInput(iceInput, 'riseTime', inParams%riseTime, iceLog, 0.1_ReKi, 0.9_ReKi)
call logMessage(iceLog, ' Saw tooth rise time fraction = '//TRIM(Num2LStr(inParams%riseTime)))

call getIceInput(iceInput, 'fallTime', inParams%fallTime, iceLog, 0.1_ReKi, 1.0-inParams%riseTime)
call getIceInput(iceInput, 'fallTime', inParams%fallTime, iceLog, 0.1_ReKi, 1.0_ReKi-inParams%riseTime)
call logMessage(iceLog, ' Saw tooth fall time fraction = '//TRIM(Num2LStr(inParams%fallTime)))

! get leg load phase
Expand Down
2 changes: 1 addition & 1 deletion modules-ext/icefloe/src/icefloe/lockInISO.F90
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ subroutine initLockInCrushingISO (iceInput, myIceParams, iceLog)
call logMessage(iceLog, '** Global crushing load is: '//TRIM(Num2LStr(maxLoad))//' Newtons.' )

call crushLoadTimeSeriesISO(myIceParams, inParams, iceLog, maxLoad, inParams%minLoadFraction*maxLoad, &
1.0/inParams%twr%freq, inParams%riseTime, fallTime)
1.0_ReKi/inParams%twr%freq, inParams%riseTime, fallTime)

end subroutine initLockInCrushingISO

Expand Down
4 changes: 2 additions & 2 deletions modules-ext/moordyn/src/MoorDyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1242,9 +1242,9 @@ SUBROUTINE TimeStep ( t, dtStep, u, utimes, p, x, xd, z, other, m, ErrStat, ErrM

! step 2

CALL MD_Input_ExtrapInterp(u, utimes, u_interp, tDbKi + 0.5*dtM, ErrStat, ErrMsg) ! interpolate input mesh to correct time (t+0.5*dtM)
CALL MD_Input_ExtrapInterp(u, utimes, u_interp, tDbKi + 0.5_ReKi*dtM, ErrStat, ErrMsg) ! interpolate input mesh to correct time (t+0.5*dtM)

CALL MD_CalcContStateDeriv( (t + 0.5*dtM), u_interp, p, x2, xd, z, other, m, dxdt, ErrStat, ErrMsg ) !called with updated states x2 and time = t + dt/2.0
CALL MD_CalcContStateDeriv( (t + 0.5_ReKi*dtM), u_interp, p, x2, xd, z, other, m, dxdt, ErrStat, ErrMsg ) !called with updated states x2 and time = t + dt/2.0
DO J = 1, Nx
x%states(J) = x%states(J) + dtM*dxdt%states(J)
END DO
Expand Down
15 changes: 9 additions & 6 deletions modules-local/aerodyn/src/AeroDyn_Driver_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,23 @@ subroutine Dvr_Init(DvrData,errStat,errMsg )
character(*), parameter :: RoutineName = 'Dvr_Init'

CHARACTER(1000) :: inputFile ! String to hold the file name.
CHARACTER(200) :: git_commit ! String containing the current git commit hash

TYPE(ProgDesc), PARAMETER :: version = ProgDesc( 'AeroDyn Driver', '', '' ) ! The version number of this program.

ErrStat = ErrID_None
ErrMsg = ""


DvrData%OutFileData%unOutFile = -1

! Initialize the library which handle file echos and WrScr, for example
call NWTC_Init()

CALL NWTC_Init()
! Display the copyright notice
CALL DispCopyrightLicense( version )

CALL DispCopyrightLicense( version )
! Obtain OpenFAST git commit hash
git_commit = QueryGitVersion()
! Tell our users what they're running
CALL WrScr( ' Running '//GetNVD( version )//NewLine//' linked with '//TRIM( GetNVD( NWTC_Ver ))//NewLine )
CALL WrScr( ' Running '//GetNVD( version )//' a part of OpenFAST - '//TRIM(git_Commit)//NewLine//' linked with '//TRIM( GetNVD( NWTC_Ver ))//NewLine )

InputFile = "" ! initialize to empty string to make sure it's input from the command line
CALL CheckArgs( InputFile, ErrStat2 )
Expand Down
14 changes: 11 additions & 3 deletions modules-local/aerodyn/src/UnsteadyAero_Driver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ program UnsteadyAero_Driver
real(DbKi), allocatable :: timeArr(:)
real(ReKi), allocatable :: AOAarr(:)
real(ReKi), allocatable :: Uarr(:) !RRD

CHARACTER(200) :: git_commit
TYPE(ProgDesc), PARAMETER :: version = ProgDesc( 'UnsteadyAero Driver', '', '' ) ! The version number of this program.
! Initialize the NWTC library
call NWTC_Init()

Expand All @@ -81,8 +82,15 @@ program UnsteadyAero_Driver
ErrStat = ErrID_None

RoutineName = 'UnsteadyAero_Driver'

print *, 'Running UnsteadyAero_Driver'


! Display the copyright notice
CALL DispCopyrightLicense( version )
! Obtain OpenFAST git commit hash
git_commit = QueryGitVersion()
! Tell our users what they're running
CALL WrScr( ' Running '//GetNVD( version )//' a part of OpenFAST - '//TRIM(git_Commit)//NewLine//' linked with '//TRIM( GetNVD( NWTC_Ver ))//NewLine )




Expand Down
2 changes: 1 addition & 1 deletion modules-local/aerodyn14/src/AeroSubs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2564,7 +2564,7 @@ SUBROUTINE GetTwrSectProp ( P, m, ErrStat, ErrMess, &

ELSE ! There are multiple Re rows

TwrElRe = GetReynolds( VelHor, 2.0*TwrElRad, P%Wind%KinVisc )
TwrElRe = GetReynolds( VelHor, 2.0_ReKi*TwrElRad, P%Wind%KinVisc )

IF ( p%TwrProps%NTwrCD == 1 ) THEN ! There is only one CD column
TwrElCD = InterpBin( TwrElRe, p%TwrProps%TwrRe, p%TwrProps%TwrCD(:,1), N1, p%TwrProps%NTwrRe )
Expand Down
31 changes: 15 additions & 16 deletions modules-local/beamdyn/src/Driver_Beam.f90
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,21 @@ PROGRAM BeamDyn_Driver_Program

TYPE(BD_DriverInternalType) :: DvrData

CHARACTER(256) :: DvrInputFile
CHARACTER(256) :: RootName


! local variables
Integer(IntKi) :: j ! counter for various loops
Integer(IntKi) :: i ! counter for various loops

REAL(DbKi) :: TiLstPrn !< The simulation time of the last print (to file) [(s)]
REAL(ReKi) :: PrevClockTime !< Clock time at start of simulation in seconds [(s)]
REAL(ReKi) :: UsrTime1 !< User CPU time for simulation initialization [(s)]
REAL(ReKi) :: UsrTime2 !< User CPU time for simulation (without intialization) [(s)]
INTEGER(IntKi) , DIMENSION(1:8) :: StrtTime !< Start time of simulation (including intialization) [-]
INTEGER(IntKi) , DIMENSION(1:8) :: SimStrtTime !< Start time of simulation (after initialization) [-]

CHARACTER(256) :: DvrInputFile
CHARACTER(256) :: RootName
INTEGER(IntKi) :: j ! counter for various loops
INTEGER(IntKi) :: i ! counter for various loops
REAL(DbKi) :: TiLstPrn ! The simulation time of the last print (to file) [(s)]
REAL(ReKi) :: PrevClockTime ! Clock time at start of simulation in seconds [(s)]
REAL(ReKi) :: UsrTime1 ! User CPU time for simulation initialization [(s)]
REAL(ReKi) :: UsrTime2 ! User CPU time for simulation (without intialization) [(s)]
INTEGER(IntKi) , DIMENSION(1:8) :: StrtTime ! Start time of simulation (including intialization) [-]
INTEGER(IntKi) , DIMENSION(1:8) :: SimStrtTime ! Start time of simulation (after initialization) [-]
CHARACTER(200) :: git_commit ! String containing the current git commit hash


TYPE(ProgDesc), PARAMETER :: version = ProgDesc( 'BeamDyn Driver', '', '' ) ! The version number of this program.
TYPE(ProgDesc), PARAMETER :: version = ProgDesc( 'BeamDyn Driver', '', '' ) ! The version number of this program.


! -------------------------------------------------------------------------
Expand All @@ -83,8 +80,10 @@ PROGRAM BeamDyn_Driver_Program
CALL NWTC_Init()
! Display the copyright notice
CALL DispCopyrightLicense( version )
! Obtain OpenFAST git commit hash
git_commit = QueryGitVersion()
! Tell our users what they're running
CALL WrScr( ' Running '//GetNVD( version )//NewLine//' linked with '//TRIM( GetNVD( NWTC_Ver ))//NewLine )
CALL WrScr( ' Running '//GetNVD( version )//' a part of OpenFAST - '//TRIM(git_Commit)//NewLine//' linked with '//TRIM( GetNVD( NWTC_Ver ))//NewLine )

! -------------------------------------------------------------------------
! Initialization of glue-code time-step variables
Expand Down
30 changes: 7 additions & 23 deletions modules-local/fast-library/src/FAST_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,9 @@ FUNCTION GetVersion(ThisProgVer)

TYPE(ProgDesc), INTENT( IN ) :: ThisProgVer !< program name/date/version description
CHARACTER(1024) :: GetVersion !< String containing a description of the compiled precision.


CHARACTER(200) :: git_commit

GetVersion = TRIM(GetNVD(ThisProgVer))//', compiled'

IF ( Cmpl4SFun ) THEN ! FAST has been compiled as an S-Function for Simulink
Expand All @@ -1299,22 +1301,14 @@ FUNCTION GetVersion(ThisProgVer)
ELSE ! Unknown precision
GetVersion = TRIM(GetVersion)//' unknown'
ENDIF


! GetVersion = TRIM(GetVersion)//' precision with '//OS_Desc
GetVersion = TRIM(GetVersion)//' precision'

! add git info
#ifdef GIT_COMMIT_HASH
GetVersion = TRIM(GetVersion)//' at commit '//GIT_COMMIT_HASH
#endif
#ifdef GIT_HASH_FILE
! VS build method for obtaining the git hash info.
! This requires setting:
! 1) GIT_HASH_FILE = '$(ProjectDir)\gitHash.txt' preprocessor opetion on this file.
! 2) Creating a prebuild event on the profile file which runs this command: ..\GetGitHash.bat
! 3) The bat file, GetGitHash.bat, located in the vs-build folder of the openfast repository, which contains the git command used to obtain the git info
GetVersion = TRIM(GetVersion)//' at commit '//ReadGitHash(GIT_HASH_FILE, errStat, errMsg)
#endif
git_commit = QueryGitVersion()
GetVersion = TRIM(GetVersion)//' at commit '//git_commit

RETURN
END FUNCTION GetVersion
Expand All @@ -1330,17 +1324,7 @@ subroutine GetProgramMetadata(ThisProgVer, name, version, git_commit, architectu
name = trim(ThisProgVer%Name)
version = trim(ThisProgVer%Ver)

#ifdef GIT_COMMIT_HASH
git_commit = GIT_COMMIT_HASH
#endif
#ifdef GIT_HASH_FILE
! VS build method for obtaining the git hash info.
! This requires setting:
! 1) GIT_HASH_FILE = '$(ProjectDir)\gitHash.txt' preprocessor opetion on this file.
! 2) Creating a prebuild event on the profile file which runs this command: ..\GetGitHash.bat
! 3) The bat file, GetGitHash.bat, located in the vs-build folder of the openfast repository, which contains the git command used to obtain the git info
git_commit = ReadGitHash(GIT_HASH_FILE, errStat, errMsg)
#endif
git_commit = QueryGitVersion()

architecture = TRIM(Num2LStr(BITS_IN_ADDR))//' bit'

Expand Down
16 changes: 14 additions & 2 deletions modules-local/hydrodyn/src/HydroDyn_DriverCode.f90
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ PROGRAM HydroDynDriver
CHARACTER(10) :: AngleMsg ! For debugging, a string version of the largest rotation input
INTEGER :: UnMeshDebug
CHARACTER(50) :: MeshDebugFile

CHARACTER(200) :: git_commit ! String containing the current git commit hash

TYPE(ProgDesc), PARAMETER :: version = ProgDesc( 'HydroDyn Driver', '', '' ) ! The version number of this program.

!...............................................................................................................................
! Routines called in initialization
!...............................................................................................................................
Expand All @@ -147,8 +152,14 @@ PROGRAM HydroDynDriver
! Initialize the library which handle file echos and WrScr, for example
call nwtc_init()


IF ( command_argument_count() > 1 ) THEN
! Display the copyright notice
CALL DispCopyrightLicense( version )
! Obtain OpenFAST git commit hash
git_commit = QueryGitVersion()
! Tell our users what they're running
CALL WrScr( ' Running '//GetNVD( version )//' a part of OpenFAST - '//TRIM(git_Commit)//NewLine//' linked with '//TRIM( GetNVD( NWTC_Ver ))//NewLine )

IF ( command_argument_count() /= 1 ) THEN
CALL print_help()
STOP
END IF
Expand All @@ -175,6 +186,7 @@ PROGRAM HydroDynDriver
call date_and_time ( Values=StrtTime ) ! Let's time the whole simulation
call cpu_time ( UsrTime1 ) ! Initial time (this zeros the start time when used as a MATLAB function)
SttsTime = 1.0 ! seconds

! figure out how many time steps we should go before writing screen output:
n_SttsTime = MAX( 1, NINT( SttsTime / drvrInitInp%TimeInterval ) ) ! this may not be the final TimeInterval, though!!! GJH 8/14/14

Expand Down
3 changes: 3 additions & 0 deletions modules-local/nwtc-library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ set(NWTCLIBS_SOURCES
src/SingPrec.f90
src/NWTC_Library_Types.f90

# RanLux sources
src/ranlux/RANLUX.f90

# NetLib sources
src/NetLib/Dierckx_FitPack/dierckx_fitpack.f
src/NetLib/fftpack/fftpack4.1.f
Expand Down
50 changes: 50 additions & 0 deletions modules-local/nwtc-library/src/NWTC_IO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4416,6 +4416,56 @@ SUBROUTINE ProgWarn ( Message )

RETURN
END SUBROUTINE ProgWarn

!=======================================================================
!> This routine outputs the git hash associate with the current codebase.
FUNCTION QueryGitVersion()

! Passed variables.

!INTEGER(IntKi), INTENT(OUT) :: ErrStat ! Error status
!CHARACTER(*), INTENT(OUT) :: ErrMsg ! Error message

! Function declaration.

CHARACTER(200) :: QueryGitVersion ! This function.

! Local variables.

INTEGER(IntKi) :: UnIn ! Unit number for reading file
INTEGER(IntKi) :: ErrStat2 ! Temporary Error status
CHARACTER(ErrMsgLen) :: ErrMsg2 ! Temporary Error message

!ErrStat = ErrID_None
!ErrMsg = ''

QueryGitVersion = 'unversioned'

! VS build method for obtaining the git version info.
! This requires setting:
! 1) GIT_INCLUDE_FILE = '$(ProjectDir)\..\gitVersionInfo.h' preprocessor option on this file or the project containing this file.
! 2) Creating a prebuild event on the project file producing the resulting binary (i.e., FAST.exe) with the following command: ..\CreateGitVersion.bat
! 3) The bat file, CreateGitVersion.bat, located in the vs-build folder of the openfast repository, which contains the git command used to obtain the git info
! @ECHO off
! SET IncludeFile=..\gitVersionInfo.h
!
! <NUL SET /p IncludeTxt=#define GIT_VERSION_INFO '> %IncludeFile%
! FOR /f %%a IN ('git describe --abbrev^=7 --always --tags --dirty') DO <NUL SET /p IncludeTxt=%%a>> %IncludeFile%
! ECHO '>> %IncludeFile%
! EXIT /B 0
! This creates the gitVersionInfo.h file in the vs-build folder

#ifdef GIT_INCLUDE_FILE
#include GIT_INCLUDE_FILE
#endif

#ifdef GIT_VERSION_INFO
QueryGitVersion = GIT_VERSION_INFO
#endif

RETURN
END FUNCTION QueryGitVersion

!=======================================================================
!> \copydoc nwtc_io::int2lstr
FUNCTION R2LStr4 ( Num )
Expand Down
2 changes: 1 addition & 1 deletion modules-local/subdyn/src/SubDyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3105,7 +3105,7 @@ SUBROUTINE EigenSolve(K, M, nDOF, NOmega, Reduced, Init,p, Phi, Omega, ErrStat,
CHARACTER(*), INTENT( OUT) :: ErrMsg ! Error message if ErrStat /= ErrID_None

! LOCALS
REAL(ReKi), ALLOCATABLE :: Omega2(:) !RRD: Eigen-values new system
REAL(LAKi), ALLOCATABLE :: Omega2(:) !RRD: Eigen-values new system
! note: SGGEV seems to have memory issues in certain cases. The eigenvalues seem to be okay, but the eigenvectors vary wildly with different compiling options.
! DGGEV seems to work better, so I'm making these variables LAKi (which is set to R8Ki for now) - bjj 4/25/2014
REAL(LAKi), ALLOCATABLE :: Kred(:,:), Mred(:,:)
Expand Down
Loading