From cd501cee84f3e3777117252741b83b5b7657aa16 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Wed, 24 Feb 2021 17:26:37 -0700 Subject: [PATCH 1/2] CMake: add versions to FindMatlab.cmake --- cmake/FindMatlab.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/FindMatlab.cmake b/cmake/FindMatlab.cmake index 3180b470f4..c50878ef53 100644 --- a/cmake/FindMatlab.cmake +++ b/cmake/FindMatlab.cmake @@ -233,6 +233,11 @@ if(NOT MATLAB_ADDITIONAL_VERSIONS) endif() set(MATLAB_VERSIONS_MAPPING + "R2020b=9.9" + "R2020a=9.8" + "R2019b=9.7" + "R2019a=9.6" + "R2018b=9.5" "R2018a=9.4" "R2017b=9.3" "R2017a=9.2" @@ -1712,4 +1717,4 @@ if(Matlab_INCLUDE_DIRS AND Matlab_LIBRARIES) Matlab_MEXEXTENSIONS_PROG Matlab_MEX_EXTENSION ) -endif() \ No newline at end of file +endif() From ef0028deb7435d81dccb9ff5662f6c10f8e27687 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Wed, 24 Feb 2021 17:55:10 -0700 Subject: [PATCH 2/2] [BugFix] Issues with SysMatlab*f90 files The Set_IEEE_Routines did not get updated to the correct interface --- .../nwtc-library/src/SysMatlabLinuxGnu.f90 | 17 +++++++---- .../nwtc-library/src/SysMatlabLinuxIntel.f90 | 10 +++++-- modules/nwtc-library/src/SysMatlabWindows.f90 | 30 ------------------- 3 files changed, 20 insertions(+), 37 deletions(-) diff --git a/modules/nwtc-library/src/SysMatlabLinuxGnu.f90 b/modules/nwtc-library/src/SysMatlabLinuxGnu.f90 index 7c2931c26a..f948f6cd3e 100644 --- a/modules/nwtc-library/src/SysMatlabLinuxGnu.f90 +++ b/modules/nwtc-library/src/SysMatlabLinuxGnu.f90 @@ -291,7 +291,7 @@ SUBROUTINE ProgExit ( StatCode ) END SUBROUTINE ProgExit ! ( StatCode ) !======================================================================= -SUBROUTINE Set_IEEE_Constants( NaN_D, Inf_D, NaN, Inf ) +SUBROUTINE Set_IEEE_Constants( NaN_D, Inf_D, NaN, Inf, NaN_S, Inf_S ) ! routine that sets the values of NaN_D, Inf_D, NaN, Inf (IEEE ! values for not-a-number and infinity in sindle and double @@ -302,30 +302,37 @@ SUBROUTINE Set_IEEE_Constants( NaN_D, Inf_D, NaN, Inf ) REAL(DbKi), INTENT(inout) :: Inf_D ! IEEE value for NaN (not-a-number) in double precision REAL(DbKi), INTENT(inout) :: NaN_D ! IEEE value for Inf (infinity) in double precision + REAL(ReKi), INTENT(inout) :: Inf ! IEEE value for NaN (not-a-number) REAL(ReKi), INTENT(inout) :: NaN ! IEEE value for Inf (infinity) - ! local variables for getting values of NaN and Inf (not necessary when using ieee_arithmetic) - REAL(DbKi) :: Neg_D ! a negative real(DbKi) number - REAL(ReKi) :: Neg ! a negative real(ReKi) number + REAL(SiKi), INTENT(inout) :: Inf_S ! IEEE value for NaN (not-a-number) in single precision + REAL(SiKi), INTENT(inout) :: NaN_S ! IEEE value for Inf (infinity) in single precision + + real(DbKi) :: Neg_D + real(SiKi) :: Neg_S + real(ReKi) :: Neg - ! if compiling with floating-point-exception traps, this will not work, so we've added a compiler directive. ! note that anything that refers to NaN or Inf will be incorrect in that case. #ifndef FPE_TRAP_ENABLED ! set variables to negative numbers to calculate NaNs (compilers may complain when taking sqrt of negative constants) Neg_D = -1.0_DbKi + Neg_S = -1.0_SiKi Neg = -1.0_ReKi NaN_D = SQRT ( Neg_D ) + NaN_S = SQRT ( Neg_S ) NaN = SQRT ( Neg ) ! set variables to zero to calculate Infs (using division by zero) Neg_D = 0.0_DbKi + Neg_S = 0.0_SiKi Neg = 0.0_ReKi Inf_D = 1.0_DbKi / Neg_D + Inf_S = 1.0_SiKi / Neg_S Inf = 1.0_ReKi / Neg #endif diff --git a/modules/nwtc-library/src/SysMatlabLinuxIntel.f90 b/modules/nwtc-library/src/SysMatlabLinuxIntel.f90 index cb66012814..6935a9ffaa 100644 --- a/modules/nwtc-library/src/SysMatlabLinuxIntel.f90 +++ b/modules/nwtc-library/src/SysMatlabLinuxIntel.f90 @@ -297,8 +297,8 @@ SUBROUTINE ProgExit ( StatCode ) END SUBROUTINE ProgExit ! ( StatCode ) !======================================================================= -SUBROUTINE Set_IEEE_Constants( NaN_D, Inf_D, NaN, Inf ) - +SUBROUTINE Set_IEEE_Constants( NaN_D, Inf_D, NaN, Inf, NaN_S, Inf_S ) + ! routine that sets the values of NaN_D, Inf_D, NaN, Inf (IEEE ! values for not-a-number and infinity in sindle and double ! precision) This uses standard F03 intrinsic routines, @@ -313,6 +313,9 @@ SUBROUTINE Set_IEEE_Constants( NaN_D, Inf_D, NaN, Inf ) REAL(ReKi), INTENT(inout) :: Inf ! IEEE value for NaN (not-a-number) REAL(ReKi), INTENT(inout) :: NaN ! IEEE value for Inf (infinity) + REAL(SiKi), INTENT(inout) :: Inf_S ! IEEE value for NaN (not-a-number) in single precision + REAL(SiKi), INTENT(inout) :: NaN_S ! IEEE value for Inf (infinity) in single precision + NaN_D = ieee_value(0.0_DbKi, ieee_quiet_nan) Inf_D = ieee_value(0.0_DbKi, ieee_positive_inf) @@ -320,6 +323,9 @@ SUBROUTINE Set_IEEE_Constants( NaN_D, Inf_D, NaN, Inf ) NaN = ieee_value(0.0_ReKi, ieee_quiet_nan) Inf = ieee_value(0.0_ReKi, ieee_positive_inf) + NaN_S = ieee_value(0.0_SiKi, ieee_quiet_nan) + Inf_S = ieee_value(0.0_SiKi, ieee_positive_inf) + END SUBROUTINE Set_IEEE_Constants !======================================================================= SUBROUTINE UsrAlarm diff --git a/modules/nwtc-library/src/SysMatlabWindows.f90 b/modules/nwtc-library/src/SysMatlabWindows.f90 index 8e73364b73..004a72ef30 100644 --- a/modules/nwtc-library/src/SysMatlabWindows.f90 +++ b/modules/nwtc-library/src/SysMatlabWindows.f90 @@ -27,30 +27,6 @@ MODULE SysSubs -<<<<<<< HEAD:modules/nwtc-library/src/SysMatlab.f90 - ! It contains the following routines: - - ! FUNCTION FileSize( Unit ) ! Returns the size (in bytes) of an open file. - ! SUBROUTINE FlushOut ( Unit ) - ! FUNCTION NWTC_ERF( x ) - ! FUNCTION NWTC_gamma( x ) - ! SUBROUTINE GET_CWD( DirName, Status ) - ! FUNCTION Is_NaN( DblNum ) ! Please use IEEE_IS_NAN() instead - ! FUNCTION NWTC_Gamma( x ) ! Returns the gamma value of its argument. - ! per MLB, this can be removed, but only if CU is OUTPUT_UNIT: - ! SUBROUTINE OpenCon ! Actually, it can't be removed until we get Intel's FLUSH working. (mlb) - ! SUBROUTINE OpenUnfInpBEFile ( Un, InFile, RecLen, Error ) - ! SUBROUTINE ProgExit ( StatCode ) - ! SUBROUTINE Set_IEEE_Constants( NaN_D, Inf_D, NaN, Inf, NaN_S, Inf_S ) - ! SUBROUTINE UsrAlarm - ! SUBROUTINE WrNR ( Str ) - ! SUBROUTINE WrOver ( Str ) - ! SUBROUTINE WriteScr ( Str, Frm ) - ! SUBROUTINE LoadDynamicLib( DLL, ErrStat, ErrMsg ) - ! SUBROUTINE FreeDynamicLib( DLL, ErrStat, ErrMsg ) - -======= ->>>>>>> upstream/master:modules/nwtc-library/src/SysMatlabWindows.f90 USE NWTC_Base @@ -363,12 +339,6 @@ SUBROUTINE Set_IEEE_Constants( NaN_D, Inf_D, NaN, Inf, NaN_S, Inf_S ) NaN_S = ieee_value(0.0_SiKi, ieee_quiet_nan) Inf_S = ieee_value(0.0_SiKi, ieee_positive_inf) - - NaN_D = ieee_value(0.0_DbKi, ieee_quiet_nan) - Inf_D = ieee_value(0.0_DbKi, ieee_positive_inf) - - NaN = ieee_value(0.0_ReKi, ieee_quiet_nan) - Inf = ieee_value(0.0_ReKi, ieee_positive_inf) END SUBROUTINE Set_IEEE_Constants !=======================================================================