diff --git a/cmake/OpenfastFortranOptions.cmake b/cmake/OpenfastFortranOptions.cmake index ad7d4ffc78..c73987d1f1 100644 --- a/cmake/OpenfastFortranOptions.cmake +++ b/cmake/OpenfastFortranOptions.cmake @@ -71,6 +71,13 @@ macro(set_fast_fortran) elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "^Intel") set_fast_intel_fortran() endif() + + # If double precision option enabled, set preprocessor define to use + # real64 for ReKi reals + if (DOUBLE_PRECISION) + add_definitions(-DOPENFAST_DOUBLE_PRECISION) + endif() + endmacro(set_fast_fortran) # @@ -113,11 +120,10 @@ macro(set_fast_gfortran) # and https://github.com/OpenFAST/openfast/pull/595 set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fstack-reuse=none") - # Deal with Double/Single precision + # If double precision, make constants double precision if (DOUBLE_PRECISION) - add_definitions(-DOPENFAST_DOUBLE_PRECISION) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8") - endif (DOUBLE_PRECISION) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fdefault-double-8") + endif() # debug flags if(CMAKE_BUILD_TYPE MATCHES Debug) @@ -156,21 +162,21 @@ endmacro(set_fast_intel_fortran) # macro(set_fast_intel_fortran_posix) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpic -fpp") - # Deal with Double/Single precision - if (DOUBLE_PRECISION) - add_definitions(-DOPENFAST_DOUBLE_PRECISION) - if("${CMAKE_Fortran_COMPILER_VERSION}" VERSION_GREATER "19") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -double-size 128") - else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -double_size 128") - endif() - endif (DOUBLE_PRECISION) # debug flags if(CMAKE_BUILD_TYPE MATCHES Debug) set( CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -check all,noarg_temp_created -traceback -init=huge,infinity" ) endif() + # If double precision, make real and double constants 64 bits + if (DOUBLE_PRECISION) + if("${CMAKE_Fortran_COMPILER_VERSION}" VERSION_GREATER "19") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -real-size 64 -double-size 64") + else() + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -real_size 64 -double_size 64") + endif() + endif() + # OPENMP if (OPENMP) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qopenmp") @@ -206,15 +212,14 @@ macro(set_fast_intel_fortran_windows) # - 5268: 132 column limit set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /Qdiag-disable:5199,5268 /fpp") - # Deal with Double/Single precision + # If double precision, make constants double precision if (DOUBLE_PRECISION) - add_definitions(-DOPENFAST_DOUBLE_PRECISION) if("${CMAKE_Fortran_COMPILER_VERSION}" VERSION_GREATER "19") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /real-size:64 /double-size:128") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /real-size:64 /double-size:64") else() - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /real_size:64 /double_size:128") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /real_size:64 /double_size:64") endif() - endif (DOUBLE_PRECISION) + endif() # increase the default 2MB stack size to 16 MB MATH(EXPR stack_size "16 * 1024 * 1024") diff --git a/docs/OtherSupporting/ElastoDyn/FASTLogicFlow.doc b/docs/OtherSupporting/ElastoDyn/FASTLogicFlow.doc index 8a7131579b..360e13d3cb 100644 Binary files a/docs/OtherSupporting/ElastoDyn/FASTLogicFlow.doc and b/docs/OtherSupporting/ElastoDyn/FASTLogicFlow.doc differ diff --git a/docs/source/testing/regression_test.rst b/docs/source/testing/regression_test.rst index bb134c501f..491fd05659 100644 --- a/docs/source/testing/regression_test.rst +++ b/docs/source/testing/regression_test.rst @@ -68,7 +68,7 @@ The following packages are required for regression testing: - Python 3.7+ - Numpy - CMake and CTest (Optional) -- Bokeh 1.4 (Optional) +- Bokeh 2.4+ (Optional) .. _python_driver: @@ -85,17 +85,15 @@ executing with the help option: >>>$ python manualRegressionTest.py -h usage: manualRegressionTest.py [-h] [-p [Plotting-Flag]] [-n [No-Execution]] - [-v [Verbose-Flag]] [-case [Case-Name]] - OpenFAST System-Name Compiler-Id Test-Tolerance + [-v [Verbose-Flag]] [-case [Case-Name]] [-module [Module-Name]] + Executable-Name Relative-Tolerance Absolute-Tolerance - Executes OpenFAST and a regression test for a single test case. + Executes OpenFAST or driver and a regression test for a single test case. positional arguments: - OpenFAST path to the OpenFAST executable - System-Name current system's name: [Darwin,Linux,Windows] - Compiler-Id compiler's id: [Intel,GNU] - Test-Tolerance tolerance defining pass or failure in the regression - test + Executable-Name path to the executable + Relative-Tolerance Relative tolerance to allow the solution to deviate; expressed as order of magnitudes less than baseline. + Absolute-Tolerance Absolute tolerance to allow small values to pass; expressed as order of magnitudes less than baseline. optional arguments: -h, --help show this help message and exit @@ -106,6 +104,8 @@ executing with the help option: -v [Verbose-Flag], -verbose [Verbose-Flag] bool to include verbose system output -case [Case-Name] single case name to execute + -module [Module-Name], -mod [Module-Name] + name of module to execute .. note:: @@ -351,17 +351,15 @@ included Python driver. cd reg_tests python manualRegressionTest.py -h # usage: manualRegressionTest.py [-h] [-p [Plotting-Flag]] [-n [No-Execution]] - # [-v [Verbose-Flag]] [-case [Case-Name]] - # OpenFAST System-Name Compiler-Id Test-Tolerance + # [-v [Verbose-Flag]] [-case [Case-Name]] [-module [Module-Name]] + # Executable-Name Relative-Tolerance Absolute-Tolerance # - # Executes OpenFAST and a regression test for a single test case. + # Executes OpenFAST or driver and a regression test for a single test case. # # positional arguments: - # OpenFAST path to the OpenFAST executable - # System-Name current system's name: [Darwin,Linux,Windows] - # Compiler-Id compiler's id: [Intel,GNU] - # Test-Tolerance tolerance defining pass or failure in the regression - # test + # Executable-Name path to the executable + # Relative-Tolerance Relative tolerance to allow the solution to deviate; expressed as order of magnitudes less than baseline. + # Absolute-Tolerance Absolute tolerance to allow small values to pass; expressed as order of magnitudes less than baseline. # # optional arguments: # -h, --help show this help message and exit @@ -372,12 +370,10 @@ included Python driver. # -v [Verbose-Flag], -verbose [Verbose-Flag] # bool to include verbose system output # -case [Case-Name] single case name to execute + # -module [Module-Name], -mod [Module-Name] + # name of module to execute - python manualRegressionTest.py \ - ..\build\bin\openfast_x64_Double.exe \ - Windows \ - Intel \ - 1e-5 + python manualRegressionTest.py ..\build\bin\openfast_x64_Double.exe 2.0 1.9 .. _reg_test_windows: diff --git a/docs/source/testing/regression_test_windows.rst b/docs/source/testing/regression_test_windows.rst index 4894e7b514..6c04bee6a5 100644 --- a/docs/source/testing/regression_test_windows.rst +++ b/docs/source/testing/regression_test_windows.rst @@ -84,7 +84,7 @@ Windows with Visual Studio regression test b) Change your working directory to ``openfast\reg_tests`` - c) Type: ``python manualRegressionTest.py ..\build\bin\openfast_x64_Double.exe Windows Intel 1e-5`` + c) Type: ``python manualRegressionTest.py ..\build\bin\openfast_x64_Double.exe 2.0 1.9`` You should see this: ``executing AWT_YFix_WSt`` d) The tests will continue to execute one-by-one until you finally see something like this: diff --git a/docs/source/user/aerodyn-olaf/OLAFTheory.rst b/docs/source/user/aerodyn-olaf/OLAFTheory.rst index 0605c32582..7bde8f6587 100644 --- a/docs/source/user/aerodyn-olaf/OLAFTheory.rst +++ b/docs/source/user/aerodyn-olaf/OLAFTheory.rst @@ -241,7 +241,7 @@ approach using the following steps: .. math:: \begin{aligned} - \Gamma_{ll,j} =\frac{1}{2} C_{l,j}(\alpha_j) \frac{\left[ (\vec{v}_j \cdot \vec{N})^2 + (\vec{v}_j \cdot \vec{T})^2\right]^2\,dA}{ + \Gamma_{ll,j} =\frac{1}{2} C_{l,j}(\alpha_j) \frac{\left[ (\vec{v}_j \cdot \vec{N})^2 + (\vec{v}_j \cdot \vec{T})^2\right]\,dA}{ \sqrt{\left[(\vec{v}_j\times \vec{dl})\cdot\vec{N}\right]^2 + \left[(\vec{v}_j\times \vec{dl})\cdot\vec{T}\right]^2} } %\label{eq:} ,\quad\text{with} @@ -278,11 +278,13 @@ approach using the following steps: No-flow-through Method ^^^^^^^^^^^^^^^^^^^^^^ -A Weissinger-L-based representation (:cite:`olaf-Weissinger47_1`) -of the lifting surface is also -available (:cite:`olaf-Bagai94_1,olaf-Gupta06_1,olaf-Ribera07_1`). In this -method, the circulation is solved by satisfying a no-flow through -condition at the 1/4-chord points. It is selected with **CircSolvMethod=[2]**. +A no-flow-through circulation solving method +(sometimes called Weissinger-L-based method) +might be implemented in the future +(:cite:`olaf-Weissinger47_1,olaf-Bagai94_1,olaf-Gupta06_1,olaf-Ribera07_1`). +In this method, the circulation is solved by satisfying a no-flow through +condition at the 1/4-chord points. +It would be selected with **CircSolvMethod=[2]** but is currently no implemented. Prescribed Circulation ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/source/user/api_change.rst b/docs/source/user/api_change.rst index 4a07c4972e..296785539d 100644 --- a/docs/source/user/api_change.rst +++ b/docs/source/user/api_change.rst @@ -9,6 +9,18 @@ The changes are tabulated according to the module input file, line number, and f The line number corresponds to the resulting line number after all changes are implemented. Thus, be sure to implement each in order so that subsequent line numbers are correct. +OpenFAST v3.4.0 to OpenFAST dev +---------------------------------- + +============================================= ==== ================= ======================================================================================================================================================================================================== +Modified in OpenFAST `dev` +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +Module Line Flag Name Example Value +============================================= ==== ================= ======================================================================================================================================================================================================== +ServoDyn-StructCtrl 6 StC_DOF_MODE 2 StC_DOF_MODE - DOF mode (switch) {0: No StC or TLCD DOF; 1: StC_X_DOF, StC_Y_DOF, and/or StC_Z_DOF (three independent StC DOFs); 2: StC_XY_DOF (Omni-Directional StC); 3: TLCD; 4: Prescribed force/moment time series; 5: Force determined by external DLL} +============================================= ==== ================= ======================================================================================================================================================================================================== + + OpenFAST v3.4.1 to OpenFAST v3.4.1 ---------------------------------- @@ -22,7 +34,7 @@ OpenFAST v3.3.0 to OpenFAST v3.4.0 ---------------------------------- ============================================= ==== ================= ======================================================================================================================================================================================================== -Added in OpenFAST `dev` +Added in OpenFAST `3.4.0` ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Module Line Flag Name Example Value ============================================= ==== ================= ======================================================================================================================================================================================================== diff --git a/docs/source/user/servodyn-stc/ExampleFiles/NRELOffshrBsline5MW_StC.dat b/docs/source/user/servodyn-stc/ExampleFiles/NRELOffshrBsline5MW_StC.dat index f504cb8d8f..9471cd7c17 100644 --- a/docs/source/user/servodyn-stc/ExampleFiles/NRELOffshrBsline5MW_StC.dat +++ b/docs/source/user/servodyn-stc/ExampleFiles/NRELOffshrBsline5MW_StC.dat @@ -3,7 +3,7 @@ Input file for tuned mass damper, module by Matt Lackner, Meghan Glade, and Semy ---------------------- SIMULATION CONTROL -------------------------------------- True Echo - Echo input data to .ech (flag) ---------------------- StC DEGREES OF FREEDOM ---------------------------------- - 2 StC_DOF_MODE - DOF mode (switch) {0: No StC or TLCD DOF; 1: StC_X_DOF, StC_Y_DOF, and/or StC_Z_DOF (three independent StC DOFs); 2: StC_XY_DOF (Omni-Directional StC); 3: TLCD; 4: Prescribed force/moment time series} + 2 StC_DOF_MODE - DOF mode (switch) {0: No StC or TLCD DOF; 1: StC_X_DOF, StC_Y_DOF, and/or StC_Z_DOF (three independent StC DOFs); 2: StC_XY_DOF (Omni-Directional StC); 3: TLCD; 4: Prescribed force/moment time series; 5: Force determined by external DLL} true StC_X_DOF - DOF on or off for StC X (flag) [Used only when StC_DOF_MODE=1] true StC_Y_DOF - DOF on or off for StC Y (flag) [Used only when StC_DOF_MODE=1] FALSE StC_Z_DOF - DOF on or off for StC Z (flag) [Used only when StC_DOF_MODE=1] diff --git a/docs/source/user/servodyn-stc/StC_input.rst b/docs/source/user/servodyn-stc/StC_input.rst index e62ed91075..c132873d09 100644 --- a/docs/source/user/servodyn-stc/StC_input.rst +++ b/docs/source/user/servodyn-stc/StC_input.rst @@ -107,7 +107,7 @@ StC Degrees of Freedom DOF mode {0: No StC or TLCD DOF; 1: StC_X_DOF, StC_Y_DOF, and/or StC_Z_DOF (three independent StC DOFs); 2: StC_XY_DOF (Omni-Directional StC); 3: TLCD; - 4: Prescribed force/moment time series} + 4: Prescribed force/moment time series; 5: Force determined by external DLL} **StC_X_DOF** [flag] @@ -310,7 +310,8 @@ StructCtrl Control **StC_CMODE** [switch] - Control mode {0:none; 1: Semi-Active Control Mode; 2: Active Control Mode} + Control mode {0:none; 1: Semi-Active Control Mode; 2: Active Control Mode}. + When using StC_DOF_MODE==5, StC_CMODE must be 2. **StC_SA_MODE** [-] @@ -425,7 +426,8 @@ when* **StC_DOF_MODE==4**. **PrescribedForcesCoord** [switch] - Prescribed forces are in global or local coordinates {1: global; 2: local} + Prescribed forces are in global or local coordinates {1: global; 2: local}. + When using StC_DOF_MODE==5, PrescribedForcesCoord must be 1. **PrescribedForcesFile** [-] diff --git a/docs/source/user/subdyn/input_files.rst b/docs/source/user/subdyn/input_files.rst index 00df199775..f5a7f06523 100644 --- a/docs/source/user/subdyn/input_files.rst +++ b/docs/source/user/subdyn/input_files.rst @@ -602,7 +602,7 @@ Output: Summary and Outfile In this section of the input file, the user sets flags and switches for the desired output behavior. -Specifying **SDSum** = TRUE causes SubDyn to generate a summary file +Specifying **SumPrint** = TRUE causes SubDyn to generate a summary file with name **OutRootName**.SD.sum*. **OutRootName** is either specified in the SUBDYN section of the driver input file when running SubDyn in stand-alone mode, or in the FAST input file when running a diff --git a/docs/source/user/subdyn/output_files.rst b/docs/source/user/subdyn/output_files.rst index f016ecfa12..ca5988e00b 100644 --- a/docs/source/user/subdyn/output_files.rst +++ b/docs/source/user/subdyn/output_files.rst @@ -27,7 +27,7 @@ Summary File ------------ SubDyn generates a summary file with the naming convention, -**OutRootName.SD.sum** if the **SDSum** parameter is set to TRUE. +**OutRootName.SD.sum** if the **SumPrint** parameter is set to TRUE. This file summarizes key information about the substructure model, including: diff --git a/docs/source/user/subdyn/theory.rst b/docs/source/user/subdyn/theory.rst index 5ca5917d4d..1dff8475b9 100644 --- a/docs/source/user/subdyn/theory.rst +++ b/docs/source/user/subdyn/theory.rst @@ -2572,7 +2572,7 @@ Output: nodal motions **Fixed-bottom case** -.. math:: :label: +.. math:: :label: nodalMotionFixed \bar{U}_R &= T_I U_{TP} ,\qquad @@ -2597,7 +2597,7 @@ The meshes :math:`y_2` and :math:`y_3` are identical (Guyan displacements comput **Floating case** -.. math:: :label: +.. math:: :label: nodalMotionFloating \bar{U}_R &= U_{R,\text{rigid}} ,\qquad @@ -2646,7 +2646,13 @@ where :math:`P` is a point belonging to the R- or L-set of nodes. Outputs to file: ~~~~~~~~~~~~~~~~ -**Motions**: nodal motions written to file are in global coordinates, and for the floating case they contain the elastic motion :math:`\bar{U}_L = U_{L,\text{rigid}} + \Phi_m q_m + U_{L,\text{SIM}}` (whereas these elastic motions are not returned to the glue code) +**Motions**: nodal motions written to file are in global coordinates. +For the fixed-bottom case, they are :math:`\bar{U}_L = \bar{\Phi}_R \bar{U}_R + \Phi_m q_m + U_{L,\text{SIM}}` +(see Eq. :eq:`nodalMotionFixed`). +For the floating case, they are :math:`\bar{U}_L = U_{L,\text{rigid}} + R_{b2g}(\Phi_m q_m + U_{L,\text{SIM}})`. +Note that the outputs for the floating case contains the elastic motions (similar to what is returned to MoorDyn), whereas these motions are not returned to the glue code for HydroDyn (see the "0" present in Eq. :eq:`nodalMotionFloating`). + + **Loads**: Nodal loads are written to file in the element coordinate system. The procedure are the same for fixed-bottom and floating cases. diff --git a/glue-codes/fast-farm/src/FAST_Farm_Subs.f90 b/glue-codes/fast-farm/src/FAST_Farm_Subs.f90 index 34786b381c..e991ac253d 100644 --- a/glue-codes/fast-farm/src/FAST_Farm_Subs.f90 +++ b/glue-codes/fast-farm/src/FAST_Farm_Subs.f90 @@ -1112,7 +1112,19 @@ SUBROUTINE Farm_ReadPrimaryFile( InputFile, p, WD_InitInp, AWAE_InitInp, SC_Init AWAE_InitInp%Mod_Projection=1 endif endif - + !----------------------- WAKE-ADDED TURBULENCE ------------------------------------------ + ! Read WAT variables + WD_InitInp%WAT_k_Def =1.0_ReKi + WD_InitInp%WAT_k_Grad =1.0_ReKi + WD_InitInp%WAT = .false. ! initialize to false to avoid segfault + !CALL ReadCom( UnIn, InputFile, 'Section Header: Wake-added turbulence', ErrStat2, ErrMsg2, UnEc ) + !CALL ReadVar( UnIn, InputFile, WD_InitInp%WAT, "WAT", "Switch for turning on and off wake-added turbulence", ErrStat2, ErrMsg2, UnEc); if(failed()) return + !CALL ReadCom( UnIn, InputFile, 'dummy predef', ErrStat2, ErrMsg2, UnEc ) + !CALL ReadCom( UnIn, InputFile, 'dummy user', ErrStat2, ErrMsg2, UnEc ) + !CALL ReadCom( UnIn, InputFile, 'dummy userdx', ErrStat2, ErrMsg2, UnEc ) + !CALL ReadVarWDefault( UnIn, InputFile, WD_InitInp%WAT_k_Def, "WAT_k_Def, "Calibrated parameter for the influence of the wake deficit in the wake-added Turbulence (-) [>=0.0] or DEFAULT [DEFAULT=1.44]", 1.44_ReKi, ErrStat2, ErrMsg2, UnEc); if(failed()) return + !CALL ReadVarWDefault( UnIn, InputFile, WD_InitInp%WAT_k_Grad, "WAT_k_Grad", "Calibrated parameter for the influence of the radial velocity gradient of the wake deficit in the wake-added Turbulence (-) [>=0.0] or DEFAULT [DEFAULT=0.84]", 0.84_ReKi, ErrStat2, ErrMsg2, UnEc); if(failed()) return + !IF ( PathIsRelative( p%File ) )p%File = TRIM(PriPath)//TRIM(p%File) !---------------------- VISUALIZATION -------------------------------------------------- CALL ReadCom( UnIn, InputFile, 'Section Header: Visualization', ErrStat2, ErrMsg2, UnEc ) @@ -1500,16 +1512,23 @@ SUBROUTINE Farm_ValidateInput( p, WD_InitInp, AWAE_InitInp, SC_InitInp, ErrStat, END IF END IF - IF (WD_InitInp%FilterInit < 0 ) CALL SetErrStat(ErrID_Fatal,'FilterInit needs to >= 0',ErrStat,ErrMsg,RoutineName) - IF (AWAE_InitInp%Mod_Meander < MeanderMod_Uniform .or. AWAE_InitInp%Mod_Meander > MeanderMod_WndwdJinc) THEN - call SetErrStat(ErrID_Fatal,'Spatial filter model for wake meandering, Mod_Meander, must be 1 (uniform), 2 (truncated jinc), 3 (windowed jinc) or DEFAULT.',ErrStat,ErrMsg,RoutineName) - END IF + IF (AWAE_InitInp%C_Meander < 1.0_Reki) THEN CALL SetErrStat(ErrID_Fatal,'C_Meander parameter must not be less than 1.',ErrStat,ErrMsg,RoutineName) END IF + + ! --- CURL + IF (WD_InitInp%FilterInit < 0 ) CALL SetErrStat(ErrID_Fatal,'FilterInit needs to >= 0',ErrStat,ErrMsg,RoutineName) + IF (AWAE_InitInp%Mod_Meander < MeanderMod_Uniform .or. AWAE_InitInp%Mod_Meander > MeanderMod_WndwdJinc) THEN + call SetErrStat(ErrID_Fatal,'Spatial filter model for wake meandering, Mod_Meander, must be 1 (uniform), 2 (truncated jinc), 3 (windowed jinc) or DEFAULT.',ErrStat,ErrMsg,RoutineName) + END IF IF (.not.(ANY((/1,2/)==AWAE_InitInp%Mod_Projection))) CALL SetErrStat(ErrID_Fatal,'Mod_Projection needs to be 1 or 2',ErrStat,ErrMsg,RoutineName) + ! --- WAT + IF (WD_InitInp%WAT_k_Def <= 0.0_Reki) CALL SetErrStat(ErrID_Fatal,'WAT_k_Def parameter must be positive.',ErrStat,ErrMsg,RoutineName) + IF (WD_InitInp%WAT_k_Grad <= 0.0_Reki) CALL SetErrStat(ErrID_Fatal,'WAT_k_Grad parameter must be positive.',ErrStat,ErrMsg,RoutineName) + !--- OUTPUT --- IF ( p%n_ChkptTime < 1_IntKi ) CALL SetErrStat( ErrID_Fatal, 'ChkptTime must be greater than 0 seconds.', ErrStat, ErrMsg, RoutineName ) IF (p%TStart < 0.0_ReKi) CALL SetErrStat(ErrID_Fatal,'TStart must not be negative.',ErrStat,ErrMsg,RoutineName) diff --git a/glue-codes/simulink/src/create_FAST_SFunc.m b/glue-codes/simulink/src/create_FAST_SFunc.m index 548f235291..e6f1144b17 100644 --- a/glue-codes/simulink/src/create_FAST_SFunc.m +++ b/glue-codes/simulink/src/create_FAST_SFunc.m @@ -12,7 +12,6 @@ % % Run `mex -setup` in Matlab to configure a C compiler if you have not already done so. - mexname = 'FAST_SFunc'; % base name of the resulting mex file built_with_visualStudio = true; %if the libraries were built with cmake, set to false @@ -60,14 +59,31 @@ fprintf( '\n----------------------------\n' ); fprintf( 'Creating %s\n\n', [outDir filesep mexname '.' mexext] ); -mex('-largeArrayDims', ... - ... % '-v', ... %add this line for "verbose" output (for debugging) - ['-L' libDir], ... - ['-l' libName], ... - ['-I' includeDir], ... - '-I../../../modules/supercontroller/src', ... % needed for visual studio builds to find "SuperController_Types.h" - '-I../../../modules/openfoam/src', ... % needed for visual studio builds to find "OpenFOAM_Types.h" - '-outdir', outDir, ... - ['COMPFLAGS=$COMPFLAGS -MT -DS_FUNCTION_NAME=' mexname], ... - '-output', mexname, ... - 'FAST_SFunc.c'); +if ispc () % Windows PC + + mex('-largeArrayDims', ... + ... % '-v', ... %add this line for "verbose" output (for debugging) + ['-L' libDir], ... + ['-l' libName], ... + ['-I' includeDir], ... + '-I../../../modules/supercontroller/src', ... % needed for visual studio builds to find "SuperController_Types.h" + '-I../../../modules/openfoam/src', ... % needed for visual studio builds to find "OpenFOAM_Types.h" + '-outdir', outDir, ... + ['COMPFLAGS=$COMPFLAGS -MT -DS_FUNCTION_NAME=' mexname], ... + '-output', mexname, ... + 'FAST_SFunc.c'); + +else % mac/unix + + mex('-largeArrayDims', ... + '-v', ... %add this line for "verbose" output (for debugging) + ['-L', libDir], ... + ['-l', libName], ... + ['-I', includeDir], ... + '-outdir', outDir, ... + ['CFLAGS=$CFLAGS -DS_FUNCTION_NAME=' mexname], ... + ... ['CXXFLAGS=$CXXFLAGS -DS_FUNCTION_NAME=' mexname], ... + '-output', mexname, ... + 'FAST_SFunc.c'); + +end diff --git a/modules/aerodyn/src/UnsteadyAero_Registry.txt b/modules/aerodyn/src/UnsteadyAero_Registry.txt index 25bdee4239..b71aef051d 100644 --- a/modules/aerodyn/src/UnsteadyAero_Registry.txt +++ b/modules/aerodyn/src/UnsteadyAero_Registry.txt @@ -51,58 +51,58 @@ typedef ^ ^ CHARACTER(1 # Variables local to the Kelvin Chain: -typedef ^ UA_KelvinChainType ReKi Cn_prime - - - "" - -#typedef ^ UA_KelvinChainType ReKi Cn_prime_diff - - - "" - -typedef ^ UA_KelvinChainType ReKi C_nalpha_circ - - - "slope of the circulatory normal force coefficient vs alpha curve" - -typedef ^ UA_KelvinChainType ReKi Kalpha_f - - - "filtered backwards finite difference of alpha (xd%Kalpha_f_minus1)" - -typedef ^ UA_KelvinChainType ReKi Kq_f - - - "filtered backwards finite difference of q" - -typedef ^ UA_KelvinChainType ReKi alpha_filt_cur - - - "filtered angle of attack" - -typedef ^ UA_KelvinChainType ReKi alpha_e - - - "effective angle of attack at 3/4 chord TODO: verify 3/4 and not 1/4" - -typedef ^ UA_KelvinChainType ReKi dalpha0 - - - "" - -typedef ^ UA_KelvinChainType ReKi alpha_f - - - "" - -typedef ^ UA_KelvinChainType ReKi Kq - - - "" - -typedef ^ UA_KelvinChainType ReKi q_cur - - - "" - -typedef ^ UA_KelvinChainType ReKi q_f_cur - - - "" - -typedef ^ UA_KelvinChainType ReKi X1 - - - "" - -typedef ^ UA_KelvinChainType ReKi X2 - - - "" - -typedef ^ UA_KelvinChainType ReKi X3 - - - "" - -typedef ^ UA_KelvinChainType ReKi X4 - - - "" - -typedef ^ UA_KelvinChainType ReKi Kprime_alpha - - - "" - -typedef ^ UA_KelvinChainType ReKi Kprime_q - - - "" - -typedef ^ UA_KelvinChainType ReKi K3prime_q - - - "" - -typedef ^ UA_KelvinChainType ReKi Kprimeprime_q - - - "" - -typedef ^ UA_KelvinChainType ReKi Dp - - - "" - -typedef ^ UA_KelvinChainType ReKi Cn_pot - - - "" - -typedef ^ UA_KelvinChainType ReKi Cc_pot - - - "" - -typedef ^ UA_KelvinChainType ReKi Cn_alpha_q_circ - - - "" - -typedef ^ UA_KelvinChainType ReKi Cn_alpha_q_nc - - - "non-circulatory component of normal force coefficient response to step change in alpha and q" - -typedef ^ UA_KelvinChainType ReKi Cm_q_circ - - - "" - -typedef ^ UA_KelvinChainType ReKi Cn_alpha_nc - - - "non-circulatory component of the normal force coefficient response to step change in alpha" - -typedef ^ UA_KelvinChainType ReKi Cn_q_circ - - - "" - -typedef ^ UA_KelvinChainType ReKi Cn_q_nc - - - "" - -typedef ^ UA_KelvinChainType ReKi Cm_q_nc - - - "non-circulatory component of the moment coefficient response to step change in q" - -typedef ^ UA_KelvinChainType ReKi fprimeprime - - - "" - -typedef ^ UA_KelvinChainType ReKi Df - - - "" - -typedef ^ UA_KelvinChainType ReKi Df_c - - - "" - -typedef ^ UA_KelvinChainType ReKi Df_m - - - "" - -typedef ^ UA_KelvinChainType ReKi Dalphaf - - - "" - -typedef ^ UA_KelvinChainType ReKi fprime - - - "" - -typedef ^ UA_KelvinChainType ReKi fprime_c - - - "" - -typedef ^ UA_KelvinChainType ReKi fprimeprime_c - - - "" - -typedef ^ UA_KelvinChainType ReKi fprime_m - - - "" - -typedef ^ UA_KelvinChainType ReKi fprimeprime_m - - - "" - -typedef ^ UA_KelvinChainType ReKi Cn_v - - - "normal force coefficient due to the presence of LE vortex" - -typedef ^ UA_KelvinChainType ReKi C_V - - - "contribution to the normal force coefficient due to accumulated vorticity in the LE vortex" - -typedef ^ UA_KelvinChainType ReKi Cn_FS - - - "" - -typedef ^ UA_KelvinChainType ReKi T_f - - - "" - -typedef ^ UA_KelvinChainType ReKi T_fc - - - "" - -typedef ^ UA_KelvinChainType ReKi T_fm - - - "" - -typedef ^ UA_KelvinChainType ReKi T_V - - - "backwards finite difference of the non-dimensionalized distance parameter" - -typedef ^ UA_KelvinChainType ReKi k_alpha - - - "" - -typedef ^ UA_KelvinChainType ReKi k_q - - - "" - -typedef ^ UA_KelvinChainType ReKi T_alpha - - - "" - -typedef ^ UA_KelvinChainType ReKi T_q - - - "" - -typedef ^ UA_KelvinChainType ReKi ds - - - "non-dimensionalized distance parameter" - +typedef ^ UA_KelvinChainType ReKi Cn_prime - 0.0 - "" - +#typedef ^ UA_KelvinChainType ReKi Cn_prime_diff - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi C_nalpha_circ - 0.0 - "slope of the circulatory normal force coefficient vs alpha curve" - +typedef ^ UA_KelvinChainType ReKi Kalpha_f - 0.0 - "filtered backwards finite difference of alpha (xd%Kalpha_f_minus1)" - +typedef ^ UA_KelvinChainType ReKi Kq_f - 0.0 - "filtered backwards finite difference of q" - +typedef ^ UA_KelvinChainType ReKi alpha_filt_cur - 0.0 - "filtered angle of attack" - +typedef ^ UA_KelvinChainType ReKi alpha_e - 0.0 - "effective angle of attack at 3/4 chord TODO: verify 3/4 and not 1/4" - +typedef ^ UA_KelvinChainType ReKi dalpha0 - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi alpha_f - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi Kq - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi q_cur - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi q_f_cur - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi X1 - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi X2 - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi X3 - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi X4 - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi Kprime_alpha - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi Kprime_q - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi K3prime_q - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi Kprimeprime_q - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi Dp - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi Cn_pot - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi Cc_pot - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi Cn_alpha_q_circ - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi Cn_alpha_q_nc - 0.0 - "non-circulatory component of normal force coefficient response to step change in alpha and q" - +typedef ^ UA_KelvinChainType ReKi Cm_q_circ - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi Cn_alpha_nc - 0.0 - "non-circulatory component of the normal force coefficient response to step change in alpha" - +typedef ^ UA_KelvinChainType ReKi Cn_q_circ - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi Cn_q_nc - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi Cm_q_nc - 0.0 - "non-circulatory component of the moment coefficient response to step change in q" - +typedef ^ UA_KelvinChainType ReKi fprimeprime - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi Df - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi Df_c - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi Df_m - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi Dalphaf - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi fprime - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi fprime_c - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi fprimeprime_c - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi fprime_m - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi fprimeprime_m - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi Cn_v - 0.0 - "normal force coefficient due to the presence of LE vortex" - +typedef ^ UA_KelvinChainType ReKi C_V - 0.0 - "contribution to the normal force coefficient due to accumulated vorticity in the LE vortex" - +typedef ^ UA_KelvinChainType ReKi Cn_FS - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi T_f - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi T_fc - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi T_fm - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi T_V - 0.0 - "backwards finite difference of the non-dimensionalized distance parameter" - +typedef ^ UA_KelvinChainType ReKi k_alpha - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi k_q - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi T_alpha - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi T_q - 0.0 - "" - +typedef ^ UA_KelvinChainType ReKi ds - 0.0 - "non-dimensionalized distance parameter" - # ..... States .................................................................................................................... diff --git a/modules/aerodyn/src/UnsteadyAero_Types.f90 b/modules/aerodyn/src/UnsteadyAero_Types.f90 index 035021149b..3a42342068 100644 --- a/modules/aerodyn/src/UnsteadyAero_Types.f90 +++ b/modules/aerodyn/src/UnsteadyAero_Types.f90 @@ -66,57 +66,57 @@ MODULE UnsteadyAero_Types ! ======================= ! ========= UA_KelvinChainType ======= TYPE, PUBLIC :: UA_KelvinChainType - REAL(ReKi) :: Cn_prime !< [-] - REAL(ReKi) :: C_nalpha_circ !< slope of the circulatory normal force coefficient vs alpha curve [-] - REAL(ReKi) :: Kalpha_f !< filtered backwards finite difference of alpha (xd%Kalpha_f_minus1) [-] - REAL(ReKi) :: Kq_f !< filtered backwards finite difference of q [-] - REAL(ReKi) :: alpha_filt_cur !< filtered angle of attack [-] - REAL(ReKi) :: alpha_e !< effective angle of attack at 3/4 chord TODO: verify 3/4 and not 1/4 [-] - REAL(ReKi) :: dalpha0 !< [-] - REAL(ReKi) :: alpha_f !< [-] - REAL(ReKi) :: Kq !< [-] - REAL(ReKi) :: q_cur !< [-] - REAL(ReKi) :: q_f_cur !< [-] - REAL(ReKi) :: X1 !< [-] - REAL(ReKi) :: X2 !< [-] - REAL(ReKi) :: X3 !< [-] - REAL(ReKi) :: X4 !< [-] - REAL(ReKi) :: Kprime_alpha !< [-] - REAL(ReKi) :: Kprime_q !< [-] - REAL(ReKi) :: K3prime_q !< [-] - REAL(ReKi) :: Kprimeprime_q !< [-] - REAL(ReKi) :: Dp !< [-] - REAL(ReKi) :: Cn_pot !< [-] - REAL(ReKi) :: Cc_pot !< [-] - REAL(ReKi) :: Cn_alpha_q_circ !< [-] - REAL(ReKi) :: Cn_alpha_q_nc !< non-circulatory component of normal force coefficient response to step change in alpha and q [-] - REAL(ReKi) :: Cm_q_circ !< [-] - REAL(ReKi) :: Cn_alpha_nc !< non-circulatory component of the normal force coefficient response to step change in alpha [-] - REAL(ReKi) :: Cn_q_circ !< [-] - REAL(ReKi) :: Cn_q_nc !< [-] - REAL(ReKi) :: Cm_q_nc !< non-circulatory component of the moment coefficient response to step change in q [-] - REAL(ReKi) :: fprimeprime !< [-] - REAL(ReKi) :: Df !< [-] - REAL(ReKi) :: Df_c !< [-] - REAL(ReKi) :: Df_m !< [-] - REAL(ReKi) :: Dalphaf !< [-] - REAL(ReKi) :: fprime !< [-] - REAL(ReKi) :: fprime_c !< [-] - REAL(ReKi) :: fprimeprime_c !< [-] - REAL(ReKi) :: fprime_m !< [-] - REAL(ReKi) :: fprimeprime_m !< [-] - REAL(ReKi) :: Cn_v !< normal force coefficient due to the presence of LE vortex [-] - REAL(ReKi) :: C_V !< contribution to the normal force coefficient due to accumulated vorticity in the LE vortex [-] - REAL(ReKi) :: Cn_FS !< [-] - REAL(ReKi) :: T_f !< [-] - REAL(ReKi) :: T_fc !< [-] - REAL(ReKi) :: T_fm !< [-] - REAL(ReKi) :: T_V !< backwards finite difference of the non-dimensionalized distance parameter [-] - REAL(ReKi) :: k_alpha !< [-] - REAL(ReKi) :: k_q !< [-] - REAL(ReKi) :: T_alpha !< [-] - REAL(ReKi) :: T_q !< [-] - REAL(ReKi) :: ds !< non-dimensionalized distance parameter [-] + REAL(ReKi) :: Cn_prime = 0.0 !< [-] + REAL(ReKi) :: C_nalpha_circ = 0.0 !< slope of the circulatory normal force coefficient vs alpha curve [-] + REAL(ReKi) :: Kalpha_f = 0.0 !< filtered backwards finite difference of alpha (xd%Kalpha_f_minus1) [-] + REAL(ReKi) :: Kq_f = 0.0 !< filtered backwards finite difference of q [-] + REAL(ReKi) :: alpha_filt_cur = 0.0 !< filtered angle of attack [-] + REAL(ReKi) :: alpha_e = 0.0 !< effective angle of attack at 3/4 chord TODO: verify 3/4 and not 1/4 [-] + REAL(ReKi) :: dalpha0 = 0.0 !< [-] + REAL(ReKi) :: alpha_f = 0.0 !< [-] + REAL(ReKi) :: Kq = 0.0 !< [-] + REAL(ReKi) :: q_cur = 0.0 !< [-] + REAL(ReKi) :: q_f_cur = 0.0 !< [-] + REAL(ReKi) :: X1 = 0.0 !< [-] + REAL(ReKi) :: X2 = 0.0 !< [-] + REAL(ReKi) :: X3 = 0.0 !< [-] + REAL(ReKi) :: X4 = 0.0 !< [-] + REAL(ReKi) :: Kprime_alpha = 0.0 !< [-] + REAL(ReKi) :: Kprime_q = 0.0 !< [-] + REAL(ReKi) :: K3prime_q = 0.0 !< [-] + REAL(ReKi) :: Kprimeprime_q = 0.0 !< [-] + REAL(ReKi) :: Dp = 0.0 !< [-] + REAL(ReKi) :: Cn_pot = 0.0 !< [-] + REAL(ReKi) :: Cc_pot = 0.0 !< [-] + REAL(ReKi) :: Cn_alpha_q_circ = 0.0 !< [-] + REAL(ReKi) :: Cn_alpha_q_nc = 0.0 !< non-circulatory component of normal force coefficient response to step change in alpha and q [-] + REAL(ReKi) :: Cm_q_circ = 0.0 !< [-] + REAL(ReKi) :: Cn_alpha_nc = 0.0 !< non-circulatory component of the normal force coefficient response to step change in alpha [-] + REAL(ReKi) :: Cn_q_circ = 0.0 !< [-] + REAL(ReKi) :: Cn_q_nc = 0.0 !< [-] + REAL(ReKi) :: Cm_q_nc = 0.0 !< non-circulatory component of the moment coefficient response to step change in q [-] + REAL(ReKi) :: fprimeprime = 0.0 !< [-] + REAL(ReKi) :: Df = 0.0 !< [-] + REAL(ReKi) :: Df_c = 0.0 !< [-] + REAL(ReKi) :: Df_m = 0.0 !< [-] + REAL(ReKi) :: Dalphaf = 0.0 !< [-] + REAL(ReKi) :: fprime = 0.0 !< [-] + REAL(ReKi) :: fprime_c = 0.0 !< [-] + REAL(ReKi) :: fprimeprime_c = 0.0 !< [-] + REAL(ReKi) :: fprime_m = 0.0 !< [-] + REAL(ReKi) :: fprimeprime_m = 0.0 !< [-] + REAL(ReKi) :: Cn_v = 0.0 !< normal force coefficient due to the presence of LE vortex [-] + REAL(ReKi) :: C_V = 0.0 !< contribution to the normal force coefficient due to accumulated vorticity in the LE vortex [-] + REAL(ReKi) :: Cn_FS = 0.0 !< [-] + REAL(ReKi) :: T_f = 0.0 !< [-] + REAL(ReKi) :: T_fc = 0.0 !< [-] + REAL(ReKi) :: T_fm = 0.0 !< [-] + REAL(ReKi) :: T_V = 0.0 !< backwards finite difference of the non-dimensionalized distance parameter [-] + REAL(ReKi) :: k_alpha = 0.0 !< [-] + REAL(ReKi) :: k_q = 0.0 !< [-] + REAL(ReKi) :: T_alpha = 0.0 !< [-] + REAL(ReKi) :: T_q = 0.0 !< [-] + REAL(ReKi) :: ds = 0.0 !< non-dimensionalized distance parameter [-] END TYPE UA_KelvinChainType ! ======================= ! ========= UA_ElementContinuousStateType ======= diff --git a/modules/awae/src/AWAE.f90 b/modules/awae/src/AWAE.f90 index c4327114fc..3e8887f38e 100644 --- a/modules/awae/src/AWAE.f90 +++ b/modules/awae/src/AWAE.f90 @@ -870,6 +870,9 @@ subroutine AWAE_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitO p%Mod_Meander = InitInp%InputFileData%Mod_Meander p%C_Meander = InitInp%InputFileData%C_Meander p%Mod_Projection = InitInp%InputFileData%Mod_Projection + ! Wake Added Turbulence (WAT) Parameters + !p%WAT = InitInp%InputFileData%WAT + !p%WAT_Basename = InitInp%InputFileData%WAT_Basename select case ( p%Mod_Meander ) case (MeanderMod_Uniform) @@ -992,6 +995,7 @@ subroutine AWAE_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitO ! Initialize InflowWind IfW_InitInp%FixedWindFileRootName = .false. IfW_InitInp%NumWindPoints = p%NumGrid_low + IfW_InitInp%RadAvg = 0.25 * p%nZ_low * p%dX_low ! arbitrary garbage, just must be bigger than zero, but not bigger than grid (IfW will complain if this isn't set when it tries to calculate disk average vel) call InflowWind_Init( IfW_InitInp, m%u_IfW_Low, p%IfW(0), x%IfW(0), xd%IfW(0), z%IfW(0), OtherState%IfW(0), m%y_IfW_Low, m%IfW(0), Interval, IfW_InitOut, ErrStat2, ErrMsg2 ) call SetErrStat ( errStat2, errMsg2, errStat, errMsg, RoutineName ) @@ -1062,6 +1066,9 @@ subroutine AWAE_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitO ! Set the position inputs once for the low-resolution grid m%u_IfW_Low%PositionXYZ = p%Grid_low + ! Set the hub position and orientation to pass to IfW (IfW always calculates hub and disk avg vel) + m%u_IfW_Low%HubPosition = (/ p%X0_low + 0.5*p%nX_low*p%dX_low, p%Y0_low + 0.5*p%nY_low*p%dY_low, p%Z0_low + 0.5*p%nZ_low*p%dZ_low /) + call Eye(m%u_IfW_Low%HubOrientation,ErrStat2,ErrMsg2) ! Initialize the high-resolution grid inputs and outputs IF ( .NOT. ALLOCATED( m%u_IfW_High%PositionXYZ ) ) THEN @@ -1128,6 +1135,7 @@ subroutine AWAE_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitO allocate ( u%Vy_wake (-p%NumRadii+1:p%NumRadii-1, -p%NumRadii+1:p%NumRadii-1, 0:p%NumPlanes-1,1:p%NumTurbines), STAT=ErrStat2 ); if (errStat2 /= 0) call SetErrStat ( ErrID_Fatal, 'Could not allocate memory for u%Vy_wake.', errStat, errMsg, RoutineName ) allocate ( u%Vz_wake (-p%NumRadii+1:p%NumRadii-1, -p%NumRadii+1:p%NumRadii-1, 0:p%NumPlanes-1,1:p%NumTurbines), STAT=ErrStat2 ); if (errStat2 /= 0) call SetErrStat ( ErrID_Fatal, 'Could not allocate memory for u%Vz_wake.', errStat, errMsg, RoutineName ) allocate ( u%D_wake (0:p%NumPlanes-1,1:p%NumTurbines), STAT=ErrStat2 ); if (errStat2 /= 0) call SetErrStat ( ErrID_Fatal, 'Could not allocate memory for u%D_wake.', errStat, errMsg, RoutineName ) + allocate ( u%WAT_k_mt (0:p%NumRadii-1, 0:p%NumPlanes-1, 1:p%NumTurbines), STAT=ErrStat2 ); if (errStat2 /= 0) call SetErrStat ( ErrID_Fatal, 'Could not allocate memory for u%k_mt.', errStat, errMsg, RoutineName ) if (errStat /= ErrID_None) return u%Vx_wake=0.0_ReKi @@ -1384,6 +1392,9 @@ subroutine AWAE_UpdateStates( t, n, u, p, x, xd, z, OtherState, m, errStat, errM else ! p%Mod_AmbWind == 2 .or. 3 + ! Set the hub position and orientation to pass to IfW (IfW always calculates hub and disk avg vel) + m%u_IfW_Low%HubPosition = (/ p%X0_low + 0.5*p%nX_low*p%dX_low, p%Y0_low + 0.5*p%nY_low*p%dY_low, p%Z0_low + 0.5*p%nZ_low*p%dZ_low /) + call Eye(m%u_IfW_Low%HubOrientation,ErrStat2,ErrMsg2) ! Set low-resolution inflow wind velocities call InflowWind_CalcOutput(t+p%dt_low, m%u_IfW_Low, p%IfW(0), x%IfW(0), xd%IfW(0), z%IfW(0), OtherState%IfW(0), m%y_IfW_Low, m%IfW(0), errStat2, errMsg2) call SetErrStat( ErrStat2, ErrMsg2, errStat, errMsg, RoutineName ) @@ -1401,6 +1412,9 @@ subroutine AWAE_UpdateStates( t, n, u, p, x, xd, z, OtherState, m, errStat, errM if ( p%Mod_AmbWind == 2 ) then do nt = 1,p%NumTurbines m%u_IfW_High%PositionXYZ = p%Grid_high(:,:,nt) + ! Set the hub position and orientation to pass to IfW (IfW always calculates hub and disk avg vel) + m%u_IfW_High%HubPosition = (/ p%X0_high(nt) + 0.5*p%nX_high*p%dX_high(nt), p%Y0_high(nt) + 0.5*p%nY_high*p%dY_high(nt), p%Z0_high(nt) + 0.5*p%nZ_high*p%dZ_high(nt) /) + call Eye(m%u_IfW_High%HubOrientation,ErrStat2,ErrMsg2) do n_hl=0, n_high_low call InflowWind_CalcOutput(t+p%dt_low+n_hl*p%DT_high, m%u_IfW_High, p%IfW(0), x%IfW(0), xd%IfW(0), z%IfW(0), OtherState%IfW(0), m%y_IfW_High, m%IfW(0), errStat2, errMsg2) call SetErrStat( ErrStat2, ErrMsg2, errStat, errMsg, RoutineName ) @@ -1429,6 +1443,9 @@ subroutine AWAE_UpdateStates( t, n, u, p, x, xd, z, OtherState, m, errStat, errM end do end do do n_hl=0, n_high_low + ! Set the hub position and orientation to pass to IfW (IfW always calculates hub and disk avg vel) + m%u_IfW_High%HubPosition = (/ p%X0_high(nt) + 0.5*p%nX_high*p%dX_high(nt), p%Y0_high(nt) + 0.5*p%nY_high*p%dY_high(nt), p%Z0_high(nt) + 0.5*p%nZ_high*p%dZ_high(nt) /) + call Eye(m%u_IfW_High%HubOrientation,ErrStat2,ErrMsg2) call InflowWind_CalcOutput(t+p%dt_low+n_hl*p%DT_high, m%u_IfW_High, p%IfW(nt), x%IfW(nt), xd%IfW(nt), z%IfW(nt), OtherState%IfW(nt), m%y_IfW_High, m%IfW(nt), errStat2, errMsg2) call SetErrStat( ErrStat2, ErrMsg2, errStat, errMsg, RoutineName ) if (errStat >= AbortErrLev) return @@ -1862,6 +1879,40 @@ subroutine AWAE_TEST_CalcOutput(errStat, errMsg) end subroutine AWAE_TEST_CalcOutput +! WAT TODO +!> Compute non-scaled turbulence at a given plane based on a Mann Box, current time, and convection velocity of the box +subroutine TurbPlane(Uconv, t, nr, u_p, v_p, w_p) + integer(IntKi), intent(in) :: nr !< Number of radius in wake plane + !real(ReKi), dimension(0:,0:,0:), pointer, intent(in) :: u_b !< TODO turbulence box + real(ReKi), intent(in) :: Uconv !< Convection velocity of the box + real(DbKi), intent(in) :: t !< Current time + real(ReKi), dimension(-nr+1:nr+1,-nr+1:nr+1), intent(out) :: u_p !< Plane to be filled with turbulence values, shape + real(ReKi), dimension(-nr+1:nr+1,-nr+1:nr+1), intent(out) :: v_p !< Plane to be filled with turbulence values, shape + real(ReKi), dimension(-nr+1:nr+1,-nr+1:nr+1), intent(out) :: w_p !< Plane to be filled with turbulence values, shape + integer(IntKi) :: iz, iy ! indices in plane coordinates + integer(IntKi) :: ix_b, iy_b, iz_b, ib0, nb ! Indices in box coordinates + + !nb = size(u_b, 1) + nb=2 ! TODO + ib0 = int(nb/2)-1 ! NOTE: nb is multiple of 2 + + ! Interpolate time + ! TODO use Uconv/t to find ix_b + + ! Loop through all plane points + do iz = -nr+1, nr-1 + iz_b = modulo(ib0 + iz, nb) ! NOTE: assumes that turbulene box has indexing starting from 0 + do iy = -nr+1, nr-1 + iy_b = modulo(ib0 + iz, nb) + u_p(iy,iz) = 0.0_ReKi + v_p(iy,iz) = 0.0_ReKi + w_p(iy,iz) = 0.0_ReKi + !u_b = u_b(iy_b, iz_b, ix_b) ! TODO + enddo + enddo + +end subroutine + FUNCTION INTERP3D(p,p0,del,V,within,nX,nY,nZ,Vbox) ! I/O variables Real(ReKi), INTENT( IN ) :: p(3) !< Position where the 3D velocity field will be interpreted (m) diff --git a/modules/awae/src/AWAE_Registry.txt b/modules/awae/src/AWAE_Registry.txt index 07d287715c..a5680f0dc5 100644 --- a/modules/awae/src/AWAE_Registry.txt +++ b/modules/awae/src/AWAE_Registry.txt @@ -214,4 +214,5 @@ typedef ^ InputType ReKi Vx_wake {:}{:}{:}{:} - typedef ^ InputType ReKi Vy_wake {:}{:}{:}{:} - - "Transverse horizonal wake velocity deficit at wake planes, distributed across the plane, for each turbine (ny,nz,np,nWT)" m/s typedef ^ InputType ReKi Vz_wake {:}{:}{:}{:} - - "Transverse nominally vertical wake velocity deficit at wake planes, distributed across the plane, for each turbine (ny,nz,np,nWT)" m/s typedef ^ InputType ReKi D_wake {:}{:} - - "Wake diameters at wake planes for each turbine" m - +# wake added turbulence (WAT) inputs +typedef ^ InputType ReKi WAT_k_mt {:}{:}{:} - - "Scaling factor k_mt(r,x) for wake-added turbulence" - diff --git a/modules/awae/src/AWAE_Types.f90 b/modules/awae/src/AWAE_Types.f90 index f6e64aab8d..c183223332 100644 --- a/modules/awae/src/AWAE_Types.f90 +++ b/modules/awae/src/AWAE_Types.f90 @@ -236,6 +236,7 @@ MODULE AWAE_Types REAL(ReKi) , DIMENSION(:,:,:,:), ALLOCATABLE :: Vy_wake !< Transverse horizonal wake velocity deficit at wake planes, distributed across the plane, for each turbine (ny,nz,np,nWT) [m/s] REAL(ReKi) , DIMENSION(:,:,:,:), ALLOCATABLE :: Vz_wake !< Transverse nominally vertical wake velocity deficit at wake planes, distributed across the plane, for each turbine (ny,nz,np,nWT) [m/s] REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: D_wake !< Wake diameters at wake planes for each turbine [m] + REAL(ReKi) , DIMENSION(:,:,:), ALLOCATABLE :: WAT_k_mt !< Scaling factor k_mt(r,x) for wake-added turbulence [-] END TYPE AWAE_InputType ! ======================= CONTAINS @@ -7092,6 +7093,22 @@ SUBROUTINE AWAE_CopyInput( SrcInputData, DstInputData, CtrlCode, ErrStat, ErrMsg END IF END IF DstInputData%D_wake = SrcInputData%D_wake +ENDIF +IF (ALLOCATED(SrcInputData%WAT_k_mt)) THEN + i1_l = LBOUND(SrcInputData%WAT_k_mt,1) + i1_u = UBOUND(SrcInputData%WAT_k_mt,1) + i2_l = LBOUND(SrcInputData%WAT_k_mt,2) + i2_u = UBOUND(SrcInputData%WAT_k_mt,2) + i3_l = LBOUND(SrcInputData%WAT_k_mt,3) + i3_u = UBOUND(SrcInputData%WAT_k_mt,3) + IF (.NOT. ALLOCATED(DstInputData%WAT_k_mt)) THEN + ALLOCATE(DstInputData%WAT_k_mt(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) + IF (ErrStat2 /= 0) THEN + CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInputData%WAT_k_mt.', ErrStat, ErrMsg,RoutineName) + RETURN + END IF + END IF + DstInputData%WAT_k_mt = SrcInputData%WAT_k_mt ENDIF END SUBROUTINE AWAE_CopyInput @@ -7133,6 +7150,9 @@ SUBROUTINE AWAE_DestroyInput( InputData, ErrStat, ErrMsg, DEALLOCATEpointers ) ENDIF IF (ALLOCATED(InputData%D_wake)) THEN DEALLOCATE(InputData%D_wake) +ENDIF +IF (ALLOCATED(InputData%WAT_k_mt)) THEN + DEALLOCATE(InputData%WAT_k_mt) ENDIF END SUBROUTINE AWAE_DestroyInput @@ -7201,6 +7221,11 @@ SUBROUTINE AWAE_PackInput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Int_BufSz = Int_BufSz + 2*2 ! D_wake upper/lower bounds for each dimension Re_BufSz = Re_BufSz + SIZE(InData%D_wake) ! D_wake END IF + Int_BufSz = Int_BufSz + 1 ! WAT_k_mt allocated yes/no + IF ( ALLOCATED(InData%WAT_k_mt) ) THEN + Int_BufSz = Int_BufSz + 2*3 ! WAT_k_mt upper/lower bounds for each dimension + Re_BufSz = Re_BufSz + SIZE(InData%WAT_k_mt) ! WAT_k_mt + END IF IF ( Re_BufSz .GT. 0 ) THEN ALLOCATE( ReKiBuf( Re_BufSz ), STAT=ErrStat2 ) IF (ErrStat2 /= 0) THEN @@ -7388,6 +7413,31 @@ SUBROUTINE AWAE_PackInput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, END DO END DO END IF + IF ( .NOT. ALLOCATED(InData%WAT_k_mt) ) THEN + IntKiBuf( Int_Xferred ) = 0 + Int_Xferred = Int_Xferred + 1 + ELSE + IntKiBuf( Int_Xferred ) = 1 + Int_Xferred = Int_Xferred + 1 + IntKiBuf( Int_Xferred ) = LBOUND(InData%WAT_k_mt,1) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%WAT_k_mt,1) + Int_Xferred = Int_Xferred + 2 + IntKiBuf( Int_Xferred ) = LBOUND(InData%WAT_k_mt,2) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%WAT_k_mt,2) + Int_Xferred = Int_Xferred + 2 + IntKiBuf( Int_Xferred ) = LBOUND(InData%WAT_k_mt,3) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%WAT_k_mt,3) + Int_Xferred = Int_Xferred + 2 + + DO i3 = LBOUND(InData%WAT_k_mt,3), UBOUND(InData%WAT_k_mt,3) + DO i2 = LBOUND(InData%WAT_k_mt,2), UBOUND(InData%WAT_k_mt,2) + DO i1 = LBOUND(InData%WAT_k_mt,1), UBOUND(InData%WAT_k_mt,1) + ReKiBuf(Re_Xferred) = InData%WAT_k_mt(i1,i2,i3) + Re_Xferred = Re_Xferred + 1 + END DO + END DO + END DO + END IF END SUBROUTINE AWAE_PackInput SUBROUTINE AWAE_UnPackInput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) @@ -7598,6 +7648,34 @@ SUBROUTINE AWAE_UnPackInput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMs END DO END DO END IF + IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! WAT_k_mt not allocated + Int_Xferred = Int_Xferred + 1 + ELSE + Int_Xferred = Int_Xferred + 1 + i1_l = IntKiBuf( Int_Xferred ) + i1_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + i2_l = IntKiBuf( Int_Xferred ) + i2_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + i3_l = IntKiBuf( Int_Xferred ) + i3_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + IF (ALLOCATED(OutData%WAT_k_mt)) DEALLOCATE(OutData%WAT_k_mt) + ALLOCATE(OutData%WAT_k_mt(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) + IF (ErrStat2 /= 0) THEN + CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%WAT_k_mt.', ErrStat, ErrMsg,RoutineName) + RETURN + END IF + DO i3 = LBOUND(OutData%WAT_k_mt,3), UBOUND(OutData%WAT_k_mt,3) + DO i2 = LBOUND(OutData%WAT_k_mt,2), UBOUND(OutData%WAT_k_mt,2) + DO i1 = LBOUND(OutData%WAT_k_mt,1), UBOUND(OutData%WAT_k_mt,1) + OutData%WAT_k_mt(i1,i2,i3) = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 + END DO + END DO + END DO + END IF END SUBROUTINE AWAE_UnPackInput END MODULE AWAE_Types diff --git a/modules/beamdyn/src/BeamDyn.f90 b/modules/beamdyn/src/BeamDyn.f90 index b5d0e1bed1..d2354776ef 100644 --- a/modules/beamdyn/src/BeamDyn.f90 +++ b/modules/beamdyn/src/BeamDyn.f90 @@ -5438,6 +5438,10 @@ SUBROUTINE BD_InitAcc( u, p, x, m, qdotdot, ErrStat, ErrMsg ) ! Calculate Quadrature point values needed CALL BD_QuadraturePointData( p, x, m ) ! Calculate QP values uuu, uup, RR0, kappa, E1 + ! Reset QP values + CALL BD_QPData_mEta_rho(p, m) + CALL BD_QPDataVelocity(p, x, m) + ! set misc vars, particularly m%RHS CALL BD_CalcForceAcc( u, p, m, ErrStat2, ErrMsg2 ) CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) diff --git a/modules/beamdyn/src/Driver_Beam.f90 b/modules/beamdyn/src/Driver_Beam.f90 index 9d0611e66c..eed92052de 100644 --- a/modules/beamdyn/src/Driver_Beam.f90 +++ b/modules/beamdyn/src/Driver_Beam.f90 @@ -33,6 +33,7 @@ PROGRAM BeamDyn_Driver_Program REAL(DbKi) :: t_global ! global-loop time marker INTEGER(IntKi) :: n_t_final ! total number of time steps INTEGER(IntKi) :: n_t_global ! global-loop time counter + INTEGER(IntKi) :: n_t_vtk ! global vtk step counter INTEGER(IntKi), parameter :: BD_interp_order = 1 ! order of interpolation/extrapolation ! Module1 Derived-types variables; see Registry_Module1.txt for details @@ -99,9 +100,9 @@ PROGRAM BeamDyn_Driver_Program ! initialize the BD_InitInput values not in the driver input file BD_InitInput%RootName = TRIM(BD_Initinput%InputFile) BD_InitInput%RootName = TRIM(RootName)//'.BD' - BD_InitInput%RootDisp = 0.d0 + BD_InitInput%RootDisp = MATMUL(BD_InitInput%GlbPos(:),DvrData%RootRelInit) - BD_InitInput%GlbPos(:) BD_InitInput%DynamicSolve = DvrData%DynamicSolve ! QuasiStatic options handled within the BD code. - + t_global = DvrData%t_initial n_t_final = ((DvrData%t_final - DvrData%t_initial) / dt_global ) @@ -157,6 +158,21 @@ PROGRAM BeamDyn_Driver_Program CALL CheckError() END DO + ! Write VTK reference if requested (ref is (0,0,0) + if (DvrData%WrVTK > 0) then + call SetVTKvars() + call MeshWrVTKreference( (/0.0_SiKi, 0.0_SiKi, 0.0_SiKi /), BD_Output%BldMotion, trim(DvrData%VTK_OutFileRoot)//'_BldMotion', ErrStat, ErrMsg ); call CheckError() + call MeshWrVTKreference( (/0.0_SiKi, 0.0_SiKi, 0.0_SiKi /), BD_Input(1)%PointLoad, trim(DvrData%VTK_OutFileRoot)//'_PointLoad', ErrStat, ErrMsg ); call CheckError() + call MeshWrVTKreference( (/0.0_SiKi, 0.0_SiKi, 0.0_SiKi /), BD_Input(1)%DistrLoad, trim(DvrData%VTK_OutFileRoot)//'_DistrLoad', ErrStat, ErrMsg ); call CheckError() + endif + ! Write VTK reference if requested (ref is (0,0,0) + if (DvrData%WrVTK == 2) then + n_t_vtk = 0 + call MeshWrVTK( (/0.0_SiKi, 0.0_SiKi, 0.0_SiKi /), BD_Output%BldMotion, trim(DvrData%VTK_OutFileRoot)//'_BldMotion', n_t_vtk, .true., ErrStat, ErrMsg, DvrData%VTK_tWidth ) + call MeshWrVTK( (/0.0_SiKi, 0.0_SiKi, 0.0_SiKi /), BD_Input(1)%PointLoad, trim(DvrData%VTK_OutFileRoot)//'_PointLoad', n_t_vtk, .true., ErrStat, ErrMsg, DvrData%VTK_tWidth ) + call MeshWrVTK( (/0.0_SiKi, 0.0_SiKi, 0.0_SiKi /), BD_Input(1)%DistrLoad, trim(DvrData%VTK_OutFileRoot)//'_DistrLoad', n_t_vtk, .true., ErrStat, ErrMsg, DvrData%VTK_tWidth ) + call CheckError() + endif !......................... @@ -208,6 +224,18 @@ PROGRAM BeamDyn_Driver_Program CALL Dvr_WriteOutputLine(t_global,DvrOut,BD_Parameter%OutFmt,BD_Output) + ! Write VTK reference if requested (ref is (0,0,0) + if (DvrData%WrVTK == 2) then + if ( MOD( n_t_global, DvrData%n_VTKTime ) == 0 ) then + n_t_vtk = n_t_vtk + 1 + call MeshWrVTK( (/0.0_SiKi, 0.0_SiKi, 0.0_SiKi /), BD_Output%BldMotion, trim(DvrData%VTK_OutFileRoot)//'_BldMotion', n_t_vtk, .true., ErrStat, ErrMsg, DvrData%VTK_tWidth ) + call MeshWrVTK( (/0.0_SiKi, 0.0_SiKi, 0.0_SiKi /), BD_Input(1)%PointLoad, trim(DvrData%VTK_OutFileRoot)//'_PointLoad', n_t_vtk, .true., ErrStat, ErrMsg, DvrData%VTK_tWidth ) + call MeshWrVTK( (/0.0_SiKi, 0.0_SiKi, 0.0_SiKi /), BD_Input(1)%DistrLoad, trim(DvrData%VTK_OutFileRoot)//'_DistrLoad', n_t_vtk, .true., ErrStat, ErrMsg, DvrData%VTK_tWidth ) + call CheckError() + endif + endif + + if ( MOD( n_t_global + 1, 100 ) == 0 ) call SimStatus( TiLstPrn, PrevClockTime, t_global, DvrData%t_final ) ENDDO @@ -264,4 +292,38 @@ subroutine CheckError() end subroutine CheckError + subroutine SetVTKvars() + real(R8Ki) :: TmpTime + real(R8Ki) :: TmpRate + real(R8Ki) :: TotalTime + + DvrData%VTK_OutFileRoot = trim(BD_InitInput%RootName) + n_t_vtk = 0 ! first VTK output number + + ! convert frames-per-second to seconds per sample: + TotalTime = DvrData%t_final - DvrData%t_initial + if ( DvrData%VTK_fps == 0 ) then + TmpTime = TotalTime + dt_global + else + TmpTime = 1.0_R8Ki / DvrData%VTK_fps + endif + + ! now save the number of time steps between VTK file output: + if (TmpTime > TotalTime) then + DvrData%n_VTKTime = HUGE(DvrData%n_VTKTime) + else + DvrData%n_VTKTime = NINT( TmpTime / dt_global ) + ! I'll warn if p%n_VTKTime*p%DT is not TmpTime + IF (DvrData%WrVTK == 2) THEN + TmpRate = DvrData%n_VTKTime*dt_global + if (.not. EqualRealNos(TmpRate, TmpTime)) then + call WrScr('1/VTK_fps is not an integer multiple of DT. FAST will output VTK information at '//& + trim(num2lstr(1.0_DbKi/TmpRate))//' fps, the closest rate possible.') + end if + end if + end if + + DvrData%VTK_tWidth = CEILING( log10( real(n_t_final, ReKi) / DvrData%n_VTKTime ) ) + 1 + end subroutine SetVTKvars + END PROGRAM BeamDyn_Driver_Program diff --git a/modules/beamdyn/src/Driver_Beam_Subs.f90 b/modules/beamdyn/src/Driver_Beam_Subs.f90 index ca4ea3df47..7d8141b7c8 100644 --- a/modules/beamdyn/src/Driver_Beam_Subs.f90 +++ b/modules/beamdyn/src/Driver_Beam_Subs.f90 @@ -47,7 +47,13 @@ module BeamDyn_driver_subs REAL(DbKi) :: RootRelInit(3,3) ! Initial root orientation relative to GlbRot REAL(DbKi) :: t_initial REAL(DbKi) :: t_final - REAL(R8Ki) :: w ! magnitude of rotational velocity vector + REAL(R8Ki) :: w ! magnitude of rotational velocity vector + + INTEGER(IntKi) :: WrVTK ! VTK visualization data output: (switch) {0=none; 1=init; 2=animation} + INTEGER(IntKi) :: VTK_fps ! Frame rate for VTK output (frames per second) {will use closest integer multiple of DT} [used only if WrVTK=2] + INTEGER(IntKi) :: n_VTKTime ! Number of time steps between writing VTK files + INTEGER(IntKi) :: VTK_tWidth ! number of digits in the time part of file name + character(1024) :: VTK_OutFileRoot ! rootname for the output file END TYPE @@ -95,187 +101,95 @@ SUBROUTINE BD_ReadDvrFile(DvrInputFile,dt,InitInputData,DvrData,& ErrMsg = "" UnEc = -1 - CALL GetNewUnit(UnIn,ErrStat2,ErrMsg2) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL OpenFInpFile(UnIn,DvrInputFile,ErrStat2,ErrMsg2) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - IF (ErrStat >= AbortErrLev) RETURN + CALL GetNewUnit(UnIn,ErrStat2,ErrMsg2); if (Failed()) return; + CALL OpenFInpFile(UnIn,DvrInputFile,ErrStat2,ErrMsg2); if (Failed()) return; CALL GetPath( DvrInputFile, PriPath ) ! Input files will be relative to the path where the primary input file is located. !-------------------------- HEADER --------------------------------------------- - CALL ReadCom(UnIn,DvrInputFile,'File Header: Module Version (line 1)',ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - - CALL ReadStr(UnIn,DvrInputFile,FTitle,'FTitle','File Header: File Description (line 2)',ErrStat2, ErrMsg2, UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - if (ErrStat >= AbortErrLev) then - call cleanup() - return - end if + CALL ReadCom(UnIn,DvrInputFile,'File Header: Module Version (line 1)',ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadStr(UnIn,DvrInputFile,FTitle,'FTitle','File Header: File Description (line 2)',ErrStat2, ErrMsg2, UnEc); if (Failed()) return; !---------------------- SIMULATION CONTROL -------------------------------------- - CALL ReadCom(UnIn,DvrInputFile,'Section Header: Simulation Control',ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - - CALL ReadVar(UnIn,DvrInputFile,DvrData%DynamicSolve,'DynamicSolve','Use Dynamic solve (false for static solve).',ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - - CALL ReadVar(UnIn,DvrInputFile,DvrData%t_initial,'t_initial','Starting time of simulation',ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - - CALL ReadVar(UnIn,DvrInputFile,DvrData%t_final,"t_final", "Ending time of simulation",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - + CALL ReadCom(UnIn,DvrInputFile,'Section Header: Simulation Control',ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,DvrData%DynamicSolve,'DynamicSolve','Use Dynamic solve (false for static solve).',ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,DvrData%t_initial,'t_initial','Starting time of simulation',ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,DvrData%t_final,"t_final", "Ending time of simulation",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; CALL ReadVar(UnIn,DvrInputFile,dt,"dt", "Time increment size",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) !---------------------- GRAVITY PARAMETER -------------------------------------- CALL ReadCom(UnIn,DvrInputFile,'Section Header: Gravity Parameter',ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) InitInputData%gravity(:) = 0.0_ReKi - CALL ReadVar(UnIn,DvrInputFile,InitInputData%gravity(1),"InitInputData%gravity(1)", "gravity vector X",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadVar(UnIn,DvrInputFile,InitInputData%gravity(2),"InitInputData%gravity(2)", "gravity vector Y",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadVar(UnIn,DvrInputFile,InitInputData%gravity(3),"InitInputData%gravity(3)", "gravity vector Z",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - if (ErrStat >= AbortErrLev) then - call cleanup() - return - end if + CALL ReadVar(UnIn,DvrInputFile,InitInputData%gravity(1),"InitInputData%gravity(1)", "gravity vector X",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,InitInputData%gravity(2),"InitInputData%gravity(2)", "gravity vector Y",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,InitInputData%gravity(3),"InitInputData%gravity(3)", "gravity vector Z",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + !---------------------- FRAME PARAMETER -------------------------------------- - CALL ReadCom(UnIn,DvrInputFile,'Section Header: Frame Parameter',ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) + CALL ReadCom(UnIn,DvrInputFile,'Section Header: Frame Parameter',ErrStat2,ErrMsg2,UnEc); if (Failed()) return; InitInputData%GlbPos(:) = 0.0_ReKi InitInputData%GlbRot(:,:) = 0.0_R8Ki InitInputData%RootOri(:,:) = 0.0_R8Ki - CALL ReadVar(UnIn,DvrInputFile,InitInputData%GlbPos(1),"InitInputData%GlbPos(1)", "position vector X",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadVar(UnIn,DvrInputFile,InitInputData%GlbPos(2),"InitInputData%GlbPos(2)", "position vector Y",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadVar(UnIn,DvrInputFile,InitInputData%GlbPos(3),"InitInputData%GlbPos(3)", "position vector Z",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) + CALL ReadVar(UnIn,DvrInputFile,InitInputData%GlbPos(1),"InitInputData%GlbPos(1)", "position vector X",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,InitInputData%GlbPos(2),"InitInputData%GlbPos(2)", "position vector Y",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,InitInputData%GlbPos(3),"InitInputData%GlbPos(3)", "position vector Z",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; - CALL ReadCom(UnIn,DvrInputFile,'Comments on DCM',ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadCom(UnIn,DvrInputFile,'Comments on DCM',ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) + CALL ReadCom(UnIn,DvrInputFile,'Comments on DCM',ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadCom(UnIn,DvrInputFile,'Comments on DCM',ErrStat2,ErrMsg2,UnEc); if (Failed()) return; DO i=1,3 CALL ReadAry(UnIn,DvrInputFile,InitInputData%RootOri(i,:),3,"InitInputData%RootOri",& - "Initial root orientation",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) + "Initial root orientation",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; ENDDO - CALL ReadVar(UnIn,DvrInputFile,DvrData%GlbRotBladeT0,"DvrData%GlbRotBladeT0","Is the blade initial orientation also the GlbRot calculation frame",ErrStat2,ErrMSg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - - if (ErrStat >= AbortErrLev) then - call cleanup() - return - end if + CALL ReadVar(UnIn,DvrInputFile,DvrData%GlbRotBladeT0,"DvrData%GlbRotBladeT0","Is the blade initial orientation also the GlbRot calculation frame",ErrStat2,ErrMSg2,UnEc); if (Failed()) return; ! Use the initial blade root orientation as the GlbRot reference orientation for all calculations? if ( DvrData%GlbRotBladeT0 ) then - ! Set the GlbRot matrix InitInputData%GlbRot = InitInputData%RootOri - CALL eye( DvrData%RootRelInit, ErrStat2, ErrMsg2 ) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - + CALL eye( DvrData%RootRelInit, ErrStat2, ErrMsg2 ); if (Failed()) return; else - ! Initialize the GlbRot matrix as the identity. Relative rotation for root to GlbRot DvrData%RootRelInit = InitInputData%RootOri - CALL eye( InitInputData%GlbRot, ErrStat2, ErrMsg2 ) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - - end if - - if (ErrStat >= AbortErrLev) then - call cleanup() - return + CALL eye( InitInputData%GlbRot, ErrStat2, ErrMsg2 ); if (Failed()) return; end if !---------------------- INITIAL VELOCITY PARAMETER -------------------------------- - CALL ReadCom(UnIn,DvrInputFile,'Section Header: Initial Velocity Parameter',ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - - CALL ReadVar(UnIn,DvrInputFile,InitInputData%RootVel(4),"InitInputData%IniRootVel(1)", "angular velocity vector X",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadVar(UnIn,DvrInputFile,InitInputData%RootVel(5),"InitInputData%IniRootVel(2)", "angular velocity vector Y",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadVar(UnIn,DvrInputFile,InitInputData%RootVel(6),"InitInputData%IniRootVel(3)", "angular velocity vector Z",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - if (ErrStat >= AbortErrLev) then - call cleanup() - return - end if - + CALL ReadCom(UnIn,DvrInputFile,'Section Header: Initial Velocity Parameter',ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,InitInputData%RootVel(4),"InitInputData%IniRootVel(1)", "angular velocity vector X",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,InitInputData%RootVel(5),"InitInputData%IniRootVel(2)", "angular velocity vector Y",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,InitInputData%RootVel(6),"InitInputData%IniRootVel(3)", "angular velocity vector Z",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; InitInputData%RootVel(1:3) = cross_product(InitInputData%RootVel(4:6),InitInputData%GlbPos(:)) !---------------------- APPLIED FORCE -------------------------------- - CALL ReadCom(UnIn,DvrInputFile,'Section Header: Applied Force',ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - - CALL ReadVar(UnIn,DvrInputFile,DvrData%DistrLoad(1),"InitInputData%DistrLoad(1)", "Distributed load vector X",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadVar(UnIn,DvrInputFile,DvrData%DistrLoad(2),"InitInputData%DistrLoad(2)", "Distributed load vector Y",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadVar(UnIn,DvrInputFile,DvrData%DistrLoad(3),"InitInputData%DistrLoad(3)", "Distributed load vector Z",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadVar(UnIn,DvrInputFile,DvrData%DistrLoad(4),"InitInputData%DistrLoad(4)", "Distributed load vector X",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadVar(UnIn,DvrInputFile,DvrData%DistrLoad(5),"InitInputData%DistrLoad(5)", "Distributed load vector Y",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadVar(UnIn,DvrInputFile,DvrData%DistrLoad(6),"InitInputData%DistrLoad(6)", "Distributed load vector Z",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadVar(UnIn,DvrInputFile,DvrData%TipLoad(1),"InitInputData%TipLoad(1)", "Tip load vector X",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadVar(UnIn,DvrInputFile,DvrData%TipLoad(2),"InitInputData%TipLoad(2)", "Tip load vector Y",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadVar(UnIn,DvrInputFile,DvrData%TipLoad(3),"InitInputData%TipLoad(3)", "Tip load vector Z",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadVar(UnIn,DvrInputFile,DvrData%TipLoad(4),"InitInputData%TipLoad(4)", "Tip load vector X",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadVar(UnIn,DvrInputFile,DvrData%TipLoad(5),"InitInputData%TipLoad(5)", "Tip load vector Y",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadVar(UnIn,DvrInputFile,DvrData%TipLoad(6),"InitInputData%TipLoad(6)", "Tip load vector Z",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - if (ErrStat >= AbortErrLev) then - call cleanup() - return - end if + CALL ReadCom(UnIn,DvrInputFile,'Section Header: Applied Force',ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,DvrData%DistrLoad(1),"InitInputData%DistrLoad(1)", "Distributed load vector X",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,DvrData%DistrLoad(2),"InitInputData%DistrLoad(2)", "Distributed load vector Y",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,DvrData%DistrLoad(3),"InitInputData%DistrLoad(3)", "Distributed load vector Z",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,DvrData%DistrLoad(4),"InitInputData%DistrLoad(4)", "Distributed load vector X",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,DvrData%DistrLoad(5),"InitInputData%DistrLoad(5)", "Distributed load vector Y",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,DvrData%DistrLoad(6),"InitInputData%DistrLoad(6)", "Distributed load vector Z",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,DvrData%TipLoad(1),"InitInputData%TipLoad(1)", "Tip load vector X",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,DvrData%TipLoad(2),"InitInputData%TipLoad(2)", "Tip load vector Y",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,DvrData%TipLoad(3),"InitInputData%TipLoad(3)", "Tip load vector Z",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,DvrData%TipLoad(4),"InitInputData%TipLoad(4)", "Tip load vector X",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,DvrData%TipLoad(5),"InitInputData%TipLoad(5)", "Tip load vector Y",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,DvrData%TipLoad(6),"InitInputData%TipLoad(6)", "Tip load vector Z",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; !---------------------- MULTI-POINT LOAD INPUTS ---------------------------------------- !First read into temporary "line" variable so we can check if this is numeric or not (for backward compatibility) - CALL ReadVar(UnIn,DvrInputFile,line,"DvrData%NumPointLoads", "Number of Point Loads (primary input file section header)",ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - if (ErrStat >= AbortErrLev) then - call cleanup() - return - end if + CALL ReadVar(UnIn,DvrInputFile,line,"DvrData%NumPointLoads", "Number of Point Loads (primary input file section header)",ErrStat2,ErrMsg2,UnEc); if (Failed()) return; READ( Line, *, IOSTAT=IOS) DvrData%NumPointLoads if (IOS == 0) then !this is numeric, so we can go ahead with the multi-point loads - CALL ReadCom(UnIn,DvrInputFile,'Multiple Point Loads Table',ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL ReadCom(UnIn,DvrInputFile,'Multiple Point Loads Table Units',ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - CALL AllocAry(DvrData%MultiPointLoad,max(1,DvrData%NumPointLoads),7,'Point loads input array',ErrStat2,ErrMsg2) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - if (ErrStat >= AbortErrLev) then - call cleanup() - return - end if - + CALL ReadCom(UnIn,DvrInputFile,'Multiple Point Loads Table',ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadCom(UnIn,DvrInputFile,'Multiple Point Loads Table Units',ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL AllocAry(DvrData%MultiPointLoad,max(1,DvrData%NumPointLoads),7,'Point loads input array',ErrStat2,ErrMsg2); if (Failed()) return; DvrData%MultiPointLoad = 0.0_ReKi ! this must have at least one node, and it will be initialized to 0 DO i = 1,DvrData%NumPointLoads - CALL ReadAry( UnIn, DvrInputFile, TmpReAry, 7, 'PointLoad', 'Nodal point loads - Node No., DOF No., ', ErrStat2, ErrMsg2, UnEc ) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) + CALL ReadAry( UnIn, DvrInputFile, TmpReAry, 7, 'PointLoad', 'Nodal point loads - Node No., DOF No., ', ErrStat2, ErrMsg2, UnEc ); if (Failed()) return; DvrData%MultiPointLoad(i,1) = TmpReAry(1) DvrData%MultiPointLoad(i,2) = TmpReAry(2) DvrData%MultiPointLoad(i,3) = TmpReAry(3) @@ -284,37 +198,34 @@ SUBROUTINE BD_ReadDvrFile(DvrInputFile,dt,InitInputData,DvrData,& DvrData%MultiPointLoad(i,6) = TmpReAry(6) DvrData%MultiPointLoad(i,7) = TmpReAry(7) ENDDO - if (ErrStat >= AbortErrLev) then - call cleanup() - return - end if DvrData%NumPointLoads = max(1,DvrData%NumPointLoads) !---------------------- BEAM SECTIONAL PARAMETER ---------------------------------------- - CALL ReadCom(UnIn,DvrInputFile,'Section Header: Primary input file',ErrStat2,ErrMsg2,UnEc) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) + CALL ReadCom(UnIn,DvrInputFile,'Section Header: Primary input file',ErrStat2,ErrMsg2,UnEc); if (Failed()) return; else DvrData%NumPointLoads = 1 - CALL AllocAry(DvrData%MultiPointLoad,DvrData%NumPointLoads,7,'Point loads input array',ErrStat2,ErrMsg2) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - if (ErrStat >= AbortErrLev) then - call cleanup() - return - end if + CALL AllocAry(DvrData%MultiPointLoad,DvrData%NumPointLoads,7,'Point loads input array',ErrStat2,ErrMsg2); if (Failed()) return; DvrData%MultiPointLoad = 0.0_ReKi end if ! we read the header already !---------------------- BEAM SECTIONAL PARAMETER ---------------------------------------- - CALL ReadVar ( UnIn, DvrInputFile, InitInputData%InputFile, 'InputFile', 'Name of the primary input file', ErrStat2,ErrMsg2, UnEc ) - CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) + CALL ReadVar ( UnIn, DvrInputFile, InitInputData%InputFile, 'InputFile', 'Name of the primary input file', ErrStat2,ErrMsg2, UnEc ); if (Failed()) return; IF ( PathIsRelative( InitInputData%InputFile ) ) InitInputData%InputFile = TRIM(PriPath)//TRIM(InitInputData%InputFile) - if (ErrStat >= AbortErrLev) then - call cleanup() - return - end if + !---------------------- Outputs --------------------------------------------------------- + CALL ReadCom(UnIn,DvrInputFile,'Section Header: Outputs',ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,DvrData%WrVTK,'WrVTK','WrVTK',ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + CALL ReadVar(UnIn,DvrInputFile,DvrData%VTK_fps,'VTK_fps','VTK_fps',ErrStat2,ErrMsg2,UnEc); if (Failed()) return; + + ! FIXME: added error check here, but probably should be done with more comprehensive error checks on the input file + if (DvrData%WrVTK < 0 .or. DvrData%WrVTK > 2) then + ErrStat2 = ErrID_Fatal; ErrMsg2 = "WrVTK must be 0=none; 1=init; 2=animation"; + if (Failed()) return; + endif + + call cleanup() return @@ -323,7 +234,13 @@ SUBROUTINE BD_ReadDvrFile(DvrInputFile,dt,InitInputData,DvrData,& subroutine cleanup() close(UnIn) return - end subroutine cleanup + end subroutine cleanup + logical function Failed() + call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, 'BD_ReadDvrFile') + Failed = ErrStat>=ErrID_Fatal + if (Failed) call cleanup() + return + end function Failed END SUBROUTINE BD_ReadDvrFile SUBROUTINE Dvr_InitializeOutputFile(OutUnit,IntOutput,RootName,ErrStat,ErrMsg) diff --git a/modules/elastodyn/src/ED_UserSubs.f90 b/modules/elastodyn/src/ED_UserSubs.f90 index 5184e81592..de368c02eb 100644 --- a/modules/elastodyn/src/ED_UserSubs.f90 +++ b/modules/elastodyn/src/ED_UserSubs.f90 @@ -32,9 +32,6 @@ SUBROUTINE UserRFrl ( RFrlDef, RFrlRate, ZTime, DirRoot, RFrlMom ) ! This technique is useful, for example, if the rotor-furl hinge has ! an electromagnetic latch that will unlock and relock the hinge under ! certain specified conditions. - ! Note that this technique WILL NOT work for user-defined routines - ! written for ADAMS datasets extracted using the FAST-to-ADAMS - ! preprocessor. USE Precision @@ -78,9 +75,6 @@ SUBROUTINE UserTeet ( TeetDef, TeetRate, ZTime, DirRoot, TeetMom ) ! This technique is useful, for example, if the teeter hinge has ! an electromagnetic latch that will unlock and relock the hinge under ! certain specified conditions. - ! Note that this technique WILL NOT work for user-defined routines - ! written for ADAMS datasets extracted using the FAST-to-ADAMS - ! preprocessor. USE Precision @@ -124,9 +118,6 @@ SUBROUTINE UserTFrl ( TFrlDef, TFrlRate, ZTime, DirRoot, TFrlMom ) ! This technique is useful, for example, if the tail-furl hinge has ! an electromagnetic latch that will unlock and relock the hinge under ! certain specified conditions. - ! Note that this technique WILL NOT work for user-defined routines - ! written for ADAMS datasets extracted using the FAST-to-ADAMS - ! preprocessor. USE Precision diff --git a/modules/elastodyn/src/ElastoDyn.f90 b/modules/elastodyn/src/ElastoDyn.f90 index 568adecf7f..e6d061ff40 100644 --- a/modules/elastodyn/src/ElastoDyn.f90 +++ b/modules/elastodyn/src/ElastoDyn.f90 @@ -98,7 +98,6 @@ SUBROUTINE ED_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut TYPE(ED_InputFile) :: InputFileData ! Data stored in the module's input file INTEGER(IntKi) :: ErrStat2 ! temporary Error status of the operation INTEGER(IntKi) :: i, K ! loop counters - LOGICAL, PARAMETER :: GetAdamsVals = .FALSE. ! Determines if we should read Adams values and create (update) an Adams model CHARACTER(ErrMsgLen) :: ErrMsg2 ! temporary Error message if ErrStat /= ErrID_None REAL(R8Ki) :: TransMat(3,3) ! Initial rotation matrix at Platform Refz @@ -127,7 +126,7 @@ SUBROUTINE ED_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut p%Gravity = InitInp%Gravity - CALL ED_ReadInput( InitInp%InputFile, InitInp%ADInputFile, InputFileData, GetAdamsVals, p%BD4Blades, Interval, p%RootName, ErrStat2, ErrMsg2 ) + CALL ED_ReadInput( InitInp%InputFile, InitInp%ADInputFile, InputFileData, p%BD4Blades, Interval, p%RootName, ErrStat2, ErrMsg2 ) CALL CheckError( ErrStat2, ErrMsg2 ) IF ( ErrStat >= AbortErrLev ) RETURN @@ -304,7 +303,7 @@ SUBROUTINE ED_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut ! Print the summary file if requested: IF (InputFileData%SumPrint) THEN - CALL ED_PrintSum( p, OtherState, GetAdamsVals, ErrStat2, ErrMsg2 ) + CALL ED_PrintSum( p, OtherState, ErrStat2, ErrMsg2 ) CALL CheckError( ErrStat2, ErrMsg2 ) IF (ErrStat >= AbortErrLev) RETURN END IF @@ -2509,17 +2508,10 @@ SUBROUTINE SetBladeParameters( p, BladeInData, BladeMeshData, ErrStat, ErrMsg ) INTEGER(IntKi ) :: K ! Blade number INTEGER(IntKi ) :: J ! Index for the node arrays INTEGER(IntKi) :: InterpInd ! Index for the interpolation routine - LOGICAL :: SetAdmVals ! Logical to determine if Adams inputs should be set ! initialize variables ErrStat = ErrID_None ErrMsg = '' - - IF (p%BD4Blades) THEN - SetAdmVals = .FALSE. - ELSE - SetAdmVals = ALLOCATED( BladeInData(1)%GJStff ) - END IF ! .............................................................................................................................. @@ -2540,7 +2532,7 @@ SUBROUTINE SetBladeParameters( p, BladeInData, BladeMeshData, ErrStat, ErrMsg ) ! .......... Allocate arrays for the blade parameters being set in this routine ..........: - CALL Alloc_BladeParameters( p, SetAdmVals, ErrStat, ErrMsg ) + CALL Alloc_BladeParameters( p, ErrStat, ErrMsg ) IF ( ErrStat /= ErrID_None ) RETURN @@ -2601,17 +2593,6 @@ SUBROUTINE SetBladeParameters( p, BladeInData, BladeMeshData, ErrStat, ErrMsg ) ! BMassDen MassB Lineal mass density ! FlpStff StiffBF Flapwise stiffness ! EdgStff StiffBE Edgewise stiffness - ! GJStff StiffBGJ Blade torsional stiffness - ! EAStff StiffBEA Blade extensional stiffness - ! Alpha BAlpha Blade flap/twist coupling coefficient - ! FlpIner InerBFlp Blade flap (about local structural yb-axis) mass inertia per unit length - ! EdgIner InerBEdg Blade edge (about local structural xb-axis) mass inertia per unit length - ! PrecrvRef RefAxisxb Blade offset for defining the reference axis from the pitch axis for precurved blades (along xb-axis) - ! PreswpRef RefAxisyb Blade offset for defining the reference axis from the pitch axis for preswept blades (along yb-axis) - ! FlpcgOf cgOffBFlp Blade flap mass cg offset - ! EdgcgOf cgOffBEdg Blade edge mass cg offset - ! FlpEAOf EAOffBFlp Blade flap elastic axis offset - ! EdgEAOf EAOffBEdg Blade edge elastic axis offset ! Define RNodesNorm() which is common to all the blades: @@ -2653,30 +2634,8 @@ SUBROUTINE SetBladeParameters( p, BladeInData, BladeMeshData, ErrStat, ErrMsg ) p%StiffBF (K,J) = InterpAry( x, BladeInData(K)%FlpStff , InterpInd ) p%StiffBE (K,J) = InterpAry( x, BladeInData(K)%EdgStff , InterpInd ) - IF ( SetAdmVals ) THEN - p%StiffBGJ (K,J) = InterpAry( x, BladeInData(K)%GJStff , InterpInd ) - p%StiffBEA (K,J) = InterpAry( x, BladeInData(K)%EAStff , InterpInd ) - p%BAlpha (K,J) = InterpAry( x, BladeInData(K)%Alpha , InterpInd ) - p%InerBFlp (K,J) = InterpAry( x, BladeInData(K)%FlpIner , InterpInd ) - p%InerBEdg (K,J) = InterpAry( x, BladeInData(K)%EdgIner , InterpInd ) - p%RefAxisxb(K,J) = InterpAry( x, BladeInData(K)%PrecrvRef, InterpInd ) - p%RefAxisyb(K,J) = InterpAry( x, BladeInData(K)%PreswpRef, InterpInd ) - p%cgOffBFlp(K,J) = InterpAry( x, BladeInData(K)%FlpcgOf , InterpInd ) - p%cgOffBEdg(K,J) = InterpAry( x, BladeInData(K)%EdgcgOf , InterpInd ) - p%EAOffBFlp(K,J) = InterpAry( x, BladeInData(K)%FlpEAOf , InterpInd ) - p%EAOffBEdg(K,J) = InterpAry( x, BladeInData(K)%EdgEAOf , InterpInd ) - END IF - - - END DO ! J (Blade nodes) - IF ( SetAdmVals ) THEN - ! Set the valus for the tip node - p%RefAxisxb(K,p%TipNode) = BladeInData(K)%PrecrvRef( BladeInData(K)%NBlInpSt ) - p%RefAxisyb(K,p%TipNode) = BladeInData(K)%PreswpRef( BladeInData(K)%NBlInpSt ) - END IF - ! Set the blade damping and stiffness tuner p%BldFDamp(K,:) = BladeInData(K)%BldFlDmp @@ -2742,11 +2701,10 @@ END FUNCTION InterpAry END SUBROUTINE SetBladeParameters !---------------------------------------------------------------------------------------------------------------------------------- !> This routine allocates arrays for the blade parameters. -SUBROUTINE Alloc_BladeParameters( p, AllocAdams, ErrStat, ErrMsg ) +SUBROUTINE Alloc_BladeParameters( p, ErrStat, ErrMsg ) !.................................................................................................................................. TYPE(ED_ParameterType), INTENT(INOUT) :: p !< The parameters of the structural dynamics module - LOGICAL, INTENT(IN) :: AllocAdams !< Logical to determine if Adams inputs should be allocated INTEGER(IntKi), INTENT(OUT) :: ErrStat !< Error status CHARACTER(*), INTENT(OUT) :: ErrMsg !< Err msg @@ -2778,31 +2736,6 @@ SUBROUTINE Alloc_BladeParameters( p, AllocAdams, ErrStat, ErrMsg ) CALL AllocAry ( p%StiffBE, p%NumBl, p%BldNodes, 'StiffBE' , ErrStat, ErrMsg ); IF ( ErrStat /= ErrID_None ) RETURN - IF ( AllocAdams ) THEN - CALL AllocAry ( p%StiffBGJ, p%NumBl, p%BldNodes, 'StiffBGJ' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( p%StiffBEA, p%NumBl, p%BldNodes, 'StiffBEA' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( p%BAlpha, p%NumBl, p%BldNodes, 'BAlpha' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( p%InerBFlp, p%NumBl, p%BldNodes, 'InerBFlp' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( p%InerBEdg, p%NumBl, p%BldNodes, 'InerBEdg' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( p%RefAxisxb, p%NumBl, p%TipNode, 'RefAxisxb' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( p%RefAxisyb, p%NumBl, p%TipNode, 'RefAxisyb' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( p%cgOffBFlp, p%NumBl, p%BldNodes, 'cgOffBFlp' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( p%cgOffBEdg, p%NumBl, p%BldNodes, 'cgOffBEdg' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( p%EAOffBFlp, p%NumBl, p%BldNodes, 'EAOffBFlp' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( p%EAOffBEdg, p%NumBl, p%BldNodes, 'EAOffBEdg' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - END IF - CALL AllocAry ( p%BldEDamp, p%NumBl, NumBE, 'BldEDamp' , ErrStat, ErrMsg ) IF ( ErrStat /= ErrID_None ) RETURN CALL AllocAry ( p%BldFDamp, p%NumBl, NumBF, 'BldFDamp' , ErrStat, ErrMsg ) @@ -2824,11 +2757,10 @@ SUBROUTINE Alloc_BladeParameters( p, AllocAdams, ErrStat, ErrMsg ) END SUBROUTINE Alloc_BladeParameters !---------------------------------------------------------------------------------------------------------------------------------- !> This routine allocates arrays for the tower parameters. -SUBROUTINE Alloc_TowerParameters( p, AllocAdams, ErrStat, ErrMsg ) +SUBROUTINE Alloc_TowerParameters( p, ErrStat, ErrMsg ) !.................................................................................................................................. TYPE(ED_ParameterType), INTENT(INOUT) :: p !< The parameters of the structural dynamics module - LOGICAL, INTENT(IN) :: AllocAdams !< Logical to determine if Adams inputs should be allocated INTEGER(IntKi), INTENT(OUT) :: ErrStat !< Error status CHARACTER(*), INTENT(OUT) :: ErrMsg !< Err msg @@ -2849,20 +2781,6 @@ SUBROUTINE Alloc_TowerParameters( p, AllocAdams, ErrStat, ErrMsg ) CALL AllocAry ( p%StiffTSS, p%TwrNodes, 'StiffTSS' , ErrStat, ErrMsg ) IF ( ErrStat /= ErrID_None ) RETURN - IF ( AllocAdams ) THEN - CALL AllocAry ( p%StiffTGJ, p%TwrNodes, 'StiffTGJ' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( p%StiffTEA, p%TwrNodes, 'StiffTEA' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( p%InerTFA, p%TwrNodes, 'InerTFA' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( p%InerTSS, p%TwrNodes, 'InerTSS' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( p%cgOffTFA, p%TwrNodes, 'cgOffTFA' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( p%cgOffTSS, p%TwrNodes, 'cgOffTSS' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - END IF ! ! these are for HydroDyn? !CALL AllocAry ( p%DiamT, p%TwrNodes, 'DiamT' , ErrStat, ErrMsg ) @@ -3242,15 +3160,13 @@ SUBROUTINE SetTowerParameters( p, InputFileData, ErrStat, ErrMsg ) REAL(ReKi) :: x ! Fractional location between two points in linear interpolation INTEGER(IntKi ) :: J ! Index for the node arrays INTEGER(IntKi) :: InterpInd ! Index for the interpolation routine - LOGICAL :: SetAdmVals ! Logical to determine if Adams inputs should be set ! Initialize data ErrStat = ErrID_None ErrMsg = '' - SetAdmVals = ALLOCATED( InputFileData%TwGJStif ) - CALL Alloc_TowerParameters( p, SetAdmVals, ErrStat, ErrMsg ) + CALL Alloc_TowerParameters( p, ErrStat, ErrMsg ) IF ( ErrStat /= ErrID_None ) RETURN @@ -3283,12 +3199,6 @@ SUBROUTINE SetTowerParameters( p, InputFileData, ErrStat, ErrMsg ) ! TMassDen MassT Lineal mass density ! TwFAStif StiffTFA Tower fore-aft stiffness ! TwSSStif StiffTSS Tower side-to-side stiffness - ! TwGJStif StiffTGJ Tower torsional stiffness - ! TwEAStif StiffTEA Tower extensional stiffness - ! TwFAIner InerTFA Tower fore-aft (about yt-axis) mass inertia per unit length - ! TwSSIner InerTSS Tower side-to-side (about xt-axis) mass inertia per unit length - ! TwFAcgOf cgOffTFA Tower fore-aft mass cg offset - ! TwSScgOf cgOffTSS Tower side-to-side mass cg offset InterpInd = 1 @@ -3302,18 +3212,6 @@ SUBROUTINE SetTowerParameters( p, InputFileData, ErrStat, ErrMsg ) END DO ! J - IF ( SetAdmVals ) THEN ! An ADAMS model will be created; thus, read in all the cols. - DO J=1,p%TwrNodes - p%StiffTGJ (J) = InterpStp( p%HNodesNorm(J), InputFileData%HtFract, InputFileData%TwGJStif, InterpInd, InputFileData%NTwInpSt ) - p%StiffTEA (J) = InterpStp( p%HNodesNorm(J), InputFileData%HtFract, InputFileData%TwEAStif, InterpInd, InputFileData%NTwInpSt ) - p%InerTFA (J) = InterpStp( p%HNodesNorm(J), InputFileData%HtFract, InputFileData%TwFAIner, InterpInd, InputFileData%NTwInpSt ) - p%InerTSS (J) = InterpStp( p%HNodesNorm(J), InputFileData%HtFract, InputFileData%TwSSIner, InterpInd, InputFileData%NTwInpSt ) - p%cgOffTFA (J) = InterpStp( p%HNodesNorm(J), InputFileData%HtFract, InputFileData%TwFAcgOf, InterpInd, InputFileData%NTwInpSt ) - p%cgOffTSS (J) = InterpStp( p%HNodesNorm(J), InputFileData%HtFract, InputFileData%TwSScgOf, InterpInd, InputFileData%NTwInpSt ) - END DO ! J - END IF - - !............................................................................................................................... ! Set other tower parameters: !............................................................................................................................... @@ -9831,12 +9729,11 @@ END SUBROUTINE CheckError END SUBROUTINE ED_ABM4 !---------------------------------------------------------------------------------------------------------------------------------- !> This routine generates the summary file, which contains a regurgitation of the input data and interpolated flexible body data. -SUBROUTINE ED_PrintSum( p, OtherState, GenerateAdamsModel, ErrStat, ErrMsg ) +SUBROUTINE ED_PrintSum( p, OtherState, ErrStat, ErrMsg ) ! passed variables TYPE(ED_ParameterType), INTENT(IN ) :: p !< Parameters of the structural dynamics module TYPE(ED_OtherStateType), INTENT(IN ) :: OtherState !< Other states of the structural dynamics module - LOGICAL, INTENT(IN ) :: GenerateAdamsModel !< Logical to determine if Adams inputs were read/should be summarized INTEGER(IntKi), INTENT( OUT) :: ErrStat !< Error status of the operation CHARACTER(*), INTENT( OUT) :: ErrMsg !< Error message if ErrStat /= ErrID_None @@ -9976,30 +9873,14 @@ SUBROUTINE ED_PrintSum( p, OtherState, GenerateAdamsModel, ErrStat, ErrMsg ) ! Interpolated tower properties. WRITE (UnSu,"(//,'Interpolated tower properties:',/)") - IF ( GenerateAdamsModel ) THEN ! An ADAMS model will be created; thus, print out all the cols. - WRITE (UnSu,'(A)') 'Node TwFract HNodes DHNodes TMassDen FAStiff SSStiff'// & - ' GJStiff EAStiff FAIner SSIner FAcgOff SScgOff' - WRITE (UnSu,'(A)') ' (-) (-) (m) (m) (kg/m) (Nm^2) (Nm^2)'// & - ' (Nm^2) (N) (kg m) (kg m) (m) (m)' + WRITE (UnSu,'(A)') 'Node TwFract HNodes DHNodes TMassDen FAStiff SSStiff' + WRITE (UnSu,'(A)') ' (-) (-) (m) (m) (kg/m) (Nm^2) (Nm^2)' - DO I=1,p%TwrNodes - WRITE(UnSu,'(I4,3F9.3,F10.3,4ES11.3,2F10.3,2F9.3)') I, p%HNodesNorm(I), p%HNodes(I), p%DHNodes(I), p%MassT(I), & - p%StiffTFA(I), p%StiffTSS(I), p%StiffTGJ(I), p%StiffTEA(I), & - p%InerTFA(I), p%InerTSS(I), p%cgOffTFA(I), p%cgOffTSS(I) - ENDDO ! I - - ELSE ! Only FAST will be run; thus, only print out the necessary cols. - - WRITE (UnSu,'(A)') 'Node TwFract HNodes DHNodes TMassDen FAStiff SSStiff' - WRITE (UnSu,'(A)') ' (-) (-) (m) (m) (kg/m) (Nm^2) (Nm^2)' - - DO I=1,p%TwrNodes - WRITE(UnSu,'(I4,3F9.3,F10.3,2ES11.3)') I, p%HNodesNorm(I), p%HNodes(I), p%DHNodes(I), p%MassT(I), & - p%StiffTFA(I), p%StiffTSS(I) - ENDDO ! I - - ENDIF + DO I=1,p%TwrNodes + WRITE(UnSu,'(I4,3F9.3,F10.3,2ES11.3)') I, p%HNodesNorm(I), p%HNodes(I), p%DHNodes(I), p%MassT(I), & + p%StiffTFA(I), p%StiffTSS(I) + ENDDO ! I ! Interpolated blade properties. @@ -10008,39 +9889,15 @@ SUBROUTINE ED_PrintSum( p, OtherState, GenerateAdamsModel, ErrStat, ErrMsg ) DO K=1,p%NumBl WRITE (UnSu,'(//,A,I1,A,/)') 'Interpolated blade ', K, ' properties:' - IF ( GenerateAdamsModel ) THEN ! An ADAMS model will be created; thus, print out all the cols. - - WRITE (UnSu,'(A)') 'Node BlFract RNodes DRNodes PitchAxis StrcTwst BMassDen FlpStff EdgStff'// & - ' GJStff EAStff Alpha FlpIner EdgIner PrecrvRef PreswpRef FlpcgOf EdgcgOf'// & - ' FlpEAOf EdgEAOf' - WRITE (UnSu,'(A)') ' (-) (-) (m) (m) (-) (deg) (kg/m) (Nm^2) (Nm^2)'// & - ' (Nm^2) (Nm^2) (-) (kg m) (kg m) (m) (m) (m) (m)'// & - ' (m) (m)' - - DO I=1,p%BldNodes - - WRITE(UnSu,'(I4,3F9.3,3F10.3,4ES11.3,F9.3,4F10.3,4F9.3)') I, p%RNodesNorm(I), p%RNodes(I) + p%HubRad, p%DRNodes(I), & - p%PitchAxis(K,I), p%ThetaS(K,I)*R2D, p%MassB(K,I), & - p%StiffBF(K,I), p%StiffBE(K,I), & - p%StiffBGJ(K,I), p%StiffBEA(K,I), & - p%BAlpha(K,I), p%InerBFlp(K,I), p%InerBEdg(K,I), & - p%RefAxisxb(K,I), p%RefAxisyb(K,I), & - p%cgOffBFlp(K,I), p%cgOffBEdg(K,I), & - p%EAOffBFlp(K,I), p%EAOffBEdg(K,I) - ENDDO ! I - - ELSE ! Only FAST will be run; thus, only print out the necessary cols. - - WRITE (UnSu,'(A)') 'Node BlFract RNodes DRNodes PitchAxis StrcTwst BMassDen FlpStff EdgStff' - WRITE (UnSu,'(A)') ' (-) (-) (m) (m) (-) (deg) (kg/m) (Nm^2) (Nm^2)' - - DO I=1,p%BldNodes - WRITE(UnSu,'(I4,3F9.3,3F10.3,2ES11.3)') I, p%RNodesNorm(I), p%RNodes(I) + p%HubRad, p%DRNodes(I), & - p%PitchAxis(K,I),p%ThetaS(K,I)*R2D, p%MassB(K,I), & - p%StiffBF(K,I), p%StiffBE(K,I) - ENDDO ! I - ENDIF + WRITE (UnSu,'(A)') 'Node BlFract RNodes DRNodes PitchAxis StrcTwst BMassDen FlpStff EdgStff' + WRITE (UnSu,'(A)') ' (-) (-) (m) (m) (-) (deg) (kg/m) (Nm^2) (Nm^2)' + + DO I=1,p%BldNodes + WRITE(UnSu,'(I4,3F9.3,3F10.3,2ES11.3)') I, p%RNodesNorm(I), p%RNodes(I) + p%HubRad, p%DRNodes(I), & + p%PitchAxis(K,I),p%ThetaS(K,I)*R2D, p%MassB(K,I), & + p%StiffBF(K,I), p%StiffBE(K,I) + ENDDO ! I ENDDO ! K diff --git a/modules/elastodyn/src/ElastoDyn_IO.f90 b/modules/elastodyn/src/ElastoDyn_IO.f90 index 3a13e5e800..7e74a3325c 100644 --- a/modules/elastodyn/src/ElastoDyn_IO.f90 +++ b/modules/elastodyn/src/ElastoDyn_IO.f90 @@ -1276,7 +1276,7 @@ MODULE ElastoDyn_IO !---------------------------------------------------------------------------------------------------------------------------------- !> This subroutine reads the input file and stores all the data in the ED_InputFile structure. !! It does not perform data validation. -SUBROUTINE ED_ReadInput( InputFileName, MeshFile, InputFileData, ReadAdmVals, BD4Blades, Default_DT, OutFileRoot, ErrStat, ErrMsg ) +SUBROUTINE ED_ReadInput( InputFileName, MeshFile, InputFileData, BD4Blades, Default_DT, OutFileRoot, ErrStat, ErrMsg ) !.................................................................................................................................. ! Passed variables @@ -1289,7 +1289,6 @@ SUBROUTINE ED_ReadInput( InputFileName, MeshFile, InputFileData, ReadAdmVals, BD TYPE(ED_InputFile), INTENT(OUT) :: InputFileData !< Data stored in the module's input file INTEGER(IntKi), INTENT(OUT) :: ErrStat !< The error status code - LOGICAL, INTENT(IN) :: ReadAdmVals !< Determines if we should read the Adams-only values LOGICAL, INTENT(IN) :: BD4Blades !< Determines if we should read the blade values (true=don't read this file; use BeamDyn for blades instead) CHARACTER(*), INTENT(OUT) :: ErrMsg !< The error message, if an error occurred @@ -1377,7 +1376,7 @@ SUBROUTINE ED_ReadInput( InputFileName, MeshFile, InputFileData, ReadAdmVals, BD ! get the blade input-file data (from blade and mesh files) IF (.NOT. BD4Blades) THEN - CALL ReadBladeInputs ( BldFile, MeshFile, ReadAdmVals, InputFileData, UnEcho, ErrStat2, ErrMsg2 ) + CALL ReadBladeInputs ( BldFile, MeshFile, InputFileData, UnEcho, ErrStat2, ErrMsg2 ) call SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName) if ( ErrStat >= AbortErrLev ) then call Cleanup() @@ -1387,7 +1386,7 @@ SUBROUTINE ED_ReadInput( InputFileName, MeshFile, InputFileData, ReadAdmVals, BD ! get the tower input-file data - CALL ReadTowerFile( TwrFile, InputFileData, ReadAdmVals, UnEcho, ErrStat2, ErrMsg2 ) + CALL ReadTowerFile( TwrFile, InputFileData, UnEcho, ErrStat2, ErrMsg2 ) call SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName) if ( ErrStat >= AbortErrLev ) then call Cleanup() @@ -1463,7 +1462,7 @@ END SUBROUTINE ED_ValidateInput !---------------------------------------------------------------------------------------------------------------------------------- !> This routine reads the data from the blade and mesh inputs files. !! This routines assumes that InputFileData%NumBl has already been set. -SUBROUTINE ReadBladeInputs ( BldFile, MeshFile, ReadAdmVals, InputFileData, UnEc, ErrStat, ErrMsg ) +SUBROUTINE ReadBladeInputs ( BldFile, MeshFile, InputFileData, UnEc, ErrStat, ErrMsg ) !.................................................................................................................................. ! Passed variables: @@ -1475,7 +1474,6 @@ SUBROUTINE ReadBladeInputs ( BldFile, MeshFile, ReadAdmVals, InputFileData, UnEc INTEGER(IntKi), INTENT(OUT) :: ErrStat !< The error ID CHARACTER(*), INTENT(OUT) :: ErrMsg !< Message describing error - LOGICAL, INTENT(IN) :: ReadAdmVals !< Logical to determine if Adams inputs should be read from file ! Local variables: @@ -1527,7 +1525,7 @@ SUBROUTINE ReadBladeInputs ( BldFile, MeshFile, ReadAdmVals, InputFileData, UnEc WRITE (UnEc,'(//,A,/)') 'Blade '//TRIM( Num2LStr( K ) )//' input data from file "'//TRIM( BldFile(K) )//'":' END IF - CALL ReadBladeFile( BldFile(K), InputFileData%InpBl(K), ReadAdmVals, UnEc, ErrStat2, ErrMsg2 ) + CALL ReadBladeFile( BldFile(K), InputFileData%InpBl(K), UnEc, ErrStat2, ErrMsg2 ) call SetErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName) IF ( ErrStat >= AbortErrLev ) RETURN @@ -1551,14 +1549,13 @@ SUBROUTINE ReadBladeInputs ( BldFile, MeshFile, ReadAdmVals, InputFileData, UnEc END SUBROUTINE ReadBladeInputs !---------------------------------------------------------------------------------------------------------------------------------- !> This routine reads a blade input file. -SUBROUTINE ReadBladeFile ( BldFile, BladeKInputFileData, ReadAdmVals, UnEc, ErrStat, ErrMsg ) +SUBROUTINE ReadBladeFile ( BldFile, BladeKInputFileData, UnEc, ErrStat, ErrMsg ) !.................................................................................................................................. ! Passed variables: TYPE(BladeInputData), INTENT(INOUT) :: BladeKInputFileData !< Data for Blade K stored in the module's input file CHARACTER(*), INTENT(IN) :: BldFile !< Name of the blade input file data - LOGICAL, INTENT(IN) :: ReadAdmVals !< Logical to determine if Adams inputs should be read from file INTEGER(IntKi), INTENT(IN) :: UnEc !< I/O unit for echo file. If present and > 0, write to UnEc INTEGER(IntKi), INTENT(OUT) :: ErrStat !< Error status @@ -1638,7 +1635,7 @@ SUBROUTINE ReadBladeFile ( BldFile, BladeKInputFileData, ReadAdmVals, UnEc, ErrS ! .......... Allocate the arrays based on this NBlInpSt input .......... - CALL Alloc_BladeInputProperties( BladeKInputFileData, ReadAdmVals, ErrStat2, ErrMsg2 ) + CALL Alloc_BladeInputProperties( BladeKInputFileData, ErrStat2, ErrMsg2 ) CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) IF ( ErrStat >= AbortErrLev ) THEN CALL Cleanup() @@ -1772,11 +1769,7 @@ SUBROUTINE ReadBladeFile ( BldFile, BladeKInputFileData, ReadAdmVals, UnEc, ErrS ! Read the table. - IF ( ReadAdmVals ) THEN - NInputCols = 17 - ELSE - NInputCols = 6 - END IF + NInputCols = 6 DO I=1,BladeKInputFileData%NBlInpSt @@ -1796,19 +1789,6 @@ SUBROUTINE ReadBladeFile ( BldFile, BladeKInputFileData, ReadAdmVals, UnEc, ErrS BladeKInputFileData%FlpStff( I) = TmpRAry(5)*AdjFlSt ! Apply the correction factors to the elemental data. BladeKInputFileData%EdgStff( I) = TmpRAry(6)*AdjEdSt ! Apply the correction factors to the elemental data. - IF ( NInputCols > 6 ) THEN - BladeKInputFileData%GJStff( I) = TmpRAry( 7) - BladeKInputFileData%EAStff( I) = TmpRAry( 8) - BladeKInputFileData%Alpha( I) = TmpRAry( 9) - BladeKInputFileData%FlpIner( I) = TmpRAry(10) - BladeKInputFileData%EdgIner( I) = TmpRAry(11) - BladeKInputFileData%PrecrvRef(I) = TmpRAry(12) - BladeKInputFileData%PreswpRef(I) = TmpRAry(13) - BladeKInputFileData%FlpcgOf( I) = TmpRAry(14) - BladeKInputFileData%EdgcgOf( I) = TmpRAry(15) - BladeKInputFileData%FlpEAOf( I) = TmpRAry(16) - BladeKInputFileData%EdgEAOf( I) = TmpRAry(17) - END IF ENDDO ! I @@ -2164,7 +2144,7 @@ end subroutine Fatal END SUBROUTINE ReadFurlFile !---------------------------------------------------------------------------------------------------------------------------------- !> This routine reads the tower file input. -SUBROUTINE ReadTowerFile( TwrFile, InputFileData, ReadAdmVals, UnEc, ErrStat, ErrMsg ) +SUBROUTINE ReadTowerFile( TwrFile, InputFileData, UnEc, ErrStat, ErrMsg ) !.................................................................................................................................. IMPLICIT NONE @@ -2173,7 +2153,6 @@ SUBROUTINE ReadTowerFile( TwrFile, InputFileData, ReadAdmVals, UnEc, ErrStat, Er INTEGER(IntKi), INTENT(OUT) :: ErrStat !< Error status INTEGER(IntKi), INTENT(IN) :: UnEc !< I/O unit for echo file. If present and > 0, write to UnEc - LOGICAL, INTENT(IN) :: ReadAdmVals !< Logical to determine if Adams inputs should be read from file CHARACTER(*), INTENT(OUT) :: ErrMsg !< Error message CHARACTER(*), INTENT(IN) :: TwrFile !< Name of the tower input file data TYPE(ED_InputFile), INTENT(INOUT) :: InputFileData !< All the data in the ElastoDyn input file @@ -2254,7 +2233,7 @@ SUBROUTINE ReadTowerFile( TwrFile, InputFileData, ReadAdmVals, UnEc, ErrStat, Er ! Allocate the input arrays based on this NTwInpSt input - CALL Alloc_TowerInputProperties( InputFileData, ReadAdmVals, ErrStat, ErrMsg ) + CALL Alloc_TowerInputProperties( InputFileData, ErrStat, ErrMsg ) CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName ) IF ( ErrStat >= AbortErrLev ) THEN CALL Cleanup() @@ -2402,12 +2381,8 @@ SUBROUTINE ReadTowerFile( TwrFile, InputFileData, ReadAdmVals, UnEc, ErrStat, Er ! Read the table. - - IF ( ReadAdmVals ) THEN - NInputCols = 10 - ELSE - NInputCols = 4 - END IF + + NInputCols = 4 DO I=1,InputFileData%NTwInpSt @@ -2425,15 +2400,6 @@ SUBROUTINE ReadTowerFile( TwrFile, InputFileData, ReadAdmVals, UnEc, ErrStat, Er InputFileData%TwFAStif(I) = TmpRAry(3)*AdjFASt ! Apply the correction factors to the elemental data. InputFileData%TwSSStif(I) = TmpRAry(4)*AdjSSSt ! Apply the correction factors to the elemental data. - IF ( NInputCols > 4 ) THEN - InputFileData%TwGJStif(I) = TmpRAry( 5) - InputFileData%TwEAStif(I) = TmpRAry( 6) - InputFileData%TwFAIner(I) = TmpRAry( 7) - InputFileData%TwSSIner(I) = TmpRAry( 8) - InputFileData%TwFAcgOf(I) = TmpRAry( 9) - InputFileData%TwSScgOf(I) = TmpRAry(10) - END IF - END DO ! I @@ -3702,11 +3668,10 @@ SUBROUTINE Alloc_BladeMeshInputProperties( BladeKInputFileMesh, ErrStat, ErrMsg END SUBROUTINE Alloc_BladeMeshInputProperties !---------------------------------------------------------------------------------------------------------------------------------- !> This routine allocates arrays for the blade properties from the input file. -SUBROUTINE Alloc_BladeInputProperties( BladeKInputFileData, AllocAdams, ErrStat, ErrMsg ) +SUBROUTINE Alloc_BladeInputProperties( BladeKInputFileData, ErrStat, ErrMsg ) !.................................................................................................................................. TYPE(BladeInputData), INTENT(INOUT) :: BladeKInputFileData !< Data for Blade K stored in the module's input file - LOGICAL, INTENT(IN) :: AllocAdams !< Logical to determine if we should allocate the arrays only used for Adams INTEGER(IntKi), INTENT(OUT) :: ErrStat !< Error status CHARACTER(*), INTENT(OUT) :: ErrMsg !< Err message @@ -3734,32 +3699,6 @@ SUBROUTINE Alloc_BladeInputProperties( BladeKInputFileData, AllocAdams, ErrStat, IF ( ErrStat /= ErrID_None ) RETURN - IF ( AllocAdams ) THEN - CALL AllocAry ( BladeKInputFileData%GJStff, BladeKInputFileData%NBlInpSt, 'GJStff' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( BladeKInputFileData%EAStff, BladeKInputFileData%NBlInpSt, 'EAStff' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( BladeKInputFileData%Alpha, BladeKInputFileData%NBlInpSt, 'Alpha' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( BladeKInputFileData%FlpIner, BladeKInputFileData%NBlInpSt, 'FlpIner' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( BladeKInputFileData%EdgIner, BladeKInputFileData%NBlInpSt, 'EdgIner' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( BladeKInputFileData%PrecrvRef,BladeKInputFileData%NBlInpSt, 'PrecrvRef', ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( BladeKInputFileData%PreswpRef,BladeKInputFileData%NBlInpSt, 'PreswpRef', ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( BladeKInputFileData%FlpcgOf, BladeKInputFileData%NBlInpSt, 'FlpcgOf' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( BladeKInputFileData%EdgcgOf, BladeKInputFileData%NBlInpSt, 'EdgcgOf' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( BladeKInputFileData%FlpEAOf, BladeKInputFileData%NBlInpSt, 'FlpEAOf' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( BladeKInputFileData%EdgEAOf, BladeKInputFileData%NBlInpSt, 'EdgEAOf' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - END IF - - ! BJJ: note that these used to be allocated 2:PolyOrd : CALL AllocAry ( BladeKInputFileData%BldFl1Sh, PolyOrd-1, 'BldFl1Sh' , ErrStat, ErrMsg ) @@ -3773,11 +3712,10 @@ SUBROUTINE Alloc_BladeInputProperties( BladeKInputFileData, AllocAdams, ErrStat, END SUBROUTINE Alloc_BladeInputProperties !---------------------------------------------------------------------------------------------------------------------------------- !> This routine allocates arrays for the tower properties from the input file. -SUBROUTINE Alloc_TowerInputProperties( InputFileData, AllocAdams, ErrStat, ErrMsg ) +SUBROUTINE Alloc_TowerInputProperties( InputFileData, ErrStat, ErrMsg ) !.................................................................................................................................. TYPE(ED_InputFile), INTENT(INOUT) :: InputFileData !< All the data in the ElastoDyn input file - LOGICAL, INTENT(IN) :: AllocAdams !< Determines if the columns for Adams data will be read INTEGER(IntKi), INTENT(OUT) :: ErrStat !< Error status CHARACTER(*), INTENT(OUT) :: ErrMsg !< Error message @@ -3800,21 +3738,6 @@ SUBROUTINE Alloc_TowerInputProperties( InputFileData, AllocAdams, ErrStat, ErrMs CALL AllocAry ( InputFileData%TwSSStif, InputFileData%NTwInpSt, 'TwSSStif' , ErrStat, ErrMsg ) IF ( ErrStat /= ErrID_None ) RETURN - IF ( AllocAdams ) THEN - CALL AllocAry ( InputFileData%TwGJStif, InputFileData%NTwInpSt, 'TwGJStif' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( InputFileData%TwEAStif, InputFileData%NTwInpSt, 'TwEAStif' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( InputFileData%TwFAIner, InputFileData%NTwInpSt, 'TwFAIner' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( InputFileData%TwSSIner, InputFileData%NTwInpSt, 'TwSSIner' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( InputFileData%TwFAcgOf, InputFileData%NTwInpSt, 'TwFAcgOf' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - CALL AllocAry ( InputFileData%TwSScgOf, InputFileData%NTwInpSt, 'TwSScgOf' , ErrStat, ErrMsg ) - IF ( ErrStat /= ErrID_None ) RETURN - END IF - ! BJJ: note that these used to be allocated 2:PolyOrd : CALL AllocAry ( InputFileData%TwFAM1Sh, PolyOrd-1, 'TwFAM1Sh' , ErrStat, ErrMsg ) @@ -3897,61 +3820,6 @@ SUBROUTINE ValidateBladeData ( BladeKInputFileData, ErrStat, ErrMsg ) END DO - ! Check values for Adams input - - IF ( ALLOCATED(BladeKInputFileData%GJStff) ) THEN ! We assume that if GJStff is allocated, we are using ADAMS inputs - - ! The reference axis must be coincident with the pitch axis at the blade root (I == 1): - IF ( .NOT. EqualRealNos( BladeKInputFileData%PrecrvRef(1), 0.0_ReKi ) .OR. & - .NOT. EqualRealNos( BladeKInputFileData%PreswpRef(1), 0.0_ReKi ) ) THEN - CALL SetErrStat( ErrID_Fatal,'Both PrecrvRef(1) and PreswpRef(1) must be zero '//& - '(the reference axis must be coincident with the pitch axis at the blade root).',ErrStat,ErrMsg,RoutineName) - END IF - - - DO I = 1,BladeKInputFileData%NBlInpSt - - ! Check that GJStff is contained in (0.0, inf): - IF ( BladeKInputFileData%GJStff(I) <= 0.0_ReKi ) THEN - CALL SetErrStat( ErrID_Fatal,'GJStff('//TRIM( Num2LStr( I ) )//') must be greater than zero.',ErrStat,ErrMsg,RoutineName) - END IF - - ! Check that EAStff is contained in (0.0, inf): - IF ( BladeKInputFileData%EAStff(I) <= 0.0_ReKi ) THEN - CALL SetErrStat( ErrID_Fatal,'EAStff('//TRIM( Num2LStr( I ) )//') must be greater than zero.',ErrStat,ErrMsg,RoutineName) - END IF - - ! Check that Alpha is contained in (-1.0, 1): - IF ( ( BladeKInputFileData%Alpha(I) <= -1.0_ReKi ) .OR. ( BladeKInputFileData%Alpha(I) >= 1.0_ReKi ) ) THEN - CALL SetErrStat( ErrID_Fatal,'Alpha('//TRIM( Num2LStr( I ) )//') (the blade flap/twist'// & - ' coupling coefficient) must be between -1 and 1 (exclusive).',ErrStat,ErrMsg,RoutineName) - END IF - - ! Check that FlpIner is contained in [0.0, inf): - IF ( BladeKInputFileData%FlpIner(I) < 0.0_ReKi ) THEN - CALL SetErrStat( ErrID_Fatal,'FlpIner('//TRIM( Num2LStr( I ) )//') must not be less than zero.',ErrStat,ErrMsg,RoutineName) - END IF - - ! Check that EdgIner is contained in [0.0, inf): - IF ( BladeKInputFileData%EdgIner(I) < 0.0_ReKi ) THEN - CALL SetErrStat( ErrID_Fatal,'EdgIner('//TRIM( Num2LStr( I ) )//') must not be less than zero.',ErrStat,ErrMsg,RoutineName) - END IF - - ! Check that PrecrvRef is 0.0 for Adams models: - IF ( .NOT. EqualRealNos( BladeKInputFileData%PrecrvRef(I), 0.0_ReKi) ) THEN - CALL SetErrStat( ErrID_Fatal,'PrecrvRef('//TRIM( Num2LStr( I ) )//') must be zero for Adams models.',ErrStat,ErrMsg,RoutineName) - END IF - - ! Check that GJStff is contained in (0.0, inf): - IF ( .NOT. EqualRealNos( BladeKInputFileData%PreswpRef(I), 0.0_ReKi) ) THEN - CALL SetErrStat( ErrID_Fatal,'PreswpRef('//TRIM( Num2LStr( I ) )//') must be zero for Adams models.',ErrStat,ErrMsg,RoutineName) - END IF - - END DO - - END IF ! check for Adams models - - ! Check that the blade damping is not negative: IF ( ANY( BladeKInputFileData%BldFlDmp < 0.0_ReKi ) ) CALL SetErrStat( ErrID_Fatal,'BldFlDmp must not be negative.',ErrStat,ErrMsg,RoutineName) @@ -4056,31 +3924,6 @@ SUBROUTINE ValidateTowerData ( InputFileData, ErrStat, ErrMsg ) END IF END DO - ! Check Adams inputs - - IF ( ALLOCATED( InputFileData%TwGJStif ) ) THEN ! Assume that all of the Adams tower data is allocated - - DO I = 1,InputFileData%NTwInpSt - IF ( InputFileData%TwGJStif(I) <= 0.0_ReKi ) THEN - CALL SetErrStat( ErrID_Fatal, 'TwGJStif('//TRIM(Num2LStr( I ))//') must be greater than zero.', ErrStat, ErrMsg, RoutineName) - END IF - - IF ( InputFileData%TwEAStif(I) <= 0.0_ReKi ) THEN - CALL SetErrStat( ErrID_Fatal, 'TwEAStif('//TRIM(Num2LStr( I ))//') must be greater than zero.', ErrStat, ErrMsg, RoutineName) - END IF - - IF ( InputFileData%TwFAIner(I) <= 0.0_ReKi ) THEN - CALL SetErrStat( ErrID_Fatal, 'TwFAIner('//TRIM(Num2LStr( I ))//') must be greater than zero.', ErrStat, ErrMsg, RoutineName) - END IF - - IF ( InputFileData%TwSSIner(I) <= 0.0_ReKi ) THEN - CALL SetErrStat( ErrID_Fatal, 'TwSSIner('//TRIM(Num2LStr( I ))//') must be greater than zero.', ErrStat, ErrMsg, RoutineName) - END IF - END DO - - END IF ! Check items for Adams - - ! Check that the tower damping (TwrFADmp) is contained in the range [0, 100]: diff --git a/modules/elastodyn/src/ElastoDyn_Registry.txt b/modules/elastodyn/src/ElastoDyn_Registry.txt index fcdfed0182..e9445f76f1 100644 --- a/modules/elastodyn/src/ElastoDyn_Registry.txt +++ b/modules/elastodyn/src/ElastoDyn_Registry.txt @@ -62,17 +62,6 @@ typedef ^ BladeInputData ReKi StrcTwst {:} - - "Structural twist for distributed typedef ^ BladeInputData ReKi BMassDen {:} - - "Blade mass density for distributed input data" typedef ^ BladeInputData ReKi FlpStff {:} - - "Blade flap stiffness for distributed input data" typedef ^ BladeInputData ReKi EdgStff {:} - - "Blade edge stiffness for distributed input data" -typedef ^ BladeInputData ReKi GJStff {:} - - "Blade torsional stiffness for a given input station" -typedef ^ BladeInputData ReKi EAStff {:} - - "Blade extensional stiffness for a given input station" -typedef ^ BladeInputData ReKi Alpha {:} - - "Blade coupling coefficient between flap and twist for a given input station" -typedef ^ BladeInputData ReKi FlpIner {:} - - "Blade flap (about local structural yb-axis) mass inertia per unit length for a given input station" -typedef ^ BladeInputData ReKi EdgIner {:} - - "Blade edge (about local structural xb-axis) mass inertia per unit length for a given input station" -typedef ^ BladeInputData ReKi PrecrvRef {:} - - "Offset for defining the reference axis from the pitch axis for precurved blades at a given input station" -typedef ^ BladeInputData ReKi PreswpRef {:} - - "Offset for defining the reference axis from the pitch axis for preswept blades at a given input station" -typedef ^ BladeInputData ReKi FlpcgOf {:} - - "Blade flap (along local aerodynamic xb-axis) mass cg offset for a given input station" -typedef ^ BladeInputData ReKi EdgcgOf {:} - - "Blade edge (along local aerodynamic yb-axis) mass cg offset for a given input station" -typedef ^ BladeInputData ReKi FlpEAOf {:} - - "Blade flap (along local aerodynamic xb-axis) elastic axis offset for a given input station" -typedef ^ BladeInputData ReKi EdgEAOf {:} - - "Blade edge (along local aerodynamic yb-axis) elastic axis offset for a given input station" typedef ^ BladeInputData ReKi BldFlDmp 2 - - "Blade structural damping ratios in flapwise direction" typedef ^ BladeInputData ReKi BldEdDmp 1 - - "Blade structural damping ratios in edgewise direction" typedef ^ BladeInputData ReKi FlStTunr 2 - - "Blade flapwise modal stiffness tuners (input)" @@ -204,13 +193,6 @@ typedef ^ ED_InputFile ReKi TwFAM1Sh {:} - - "Tower fore-aft mode-1 shape coeffi typedef ^ ED_InputFile ReKi TwFAM2Sh {:} - - "Tower fore-aft mode-2 shape coefficients" - typedef ^ ED_InputFile ReKi TwSSM1Sh {:} - - "Tower side-to-side mode-1 shape coefficients" - typedef ^ ED_InputFile ReKi TwSSM2Sh {:} - - "Tower side-to-side mode-2 shape coefficients" - -# ..... Tower Input file data (ADAMS only) ........................................................................................................... -typedef ^ ED_InputFile ReKi TwGJStif {:} - - "Tower torsional stiffness for a given input station" Nm^2 -typedef ^ ED_InputFile ReKi TwEAStif {:} - - "Tower extensional stiffness for a given input station" N -typedef ^ ED_InputFile ReKi TwFAIner {:} - - "Tower fore-aft (about yt-axis) mass inertia per unit length for a given input station" "kg m" -typedef ^ ED_InputFile ReKi TwSSIner {:} - - "Tower side-to-side (about xt-axis) mass inertia per unit length for a given input station" "kg m" -typedef ^ ED_InputFile ReKi TwFAcgOf {:} - - "Tower fore-aft (along the xt-axis) mass cg offset for a given input station" meters -typedef ^ ED_InputFile ReKi TwSScgOf {:} - - "Tower fore-aft (along the yt-axis) mass cg offset for a given input station" meters # ..... Furling Input file data ........................................................................................................... typedef ^ ED_InputFile LOGICAL RFrlDOF - - - "Rotor-furl DOF" - typedef ^ ED_InputFile LOGICAL TFrlDOF - - - "Tail-furl DOF" - @@ -641,13 +623,7 @@ typedef ^ ParameterType ReKi TwrFlexL - - - "Height / length of the flexible por typedef ^ ParameterType ReKi TwrSSSF {:}{:}{:} - - "Tower side-to-side shape functions" typedef ^ ParameterType IntKi TTopNode - - - "Index of the additional node located at the tower-top = TwrNodes + 1" typedef ^ ParameterType IntKi TwrNodes - - - "Number of tower nodes used in the analysis" -typedef ^ ParameterType ReKi InerTFA {:} - - "Interpolated tower fore-aft (about yt-axis) mass inertia per unit length" -typedef ^ ParameterType ReKi InerTSS {:} - - "Interpolated tower side-to-side (about xt-axis) mass inertia per unit length" -typedef ^ ParameterType ReKi StiffTGJ {:} - - "Interpolated tower torsional stiffness" -typedef ^ ParameterType ReKi StiffTEA {:} - - "Interpolated tower extensional stiffness" typedef ^ ParameterType ReKi StiffTFA {:} - - "Interpolated fore-aft tower stiffness" -typedef ^ ParameterType ReKi cgOffTFA {:} - - "Interpolated tower fore-aft mass cg offset" -typedef ^ ParameterType ReKi cgOffTSS {:} - - "Interpolated tower side-to-side mass cg offset" typedef ^ ParameterType ReKi AtfaIner - - - "Inertia of tail boom about the tail-furl axis whose origin is the tail boom center of mass" typedef ^ ParameterType ReKi BldCG {:} - - "Blade center of mass wrt the blade root" typedef ^ ParameterType ReKi BldMass {:} - - "Blade masses" @@ -680,37 +656,26 @@ typedef ^ ParameterType ReKi Gravity - - - "Gravitational acceleration" m/s^2 typedef ^ ParameterType ReKi PitchAxis {:}{:} - - "Pitch axis for analysis nodes" - typedef ^ ParameterType ReKi AeroTwst {:} - - "Aerodynamic twist of the blade at the analysis nodes" typedef ^ ParameterType ReKi AxRedBld {:}{:}{:}{:} - - "The axial-reduction terms of the blade shape function" -typedef ^ ParameterType ReKi BAlpha {:}{:} - - "Interpolated blade coupling coefficient between flap and twist" typedef ^ ParameterType ReKi BldEDamp {:}{:} - - "Blade edgewise damping coefficients" typedef ^ ParameterType ReKi BldFDamp {:}{:} - - "Blade flapwise damping coefficients" typedef ^ ParameterType ReKi BldFlexL - - - "Flexible blade length" typedef ^ ParameterType ReKi CAeroTwst {:} - - "Cosine of the aerodynamic twist of the blade at the analysis nodes" typedef ^ ParameterType ReKi CBE {:}{:}{:} - - "Generalized edgewise damping of the blades" typedef ^ ParameterType ReKi CBF {:}{:}{:} - - "Generalized flapwise damping of the blades" -typedef ^ ParameterType ReKi cgOffBEdg {:}{:} - - "Interpolated blade edge (along local aerodynamic yb-axis) mass cg offset" -typedef ^ ParameterType ReKi cgOffBFlp {:}{:} - - "Interpolated blade flap (along local aerodynamic xb-axis) mass cg offset" typedef ^ ParameterType ReKi Chord {:} - - "Chord of the blade at the analysis nodes" typedef ^ ParameterType R8Ki CThetaS {:}{:} - - "COS( ThetaS )" typedef ^ ParameterType ReKi DRNodes {:} - - "Length of variable-spaced blade elements" -typedef ^ ParameterType ReKi EAOffBEdg {:}{:} - - "Interpolated blade edge (along local aerodynamic yb-axis) elastic axis offset" -typedef ^ ParameterType ReKi EAOffBFlp {:}{:} - - "Interpolated blade flap (along local aerodynamic xb-axis) elastic axis offset" typedef ^ ParameterType ReKi FStTunr {:}{:} - - "Blade flapwise modal stiffness tuners (stored for all blades)" -typedef ^ ParameterType ReKi InerBEdg {:}{:} - - "Interpolated blade edge (about local structural xb-axis) mass inertia per unit length" -typedef ^ ParameterType ReKi InerBFlp {:}{:} - - "Interpolated blade flap (about local structural yb-axis) mass inertia per unit length" typedef ^ ParameterType ReKi KBE {:}{:}{:} - - "Generalized edgewise stiffness of the blades" typedef ^ ParameterType ReKi KBF {:}{:}{:} - - "Generalized flapwise stiffness of the blades" typedef ^ ParameterType ReKi MassB {:}{:} - - "Interpolated lineal blade mass density" -typedef ^ ParameterType ReKi RefAxisxb {:}{:} - - "Interpolated Offset for defining the reference axis from the pitch axis for precurved blades at a given input station (along xb-axis)" -typedef ^ ParameterType ReKi RefAxisyb {:}{:} - - "Interpolated Offset for defining the reference axis from the pitch axis for preswept blades at a given input station (along yb-axis)" typedef ^ ParameterType ReKi RNodes {:} - - "Radius to analysis nodes relative to hub ( 0 < RNodes(:) < BldFlexL )" typedef ^ ParameterType ReKi RNodesNorm {:} - - "Normalized radius to analysis nodes relative to hub ( 0 < RNodesNorm(:) < 1 )" typedef ^ ParameterType ReKi rSAerCenn1 {:}{:} - - "Distance from point S on a blade to the aerodynamic center in the n1 direction (m)" typedef ^ ParameterType ReKi rSAerCenn2 {:}{:} - - "Distance from point S on a blade to the aerodynamic center in the n2 direction (m)" typedef ^ ParameterType ReKi SAeroTwst {:} - - "Sine of the aerodynamic twist of the blade at the analysis nodes" typedef ^ ParameterType ReKi StiffBE {:}{:} - - "Interpolated edgewise blade stiffness" -typedef ^ ParameterType ReKi StiffBEA {:}{:} - - "Interpolated blade extensional stiffness" typedef ^ ParameterType ReKi StiffBF {:}{:} - - "Interpolated flapwise blade stiffness" -typedef ^ ParameterType ReKi StiffBGJ {:}{:} - - "Interpolated blade torsional stiffness" typedef ^ ParameterType R8Ki SThetaS {:}{:} - - "SIN( ThetaS )" typedef ^ ParameterType ReKi ThetaS {:}{:} - - "Structural twist for analysis nodes" radians typedef ^ ParameterType ReKi TwistedSF {:}{:}{:}{:}{:} - - "Interpolated lineal blade mass density" diff --git a/modules/elastodyn/src/ElastoDyn_Types.f90 b/modules/elastodyn/src/ElastoDyn_Types.f90 index e807363ba1..ef3886b5f9 100644 --- a/modules/elastodyn/src/ElastoDyn_Types.f90 +++ b/modules/elastodyn/src/ElastoDyn_Types.f90 @@ -84,17 +84,6 @@ MODULE ElastoDyn_Types REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: BMassDen !< Blade mass density for distributed input data [-] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: FlpStff !< Blade flap stiffness for distributed input data [-] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: EdgStff !< Blade edge stiffness for distributed input data [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: GJStff !< Blade torsional stiffness for a given input station [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: EAStff !< Blade extensional stiffness for a given input station [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: Alpha !< Blade coupling coefficient between flap and twist for a given input station [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: FlpIner !< Blade flap (about local structural yb-axis) mass inertia per unit length for a given input station [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: EdgIner !< Blade edge (about local structural xb-axis) mass inertia per unit length for a given input station [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: PrecrvRef !< Offset for defining the reference axis from the pitch axis for precurved blades at a given input station [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: PreswpRef !< Offset for defining the reference axis from the pitch axis for preswept blades at a given input station [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: FlpcgOf !< Blade flap (along local aerodynamic xb-axis) mass cg offset for a given input station [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: EdgcgOf !< Blade edge (along local aerodynamic yb-axis) mass cg offset for a given input station [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: FlpEAOf !< Blade flap (along local aerodynamic xb-axis) elastic axis offset for a given input station [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: EdgEAOf !< Blade edge (along local aerodynamic yb-axis) elastic axis offset for a given input station [-] REAL(ReKi) , DIMENSION(1:2) :: BldFlDmp !< Blade structural damping ratios in flapwise direction [-] REAL(ReKi) , DIMENSION(1:1) :: BldEdDmp !< Blade structural damping ratios in edgewise direction [-] REAL(ReKi) , DIMENSION(1:2) :: FlStTunr !< Blade flapwise modal stiffness tuners (input) [-] @@ -223,12 +212,6 @@ MODULE ElastoDyn_Types REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: TwFAM2Sh !< Tower fore-aft mode-2 shape coefficients [-] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: TwSSM1Sh !< Tower side-to-side mode-1 shape coefficients [-] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: TwSSM2Sh !< Tower side-to-side mode-2 shape coefficients [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: TwGJStif !< Tower torsional stiffness for a given input station [Nm^2] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: TwEAStif !< Tower extensional stiffness for a given input station [N] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: TwFAIner !< Tower fore-aft (about yt-axis) mass inertia per unit length for a given input station [kg m] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: TwSSIner !< Tower side-to-side (about xt-axis) mass inertia per unit length for a given input station [kg m] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: TwFAcgOf !< Tower fore-aft (along the xt-axis) mass cg offset for a given input station [meters] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: TwSScgOf !< Tower fore-aft (along the yt-axis) mass cg offset for a given input station [meters] LOGICAL :: RFrlDOF !< Rotor-furl DOF [-] LOGICAL :: TFrlDOF !< Tail-furl DOF [-] REAL(ReKi) :: RotFurl !< Initial or fixed rotor-furl angle [radians] @@ -649,13 +632,7 @@ MODULE ElastoDyn_Types REAL(ReKi) , DIMENSION(:,:,:), ALLOCATABLE :: TwrSSSF !< Tower side-to-side shape functions [-] INTEGER(IntKi) :: TTopNode !< Index of the additional node located at the tower-top = TwrNodes + 1 [-] INTEGER(IntKi) :: TwrNodes !< Number of tower nodes used in the analysis [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: InerTFA !< Interpolated tower fore-aft (about yt-axis) mass inertia per unit length [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: InerTSS !< Interpolated tower side-to-side (about xt-axis) mass inertia per unit length [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: StiffTGJ !< Interpolated tower torsional stiffness [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: StiffTEA !< Interpolated tower extensional stiffness [-] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: StiffTFA !< Interpolated fore-aft tower stiffness [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: cgOffTFA !< Interpolated tower fore-aft mass cg offset [-] - REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: cgOffTSS !< Interpolated tower side-to-side mass cg offset [-] REAL(ReKi) :: AtfaIner !< Inertia of tail boom about the tail-furl axis whose origin is the tail boom center of mass [-] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: BldCG !< Blade center of mass wrt the blade root [-] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: BldMass !< Blade masses [-] @@ -687,37 +664,26 @@ MODULE ElastoDyn_Types REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: PitchAxis !< Pitch axis for analysis nodes [-] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: AeroTwst !< Aerodynamic twist of the blade at the analysis nodes [-] REAL(ReKi) , DIMENSION(:,:,:,:), ALLOCATABLE :: AxRedBld !< The axial-reduction terms of the blade shape function [-] - REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: BAlpha !< Interpolated blade coupling coefficient between flap and twist [-] REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: BldEDamp !< Blade edgewise damping coefficients [-] REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: BldFDamp !< Blade flapwise damping coefficients [-] REAL(ReKi) :: BldFlexL !< Flexible blade length [-] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: CAeroTwst !< Cosine of the aerodynamic twist of the blade at the analysis nodes [-] REAL(ReKi) , DIMENSION(:,:,:), ALLOCATABLE :: CBE !< Generalized edgewise damping of the blades [-] REAL(ReKi) , DIMENSION(:,:,:), ALLOCATABLE :: CBF !< Generalized flapwise damping of the blades [-] - REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: cgOffBEdg !< Interpolated blade edge (along local aerodynamic yb-axis) mass cg offset [-] - REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: cgOffBFlp !< Interpolated blade flap (along local aerodynamic xb-axis) mass cg offset [-] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: Chord !< Chord of the blade at the analysis nodes [-] REAL(R8Ki) , DIMENSION(:,:), ALLOCATABLE :: CThetaS !< COS( ThetaS ) [-] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: DRNodes !< Length of variable-spaced blade elements [-] - REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: EAOffBEdg !< Interpolated blade edge (along local aerodynamic yb-axis) elastic axis offset [-] - REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: EAOffBFlp !< Interpolated blade flap (along local aerodynamic xb-axis) elastic axis offset [-] REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: FStTunr !< Blade flapwise modal stiffness tuners (stored for all blades) [-] - REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: InerBEdg !< Interpolated blade edge (about local structural xb-axis) mass inertia per unit length [-] - REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: InerBFlp !< Interpolated blade flap (about local structural yb-axis) mass inertia per unit length [-] REAL(ReKi) , DIMENSION(:,:,:), ALLOCATABLE :: KBE !< Generalized edgewise stiffness of the blades [-] REAL(ReKi) , DIMENSION(:,:,:), ALLOCATABLE :: KBF !< Generalized flapwise stiffness of the blades [-] REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: MassB !< Interpolated lineal blade mass density [-] - REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: RefAxisxb !< Interpolated Offset for defining the reference axis from the pitch axis for precurved blades at a given input station (along xb-axis) [-] - REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: RefAxisyb !< Interpolated Offset for defining the reference axis from the pitch axis for preswept blades at a given input station (along yb-axis) [-] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: RNodes !< Radius to analysis nodes relative to hub ( 0 < RNodes(:) < BldFlexL ) [-] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: RNodesNorm !< Normalized radius to analysis nodes relative to hub ( 0 < RNodesNorm(:) < 1 ) [-] REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: rSAerCenn1 !< Distance from point S on a blade to the aerodynamic center in the n1 direction (m) [-] REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: rSAerCenn2 !< Distance from point S on a blade to the aerodynamic center in the n2 direction (m) [-] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: SAeroTwst !< Sine of the aerodynamic twist of the blade at the analysis nodes [-] REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: StiffBE !< Interpolated edgewise blade stiffness [-] - REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: StiffBEA !< Interpolated blade extensional stiffness [-] REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: StiffBF !< Interpolated flapwise blade stiffness [-] - REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: StiffBGJ !< Interpolated blade torsional stiffness [-] REAL(R8Ki) , DIMENSION(:,:), ALLOCATABLE :: SThetaS !< SIN( ThetaS ) [-] REAL(ReKi) , DIMENSION(:,:), ALLOCATABLE :: ThetaS !< Structural twist for analysis nodes [radians] REAL(ReKi) , DIMENSION(:,:,:,:,:), ALLOCATABLE :: TwistedSF !< Interpolated lineal blade mass density [-] @@ -842,9 +808,6 @@ MODULE ElastoDyn_Types REAL(ReKi) :: LSShftFxa !< Rotating low-speed shaft force x [N] REAL(ReKi) :: LSShftFys !< Nonrotating low-speed shaft force y [N] REAL(ReKi) :: LSShftFzs !< Nonrotating low-speed shaft force z [N] - REAL(ReKi) :: HubDisplacementX !< For AeroDyn14 & ServoDyn/TMD: motions of the nacelle. [m] - REAL(ReKi) :: HubDisplacementY !< For AeroDyn14 & ServoDyn/TMD: motions of the nacelle. [m] - REAL(ReKi) :: HubDisplacementZ !< For AeroDyn14 & ServoDyn/TMD: motions of the nacelle. [m] END TYPE ED_OutputType ! ======================= CONTAINS @@ -2179,138 +2142,6 @@ SUBROUTINE ED_CopyBladeInputData( SrcBladeInputDataData, DstBladeInputDataData, END IF END IF DstBladeInputDataData%EdgStff = SrcBladeInputDataData%EdgStff -ENDIF -IF (ALLOCATED(SrcBladeInputDataData%GJStff)) THEN - i1_l = LBOUND(SrcBladeInputDataData%GJStff,1) - i1_u = UBOUND(SrcBladeInputDataData%GJStff,1) - IF (.NOT. ALLOCATED(DstBladeInputDataData%GJStff)) THEN - ALLOCATE(DstBladeInputDataData%GJStff(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstBladeInputDataData%GJStff.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstBladeInputDataData%GJStff = SrcBladeInputDataData%GJStff -ENDIF -IF (ALLOCATED(SrcBladeInputDataData%EAStff)) THEN - i1_l = LBOUND(SrcBladeInputDataData%EAStff,1) - i1_u = UBOUND(SrcBladeInputDataData%EAStff,1) - IF (.NOT. ALLOCATED(DstBladeInputDataData%EAStff)) THEN - ALLOCATE(DstBladeInputDataData%EAStff(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstBladeInputDataData%EAStff.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstBladeInputDataData%EAStff = SrcBladeInputDataData%EAStff -ENDIF -IF (ALLOCATED(SrcBladeInputDataData%Alpha)) THEN - i1_l = LBOUND(SrcBladeInputDataData%Alpha,1) - i1_u = UBOUND(SrcBladeInputDataData%Alpha,1) - IF (.NOT. ALLOCATED(DstBladeInputDataData%Alpha)) THEN - ALLOCATE(DstBladeInputDataData%Alpha(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstBladeInputDataData%Alpha.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstBladeInputDataData%Alpha = SrcBladeInputDataData%Alpha -ENDIF -IF (ALLOCATED(SrcBladeInputDataData%FlpIner)) THEN - i1_l = LBOUND(SrcBladeInputDataData%FlpIner,1) - i1_u = UBOUND(SrcBladeInputDataData%FlpIner,1) - IF (.NOT. ALLOCATED(DstBladeInputDataData%FlpIner)) THEN - ALLOCATE(DstBladeInputDataData%FlpIner(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstBladeInputDataData%FlpIner.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstBladeInputDataData%FlpIner = SrcBladeInputDataData%FlpIner -ENDIF -IF (ALLOCATED(SrcBladeInputDataData%EdgIner)) THEN - i1_l = LBOUND(SrcBladeInputDataData%EdgIner,1) - i1_u = UBOUND(SrcBladeInputDataData%EdgIner,1) - IF (.NOT. ALLOCATED(DstBladeInputDataData%EdgIner)) THEN - ALLOCATE(DstBladeInputDataData%EdgIner(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstBladeInputDataData%EdgIner.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstBladeInputDataData%EdgIner = SrcBladeInputDataData%EdgIner -ENDIF -IF (ALLOCATED(SrcBladeInputDataData%PrecrvRef)) THEN - i1_l = LBOUND(SrcBladeInputDataData%PrecrvRef,1) - i1_u = UBOUND(SrcBladeInputDataData%PrecrvRef,1) - IF (.NOT. ALLOCATED(DstBladeInputDataData%PrecrvRef)) THEN - ALLOCATE(DstBladeInputDataData%PrecrvRef(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstBladeInputDataData%PrecrvRef.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstBladeInputDataData%PrecrvRef = SrcBladeInputDataData%PrecrvRef -ENDIF -IF (ALLOCATED(SrcBladeInputDataData%PreswpRef)) THEN - i1_l = LBOUND(SrcBladeInputDataData%PreswpRef,1) - i1_u = UBOUND(SrcBladeInputDataData%PreswpRef,1) - IF (.NOT. ALLOCATED(DstBladeInputDataData%PreswpRef)) THEN - ALLOCATE(DstBladeInputDataData%PreswpRef(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstBladeInputDataData%PreswpRef.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstBladeInputDataData%PreswpRef = SrcBladeInputDataData%PreswpRef -ENDIF -IF (ALLOCATED(SrcBladeInputDataData%FlpcgOf)) THEN - i1_l = LBOUND(SrcBladeInputDataData%FlpcgOf,1) - i1_u = UBOUND(SrcBladeInputDataData%FlpcgOf,1) - IF (.NOT. ALLOCATED(DstBladeInputDataData%FlpcgOf)) THEN - ALLOCATE(DstBladeInputDataData%FlpcgOf(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstBladeInputDataData%FlpcgOf.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstBladeInputDataData%FlpcgOf = SrcBladeInputDataData%FlpcgOf -ENDIF -IF (ALLOCATED(SrcBladeInputDataData%EdgcgOf)) THEN - i1_l = LBOUND(SrcBladeInputDataData%EdgcgOf,1) - i1_u = UBOUND(SrcBladeInputDataData%EdgcgOf,1) - IF (.NOT. ALLOCATED(DstBladeInputDataData%EdgcgOf)) THEN - ALLOCATE(DstBladeInputDataData%EdgcgOf(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstBladeInputDataData%EdgcgOf.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstBladeInputDataData%EdgcgOf = SrcBladeInputDataData%EdgcgOf -ENDIF -IF (ALLOCATED(SrcBladeInputDataData%FlpEAOf)) THEN - i1_l = LBOUND(SrcBladeInputDataData%FlpEAOf,1) - i1_u = UBOUND(SrcBladeInputDataData%FlpEAOf,1) - IF (.NOT. ALLOCATED(DstBladeInputDataData%FlpEAOf)) THEN - ALLOCATE(DstBladeInputDataData%FlpEAOf(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstBladeInputDataData%FlpEAOf.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstBladeInputDataData%FlpEAOf = SrcBladeInputDataData%FlpEAOf -ENDIF -IF (ALLOCATED(SrcBladeInputDataData%EdgEAOf)) THEN - i1_l = LBOUND(SrcBladeInputDataData%EdgEAOf,1) - i1_u = UBOUND(SrcBladeInputDataData%EdgEAOf,1) - IF (.NOT. ALLOCATED(DstBladeInputDataData%EdgEAOf)) THEN - ALLOCATE(DstBladeInputDataData%EdgEAOf(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstBladeInputDataData%EdgEAOf.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstBladeInputDataData%EdgEAOf = SrcBladeInputDataData%EdgEAOf ENDIF DstBladeInputDataData%BldFlDmp = SrcBladeInputDataData%BldFlDmp DstBladeInputDataData%BldEdDmp = SrcBladeInputDataData%BldEdDmp @@ -2392,39 +2223,6 @@ SUBROUTINE ED_DestroyBladeInputData( BladeInputDataData, ErrStat, ErrMsg, DEALLO IF (ALLOCATED(BladeInputDataData%EdgStff)) THEN DEALLOCATE(BladeInputDataData%EdgStff) ENDIF -IF (ALLOCATED(BladeInputDataData%GJStff)) THEN - DEALLOCATE(BladeInputDataData%GJStff) -ENDIF -IF (ALLOCATED(BladeInputDataData%EAStff)) THEN - DEALLOCATE(BladeInputDataData%EAStff) -ENDIF -IF (ALLOCATED(BladeInputDataData%Alpha)) THEN - DEALLOCATE(BladeInputDataData%Alpha) -ENDIF -IF (ALLOCATED(BladeInputDataData%FlpIner)) THEN - DEALLOCATE(BladeInputDataData%FlpIner) -ENDIF -IF (ALLOCATED(BladeInputDataData%EdgIner)) THEN - DEALLOCATE(BladeInputDataData%EdgIner) -ENDIF -IF (ALLOCATED(BladeInputDataData%PrecrvRef)) THEN - DEALLOCATE(BladeInputDataData%PrecrvRef) -ENDIF -IF (ALLOCATED(BladeInputDataData%PreswpRef)) THEN - DEALLOCATE(BladeInputDataData%PreswpRef) -ENDIF -IF (ALLOCATED(BladeInputDataData%FlpcgOf)) THEN - DEALLOCATE(BladeInputDataData%FlpcgOf) -ENDIF -IF (ALLOCATED(BladeInputDataData%EdgcgOf)) THEN - DEALLOCATE(BladeInputDataData%EdgcgOf) -ENDIF -IF (ALLOCATED(BladeInputDataData%FlpEAOf)) THEN - DEALLOCATE(BladeInputDataData%FlpEAOf) -ENDIF -IF (ALLOCATED(BladeInputDataData%EdgEAOf)) THEN - DEALLOCATE(BladeInputDataData%EdgEAOf) -ENDIF IF (ALLOCATED(BladeInputDataData%BldFl1Sh)) THEN DEALLOCATE(BladeInputDataData%BldFl1Sh) ENDIF @@ -2501,61 +2299,6 @@ SUBROUTINE ED_PackBladeInputData( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, E IF ( ALLOCATED(InData%EdgStff) ) THEN Int_BufSz = Int_BufSz + 2*1 ! EdgStff upper/lower bounds for each dimension Re_BufSz = Re_BufSz + SIZE(InData%EdgStff) ! EdgStff - END IF - Int_BufSz = Int_BufSz + 1 ! GJStff allocated yes/no - IF ( ALLOCATED(InData%GJStff) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! GJStff upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%GJStff) ! GJStff - END IF - Int_BufSz = Int_BufSz + 1 ! EAStff allocated yes/no - IF ( ALLOCATED(InData%EAStff) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! EAStff upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%EAStff) ! EAStff - END IF - Int_BufSz = Int_BufSz + 1 ! Alpha allocated yes/no - IF ( ALLOCATED(InData%Alpha) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! Alpha upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%Alpha) ! Alpha - END IF - Int_BufSz = Int_BufSz + 1 ! FlpIner allocated yes/no - IF ( ALLOCATED(InData%FlpIner) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! FlpIner upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%FlpIner) ! FlpIner - END IF - Int_BufSz = Int_BufSz + 1 ! EdgIner allocated yes/no - IF ( ALLOCATED(InData%EdgIner) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! EdgIner upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%EdgIner) ! EdgIner - END IF - Int_BufSz = Int_BufSz + 1 ! PrecrvRef allocated yes/no - IF ( ALLOCATED(InData%PrecrvRef) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! PrecrvRef upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%PrecrvRef) ! PrecrvRef - END IF - Int_BufSz = Int_BufSz + 1 ! PreswpRef allocated yes/no - IF ( ALLOCATED(InData%PreswpRef) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! PreswpRef upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%PreswpRef) ! PreswpRef - END IF - Int_BufSz = Int_BufSz + 1 ! FlpcgOf allocated yes/no - IF ( ALLOCATED(InData%FlpcgOf) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! FlpcgOf upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%FlpcgOf) ! FlpcgOf - END IF - Int_BufSz = Int_BufSz + 1 ! EdgcgOf allocated yes/no - IF ( ALLOCATED(InData%EdgcgOf) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! EdgcgOf upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%EdgcgOf) ! EdgcgOf - END IF - Int_BufSz = Int_BufSz + 1 ! FlpEAOf allocated yes/no - IF ( ALLOCATED(InData%FlpEAOf) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! FlpEAOf upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%FlpEAOf) ! FlpEAOf - END IF - Int_BufSz = Int_BufSz + 1 ! EdgEAOf allocated yes/no - IF ( ALLOCATED(InData%EdgEAOf) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! EdgEAOf upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%EdgEAOf) ! EdgEAOf END IF Re_BufSz = Re_BufSz + SIZE(InData%BldFlDmp) ! BldFlDmp Re_BufSz = Re_BufSz + SIZE(InData%BldEdDmp) ! BldEdDmp @@ -2693,171 +2436,6 @@ SUBROUTINE ED_PackBladeInputData( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, E ReKiBuf(Re_Xferred) = InData%EdgStff(i1) Re_Xferred = Re_Xferred + 1 END DO - END IF - IF ( .NOT. ALLOCATED(InData%GJStff) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%GJStff,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%GJStff,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%GJStff,1), UBOUND(InData%GJStff,1) - ReKiBuf(Re_Xferred) = InData%GJStff(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%EAStff) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%EAStff,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%EAStff,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%EAStff,1), UBOUND(InData%EAStff,1) - ReKiBuf(Re_Xferred) = InData%EAStff(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%Alpha) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%Alpha,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%Alpha,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%Alpha,1), UBOUND(InData%Alpha,1) - ReKiBuf(Re_Xferred) = InData%Alpha(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%FlpIner) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%FlpIner,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%FlpIner,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%FlpIner,1), UBOUND(InData%FlpIner,1) - ReKiBuf(Re_Xferred) = InData%FlpIner(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%EdgIner) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%EdgIner,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%EdgIner,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%EdgIner,1), UBOUND(InData%EdgIner,1) - ReKiBuf(Re_Xferred) = InData%EdgIner(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%PrecrvRef) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%PrecrvRef,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%PrecrvRef,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%PrecrvRef,1), UBOUND(InData%PrecrvRef,1) - ReKiBuf(Re_Xferred) = InData%PrecrvRef(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%PreswpRef) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%PreswpRef,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%PreswpRef,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%PreswpRef,1), UBOUND(InData%PreswpRef,1) - ReKiBuf(Re_Xferred) = InData%PreswpRef(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%FlpcgOf) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%FlpcgOf,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%FlpcgOf,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%FlpcgOf,1), UBOUND(InData%FlpcgOf,1) - ReKiBuf(Re_Xferred) = InData%FlpcgOf(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%EdgcgOf) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%EdgcgOf,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%EdgcgOf,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%EdgcgOf,1), UBOUND(InData%EdgcgOf,1) - ReKiBuf(Re_Xferred) = InData%EdgcgOf(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%FlpEAOf) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%FlpEAOf,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%FlpEAOf,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%FlpEAOf,1), UBOUND(InData%FlpEAOf,1) - ReKiBuf(Re_Xferred) = InData%FlpEAOf(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%EdgEAOf) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%EdgEAOf,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%EdgEAOf,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%EdgEAOf,1), UBOUND(InData%EdgEAOf,1) - ReKiBuf(Re_Xferred) = InData%EdgEAOf(i1) - Re_Xferred = Re_Xferred + 1 - END DO END IF DO i1 = LBOUND(InData%BldFlDmp,1), UBOUND(InData%BldFlDmp,1) ReKiBuf(Re_Xferred) = InData%BldFlDmp(i1) @@ -2978,278 +2556,80 @@ SUBROUTINE ED_UnPackBladeInputData( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%PitchAx.', ErrStat, ErrMsg,RoutineName) RETURN END IF - DO i1 = LBOUND(OutData%PitchAx,1), UBOUND(OutData%PitchAx,1) - OutData%PitchAx(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! StrcTwst not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%StrcTwst)) DEALLOCATE(OutData%StrcTwst) - ALLOCATE(OutData%StrcTwst(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%StrcTwst.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%StrcTwst,1), UBOUND(OutData%StrcTwst,1) - OutData%StrcTwst(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! BMassDen not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%BMassDen)) DEALLOCATE(OutData%BMassDen) - ALLOCATE(OutData%BMassDen(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%BMassDen.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%BMassDen,1), UBOUND(OutData%BMassDen,1) - OutData%BMassDen(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! FlpStff not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%FlpStff)) DEALLOCATE(OutData%FlpStff) - ALLOCATE(OutData%FlpStff(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%FlpStff.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%FlpStff,1), UBOUND(OutData%FlpStff,1) - OutData%FlpStff(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! EdgStff not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%EdgStff)) DEALLOCATE(OutData%EdgStff) - ALLOCATE(OutData%EdgStff(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%EdgStff.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%EdgStff,1), UBOUND(OutData%EdgStff,1) - OutData%EdgStff(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! GJStff not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%GJStff)) DEALLOCATE(OutData%GJStff) - ALLOCATE(OutData%GJStff(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%GJStff.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%GJStff,1), UBOUND(OutData%GJStff,1) - OutData%GJStff(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! EAStff not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%EAStff)) DEALLOCATE(OutData%EAStff) - ALLOCATE(OutData%EAStff(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%EAStff.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%EAStff,1), UBOUND(OutData%EAStff,1) - OutData%EAStff(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! Alpha not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%Alpha)) DEALLOCATE(OutData%Alpha) - ALLOCATE(OutData%Alpha(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%Alpha.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%Alpha,1), UBOUND(OutData%Alpha,1) - OutData%Alpha(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! FlpIner not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%FlpIner)) DEALLOCATE(OutData%FlpIner) - ALLOCATE(OutData%FlpIner(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%FlpIner.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%FlpIner,1), UBOUND(OutData%FlpIner,1) - OutData%FlpIner(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! EdgIner not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%EdgIner)) DEALLOCATE(OutData%EdgIner) - ALLOCATE(OutData%EdgIner(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%EdgIner.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%EdgIner,1), UBOUND(OutData%EdgIner,1) - OutData%EdgIner(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! PrecrvRef not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%PrecrvRef)) DEALLOCATE(OutData%PrecrvRef) - ALLOCATE(OutData%PrecrvRef(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%PrecrvRef.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%PrecrvRef,1), UBOUND(OutData%PrecrvRef,1) - OutData%PrecrvRef(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! PreswpRef not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%PreswpRef)) DEALLOCATE(OutData%PreswpRef) - ALLOCATE(OutData%PreswpRef(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%PreswpRef.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%PreswpRef,1), UBOUND(OutData%PreswpRef,1) - OutData%PreswpRef(i1) = ReKiBuf(Re_Xferred) + DO i1 = LBOUND(OutData%PitchAx,1), UBOUND(OutData%PitchAx,1) + OutData%PitchAx(i1) = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 END DO END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! FlpcgOf not allocated + IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! StrcTwst not allocated Int_Xferred = Int_Xferred + 1 ELSE Int_Xferred = Int_Xferred + 1 i1_l = IntKiBuf( Int_Xferred ) i1_u = IntKiBuf( Int_Xferred + 1) Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%FlpcgOf)) DEALLOCATE(OutData%FlpcgOf) - ALLOCATE(OutData%FlpcgOf(i1_l:i1_u),STAT=ErrStat2) + IF (ALLOCATED(OutData%StrcTwst)) DEALLOCATE(OutData%StrcTwst) + ALLOCATE(OutData%StrcTwst(i1_l:i1_u),STAT=ErrStat2) IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%FlpcgOf.', ErrStat, ErrMsg,RoutineName) + CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%StrcTwst.', ErrStat, ErrMsg,RoutineName) RETURN END IF - DO i1 = LBOUND(OutData%FlpcgOf,1), UBOUND(OutData%FlpcgOf,1) - OutData%FlpcgOf(i1) = ReKiBuf(Re_Xferred) + DO i1 = LBOUND(OutData%StrcTwst,1), UBOUND(OutData%StrcTwst,1) + OutData%StrcTwst(i1) = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 END DO END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! EdgcgOf not allocated + IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! BMassDen not allocated Int_Xferred = Int_Xferred + 1 ELSE Int_Xferred = Int_Xferred + 1 i1_l = IntKiBuf( Int_Xferred ) i1_u = IntKiBuf( Int_Xferred + 1) Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%EdgcgOf)) DEALLOCATE(OutData%EdgcgOf) - ALLOCATE(OutData%EdgcgOf(i1_l:i1_u),STAT=ErrStat2) + IF (ALLOCATED(OutData%BMassDen)) DEALLOCATE(OutData%BMassDen) + ALLOCATE(OutData%BMassDen(i1_l:i1_u),STAT=ErrStat2) IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%EdgcgOf.', ErrStat, ErrMsg,RoutineName) + CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%BMassDen.', ErrStat, ErrMsg,RoutineName) RETURN END IF - DO i1 = LBOUND(OutData%EdgcgOf,1), UBOUND(OutData%EdgcgOf,1) - OutData%EdgcgOf(i1) = ReKiBuf(Re_Xferred) + DO i1 = LBOUND(OutData%BMassDen,1), UBOUND(OutData%BMassDen,1) + OutData%BMassDen(i1) = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 END DO END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! FlpEAOf not allocated + IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! FlpStff not allocated Int_Xferred = Int_Xferred + 1 ELSE Int_Xferred = Int_Xferred + 1 i1_l = IntKiBuf( Int_Xferred ) i1_u = IntKiBuf( Int_Xferred + 1) Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%FlpEAOf)) DEALLOCATE(OutData%FlpEAOf) - ALLOCATE(OutData%FlpEAOf(i1_l:i1_u),STAT=ErrStat2) + IF (ALLOCATED(OutData%FlpStff)) DEALLOCATE(OutData%FlpStff) + ALLOCATE(OutData%FlpStff(i1_l:i1_u),STAT=ErrStat2) IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%FlpEAOf.', ErrStat, ErrMsg,RoutineName) + CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%FlpStff.', ErrStat, ErrMsg,RoutineName) RETURN END IF - DO i1 = LBOUND(OutData%FlpEAOf,1), UBOUND(OutData%FlpEAOf,1) - OutData%FlpEAOf(i1) = ReKiBuf(Re_Xferred) + DO i1 = LBOUND(OutData%FlpStff,1), UBOUND(OutData%FlpStff,1) + OutData%FlpStff(i1) = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 END DO END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! EdgEAOf not allocated + IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! EdgStff not allocated Int_Xferred = Int_Xferred + 1 ELSE Int_Xferred = Int_Xferred + 1 i1_l = IntKiBuf( Int_Xferred ) i1_u = IntKiBuf( Int_Xferred + 1) Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%EdgEAOf)) DEALLOCATE(OutData%EdgEAOf) - ALLOCATE(OutData%EdgEAOf(i1_l:i1_u),STAT=ErrStat2) + IF (ALLOCATED(OutData%EdgStff)) DEALLOCATE(OutData%EdgStff) + ALLOCATE(OutData%EdgStff(i1_l:i1_u),STAT=ErrStat2) IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%EdgEAOf.', ErrStat, ErrMsg,RoutineName) + CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%EdgStff.', ErrStat, ErrMsg,RoutineName) RETURN END IF - DO i1 = LBOUND(OutData%EdgEAOf,1), UBOUND(OutData%EdgEAOf,1) - OutData%EdgEAOf(i1) = ReKiBuf(Re_Xferred) + DO i1 = LBOUND(OutData%EdgStff,1), UBOUND(OutData%EdgStff,1) + OutData%EdgStff(i1) = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 END DO END IF @@ -3911,78 +3291,6 @@ SUBROUTINE ED_CopyInputFile( SrcInputFileData, DstInputFileData, CtrlCode, ErrSt END IF END IF DstInputFileData%TwSSM2Sh = SrcInputFileData%TwSSM2Sh -ENDIF -IF (ALLOCATED(SrcInputFileData%TwGJStif)) THEN - i1_l = LBOUND(SrcInputFileData%TwGJStif,1) - i1_u = UBOUND(SrcInputFileData%TwGJStif,1) - IF (.NOT. ALLOCATED(DstInputFileData%TwGJStif)) THEN - ALLOCATE(DstInputFileData%TwGJStif(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInputFileData%TwGJStif.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstInputFileData%TwGJStif = SrcInputFileData%TwGJStif -ENDIF -IF (ALLOCATED(SrcInputFileData%TwEAStif)) THEN - i1_l = LBOUND(SrcInputFileData%TwEAStif,1) - i1_u = UBOUND(SrcInputFileData%TwEAStif,1) - IF (.NOT. ALLOCATED(DstInputFileData%TwEAStif)) THEN - ALLOCATE(DstInputFileData%TwEAStif(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInputFileData%TwEAStif.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstInputFileData%TwEAStif = SrcInputFileData%TwEAStif -ENDIF -IF (ALLOCATED(SrcInputFileData%TwFAIner)) THEN - i1_l = LBOUND(SrcInputFileData%TwFAIner,1) - i1_u = UBOUND(SrcInputFileData%TwFAIner,1) - IF (.NOT. ALLOCATED(DstInputFileData%TwFAIner)) THEN - ALLOCATE(DstInputFileData%TwFAIner(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInputFileData%TwFAIner.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstInputFileData%TwFAIner = SrcInputFileData%TwFAIner -ENDIF -IF (ALLOCATED(SrcInputFileData%TwSSIner)) THEN - i1_l = LBOUND(SrcInputFileData%TwSSIner,1) - i1_u = UBOUND(SrcInputFileData%TwSSIner,1) - IF (.NOT. ALLOCATED(DstInputFileData%TwSSIner)) THEN - ALLOCATE(DstInputFileData%TwSSIner(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInputFileData%TwSSIner.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstInputFileData%TwSSIner = SrcInputFileData%TwSSIner -ENDIF -IF (ALLOCATED(SrcInputFileData%TwFAcgOf)) THEN - i1_l = LBOUND(SrcInputFileData%TwFAcgOf,1) - i1_u = UBOUND(SrcInputFileData%TwFAcgOf,1) - IF (.NOT. ALLOCATED(DstInputFileData%TwFAcgOf)) THEN - ALLOCATE(DstInputFileData%TwFAcgOf(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInputFileData%TwFAcgOf.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstInputFileData%TwFAcgOf = SrcInputFileData%TwFAcgOf -ENDIF -IF (ALLOCATED(SrcInputFileData%TwSScgOf)) THEN - i1_l = LBOUND(SrcInputFileData%TwSScgOf,1) - i1_u = UBOUND(SrcInputFileData%TwSScgOf,1) - IF (.NOT. ALLOCATED(DstInputFileData%TwSScgOf)) THEN - ALLOCATE(DstInputFileData%TwSScgOf(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstInputFileData%TwSScgOf.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstInputFileData%TwSScgOf = SrcInputFileData%TwSScgOf ENDIF DstInputFileData%RFrlDOF = SrcInputFileData%RFrlDOF DstInputFileData%TFrlDOF = SrcInputFileData%TFrlDOF @@ -4115,24 +3423,6 @@ SUBROUTINE ED_DestroyInputFile( InputFileData, ErrStat, ErrMsg, DEALLOCATEpointe IF (ALLOCATED(InputFileData%TwSSM2Sh)) THEN DEALLOCATE(InputFileData%TwSSM2Sh) ENDIF -IF (ALLOCATED(InputFileData%TwGJStif)) THEN - DEALLOCATE(InputFileData%TwGJStif) -ENDIF -IF (ALLOCATED(InputFileData%TwEAStif)) THEN - DEALLOCATE(InputFileData%TwEAStif) -ENDIF -IF (ALLOCATED(InputFileData%TwFAIner)) THEN - DEALLOCATE(InputFileData%TwFAIner) -ENDIF -IF (ALLOCATED(InputFileData%TwSSIner)) THEN - DEALLOCATE(InputFileData%TwSSIner) -ENDIF -IF (ALLOCATED(InputFileData%TwFAcgOf)) THEN - DEALLOCATE(InputFileData%TwFAcgOf) -ENDIF -IF (ALLOCATED(InputFileData%TwSScgOf)) THEN - DEALLOCATE(InputFileData%TwSScgOf) -ENDIF IF (ALLOCATED(InputFileData%BldNd_OutList)) THEN DEALLOCATE(InputFileData%BldNd_OutList) ENDIF @@ -4375,36 +3665,6 @@ SUBROUTINE ED_PackInputFile( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg IF ( ALLOCATED(InData%TwSSM2Sh) ) THEN Int_BufSz = Int_BufSz + 2*1 ! TwSSM2Sh upper/lower bounds for each dimension Re_BufSz = Re_BufSz + SIZE(InData%TwSSM2Sh) ! TwSSM2Sh - END IF - Int_BufSz = Int_BufSz + 1 ! TwGJStif allocated yes/no - IF ( ALLOCATED(InData%TwGJStif) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! TwGJStif upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%TwGJStif) ! TwGJStif - END IF - Int_BufSz = Int_BufSz + 1 ! TwEAStif allocated yes/no - IF ( ALLOCATED(InData%TwEAStif) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! TwEAStif upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%TwEAStif) ! TwEAStif - END IF - Int_BufSz = Int_BufSz + 1 ! TwFAIner allocated yes/no - IF ( ALLOCATED(InData%TwFAIner) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! TwFAIner upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%TwFAIner) ! TwFAIner - END IF - Int_BufSz = Int_BufSz + 1 ! TwSSIner allocated yes/no - IF ( ALLOCATED(InData%TwSSIner) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! TwSSIner upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%TwSSIner) ! TwSSIner - END IF - Int_BufSz = Int_BufSz + 1 ! TwFAcgOf allocated yes/no - IF ( ALLOCATED(InData%TwFAcgOf) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! TwFAcgOf upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%TwFAcgOf) ! TwFAcgOf - END IF - Int_BufSz = Int_BufSz + 1 ! TwSScgOf allocated yes/no - IF ( ALLOCATED(InData%TwSScgOf) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! TwSScgOf upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%TwSScgOf) ! TwSScgOf END IF Int_BufSz = Int_BufSz + 1 ! RFrlDOF Int_BufSz = Int_BufSz + 1 ! TFrlDOF @@ -4953,96 +4213,6 @@ SUBROUTINE ED_PackInputFile( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg ReKiBuf(Re_Xferred) = InData%TwSSM2Sh(i1) Re_Xferred = Re_Xferred + 1 END DO - END IF - IF ( .NOT. ALLOCATED(InData%TwGJStif) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%TwGJStif,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%TwGJStif,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%TwGJStif,1), UBOUND(InData%TwGJStif,1) - ReKiBuf(Re_Xferred) = InData%TwGJStif(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%TwEAStif) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%TwEAStif,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%TwEAStif,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%TwEAStif,1), UBOUND(InData%TwEAStif,1) - ReKiBuf(Re_Xferred) = InData%TwEAStif(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%TwFAIner) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%TwFAIner,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%TwFAIner,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%TwFAIner,1), UBOUND(InData%TwFAIner,1) - ReKiBuf(Re_Xferred) = InData%TwFAIner(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%TwSSIner) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%TwSSIner,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%TwSSIner,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%TwSSIner,1), UBOUND(InData%TwSSIner,1) - ReKiBuf(Re_Xferred) = InData%TwSSIner(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%TwFAcgOf) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%TwFAcgOf,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%TwFAcgOf,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%TwFAcgOf,1), UBOUND(InData%TwFAcgOf,1) - ReKiBuf(Re_Xferred) = InData%TwFAcgOf(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%TwSScgOf) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%TwSScgOf,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%TwSScgOf,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%TwSScgOf,1), UBOUND(InData%TwSScgOf,1) - ReKiBuf(Re_Xferred) = InData%TwSScgOf(i1) - Re_Xferred = Re_Xferred + 1 - END DO END IF IntKiBuf(Int_Xferred) = TRANSFER(InData%RFrlDOF, IntKiBuf(1)) Int_Xferred = Int_Xferred + 1 @@ -5741,114 +4911,6 @@ SUBROUTINE ED_UnPackInputFile( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, Err OutData%TwSSM2Sh(i1) = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! TwGJStif not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%TwGJStif)) DEALLOCATE(OutData%TwGJStif) - ALLOCATE(OutData%TwGJStif(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%TwGJStif.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%TwGJStif,1), UBOUND(OutData%TwGJStif,1) - OutData%TwGJStif(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! TwEAStif not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%TwEAStif)) DEALLOCATE(OutData%TwEAStif) - ALLOCATE(OutData%TwEAStif(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%TwEAStif.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%TwEAStif,1), UBOUND(OutData%TwEAStif,1) - OutData%TwEAStif(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! TwFAIner not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%TwFAIner)) DEALLOCATE(OutData%TwFAIner) - ALLOCATE(OutData%TwFAIner(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%TwFAIner.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%TwFAIner,1), UBOUND(OutData%TwFAIner,1) - OutData%TwFAIner(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! TwSSIner not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%TwSSIner)) DEALLOCATE(OutData%TwSSIner) - ALLOCATE(OutData%TwSSIner(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%TwSSIner.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%TwSSIner,1), UBOUND(OutData%TwSSIner,1) - OutData%TwSSIner(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! TwFAcgOf not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%TwFAcgOf)) DEALLOCATE(OutData%TwFAcgOf) - ALLOCATE(OutData%TwFAcgOf(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%TwFAcgOf.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%TwFAcgOf,1), UBOUND(OutData%TwFAcgOf,1) - OutData%TwFAcgOf(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! TwSScgOf not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%TwSScgOf)) DEALLOCATE(OutData%TwSScgOf) - ALLOCATE(OutData%TwSScgOf(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%TwSScgOf.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%TwSScgOf,1), UBOUND(OutData%TwSScgOf,1) - OutData%TwSScgOf(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO END IF OutData%RFrlDOF = TRANSFER(IntKiBuf(Int_Xferred), OutData%RFrlDOF) Int_Xferred = Int_Xferred + 1 @@ -16703,54 +15765,6 @@ SUBROUTINE ED_CopyParam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg ) ENDIF DstParamData%TTopNode = SrcParamData%TTopNode DstParamData%TwrNodes = SrcParamData%TwrNodes -IF (ALLOCATED(SrcParamData%InerTFA)) THEN - i1_l = LBOUND(SrcParamData%InerTFA,1) - i1_u = UBOUND(SrcParamData%InerTFA,1) - IF (.NOT. ALLOCATED(DstParamData%InerTFA)) THEN - ALLOCATE(DstParamData%InerTFA(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%InerTFA.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%InerTFA = SrcParamData%InerTFA -ENDIF -IF (ALLOCATED(SrcParamData%InerTSS)) THEN - i1_l = LBOUND(SrcParamData%InerTSS,1) - i1_u = UBOUND(SrcParamData%InerTSS,1) - IF (.NOT. ALLOCATED(DstParamData%InerTSS)) THEN - ALLOCATE(DstParamData%InerTSS(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%InerTSS.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%InerTSS = SrcParamData%InerTSS -ENDIF -IF (ALLOCATED(SrcParamData%StiffTGJ)) THEN - i1_l = LBOUND(SrcParamData%StiffTGJ,1) - i1_u = UBOUND(SrcParamData%StiffTGJ,1) - IF (.NOT. ALLOCATED(DstParamData%StiffTGJ)) THEN - ALLOCATE(DstParamData%StiffTGJ(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%StiffTGJ.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%StiffTGJ = SrcParamData%StiffTGJ -ENDIF -IF (ALLOCATED(SrcParamData%StiffTEA)) THEN - i1_l = LBOUND(SrcParamData%StiffTEA,1) - i1_u = UBOUND(SrcParamData%StiffTEA,1) - IF (.NOT. ALLOCATED(DstParamData%StiffTEA)) THEN - ALLOCATE(DstParamData%StiffTEA(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%StiffTEA.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%StiffTEA = SrcParamData%StiffTEA -ENDIF IF (ALLOCATED(SrcParamData%StiffTFA)) THEN i1_l = LBOUND(SrcParamData%StiffTFA,1) i1_u = UBOUND(SrcParamData%StiffTFA,1) @@ -16762,30 +15776,6 @@ SUBROUTINE ED_CopyParam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg ) END IF END IF DstParamData%StiffTFA = SrcParamData%StiffTFA -ENDIF -IF (ALLOCATED(SrcParamData%cgOffTFA)) THEN - i1_l = LBOUND(SrcParamData%cgOffTFA,1) - i1_u = UBOUND(SrcParamData%cgOffTFA,1) - IF (.NOT. ALLOCATED(DstParamData%cgOffTFA)) THEN - ALLOCATE(DstParamData%cgOffTFA(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%cgOffTFA.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%cgOffTFA = SrcParamData%cgOffTFA -ENDIF -IF (ALLOCATED(SrcParamData%cgOffTSS)) THEN - i1_l = LBOUND(SrcParamData%cgOffTSS,1) - i1_u = UBOUND(SrcParamData%cgOffTSS,1) - IF (.NOT. ALLOCATED(DstParamData%cgOffTSS)) THEN - ALLOCATE(DstParamData%cgOffTSS(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%cgOffTSS.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%cgOffTSS = SrcParamData%cgOffTSS ENDIF DstParamData%AtfaIner = SrcParamData%AtfaIner IF (ALLOCATED(SrcParamData%BldCG)) THEN @@ -16914,20 +15904,6 @@ SUBROUTINE ED_CopyParam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg ) END IF DstParamData%AxRedBld = SrcParamData%AxRedBld ENDIF -IF (ALLOCATED(SrcParamData%BAlpha)) THEN - i1_l = LBOUND(SrcParamData%BAlpha,1) - i1_u = UBOUND(SrcParamData%BAlpha,1) - i2_l = LBOUND(SrcParamData%BAlpha,2) - i2_u = UBOUND(SrcParamData%BAlpha,2) - IF (.NOT. ALLOCATED(DstParamData%BAlpha)) THEN - ALLOCATE(DstParamData%BAlpha(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%BAlpha.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%BAlpha = SrcParamData%BAlpha -ENDIF IF (ALLOCATED(SrcParamData%BldEDamp)) THEN i1_l = LBOUND(SrcParamData%BldEDamp,1) i1_u = UBOUND(SrcParamData%BldEDamp,1) @@ -17001,34 +15977,6 @@ SUBROUTINE ED_CopyParam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg ) END IF DstParamData%CBF = SrcParamData%CBF ENDIF -IF (ALLOCATED(SrcParamData%cgOffBEdg)) THEN - i1_l = LBOUND(SrcParamData%cgOffBEdg,1) - i1_u = UBOUND(SrcParamData%cgOffBEdg,1) - i2_l = LBOUND(SrcParamData%cgOffBEdg,2) - i2_u = UBOUND(SrcParamData%cgOffBEdg,2) - IF (.NOT. ALLOCATED(DstParamData%cgOffBEdg)) THEN - ALLOCATE(DstParamData%cgOffBEdg(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%cgOffBEdg.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%cgOffBEdg = SrcParamData%cgOffBEdg -ENDIF -IF (ALLOCATED(SrcParamData%cgOffBFlp)) THEN - i1_l = LBOUND(SrcParamData%cgOffBFlp,1) - i1_u = UBOUND(SrcParamData%cgOffBFlp,1) - i2_l = LBOUND(SrcParamData%cgOffBFlp,2) - i2_u = UBOUND(SrcParamData%cgOffBFlp,2) - IF (.NOT. ALLOCATED(DstParamData%cgOffBFlp)) THEN - ALLOCATE(DstParamData%cgOffBFlp(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%cgOffBFlp.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%cgOffBFlp = SrcParamData%cgOffBFlp -ENDIF IF (ALLOCATED(SrcParamData%Chord)) THEN i1_l = LBOUND(SrcParamData%Chord,1) i1_u = UBOUND(SrcParamData%Chord,1) @@ -17065,35 +16013,7 @@ SUBROUTINE ED_CopyParam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg ) RETURN END IF END IF - DstParamData%DRNodes = SrcParamData%DRNodes -ENDIF -IF (ALLOCATED(SrcParamData%EAOffBEdg)) THEN - i1_l = LBOUND(SrcParamData%EAOffBEdg,1) - i1_u = UBOUND(SrcParamData%EAOffBEdg,1) - i2_l = LBOUND(SrcParamData%EAOffBEdg,2) - i2_u = UBOUND(SrcParamData%EAOffBEdg,2) - IF (.NOT. ALLOCATED(DstParamData%EAOffBEdg)) THEN - ALLOCATE(DstParamData%EAOffBEdg(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%EAOffBEdg.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%EAOffBEdg = SrcParamData%EAOffBEdg -ENDIF -IF (ALLOCATED(SrcParamData%EAOffBFlp)) THEN - i1_l = LBOUND(SrcParamData%EAOffBFlp,1) - i1_u = UBOUND(SrcParamData%EAOffBFlp,1) - i2_l = LBOUND(SrcParamData%EAOffBFlp,2) - i2_u = UBOUND(SrcParamData%EAOffBFlp,2) - IF (.NOT. ALLOCATED(DstParamData%EAOffBFlp)) THEN - ALLOCATE(DstParamData%EAOffBFlp(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%EAOffBFlp.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%EAOffBFlp = SrcParamData%EAOffBFlp + DstParamData%DRNodes = SrcParamData%DRNodes ENDIF IF (ALLOCATED(SrcParamData%FStTunr)) THEN i1_l = LBOUND(SrcParamData%FStTunr,1) @@ -17109,34 +16029,6 @@ SUBROUTINE ED_CopyParam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg ) END IF DstParamData%FStTunr = SrcParamData%FStTunr ENDIF -IF (ALLOCATED(SrcParamData%InerBEdg)) THEN - i1_l = LBOUND(SrcParamData%InerBEdg,1) - i1_u = UBOUND(SrcParamData%InerBEdg,1) - i2_l = LBOUND(SrcParamData%InerBEdg,2) - i2_u = UBOUND(SrcParamData%InerBEdg,2) - IF (.NOT. ALLOCATED(DstParamData%InerBEdg)) THEN - ALLOCATE(DstParamData%InerBEdg(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%InerBEdg.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%InerBEdg = SrcParamData%InerBEdg -ENDIF -IF (ALLOCATED(SrcParamData%InerBFlp)) THEN - i1_l = LBOUND(SrcParamData%InerBFlp,1) - i1_u = UBOUND(SrcParamData%InerBFlp,1) - i2_l = LBOUND(SrcParamData%InerBFlp,2) - i2_u = UBOUND(SrcParamData%InerBFlp,2) - IF (.NOT. ALLOCATED(DstParamData%InerBFlp)) THEN - ALLOCATE(DstParamData%InerBFlp(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%InerBFlp.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%InerBFlp = SrcParamData%InerBFlp -ENDIF IF (ALLOCATED(SrcParamData%KBE)) THEN i1_l = LBOUND(SrcParamData%KBE,1) i1_u = UBOUND(SrcParamData%KBE,1) @@ -17183,34 +16075,6 @@ SUBROUTINE ED_CopyParam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg ) END IF DstParamData%MassB = SrcParamData%MassB ENDIF -IF (ALLOCATED(SrcParamData%RefAxisxb)) THEN - i1_l = LBOUND(SrcParamData%RefAxisxb,1) - i1_u = UBOUND(SrcParamData%RefAxisxb,1) - i2_l = LBOUND(SrcParamData%RefAxisxb,2) - i2_u = UBOUND(SrcParamData%RefAxisxb,2) - IF (.NOT. ALLOCATED(DstParamData%RefAxisxb)) THEN - ALLOCATE(DstParamData%RefAxisxb(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%RefAxisxb.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%RefAxisxb = SrcParamData%RefAxisxb -ENDIF -IF (ALLOCATED(SrcParamData%RefAxisyb)) THEN - i1_l = LBOUND(SrcParamData%RefAxisyb,1) - i1_u = UBOUND(SrcParamData%RefAxisyb,1) - i2_l = LBOUND(SrcParamData%RefAxisyb,2) - i2_u = UBOUND(SrcParamData%RefAxisyb,2) - IF (.NOT. ALLOCATED(DstParamData%RefAxisyb)) THEN - ALLOCATE(DstParamData%RefAxisyb(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%RefAxisyb.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%RefAxisyb = SrcParamData%RefAxisyb -ENDIF IF (ALLOCATED(SrcParamData%RNodes)) THEN i1_l = LBOUND(SrcParamData%RNodes,1) i1_u = UBOUND(SrcParamData%RNodes,1) @@ -17289,20 +16153,6 @@ SUBROUTINE ED_CopyParam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg ) END IF DstParamData%StiffBE = SrcParamData%StiffBE ENDIF -IF (ALLOCATED(SrcParamData%StiffBEA)) THEN - i1_l = LBOUND(SrcParamData%StiffBEA,1) - i1_u = UBOUND(SrcParamData%StiffBEA,1) - i2_l = LBOUND(SrcParamData%StiffBEA,2) - i2_u = UBOUND(SrcParamData%StiffBEA,2) - IF (.NOT. ALLOCATED(DstParamData%StiffBEA)) THEN - ALLOCATE(DstParamData%StiffBEA(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%StiffBEA.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%StiffBEA = SrcParamData%StiffBEA -ENDIF IF (ALLOCATED(SrcParamData%StiffBF)) THEN i1_l = LBOUND(SrcParamData%StiffBF,1) i1_u = UBOUND(SrcParamData%StiffBF,1) @@ -17317,20 +16167,6 @@ SUBROUTINE ED_CopyParam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg ) END IF DstParamData%StiffBF = SrcParamData%StiffBF ENDIF -IF (ALLOCATED(SrcParamData%StiffBGJ)) THEN - i1_l = LBOUND(SrcParamData%StiffBGJ,1) - i1_u = UBOUND(SrcParamData%StiffBGJ,1) - i2_l = LBOUND(SrcParamData%StiffBGJ,2) - i2_u = UBOUND(SrcParamData%StiffBGJ,2) - IF (.NOT. ALLOCATED(DstParamData%StiffBGJ)) THEN - ALLOCATE(DstParamData%StiffBGJ(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating DstParamData%StiffBGJ.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - END IF - DstParamData%StiffBGJ = SrcParamData%StiffBGJ -ENDIF IF (ALLOCATED(SrcParamData%SThetaS)) THEN i1_l = LBOUND(SrcParamData%SThetaS,1) i1_u = UBOUND(SrcParamData%SThetaS,1) @@ -17661,27 +16497,9 @@ SUBROUTINE ED_DestroyParam( ParamData, ErrStat, ErrMsg, DEALLOCATEpointers ) IF (ALLOCATED(ParamData%TwrSSSF)) THEN DEALLOCATE(ParamData%TwrSSSF) ENDIF -IF (ALLOCATED(ParamData%InerTFA)) THEN - DEALLOCATE(ParamData%InerTFA) -ENDIF -IF (ALLOCATED(ParamData%InerTSS)) THEN - DEALLOCATE(ParamData%InerTSS) -ENDIF -IF (ALLOCATED(ParamData%StiffTGJ)) THEN - DEALLOCATE(ParamData%StiffTGJ) -ENDIF -IF (ALLOCATED(ParamData%StiffTEA)) THEN - DEALLOCATE(ParamData%StiffTEA) -ENDIF IF (ALLOCATED(ParamData%StiffTFA)) THEN DEALLOCATE(ParamData%StiffTFA) ENDIF -IF (ALLOCATED(ParamData%cgOffTFA)) THEN - DEALLOCATE(ParamData%cgOffTFA) -ENDIF -IF (ALLOCATED(ParamData%cgOffTSS)) THEN - DEALLOCATE(ParamData%cgOffTSS) -ENDIF IF (ALLOCATED(ParamData%BldCG)) THEN DEALLOCATE(ParamData%BldCG) ENDIF @@ -17706,9 +16524,6 @@ SUBROUTINE ED_DestroyParam( ParamData, ErrStat, ErrMsg, DEALLOCATEpointers ) IF (ALLOCATED(ParamData%AxRedBld)) THEN DEALLOCATE(ParamData%AxRedBld) ENDIF -IF (ALLOCATED(ParamData%BAlpha)) THEN - DEALLOCATE(ParamData%BAlpha) -ENDIF IF (ALLOCATED(ParamData%BldEDamp)) THEN DEALLOCATE(ParamData%BldEDamp) ENDIF @@ -17724,12 +16539,6 @@ SUBROUTINE ED_DestroyParam( ParamData, ErrStat, ErrMsg, DEALLOCATEpointers ) IF (ALLOCATED(ParamData%CBF)) THEN DEALLOCATE(ParamData%CBF) ENDIF -IF (ALLOCATED(ParamData%cgOffBEdg)) THEN - DEALLOCATE(ParamData%cgOffBEdg) -ENDIF -IF (ALLOCATED(ParamData%cgOffBFlp)) THEN - DEALLOCATE(ParamData%cgOffBFlp) -ENDIF IF (ALLOCATED(ParamData%Chord)) THEN DEALLOCATE(ParamData%Chord) ENDIF @@ -17739,21 +16548,9 @@ SUBROUTINE ED_DestroyParam( ParamData, ErrStat, ErrMsg, DEALLOCATEpointers ) IF (ALLOCATED(ParamData%DRNodes)) THEN DEALLOCATE(ParamData%DRNodes) ENDIF -IF (ALLOCATED(ParamData%EAOffBEdg)) THEN - DEALLOCATE(ParamData%EAOffBEdg) -ENDIF -IF (ALLOCATED(ParamData%EAOffBFlp)) THEN - DEALLOCATE(ParamData%EAOffBFlp) -ENDIF IF (ALLOCATED(ParamData%FStTunr)) THEN DEALLOCATE(ParamData%FStTunr) ENDIF -IF (ALLOCATED(ParamData%InerBEdg)) THEN - DEALLOCATE(ParamData%InerBEdg) -ENDIF -IF (ALLOCATED(ParamData%InerBFlp)) THEN - DEALLOCATE(ParamData%InerBFlp) -ENDIF IF (ALLOCATED(ParamData%KBE)) THEN DEALLOCATE(ParamData%KBE) ENDIF @@ -17763,12 +16560,6 @@ SUBROUTINE ED_DestroyParam( ParamData, ErrStat, ErrMsg, DEALLOCATEpointers ) IF (ALLOCATED(ParamData%MassB)) THEN DEALLOCATE(ParamData%MassB) ENDIF -IF (ALLOCATED(ParamData%RefAxisxb)) THEN - DEALLOCATE(ParamData%RefAxisxb) -ENDIF -IF (ALLOCATED(ParamData%RefAxisyb)) THEN - DEALLOCATE(ParamData%RefAxisyb) -ENDIF IF (ALLOCATED(ParamData%RNodes)) THEN DEALLOCATE(ParamData%RNodes) ENDIF @@ -17787,15 +16578,9 @@ SUBROUTINE ED_DestroyParam( ParamData, ErrStat, ErrMsg, DEALLOCATEpointers ) IF (ALLOCATED(ParamData%StiffBE)) THEN DEALLOCATE(ParamData%StiffBE) ENDIF -IF (ALLOCATED(ParamData%StiffBEA)) THEN - DEALLOCATE(ParamData%StiffBEA) -ENDIF IF (ALLOCATED(ParamData%StiffBF)) THEN DEALLOCATE(ParamData%StiffBF) ENDIF -IF (ALLOCATED(ParamData%StiffBGJ)) THEN - DEALLOCATE(ParamData%StiffBGJ) -ENDIF IF (ALLOCATED(ParamData%SThetaS)) THEN DEALLOCATE(ParamData%SThetaS) ENDIF @@ -18078,40 +16863,10 @@ SUBROUTINE ED_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si END IF Int_BufSz = Int_BufSz + 1 ! TTopNode Int_BufSz = Int_BufSz + 1 ! TwrNodes - Int_BufSz = Int_BufSz + 1 ! InerTFA allocated yes/no - IF ( ALLOCATED(InData%InerTFA) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! InerTFA upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%InerTFA) ! InerTFA - END IF - Int_BufSz = Int_BufSz + 1 ! InerTSS allocated yes/no - IF ( ALLOCATED(InData%InerTSS) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! InerTSS upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%InerTSS) ! InerTSS - END IF - Int_BufSz = Int_BufSz + 1 ! StiffTGJ allocated yes/no - IF ( ALLOCATED(InData%StiffTGJ) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! StiffTGJ upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%StiffTGJ) ! StiffTGJ - END IF - Int_BufSz = Int_BufSz + 1 ! StiffTEA allocated yes/no - IF ( ALLOCATED(InData%StiffTEA) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! StiffTEA upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%StiffTEA) ! StiffTEA - END IF Int_BufSz = Int_BufSz + 1 ! StiffTFA allocated yes/no IF ( ALLOCATED(InData%StiffTFA) ) THEN Int_BufSz = Int_BufSz + 2*1 ! StiffTFA upper/lower bounds for each dimension Re_BufSz = Re_BufSz + SIZE(InData%StiffTFA) ! StiffTFA - END IF - Int_BufSz = Int_BufSz + 1 ! cgOffTFA allocated yes/no - IF ( ALLOCATED(InData%cgOffTFA) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! cgOffTFA upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%cgOffTFA) ! cgOffTFA - END IF - Int_BufSz = Int_BufSz + 1 ! cgOffTSS allocated yes/no - IF ( ALLOCATED(InData%cgOffTSS) ) THEN - Int_BufSz = Int_BufSz + 2*1 ! cgOffTSS upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%cgOffTSS) ! cgOffTSS END IF Re_BufSz = Re_BufSz + 1 ! AtfaIner Int_BufSz = Int_BufSz + 1 ! BldCG allocated yes/no @@ -18176,11 +16931,6 @@ SUBROUTINE ED_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si Int_BufSz = Int_BufSz + 2*4 ! AxRedBld upper/lower bounds for each dimension Re_BufSz = Re_BufSz + SIZE(InData%AxRedBld) ! AxRedBld END IF - Int_BufSz = Int_BufSz + 1 ! BAlpha allocated yes/no - IF ( ALLOCATED(InData%BAlpha) ) THEN - Int_BufSz = Int_BufSz + 2*2 ! BAlpha upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%BAlpha) ! BAlpha - END IF Int_BufSz = Int_BufSz + 1 ! BldEDamp allocated yes/no IF ( ALLOCATED(InData%BldEDamp) ) THEN Int_BufSz = Int_BufSz + 2*2 ! BldEDamp upper/lower bounds for each dimension @@ -18207,16 +16957,6 @@ SUBROUTINE ED_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si Int_BufSz = Int_BufSz + 2*3 ! CBF upper/lower bounds for each dimension Re_BufSz = Re_BufSz + SIZE(InData%CBF) ! CBF END IF - Int_BufSz = Int_BufSz + 1 ! cgOffBEdg allocated yes/no - IF ( ALLOCATED(InData%cgOffBEdg) ) THEN - Int_BufSz = Int_BufSz + 2*2 ! cgOffBEdg upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%cgOffBEdg) ! cgOffBEdg - END IF - Int_BufSz = Int_BufSz + 1 ! cgOffBFlp allocated yes/no - IF ( ALLOCATED(InData%cgOffBFlp) ) THEN - Int_BufSz = Int_BufSz + 2*2 ! cgOffBFlp upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%cgOffBFlp) ! cgOffBFlp - END IF Int_BufSz = Int_BufSz + 1 ! Chord allocated yes/no IF ( ALLOCATED(InData%Chord) ) THEN Int_BufSz = Int_BufSz + 2*1 ! Chord upper/lower bounds for each dimension @@ -18232,31 +16972,11 @@ SUBROUTINE ED_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si Int_BufSz = Int_BufSz + 2*1 ! DRNodes upper/lower bounds for each dimension Re_BufSz = Re_BufSz + SIZE(InData%DRNodes) ! DRNodes END IF - Int_BufSz = Int_BufSz + 1 ! EAOffBEdg allocated yes/no - IF ( ALLOCATED(InData%EAOffBEdg) ) THEN - Int_BufSz = Int_BufSz + 2*2 ! EAOffBEdg upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%EAOffBEdg) ! EAOffBEdg - END IF - Int_BufSz = Int_BufSz + 1 ! EAOffBFlp allocated yes/no - IF ( ALLOCATED(InData%EAOffBFlp) ) THEN - Int_BufSz = Int_BufSz + 2*2 ! EAOffBFlp upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%EAOffBFlp) ! EAOffBFlp - END IF Int_BufSz = Int_BufSz + 1 ! FStTunr allocated yes/no IF ( ALLOCATED(InData%FStTunr) ) THEN Int_BufSz = Int_BufSz + 2*2 ! FStTunr upper/lower bounds for each dimension Re_BufSz = Re_BufSz + SIZE(InData%FStTunr) ! FStTunr END IF - Int_BufSz = Int_BufSz + 1 ! InerBEdg allocated yes/no - IF ( ALLOCATED(InData%InerBEdg) ) THEN - Int_BufSz = Int_BufSz + 2*2 ! InerBEdg upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%InerBEdg) ! InerBEdg - END IF - Int_BufSz = Int_BufSz + 1 ! InerBFlp allocated yes/no - IF ( ALLOCATED(InData%InerBFlp) ) THEN - Int_BufSz = Int_BufSz + 2*2 ! InerBFlp upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%InerBFlp) ! InerBFlp - END IF Int_BufSz = Int_BufSz + 1 ! KBE allocated yes/no IF ( ALLOCATED(InData%KBE) ) THEN Int_BufSz = Int_BufSz + 2*3 ! KBE upper/lower bounds for each dimension @@ -18272,16 +16992,6 @@ SUBROUTINE ED_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si Int_BufSz = Int_BufSz + 2*2 ! MassB upper/lower bounds for each dimension Re_BufSz = Re_BufSz + SIZE(InData%MassB) ! MassB END IF - Int_BufSz = Int_BufSz + 1 ! RefAxisxb allocated yes/no - IF ( ALLOCATED(InData%RefAxisxb) ) THEN - Int_BufSz = Int_BufSz + 2*2 ! RefAxisxb upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%RefAxisxb) ! RefAxisxb - END IF - Int_BufSz = Int_BufSz + 1 ! RefAxisyb allocated yes/no - IF ( ALLOCATED(InData%RefAxisyb) ) THEN - Int_BufSz = Int_BufSz + 2*2 ! RefAxisyb upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%RefAxisyb) ! RefAxisyb - END IF Int_BufSz = Int_BufSz + 1 ! RNodes allocated yes/no IF ( ALLOCATED(InData%RNodes) ) THEN Int_BufSz = Int_BufSz + 2*1 ! RNodes upper/lower bounds for each dimension @@ -18312,21 +17022,11 @@ SUBROUTINE ED_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si Int_BufSz = Int_BufSz + 2*2 ! StiffBE upper/lower bounds for each dimension Re_BufSz = Re_BufSz + SIZE(InData%StiffBE) ! StiffBE END IF - Int_BufSz = Int_BufSz + 1 ! StiffBEA allocated yes/no - IF ( ALLOCATED(InData%StiffBEA) ) THEN - Int_BufSz = Int_BufSz + 2*2 ! StiffBEA upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%StiffBEA) ! StiffBEA - END IF Int_BufSz = Int_BufSz + 1 ! StiffBF allocated yes/no IF ( ALLOCATED(InData%StiffBF) ) THEN Int_BufSz = Int_BufSz + 2*2 ! StiffBF upper/lower bounds for each dimension Re_BufSz = Re_BufSz + SIZE(InData%StiffBF) ! StiffBF END IF - Int_BufSz = Int_BufSz + 1 ! StiffBGJ allocated yes/no - IF ( ALLOCATED(InData%StiffBGJ) ) THEN - Int_BufSz = Int_BufSz + 2*2 ! StiffBGJ upper/lower bounds for each dimension - Re_BufSz = Re_BufSz + SIZE(InData%StiffBGJ) ! StiffBGJ - END IF Int_BufSz = Int_BufSz + 1 ! SThetaS allocated yes/no IF ( ALLOCATED(InData%SThetaS) ) THEN Int_BufSz = Int_BufSz + 2*2 ! SThetaS upper/lower bounds for each dimension @@ -19024,66 +17724,6 @@ SUBROUTINE ED_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si Int_Xferred = Int_Xferred + 1 IntKiBuf(Int_Xferred) = InData%TwrNodes Int_Xferred = Int_Xferred + 1 - IF ( .NOT. ALLOCATED(InData%InerTFA) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%InerTFA,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InerTFA,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%InerTFA,1), UBOUND(InData%InerTFA,1) - ReKiBuf(Re_Xferred) = InData%InerTFA(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%InerTSS) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%InerTSS,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InerTSS,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%InerTSS,1), UBOUND(InData%InerTSS,1) - ReKiBuf(Re_Xferred) = InData%InerTSS(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%StiffTGJ) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%StiffTGJ,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%StiffTGJ,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%StiffTGJ,1), UBOUND(InData%StiffTGJ,1) - ReKiBuf(Re_Xferred) = InData%StiffTGJ(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%StiffTEA) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%StiffTEA,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%StiffTEA,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%StiffTEA,1), UBOUND(InData%StiffTEA,1) - ReKiBuf(Re_Xferred) = InData%StiffTEA(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF IF ( .NOT. ALLOCATED(InData%StiffTFA) ) THEN IntKiBuf( Int_Xferred ) = 0 Int_Xferred = Int_Xferred + 1 @@ -19098,36 +17738,6 @@ SUBROUTINE ED_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si ReKiBuf(Re_Xferred) = InData%StiffTFA(i1) Re_Xferred = Re_Xferred + 1 END DO - END IF - IF ( .NOT. ALLOCATED(InData%cgOffTFA) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%cgOffTFA,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%cgOffTFA,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%cgOffTFA,1), UBOUND(InData%cgOffTFA,1) - ReKiBuf(Re_Xferred) = InData%cgOffTFA(i1) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( .NOT. ALLOCATED(InData%cgOffTSS) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%cgOffTSS,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%cgOffTSS,1) - Int_Xferred = Int_Xferred + 2 - - DO i1 = LBOUND(InData%cgOffTSS,1), UBOUND(InData%cgOffTSS,1) - ReKiBuf(Re_Xferred) = InData%cgOffTSS(i1) - Re_Xferred = Re_Xferred + 1 - END DO END IF ReKiBuf(Re_Xferred) = InData%AtfaIner Re_Xferred = Re_Xferred + 1 @@ -19315,26 +17925,6 @@ SUBROUTINE ED_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si END DO END DO END IF - IF ( .NOT. ALLOCATED(InData%BAlpha) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%BAlpha,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%BAlpha,1) - Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%BAlpha,2) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%BAlpha,2) - Int_Xferred = Int_Xferred + 2 - - DO i2 = LBOUND(InData%BAlpha,2), UBOUND(InData%BAlpha,2) - DO i1 = LBOUND(InData%BAlpha,1), UBOUND(InData%BAlpha,1) - ReKiBuf(Re_Xferred) = InData%BAlpha(i1,i2) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF IF ( .NOT. ALLOCATED(InData%BldEDamp) ) THEN IntKiBuf( Int_Xferred ) = 0 Int_Xferred = Int_Xferred + 1 @@ -19442,46 +18032,6 @@ SUBROUTINE ED_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si END DO END DO END IF - IF ( .NOT. ALLOCATED(InData%cgOffBEdg) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%cgOffBEdg,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%cgOffBEdg,1) - Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%cgOffBEdg,2) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%cgOffBEdg,2) - Int_Xferred = Int_Xferred + 2 - - DO i2 = LBOUND(InData%cgOffBEdg,2), UBOUND(InData%cgOffBEdg,2) - DO i1 = LBOUND(InData%cgOffBEdg,1), UBOUND(InData%cgOffBEdg,1) - ReKiBuf(Re_Xferred) = InData%cgOffBEdg(i1,i2) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF - IF ( .NOT. ALLOCATED(InData%cgOffBFlp) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%cgOffBFlp,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%cgOffBFlp,1) - Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%cgOffBFlp,2) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%cgOffBFlp,2) - Int_Xferred = Int_Xferred + 2 - - DO i2 = LBOUND(InData%cgOffBFlp,2), UBOUND(InData%cgOffBFlp,2) - DO i1 = LBOUND(InData%cgOffBFlp,1), UBOUND(InData%cgOffBFlp,1) - ReKiBuf(Re_Xferred) = InData%cgOffBFlp(i1,i2) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF IF ( .NOT. ALLOCATED(InData%Chord) ) THEN IntKiBuf( Int_Xferred ) = 0 Int_Xferred = Int_Xferred + 1 @@ -19532,46 +18082,6 @@ SUBROUTINE ED_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si Re_Xferred = Re_Xferred + 1 END DO END IF - IF ( .NOT. ALLOCATED(InData%EAOffBEdg) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%EAOffBEdg,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%EAOffBEdg,1) - Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%EAOffBEdg,2) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%EAOffBEdg,2) - Int_Xferred = Int_Xferred + 2 - - DO i2 = LBOUND(InData%EAOffBEdg,2), UBOUND(InData%EAOffBEdg,2) - DO i1 = LBOUND(InData%EAOffBEdg,1), UBOUND(InData%EAOffBEdg,1) - ReKiBuf(Re_Xferred) = InData%EAOffBEdg(i1,i2) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF - IF ( .NOT. ALLOCATED(InData%EAOffBFlp) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%EAOffBFlp,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%EAOffBFlp,1) - Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%EAOffBFlp,2) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%EAOffBFlp,2) - Int_Xferred = Int_Xferred + 2 - - DO i2 = LBOUND(InData%EAOffBFlp,2), UBOUND(InData%EAOffBFlp,2) - DO i1 = LBOUND(InData%EAOffBFlp,1), UBOUND(InData%EAOffBFlp,1) - ReKiBuf(Re_Xferred) = InData%EAOffBFlp(i1,i2) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF IF ( .NOT. ALLOCATED(InData%FStTunr) ) THEN IntKiBuf( Int_Xferred ) = 0 Int_Xferred = Int_Xferred + 1 @@ -19592,46 +18102,6 @@ SUBROUTINE ED_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si END DO END DO END IF - IF ( .NOT. ALLOCATED(InData%InerBEdg) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%InerBEdg,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InerBEdg,1) - Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%InerBEdg,2) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InerBEdg,2) - Int_Xferred = Int_Xferred + 2 - - DO i2 = LBOUND(InData%InerBEdg,2), UBOUND(InData%InerBEdg,2) - DO i1 = LBOUND(InData%InerBEdg,1), UBOUND(InData%InerBEdg,1) - ReKiBuf(Re_Xferred) = InData%InerBEdg(i1,i2) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF - IF ( .NOT. ALLOCATED(InData%InerBFlp) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%InerBFlp,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InerBFlp,1) - Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%InerBFlp,2) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%InerBFlp,2) - Int_Xferred = Int_Xferred + 2 - - DO i2 = LBOUND(InData%InerBFlp,2), UBOUND(InData%InerBFlp,2) - DO i1 = LBOUND(InData%InerBFlp,1), UBOUND(InData%InerBFlp,1) - ReKiBuf(Re_Xferred) = InData%InerBFlp(i1,i2) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF IF ( .NOT. ALLOCATED(InData%KBE) ) THEN IntKiBuf( Int_Xferred ) = 0 Int_Xferred = Int_Xferred + 1 @@ -19702,46 +18172,6 @@ SUBROUTINE ED_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si END DO END DO END IF - IF ( .NOT. ALLOCATED(InData%RefAxisxb) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%RefAxisxb,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%RefAxisxb,1) - Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%RefAxisxb,2) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%RefAxisxb,2) - Int_Xferred = Int_Xferred + 2 - - DO i2 = LBOUND(InData%RefAxisxb,2), UBOUND(InData%RefAxisxb,2) - DO i1 = LBOUND(InData%RefAxisxb,1), UBOUND(InData%RefAxisxb,1) - ReKiBuf(Re_Xferred) = InData%RefAxisxb(i1,i2) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF - IF ( .NOT. ALLOCATED(InData%RefAxisyb) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%RefAxisyb,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%RefAxisyb,1) - Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%RefAxisyb,2) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%RefAxisyb,2) - Int_Xferred = Int_Xferred + 2 - - DO i2 = LBOUND(InData%RefAxisyb,2), UBOUND(InData%RefAxisyb,2) - DO i1 = LBOUND(InData%RefAxisyb,1), UBOUND(InData%RefAxisyb,1) - ReKiBuf(Re_Xferred) = InData%RefAxisyb(i1,i2) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF IF ( .NOT. ALLOCATED(InData%RNodes) ) THEN IntKiBuf( Int_Xferred ) = 0 Int_Xferred = Int_Xferred + 1 @@ -19847,26 +18277,6 @@ SUBROUTINE ED_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si END DO END DO END IF - IF ( .NOT. ALLOCATED(InData%StiffBEA) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%StiffBEA,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%StiffBEA,1) - Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%StiffBEA,2) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%StiffBEA,2) - Int_Xferred = Int_Xferred + 2 - - DO i2 = LBOUND(InData%StiffBEA,2), UBOUND(InData%StiffBEA,2) - DO i1 = LBOUND(InData%StiffBEA,1), UBOUND(InData%StiffBEA,1) - ReKiBuf(Re_Xferred) = InData%StiffBEA(i1,i2) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF IF ( .NOT. ALLOCATED(InData%StiffBF) ) THEN IntKiBuf( Int_Xferred ) = 0 Int_Xferred = Int_Xferred + 1 @@ -19881,28 +18291,8 @@ SUBROUTINE ED_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si Int_Xferred = Int_Xferred + 2 DO i2 = LBOUND(InData%StiffBF,2), UBOUND(InData%StiffBF,2) - DO i1 = LBOUND(InData%StiffBF,1), UBOUND(InData%StiffBF,1) - ReKiBuf(Re_Xferred) = InData%StiffBF(i1,i2) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF - IF ( .NOT. ALLOCATED(InData%StiffBGJ) ) THEN - IntKiBuf( Int_Xferred ) = 0 - Int_Xferred = Int_Xferred + 1 - ELSE - IntKiBuf( Int_Xferred ) = 1 - Int_Xferred = Int_Xferred + 1 - IntKiBuf( Int_Xferred ) = LBOUND(InData%StiffBGJ,1) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%StiffBGJ,1) - Int_Xferred = Int_Xferred + 2 - IntKiBuf( Int_Xferred ) = LBOUND(InData%StiffBGJ,2) - IntKiBuf( Int_Xferred + 1) = UBOUND(InData%StiffBGJ,2) - Int_Xferred = Int_Xferred + 2 - - DO i2 = LBOUND(InData%StiffBGJ,2), UBOUND(InData%StiffBGJ,2) - DO i1 = LBOUND(InData%StiffBGJ,1), UBOUND(InData%StiffBGJ,1) - ReKiBuf(Re_Xferred) = InData%StiffBGJ(i1,i2) + DO i1 = LBOUND(InData%StiffBF,1), UBOUND(InData%StiffBF,1) + ReKiBuf(Re_Xferred) = InData%StiffBF(i1,i2) Re_Xferred = Re_Xferred + 1 END DO END DO @@ -20990,78 +19380,6 @@ SUBROUTINE ED_UnPackParam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg Int_Xferred = Int_Xferred + 1 OutData%TwrNodes = IntKiBuf(Int_Xferred) Int_Xferred = Int_Xferred + 1 - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! InerTFA not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%InerTFA)) DEALLOCATE(OutData%InerTFA) - ALLOCATE(OutData%InerTFA(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%InerTFA.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%InerTFA,1), UBOUND(OutData%InerTFA,1) - OutData%InerTFA(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! InerTSS not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%InerTSS)) DEALLOCATE(OutData%InerTSS) - ALLOCATE(OutData%InerTSS(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%InerTSS.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%InerTSS,1), UBOUND(OutData%InerTSS,1) - OutData%InerTSS(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! StiffTGJ not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%StiffTGJ)) DEALLOCATE(OutData%StiffTGJ) - ALLOCATE(OutData%StiffTGJ(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%StiffTGJ.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%StiffTGJ,1), UBOUND(OutData%StiffTGJ,1) - OutData%StiffTGJ(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! StiffTEA not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%StiffTEA)) DEALLOCATE(OutData%StiffTEA) - ALLOCATE(OutData%StiffTEA(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%StiffTEA.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%StiffTEA,1), UBOUND(OutData%StiffTEA,1) - OutData%StiffTEA(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! StiffTFA not allocated Int_Xferred = Int_Xferred + 1 ELSE @@ -21079,42 +19397,6 @@ SUBROUTINE ED_UnPackParam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg OutData%StiffTFA(i1) = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! cgOffTFA not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%cgOffTFA)) DEALLOCATE(OutData%cgOffTFA) - ALLOCATE(OutData%cgOffTFA(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%cgOffTFA.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%cgOffTFA,1), UBOUND(OutData%cgOffTFA,1) - OutData%cgOffTFA(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! cgOffTSS not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%cgOffTSS)) DEALLOCATE(OutData%cgOffTSS) - ALLOCATE(OutData%cgOffTSS(i1_l:i1_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%cgOffTSS.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i1 = LBOUND(OutData%cgOffTSS,1), UBOUND(OutData%cgOffTSS,1) - OutData%cgOffTSS(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO END IF OutData%AtfaIner = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 @@ -21326,29 +19608,6 @@ SUBROUTINE ED_UnPackParam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg END DO END DO END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! BAlpha not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - i2_l = IntKiBuf( Int_Xferred ) - i2_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%BAlpha)) DEALLOCATE(OutData%BAlpha) - ALLOCATE(OutData%BAlpha(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%BAlpha.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i2 = LBOUND(OutData%BAlpha,2), UBOUND(OutData%BAlpha,2) - DO i1 = LBOUND(OutData%BAlpha,1), UBOUND(OutData%BAlpha,1) - OutData%BAlpha(i1,i2) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! BldEDamp not allocated Int_Xferred = Int_Xferred + 1 ELSE @@ -21471,52 +19730,6 @@ SUBROUTINE ED_UnPackParam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg END DO END DO END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! cgOffBEdg not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - i2_l = IntKiBuf( Int_Xferred ) - i2_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%cgOffBEdg)) DEALLOCATE(OutData%cgOffBEdg) - ALLOCATE(OutData%cgOffBEdg(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%cgOffBEdg.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i2 = LBOUND(OutData%cgOffBEdg,2), UBOUND(OutData%cgOffBEdg,2) - DO i1 = LBOUND(OutData%cgOffBEdg,1), UBOUND(OutData%cgOffBEdg,1) - OutData%cgOffBEdg(i1,i2) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! cgOffBFlp not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - i2_l = IntKiBuf( Int_Xferred ) - i2_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%cgOffBFlp)) DEALLOCATE(OutData%cgOffBFlp) - ALLOCATE(OutData%cgOffBFlp(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%cgOffBFlp.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i2 = LBOUND(OutData%cgOffBFlp,2), UBOUND(OutData%cgOffBFlp,2) - DO i1 = LBOUND(OutData%cgOffBFlp,1), UBOUND(OutData%cgOffBFlp,1) - OutData%cgOffBFlp(i1,i2) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! Chord not allocated Int_Xferred = Int_Xferred + 1 ELSE @@ -21576,52 +19789,6 @@ SUBROUTINE ED_UnPackParam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg Re_Xferred = Re_Xferred + 1 END DO END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! EAOffBEdg not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - i2_l = IntKiBuf( Int_Xferred ) - i2_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%EAOffBEdg)) DEALLOCATE(OutData%EAOffBEdg) - ALLOCATE(OutData%EAOffBEdg(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%EAOffBEdg.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i2 = LBOUND(OutData%EAOffBEdg,2), UBOUND(OutData%EAOffBEdg,2) - DO i1 = LBOUND(OutData%EAOffBEdg,1), UBOUND(OutData%EAOffBEdg,1) - OutData%EAOffBEdg(i1,i2) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! EAOffBFlp not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - i2_l = IntKiBuf( Int_Xferred ) - i2_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%EAOffBFlp)) DEALLOCATE(OutData%EAOffBFlp) - ALLOCATE(OutData%EAOffBFlp(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%EAOffBFlp.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i2 = LBOUND(OutData%EAOffBFlp,2), UBOUND(OutData%EAOffBFlp,2) - DO i1 = LBOUND(OutData%EAOffBFlp,1), UBOUND(OutData%EAOffBFlp,1) - OutData%EAOffBFlp(i1,i2) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! FStTunr not allocated Int_Xferred = Int_Xferred + 1 ELSE @@ -21645,52 +19812,6 @@ SUBROUTINE ED_UnPackParam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg END DO END DO END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! InerBEdg not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - i2_l = IntKiBuf( Int_Xferred ) - i2_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%InerBEdg)) DEALLOCATE(OutData%InerBEdg) - ALLOCATE(OutData%InerBEdg(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%InerBEdg.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i2 = LBOUND(OutData%InerBEdg,2), UBOUND(OutData%InerBEdg,2) - DO i1 = LBOUND(OutData%InerBEdg,1), UBOUND(OutData%InerBEdg,1) - OutData%InerBEdg(i1,i2) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! InerBFlp not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - i2_l = IntKiBuf( Int_Xferred ) - i2_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%InerBFlp)) DEALLOCATE(OutData%InerBFlp) - ALLOCATE(OutData%InerBFlp(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%InerBFlp.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i2 = LBOUND(OutData%InerBFlp,2), UBOUND(OutData%InerBFlp,2) - DO i1 = LBOUND(OutData%InerBFlp,1), UBOUND(OutData%InerBFlp,1) - OutData%InerBFlp(i1,i2) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! KBE not allocated Int_Xferred = Int_Xferred + 1 ELSE @@ -21770,52 +19891,6 @@ SUBROUTINE ED_UnPackParam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg END DO END DO END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! RefAxisxb not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - i2_l = IntKiBuf( Int_Xferred ) - i2_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%RefAxisxb)) DEALLOCATE(OutData%RefAxisxb) - ALLOCATE(OutData%RefAxisxb(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%RefAxisxb.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i2 = LBOUND(OutData%RefAxisxb,2), UBOUND(OutData%RefAxisxb,2) - DO i1 = LBOUND(OutData%RefAxisxb,1), UBOUND(OutData%RefAxisxb,1) - OutData%RefAxisxb(i1,i2) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! RefAxisyb not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - i2_l = IntKiBuf( Int_Xferred ) - i2_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%RefAxisyb)) DEALLOCATE(OutData%RefAxisyb) - ALLOCATE(OutData%RefAxisyb(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%RefAxisyb.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i2 = LBOUND(OutData%RefAxisyb,2), UBOUND(OutData%RefAxisyb,2) - DO i1 = LBOUND(OutData%RefAxisyb,1), UBOUND(OutData%RefAxisyb,1) - OutData%RefAxisyb(i1,i2) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! RNodes not allocated Int_Xferred = Int_Xferred + 1 ELSE @@ -21939,29 +20014,6 @@ SUBROUTINE ED_UnPackParam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg END DO END DO END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! StiffBEA not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - i2_l = IntKiBuf( Int_Xferred ) - i2_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%StiffBEA)) DEALLOCATE(OutData%StiffBEA) - ALLOCATE(OutData%StiffBEA(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%StiffBEA.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i2 = LBOUND(OutData%StiffBEA,2), UBOUND(OutData%StiffBEA,2) - DO i1 = LBOUND(OutData%StiffBEA,1), UBOUND(OutData%StiffBEA,1) - OutData%StiffBEA(i1,i2) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! StiffBF not allocated Int_Xferred = Int_Xferred + 1 ELSE @@ -21985,29 +20037,6 @@ SUBROUTINE ED_UnPackParam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg END DO END DO END IF - IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! StiffBGJ not allocated - Int_Xferred = Int_Xferred + 1 - ELSE - Int_Xferred = Int_Xferred + 1 - i1_l = IntKiBuf( Int_Xferred ) - i1_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - i2_l = IntKiBuf( Int_Xferred ) - i2_u = IntKiBuf( Int_Xferred + 1) - Int_Xferred = Int_Xferred + 2 - IF (ALLOCATED(OutData%StiffBGJ)) DEALLOCATE(OutData%StiffBGJ) - ALLOCATE(OutData%StiffBGJ(i1_l:i1_u,i2_l:i2_u),STAT=ErrStat2) - IF (ErrStat2 /= 0) THEN - CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%StiffBGJ.', ErrStat, ErrMsg,RoutineName) - RETURN - END IF - DO i2 = LBOUND(OutData%StiffBGJ,2), UBOUND(OutData%StiffBGJ,2) - DO i1 = LBOUND(OutData%StiffBGJ,1), UBOUND(OutData%StiffBGJ,1) - OutData%StiffBGJ(i1,i2) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO - END DO - END IF IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! SThetaS not allocated Int_Xferred = Int_Xferred + 1 ELSE @@ -23524,9 +21553,6 @@ SUBROUTINE ED_CopyOutput( SrcOutputData, DstOutputData, CtrlCode, ErrStat, ErrMs DstOutputData%LSShftFxa = SrcOutputData%LSShftFxa DstOutputData%LSShftFys = SrcOutputData%LSShftFys DstOutputData%LSShftFzs = SrcOutputData%LSShftFzs - DstOutputData%HubDisplacementX = SrcOutputData%HubDisplacementX - DstOutputData%HubDisplacementY = SrcOutputData%HubDisplacementY - DstOutputData%HubDisplacementZ = SrcOutputData%HubDisplacementZ END SUBROUTINE ED_CopyOutput SUBROUTINE ED_DestroyOutput( OutputData, ErrStat, ErrMsg, DEALLOCATEpointers ) @@ -23861,9 +21887,6 @@ SUBROUTINE ED_PackOutput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, S Re_BufSz = Re_BufSz + 1 ! LSShftFxa Re_BufSz = Re_BufSz + 1 ! LSShftFys Re_BufSz = Re_BufSz + 1 ! LSShftFzs - Re_BufSz = Re_BufSz + 1 ! HubDisplacementX - Re_BufSz = Re_BufSz + 1 ! HubDisplacementY - Re_BufSz = Re_BufSz + 1 ! HubDisplacementZ IF ( Re_BufSz .GT. 0 ) THEN ALLOCATE( ReKiBuf( Re_BufSz ), STAT=ErrStat2 ) IF (ErrStat2 /= 0) THEN @@ -24311,12 +22334,6 @@ SUBROUTINE ED_PackOutput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, S Re_Xferred = Re_Xferred + 1 ReKiBuf(Re_Xferred) = InData%LSShftFzs Re_Xferred = Re_Xferred + 1 - ReKiBuf(Re_Xferred) = InData%HubDisplacementX - Re_Xferred = Re_Xferred + 1 - ReKiBuf(Re_Xferred) = InData%HubDisplacementY - Re_Xferred = Re_Xferred + 1 - ReKiBuf(Re_Xferred) = InData%HubDisplacementZ - Re_Xferred = Re_Xferred + 1 END SUBROUTINE ED_PackOutput SUBROUTINE ED_UnPackOutput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) @@ -24914,12 +22931,6 @@ SUBROUTINE ED_UnPackOutput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg Re_Xferred = Re_Xferred + 1 OutData%LSShftFzs = ReKiBuf(Re_Xferred) Re_Xferred = Re_Xferred + 1 - OutData%HubDisplacementX = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - OutData%HubDisplacementY = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - OutData%HubDisplacementZ = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 END SUBROUTINE ED_UnPackOutput @@ -25364,12 +23375,6 @@ SUBROUTINE ED_Output_ExtrapInterp1(y1, y2, tin, y_out, tin_out, ErrStat, ErrMsg y_out%LSShftFys = y1%LSShftFys + b * ScaleFactor b = -(y1%LSShftFzs - y2%LSShftFzs) y_out%LSShftFzs = y1%LSShftFzs + b * ScaleFactor - b = -(y1%HubDisplacementX - y2%HubDisplacementX) - y_out%HubDisplacementX = y1%HubDisplacementX + b * ScaleFactor - b = -(y1%HubDisplacementY - y2%HubDisplacementY) - y_out%HubDisplacementY = y1%HubDisplacementY + b * ScaleFactor - b = -(y1%HubDisplacementZ - y2%HubDisplacementZ) - y_out%HubDisplacementZ = y1%HubDisplacementZ + b * ScaleFactor END SUBROUTINE ED_Output_ExtrapInterp1 @@ -25545,15 +23550,6 @@ SUBROUTINE ED_Output_ExtrapInterp2(y1, y2, y3, tin, y_out, tin_out, ErrStat, Err b = (t(3)**2*(y1%LSShftFzs - y2%LSShftFzs) + t(2)**2*(-y1%LSShftFzs + y3%LSShftFzs))* scaleFactor c = ( (t(2)-t(3))*y1%LSShftFzs + t(3)*y2%LSShftFzs - t(2)*y3%LSShftFzs ) * scaleFactor y_out%LSShftFzs = y1%LSShftFzs + b + c * t_out - b = (t(3)**2*(y1%HubDisplacementX - y2%HubDisplacementX) + t(2)**2*(-y1%HubDisplacementX + y3%HubDisplacementX))* scaleFactor - c = ( (t(2)-t(3))*y1%HubDisplacementX + t(3)*y2%HubDisplacementX - t(2)*y3%HubDisplacementX ) * scaleFactor - y_out%HubDisplacementX = y1%HubDisplacementX + b + c * t_out - b = (t(3)**2*(y1%HubDisplacementY - y2%HubDisplacementY) + t(2)**2*(-y1%HubDisplacementY + y3%HubDisplacementY))* scaleFactor - c = ( (t(2)-t(3))*y1%HubDisplacementY + t(3)*y2%HubDisplacementY - t(2)*y3%HubDisplacementY ) * scaleFactor - y_out%HubDisplacementY = y1%HubDisplacementY + b + c * t_out - b = (t(3)**2*(y1%HubDisplacementZ - y2%HubDisplacementZ) + t(2)**2*(-y1%HubDisplacementZ + y3%HubDisplacementZ))* scaleFactor - c = ( (t(2)-t(3))*y1%HubDisplacementZ + t(3)*y2%HubDisplacementZ - t(2)*y3%HubDisplacementZ ) * scaleFactor - y_out%HubDisplacementZ = y1%HubDisplacementZ + b + c * t_out END SUBROUTINE ED_Output_ExtrapInterp2 END MODULE ElastoDyn_Types diff --git a/modules/hydrodyn/src/HydroDyn_DriverCode.f90 b/modules/hydrodyn/src/HydroDyn_DriverCode.f90 index 6312fb010c..926e58e35e 100644 --- a/modules/hydrodyn/src/HydroDyn_DriverCode.f90 +++ b/modules/hydrodyn/src/HydroDyn_DriverCode.f90 @@ -103,7 +103,7 @@ PROGRAM HydroDynDriver INTEGER(IntKi) :: n ! Loop counter (for time step) INTEGER(IntKi) :: ErrStat,ErrStat2 ! Status of error message CHARACTER(1024) :: ErrMsg,ErrMsg2 ! Error message if ErrStat /= ErrID_None - REAL(R8Ki) :: dcm (3,3) ! The resulting transformation matrix from X to x, (-). + REAL(ReKi) :: dcm (3,3) ! The resulting transformation matrix from X to x, (-). CHARACTER(1024) :: drvrFilename ! Filename and path for the driver input file. This is passed in as a command line argument when running the Driver exe. TYPE(HD_Drvr_InitInput) :: drvrInitInp ! Initialization data for the driver program diff --git a/modules/hydrodyn/src/WAMIT2.f90 b/modules/hydrodyn/src/WAMIT2.f90 index 080f7eb5a3..47653312a2 100644 --- a/modules/hydrodyn/src/WAMIT2.f90 +++ b/modules/hydrodyn/src/WAMIT2.f90 @@ -729,7 +729,7 @@ SUBROUTINE WAMIT2_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, Ini !---------------------------------------------------------------------- !> 6. Set zero values for unused outputs. This is mostly so that the - !! compiler does not complain. + !! compiler does not complain. Also set misc vars !---------------------------------------------------------------------- x%DummyContState = 0.0_SiKi xd%DummyDiscState = 0.0_SiKi @@ -737,6 +737,8 @@ SUBROUTINE WAMIT2_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, Ini CALL AllocAry( m%LastIndWave, p%NBody, 'm%LastIndWave', ErrStatTmp, ErrMsgTmp) CALL SetErrStat( ErrStatTmp, ErrMsgTmp, ErrStat, ErrMsg, RoutineName) m%LastIndWave = 1_IntKi + call AllocAry(m%F_Waves2, 6*p%NBody, 'm%F_Waves2', ErrStatTmp, ErrMsgTmp) + CALL SetErrStat( ErrStatTmp, ErrMsgTmp, ErrStat, ErrMsg, RoutineName) OtherState%DummyOtherState = 0 @@ -4024,7 +4026,7 @@ SUBROUTINE Read_DataFile3D( InitInp, Filename3D, Data3D, ErrStat, Errmsg ) ! Now that we know how many frequencies and wave directions there are, we can allocate the array ! for saving the sorted data. - ALLOCATE( Data3D%DataSet( Data3D%NumWvFreq1, Data3D%NumWvDir1, Data3D%NumWvDir2, 6 ), STAT=ErrStatTmp ) + ALLOCATE( Data3D%DataSet( Data3D%NumWvFreq1, Data3D%NumWvDir1, Data3D%NumWvDir2, 6*Data3D%NumBodies ), STAT=ErrStatTmp ) IF (ErrStatTmp /= 0) CALL SetErrStat(ErrID_Fatal,'Cannot allocate array Data3D%DataSet to store '// & 'the sorted 3D 2nd order WAMIT data.', ErrStat,ErrMsg,RoutineName) IF ( ErrStat >= AbortErrLev ) THEN @@ -4038,7 +4040,7 @@ SUBROUTINE Read_DataFile3D( InitInp, Filename3D, Data3D, ErrStat, Errmsg ) ENDIF ! Allocate the logical array for storing the mask for which points are valid. Set to .FALSE. - ALLOCATE( Data3D%DataMask( Data3D%NumWvFreq1, Data3D%NumWvDir1, Data3D%NumWvDir2, 6 ), STAT=ErrStatTmp ) + ALLOCATE( Data3D%DataMask( Data3D%NumWvFreq1, Data3D%NumWvDir1, Data3D%NumWvDir2, 6*Data3D%NumBodies ), STAT=ErrStatTmp ) IF (ErrStatTmp /= 0) CALL SetErrStat(ErrID_Fatal,'Cannot allocate array Data3D%DataMask to store '// & 'the sorted 3D 2nd order WAMIT data.', ErrStat,ErrMsg,RoutineName) IF ( ErrStat >= AbortErrLev ) THEN @@ -4130,6 +4132,21 @@ SUBROUTINE Read_DataFile3D( InitInp, Filename3D, Data3D, ErrStat, Errmsg ) ! Find which force component this belongs to TmpCoord(4) = NINT(RawData3D(I,4)) + ! Check that it is a valid force component + if (TmpCoord(4) < 1 .or. TmpCoord(4) > 6*Data3D%NumBodies) then + CALL SetErrStat( ErrID_Fatal, ' Line '//TRIM(Num2Lstr(NumHeaderLines+I))//' of '//TRIM(Filename3D)// & + ' contains force component '//TRIM(Num2LStr(TmpCoord(4)))//' which is outside the expected force '// & + ' range of 1 to '//TRIM(Num2Lstr(6*Data3D%NumBodies))//' for a '//TRIM(Num2LStr(Data3D%NumBodies))// & + ' body system.', ErrStat, ErrMsg, RoutineName) + IF (ALLOCATED(RawData3D)) DEALLOCATE(RawData3D,STAT=ErrStatTmp) + IF (ALLOCATED(RawData3DTmp)) DEALLOCATE(RawData3DTmp,STAT=ErrStatTmp) + IF (ALLOCATED(TmpRealArr)) DEALLOCATE(TmpRealArr,STAT=ErrStatTmp) + IF (ALLOCATED(TmpDataRow)) DEALLOCATE(TmpDataRow,STAT=ErrStatTmp) + IF (ALLOCATED(TmpWvFreq1)) DEALLOCATE(TmpWvFreq1,STAT=ErrStatTmp) + CALL CleanUp + RETURN + endif + !> The data from the WAMIT file is non-dimensional, so we need to dimensionalize it here. This @@ -4164,7 +4181,8 @@ SUBROUTINE Read_DataFile3D( InitInp, Filename3D, Data3D, ErrStat, Errmsg ) REAL(InitInp%RhoXg * InitInp%WAMITULEN**K * RawData3D(I,8) ,SiKi)) ) THEN CALL SetErrStat( ErrID_Fatal, ' Line '//TRIM(Num2Lstr(NumHeaderLines+I))//' of '//TRIM(Filename3D)// & ' contains different values for the real and imaginary part (columns 7 and 8) than was '// & - 'given earlier in the file for the same values of wave frequency and wave direction.', & + 'given earlier in the file for the same values of wave frequency and wave direction '// & + '(force dimension = '//TRIM(Num2LStr(TmpCoord(4)))//').', & ErrStat, ErrMsg, RoutineName ) IF (ALLOCATED(TmpRealArr)) DEALLOCATE(TmpRealArr,STAT=ErrStatTmp) IF (ALLOCATED(RawData3D)) DEALLOCATE(RawData3D,STAT=ErrStatTmp) @@ -4860,7 +4878,7 @@ SUBROUTINE Read_DataFile4D( InitInp, Filename4D, Data4D, ErrStat, Errmsg ) ! Now that we know how many frequencies and wave directions there are, we can allocate the array ! for saving the sorted data. - ALLOCATE( Data4D%DataSet( Data4D%NumWvFreq1, Data4D%NumWvFreq2, Data4D%NumWvDir1, Data4D%NumWvDir2, 6 ), STAT=ErrStatTmp ) + ALLOCATE( Data4D%DataSet( Data4D%NumWvFreq1, Data4D%NumWvFreq2, Data4D%NumWvDir1, Data4D%NumWvDir2, 6*Data4D%NumBodies ), STAT=ErrStatTmp ) IF (ErrStatTmp /= 0) CALL SetErrStat(ErrID_Fatal,'Cannot allocate array Data4D%DataSet to store '// & 'the sorted 4D 2nd order WAMIT data.', ErrStat,ErrMsg,RoutineName) IF ( ErrStat >= AbortErrLev ) THEN @@ -4875,7 +4893,7 @@ SUBROUTINE Read_DataFile4D( InitInp, Filename4D, Data4D, ErrStat, Errmsg ) ENDIF ! Allocate the logical array for storing the mask for which points are valid. Set to .FALSE. - ALLOCATE( Data4D%DataMask( Data4D%NumWvFreq1, Data4D%NumWvFreq2, Data4D%NumWvDir1, Data4D%NumWvDir2, 6 ), STAT=ErrStatTmp ) + ALLOCATE( Data4D%DataMask( Data4D%NumWvFreq1, Data4D%NumWvFreq2, Data4D%NumWvDir1, Data4D%NumWvDir2, 6*Data4D%NumBodies ), STAT=ErrStatTmp ) IF (ErrStatTmp /= 0) CALL SetErrStat(ErrID_Fatal,'Cannot allocate array Data4D%DataMask to store '// & 'the sorted 4D 2nd order WAMIT data.', ErrStat,ErrMsg,RoutineName) IF ( ErrStat >= AbortErrLev ) THEN @@ -4988,6 +5006,21 @@ SUBROUTINE Read_DataFile4D( InitInp, Filename4D, Data4D, ErrStat, Errmsg ) ! Find which force component this belongs to TmpCoord(5) = NINT(RawData4D(I,5)) + ! Check that it is a valid force component + if (TmpCoord(5) < 1 .or. TmpCoord(5) > 6*Data4D%NumBodies) then + CALL SetErrStat( ErrID_Fatal, ' Line '//TRIM(Num2Lstr(NumHeaderLines+I))//' of '//TRIM(Filename4D)// & + ' contains force component '//TRIM(Num2LStr(TmpCoord(5)))//' which is outside the expected force '// & + ' range of 1 to '//TRIM(Num2Lstr(6*Data4D%NumBodies))//' for a '//TRIM(Num2LStr(Data4D%NumBodies))// & + ' body system.', ErrStat, ErrMsg, RoutineName) + IF (ALLOCATED(RawData4D)) DEALLOCATE(RawData4D,STAT=ErrStatTmp) + IF (ALLOCATED(RawData4DTmp)) DEALLOCATE(RawData4DTmp,STAT=ErrStatTmp) + IF (ALLOCATED(TmpRealArr)) DEALLOCATE(TmpRealArr,STAT=ErrStatTmp) + IF (ALLOCATED(TmpDataRow)) DEALLOCATE(TmpDataRow,STAT=ErrStatTmp) + IF (ALLOCATED(TmpWvFreq1)) DEALLOCATE(TmpWvFreq1,STAT=ErrStatTmp) + IF (ALLOCATED(TmpWvFreq2)) DEALLOCATE(TmpWvFreq2,STAT=ErrStatTmp) + CALL CleanUp + RETURN + endif !> The data from the WAMIT file is non-dimensional, so we need to dimensionalize it here. This @@ -5022,7 +5055,8 @@ SUBROUTINE Read_DataFile4D( InitInp, Filename4D, Data4D, ErrStat, Errmsg ) REAL(InitInp%RhoXg * InitInp%WAMITULEN**K * RawData4D(I,9) ,SiKi))) THEN CALL SetErrStat( ErrID_Fatal, ' Line '//TRIM(Num2Lstr(NumHeaderLines+I))//' of '//TRIM(Filename4D)// & ' contains different values for the real and imaginary part (columns 8 and 9) than was '// & - 'given earlier in the file for the same values of wave frequency and wave direction.', & + 'given earlier in the file for the same values of wave frequency and wave direction '// & + '(force dimension = '//TRIM(Num2LStr(TmpCoord(5)))//').', & ErrStat, ErrMsg, RoutineName ) IF (ALLOCATED(RawData4D)) DEALLOCATE(RawData4D,STAT=ErrStatTmp) IF (ALLOCATED(RawData4DTmp)) DEALLOCATE(RawData4DTmp,STAT=ErrStatTmp) @@ -6014,10 +6048,10 @@ SUBROUTINE Copy_InitData4Dto3D( Data4D, Data3D, ErrStat, ErrMsg ) ! Now allocate the storage arrays - ALLOCATE( Data3D%DataSet( Data3D%NumWvFreq1, Data3D%NumWvDir1, Data3D%NumWvDir2, 6 ), STAT=ErrStatTmp ) + ALLOCATE( Data3D%DataSet( Data3D%NumWvFreq1, Data3D%NumWvDir1, Data3D%NumWvDir2, 6*Data3D%NumBodies ), STAT=ErrStatTmp ) IF (ErrStatTmp /= 0) CALL SetErrStat(ErrID_Fatal,'Cannot allocate array Data3D%DataSet to store '// & 'the 3D 2nd order WAMIT data.', ErrStat,ErrMsg,RoutineName) - ALLOCATE( Data3D%DataMask( Data3D%NumWvFreq1, Data3D%NumWvDir1, Data3D%NumWvDir2, 6 ), STAT=ErrStatTmp ) + ALLOCATE( Data3D%DataMask( Data3D%NumWvFreq1, Data3D%NumWvDir1, Data3D%NumWvDir2, 6*Data3D%NumBodies ), STAT=ErrStatTmp ) IF (ErrStatTmp /= 0) CALL SetErrStat(ErrID_Fatal,'Cannot allocate array Data3D%DataMask to store '// & 'the information on the 3D 2nd order WAMIT data.', ErrStat,ErrMsg,RoutineName) CALL AllocAry( Data3D%WvFreq1, Data3D%NumWvFreq1, 'Data3D WvFreq array', ErrStatTmp, ErrMsgTmp ) diff --git a/modules/hydrodyn/src/WAMIT2.txt b/modules/hydrodyn/src/WAMIT2.txt index 9a500b34ab..992093a69a 100644 --- a/modules/hydrodyn/src/WAMIT2.txt +++ b/modules/hydrodyn/src/WAMIT2.txt @@ -89,7 +89,7 @@ typedef ^ OtherStateType IntKi DummyOtherS # Define any data that are used only for efficiency purposes (these variables are not associated with time): # e.g. indices for searching in an array, large arrays that are local variables in any routine called multiple times, etc. typedef ^ MiscVarType INTEGER LastIndWave : - - "Index for last interpolation step of 2nd order forces" - -typedef ^ ^ ReKi F_Waves2 {6} - - "2nd order force from this timestep" - +typedef ^ ^ ReKi F_Waves2 {:} - - "2nd order force from this timestep" - diff --git a/modules/hydrodyn/src/WAMIT2_Types.f90 b/modules/hydrodyn/src/WAMIT2_Types.f90 index 972f4ce915..d09382e26e 100644 --- a/modules/hydrodyn/src/WAMIT2_Types.f90 +++ b/modules/hydrodyn/src/WAMIT2_Types.f90 @@ -105,7 +105,7 @@ MODULE WAMIT2_Types ! ========= WAMIT2_MiscVarType ======= TYPE, PUBLIC :: WAMIT2_MiscVarType INTEGER(IntKi) , DIMENSION(:), ALLOCATABLE :: LastIndWave !< Index for last interpolation step of 2nd order forces [-] - REAL(ReKi) , DIMENSION(1:6) :: F_Waves2 !< 2nd order force from this timestep [-] + REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: F_Waves2 !< 2nd order force from this timestep [-] END TYPE WAMIT2_MiscVarType ! ======================= ! ========= WAMIT2_ParameterType ======= @@ -1570,7 +1570,18 @@ SUBROUTINE WAMIT2_CopyMisc( SrcMiscData, DstMiscData, CtrlCode, ErrStat, ErrMsg END IF DstMiscData%LastIndWave = SrcMiscData%LastIndWave ENDIF +IF (ALLOCATED(SrcMiscData%F_Waves2)) THEN + i1_l = LBOUND(SrcMiscData%F_Waves2,1) + i1_u = UBOUND(SrcMiscData%F_Waves2,1) + IF (.NOT. ALLOCATED(DstMiscData%F_Waves2)) THEN + ALLOCATE(DstMiscData%F_Waves2(i1_l:i1_u),STAT=ErrStat2) + IF (ErrStat2 /= 0) THEN + CALL SetErrStat(ErrID_Fatal, 'Error allocating DstMiscData%F_Waves2.', ErrStat, ErrMsg,RoutineName) + RETURN + END IF + END IF DstMiscData%F_Waves2 = SrcMiscData%F_Waves2 +ENDIF END SUBROUTINE WAMIT2_CopyMisc SUBROUTINE WAMIT2_DestroyMisc( MiscData, ErrStat, ErrMsg, DEALLOCATEpointers ) @@ -1596,6 +1607,9 @@ SUBROUTINE WAMIT2_DestroyMisc( MiscData, ErrStat, ErrMsg, DEALLOCATEpointers ) IF (ALLOCATED(MiscData%LastIndWave)) THEN DEALLOCATE(MiscData%LastIndWave) +ENDIF +IF (ALLOCATED(MiscData%F_Waves2)) THEN + DEALLOCATE(MiscData%F_Waves2) ENDIF END SUBROUTINE WAMIT2_DestroyMisc @@ -1639,7 +1653,11 @@ SUBROUTINE WAMIT2_PackMisc( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Int_BufSz = Int_BufSz + 2*1 ! LastIndWave upper/lower bounds for each dimension Int_BufSz = Int_BufSz + SIZE(InData%LastIndWave) ! LastIndWave END IF + Int_BufSz = Int_BufSz + 1 ! F_Waves2 allocated yes/no + IF ( ALLOCATED(InData%F_Waves2) ) THEN + Int_BufSz = Int_BufSz + 2*1 ! F_Waves2 upper/lower bounds for each dimension Re_BufSz = Re_BufSz + SIZE(InData%F_Waves2) ! F_Waves2 + END IF IF ( Re_BufSz .GT. 0 ) THEN ALLOCATE( ReKiBuf( Re_BufSz ), STAT=ErrStat2 ) IF (ErrStat2 /= 0) THEN @@ -1682,10 +1700,21 @@ SUBROUTINE WAMIT2_PackMisc( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Int_Xferred = Int_Xferred + 1 END DO END IF - DO i1 = LBOUND(InData%F_Waves2,1), UBOUND(InData%F_Waves2,1) - ReKiBuf(Re_Xferred) = InData%F_Waves2(i1) - Re_Xferred = Re_Xferred + 1 - END DO + IF ( .NOT. ALLOCATED(InData%F_Waves2) ) THEN + IntKiBuf( Int_Xferred ) = 0 + Int_Xferred = Int_Xferred + 1 + ELSE + IntKiBuf( Int_Xferred ) = 1 + Int_Xferred = Int_Xferred + 1 + IntKiBuf( Int_Xferred ) = LBOUND(InData%F_Waves2,1) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%F_Waves2,1) + Int_Xferred = Int_Xferred + 2 + + DO i1 = LBOUND(InData%F_Waves2,1), UBOUND(InData%F_Waves2,1) + ReKiBuf(Re_Xferred) = InData%F_Waves2(i1) + Re_Xferred = Re_Xferred + 1 + END DO + END IF END SUBROUTINE WAMIT2_PackMisc SUBROUTINE WAMIT2_UnPackMisc( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) @@ -1733,12 +1762,24 @@ SUBROUTINE WAMIT2_UnPackMisc( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrM Int_Xferred = Int_Xferred + 1 END DO END IF - i1_l = LBOUND(OutData%F_Waves2,1) - i1_u = UBOUND(OutData%F_Waves2,1) - DO i1 = LBOUND(OutData%F_Waves2,1), UBOUND(OutData%F_Waves2,1) - OutData%F_Waves2(i1) = ReKiBuf(Re_Xferred) - Re_Xferred = Re_Xferred + 1 - END DO + IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! F_Waves2 not allocated + Int_Xferred = Int_Xferred + 1 + ELSE + Int_Xferred = Int_Xferred + 1 + i1_l = IntKiBuf( Int_Xferred ) + i1_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + IF (ALLOCATED(OutData%F_Waves2)) DEALLOCATE(OutData%F_Waves2) + ALLOCATE(OutData%F_Waves2(i1_l:i1_u),STAT=ErrStat2) + IF (ErrStat2 /= 0) THEN + CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%F_Waves2.', ErrStat, ErrMsg,RoutineName) + RETURN + END IF + DO i1 = LBOUND(OutData%F_Waves2,1), UBOUND(OutData%F_Waves2,1) + OutData%F_Waves2(i1) = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 + END DO + END IF END SUBROUTINE WAMIT2_UnPackMisc SUBROUTINE WAMIT2_CopyParam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg ) diff --git a/modules/icedyn/src/IceDyn.f90 b/modules/icedyn/src/IceDyn.f90 index 454777b03e..9abd548d9f 100644 --- a/modules/icedyn/src/IceDyn.f90 +++ b/modules/icedyn/src/IceDyn.f90 @@ -267,7 +267,7 @@ SUBROUTINE IceD_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitO ! ! Print the summary file if requested: ! IF (InputFileData%SumPrint) THEN - ! CALL IceD_PrintSum( p, OtherState, GetAdamsVals, ErrStat2, ErrMsg2 ) + ! CALL IceD_PrintSum( p, OtherState, ErrStat2, ErrMsg2 ) ! CALL CheckError( ErrStat2, ErrMsg2 ) ! IF (ErrStat >= AbortErrLev) RETURN ! END IF diff --git a/modules/icefloe/src/interfaces/ADAMS/IceADAMS_VFOSUB.f90 b/modules/icefloe/src/interfaces/ADAMS/IceADAMS_VFOSUB.f90 deleted file mode 100644 index 74ef791828..0000000000 --- a/modules/icefloe/src/interfaces/ADAMS/IceADAMS_VFOSUB.f90 +++ /dev/null @@ -1,264 +0,0 @@ -!********************************************************************************************************************************** -! LICENSING -! Copyright (C) 2014 DNV KEMA Renewables, Inc. -! -! This file is part of the IceFloe suite of subroutines -! -! Licensed under the Apache License, Version 2.0 (the "License"); -! you may not use this file except in compliance with the License. -! You may obtain a copy of the License at -! -! http://www.apache.org/licenses/LICENSE-2.0 -! -! Unless required by applicable law or agreed to in writing, software -! distributed under the License is distributed on an "AS IS" BASIS, -! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -! See the License for the specific language governing permissions and -! limitations under the License. -!************************************************************************ - -!********************************************************************************************************************************** -! File last committed: $Date: 2014-01-31 09:14:28 -0800 (Fri, 31 Jan 2014) $ -! (File) Revision #: $Rev: 131 $ -! URL: $HeadURL: http://sel1004.verit.dnv.com:8080/svn/LoadSimCtl_SurfaceIce/trunk/IceDyn_IntelFortran/HAWC2_DLL/HAWC2_DLL.f90 $ -!********************************************************************************************************************************** - -module IceADAMS - - use IceLog - use IceInputParams - use iceFloeBase - use IceCrushingISO - use IceCrushingIEC - use IceIntermittentCrushing - use IceFlexISO - use IceFlexIEC - use IceLockInCrushingISO - use randomCrushing - use IceCpldCrushing - use NWTC_IO, only : DispNVD, progdesc, curdate, curtime - - type(iceFloe_ParameterType), save :: icep ! Parameters, including precalculated time series - type(iceFloe_LoggingType), save :: theIceLog ! structure with message and error logging variables - -contains -!------------------------------------------------------------------------------------ - subroutine icefloe_init() - - implicit none - - ! locals - Real(ReKi) :: duration - INTEGER(IntKi) :: nSteps - INTEGER(IntKi) :: Err ! Error status of the operation - LOGICAL, SAVE :: bInit = .FALSE. ! Initialization flag - TYPE(ProgDesc), PARAMETER :: IceFloe_Ver = ProgDesc( 'IceFloe', 'v1.00.00', 'May-2014' ) - - ! More IceFloe types - type(iceInputType) :: iceInput ! hold list of input names and values from file - character(132) :: logFile ! File name for message logging - - ! Set up error logging - theIceLog%warnFlag = .false. - theIceLog%ErrID = ErrID_None - theIceLog%ErrMsg = "" - - ! Display the module information - - CALL DispNVD( IceFloe_Ver ) - - call openIceLog(theIceLog, 'IceFloe.log') - call logMessage(theIceLog, ' Running: '//trim(IceFloe_Ver%Name)//trim(IceFloe_Ver%Ver)//trim(IceFloe_Ver%Date)) - call logMessage(theIceLog, ' This run started on: '//curdate()//' at '//curtime()//newLine) - - call countIceInputs('testIce.inp', theIceLog, iceInput) - call readIceInputs(theIceLog, iceInput) - call logMessage(theIceLog, ' Input file read complete.'//newLine) - - ! call IceFloe initialization routine and get parameters back - ! not all parameters used by all ice floe types - call getIceInput(iceInput, 'iceType',icep%iceType, theIceLog, lowTypeLimit, hiTypeLimit) - if (theIceLog%ErrID >= AbortErrLev) then - return - endif - - ! Set the time step as the minimum of the suggested p%dt and the time step from the ice input file - call getIceInput(iceInput, 'timeStep',icep%dt, theIceLog, 0.0) - if (theIceLog%ErrID >= AbortErrLev) then - return - endif - - ! get the duration of the simulation - call getIceInput(iceInput, 'duration', duration, theIceLog, 0.0) - call logMessage(theIceLog, ' Load time series duration = '//TRIM(Num2LStr(duration))//' sec') - - ! get the number of legs on the support structure - call getIceInput(iceInput, 'numLegs', icep%numLegs, theIceLog, 1, 4) - if (theIceLog%ErrID >= AbortErrLev) then - return - endif - - ! allocate storage for load series - nSteps = ceiling(duration/icep%dt) + 1 ! + 1 for zero point - allocate(icep%loadSeries(nSteps, icep%numLegs), stat=err) - if (err /= 0) then - call iceErrorHndlr (theIceLog, ErrID_Fatal, 'Error in time series array allocation in IceFloe_init', 1) - return - endif - ! point internal iceFloe array to the saved load series - ! icep%loadSeries => loadseries - - ! allocate storage for the leg positions - allocate (icep%legX(icep%numLegs), stat=err) - allocate (icep%legY(icep%numLegs), stat=err) - allocate (icep%ks(icep%numLegs), stat=err) - if (err /= 0) then - call iceErrorHndlr (theIceLog, ErrID_Fatal, 'Error in allocation of leg data in parameters', 1) - return ! error in array allocation - endif - - iceType: select case (icep%iceType) - case (randomCrush) - call initRandomCrushing(iceInput, icep, theIceLog) - if (theIceLog%ErrID <= ErrID_Warn) & - call logMessage(theIceLog, newLine//' Random continuous ice crushing via ISO/Karna initialized'//newLine) - case (interCrush) - call initInterCrushing(iceInput, icep, theIceLog) - if (theIceLog%ErrID <= ErrID_Warn) & - call logMessage(theIceLog, newLine//' Intermittent ice crushing loads initialized'//newLine) - case (crushIEC) - call initCrushingIEC(iceInput, icep, theIceLog) - if (theIceLog%ErrID <= ErrID_Warn) & - call logMessage(theIceLog, newLine//' Ice crushing loads IEC/Korzhavin initialized'//newLine) - case (flexFailISO) - call initFlexISO(iceInput, icep, theIceLog) - if (theIceLog%ErrID <= ErrID_Warn) & - call logMessage(theIceLog, newLine//' ISO/Croasdale ice flexural failure loads initialized'//newLine) - case (flexFailIEC) - call initFlexIEC(iceInput, icep, theIceLog) - if (theIceLog%ErrID <= ErrID_Warn) & - call logMessage(theIceLog, newLine//' IEC/Ralston ice flexural failure loads initialized'//newLine) - case (lockInISO) - call initLockInCrushingISO(iceInput, icep, theIceLog) - if (theIceLog%ErrID <= ErrID_Warn) & - call logMessage(theIceLog, newLine//' Frequency lock-in ice crushing loads via ISO initialized'//newLine) - case (cpldCrush) - call initCpldCrushing(iceInput, icep, theIceLog) - if (theIceLog%ErrID <= ErrID_Warn) & - call logMessage(theIceLog, newLine//' Coupled crushing ice loads (Maattanen) initialized'//newLine) - case default - call iceErrorHndlr (theIceLog, ErrID_Fatal, 'Invalid ice floe type, ' & - //TRIM(Num2LStr(icep%IceType))//' is not a valid selection', 1) - end select iceType - - end subroutine icefloe_init - -!********************************************************************************************************************************** - SUBROUTINE icefloe_update(Time, Vels, Forces) - - implicit none - ! input - real(DbKi), intent(IN) :: Time - real(ReKi), intent(IN) :: Vels(3) - ! output - real(ReKi), intent(OUT) :: Forces(3) - - real(ReKi) :: loadVect(6,icep%numLegs) - real(ReKi) :: inVels(2,icep%numLegs) - integer(IntKi) :: nL - - ! reset up error logging - theIceLog%warnFlag = .false. - theIceLog%ErrID = ErrID_None - theIceLog%ErrMsg = "" - - ! Assign support structure velocities to local variables - ! CURRENTLY only monopile supported so NL should = 1 - inVels = 0.0 - do nL = 1, icep%numLegs - inVels(1,nL) = Vels(1) - inVels(2,nL) = Vels(2) - enddo - - ! get loads from IceFloe - iceType: select case (icep%iceType) - case (randomCrush) - loadVect = outputRandomCrushLoad(icep, theIceLog, time) - case (crushIEC) - loadVect = outputCrushLoadIEC(icep, theIceLog, time) - case (interCrush) - loadVect = outputInterCrushLoad(icep, theIceLog, time) - case (flexFailISO) - loadVect = outputFlexLoadISO(icep, theIceLog, time) - case (flexFailIEC) - loadVect = outputFlexLoadIEC(icep, theIceLog, time) - case (lockInISO) - loadVect = outputLockInLoadISO(icep, theIceLog, time) - case (cpldCrush) - loadVect = outputCpldCrushLoad(icep, theIceLog, inVels, time) - case default - call logFatal (theIceLog, 'Invalid Ice Floe Type Selection', 1) - end select iceType - - !Apply ramp for first 10 seconds - do nL = 1, icep%numLegs - Forces(1) = loadVect(1,nL)*min(1.0, 0.1*time) - Forces(2) = loadVect(2,nL)*min(1.0, 0.1*time) - Forces(3) = 0.0 - enddo - - end SUBROUTINE icefloe_update - -end module IceADAMS - -!********************************************************************************************************************************** - -SUBROUTINE VFOSUB ( ID, ATIME, PAR, NPAR, DFLAG, IFLAG, Forces ) - -! This routine is used to calculate the functional values for a VFORCE statement. -! Specifically to call the IceFloe routines for use in ADAMS - - use IceADAMS - - IMPLICIT NONE - -! Passed variables: - - INTEGER(4), INTENT(IN ) :: ID ! ID of the REQUEST statement calling this routine. - INTEGER(4), INTENT(IN ) :: NPAR ! Number of PARameters passed through PAR. - - REAL(8), INTENT(IN ) :: ATIME ! The current simimulation time. - REAL(8), INTENT(IN ) :: PAR(NPAR) ! The passeed PARameters. - REAL(8), INTENT(OUT) :: Forces(3) ! Values returned to ADAMS. - - LOGICAL, INTENT(IN) :: DFLAG ! Partial Derivative flag. - LOGICAL, INTENT(IN) :: IFLAG ! Initialization pass flag. - -! Local variables - LOGICAL, save :: initFlag = .true. - logical :: errFlg - integer(4) :: IPar3(3), NStates - REAL(4) :: IceForces(3) - REAL(8) :: States(3) - -! get the local velocity at the marker specified in PAR - IPar3(1) = int(PAR(1)) - IPar3(2) = 1 ! ground marker - IPar3(3) = 1 ! ground marker - call SYSARY('TVEL', IPar3, 3, States, NStates, errFlg ) - - IceForces = 0.0 - if (IFLAG .and. initFlag) then - call icefloe_init - initFlag = .false. - endif - - if (.not. initFlag) then -! Get the ice loads - call icefloe_update(atime, real(States, 4), IceForces) - endif - - Forces = real(IceForces, 8)/1000.0 - -END SUBROUTINE VFOSUB - diff --git a/modules/icefloe/src/interfaces/Console/SysIVF_reduced.f90 b/modules/icefloe/src/interfaces/Console/SysIVF_reduced.f90 index 0c31950cc7..db1d0814cb 100644 --- a/modules/icefloe/src/interfaces/Console/SysIVF_reduced.f90 +++ b/modules/icefloe/src/interfaces/Console/SysIVF_reduced.f90 @@ -56,7 +56,7 @@ MODULE SysSubs INTEGER, PARAMETER :: ConRecL = 120 ! The record length for console output. - INTEGER, PARAMETER :: CU = 6 ! The I/O unit for the console. Unit 6 causes ADAMS to crash. + INTEGER, PARAMETER :: CU = 6 ! The I/O unit for the console. INTEGER, PARAMETER :: MaxWrScrLen = 98 ! The maximum number of characters allowed to be written to a line in WrScr INTEGER, PARAMETER :: NL_Len = 2 ! The number of characters used for a new line. @@ -128,8 +128,6 @@ SUBROUTINE FlushOut ( Unit ) CALL FLUSH ( INT(Unit, B4Ki) ) -!bjj: ADAMS does not compile well with this, so I'll put it back to the subroutine form: -! FLUSH ( Unit ) RETURN diff --git a/modules/inflowwind/src/IfW_HAWCWind.f90 b/modules/inflowwind/src/IfW_HAWCWind.f90 index 7f6ffab430..c903ee66a6 100644 --- a/modules/inflowwind/src/IfW_HAWCWind.f90 +++ b/modules/inflowwind/src/IfW_HAWCWind.f90 @@ -269,7 +269,8 @@ SUBROUTINE ReadTurbulenceData(p, InitInp, ErrStat, ErrMsg) CALL SetErrStat(TmpErrStat, TmpErrMsg, ErrStat, ErrMsg, RoutineName) IF (ErrStat >= AbortErrLev) RETURN - DO IX = 1,p%FF%NFFSteps + ! DO IX = p%FF%NFFSteps,1,-1 ! This order fixes #256 + DO IX = 1,p%FF%NFFSteps ! This order is wrong (has been in dev and hawc2 for a while now) DO IY = p%FF%NYGrids,1,-1 !DO IZ = 1,p%FF%NZGrids diff --git a/modules/moordyn/src/MoorDyn.f90 b/modules/moordyn/src/MoorDyn.f90 index 12b4c93c65..bbd5fc9328 100644 --- a/modules/moordyn/src/MoorDyn.f90 +++ b/modules/moordyn/src/MoorDyn.f90 @@ -1806,7 +1806,7 @@ SUBROUTINE MD_Init(InitInp, u, p, x, xd, z, other, y, m, DTcoupling, InitOut, Er CALL MeshConstructElement(u%CoupledKinematics(iTurb), ELEMENT_POINT, ErrStat2, ErrMsg2, J) ! lastly, do this to set the attached line endpoint positions: - CALL Rod_SetKinematics(m%RodList(m%CpldRodIs(l,iTurb)), DBLE(rRef), m%zeros6, m%zeros6, 0.0_DbKi, m) + CALL Rod_SetKinematics(m%RodList(m%CpldRodIs(l,iTurb)), REAL(rRef,R8Ki), m%zeros6, m%zeros6, 0.0_DbKi, m) END DO DO l = 1,p%nCpldCons(iTurb) ! keeping this one simple for now, positioning at whatever is specified by glue code <<< diff --git a/modules/moordyn/src/MoorDyn_IO.f90 b/modules/moordyn/src/MoorDyn_IO.f90 index ffa6c76458..14d93ff6be 100644 --- a/modules/moordyn/src/MoorDyn_IO.f90 +++ b/modules/moordyn/src/MoorDyn_IO.f90 @@ -139,7 +139,7 @@ SUBROUTINE setupBathymetry(inputString, defaultDepth, BathGrid, BathGrid_Xs, Bat IF (LEN_TRIM(inputString) == 0) THEN ! If the input is empty (not provided), make the 1x1 bathymetry grid using the default depth ALLOCATE(BathGrid(1,1), STAT=ErrStat4) - BathGrid(1,1) = DBLE(defaultDepth) + BathGrid(1,1) = REAL(defaultDepth,R8Ki) ALLOCATE(BathGrid_Xs(1), STAT=ErrStat4) BathGrid_Xs(1) = 0.0_DbKi diff --git a/modules/moordyn/src/MoorDyn_Misc.f90 b/modules/moordyn/src/MoorDyn_Misc.f90 index a9d66a6516..90cb049d18 100644 --- a/modules/moordyn/src/MoorDyn_Misc.f90 +++ b/modules/moordyn/src/MoorDyn_Misc.f90 @@ -1613,7 +1613,7 @@ SUBROUTINE setupWaterKin(WaterKinString, p, Tmax, ErrStat, ErrMsg) ! get wave number array once DO I = 0, NStepWave2 - WaveNmbr(i) = WaveNumber ( dble(I*WaveDOmega), p%g, p%WtrDpth ) + WaveNmbr(i) = WaveNumber ( REAL(I*WaveDOmega, R8Ki), p%g, p%WtrDpth ) tmpComplex(I) = CMPLX(WaveElevC0(1,I), WaveElevC0(2,I)) END DO @@ -1633,10 +1633,10 @@ SUBROUTINE setupWaterKin(WaterKinString, p, Tmax, ErrStat, ErrMsg) ImagOmega = ImagNmbr*Omega WaveElevC (i) = tmpComplex(i) * EXP( -ImagNmbr*WaveNmbr(i)*( p%pxWave(ix)*CosWaveDir + p%pyWave(iy)*SinWaveDir )) - WaveDynPC (i) = p%rhoW*p%g* WaveElevC(i) * COSHNumOvrCOSHDen( WaveNmbr(i), p%WtrDpth, DBLE(p%pzWave(iz)) ) - WaveVelCHx(i) = Omega*WaveElevC(i) * COSHNumOvrSINHDen( WaveNmbr(i), p%WtrDpth, DBLE(p%pzWave(iz)) ) *CosWaveDir - WaveVelCHy(i) = Omega*WaveElevC(i) * COSHNumOvrSINHDen( WaveNmbr(i), p%WtrDpth, DBLE(p%pzWave(iz)) ) *SinWaveDir - WaveVelCV (i) = ImagOmega*WaveElevC(i) * SINHNumOvrSINHDen( WaveNmbr(i), p%WtrDpth, DBLE(p%pzWave(iz)) ) + WaveDynPC (i) = p%rhoW*p%g* WaveElevC(i) * COSHNumOvrCOSHDen( WaveNmbr(i), p%WtrDpth, REAL(p%pzWave(iz), R8Ki) ) + WaveVelCHx(i) = Omega*WaveElevC(i) * COSHNumOvrSINHDen( WaveNmbr(i), p%WtrDpth, REAL(p%pzWave(iz), R8Ki) ) *CosWaveDir + WaveVelCHy(i) = Omega*WaveElevC(i) * COSHNumOvrSINHDen( WaveNmbr(i), p%WtrDpth, REAL(p%pzWave(iz), R8Ki) ) *SinWaveDir + WaveVelCV (i) = ImagOmega*WaveElevC(i) * SINHNumOvrSINHDen( WaveNmbr(i), p%WtrDpth, REAL(p%pzWave(iz), R8Ki) ) WaveAccCHx(i) = ImagOmega*WaveVelCHx(i) WaveAccCHy(i) = ImagOmega*WaveVelCHy(i) WaveAccCV (i) = ImagOmega*WaveVelCV (i) diff --git a/modules/nwtc-library/src/JSON.f90 b/modules/nwtc-library/src/JSON.f90 index 10c7b6e45b..f672c1a056 100644 --- a/modules/nwtc-library/src/JSON.f90 +++ b/modules/nwtc-library/src/JSON.f90 @@ -18,7 +18,7 @@ ! !********************************************************************************************************************************** module JSON - use Precision, only: IntKi, SiKi, R8Ki, QuKi + use Precision, only: IntKi, SiKi, R8Ki use NWTC_Base, only: ErrID_None, ErrID_Fatal use NWTC_IO, only: num2lstr @@ -29,7 +29,6 @@ module JSON module procedure json_write_array2R4 ! Two dimension array of SiKi module procedure json_write_array2I ! Two dimension array of IntKi module procedure json_write_array2R8 ! Two dimension array of R8Ki - module procedure json_write_array2R16 ! Two dimension array of QuKi end interface private @@ -168,48 +167,4 @@ subroutine json_write_array2R8(fid, key, A, VarFmt, ErrStat, ErrMsg, AllFmt) end if end subroutine json_write_array2R8 -subroutine json_write_array2R16(fid, key, A, VarFmt, ErrStat, ErrMsg, AllFmt) - integer(IntKi), intent(in ) :: fid !< File Unit - character(len=*), intent(in ) :: key !< Array name - real(QuKi), dimension(:,:), intent(in ) :: A !< Array - character(len=*), intent(in ) :: VarFmt !< Format for printing real numbers - integer, intent( out) :: ErrStat !< A non-zero value indicates an error occurred - character(len=*), intent( out) :: ErrMsg !< Error message if errstat /= errid_none - character(len=*), optional, intent(in ) :: AllFmt !< Format for printing a line - integer :: nr, nc, i ! size (rows and columns) of A - character(256) :: Fmt - ErrStat = ErrID_None - ErrMsg = "" - nr = size(A,1) - nc = size(A,2) - - ! Key - write(fid, '(A,": [")', iostat=ErrStat, advance='no') trim(key) - if (nr==0) then - write(fid, '("[]]")', iostat=ErrStat) - else - ! JSON Line format - if (present(AllFmt)) then - Fmt = '("[",'//trim(AllFmt)//'"]")' - elseif (nc==1) then - Fmt = '("[",'//VarFmt//',"],")' - else - Fmt = '("[",'//trim(Num2LStr(nc-1))//'('//VarFmt//',","),'//VarFmt//',"]")' - endif - ! Write line by line - do i=1,nr - write(fid, Fmt, iostat=ErrStat, advance='no') A(i,:) - if (i \copydoc nwtc_io::allipary1 @@ -130,7 +123,6 @@ MODULE NWTC_IO MODULE PROCEDURE AllRPAry2 MODULE PROCEDURE AllR4PAry3 MODULE PROCEDURE AllR8PAry3 - MODULE PROCEDURE AllR16PAry3 ! MODULE PROCEDURE AllRPAry4 !not yet coded END INTERFACE @@ -141,7 +133,6 @@ MODULE NWTC_IO MODULE PROCEDURE ParseLoVar ! Parses an LOGICAL from a string. MODULE PROCEDURE ParseSiVar ! Parses a single-precision REAL from a string. MODULE PROCEDURE ParseR8Var ! Parses a double-precision REAL from a string. - MODULE PROCEDURE ParseQuVar ! Parses a quad-precision REAL from a string. END INTERFACE !> \copydoc nwtc_io::parsechvarwdefault @@ -151,7 +142,6 @@ MODULE NWTC_IO MODULE PROCEDURE ParseLoVarWDefault ! Parses an LOGICAL from a string, potentially sets to a default value if "Default" is parsed. MODULE PROCEDURE ParseSiVarWDefault ! Parses a single-precision REAL from a string, potentially sets to a default value if "Default" is parsed. MODULE PROCEDURE ParseR8VarWDefault ! Parses a double-precision REAL from a string, potentially sets to a default value if "Default" is parsed. - MODULE PROCEDURE ParseQuVarWDefault ! Parses a quad-precision REAL from a string, potentially sets to a default value if "Default" is parsed. END INTERFACE !> \copydoc nwtc_io::parsedbary @@ -160,7 +150,6 @@ MODULE NWTC_IO MODULE PROCEDURE ParseLoAry ! Parse an array of LOGICAL values. MODULE PROCEDURE ParseSiAry ! Parse an array of single-precision REAL values. MODULE PROCEDURE ParseR8Ary ! Parse an array of double-precision REAL values. - MODULE PROCEDURE ParseQuAry ! Parse an array of quad-precision REAL values. MODULE PROCEDURE ParseChAry END INTERFACE @@ -168,7 +157,6 @@ MODULE NWTC_IO INTERFACE CheckRealVar MODULE PROCEDURE CheckR4Var ! 4-byte real MODULE PROCEDURE CheckR8Var ! 8-byte real - MODULE PROCEDURE CheckR16Var ! 16-byte real END INTERFACE !> \copydoc nwtc_io::readcvar @@ -178,7 +166,6 @@ MODULE NWTC_IO MODULE PROCEDURE ReadLVar MODULE PROCEDURE ReadR4Var ! 4-byte real MODULE PROCEDURE ReadR8Var ! 8-byte real - MODULE PROCEDURE ReadR16Var ! 16-byte real END INTERFACE !> \copydoc nwtc_io::readivarwdefault @@ -188,7 +175,6 @@ MODULE NWTC_IO MODULE PROCEDURE ReadLVarWDefault ! Logical MODULE PROCEDURE ReadR4VarWDefault ! 4-byte real MODULE PROCEDURE ReadR8VarWDefault ! 8-byte real - MODULE PROCEDURE ReadR16VarWDefault ! 16-byte real MODULE PROCEDURE ReadIAryWDefault END INTERFACE @@ -203,8 +189,6 @@ MODULE NWTC_IO MODULE PROCEDURE ReadR4AryFromStr MODULE PROCEDURE ReadR8Ary ! read array of 8-byte reals MODULE PROCEDURE ReadR8AryFromStr - MODULE PROCEDURE ReadR16Ary ! read array of 16-byte reals - MODULE PROCEDURE ReadR16AryFromStr END INTERFACE !> \copydoc nwtc_io::readcarylines @@ -212,7 +196,6 @@ MODULE NWTC_IO MODULE PROCEDURE ReadCAryLines MODULE PROCEDURE ReadR4AryLines MODULE PROCEDURE ReadR8AryLines - MODULE PROCEDURE ReadR16AryLines ! MODULE PROCEDURE ReadIAryLines ! Not coded yet ! MODULE PROCEDURE ReadLAryLines ! Not coded yet END INTERFACE @@ -223,7 +206,6 @@ MODULE NWTC_IO MODULE PROCEDURE B8Ki2LStr ! 8 byte integers MODULE PROCEDURE R2LStr4 ! 4-byte reals MODULE PROCEDURE R2LStr8 ! 8-byte reals - MODULE PROCEDURE R2LStr16 ! 16-byte reals END INTERFACE !> \copydoc nwtc_io::dispnvd0 @@ -239,8 +221,6 @@ MODULE NWTC_IO MODULE PROCEDURE WrMatrix2R4 ! Two dimension matrix of SiKi MODULE PROCEDURE WrMatrix1R8 ! Single dimension matrix (Ary) of R8Ki MODULE PROCEDURE WrMatrix2R8 ! Two dimension matrix of R8Ki - MODULE PROCEDURE WrMatrix1R16 ! Single dimension matrix (Ary) of QuKi - MODULE PROCEDURE WrMatrix2R16 ! Two dimension matrix of QuKi END INTERFACE !> \copydoc nwtc_io::wrpartialmatrix1r8 @@ -254,7 +234,6 @@ MODULE NWTC_IO MODULE PROCEDURE WrIAryFileNR MODULE PROCEDURE WrR4AryFileNR MODULE PROCEDURE WrR8AryFileNR - MODULE PROCEDURE WrR16AryFileNR END INTERFACE CONTAINS @@ -795,43 +774,6 @@ SUBROUTINE AllR8PAry3 ( Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg RETURN END SUBROUTINE AllR8PAry3 !======================================================================= -!> \copydoc nwtc_io::allipary1 - SUBROUTINE AllR16PAry3 ( Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg ) - - - ! This routine allocates a 3-D REAL array. - - ! Argument declarations. - - REAL(QuKi), POINTER :: Ary (:,:,:) ! Array to be allocated - INTEGER, INTENT(IN) :: AryDim1 ! The size of the first dimension of the array. - INTEGER, INTENT(IN) :: AryDim2 !< The size of the second dimension of the array. - INTEGER, INTENT(IN) :: AryDim3 !< The size of the third dimension of the array. - INTEGER, INTENT(OUT) :: ErrStat ! Error status - CHARACTER(*), INTENT(OUT) :: ErrMsg ! Error message corresponding to ErrStat - CHARACTER(*), INTENT(IN) :: Descr ! Brief array description. - - - IF ( ASSOCIATED(Ary) ) THEN - DEALLOCATE(Ary) - !ErrStat = ErrID_Warn - !ErrMsg = " AllRPAry3: Ary already allocated." - END IF - - ALLOCATE ( Ary(AryDim1,AryDim2,AryDim3) , STAT=ErrStat ) - IF ( ErrStat /= 0 ) THEN - ErrStat = ErrID_Fatal - ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*AryDim3*BYTES_IN_REAL))//& - ' bytes of memory for the '//TRIM( Descr )//' array.' - ELSE - ErrStat = ErrID_None - ErrMsg = '' - END IF - - Ary = 0 - RETURN - END SUBROUTINE AllR16PAry3 -!======================================================================= !> \copydoc nwtc_io::allcary1 SUBROUTINE AllLAry1 ( Ary, AryDim1, Descr, ErrStat, ErrMsg ) @@ -1003,41 +945,6 @@ SUBROUTINE AllR8Ary1 ( Ary, AryDim1, Descr, ErrStat, ErrMsg ) RETURN END SUBROUTINE AllR8Ary1 !======================================================================= -!> \copydoc nwtc_io::allcary1 - SUBROUTINE AllR16Ary1 ( Ary, AryDim1, Descr, ErrStat, ErrMsg ) - - - ! This routine allocates a 1-D 16-byte REAL array. - - - ! Argument declarations. - - REAL(QuKi), ALLOCATABLE :: Ary (:) ! Array to be allocated - INTEGER, INTENT(IN) :: AryDim1 ! The size of the array. - - CHARACTER(*), INTENT(IN) :: Descr ! Brief array description. - INTEGER, INTENT(OUT) :: ErrStat ! Error status - CHARACTER(*), INTENT(OUT) :: ErrMsg ! Error message corresponding to ErrStat - - - ALLOCATE ( Ary(AryDim1) , STAT=ErrStat ) - - IF ( ErrStat /= 0 ) THEN - ErrStat = ErrID_Fatal - IF ( ALLOCATED(Ary) ) THEN ! or Sttus=151 on IVF - ErrMsg = 'Error allocating memory for the '//TRIM( Descr )//' array; array was already allocated.' - ELSE - ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*BYTES_IN_QuKi))//' bytes of memory for the '//TRIM( Descr )//' array.' - END IF - ELSE - ErrStat = ErrID_None - ErrMsg = '' - END IF - - - RETURN - END SUBROUTINE AllR16Ary1 -!======================================================================= !> \copydoc nwtc_io::allcary1 SUBROUTINE AllR4Ary2 ( Ary, AryDim1, AryDim2, Descr, ErrStat, ErrMsg ) @@ -1114,43 +1021,6 @@ SUBROUTINE AllR8Ary2 ( Ary, AryDim1, AryDim2, Descr, ErrStat, ErrMsg ) RETURN END SUBROUTINE AllR8Ary2 !======================================================================= -!> \copydoc nwtc_io::allcary1 - SUBROUTINE AllR16Ary2 ( Ary, AryDim1, AryDim2, Descr, ErrStat, ErrMsg ) - - - ! This routine allocates a 2-D 4-Byte REAL array. - - - ! Argument declarations. - - REAL(QuKi), ALLOCATABLE :: Ary (:,:) ! Array to be allocated - - INTEGER, INTENT(IN) :: AryDim1 ! The size of the first dimension of the array. - INTEGER, INTENT(IN) :: AryDim2 !< The size of the second dimension of the array. - CHARACTER(*), INTENT(IN) :: Descr ! Brief array description. - INTEGER, INTENT(OUT) :: ErrStat ! Error status - CHARACTER(*), INTENT(OUT) :: ErrMsg ! Error message corresponding to ErrStat - - - - ALLOCATE ( Ary(AryDim1,AryDim2) , STAT=ErrStat ) - - IF ( ErrStat /= 0 ) THEN - ErrStat = ErrID_Fatal - IF ( ALLOCATED(Ary) ) THEN ! or Sttus=151 on IVF - ErrMsg = 'Error allocating memory for the '//TRIM( Descr )//' array; array was already allocated.' - ELSE - ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*BYTES_IN_QuKi))//& - ' bytes of memory for the '//TRIM( Descr )//' array.' - END IF - ELSE - ErrStat = ErrID_None - ErrMsg = '' - END IF - - RETURN - END SUBROUTINE AllR16Ary2 -!======================================================================= !> \copydoc nwtc_io::allcary1 SUBROUTINE AllR4Ary3 ( Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg ) @@ -1225,43 +1095,6 @@ SUBROUTINE AllR8Ary3 ( Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg ) RETURN END SUBROUTINE AllR8Ary3 !======================================================================= -!> \copydoc nwtc_io::allcary1 - SUBROUTINE AllR16Ary3 ( Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg ) - - - ! This routine allocates a 3-D 16-byte REAL array. - - - ! Argument declarations. - - REAL(QuKi), ALLOCATABLE :: Ary (:,:,:) ! Array to be allocated - - INTEGER, INTENT(IN) :: AryDim1 ! The size of the first dimension of the array. - INTEGER, INTENT(IN) :: AryDim2 !< The size of the second dimension of the array. - INTEGER, INTENT(IN) :: AryDim3 !< The size of the third dimension of the array. - CHARACTER(*), INTENT(IN) :: Descr ! Brief array description. - INTEGER, INTENT(OUT) :: ErrStat ! Error status; if present, program does not abort on error - CHARACTER(*), INTENT(OUT) :: ErrMsg ! Error message corresponding to ErrStat - - - ALLOCATE ( Ary(AryDim1,AryDim2,AryDim3) , STAT=ErrStat ) - - IF ( ErrStat /= 0 ) THEN - ErrStat = ErrID_Fatal - IF ( ALLOCATED(Ary) ) THEN ! or Sttus=151 on IVF - ErrMsg = 'Error allocating memory for the '//TRIM( Descr )//' array; array was already allocated.' - ELSE - ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*AryDim3*BYTES_IN_REAL))//& - ' bytes of memory for the '//TRIM( Descr )//' array.' - END IF - ELSE - ErrStat = ErrID_None - ErrMsg = '' - END IF - - RETURN - END SUBROUTINE AllR16Ary3 -!======================================================================= !> \copydoc nwtc_io::allcary1 SUBROUTINE AllR4Ary4 ( Ary, AryDim1, AryDim2, AryDim3, AryDim4, Descr, ErrStat, ErrMsg ) @@ -1338,44 +1171,6 @@ SUBROUTINE AllR8Ary4 ( Ary, AryDim1, AryDim2, AryDim3, AryDim4, Descr, ErrStat, RETURN END SUBROUTINE AllR8Ary4 !======================================================================= -!> \copydoc nwtc_io::allcary1 - SUBROUTINE AllR16Ary4 ( Ary, AryDim1, AryDim2, AryDim3, AryDim4, Descr, ErrStat, ErrMsg ) - - - ! This routine allocates a 4-D 16-byte REAL array. - - - ! Argument declarations. - - REAL(QuKi), ALLOCATABLE :: Ary (:,:,:,:) ! Array to be allocated - - INTEGER, INTENT(IN) :: AryDim1 ! The size of the first dimension of the array. - INTEGER, INTENT(IN) :: AryDim2 !< The size of the second dimension of the array. - INTEGER, INTENT(IN) :: AryDim3 !< The size of the third dimension of the array. - INTEGER, INTENT(IN) :: AryDim4 !< The size of the fourth dimension of the array. - CHARACTER(*), INTENT(IN) :: Descr ! Brief array description. - INTEGER, INTENT(OUT) :: ErrStat ! Error status; if present, program does not abort on error - CHARACTER(*), INTENT(OUT) :: ErrMsg ! Error message corresponding to ErrStat - - - ALLOCATE ( Ary(AryDim1,AryDim2,AryDim3,AryDim4) , STAT=ErrStat ) - - IF ( ErrStat /= 0 ) THEN - ErrStat = ErrID_Fatal - IF ( ALLOCATED(Ary) ) THEN ! or Sttus=151 on IVF - ErrMsg = 'Error allocating memory for the '//TRIM( Descr )//' array; array was already allocated.' - ELSE - ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*AryDim3*AryDim4*BYTES_IN_REAL))//& - ' bytes of memory for the '//TRIM( Descr )//' array.' - END IF - ELSE - ErrStat = ErrID_None - ErrMsg = '' - END IF - - RETURN - END SUBROUTINE AllR16Ary4 -!======================================================================= !> \copydoc nwtc_io::allcary1 SUBROUTINE AllR4Ary5 ( Ary, AryDim1, AryDim2, AryDim3, AryDim4, AryDim5, Descr, ErrStat, ErrMsg ) @@ -1458,48 +1253,6 @@ SUBROUTINE AllR8Ary5 ( Ary, AryDim1, AryDim2, AryDim3, AryDim4, AryDim5, Descr, RETURN END SUBROUTINE AllR8Ary5 !======================================================================= -!> \copydoc nwtc_io::allcary1 - SUBROUTINE AllR16Ary5 ( Ary, AryDim1, AryDim2, AryDim3, AryDim4, AryDim5, Descr, ErrStat, ErrMsg ) - - - ! This routine allocates a 5-D 16-byte REAL array. - - - ! Argument declarations. - - REAL(QuKi), ALLOCATABLE :: Ary (:,:,:,:,:) ! Array to be allocated - - INTEGER, INTENT(IN) :: AryDim1 ! The size of the first dimension of the array. - INTEGER, INTENT(IN) :: AryDim2 !< The size of the second dimension of the array. - INTEGER, INTENT(IN) :: AryDim3 !< The size of the third dimension of the array. - INTEGER, INTENT(IN) :: AryDim4 !< The size of the fourth dimension of the array. - INTEGER, INTENT(IN) :: AryDim5 !< The size of the fourth dimension of the array. - CHARACTER(*), INTENT(IN) :: Descr ! Brief array description. - INTEGER, INTENT(OUT) :: ErrStat ! Error status; if present, program does not abort on error - CHARACTER(*), INTENT(OUT) :: ErrMsg ! Error message corresponding to ErrStat - - - ALLOCATE ( Ary(AryDim1,AryDim2,AryDim3,AryDim4,AryDim5) , STAT=ErrStat ) - - IF ( ErrStat /= 0 ) THEN - ErrStat = ErrID_Fatal - IF ( ALLOCATED(Ary) ) THEN ! or Sttus=151 on IVF - ErrMsg = 'Error allocating memory for the '//TRIM( Descr )//' array; array was already allocated.' - ELSE - ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*AryDim3*AryDim4*AryDim5*BYTES_IN_REAL))//& - ' bytes of memory for the '//TRIM( Descr )//' array.' - END IF - ELSE - ErrStat = ErrID_None - ErrMsg = '' - END IF - - - - RETURN - END SUBROUTINE AllR16Ary5 - -!======================================================================= !> This subroutine checks the data to be parsed to make sure it finds !! the expected variable name and an associated value. SUBROUTINE ChkParseData ( Words, ExpVarName, FileName, FileLineNum, NameIndx, ErrStat, ErrMsg ) @@ -1768,24 +1521,6 @@ SUBROUTINE CheckR8Var( RealVar, RealDesc, ErrStat, ErrMsg ) END SUBROUTINE CheckR8Var !======================================================================= -!> \copydoc nwtc_io::checkr4var -SUBROUTINE CheckR16Var( RealVar, RealDesc, ErrStat, ErrMsg ) - - REAL(QuKi), INTENT(IN) :: RealVar !< Real value to check - CHARACTER(*),INTENT(IN) :: RealDesc !< description of RealVar - INTEGER, INTENT(OUT) :: ErrStat !< Error status - CHARACTER(*),INTENT(OUT) :: ErrMsg !< Error message - - IF (IEEE_IS_NAN(RealVar) .or. .not. IEEE_IS_FINITE( RealVar) ) THEN - ErrStat = ErrID_Fatal - ErrMsg = trim(RealDesc)//': value is not a finite real number.' - ELSE - ErrStat = ErrID_None - ErrMsg = "" - END IF - -END SUBROUTINE CheckR16Var -!======================================================================= !> This routine converts all the text in a string to upper case. SUBROUTINE Conv2UC ( Str ) @@ -3574,39 +3309,35 @@ SUBROUTINE ParseR8VarWDefault ( FileInfo, LineNum, ExpVarName, Var, VarDefault, RETURN END SUBROUTINE ParseR8VarWDefault !======================================================================= -!> This subroutine parses the specified line of text for AryLen REAL values. -!! Generate an error message if the value is the wrong type. -!! Use ParseAry (nwtc_io::parseary) instead of directly calling a specific routine in the generic interface. - SUBROUTINE ParseQuAry ( FileInfo, LineNum, AryName, Ary, AryLen, ErrStat, ErrMsg, UnEc ) +!> \copydoc nwtc_io::parsedbary + SUBROUTINE ParseInAry ( FileInfo, LineNum, AryName, Ary, AryLen, ErrStat, ErrMsg, UnEc ) ! Arguments declarations. - INTEGER, INTENT(IN) :: AryLen !< The length of the array to parse. + INTEGER, INTENT(IN) :: AryLen ! The length of the array to parse. - REAL(QuKi), INTENT(OUT) :: Ary (AryLen) !< The array to receive the input values. + INTEGER, INTENT(OUT) :: Ary (AryLen) ! The INTEGER array to receive the input values. - INTEGER(IntKi), INTENT(OUT) :: ErrStat !< The error status. - INTEGER(IntKi), INTENT(INOUT) :: LineNum !< The number of the line to parse. + INTEGER(IntKi), INTENT(OUT) :: ErrStat ! The error status. + INTEGER(IntKi), INTENT(INOUT) :: LineNum ! The number of the line to parse. - INTEGER, INTENT(IN), OPTIONAL :: UnEc !< I/O unit for echo file. If present and > 0, write to UnEc. + INTEGER, INTENT(IN), OPTIONAL :: UnEc ! I/O unit for echo file. If present and > 0, write to UnEc. - CHARACTER(*), INTENT(In) :: AryName !< The array name we are trying to fill. - CHARACTER(*), INTENT(OUT) :: ErrMsg !< The error message, if ErrStat /= 0. + CHARACTER(*), INTENT(In) :: AryName ! The array name we are trying to fill. + CHARACTER(*), INTENT(OUT) :: ErrMsg ! The error message, if ErrStat /= 0. - TYPE (FileInfoType), INTENT(IN) :: FileInfo !< The derived type for holding the file information. + TYPE (FileInfoType), INTENT(IN) :: FileInfo ! The derived type for holding the file information. ! Local declarations. INTEGER(IntKi) :: ErrStatLcl ! Error status local to this routine. - INTEGER(IntKi) :: i ! Error status local to this routine. - - CHARACTER(*), PARAMETER :: RoutineName = 'ParseQuAry' + CHARACTER(*), PARAMETER :: RoutineName = 'ParseInAry' ErrStat = ErrID_None ErrMsg = "" - + IF (LineNum > size(FileInfo%Lines) ) THEN CALL SetErrStat ( ErrID_Fatal, NewLine//' >> A fatal error occurred when parsing data.'//NewLine// & ' >> The "'//TRIM( AryName )//'" array was not assigned because the file is too short. LineNum='// & @@ -3614,192 +3345,13 @@ SUBROUTINE ParseQuAry ( FileInfo, LineNum, AryName, Ary, AryLen, ErrStat, ErrMsg , ErrStat, ErrMsg, RoutineName ) RETURN END IF - - + + READ (FileInfo%Lines(LineNum),*,IOSTAT=ErrStatLcl) Ary IF ( ErrStatLcl /= 0 ) THEN CALL SetErrStat ( ErrID_Fatal, 'A fatal error occurred when parsing data from "' & //TRIM( FileInfo%FileList(FileInfo%FileIndx(LineNum)) )//'".'//NewLine// & - ' >> The "'//TRIM( AryName )//'" array was not assigned valid REAL values on line #' & - //TRIM( Num2LStr( FileInfo%FileLine(LineNum) ) )//'.'//NewLine//' >> The text being parsed was :'//NewLine & - //' "'//TRIM( FileInfo%Lines(LineNum) )//'"',ErrStat,ErrMsg,RoutineName ) - RETURN - ENDIF - - DO i=1,AryLen - call CheckRealVar( Ary(i), AryName, ErrStat, ErrMsg ) - if (ErrStat>= AbortErrLev) return - END DO - - - IF ( PRESENT(UnEc) ) THEN - IF ( UnEc > 0 ) WRITE (UnEc,'(A)') TRIM( FileInfo%Lines(LineNum) ) - END IF - - LineNum = LineNum + 1 - - RETURN - - END SUBROUTINE ParseQuAry -!======================================================================= -!> \copydoc nwtc_io::parsechvar - SUBROUTINE ParseQuVar ( FileInfo, LineNum, ExpVarName, Var, ErrStat, ErrMsg, UnEc ) - - ! Arguments declarations. - - REAL(QuKi), INTENT(OUT) :: Var ! The double-precision REAL variable to receive the input value. - - INTEGER(IntKi), INTENT(OUT) :: ErrStat ! The error status. - INTEGER(IntKi), INTENT(INOUT) :: LineNum ! The number of the line to parse. - - INTEGER, INTENT(IN), OPTIONAL :: UnEc ! I/O unit for echo file. If present and > 0, write to UnEc. - - CHARACTER(*), INTENT(OUT) :: ErrMsg ! The error message, if ErrStat /= 0. - CHARACTER(*), INTENT(IN) :: ExpVarName ! The expected variable name. - - TYPE (FileInfoType), INTENT(IN) :: FileInfo ! The derived type for holding the file information. - - - ! Local declarations. - - INTEGER(IntKi) :: ErrStatLcl ! Error status local to this routine. - INTEGER(IntKi) :: NameIndx ! The index into the Words array that points to the variable name. - - CHARACTER(NWTC_SizeOfNumWord) :: Words (2) ! The two "words" parsed from the line. - CHARACTER(ErrMsgLen) :: ErrMsg2 - CHARACTER(*), PARAMETER :: RoutineName = 'ParseQuVar' - - - ErrStat = ErrID_None - ErrMsg = "" - - IF (LineNum > size(FileInfo%Lines) ) THEN - CALL SetErrStat ( ErrID_Fatal, NewLine//' >> A fatal error occurred when parsing data.'//NewLine// & - ' >> The "'//TRIM( ExpVarName )//'" variable was not assigned because the file is too short. LineNum='// & - trim(num2lstr(LineNum))//'; NumLines='//trim(num2lstr(size(FileInfo%Lines))) & - , ErrStat, ErrMsg, RoutineName ) - RETURN - END IF - - CALL GetWords ( FileInfo%Lines(LineNum), Words, 2 ) ! Read the first two words in Line. - - CALL ChkParseData ( Words, ExpVarName, FileInfo%FileList(FileInfo%FileIndx(LineNum)) & - , FileInfo%FileLine(LineNum), NameIndx, ErrStatLcl, ErrMsg2 ) - CALL SetErrStat(ErrStatLcl, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - IF ( ErrStat >= AbortErrLev ) RETURN - - - READ (Words(3-NameIndx),*,IOSTAT=ErrStatLcl) Var - IF ( ErrStatLcl /= 0 ) THEN - CALL SetErrStat ( ErrID_Fatal, NewLine//'A fatal error occurred when parsing data from "' & - //TRIM( FileInfo%FileList(FileInfo%FileIndx(LineNum)) )//'".'//NewLine// & - ' >> The variable "'//TRIM( Words(NameIndx) )//'" was not assigned valid REAL value on line #' & - //TRIM( Num2LStr( LineNum ) )//'.'//NewLine//' >> The text being parsed was :'//& - NewLine//' "'//TRIM( FileInfo%Lines(LineNum) )//'"', ErrStat, ErrMsg, RoutineName) - RETURN - ENDIF - CALL CheckRealVar( Var, ExpVarName, ErrStatLcl, ErrMsg2) - CALL SetErrStat(ErrStatLcl, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - if (ErrStat>= AbortErrLev) return - - IF ( PRESENT(UnEc) ) THEN - IF ( UnEc > 0 ) WRITE (UnEc,'(1X,A15," = ",A20)') Words - END IF - - LineNum = LineNum + 1 - - RETURN - END SUBROUTINE ParseQuVar -!======================================================================= -!> \copydoc nwtc_io::parsechvarwdefault - SUBROUTINE ParseQuVarWDefault ( FileInfo, LineNum, ExpVarName, Var, VarDefault, ErrStat, ErrMsg, UnEc ) - - ! Arguments declarations. - - - INTEGER(IntKi), INTENT(OUT) :: ErrStat ! The error status. - INTEGER(IntKi), INTENT(INOUT) :: LineNum ! The number of the line to parse. - - INTEGER, INTENT(IN), OPTIONAL :: UnEc ! I/O unit for echo file. If present and > 0, write to UnEc. - - REAL(QuKi), INTENT(OUT) :: Var ! The double-precision REAL variable to receive the input value. - REAL(QuKi), INTENT(IN) :: VarDefault ! The double-precision REAL used as the default. - CHARACTER(*), INTENT(OUT) :: ErrMsg ! The error message, if ErrStat /= 0. - CHARACTER(*), INTENT(IN) :: ExpVarName ! The expected variable name. - - TYPE (FileInfoType), INTENT(IN) :: FileInfo ! The derived type for holding the file information. - - - ! Local declarations. - - INTEGER(IntKi) :: ErrStatLcl ! Error status local to this routine. - - CHARACTER(ErrMsgLen) :: ErrMsg2 - CHARACTER(*), PARAMETER :: RoutineName = 'ParseQuVarDefault' - CHARACTER(20) :: defaultStr - - ErrStat=ErrID_None - ErrMsg = "" - - ! First parse this as a string - CALL ParseVar ( FileInfo, LineNum, ExpVarName, defaultStr, ErrStatLcl, ErrMsg2, UnEc ) - CALL SetErrStat(ErrStatLcl, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - IF (ErrStat >= AbortErrLev) RETURN - CALL Conv2UC( defaultStr ) - IF ( INDEX(defaultStr, "DEFAULT" ) /= 1 ) THEN ! If it's not "default", read this variable - LineNum = LineNum - 1 ! back up a line - CALL ParseVar ( FileInfo, LineNum, ExpVarName, Var, ErrStatLcl, ErrMsg2, UnEc ) - CALL SetErrStat( ErrStatLcl, ErrMsg2, ErrStat, ErrMsg, RoutineName ) - ELSE - Var = VarDefault ! "DEFAULT" value - END IF - - RETURN - END SUBROUTINE ParseQuVarWDefault -!======================================================================= -!> \copydoc nwtc_io::parsedbary - SUBROUTINE ParseInAry ( FileInfo, LineNum, AryName, Ary, AryLen, ErrStat, ErrMsg, UnEc ) - - ! Arguments declarations. - - INTEGER, INTENT(IN) :: AryLen ! The length of the array to parse. - - INTEGER, INTENT(OUT) :: Ary (AryLen) ! The INTEGER array to receive the input values. - - INTEGER(IntKi), INTENT(OUT) :: ErrStat ! The error status. - INTEGER(IntKi), INTENT(INOUT) :: LineNum ! The number of the line to parse. - - INTEGER, INTENT(IN), OPTIONAL :: UnEc ! I/O unit for echo file. If present and > 0, write to UnEc. - - CHARACTER(*), INTENT(In) :: AryName ! The array name we are trying to fill. - CHARACTER(*), INTENT(OUT) :: ErrMsg ! The error message, if ErrStat /= 0. - - TYPE (FileInfoType), INTENT(IN) :: FileInfo ! The derived type for holding the file information. - - - ! Local declarations. - - INTEGER(IntKi) :: ErrStatLcl ! Error status local to this routine. - - CHARACTER(*), PARAMETER :: RoutineName = 'ParseInAry' - - ErrStat = ErrID_None - ErrMsg = "" - - IF (LineNum > size(FileInfo%Lines) ) THEN - CALL SetErrStat ( ErrID_Fatal, NewLine//' >> A fatal error occurred when parsing data.'//NewLine// & - ' >> The "'//TRIM( AryName )//'" array was not assigned because the file is too short. LineNum='// & - trim(num2lstr(LineNum))//'; NumLines='//trim(num2lstr(size(FileInfo%Lines))) & - , ErrStat, ErrMsg, RoutineName ) - RETURN - END IF - - - READ (FileInfo%Lines(LineNum),*,IOSTAT=ErrStatLcl) Ary - IF ( ErrStatLcl /= 0 ) THEN - CALL SetErrStat ( ErrID_Fatal, 'A fatal error occurred when parsing data from "' & - //TRIM( FileInfo%FileList(FileInfo%FileIndx(LineNum)) )//'".'//NewLine// & - ' >> The "'//TRIM( AryName )//'" array was not assigned valid INTEGER values on line #' & + ' >> The "'//TRIM( AryName )//'" array was not assigned valid INTEGER values on line #' & //TRIM( Num2LStr( FileInfo%FileLine(LineNum) ) )//'.'//NewLine//' >> The text being parsed was :'//NewLine & //' "'//TRIM( FileInfo%Lines(LineNum) )//'"',ErrStat,ErrMsg,RoutineName ) RETURN @@ -4978,49 +4530,6 @@ FUNCTION R2LStr8 ( Num, Fmt_in ) RETURN END FUNCTION R2LStr8 -!======================================================================= -!> \copydoc nwtc_io::int2lstr - FUNCTION R2LStr16 ( Num, Fmt_in ) - - ! This function converts a 16-byte floating point number to - ! a left-aligned string. It eliminates trailing zeroes - ! and even the decimal point if it is not a fraction. - - - ! Function declaration. - - CHARACTER(15) :: R2LStr16 ! This function. - CHARACTER(*), OPTIONAL :: Fmt_in - - - ! Argument declarations. - - REAL(QuKi), INTENT(IN) :: Num ! The floating-point number to convert. - CHARACTER(15) :: Fmt ! format for output - - - ! Return a 0 if that's what we have. - - IF ( Num == 0.0_QuKi ) THEN - R2LStr16 = '0' - RETURN - END IF - - - ! Write the number into the string using G format and left justify it. - if ( present( Fmt_in ) ) then - Fmt = '('//Fmt_in//')' - else - Fmt = '(1PG15.5)' - end if - - WRITE (R2LStr16,Fmt) Num - - CALL AdjRealStr( R2LStr16 ) - - - RETURN - END FUNCTION R2LStr16 !====================================================================== !> This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) !! into an array (either on same line or multiple lines). @@ -6600,28 +6109,22 @@ SUBROUTINE ReadR8AryFromStr ( Str, Ary, AryLen, AryName, AryDescr, ErrStat, ErrM RETURN END SUBROUTINE ReadR8AryFromStr !======================================================================= -!> \copydoc nwtc_io::readcary - SUBROUTINE ReadR16Ary ( UnIn, Fil, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc ) - - - ! This routine reads a AryLen values into a 16-byte real array separated by white space - ! (possibly on the same line of the input file). - +!> \copydoc nwtc_io::readcarylines + SUBROUTINE ReadR4AryLines ( UnIn, Fil, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc ) ! Argument declarations: - INTEGER, INTENT(IN) :: AryLen ! Length of the array. - INTEGER, INTENT(IN) :: UnIn ! I/O unit for input file. - INTEGER, INTENT(IN),OPTIONAL :: UnEc ! I/O unit for echo file. If present and > 0, write to UnEc - INTEGER, INTENT(OUT) :: ErrStat ! Error status - CHARACTER(*), INTENT(OUT) :: ErrMsg ! Error message - + INTEGER, INTENT(IN) :: AryLen ! Length of the array. + INTEGER, INTENT(IN) :: UnIn ! I/O unit for input file. + INTEGER, INTENT(IN), OPTIONAL:: UnEc ! I/O unit for echo file. If present and > 0, write to UnEc + INTEGER, INTENT(OUT) :: ErrStat ! Error status + CHARACTER(*), INTENT(OUT) :: ErrMsg ! Error message associated with ErrStat - REAL(QuKi), INTENT(INOUT) :: Ary(AryLen) ! Real array being read. + REAL(SiKi), INTENT(OUT) :: Ary(AryLen) ! Real (4-byte) array being read. - CHARACTER(*), INTENT(IN) :: Fil ! Name of the input file. - CHARACTER(*), INTENT(IN) :: AryDescr ! Text string describing the variable. - CHARACTER(*), INTENT(IN) :: AryName ! Text string containing the variable name. + CHARACTER(*), INTENT(IN) :: Fil ! Name of the input file. + CHARACTER(*), INTENT(IN) :: AryDescr ! Text string describing the variable. + CHARACTER(*), INTENT(IN) :: AryName ! Text string containing the variable name. ! Local declarations: @@ -6631,111 +6134,22 @@ SUBROUTINE ReadR16Ary ( UnIn, Fil, Ary, AryLen, AryName, AryDescr, ErrStat, ErrM - READ (UnIn,*,IOSTAT=IOS) ( Ary(Ind), Ind=1,AryLen ) - - CALL CheckIOS ( IOS, Fil, TRIM( AryName ), NumType, ErrStat, ErrMsg ) - - IF (ErrStat >= AbortErrLev) RETURN + ErrStat = ErrID_None + ErrMsg = "" DO Ind=1,AryLen + READ (UnIn,*,IOSTAT=IOS) Ary(Ind) + + CALL CheckIOS ( IOS, Fil, TRIM( AryName )//'('//TRIM( Num2LStr( Ind ) )//')', NumType, ErrStat, ErrMsg ) + IF (ErrStat >= AbortErrLev) RETURN CALL CheckRealVar( Ary(Ind), AryName, ErrStat, ErrMsg) IF (ErrStat >= AbortErrLev) RETURN - END DO - - IF ( PRESENT(UnEc) ) THEN - IF ( UnEc > 0 ) THEN - WRITE( UnEc, Ec_ReAryFrmt ) TRIM( AryName ), AryDescr, Ary(1:MIN(AryLen,NWTC_MaxAryLen)) - END IF - END IF - - RETURN - END SUBROUTINE ReadR16Ary -!====================================================================== -!> This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) -!! into an array (either on same line or multiple lines) from an input string -!! Use ReadAry (nwtc_io::readary) instead of directly calling a specific routine in the generic interface. - SUBROUTINE ReadR16AryFromStr ( Str, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc ) - - ! Argument declarations: - CHARACTER(*), INTENT(IN) :: Str !< String to read from - INTEGER, INTENT(IN) :: AryLen !< Length of the array. - INTEGER, INTENT(IN), OPTIONAL:: UnEc !< I/O unit for echo file. If present and > 0, write to UnEc - INTEGER, INTENT(OUT) :: ErrStat !< Error status - CHARACTER(*), INTENT(OUT) :: ErrMsg !< Error message describing ErrStat - REAL(QuKi), INTENT(INOUT) :: Ary(AryLen) ! Real array being read. - CHARACTER(*), INTENT(IN) :: AryDescr !< Text string describing the variable. - CHARACTER(*), INTENT(IN) :: AryName !< Text string containing the variable name. - ! Local declarations: - INTEGER :: Ind ! Index into the string array. Assumed to be one digit. - INTEGER :: IOS ! I/O status returned from the read statement. - - ! Init of output - do Ind=1,AryLen - Ary(Ind)=0.0 - end do - ! Reading fields from string - READ (Str,*,IOSTAT=IOS) ( Ary(Ind), Ind=1,AryLen ) - - ! Dedicated "CheckIOS" - IF ( IOS < 0 ) THEN - write(ErrMsg,'(A,I0,A)') 'End of line reached while trying to read ',AryLen,' value from string:`'//trim(Str)//'`' - ErrStat = ErrID_Fatal - ELSE IF ( IOS > 0 ) THEN - write(ErrMsg,'(A,I0,A)') 'Unexpected error while trying to read ',AryLen,' value from string:`'//trim(Str)//'`' - ELSE - ErrMsg='' - ErrStat = ErrID_None - END IF - IF (ErrStat >= AbortErrLev) RETURN - IF ( PRESENT(UnEc) ) THEN - IF ( UnEc > 0 ) & - WRITE (UnEc,Ec_ReAryFrmt) TRIM( AryName ), AryDescr, ( Ary(Ind), Ind=1,MIN(AryLen,NWTC_MaxAryLen) ) - END IF - RETURN - END SUBROUTINE ReadR16AryFromStr -!======================================================================= -!> \copydoc nwtc_io::readcarylines - SUBROUTINE ReadR4AryLines ( UnIn, Fil, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc ) - - ! Argument declarations: - - INTEGER, INTENT(IN) :: AryLen ! Length of the array. - INTEGER, INTENT(IN) :: UnIn ! I/O unit for input file. - INTEGER, INTENT(IN), OPTIONAL:: UnEc ! I/O unit for echo file. If present and > 0, write to UnEc - INTEGER, INTENT(OUT) :: ErrStat ! Error status - CHARACTER(*), INTENT(OUT) :: ErrMsg ! Error message associated with ErrStat - - REAL(SiKi), INTENT(OUT) :: Ary(AryLen) ! Real (4-byte) array being read. - - CHARACTER(*), INTENT(IN) :: Fil ! Name of the input file. - CHARACTER(*), INTENT(IN) :: AryDescr ! Text string describing the variable. - CHARACTER(*), INTENT(IN) :: AryName ! Text string containing the variable name. - - - ! Local declarations: - - INTEGER :: Ind ! Index into the real array. Assumed to be one digit. - INTEGER :: IOS ! I/O status returned from the read statement. - - - - ErrStat = ErrID_None - ErrMsg = "" - - DO Ind=1,AryLen - READ (UnIn,*,IOSTAT=IOS) Ary(Ind) - - CALL CheckIOS ( IOS, Fil, TRIM( AryName )//'('//TRIM( Num2LStr( Ind ) )//')', NumType, ErrStat, ErrMsg ) - IF (ErrStat >= AbortErrLev) RETURN - CALL CheckRealVar( Ary(Ind), AryName, ErrStat, ErrMsg) - IF (ErrStat >= AbortErrLev) RETURN - - IF ( PRESENT(UnEc) ) THEN - IF ( UnEc > 0 ) & - WRITE (UnEc,Ec_ReFrmt) Ary(Ind), TRIM( AryName )//'('//TRIM( Int2LStr( Ind ) )//')', AryDescr - END IF - END DO + IF ( PRESENT(UnEc) ) THEN + IF ( UnEc > 0 ) & + WRITE (UnEc,Ec_ReFrmt) Ary(Ind), TRIM( AryName )//'('//TRIM( Int2LStr( Ind ) )//')', AryDescr + END IF + END DO RETURN END SUBROUTINE ReadR4AryLines @@ -6789,55 +6203,6 @@ SUBROUTINE ReadR8AryLines ( UnIn, Fil, Ary, AryLen, AryName, AryDescr, ErrStat, RETURN END SUBROUTINE ReadR8AryLines !======================================================================= -!> \copydoc nwtc_io::readcarylines - SUBROUTINE ReadR16AryLines ( UnIn, Fil, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc ) - - - ! This routine reads a AryLen values into a real array from the next AryLen lines of the input file. - - - ! Argument declarations: - - INTEGER, INTENT(IN) :: AryLen ! Length of the array. - INTEGER, INTENT(IN) :: UnIn ! I/O unit for input file. - INTEGER, INTENT(IN), OPTIONAL:: UnEc ! I/O unit for echo file. If present and > 0, write to UnEc - INTEGER, INTENT(OUT) :: ErrStat ! Error status - CHARACTER(*), INTENT(OUT) :: ErrMsg ! Error message associated with ErrStat - - REAL(QuKi), INTENT(OUT) :: Ary(AryLen) ! Real (16-byte) array being read. - - CHARACTER(*), INTENT(IN) :: Fil ! Name of the input file. - CHARACTER(*), INTENT(IN) :: AryDescr ! Text string describing the variable. - CHARACTER(*), INTENT(IN) :: AryName ! Text string containing the variable name. - - - ! Local declarations: - - INTEGER :: Ind ! Index into the real array. Assumed to be one digit. - INTEGER :: IOS ! I/O status returned from the read statement. - - - - ErrStat = ErrID_None - ErrMsg = "" - - DO Ind=1,AryLen - READ (UnIn,*,IOSTAT=IOS) Ary(Ind) - - CALL CheckIOS ( IOS, Fil, TRIM( AryName )//'('//TRIM( Num2LStr( Ind ) )//')', NumType, ErrStat, ErrMsg ) - IF (ErrStat >= AbortErrLev) RETURN - CALL CheckRealVar( Ary(Ind), AryName, ErrStat, ErrMsg) - IF (ErrStat >= AbortErrLev) RETURN - - IF ( PRESENT(UnEc) ) THEN - IF ( UnEc > 0 ) & - WRITE (UnEc,Ec_ReFrmt) Ary(Ind), TRIM( AryName )//'('//TRIM( Int2LStr( Ind ) )//')', AryDescr - END IF - END DO - - RETURN - END SUBROUTINE ReadR16AryLines -!======================================================================= !> \copydoc nwtc_io::readcvar !! WARNING: this routine limits the size of the number being read to 30 characters SUBROUTINE ReadR4Var ( UnIn, Fil, Var, VarName, VarDescr, ErrStat, ErrMsg, UnEc ) @@ -6893,8 +6258,8 @@ SUBROUTINE ReadR4VarWDefault ( UnIn, Fil, Var, VarName, VarDescr, VarDefault, Er ! Argument declarations: - REAL(SiKi), INTENT(OUT) :: Var ! Variable being read - REAL(SiKi), INTENT(IN ) :: VarDefault ! Default value for variable being read + REAL(R4Ki), INTENT(OUT) :: Var ! Variable being read + REAL(R4Ki), INTENT(IN ) :: VarDefault ! Default value for variable being read INTEGER(IntKi),INTENT(OUT) :: ErrStat ! Error status; if present, program does not abort on error CHARACTER(*), INTENT(OUT) :: ErrMsg ! Error message @@ -7032,107 +6397,6 @@ SUBROUTINE ReadR8VarWDefault ( UnIn, Fil, Var, VarName, VarDescr, VarDefault, Er RETURN END SUBROUTINE ReadR8VarWDefault !======================================================================= -!> \copydoc nwtc_io::readcvar -!! WARNING: this routine limits the size of the number being read to 30 characters - SUBROUTINE ReadR16Var ( UnIn, Fil, Var, VarName, VarDescr, ErrStat, ErrMsg, UnEc ) - - - ! This routine reads a single double (real) variable from the next line of the input file. - ! New code should call ReadVar instead of directly calling this routine. - - - ! Argument declarations: - - REAL(QuKi), INTENT(OUT) :: Var ! Real (16-byte) variable being read. - INTEGER(IntKi),INTENT(OUT),OPTIONAL:: ErrStat ! Error status; if present, program does not abort on error - CHARACTER(*), INTENT(OUT),OPTIONAL:: ErrMsg ! Error message - - INTEGER, INTENT(IN) :: UnIn ! I/O unit for input file. - INTEGER, INTENT(IN), OPTIONAL:: UnEc ! I/O unit for echo file. If present and > 0, write to UnEc - - CHARACTER( *), INTENT(IN) :: Fil ! Name of the input file. - CHARACTER( *), INTENT(IN) :: VarDescr ! Text string describing the variable. - CHARACTER( *), INTENT(IN) :: VarName ! Text string containing the variable name. - - - ! Local declarations: - - INTEGER :: IOS ! I/O status returned from the read statement. - - CHARACTER(30) :: Word ! String to hold the first word on the line. - - - - - CALL ReadNum ( UnIn, Fil, Word, VarName, ErrStat, ErrMsg ) - IF ( ErrStat >= AbortErrLev) RETURN ! If we're about to read a T/F and treat it as a number, we have a less severe ErrStat - - - READ (Word,*,IOSTAT=IOS) Var - - CALL CheckIOS ( IOS, Fil, VarName, NumType, ErrStat, ErrMsg ) - IF (ErrStat >= AbortErrLev) RETURN - CALL CheckRealVar( Var, VarName, ErrStat, ErrMsg) - IF (ErrStat >= AbortErrLev) RETURN - - IF ( PRESENT(UnEc) ) THEN - IF ( UnEc > 0 ) & - WRITE (UnEc,Ec_ReFrmt) Var, VarName, VarDescr - END IF - - - RETURN - END SUBROUTINE ReadR16Var -!======================================================================= -!> \copydoc nwtc_io::readr4varwdefault - SUBROUTINE ReadR16VarWDefault ( UnIn, Fil, Var, VarName, VarDescr, VarDefault, ErrStat, ErrMsg, UnEc ) - - ! Argument declarations: - - REAL(QuKi), INTENT(OUT) :: Var !< Variable being read - REAL(QuKi), INTENT(IN ) :: VarDefault !< Default value for variable being read - - INTEGER(IntKi),INTENT(OUT) :: ErrStat !< Error status; if present, program does not abort on error - CHARACTER(*), INTENT(OUT) :: ErrMsg !< Error message - - INTEGER, INTENT(IN) :: UnIn !< I/O unit for input file. - INTEGER, INTENT(IN), OPTIONAL:: UnEc !< I/O unit for echo file. If present and > 0, write to UnEc - - CHARACTER( *), INTENT(IN) :: Fil !< Name of the input file. - CHARACTER( *), INTENT(IN) :: VarDescr !< Text string describing the variable. - CHARACTER( *), INTENT(IN) :: VarName !< Text string containing the variable name. - - - ! Local declarations: - - INTEGER :: IOS ! I/O status returned from the read statement. - CHARACTER(30) :: Word ! String to hold the first word on the line. - - - CALL ReadNum ( UnIn, Fil, Word, VarName, ErrStat, ErrMsg ) - IF ( ErrStat >= AbortErrLev) RETURN ! If we're about to read a T/F and treat it as a number, we have a less severe ErrStat - - - CALL Conv2UC( Word ) - IF ( INDEX(Word, "DEFAULT" ) /= 1 ) THEN ! If it's not "default", read this variable; otherwise use the DEFAULT value - READ (Word,*,IOSTAT=IOS) Var - - CALL CheckIOS ( IOS, Fil, VarName, NumType, ErrStat, ErrMsg ) - IF (ErrStat >= AbortErrLev) RETURN - CALL CheckRealVar( Var, VarName, ErrStat, ErrMsg) - IF (ErrStat >= AbortErrLev) RETURN - ELSE - Var = VarDefault - END IF - - IF ( PRESENT(UnEc) ) THEN - IF ( UnEc > 0 ) & - WRITE (UnEc,Ec_ReFrmt) Var, VarName, VarDescr - END IF - - RETURN - END SUBROUTINE ReadR16VarWDefault -!======================================================================= !> \copydoc nwtc_io::readr4varwdefault SUBROUTINE ReadIAryWDefault ( UnIn, Fil, Var, AryLen, VarName, VarDescr, VarDefault, ErrStat, ErrMsg, UnEc ) ! Argument declarations: @@ -8019,36 +7283,6 @@ SUBROUTINE WrMatrix1R8( A, Un, ReFmt, MatName ) RETURN END SUBROUTINE WrMatrix1R8 !======================================================================= -!> \copydoc nwtc_io::wrmatrix1r4 - SUBROUTINE WrMatrix1R16( A, Un, ReFmt, MatName ) - - REAL(QuKi), INTENT(IN) :: A(:) - INTEGER, INTENT(IN) :: Un - CHARACTER(*), INTENT(IN) :: ReFmt ! Format for printing ReKi numbers - CHARACTER(*), OPTIONAL, INTENT(IN) :: MatName - - INTEGER :: ErrStat - INTEGER :: nr ! size (rows and columns) of A - CHARACTER(256) :: Fmt - - - nr = SIZE(A,1) - - IF ( PRESENT(MatName) ) THEN - WRITE( Un, '(A,": ",A," x ",A)', IOSTAT=ErrStat ) TRIM(MatName), TRIM(Num2LStr(nr)), "1" - END IF - - Fmt = "(2x, "//TRIM(Num2LStr(nr))//"(1x,"//ReFmt//"))" - - WRITE( Un, Fmt, IOSTAT=ErrStat ) A(:) - IF (ErrStat /= 0) THEN - CALL WrScr('Error '//TRIM(Num2LStr(ErrStat))//' writing matrix in WrMatrix1R16().') - RETURN - END IF - - RETURN - END SUBROUTINE WrMatrix1R16 -!======================================================================= !> \copydoc nwtc_io::wrmatrix1r4 SUBROUTINE WrMatrix2R4( A, Un, ReFmt, MatName ) @@ -8121,42 +7355,6 @@ SUBROUTINE WrMatrix2R8( A, Un, ReFmt, MatName ) RETURN END SUBROUTINE WrMatrix2R8 !======================================================================= -!> \copydoc nwtc_io::wrmatrix1r4 - SUBROUTINE WrMatrix2R16( A, Un, ReFmt, MatName ) - - REAL(QuKi), INTENT(IN) :: A(:,:) - INTEGER, INTENT(IN) :: Un - CHARACTER(*), INTENT(IN) :: ReFmt ! Format for printing ReKi numbers - CHARACTER(*), OPTIONAL, INTENT(IN) :: MatName - - INTEGER :: ErrStat - INTEGER :: nr, nc ! size (rows and columns) of A - INTEGER :: i ! indices into A - CHARACTER(256) :: Fmt - - - nr = SIZE(A,1) - nc = SIZE(A,2) - - IF ( PRESENT(MatName) ) THEN - WRITE( Un, '(A,": ",A," x ",A)', IOSTAT=ErrStat ) TRIM(MatName), TRIM(Num2LStr(nr)), TRIM(Num2LStr(nc)) - END IF - - Fmt = "(2x, "//TRIM(Num2LStr(nc))//"(1x,"//ReFmt//"))" - - DO i=1,nr - WRITE( Un, Fmt, IOSTAT=ErrStat ) A(i,:) - IF (ErrStat /= 0) THEN - CALL WrScr('Error '//TRIM(Num2LStr(ErrStat))//' writing matrix in WrMatrix2R16().') - RETURN - END IF - - - END DO - - RETURN - END SUBROUTINE WrMatrix2R16 -!======================================================================= !> Based on nwtc_io::wrmatrix, this routine writes a matrix to an already-open text file. It allows !! the user to omit rows and columns of A in the the file. !! Use WrPartialMatrix (nwtc_io::wrpartialmatrix) instead of directly calling a specific routine in the generic interface. @@ -8489,46 +7687,6 @@ SUBROUTINE WrR8AryFileNR ( Unit, Ary, Fmt, ErrStat, ErrMsg ) RETURN END SUBROUTINE WrR8AryFileNR !======================================================================= -!> \copydoc nwtc_io::wrr4aryfilenr - SUBROUTINE WrR16AryFileNR ( Unit, Ary, Fmt, ErrStat, ErrMsg ) - - ! Argument declarations. - - INTEGER, INTENT(IN) :: Unit ! I/O unit for input file. - REAL(QuKi), INTENT(IN) :: Ary (:) ! Array to be written without a newline at the end. - CHARACTER(*), INTENT(IN) :: Fmt ! Fmt of one element to be written. - - INTEGER(IntKi), INTENT(OUT) :: ErrStat ! Error status - CHARACTER(*), INTENT(OUT) :: ErrMsg ! Error message associated with ErrStat - - ! Local variables: - CHARACTER(50) :: Fmt2 ! Fmt of entire array to be written (will be copied). - - - - IF ( SIZE(Ary) == 0 ) THEN - ErrStat = ErrID_None - ErrMsg = '' - RETURN - END IF - - - WRITE(Fmt2,*) SIZE(Ary) - Fmt2 = '('//TRIM(Fmt2)//'('//TRIM(Fmt)//'))' - - WRITE (Unit,Fmt2,ADVANCE='NO',IOSTAT=ErrStat) Ary - IF ( ErrStat /= 0 ) THEN - ErrStat = ErrID_Fatal - ErrMsg = 'WrR16AryFileNR:Error '//TRIM(Num2LStr(ErrStat))//' occurred while writing to file using this format: '//TRIM(Fmt2) - ELSE - ErrStat = ErrID_None - ErrMsg = '' - END IF - - - RETURN - END SUBROUTINE WrR16AryFileNR -!======================================================================= !> This routine writes out a string to the screen. RECURSIVE SUBROUTINE WrScr ( InStr ) diff --git a/modules/nwtc-library/src/NWTC_Num.f90 b/modules/nwtc-library/src/NWTC_Num.f90 index a434de2ab7..de4fcd8def 100644 --- a/modules/nwtc-library/src/NWTC_Num.f90 +++ b/modules/nwtc-library/src/NWTC_Num.f90 @@ -69,11 +69,9 @@ MODULE NWTC_Num REAL(SiKi) :: Pi_R4 !< Ratio of a circle's circumference to its diameter in 4-byte precision REAL(R8Ki) :: Pi_R8 !< Ratio of a circle's circumference to its diameter in 8-byte precision - REAL(QuKi) :: Pi_R16 !< Ratio of a circle's circumference to its diameter in 16-byte precision REAL(SiKi) :: TwoPi_R4 !< 2*pi in 4-byte precision REAL(R8Ki) :: TwoPi_R8 !< 2*pi in 8-byte precision - REAL(QuKi) :: TwoPi_R16 !< 2*pi in 16-byte precision ! constants for kernel smoothing INTEGER, PARAMETER :: kernelType_EPANECHINIKOV = 1 @@ -96,14 +94,12 @@ MODULE NWTC_Num INTERFACE EqualRealNos MODULE PROCEDURE EqualRealNos4 MODULE PROCEDURE EqualRealNos8 - MODULE PROCEDURE EqualRealNos16 END INTERFACE !> \copydoc nwtc_num::eulerconstructr4() INTERFACE EulerConstruct MODULE PROCEDURE EulerConstructR4 MODULE PROCEDURE EulerConstructR8 - MODULE PROCEDURE EulerConstructR16 END INTERFACE INTERFACE EulerConstructZYX @@ -114,7 +110,6 @@ MODULE NWTC_Num INTERFACE EulerExtract MODULE PROCEDURE EulerExtractR4 MODULE PROCEDURE EulerExtractR8 - MODULE PROCEDURE EulerExtractR16 END INTERFACE !> \copydoc nwtc_num::taitbryanyxzextractr4() @@ -122,20 +117,17 @@ MODULE NWTC_Num INTERFACE TaitBryanYXZExtract MODULE PROCEDURE TaitBryanYXZExtractR4 MODULE PROCEDURE TaitBryanYXZExtractR8 - MODULE PROCEDURE TaitBryanYXZExtractR16 END INTERFACE INTERFACE TaitBryanYXZConstruct MODULE PROCEDURE TaitBryanYXZConstructR4 MODULE PROCEDURE TaitBryanYXZConstructR8 - MODULE PROCEDURE TaitBryanYXZConstructR16 END INTERFACE !> \copydoc nwtc_num::outerproductr4 INTERFACE OuterProduct MODULE PROCEDURE OuterProductR4 MODULE PROCEDURE OuterProductR8 - MODULE PROCEDURE OuterProductR16 END INTERFACE !> \copydoc nwtc_num::cross_productr4() @@ -144,12 +136,10 @@ MODULE NWTC_Num MODULE PROCEDURE Cross_ProductR4R8 MODULE PROCEDURE Cross_ProductR8 MODULE PROCEDURE Cross_ProductR8R4 - MODULE PROCEDURE Cross_ProductR16 END INTERFACE !> \copydoc nwtc_num::smllrottransd() INTERFACE SmllRotTrans - MODULE PROCEDURE SmllRotTransDD MODULE PROCEDURE SmllRotTransD MODULE PROCEDURE SmllRotTransR END INTERFACE @@ -164,21 +154,18 @@ MODULE NWTC_Num INTERFACE Zero2TwoPi MODULE PROCEDURE Zero2TwoPiR4 MODULE PROCEDURE Zero2TwoPiR8 - MODULE PROCEDURE Zero2TwoPiR16 END INTERFACE !> \copydoc nwtc_num::twonormr4 INTERFACE TwoNorm MODULE PROCEDURE TwoNormR4 MODULE PROCEDURE TwoNormR8 - MODULE PROCEDURE TwoNormR16 END INTERFACE !> \copydoc nwtc_num::tracer4 INTERFACE trace MODULE PROCEDURE traceR4 MODULE PROCEDURE traceR8 - MODULE PROCEDURE traceR16 END INTERFACE !> \copydoc nwtc_num::dcm_expd @@ -217,18 +204,15 @@ MODULE NWTC_Num INTERFACE InterpStp MODULE PROCEDURE InterpStpComp4 MODULE PROCEDURE InterpStpComp8 - MODULE PROCEDURE InterpStpComp16 MODULE PROCEDURE InterpStpReal4 MODULE PROCEDURE InterpStpReal4_8 MODULE PROCEDURE InterpStpReal8 - MODULE PROCEDURE InterpStpReal16 END INTERFACE !> \copydoc nwtc_num::interparrayr4 INTERFACE InterpArray MODULE PROCEDURE InterpArrayR4 MODULE PROCEDURE InterpArrayR8 - MODULE PROCEDURE InterpArrayR16 END INTERFACE !> \copydoc nwtc_num::interpwrappedstpreal4 @@ -236,51 +220,42 @@ MODULE NWTC_Num MODULE PROCEDURE InterpWrappedStpReal4 MODULE PROCEDURE InterpWrappedStpReal4_8 MODULE PROCEDURE InterpWrappedStpReal8 - MODULE PROCEDURE InterpWrappedStpReal16 END INTERFACE !> \copydoc nwtc_num::locatestpr4 INTERFACE LocateStp MODULE PROCEDURE LocateStpR4 MODULE PROCEDURE LocateStpR8 - MODULE PROCEDURE LocateStpR16 END INTERFACE !> \copydoc nwtc_num::skewsymmatr4 INTERFACE SkewSymMat MODULE PROCEDURE SkewSymMatR4 MODULE PROCEDURE SkewSymMatR8 - MODULE PROCEDURE SkewSymMatR16 END INTERFACE !> \copydoc nwtc_num::angle_extrapinterp2_r4 INTERFACE Angles_ExtrapInterp MODULE PROCEDURE Angles_ExtrapInterp1_R4 MODULE PROCEDURE Angles_ExtrapInterp1_R8 - MODULE PROCEDURE Angles_ExtrapInterp1_R16 MODULE PROCEDURE Angles_ExtrapInterp1_R4R MODULE PROCEDURE Angles_ExtrapInterp1_R8R - MODULE PROCEDURE Angles_ExtrapInterp1_R16R MODULE PROCEDURE Angles_ExtrapInterp2_R4 MODULE PROCEDURE Angles_ExtrapInterp2_R8 - MODULE PROCEDURE Angles_ExtrapInterp2_R16 MODULE PROCEDURE Angles_ExtrapInterp2_R4R MODULE PROCEDURE Angles_ExtrapInterp2_R8R - MODULE PROCEDURE Angles_ExtrapInterp2_R16R END INTERFACE !> \copydoc nwtc_num::addorsub2pi_r4 INTERFACE AddOrSub2Pi MODULE PROCEDURE AddOrSub2Pi_R4 MODULE PROCEDURE AddOrSub2Pi_R8 - MODULE PROCEDURE AddOrSub2Pi_R16 END INTERFACE !> \copydoc nwtc_num::mpi2pi_r4 INTERFACE MPi2Pi MODULE PROCEDURE MPi2Pi_R4 MODULE PROCEDURE MPi2Pi_R8 - MODULE PROCEDURE MPi2Pi_R16 END INTERFACE CONTAINS @@ -354,36 +329,6 @@ SUBROUTINE AddOrSub2Pi_R8 ( OldAngle, NewAngle ) RETURN END SUBROUTINE AddOrSub2Pi_R8 -!======================================================================= -!> \copydoc nwtc_num::addorsub2pi_r4 - SUBROUTINE AddOrSub2Pi_R16 ( OldAngle, NewAngle ) - - ! Argument declarations: - - REAL(QuKi), INTENT(IN ) :: OldAngle ! Angle from which NewAngle will be converted to within 2*Pi of, rad. - REAL(QuKi), INTENT(INOUT) :: NewAngle ! Angle to be converted to within 2*Pi of OldAngle, rad. - - - ! Local declarations: - - REAL(QuKi) :: DelAngle ! The difference between OldAngle and NewAngle, rad. - - - - ! Add or subtract 2*Pi in order to convert NewAngle two within Pi of OldAngle: - - - DelAngle = OldAngle - NewAngle - - DO WHILE ( ABS( DelAngle ) > Pi_R16 ) - - NewAngle = NewAngle + SIGN( TwoPi_R16, DelAngle ) - DelAngle = OldAngle - NewAngle - - END DO - - RETURN - END SUBROUTINE AddOrSub2Pi_R16 !======================================================================= FUNCTION BlendCosine( x, LowerBound, UpperBound ) RESULT(S) @@ -619,26 +564,6 @@ FUNCTION Cross_ProductR8R4(Vector1, Vector2) result(CProd) RETURN END FUNCTION Cross_ProductR8R4 !======================================================================= -!> \copydoc nwtc_num::cross_productr4 - FUNCTION Cross_ProductR16(Vector1, Vector2) result(CProd) - - ! Argument declarations. - - REAL(QuKi), INTENT(IN ) :: Vector1 (3) - REAL(QuKi), INTENT(IN ) :: Vector2 (3) - - ! Function definition - REAL(QuKi) :: CProd (3) ! = Vector1 X Vector2 (resulting in a vector) - - - CProd(1) = Vector1(2)*Vector2(3) - Vector1(3)*Vector2(2) - CProd(2) = Vector1(3)*Vector2(1) - Vector1(1)*Vector2(3) - CProd(3) = Vector1(1)*Vector2(2) - Vector1(2)*Vector2(1) - - - RETURN - END FUNCTION Cross_ProductR16 -!======================================================================= !> This routine calculates the parameters needed to compute a irregularly-spaced natural cubic spline. !! Natural cubic splines are used in that the curvature at the end points is zero. !! This routine does not require that the XAry be regularly spaced. @@ -1225,14 +1150,14 @@ FUNCTION DCM_expR(lambda) ! ! "'Interpolation' of DCMs", M.A. Sprague, 11 March 2014, Eq. 31-33 - REAL(ReKi), INTENT(IN) :: lambda(3) !< vector containing unique components of skew-symmetric matrix: \f$\lambda_1\f$, \f$\lambda_2\f$, and \f$\lambda_3\f$ - REAL(ReKi) :: DCM_expR(3,3) !< the computed matrix exponential, \f$\Lambda\f$ + REAL(SiKi), INTENT(IN) :: lambda(3) !< vector containing unique components of skew-symmetric matrix: \f$\lambda_1\f$, \f$\lambda_2\f$, and \f$\lambda_3\f$ + REAL(SiKi) :: DCM_expR(3,3) !< the computed matrix exponential, \f$\Lambda\f$ ! local variables - REAL(ReKi) :: stheta ! sine of angle of rotation - REAL(ReKi) :: theta ! angle of rotation - REAL(ReKi) :: theta2 ! angle of rotation squared - REAL(ReKi) :: tmp_Mat(3,3) + REAL(SiKi) :: stheta ! sine of angle of rotation + REAL(SiKi) :: theta ! angle of rotation + REAL(SiKi) :: theta2 ! angle of rotation squared + REAL(SiKi) :: tmp_Mat(3,3) INTEGER(IntKi) :: ErrStat CHARACTER(30) :: ErrMsg @@ -1241,8 +1166,8 @@ FUNCTION DCM_expR(lambda) theta = TwoNorm(lambda) ! Eq. 32 theta2 = theta**2 - IF ( EqualRealNos(theta, 0.0_ReKi) .or. & - EqualRealNos(theta2, 0.0_ReKi) ) THEN ! + IF ( EqualRealNos(theta, 0.0_SiKi) .or. & + EqualRealNos(theta2, 0.0_SiKi) ) THEN ! CALL eye(DCM_expR, ErrStat, ErrMsg) ! Eq. 33a @@ -1250,15 +1175,15 @@ FUNCTION DCM_expR(lambda) ! convert lambda to skew-symmetric matrix: !tmp_mat = -SkewSymMat(lambda) - tmp_mat(1,1) = 0.0_ReKi + tmp_mat(1,1) = 0.0_SiKi tmp_mat(2,1) = -lambda(3) tmp_mat(3,1) = lambda(2) tmp_mat(1,2) = lambda(3) - tmp_mat(2,2) = 0.0_ReKi + tmp_mat(2,2) = 0.0_SiKi tmp_mat(3,2) = -lambda(1) tmp_mat(1,3) = -lambda(2) tmp_mat(2,3) = lambda(1) - tmp_mat(3,3) = 0.0_ReKi + tmp_mat(3,3) = 0.0_SiKi ! Eq. 33b @@ -1437,18 +1362,18 @@ SUBROUTINE DCM_logMapR(DCM, logMap, ErrStat, ErrMsg, thetaOut) ! This function computes the logarithmic map for a direction cosine matrix. - REAL(ReKi), INTENT(IN) :: DCM(3,3) - REAL(ReKi), INTENT( OUT) :: logMap(3) - REAL(ReKi),OPTIONAL,INTENT( OUT) :: thetaOut + REAL(SiKi), INTENT(IN) :: DCM(3,3) + REAL(SiKi), INTENT( OUT) :: logMap(3) + REAL(SiKi),OPTIONAL,INTENT( OUT) :: thetaOut INTEGER(IntKi), INTENT( OUT) :: ErrStat ! Error status of the operation CHARACTER(*), INTENT( OUT) :: ErrMsg ! Error message if ErrStat /= ErrID_None ! local variables - REAL(ReKi) :: cosTheta - REAL(ReKi) :: theta - REAL(ReKi) :: TwoSinTheta - REAL(ReKi) :: v(3) - REAL(ReKi) :: divisor + REAL(SiKi) :: cosTheta + REAL(SiKi) :: theta + REAL(SiKi) :: TwoSinTheta + REAL(SiKi) :: v(3) + REAL(SiKi) :: divisor INTEGER(IntKi) :: indx_max ! initialization @@ -1456,13 +1381,13 @@ SUBROUTINE DCM_logMapR(DCM, logMap, ErrStat, ErrMsg, thetaOut) ErrMsg = "" - cosTheta = 0.5_ReKi*( trace(DCM) - 1.0_ReKi ) - cosTheta = min( max(cosTheta,-1.0_ReKi), 1.0_ReKi ) !make sure it's in a valid range (to avoid cases where this is slightly outside the +/-1 range) + cosTheta = 0.5_SiKi*( trace(DCM) - 1.0_SiKi ) + cosTheta = min( max(cosTheta,-1.0_SiKi), 1.0_SiKi ) !make sure it's in a valid range (to avoid cases where this is slightly outside the +/-1 range) theta = ACOS( cosTheta ) ! Eq. 25 ( 0<=theta<=pi ) !IF ( EqualRealNos( pi, theta ) ) THEN - IF ( theta > 3.1_ReKi ) THEN ! theta/(2*sin(theta)) blows up quickly as theta approaches pi, + IF ( theta > 3.1_SiKi ) THEN ! theta/(2*sin(theta)) blows up quickly as theta approaches pi, ! so I'm putting a pretty large tolerance on pi here, and using a different equation to find the solution near pi logMap(1) = 1.0_ReKi + DCM(1,1) - DCM(2,2) - DCM(3,3); @@ -1471,7 +1396,7 @@ SUBROUTINE DCM_logMapR(DCM, logMap, ErrStat, ErrMsg, thetaOut) indx_max = maxloc( abs(logMap), 1 ) - divisor = sqrt(abs( logMap(indx_max) * 2.0_ReKi*(1.0_ReKi - cosTheta) )) / theta ! 2*(1-cosTheta)/theta^2 * abs(lambda(indx_max)) + divisor = sqrt(abs( logMap(indx_max) * 2.0_SiKi*(1.0_SiKi - cosTheta) )) / theta ! 2*(1-cosTheta)/theta^2 * abs(lambda(indx_max)) if (indx_max == 1) then !logMap(1) = 1.0 + DCM(1,1) - DCM(2,2) - DCM(3,3) ! 2*(1-cosTheta)/theta^2 * lambda(1) * lambda(1) logMap(2) = DCM(1,2) + DCM(2,1) ! 2*(1-cosTheta)/theta^2 * lambda(1) * lambda(2) @@ -1490,20 +1415,20 @@ SUBROUTINE DCM_logMapR(DCM, logMap, ErrStat, ErrMsg, thetaOut) ! at this point we may have the wrong sign for logMap (though if theta==pi, it doesn't matter because we can change it in the DCM_setLogMapforInterp() routines) ! we'll do a little checking to see if we should change the sign: - IF ( EqualRealNos( pi, theta ) ) RETURN + IF ( EqualRealNos( Pi_S, theta ) ) RETURN v(1) = -DCM(3,2) + DCM(2,3) !-skewSym(3,2) v(2) = DCM(3,1) - DCM(1,3) ! skewSym(3,1) v(3) = -DCM(2,1) + DCM(1,2) !-skewSym(2,1) indx_max = maxloc( abs(v), 1 ) ! find component with largest magnitude - if ( .not. EqualRealNos( sign(1.0_ReKi,v(indx_max)), sign(1.0_ReKi,logMap(indx_max)) )) logMap = -logMap + if ( .not. EqualRealNos( sign(1.0_SiKi,v(indx_max)), sign(1.0_SiKi,logMap(indx_max)) )) logMap = -logMap ELSE - TwoSinTheta = 2.0_ReKi*sin(theta) + TwoSinTheta = 2.0_SiKi*sin(theta) - IF ( EqualRealNos(0.0_ReKi, theta) .or. EqualRealNos( 0.0_ReKi, TwoSinTheta ) ) THEN + IF ( EqualRealNos(0.0_SiKi, theta) .or. EqualRealNos( 0.0_SiKi, TwoSinTheta ) ) THEN !skewSym = DCM - TRANSPOSE(DCM) ! @@ -1514,7 +1439,7 @@ SUBROUTINE DCM_logMapR(DCM, logMap, ErrStat, ErrMsg, thetaOut) !logMap = 0.5_ReKi * logMap ! Eq. 26b with limit as x approaches 0 of (x/sin(x)) = 1 - logMap = 0.0_ReKi ! Eq. 26a + logMap = 0.0_SiKi ! Eq. 26a ELSE ! 0 < theta < pi @@ -1622,11 +1547,11 @@ SUBROUTINE DCM_SetLogMapForInterpR( tensor ) ! tensor*( 1 + TwoPi*k/TwoNorm(tensor) ) for any integer k - REAL(ReKi), INTENT(INOUT) :: tensor(:,:) + REAL(SiKi), INTENT(INOUT) :: tensor(:,:) - REAL(ReKi) :: diff1, diff2 ! magnitude-squared of difference between two adjacent values - REAL(ReKi) :: temp(3), temp1(3) ! difference between two tensors - REAL(ReKi) :: period(3) ! the period to add to the rotational parameters + REAL(SiKi) :: diff1, diff2 ! magnitude-squared of difference between two adjacent values + REAL(SiKi) :: temp(3), temp1(3) ! difference between two tensors + REAL(SiKi) :: period(3) ! the period to add to the rotational parameters INTEGER(IntKi) :: nc ! size of the tensors matrix INTEGER(IntKi) :: ic ! loop counters for each array dimension @@ -1637,7 +1562,7 @@ SUBROUTINE DCM_SetLogMapForInterpR( tensor ) diff1 = TwoNorm( tensor(:,ic) ) - if ( .NOT. EqualRealNos( diff1, 0.0_ReKi) ) then + if ( .NOT. EqualRealNos( diff1, 0.0_SiKi) ) then ! check if we're going around a 2pi boundary: period = tensor(:,ic) * ( Twopi/diff1 ) @@ -1755,40 +1680,6 @@ FUNCTION EqualRealNos8 ( ReNum1, ReNum2 ) END FUNCTION EqualRealNos8 !======================================================================= -!> \copydoc nwtc_num::equalrealnos4 - FUNCTION EqualRealNos16 ( ReNum1, ReNum2 ) - - ! passed variables - - REAL(QuKi), INTENT(IN ) :: ReNum1 ! the first real number to compare - REAL(QuKi), INTENT(IN ) :: ReNum2 ! the second real number to compare - - LOGICAL :: EqualRealNos16 !< .true. if and only if the numbers are almost equal - - ! local variables - REAL(QuKi), PARAMETER :: Eps = EPSILON(ReNum1) ! machine precision - REAL(QuKi), PARAMETER :: Tol = 100.0_QuKi*Eps / 2.0_QuKi ! absolute tolerance (ignore the last 2 significant digits) - - REAL(QuKi) :: Fraction - - - ! make sure we're never trying to get more precision than Tol - - Fraction = MAX( ABS(ReNum1+ReNum2), 1.0_QuKi ) - - - - ! determine if ReNum1 and ReNum2 are approximately equal - - IF ( ABS(ReNum1 - ReNum2) <= Fraction*Tol ) THEN ! the relative error - EqualRealNos16 = .TRUE. - ELSE - EqualRealNos16 = .FALSE. - ENDIF - - - END FUNCTION EqualRealNos16 -!======================================================================= !> This function creates a rotation matrix, M, from a 1-2-3 rotation !! sequence of the 3 Euler angles, \f$\theta_x\f$, \f$\theta_y\f$, and \f$\theta_z\f$, in radians. !! M represents a change of basis (from global to local coordinates; @@ -1902,57 +1793,6 @@ FUNCTION EulerConstructR8(theta) result(M) END FUNCTION EulerConstructR8 !======================================================================= -!> \copydoc nwtc_num::eulerconstructr4 - FUNCTION EulerConstructR16(theta) result(M) - - ! this function creates a rotation matrix, M, from a 1-2-3 rotation - ! sequence of the 3 Euler angles, theta_x, theta_y, and theta_z, in radians. - ! M represents a change of basis (from global to local coordinates; - ! not a physical rotation of the body). it is the inverse of EulerExtract(). - ! - ! M = R(theta_z) * R(theta_y) * R(theta_x) - ! = [ cz sz 0 | [ cy 0 -sy | [ 1 0 0 | - ! |-sz cz 0 | * | 0 1 0 | * | 0 cx sx | - ! | 0 0 1 ] | sy 0 cy ] | 0 -sx cx ] - ! = [ cy*cz cx*sz+sx*sy*cz sx*sz-cx*sy*cz | - ! |-cy*sz cx*cz-sx*sy*sz sx*cz+cx*sy*sz | - ! | sy -sx*cy cx*cy ] - ! where cz = cos(theta_z), sz = sin(theta_z), cy = cos(theta_y), etc. - - REAL(QuKi) :: M(3,3) ! rotation matrix M - REAL(QuKi), INTENT(IN) :: theta(3) ! the 3 rotation angles: theta_x, theta_y, theta_z - - REAL(QuKi) :: cx ! cos(theta_x) - REAL(QuKi) :: sx ! sin(theta_x) - REAL(QuKi) :: cy ! cos(theta_y) - REAL(QuKi) :: sy ! sin(theta_y) - REAL(QuKi) :: cz ! cos(theta_z) - REAL(QuKi) :: sz ! sin(theta_z) - - - cx = cos( theta(1) ) - sx = sin( theta(1) ) - - cy = cos( theta(2) ) - sy = sin( theta(2) ) - - cz = cos( theta(3) ) - sz = sin( theta(3) ) - - M(1,1) = cy*cz - M(2,1) = -cy*sz - M(3,1) = sy - - M(1,2) = cx*sz+sx*sy*cz - M(2,2) = cx*cz-sx*sy*sz - M(3,2) = -sx*cy - - M(1,3) = sx*sz-cx*sy*cz - M(2,3) = sx*cz+cx*sy*sz - M(3,3) = cx*cy - - END FUNCTION EulerConstructR16 -!======================================================================= !> if M is a rotation matrix from a 1-2-3 rotation sequence, this function returns !! the 3 Euler angles, \f$\theta_x\f$, \f$\theta_y\f$, and \f$\theta_z\f$ (in radians), that formed !! the matrix. M represents a change of basis (from global to local coordinates; @@ -2154,102 +1994,6 @@ FUNCTION EulerExtractR8(M) result(theta) END FUNCTION EulerExtractR8 -!======================================================================= -!> \copydoc nwtc_num::eulerextractr4 - FUNCTION EulerExtractR16(M) result(theta) - - ! if M is a rotation matrix from a 1-2-3 rotation sequence, this function returns - ! the 3 Euler angles, theta_x, theta_y, and theta_z (in radians), that formed - ! the matrix. M represents a change of basis (from global to local coordinates; - ! not a physical rotation of the body). M is the inverse of EulerConstruct(). - ! - ! M = R(theta_z) * R(theta_y) * R(theta_x) - ! = [ cz sz 0 | [ cy 0 -sy | [ 1 0 0 | - ! |-sz cz 0 | * | 0 1 0 | * | 0 cx sx | - ! | 0 0 1 ] | sy 0 cy ] | 0 -sx cx ] - ! = [ cy*cz cx*sz+sx*sy*cz sx*sz-cx*sy*cz | - ! |-cy*sz cx*cz-sx*sy*sz sx*cz+cx*sy*sz | - ! | sy -sx*cy cx*cy ] - ! where cz = cos(theta_z), sz = sin(theta_z), cy = cos(theta_y), etc. - ! - ! returned angles are in the range [-pi, pi] - - REAL(QuKi), INTENT(IN) :: M(3,3) ! rotation matrix M - REAL(QuKi) :: theta(3) ! the 3 rotation angles: theta_x, theta_y, theta_z - - REAL(QuKi) :: cx ! cos(theta_x) - REAL(QuKi) :: sx ! sin(theta_x) - REAL(QuKi) :: cy ! cos(theta_y) -! REAL(QuKi) :: sy ! sin(theta_y) - REAL(QuKi) :: cz ! cos(theta_z) - REAL(QuKi) :: sz ! sin(theta_z) - - ! use trig identity sz**2 + cz**2 = 1 to get abs(cy): - cy = sqrt( m(1,1)**2 + m(2,1)**2 ) -! cy = sqrt( m(3,3)**2 + m(3,2)**2 ) - - if ( EqualRealNos(cy,0.0_QuKi) ) then - !if ( cy < 16*epsilon(0.0_ReKi) ) then - - theta(2) = atan2( m(3,1), cy ) ! theta_y - - ! cy = 0 -> sy = +/- 1 - ! M = [ 0 cx*sz+/-sx*cz sx*sz-/+cx*cz | - ! | 0 cx*cz-/+sx*sz sx*cz+/-cx*sz | - ! |+/-1 0 0 ] - - ! gimbal lock allows us to choose theta_z = 0 - theta(3) = 0.0_QuKi ! theta_z - - ! which reduces the matrix to - ! M = [ 0 +/-sx -/+cx | - ! | 0 cx sx | - ! |+/-1 0 0 ] - - theta(1) = atan2( m(2,3), m(2,2) ) ! theta_x - - else - ! atan2( cy*sz, cy*cz ) - theta(3) = atan2( -m(2,1), m(1,1) ) ! theta_z - cz = cos( theta(3) ) - sz = sin( theta(3) ) - - ! get the appropriate sign for cy: - if ( EqualRealNos(cz, 0.0_QuKi) ) then - cy = sign( cy, -m(2,1)/sz ) - !cy = -m(2,1)/sz - else - cy = sign( cy, m(1,1)/cz ) - !cy = -m(1,1)/cz - end if - theta(2) = atan2( m(3,1), cy ) ! theta_y - - !theta(1) = atan2( -m(3,2), m(3,3) ) ! theta_x - - ! for numerical reasons, we're going to get theta_x using - ! M' = (R(theta_z) * R(theta_y))^T * M = R(theta_x) - ! = [ cy 0 sy | [ cz -sz 0 | [ 1 0 0 | - ! | 0 1 0 | * | sz cz 0 | * M = | 0 cx sx | - ! |-sy 0 cy ] | 0 0 1 ] | 0 -sx cx ] - ! = [ cy*cz -cy*sz sy | [ 1 0 0 | - ! | sz cz 0 | * M = | 0 cx sx | - ! |-sy*cz sy*sz cy ] | 0 -sx cx ] - ! taking M'(2,2) and M'(2,3) , we get cx and sx: - ! sz*m(1,2) + cz*m(2,2) = cx - ! sz*m(1,3) + cz*m(2,3) = sx - - cz = cos( theta(3) ) - sz = sin( theta(3) ) - - cx = sz*m(1,2) + cz*m(2,2) - sx = sz*m(1,3) + cz*m(2,3) - - theta(1) = atan2( sx, cx ) - - end if - - - END FUNCTION EulerExtractR16 !======================================================================= !> @@ -2303,7 +2047,7 @@ END FUNCTION EulerConstructZYXR8 SUBROUTINE Eye2( A, ErrStat, ErrMsg ) - REAL(ReKi), INTENT(INOUT) :: A (:,:) !< Array to set to the identity matrix (nr,nc,n) + REAL(SiKi), INTENT(INOUT) :: A (:,:) !< Array to set to the identity matrix (nr,nc,n) INTEGER(IntKi), INTENT(OUT) :: ErrStat !< Error level CHARACTER(*), INTENT(OUT) :: ErrMsg !< ErrMsg corresponding to ErrStat @@ -2325,11 +2069,11 @@ SUBROUTINE Eye2( A, ErrStat, ErrMsg ) END IF ! initialize to zero: - A = 0._ReKi + A = 0.0_SiKi ! set the diagonals to one: DO j = 1, MIN(nr,nc) ! the diagonal of the matrix - A(j,j) = 1._ReKi + A(j,j) = 1.0_SiKi END DO END SUBROUTINE Eye2 @@ -2376,7 +2120,7 @@ SUBROUTINE Eye3( A, ErrStat, ErrMsg ) ! Note that this also returns the "pseudo-identity" when A(:,:) ! is not square (i.e., nr/=nc). - REAL(ReKi), INTENT(INOUT) :: A (:,:,:) ! Array to set to the identity matrix (nr,nc,n) + REAL(SiKi), INTENT(INOUT) :: A (:,:,:) ! Array to set to the identity matrix (nr,nc,n) INTEGER(IntKi), INTENT(OUT) :: ErrStat ! Error level CHARACTER(*), INTENT(OUT) :: ErrMsg ! ErrMsg corresponding to ErrStat @@ -2400,12 +2144,12 @@ SUBROUTINE Eye3( A, ErrStat, ErrMsg ) END IF ! initialize to zero: - A = 0._ReKi + A = 0.0_SiKi ! set the diagonals to one: DO i = 1, n ! loop through the matrices DO j = 1, MIN(nr,nc) ! the diagonal of the matrix - A(j,j,i) = 1._ReKi + A(j,j,i) = 1.0_SiKi END DO END DO @@ -2757,21 +2501,21 @@ FUNCTION GetSmllRotAngsR ( DCMat, ErrStat, ErrMsg ) ! passed variables - REAL(ReKi), INTENT(IN ) :: DCMat (3,3) + REAL(SiKi), INTENT(IN ) :: DCMat (3,3) INTEGER, INTENT(OUT ) :: ErrStat ! a non-zero value indicates an error in the permutation matrix algorithm CHARACTER(*),INTENT(OUT ),OPTIONAL :: ErrMsg ! a non-zero value indicates an error in the permutation matrix algorithm - REAL(ReKi) :: GetSmllRotAngsR ( 3 ) + REAL(SiKi) :: GetSmllRotAngsR ( 3 ) ! local variables - REAL(ReKi) :: denom ! the denominator of the resulting matrix - REAL(ReKi), PARAMETER :: LrgAngle = 0.4_ReKi ! Threshold for when a small angle becomes large (about 23deg). This comes from: COS(SmllAngle) ~ 1/SQRT( 1 + SmllAngle^2 ) and SIN(SmllAngle) ~ SmllAngle/SQRT( 1 + SmllAngle^2 ) results in ~5% error when SmllAngle = 0.4rad. + REAL(SiKi) :: denom ! the denominator of the resulting matrix + REAL(SiKi), PARAMETER :: LrgAngle = 0.4_SiKi ! Threshold for when a small angle becomes large (about 23deg). This comes from: COS(SmllAngle) ~ 1/SQRT( 1 + SmllAngle^2 ) and SIN(SmllAngle) ~ SmllAngle/SQRT( 1 + SmllAngle^2 ) results in ~5% error when SmllAngle = 0.4rad. ! initialize output angles (just in case there is an error that prevents them from getting set) - GetSmllRotAngsR = 0.0_ReKi + GetSmllRotAngsR = 0.0_SiKi ErrStat = ErrID_None ErrMsg = "" @@ -2780,9 +2524,9 @@ FUNCTION GetSmllRotAngsR ( DCMat, ErrStat, ErrMsg ) GetSmllRotAngsR(2) = DCMat(3,1) - DCMat(1,3) GetSmllRotAngsR(3) = DCMat(1,2) - DCMat(2,1) - denom = DCMat(1,1) + DCMat(2,2) + DCMat(3,3) - 1.0_ReKi + denom = DCMat(1,1) + DCMat(2,2) + DCMat(3,3) - 1.0_SiKi - IF ( .NOT. EqualRealNos( denom, 0.0_ReKi ) ) THEN + IF ( .NOT. EqualRealNos( denom, 0.0_SiKi ) ) THEN GetSmllRotAngsR = GetSmllRotAngsR / denom ! check that the angles are, in fact, small @@ -3255,66 +2999,7 @@ FUNCTION InterpStpComp8( XVal, XAry, YAry, Ind, AryLen ) RETURN END FUNCTION InterpStpComp8 -!======================================================================= -!> \copydoc nwtc_num::interpstpcomp4 - FUNCTION InterpStpComp16( XVal, XAry, YAry, Ind, AryLen ) - - ! Function declaration. - - COMPLEX(QuKi) :: InterpStpComp16 !< The interpolated value of Y at XVal - - ! Argument declarations. - - INTEGER, INTENT(IN) :: AryLen !< Length of the arrays. - INTEGER, INTENT(INOUT) :: Ind !< Initial and final index into the arrays. - - REAL(QuKi), INTENT(IN) :: XAry (AryLen) !< Array of X values to be interpolated. - REAL(QuKi), INTENT(IN) :: XVal !< X value to be interpolated. - - COMPLEX(QuKi), INTENT(IN) :: YAry (AryLen) !< Array of Y values to be interpolated. - - - - ! Let's check the limits first. - - IF ( XVal <= XAry(1) ) THEN - InterpStpComp16 = YAry(1) - Ind = 1 - RETURN - ELSE IF ( XVal >= XAry(AryLen) ) THEN - InterpStpComp16 = YAry(AryLen) - Ind = MAX(AryLen - 1, 1) - RETURN - END IF - - - ! Let's interpolate! - - Ind = MAX( MIN( Ind, AryLen-1 ), 1 ) - - DO - - IF ( XVal < XAry(Ind) ) THEN - - Ind = Ind - 1 - - ELSE IF ( XVal >= XAry(Ind+1) ) THEN - - Ind = Ind + 1 - - ELSE - - InterpStpComp16 = ( YAry(Ind+1) - YAry(Ind) )*( XVal - XAry(Ind) )/( XAry(Ind+1) - XAry(Ind) ) + YAry(Ind) - RETURN - - END IF - - END DO - - - RETURN - END FUNCTION InterpStpComp16 !======================================================================= !> \copydoc nwtc_num::interpstpcomp4 FUNCTION InterpStpReal4( XVal, XAry, YAry, Ind, AryLen ) @@ -3492,34 +3177,40 @@ FUNCTION InterpStpReal8( XVal, XAry, YAry, Ind, AryLen ) RETURN END FUNCTION InterpStpReal8 + !======================================================================= -!> \copydoc nwtc_num::interpstpcomp4 - FUNCTION InterpStpReal16( XVal, XAry, YAry, Ind, AryLen ) +!> This funtion returns a y-value array that corresponds to an input x-value by interpolating into the arrays. +!! It uses the passed index as the starting point and does a stepwise interpolation from there. This is +!! especially useful when the calling routines save the value from the last time this routine was called +!! for a given case where XVal does not change much from call to call. +!! It returns the first or last Y() row value if XVal is outside the limits of XAry(). + SUBROUTINE InterpStpMat( XVal, XAry, Y, Ind, AryLen, yInterp ) ! Function declaration. - REAL(QuKi) :: InterpStpReal16 !< The interpolated value of Y at XVal + REAL(ReKi), intent(out) :: yInterp(:) !< The interpolated value(s) of Y(dim=2) at XVal + ! Argument declarations. - INTEGER, INTENT(IN) :: AryLen ! Length of the arrays. - INTEGER, INTENT(INOUT) :: Ind ! Initial and final index into the arrays. + INTEGER, INTENT(IN) :: AryLen !< Length of the arrays. + INTEGER, INTENT(INOUT) :: Ind !< Initial and final index into the arrays. - REAL(QuKi), INTENT(IN) :: XAry (AryLen) ! Array of X values to be interpolated. - REAL(QuKi), INTENT(IN) :: XVal ! X value to be interpolated. - REAL(QuKi), INTENT(IN) :: YAry (AryLen) ! Array of Y values to be interpolated. + REAL(ReKi), INTENT(IN) :: XAry (AryLen) !< Array of X values to be interpolated. + REAL(ReKi), INTENT(IN) :: XVal !< X value to be interpolated. + REAL(ReKi), INTENT(IN) :: Y (:,:) !< Matrix of Y values to be interpolated; First dimension is AryLen. ! Let's check the limits first. IF ( XVal <= XAry(1) ) THEN - InterpStpReal16 = YAry(1) - Ind = 1 + yInterp = Y(1,:) + Ind = 1 RETURN ELSE IF ( XVal >= XAry(AryLen) ) THEN - InterpStpReal16 = YAry(AryLen) - Ind = MAX(AryLen - 1, 1) + yInterp = Y(AryLen,:) + Ind = MAX(AryLen - 1, 1) RETURN END IF @@ -3540,70 +3231,7 @@ FUNCTION InterpStpReal16( XVal, XAry, YAry, Ind, AryLen ) ELSE - InterpStpReal16 = ( YAry(Ind+1) - YAry(Ind) )*( XVal - XAry(Ind) )/( XAry(Ind+1) - XAry(Ind) ) + YAry(Ind) - RETURN - - END IF - - END DO - - - RETURN - END FUNCTION InterpStpReal16 -!======================================================================= -!> This funtion returns a y-value array that corresponds to an input x-value by interpolating into the arrays. -!! It uses the passed index as the starting point and does a stepwise interpolation from there. This is -!! especially useful when the calling routines save the value from the last time this routine was called -!! for a given case where XVal does not change much from call to call. -!! It returns the first or last Y() row value if XVal is outside the limits of XAry(). - SUBROUTINE InterpStpMat( XVal, XAry, Y, Ind, AryLen, yInterp ) - - ! Function declaration. - - REAL(ReKi), intent(out) :: yInterp(:) !< The interpolated value(s) of Y(dim=2) at XVal - - - ! Argument declarations. - - INTEGER, INTENT(IN) :: AryLen !< Length of the arrays. - INTEGER, INTENT(INOUT) :: Ind !< Initial and final index into the arrays. - - REAL(ReKi), INTENT(IN) :: XAry (AryLen) !< Array of X values to be interpolated. - REAL(ReKi), INTENT(IN) :: XVal !< X value to be interpolated. - REAL(ReKi), INTENT(IN) :: Y (:,:) !< Matrix of Y values to be interpolated; First dimension is AryLen. - - - - ! Let's check the limits first. - - IF ( XVal <= XAry(1) ) THEN - yInterp = Y(1,:) - Ind = 1 - RETURN - ELSE IF ( XVal >= XAry(AryLen) ) THEN - yInterp = Y(AryLen,:) - Ind = MAX(AryLen - 1, 1) - RETURN - END IF - - - ! Let's interpolate! - - Ind = MAX( MIN( Ind, AryLen-1 ), 1 ) - - DO - - IF ( XVal < XAry(Ind) ) THEN - - Ind = Ind - 1 - - ELSE IF ( XVal >= XAry(Ind+1) ) THEN - - Ind = Ind + 1 - - ELSE - - yInterp = ( Y(Ind+1,:) - Y(Ind,:) )*( XVal - XAry(Ind) )/( XAry(Ind+1) - XAry(Ind) ) + Y(Ind,:) + yInterp = ( Y(Ind+1,:) - Y(Ind,:) )*( XVal - XAry(Ind) )/( XAry(Ind+1) - XAry(Ind) ) + Y(Ind,:) RETURN END IF @@ -3925,40 +3553,6 @@ FUNCTION InterpWrappedStpReal8( XValIn, XAry, YAry, Ind, AryLen ) END FUNCTION InterpWrappedStpReal8 !======================================================================= -!> \copydoc nwtc_num::interpwrappedstpreal4 - FUNCTION InterpWrappedStpReal16( XValIn, XAry, YAry, Ind, AryLen ) - - ! Function declaration. - - REAL(QuKi) :: InterpWrappedStpReal16 !< The interpolated value of Y at XVal - - - ! Argument declarations. - - INTEGER, INTENT(IN) :: AryLen !< Length of the arrays. - INTEGER, INTENT(INOUT) :: Ind ! Initial and final index into the arrays. - - REAL(QuKi), INTENT(IN) :: XAry (AryLen) ! Array of X values to be interpolated. - REAL(QuKi), INTENT(IN) :: XValIn ! X value to be interpolated. - REAL(QuKi), INTENT(IN) :: YAry (AryLen) ! Array of Y values to be interpolated. - - REAL(QuKi) :: XVal ! X value to be interpolated. - - - - ! Wrap XValIn into the range XAry(1) to XAry(AryLen) - XVal = MOD(XValIn, XAry(AryLen)) - - ! Set the Ind to the first index if we are at the beginning of XAry - IF ( XVal <= XAry(2) ) THEN - Ind = 1 - END IF - - InterpWrappedStpReal16 = InterpStp( XVal, XAry, YAry, Ind, AryLen ) - - - END FUNCTION InterpWrappedStpReal16 -!======================================================================= !> This subroutine calculates interpolated values for an array of input values. !! The size of the xknown and yknown arrays must match, and the size of the !! xnew and ynew arrays must match. Xknown must be in ascending order. @@ -4044,47 +3638,6 @@ function interp_lin0(x,x0,x1,f0,f1) ! Linear interpolation function end function interp_lin0 END SUBROUTINE InterpArrayR8 !======================================================================= -!> \copydoc nwtc_num::interparrayr4 - SUBROUTINE InterpArrayR16( xknown, yknown, xnew, ynew ) - REAL(QuKi), INTENT(IN ) :: xknown(:) - REAL(QuKi), INTENT(IN ) :: yknown(:) - REAL(QuKi), INTENT(IN ) :: xnew(:) - REAL(QuKi), INTENT( OUT) :: ynew(:) - integer(IntKi) i,itmp,nknown - nknown=size(xknown) - do i=1,size(xnew) - itmp=minloc(abs(xnew(i)-xknown),dim=1) - if (itmp==nknown) then - if (xknown(itmp)>xnew(i)) then - ynew(i)=interp_lin0(xnew(i),xknown(itmp-1),xknown(itmp),yknown(itmp-1),yknown(itmp)) - else - ! The current x is above the max of xknown - ! extrapolation required, here fixed to upper bound - ynew(i)=yknown(nknown) - endif - elseif (xknown(itmp) This subroutine calculates the iosparametric coordinates, isopc, which is a value between -1 and 1 !! (for each dimension of a dataset), indicating where InCoord falls between posLo and posHi. !! It is used in InterpStpReal2D (nwtcnum::interpstpreal2d) and InterpStpReal3D (nwtcnum::interpstpreal3d). @@ -4420,54 +3973,6 @@ SUBROUTINE LocateStpR8( XVal, XAry, Ind, AryLen ) END SUBROUTINE LocateStpR8 !======================================================================= -!> \copydoc nwtc_num::locatestpr4 - SUBROUTINE LocateStpR16( XVal, XAry, Ind, AryLen ) - - ! Argument declarations. - - INTEGER, INTENT(IN) :: AryLen ! Length of the array. - INTEGER, INTENT(INOUT) :: Ind ! Initial and final index into the array. - - REAL(QuKi), INTENT(IN) :: XAry (AryLen) ! Array of X values to be interpolated. - REAL(QuKi), INTENT(IN) :: XVal ! X value to be interpolated. - - - - ! Let's check the limits first. - - IF ( XVal < XAry(1) ) THEN - Ind = 0 - ELSE IF ( XVal >= XAry(AryLen) ) THEN - Ind = AryLen - ELSE - - Ind = MAX( MIN( Ind, AryLen-1 ), 1 ) - - DO - - IF ( XVal < XAry(Ind) ) THEN - - Ind = Ind - 1 - - ELSE IF ( XVal >= XAry(Ind+1) ) THEN - - Ind = Ind + 1 - - ELSE - - RETURN - - END IF - - END DO - - - END IF - - RETURN - - END SUBROUTINE LocateStpR16 -!======================================================================= !> This routine calculates the mean value of an array. FUNCTION Mean ( Ary, AryLen ) @@ -4556,30 +4061,6 @@ SUBROUTINE MPi2Pi_R8 ( Angle ) RETURN END SUBROUTINE MPi2Pi_R8 !======================================================================= -!> \copydoc nwtc_num::mpi2pi_r4 - SUBROUTINE MPi2Pi_R16 ( Angle ) - - - ! Argument declarations: - - REAL(QuKi), INTENT(INOUT) :: Angle - - - ! Get the angle between 0 and 2Pi. - - Angle = MODULO( Angle, TwoPi_R16 ) - - - ! Get the angle between -Pi and Pi. - - IF ( Angle > Pi_R16 ) THEN - Angle = Angle - TwoPi_R16 - END IF - - - RETURN - END SUBROUTINE MPi2Pi_R16 -!======================================================================= !> This function takes an angle in radians and converts it to !! an angle in degrees in the range [-180,180] real(reKi) function Rad2M180to180Deg(Angle) result(Alpha) @@ -4649,27 +4130,6 @@ FUNCTION OuterProductR8(u,v) END FUNCTION OuterProductR8 !======================================================================= -!> \copydoc nwtc_num::outerproductr4 - FUNCTION OuterProductR16(u,v) - - ! this routine calculates the outer product of two vectors - - REAL(QuKi),INTENT(IN):: u(:),v(:) - REAL(QuKi)::OuterProductR16(SIZE(u),SIZE(v)) - - INTEGER(IntKi)::i,j,n1,n2 - - n1=SIZE(u) - n2=SIZE(v) - - DO i=1,n1 - DO j=1,n2 - OuterProductR16(i,j) = u(i) * v(j) - ENDDO - ENDDO - - END FUNCTION OuterProductR16 -!======================================================================= !> This subroutine perturbs an orientation matrix by a small angle. Two methods !! are used: !! small angle DCM: perturb small angles extracted from DCM @@ -5724,11 +5184,9 @@ SUBROUTINE SetConstants( ) Inv2Pi_S = 0.5_SiKi/Pi_S ! 1.0_SiKi/TwoPi_S Pi_R4 = ACOS( -1.0_SiKi ) Pi_R8 = ACOS( -1.0_R8Ki ) - Pi_R16 = ACOS( -1.0_QuKi ) TwoPi_R4 = Pi_R4 *2.0_SiKi TwoPi_R8 = Pi_R8 *2.0_R8Ki - TwoPi_R16 = Pi_R16*2.0_QuKi ! IEEE constants: CALL Set_IEEE_Constants( NaN_D, Inf_D, NaN, Inf, NaN_S, Inf_S ) @@ -5921,10 +5379,10 @@ SUBROUTINE SmllRotTransD( RotationType, Theta1, Theta2, Theta3, TransMat, ErrTxt ! Passed Variables: - REAL(ReKi), INTENT(IN ) :: Theta1 !< \f$\theta_1\f$: the small rotation about \f$X_1\f$, (rad). - REAL(ReKi), INTENT(IN ) :: Theta2 !< \f$\theta_2\f$: the small rotation about \f$X_2\f$, (rad). - REAL(ReKi), INTENT(IN ) :: Theta3 !< \f$\theta_3\f$: the small rotation about \f$X_3\f$, (rad). - REAL(DbKi), INTENT(OUT) :: TransMat (3,3) !< The resulting transformation matrix from \f$X\f$ to \f$x\f$, (-). + REAL(R8Ki), INTENT(IN ) :: Theta1 !< \f$\theta_1\f$: the small rotation about \f$X_1\f$, (rad). + REAL(R8Ki), INTENT(IN ) :: Theta2 !< \f$\theta_2\f$: the small rotation about \f$X_2\f$, (rad). + REAL(R8Ki), INTENT(IN ) :: Theta3 !< \f$\theta_3\f$: the small rotation about \f$X_3\f$, (rad). + REAL(R8Ki), INTENT(OUT) :: TransMat (3,3) !< The resulting transformation matrix from \f$X\f$ to \f$x\f$, (-). INTEGER(IntKi),INTENT(OUT) :: ErrStat !< Error status CHARACTER(*), INTENT(OUT) :: ErrMsg !< Error message corresponding to ErrStat @@ -6012,33 +5470,70 @@ SUBROUTINE SmllRotTransD( RotationType, Theta1, Theta2, Theta3, TransMat, ErrTxt END SUBROUTINE SmllRotTransD !======================================================================= !> \copydoc nwtc_num::smllrottransd - SUBROUTINE SmllRotTransDD( RotationType, Theta1, Theta2, Theta3, TransMat, ErrTxt, ErrStat, ErrMsg ) + SUBROUTINE SmllRotTransR( RotationType, Theta1, Theta2, Theta3, TransMat, ErrTxt, ErrStat, ErrMsg ) + + + ! This routine computes the 3x3 transformation matrix, TransMat, + ! to a coordinate system x (with orthogonal axes x1, x2, x3) + ! resulting from three rotations (Theta1, Theta2, Theta3) about the + ! orthogonal axes (X1, X2, X3) of coordinate system X. All angles + ! are assummed to be small, as such, the order of rotations does + ! not matter and Euler angles do not need to be used. This routine + ! is used to compute the transformation matrix (TransMat) between + ! undeflected (X) and deflected (x) coordinate systems. In matrix + ! form: + ! {x1} [TransMat(Theta1, ] {X1} + ! {x2} = [ Theta2, ]*{X2} + ! {x3} [ Theta3 )] {X3} + ! + ! The transformation matrix, TransMat, is the closest orthonormal + ! matrix to the nonorthonormal, but skew-symmetric, Bernoulli-Euler + ! matrix: + ! [ 1.0 Theta3 -Theta2 ] + ! A = [ -Theta3 1.0 Theta1 ] + ! [ Theta2 -Theta1 1.0 ] + ! + ! In the Frobenius Norm sense, the closest orthornormal matrix is: + ! TransMat = U*V^T, + ! + ! where the columns of U contain the eigenvectors of A*A^T and the + ! columns of V contain the eigenvectors of A^T*A (^T = transpose). + ! This result comes directly from the Singular Value Decomposition + ! (SVD) of A = U*S*V^T where S is a diagonal matrix containing the + ! singular values of A, which are SQRT( eigenvalues of A*A^T ) = + ! SQRT( eigenvalues of A^T*A ). + ! + ! The algebraic form of the transformation matrix, as implemented + ! below, was derived symbolically by J. Jonkman by computing U*V^T + ! by hand with verification in Mathematica. + ! + ! This routine is the inverse of GetSmllRotAngs() ! Passed Variables: - REAL(DbKi), INTENT(IN ) :: Theta1 !< The small rotation about X1, (rad). - REAL(DbKi), INTENT(IN ) :: Theta2 !< The small rotation about X2, (rad). - REAL(DbKi), INTENT(IN ) :: Theta3 !< The small rotation about X3, (rad). - REAL(DbKi), INTENT(OUT) :: TransMat (3,3) !< The resulting transformation matrix from X to x, (-). + REAL(SiKi), INTENT(IN ) :: Theta1 ! The small rotation about X1, (rad). + REAL(SiKi), INTENT(IN ) :: Theta2 ! The small rotation about X2, (rad). + REAL(SiKi), INTENT(IN ) :: Theta3 ! The small rotation about X3, (rad). + REAL(SiKi), INTENT(OUT) :: TransMat (3,3) ! The resulting transformation matrix from X to x, (-). - INTEGER(IntKi),INTENT(OUT) :: ErrStat !< Error status - CHARACTER(*), INTENT(OUT) :: ErrMsg !< Error message corresponding to ErrStat + INTEGER(IntKi),INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg - CHARACTER(*), INTENT(IN) :: RotationType !< The type of rotation; used to inform the user where a large rotation is occuring upon such an event. - CHARACTER(*), INTENT(IN ), OPTIONAL :: ErrTxt !< an additional message to be displayed as a warning (typically the simulation time) + CHARACTER(*), INTENT(IN) :: RotationType ! The type of rotation; used to inform the user where a large rotation is occuring upon such an event. + CHARACTER(*), INTENT(IN ), OPTIONAL :: ErrTxt ! an additional message to be displayed as a warning (typically the simulation time) ! Local Variables: - REAL(DbKi) :: ComDenom ! = ( Theta1^2 + Theta2^2 + Theta3^2 )*SQRT( 1.0 + Theta1^2 + Theta2^2 + Theta3^2 ) - REAL(DbKi), PARAMETER :: LrgAngle = 0.4 ! Threshold for when a small angle becomes large (about 23deg). This comes from: COS(SmllAngle) ~ 1/SQRT( 1 + SmllAngle^2 ) and SIN(SmllAngle) ~ SmllAngle/SQRT( 1 + SmllAngle^2 ) results in ~5% error when SmllAngle = 0.4rad. - REAL(DbKi) :: Theta11 ! = Theta1^2 - REAL(DbKi) :: Theta12S ! = Theta1*Theta2*[ SQRT( 1.0 + Theta1^2 + Theta2^2 + Theta3^2 ) - 1.0 ] - REAL(DbKi) :: Theta13S ! = Theta1*Theta3*[ SQRT( 1.0 + Theta1^2 + Theta2^2 + Theta3^2 ) - 1.0 ] - REAL(DbKi) :: Theta22 ! = Theta2^2 - REAL(DbKi) :: Theta23S ! = Theta2*Theta3*[ SQRT( 1.0 + Theta1^2 + Theta2^2 + Theta3^2 ) - 1.0 ] - REAL(DbKi) :: Theta33 ! = Theta3^2 - REAL(DbKi) :: SqrdSum ! = Theta1^2 + Theta2^2 + Theta3^2 - REAL(DbKi) :: SQRT1SqrdSum ! = SQRT( 1.0 + Theta1^2 + Theta2^2 + Theta3^2 ) + REAL(SiKi) :: ComDenom ! = ( Theta1^2 + Theta2^2 + Theta3^2 )*SQRT( 1.0 + Theta1^2 + Theta2^2 + Theta3^2 ) + REAL(SiKi), PARAMETER :: LrgAngle = 0.4 ! Threshold for when a small angle becomes large (about 23deg). This comes from: COS(SmllAngle) ~ 1/SQRT( 1 + SmllAngle^2 ) and SIN(SmllAngle) ~ SmllAngle/SQRT( 1 + SmllAngle^2 ) results in ~5% error when SmllAngle = 0.4rad. + REAL(SiKi) :: Theta11 ! = Theta1^2 + REAL(SiKi) :: Theta12S ! = Theta1*Theta2*[ SQRT( 1.0 + Theta1^2 + Theta2^2 + Theta3^2 ) - 1.0 ] + REAL(SiKi) :: Theta13S ! = Theta1*Theta3*[ SQRT( 1.0 + Theta1^2 + Theta2^2 + Theta3^2 ) - 1.0 ] + REAL(SiKi) :: Theta22 ! = Theta2^2 + REAL(SiKi) :: Theta23S ! = Theta2*Theta3*[ SQRT( 1.0 + Theta1^2 + Theta2^2 + Theta3^2 ) - 1.0 ] + REAL(SiKi) :: Theta33 ! = Theta3^2 + REAL(SiKi) :: SqrdSum ! = Theta1^2 + Theta2^2 + Theta3^2 + REAL(SiKi) :: SQRT1SqrdSum ! = SQRT( 1.0 + Theta1^2 + Theta2^2 + Theta3^2 ) LOGICAL, SAVE :: FrstWarn = .TRUE. ! When .TRUE., indicates that we're on the first warning. @@ -6072,153 +5567,21 @@ SUBROUTINE SmllRotTransDD( RotationType, Theta1, Theta2, Theta3, TransMat, ErrTx Theta33 = Theta3*Theta3 SqrdSum = Theta11 + Theta22 + Theta33 - SQRT1SqrdSum = SQRT( 1.0_DbKi + SqrdSum ) + SQRT1SqrdSum = SQRT( 1.0_ReKi + SqrdSum ) ComDenom = SqrdSum*SQRT1SqrdSum - Theta12S = Theta1*Theta2*( SQRT1SqrdSum - 1.0_DbKi ) - Theta13S = Theta1*Theta3*( SQRT1SqrdSum - 1.0_DbKi ) - Theta23S = Theta2*Theta3*( SQRT1SqrdSum - 1.0_DbKi ) - - - ! Define the transformation matrix: - - IF ( ComDenom == 0.0_DbKi ) THEN ! All angles are zero and matrix is ill-conditioned (the matrix is derived assuming that the angles are not zero); return identity - - TransMat(1,:) = (/ 1.0_DbKi, 0.0_DbKi, 0.0_DbKi /) - TransMat(2,:) = (/ 0.0_DbKi, 1.0_DbKi, 0.0_DbKi /) - TransMat(3,:) = (/ 0.0_DbKi, 0.0_DbKi, 1.0_DbKi /) - - ELSE ! At least one angle is nonzero - - TransMat(1,1) = ( Theta11*SQRT1SqrdSum + Theta22 + Theta33 )/ComDenom - TransMat(2,2) = ( Theta11 + Theta22*SQRT1SqrdSum + Theta33 )/ComDenom - TransMat(3,3) = ( Theta11 + Theta22 + Theta33*SQRT1SqrdSum )/ComDenom - TransMat(1,2) = ( Theta3*SqrdSum + Theta12S )/ComDenom - TransMat(2,1) = ( -Theta3*SqrdSum + Theta12S )/ComDenom - TransMat(1,3) = ( -Theta2*SqrdSum + Theta13S )/ComDenom - TransMat(3,1) = ( Theta2*SqrdSum + Theta13S )/ComDenom - TransMat(2,3) = ( Theta1*SqrdSum + Theta23S )/ComDenom - TransMat(3,2) = ( -Theta1*SqrdSum + Theta23S )/ComDenom - - ENDIF - - - RETURN - END SUBROUTINE SmllRotTransDD -!======================================================================= -!> \copydoc nwtc_num::smllrottransd - SUBROUTINE SmllRotTransR( RotationType, Theta1, Theta2, Theta3, TransMat, ErrTxt, ErrStat, ErrMsg ) - - - ! This routine computes the 3x3 transformation matrix, TransMat, - ! to a coordinate system x (with orthogonal axes x1, x2, x3) - ! resulting from three rotations (Theta1, Theta2, Theta3) about the - ! orthogonal axes (X1, X2, X3) of coordinate system X. All angles - ! are assummed to be small, as such, the order of rotations does - ! not matter and Euler angles do not need to be used. This routine - ! is used to compute the transformation matrix (TransMat) between - ! undeflected (X) and deflected (x) coordinate systems. In matrix - ! form: - ! {x1} [TransMat(Theta1, ] {X1} - ! {x2} = [ Theta2, ]*{X2} - ! {x3} [ Theta3 )] {X3} - ! - ! The transformation matrix, TransMat, is the closest orthonormal - ! matrix to the nonorthonormal, but skew-symmetric, Bernoulli-Euler - ! matrix: - ! [ 1.0 Theta3 -Theta2 ] - ! A = [ -Theta3 1.0 Theta1 ] - ! [ Theta2 -Theta1 1.0 ] - ! - ! In the Frobenius Norm sense, the closest orthornormal matrix is: - ! TransMat = U*V^T, - ! - ! where the columns of U contain the eigenvectors of A*A^T and the - ! columns of V contain the eigenvectors of A^T*A (^T = transpose). - ! This result comes directly from the Singular Value Decomposition - ! (SVD) of A = U*S*V^T where S is a diagonal matrix containing the - ! singular values of A, which are SQRT( eigenvalues of A*A^T ) = - ! SQRT( eigenvalues of A^T*A ). - ! - ! The algebraic form of the transformation matrix, as implemented - ! below, was derived symbolically by J. Jonkman by computing U*V^T - ! by hand with verification in Mathematica. - ! - ! This routine is the inverse of GetSmllRotAngs() - - ! Passed Variables: - - REAL(ReKi), INTENT(IN ) :: Theta1 ! The small rotation about X1, (rad). - REAL(ReKi), INTENT(IN ) :: Theta2 ! The small rotation about X2, (rad). - REAL(ReKi), INTENT(IN ) :: Theta3 ! The small rotation about X3, (rad). - REAL(ReKi), INTENT(OUT) :: TransMat (3,3) ! The resulting transformation matrix from X to x, (-). - - INTEGER(IntKi),INTENT(OUT) :: ErrStat - CHARACTER(*), INTENT(OUT) :: ErrMsg - - CHARACTER(*), INTENT(IN) :: RotationType ! The type of rotation; used to inform the user where a large rotation is occuring upon such an event. - CHARACTER(*), INTENT(IN ), OPTIONAL :: ErrTxt ! an additional message to be displayed as a warning (typically the simulation time) - - ! Local Variables: - - REAL(ReKi) :: ComDenom ! = ( Theta1^2 + Theta2^2 + Theta3^2 )*SQRT( 1.0 + Theta1^2 + Theta2^2 + Theta3^2 ) - REAL(ReKi), PARAMETER :: LrgAngle = 0.4 ! Threshold for when a small angle becomes large (about 23deg). This comes from: COS(SmllAngle) ~ 1/SQRT( 1 + SmllAngle^2 ) and SIN(SmllAngle) ~ SmllAngle/SQRT( 1 + SmllAngle^2 ) results in ~5% error when SmllAngle = 0.4rad. - REAL(ReKi) :: Theta11 ! = Theta1^2 - REAL(ReKi) :: Theta12S ! = Theta1*Theta2*[ SQRT( 1.0 + Theta1^2 + Theta2^2 + Theta3^2 ) - 1.0 ] - REAL(ReKi) :: Theta13S ! = Theta1*Theta3*[ SQRT( 1.0 + Theta1^2 + Theta2^2 + Theta3^2 ) - 1.0 ] - REAL(ReKi) :: Theta22 ! = Theta2^2 - REAL(ReKi) :: Theta23S ! = Theta2*Theta3*[ SQRT( 1.0 + Theta1^2 + Theta2^2 + Theta3^2 ) - 1.0 ] - REAL(ReKi) :: Theta33 ! = Theta3^2 - REAL(ReKi) :: SqrdSum ! = Theta1^2 + Theta2^2 + Theta3^2 - REAL(ReKi) :: SQRT1SqrdSum ! = SQRT( 1.0 + Theta1^2 + Theta2^2 + Theta3^2 ) - - LOGICAL, SAVE :: FrstWarn = .TRUE. ! When .TRUE., indicates that we're on the first warning. - - - ErrStat = ErrID_None - ErrMsg = '' - - ! Display a warning message if at least one angle gets too large in magnitude: - - IF ( ( ( ABS(Theta1) > LrgAngle ) .OR. ( ABS(Theta2) > LrgAngle ) .OR. ( ABS(Theta3) > LrgAngle ) ) .AND. FrstWarn ) THEN - - ErrStat= ErrID_Severe - ErrMsg = 'Small angle assumption violated in SUBROUTINE SmllRotTrans() due to a large '//TRIM(RotationType)//'. '// & - 'The solution may be inaccurate. Simulation continuing, but future warnings from SmllRotTrans() will be suppressed.' - - IF ( PRESENT(ErrTxt) ) THEN - ErrMsg = TRIM(ErrMsg)//NewLine//' Additional debugging message from SUBROUTINE SmllRotTrans(): '//TRIM(ErrTxt) - END IF - - !CALL ProgWarn( TRIM(ErrMsg) ) - - FrstWarn = .FALSE. ! Don't enter here again! - - ENDIF - - - ! Compute some intermediate results: - - Theta11 = Theta1*Theta1 - Theta22 = Theta2*Theta2 - Theta33 = Theta3*Theta3 - - SqrdSum = Theta11 + Theta22 + Theta33 - SQRT1SqrdSum = SQRT( 1.0_ReKi + SqrdSum ) - ComDenom = SqrdSum*SQRT1SqrdSum - - Theta12S = Theta1*Theta2*( SQRT1SqrdSum - 1.0_Reki ) - Theta13S = Theta1*Theta3*( SQRT1SqrdSum - 1.0_Reki ) - Theta23S = Theta2*Theta3*( SQRT1SqrdSum - 1.0_Reki ) + Theta12S = Theta1*Theta2*( SQRT1SqrdSum - 1.0_Siki ) + Theta13S = Theta1*Theta3*( SQRT1SqrdSum - 1.0_Siki ) + Theta23S = Theta2*Theta3*( SQRT1SqrdSum - 1.0_Siki ) ! Define the transformation matrix: IF ( ComDenom == 0.0_ReKi ) THEN ! All angles are zero and matrix is ill-conditioned (the matrix is derived assuming that the angles are not zero); return identity - TransMat(1,:) = (/ 1.0_ReKi, 0.0_ReKi, 0.0_ReKi /) - TransMat(2,:) = (/ 0.0_ReKi, 1.0_ReKi, 0.0_ReKi /) - TransMat(3,:) = (/ 0.0_ReKi, 0.0_ReKi, 1.0_ReKi /) + TransMat(1,:) = (/ 1.0_SiKi, 0.0_SiKi, 0.0_SiKi /) + TransMat(2,:) = (/ 0.0_SiKi, 1.0_SiKi, 0.0_SiKi /) + TransMat(3,:) = (/ 0.0_SiKi, 0.0_SiKi, 1.0_SiKi /) ELSE ! At least one angle is nonzero @@ -6410,30 +5773,6 @@ FUNCTION SkewSymMatR8 ( x ) RESULT(M) RETURN END FUNCTION SkewSymMatR8 !======================================================================= -!> \copydoc nwtc_num::skewsymmatr4 - FUNCTION SkewSymMatR16 ( x ) RESULT(M) - - ! Function arguments - - REAL(QuKi) :: M(3,3) ! skew-symmetric matrix formed from input vector \f$x\f$ - REAL(QuKi), INTENT(IN) :: x(3) ! input vector \f$x\f$ - - M(1,1) = 0.0_QuKi - M(2,1) = x(3) - M(3,1) = -x(2) - - M(1,2) = -x(3) - M(2,2) = 0.0_QuKi - M(3,2) = x(1) - - M(1,3) = x(2) - M(2,3) = -x(1) - M(3,3) = 0.0_QuKi - - RETURN - END FUNCTION SkewSymMatR16 - -!======================================================================= !> If M is a rotation matrix from a 1-2-3 rotation sequence about Y-X-Z, this function returns !! the 3 sequential angles, \f$\theta_y\f$, \f$\theta_x\f$, and \f$\theta_z\f$ (in radians), that formed !! the matrix. M represents a change of basis (from global to local coordinates; @@ -6717,85 +6056,7 @@ FUNCTION TaitBryanYXZExtractR8(M) result(theta) END FUNCTION TaitBryanYXZExtractR8 -!> See nwtc_num::taitbryanyxzextractr4 for detailed explanation of algorithm - FUNCTION TaitBryanYXZExtractR16(M) result(theta) - - - REAL(QuKi), INTENT(IN) :: M(3,3) !< rotation matrix, M - REAL(QuKi) :: theta(3) !< the 3 rotation angles, \f$(\theta_y, \theta_x, \theta_z)\f$, corresponding to the Tait-Bryan rotation angle corresponding to cant-toe-twist - - REAL(QuKi) :: C_1 ! C_1 > cos(theta_y) - REAL(QuKi) :: S_1 ! S_1 > sin(theta_y) - REAL(QuKi) :: C_2 ! C_2 > cos(theta_x) - REAL(QuKi) :: C_3 ! C_3 > cos(theta_z) - REAL(QuKi) :: S_3 ! S_3 > sin(theta_z) - - !> See nwtc_num::taitbryanyxzextractr4 for detailed description of how this works. - - ! use trig identity S_3**2 + C_3**2 = 1 to get abs( C_2 ) - C_2 = sqrt( m(1,2)**2 + m(2,2)**2 ) - - ! If C_2 is zero, we can simplifiy some things since theta(2) is +/- pi/2 - if ( EqualRealNos( C_2, 0.0_QuKi ) ) then - - ! find sign of theta(2) based on sin(theta_2) - theta(2) = atan2( -m(3,2), C_2 ) ! theta_2 -> theta_x - - ! Considering C_2 = 0 and S_2 = \pm 1, the matrix M reduces to - ! M = [ C_1 C_3 \pm S_1 S_3 0 \pm C_1 S_3 - S_1 C_3 | - ! | \pm S_1 C_3 - C_1 S_3 0 \pm C_1 C_3 + S_1 S_3 | - ! | 0 0 \mp 1 0 ] - ! - ! At this point we can choose \theta_3 = 0 due to gimbal lock giving sin(theta(3)) = 0, cos(theta(3)) = 1. - - theta(3) = 0.0_QuKi ! theta_z = theta_3 - - ! This further reduces M to - ! M = [ C_1 0 - S_1 | - ! | \pm S_1 0 \pm C_1 | - ! | 0 \mp 1 0 ] - ! - ! - ! allowing us to solve for theta_1 by theta_1 = atan2( -M(1,3), M(1,1) ) = atan2( S_1, C_1). - - theta(1) = atan2( -m(1,3), m(1,1) ) - - else - ! First, start by finding \f$ \theta(1) \f$ from \f$ M(3,1) \f$ and \f$ M(3,3) \f$ using - ! - ! theta(1) = atan2( M(3,1), M(3,3) ) = atan2( S_1 * C_2, C_1 * C_2 ). - ! With this we calculate values for S_1 and C_1. - - theta(1) = atan2( m(3,1), m(3,3) ) ! theta_1 -> theta_y - C_1 = cos( theta(1) ) - S_1 = sin( theta(1) ) - - ! We already know abs( C_2 ), but need the sign of it. This can be found by comparing the - ! S_1 * C_2 and C_1 * C_2 terms with the C_1 and S_1 terms we just found. - - if ( EqualRealNos( C_1, 0.0_QuKi ) ) then - C_2 = sign( C_2, m(3,1) / S_1 ) - else - C_2 = sign( C_2, m(3,3) / C_1 ) - endif - ! Now can calculate theta(2) - theta(2) = atan2( -m(3,2), C_2 ) - - - ! For numerical reasons, we're going to get theta(3) using some matrix math and identities about M. - ! See nwtc_num::taitbryanyxzextractr4 for complete documentation on the matrix math used here - - S_3 = -( m(2,1) * C_1 + m(2,3) * (- S_1) ) - C_3 = m(1,1) * C_1 + m(1,3) * (- S_1) - - theta(3) = atan2( S_3, C_3) - - endif - - - END FUNCTION TaitBryanYXZExtractR16 - FUNCTION TaitBryanYXZConstructR4(theta) result(M) ! this function creates a rotation matrix, M, from a 1-2-3 rotation ! sequence of the 3 TaitBryan angles, theta_x, theta_y, and theta_z, in radians. @@ -6846,7 +6107,7 @@ END FUNCTION TaitBryanYXZConstructR4 FUNCTION TaitBryanYXZConstructR8(theta) result(M) - ! this function creates a rotation matrix, M, from a 1-2-3 rotation + ! this function creates a rotation matrix, M, from a 1-2-3 rotation ! sequence of the 3 TaitBryan angles, theta_x, theta_y, and theta_z, in radians. ! M represents a change of basis (from global to local coordinates; ! not a physical rotation of the body). it is the inverse of TaitBryanYXZExtract(). @@ -6893,55 +6154,6 @@ FUNCTION TaitBryanYXZConstructR8(theta) result(M) END FUNCTION TaitBryanYXZConstructR8 - FUNCTION TaitBryanYXZConstructR16(theta) result(M) - - ! this function creates a rotation matrix, M, from a 1-2-3 rotation - ! sequence of the 3 TaitBryan angles, theta_x, theta_y, and theta_z, in radians. - ! M represents a change of basis (from global to local coordinates; - ! not a physical rotation of the body). it is the inverse of TaitBryanYXZExtract(). - ! - ! M = R(theta_z) * R(theta_x) * R(theta_y) - ! = [ cz sz 0 | [ 1 0 0 | [ cy 0 -sy | - ! |-sz cz 0 |* | 0 cx sx | * | 0 1 0 | - ! | 0 0 1 ] | 0 -sx cx ] | sy 0 cy ] - ! = [ cy*cz+sy*sx*sz cx*sz cy*sx*sz-cz*sy | - ! |cz*sy*sx-cy*sz cx*cz cy*cz*sx+sy*sz | - ! |cx*sy -sx cx*cy ] - ! where cz = cos(theta_z), sz = sin(theta_z), cy = cos(theta_y), etc. - - REAL(QuKi) :: M(3,3) ! rotation matrix M - REAL(QuKi), INTENT(IN) :: theta(3) ! the 3 rotation angles: theta_x, theta_y, theta_z - - REAL(QuKi) :: cx ! cos(theta_x) - REAL(QuKi) :: sx ! sin(theta_x) - REAL(QuKi) :: cy ! cos(theta_y) - REAL(QuKi) :: sy ! sin(theta_y) - REAL(QuKi) :: cz ! cos(theta_z) - REAL(QuKi) :: sz ! sin(theta_z) - - cx = cos( theta(1) ) - sx = sin( theta(1) ) - - cy = cos( theta(2) ) - sy = sin( theta(2) ) - - cz = cos( theta(3) ) - sz = sin( theta(3) ) - - M(1,1) = cy*cz+sy*sx*sz - M(1,2) = cx*sz - M(1,3) = cy*sx*sz-cz*sy - - M(2,1) = cz*sy*sx-cy*sz - M(2,2) = cx*cz - M(2,3) = cy*cz*sx+sy*sz - - M(3,1) = cx*sy - M(3,2) = -sx - M(3,3) = cy*cx - - END FUNCTION TaitBryanYXZConstructR16 - !======================================================================= !> This routine takes an array of time values such as that returned from @@ -6999,24 +6211,7 @@ FUNCTION traceR8(A) end do END FUNCTION traceR8 -!======================================================================= -!> \copydoc nwtc_num::tracer4 - FUNCTION traceR16(A) - - REAL(QuKi), INTENT(IN) :: A(:,:) - REAL(QuKi) :: traceR16 - - INTEGER(IntKi) :: n ! rows/cols in A - INTEGER(IntKi) :: i ! loop counter - - n = min( SIZE(A,1), SIZE(A,2) ) - traceR16 = 0.0_ReKi - do i=1,n - traceR16 = traceR16 + A(i,i) - end do - - END FUNCTION traceR16 !======================================================================= !> This function returns the \f$l_2\f$ (Euclidian) norm of a vector, !! \f$v = \left(v_1, v_2, \ldots ,v_n\right)\f$. The \f$l_2\f$-norm is defined as @@ -7049,20 +6244,7 @@ FUNCTION TwoNormR8(v) END FUNCTION -!======================================================================= -!> \copydoc nwtc_num::twonormr4 - FUNCTION TwoNormR16(v) - - ! this function returns the 2-norm of a vector v - ! fortran 2008 has Norm2() built in - - REAL(QuKi), INTENT(IN) :: v(:) - REAL(QuKi) :: TwoNormR16 - - TwoNormR16 = SQRT( DOT_PRODUCT(v, v) ) - - - END FUNCTION + !======================================================================= !> This routine is used to convert Angle to an equivalent value !! in the range \f$[0, 2\pi)\f$. \n @@ -7116,47 +6298,19 @@ SUBROUTINE Zero2TwoPiR8 ( Angle ) RETURN END SUBROUTINE Zero2TwoPiR8 -!======================================================================= -!> \copydoc nwtc_num::zero2twopir4 - SUBROUTINE Zero2TwoPiR16 ( Angle ) - - ! This routine is used to convert Angle to an equivalent value - ! in the range [0, 2*pi). - - - ! Argument declarations: - - REAL(QuKi), INTENT(INOUT) :: Angle - - - - ! Get the angle between 0 and 2Pi. - - Angle = MODULO( Angle, TwoPi_R16 ) - - - ! Check numerical case where Angle == 2Pi. - - IF ( Angle == TwoPi_R16 ) THEN - Angle = 0.0_DbKi - END IF - - - RETURN - END SUBROUTINE Zero2TwoPiR16 !======================================================================= !< This routine extrapolates or interpolates between angles SUBROUTINE Angles_ExtrapInterp1_R4(Angle1, Angle2, tin, Angle_out, tin_out ) REAL(SiKi), INTENT(IN ) :: Angle1 !< Angle at t1 > t2 REAL(SiKi), INTENT(IN ) :: Angle2 !< Angle at t2 - REAL(DbKi), INTENT(IN ) :: tin(:) !< Times associated with the inputs + REAL(R8Ki), INTENT(IN ) :: tin(:) !< Times associated with the inputs REAL(SiKi), INTENT(INOUT) :: Angle_out !< Input at tin_out - REAL(DbKi), INTENT(IN ) :: tin_out !< time to be extrap/interp'd to + REAL(R8Ki), INTENT(IN ) :: tin_out !< time to be extrap/interp'd to ! local variables INTEGER(IntKi), parameter :: order = 1 ! order of polynomial fit (max 2) - REAL(DbKi) :: t(SIZE(tin)) ! Times associated with the inputs - REAL(DbKi) :: t_out ! Time to which to be extrap/interpd + REAL(R8Ki) :: t(SIZE(tin)) ! Times associated with the inputs + REAL(R8Ki) :: t_out ! Time to which to be extrap/interpd REAL(SiKi) :: Angle2_mod @@ -7193,14 +6347,14 @@ END SUBROUTINE Angles_ExtrapInterp1_R4 SUBROUTINE Angles_ExtrapInterp1_R8(Angle1, Angle2, tin, Angle_out, tin_out) REAL(R8Ki), INTENT(IN ) :: Angle1 !< Angle at t1 > t2 REAL(R8Ki), INTENT(IN ) :: Angle2 !< Angle at t2 - REAL(DbKi), INTENT(IN ) :: tin(:) !< Times associated with the inputs + REAL(R8Ki), INTENT(IN ) :: tin(:) !< Times associated with the inputs REAL(R8Ki), INTENT(INOUT) :: Angle_out !< Input at tin_out - REAL(DbKi), INTENT(IN ) :: tin_out !< time to be extrap/interp'd to + REAL(R8Ki), INTENT(IN ) :: tin_out !< time to be extrap/interp'd to ! local variables INTEGER(IntKi), parameter :: order = 1 ! order of polynomial fit (max 2) - REAL(DbKi) :: t(SIZE(tin)) ! Times associated with the inputs - REAL(DbKi) :: t_out ! Time to which to be extrap/interpd + REAL(R8Ki) :: t(SIZE(tin)) ! Times associated with the inputs + REAL(R8Ki) :: t_out ! Time to which to be extrap/interpd REAL(R8Ki) :: Angle2_mod @@ -7231,62 +6385,19 @@ SUBROUTINE Angles_ExtrapInterp1_R8(Angle1, Angle2, tin, Angle_out, tin_out) ! call MPi2Pi(Angle_out) END SUBROUTINE Angles_ExtrapInterp1_R8 -!======================================================================= - !< This routine extrapolates or interpolates between angles - SUBROUTINE Angles_ExtrapInterp1_R16(Angle1, Angle2, tin, Angle_out, tin_out) - REAL(QuKi), INTENT(IN ) :: Angle1 !< Angle at t1 > t2 - REAL(QuKi), INTENT(IN ) :: Angle2 !< Angle at t2 - REAL(DbKi), INTENT(IN ) :: tin(:) !< Times associated with the inputs - REAL(QuKi), INTENT(INOUT) :: Angle_out !< Input at tin_out - REAL(DbKi), INTENT(IN ) :: tin_out !< time to be extrap/interp'd to - - ! local variables - INTEGER(IntKi), parameter :: order = 1 ! order of polynomial fit (max 2) - REAL(DbKi) :: t(SIZE(tin)) ! Times associated with the inputs - REAL(DbKi) :: t_out ! Time to which to be extrap/interpd - - REAL(QuKi) :: Angle2_mod - - ! we'll subtract a constant from the times to resolve some - ! numerical issues when t gets large (and to simplify the equations) - t = tin - tin(1) - t_out = tin_out - tin(1) - - ! ! some error checking: - ! - ! if ( size(t) .ne. order+1) then - ! ErrStat = ErrID_Fatal - ! ErrMsg = 'Angles_ExtrapInterp1: size(t) must equal 2.' - ! RETURN - ! end if - ! - !IF ( EqualRealNos( t(1), t(2) ) ) THEN - ! ErrStat = ErrID_Fatal - ! ErrMsg = 'Angles_ExtrapInterp1: t(1) must not equal t(2) to avoid a division-by-zero error.' - ! RETURN - !END IF - - Angle2_mod = Angle2 - call AddOrSub2Pi( Angle1, Angle2_mod ) - - Angle_out = Angle1 + (Angle2_mod - Angle1) * t_out / t(2) -! call Zero2TwoPi(Angle_out) -! call MPi2Pi(Angle_out) - - END SUBROUTINE Angles_ExtrapInterp1_R16 !======================================================================= !< This routine extrapolates or interpolates between angles SUBROUTINE Angles_ExtrapInterp1_R4R(Angle1, Angle2, tin, Angle_out, tin_out ) REAL(SiKi), INTENT(IN ) :: Angle1 !< Angle at t1 > t2 REAL(SiKi), INTENT(IN ) :: Angle2 !< Angle at t2 - REAL(ReKi), INTENT(IN ) :: tin(:) !< Times associated with the inputs + REAL(R4Ki), INTENT(IN ) :: tin(:) !< Times associated with the inputs REAL(SiKi), INTENT(INOUT) :: Angle_out !< Input at tin_out - REAL(ReKi), INTENT(IN ) :: tin_out !< time to be extrap/interp'd to + REAL(R4Ki), INTENT(IN ) :: tin_out !< time to be extrap/interp'd to ! local variables INTEGER(IntKi), parameter :: order = 1 ! order of polynomial fit (max 2) - REAL(ReKi) :: t(SIZE(tin)) ! Times associated with the inputs - REAL(ReKi) :: t_out ! Time to which to be extrap/interpd + REAL(SiKi) :: t(SIZE(tin)) ! Times associated with the inputs + REAL(SiKi) :: t_out ! Time to which to be extrap/interpd REAL(SiKi) :: Angle2_mod @@ -7323,14 +6434,14 @@ END SUBROUTINE Angles_ExtrapInterp1_R4R SUBROUTINE Angles_ExtrapInterp1_R8R(Angle1, Angle2, tin, Angle_out, tin_out) REAL(R8Ki), INTENT(IN ) :: Angle1 !< Angle at t1 > t2 REAL(R8Ki), INTENT(IN ) :: Angle2 !< Angle at t2 - REAL(ReKi), INTENT(IN ) :: tin(:) !< Times associated with the inputs + REAL(SiKi), INTENT(IN ) :: tin(:) !< Times associated with the inputs REAL(R8Ki), INTENT(INOUT) :: Angle_out !< Input at tin_out - REAL(ReKi), INTENT(IN ) :: tin_out !< time to be extrap/interp'd to + REAL(SiKi), INTENT(IN ) :: tin_out !< time to be extrap/interp'd to ! local variables INTEGER(IntKi), parameter :: order = 1 ! order of polynomial fit (max 2) - REAL(ReKi) :: t(SIZE(tin)) ! Times associated with the inputs - REAL(ReKi) :: t_out ! Time to which to be extrap/interpd + REAL(SiKi) :: t(SIZE(tin)) ! Times associated with the inputs + REAL(SiKi) :: t_out ! Time to which to be extrap/interpd REAL(R8Ki) :: Angle2_mod @@ -7361,49 +6472,6 @@ SUBROUTINE Angles_ExtrapInterp1_R8R(Angle1, Angle2, tin, Angle_out, tin_out) ! call MPi2Pi(Angle_out) END SUBROUTINE Angles_ExtrapInterp1_R8R -!======================================================================= - !< This routine extrapolates or interpolates between angles - SUBROUTINE Angles_ExtrapInterp1_R16R(Angle1, Angle2, tin, Angle_out, tin_out) - REAL(QuKi), INTENT(IN ) :: Angle1 !< Angle at t1 > t2 - REAL(QuKi), INTENT(IN ) :: Angle2 !< Angle at t2 - REAL(ReKi), INTENT(IN ) :: tin(:) !< Times associated with the inputs - REAL(QuKi), INTENT(INOUT) :: Angle_out !< Input at tin_out - REAL(ReKi), INTENT(IN ) :: tin_out !< time to be extrap/interp'd to - - ! local variables - INTEGER(IntKi), parameter :: order = 1 ! order of polynomial fit (max 2) - REAL(ReKi) :: t(SIZE(tin)) ! Times associated with the inputs - REAL(ReKi) :: t_out ! Time to which to be extrap/interpd - - REAL(QuKi) :: Angle2_mod - - ! we'll subtract a constant from the times to resolve some - ! numerical issues when t gets large (and to simplify the equations) - t = tin - tin(1) - t_out = tin_out - tin(1) - - ! ! some error checking: - ! - ! if ( size(t) .ne. order+1) then - ! ErrStat = ErrID_Fatal - ! ErrMsg = 'Angles_ExtrapInterp1: size(t) must equal 2.' - ! RETURN - ! end if - ! - !IF ( EqualRealNos( t(1), t(2) ) ) THEN - ! ErrStat = ErrID_Fatal - ! ErrMsg = 'Angles_ExtrapInterp1: t(1) must not equal t(2) to avoid a division-by-zero error.' - ! RETURN - !END IF - - Angle2_mod = Angle2 - call AddOrSub2Pi( Angle1, Angle2_mod ) - - Angle_out = Angle1 + (Angle2_mod - Angle1) * t_out / t(2) -! call Zero2TwoPi(Angle_out) -! call MPi2Pi(Angle_out) - - END SUBROUTINE Angles_ExtrapInterp1_R16R !======================================================================= !< This routine extrapolates or interpolates between angles SUBROUTINE Angles_ExtrapInterp2_R4(Angle1, Angle2, Angle3, tin, Angle_out, tin_out ) @@ -7529,84 +6597,23 @@ SUBROUTINE Angles_ExtrapInterp2_R8(Angle1, Angle2, Angle3, tin, Angle_out, tin_o ! call MPi2Pi(Angle_out) END SUBROUTINE Angles_ExtrapInterp2_R8 -!======================================================================= - !< This routine extrapolates or interpolates between angles - SUBROUTINE Angles_ExtrapInterp2_R16(Angle1, Angle2, Angle3, tin, Angle_out, tin_out ) - REAL(QuKi), INTENT(IN ) :: Angle1 !< Angle at t1 > t2 > t3 - REAL(QuKi), INTENT(IN ) :: Angle2 !< Angle at t2 > t3 - REAL(QuKi), INTENT(IN ) :: Angle3 !< Angle at t3 - REAL(DbKi), INTENT(IN ) :: tin(:) !< Times associated with the inputs - REAL(QuKi), INTENT(INOUT) :: Angle_out !< Input at tin_out - REAL(DbKi), INTENT(IN ) :: tin_out !< time to be extrap/interp'd to - - ! local variables - INTEGER(IntKi), parameter :: order = 2 ! order of polynomial fit (max 2) - REAL(DbKi) :: t(SIZE(tin)) ! Times associated with the inputs - REAL(DbKi) :: t_out ! Time to which to be extrap/interpd - - REAL(DbKi) :: scaleFactor ! temporary for extrapolation/interpolation - REAL(QuKi) :: Angle2_mod - REAL(QuKi) :: Angle3_mod - - ! we'll subtract a constant from the times to resolve some - ! numerical issues when t gets large (and to simplify the equations) - t = tin - tin(1) - t_out = tin_out - tin(1) - - ! some error checking: - - !if ( size(t) .ne. order+1) then - ! ErrStat = ErrID_Fatal - ! ErrMsg = 'Angles_ExtrapInterp2: size(t) must equal 3.' - ! RETURN - !end if - ! - !IF ( EqualRealNos( t(1), t(2) ) ) THEN - ! ErrStat = ErrID_Fatal - ! ErrMsg = 'Angles_ExtrapInterp2: t(1) must not equal t(2) to avoid a division-by-zero error.' - ! RETURN - !END IF - !IF ( EqualRealNos( t(2), t(3) ) ) THEN - ! ErrStat = ErrID_Fatal - ! ErrMsg = 'Angles_ExtrapInterp2: t(2) must not equal t(3) to avoid a division-by-zero error.' - ! RETURN - !END IF - !IF ( EqualRealNos( t(1), t(3) ) ) THEN - ! ErrStat = ErrID_Fatal - ! ErrMsg = 'Angles_ExtrapInterp2: t(1) must not equal t(3) to avoid a division-by-zero error.' - ! RETURN - !END IF - - Angle2_mod = Angle2 - Angle3_mod = Angle3 - call AddOrSub2Pi( Angle1, Angle2_mod ) - call AddOrSub2Pi( Angle2_mod, Angle3_mod ) - - scaleFactor = t_out / ( t(2) * t(3) * (t(2) - t(3)) ) - Angle_out = Angle1 & - + ( t(3)**2 * (Angle1 - Angle2_mod) + t(2)**2*(-Angle1 + Angle3_mod) ) * scaleFactor & - + ( (t(2)-t(3))*Angle1 + t(3)*Angle2_mod - t(2)*Angle3_mod ) *scaleFactor * t_out -! call Zero2TwoPi(Angle_out) -! call MPi2Pi(Angle_out) - - END SUBROUTINE Angles_ExtrapInterp2_R16 !======================================================================= !< This routine extrapolates or interpolates between angles SUBROUTINE Angles_ExtrapInterp2_R4R(Angle1, Angle2, Angle3, tin, Angle_out, tin_out ) REAL(SiKi), INTENT(IN ) :: Angle1 !< Angle at t1 > t2 > t3 REAL(SiKi), INTENT(IN ) :: Angle2 !< Angle at t2 > t3 REAL(SiKi), INTENT(IN ) :: Angle3 !< Angle at t3 - REAL(ReKi), INTENT(IN ) :: tin(:) !< Times associated with the inputs + REAL(R4Ki), INTENT(IN ) :: tin(:) !< Times associated with the inputs REAL(SiKi), INTENT(INOUT) :: Angle_out !< Input at tin_out - REAL(ReKi), INTENT(IN ) :: tin_out !< time to be extrap/interp'd to + REAL(R4Ki), INTENT(IN ) :: tin_out !< time to be extrap/interp'd to ! local variables INTEGER(IntKi), parameter :: order = 2 ! order of polynomial fit (max 2) - REAL(ReKi) :: t(SIZE(tin)) ! Times associated with the inputs - REAL(ReKi) :: t_out ! Time to which to be extrap/interpd + REAL(R4Ki) :: t(SIZE(tin)) ! Times associated with the inputs + REAL(R4Ki) :: t_out ! Time to which to be extrap/interpd - REAL(DbKi) :: scaleFactor ! temporary for extrapolation/interpolation + REAL(R8Ki) :: scaleFactor ! temporary for extrapolation/interpolation REAL(SiKi) :: Angle2_mod REAL(SiKi) :: Angle3_mod @@ -7660,16 +6667,16 @@ SUBROUTINE Angles_ExtrapInterp2_R8R(Angle1, Angle2, Angle3, tin, Angle_out, tin_ REAL(R8Ki), INTENT(IN ) :: Angle1 !< Angle at t1 > t2 > t3 REAL(R8Ki), INTENT(IN ) :: Angle2 !< Angle at t2 > t3 REAL(R8Ki), INTENT(IN ) :: Angle3 !< Angle at t3 - REAL(ReKi), INTENT(IN ) :: tin(:) !< Times associated with the inputs + REAL(R4Ki), INTENT(IN ) :: tin(:) !< Times associated with the inputs REAL(R8Ki), INTENT(INOUT) :: Angle_out !< Input at tin_out - REAL(ReKi), INTENT(IN ) :: tin_out !< time to be extrap/interp'd to + REAL(R4Ki), INTENT(IN ) :: tin_out !< time to be extrap/interp'd to ! local variables INTEGER(IntKi), parameter :: order = 2 ! order of polynomial fit (max 2) - REAL(ReKi) :: t(SIZE(tin)) ! Times associated with the inputs - REAL(ReKi) :: t_out ! Time to which to be extrap/interpd + REAL(R4Ki) :: t(SIZE(tin)) ! Times associated with the inputs + REAL(R4Ki) :: t_out ! Time to which to be extrap/interpd - REAL(DbKi) :: scaleFactor ! temporary for extrapolation/interpolation + REAL(R8Ki) :: scaleFactor ! temporary for extrapolation/interpolation REAL(R8Ki) :: Angle2_mod REAL(R8Ki) :: Angle3_mod @@ -7716,67 +6723,5 @@ SUBROUTINE Angles_ExtrapInterp2_R8R(Angle1, Angle2, Angle3, tin, Angle_out, tin_ ! call MPi2Pi(Angle_out) END SUBROUTINE Angles_ExtrapInterp2_R8R -!======================================================================= - !< This routine extrapolates or interpolates between angles - SUBROUTINE Angles_ExtrapInterp2_R16R(Angle1, Angle2, Angle3, tin, Angle_out, tin_out ) - REAL(QuKi), INTENT(IN ) :: Angle1 !< Angle at t1 > t2 > t3 - REAL(QuKi), INTENT(IN ) :: Angle2 !< Angle at t2 > t3 - REAL(QuKi), INTENT(IN ) :: Angle3 !< Angle at t3 - REAL(ReKi), INTENT(IN ) :: tin(:) !< Times associated with the inputs - REAL(QuKi), INTENT(INOUT) :: Angle_out !< Input at tin_out - REAL(ReKi), INTENT(IN ) :: tin_out !< time to be extrap/interp'd to - - ! local variables - INTEGER(IntKi), parameter :: order = 2 ! order of polynomial fit (max 2) - REAL(ReKi) :: t(SIZE(tin)) ! Times associated with the inputs - REAL(ReKi) :: t_out ! Time to which to be extrap/interpd - - REAL(DbKi) :: scaleFactor ! temporary for extrapolation/interpolation - REAL(QuKi) :: Angle2_mod - REAL(QuKi) :: Angle3_mod - - ! we'll subtract a constant from the times to resolve some - ! numerical issues when t gets large (and to simplify the equations) - t = tin - tin(1) - t_out = tin_out - tin(1) - - ! some error checking: - - !if ( size(t) .ne. order+1) then - ! ErrStat = ErrID_Fatal - ! ErrMsg = 'Angles_ExtrapInterp2: size(t) must equal 3.' - ! RETURN - !end if - ! - !IF ( EqualRealNos( t(1), t(2) ) ) THEN - ! ErrStat = ErrID_Fatal - ! ErrMsg = 'Angles_ExtrapInterp2: t(1) must not equal t(2) to avoid a division-by-zero error.' - ! RETURN - !END IF - !IF ( EqualRealNos( t(2), t(3) ) ) THEN - ! ErrStat = ErrID_Fatal - ! ErrMsg = 'Angles_ExtrapInterp2: t(2) must not equal t(3) to avoid a division-by-zero error.' - ! RETURN - !END IF - !IF ( EqualRealNos( t(1), t(3) ) ) THEN - ! ErrStat = ErrID_Fatal - ! ErrMsg = 'Angles_ExtrapInterp2: t(1) must not equal t(3) to avoid a division-by-zero error.' - ! RETURN - !END IF - - Angle2_mod = Angle2 - Angle3_mod = Angle3 - call AddOrSub2Pi( Angle1, Angle2_mod ) - call AddOrSub2Pi( Angle2_mod, Angle3_mod ) - - scaleFactor = t_out / ( t(2) * t(3) * (t(2) - t(3)) ) - - Angle_out = Angle1 & - + ( t(3)**2 * (Angle1 - Angle2_mod) + t(2)**2*(-Angle1 + Angle3_mod) ) * scaleFactor & - + ( (t(2)-t(3))*Angle1 + t(3)*Angle2_mod - t(2)*Angle3_mod ) *scaleFactor * t_out -! call Zero2TwoPi(Angle_out) -! call MPi2Pi(Angle_out) - - END SUBROUTINE Angles_ExtrapInterp2_R16R !======================================================================= END MODULE NWTC_Num diff --git a/modules/nwtc-library/src/NWTC_RandomNumber.f90 b/modules/nwtc-library/src/NWTC_RandomNumber.f90 index ed8b6648f6..f12b9a8528 100644 --- a/modules/nwtc-library/src/NWTC_RandomNumber.f90 +++ b/modules/nwtc-library/src/NWTC_RandomNumber.f90 @@ -35,7 +35,6 @@ MODULE NWTC_RandomNumber INTERFACE UniformRandomNumbers MODULE PROCEDURE UniformRandomNumbersR4 ! 4-byte reals MODULE PROCEDURE UniformRandomNumbersR8 ! 8-byte reals -MODULE PROCEDURE UniformRandomNumbersR16 ! 16-byte reals END INTERFACE CONTAINS @@ -159,32 +158,5 @@ SUBROUTINE UniformRandomNumbersR8( pRNG_Type, RandomNumbers ) END IF END SUBROUTINE UniformRandomNumbersR8 -!======================================================================= -!> \copydoc nwtc_randomnumber::uniformrandomnumbersr4 -SUBROUTINE UniformRandomNumbersR16( pRNG_Type, RandomNumbers ) - - IMPLICIT NONE - - INTEGER, INTENT(IN ) :: pRNG_Type - REAL(QuKi), INTENT( OUT), DIMENSION(:) :: RandomNumbers - - REAL(ReKi), ALLOCATABLE :: RN(:) - - IF ( pRNG_Type == pRNG_INTRINSIC ) THEN - - ! The Fortran intrinsic has an interface for various floating - ! point types, so pass the variable directly - CALL RANDOM_NUMBER( RandomNumbers ) - - ELSEIF ( pRNG_Type == pRNG_RANLUX ) THEN - - ! RanLux, as implemented, uses ReKi, so cast the return value as needed - ALLOCATE( RN( SIZE(RandomNumbers) ) ) - CALL RanLux ( RN ) - RandomNumbers = REAL(RN, KIND=QuKi) - - END IF - -END SUBROUTINE UniformRandomNumbersR16 END MODULE diff --git a/modules/nwtc-library/src/NetLib/scalapack/NWTC_ScaLAPACK.f90 b/modules/nwtc-library/src/NetLib/scalapack/NWTC_ScaLAPACK.f90 index 556220d10c..c458f774bb 100644 --- a/modules/nwtc-library/src/NetLib/scalapack/NWTC_ScaLAPACK.f90 +++ b/modules/nwtc-library/src/NetLib/scalapack/NWTC_ScaLAPACK.f90 @@ -43,7 +43,7 @@ SUBROUTINE ScaLAPACK_DLASRT2( ID, N, D, KEY, ErrStat, ErrMsg ) ! .. Array Arguments .. INTEGER, intent(inout) :: KEY( : ) - DOUBLE PRECISION,intent(inout) :: D( : ) ! On entry, the array to be sorted. On exit, D has been sorted into increasing/decreasing order, depending on ID + REAL(R8Ki) ,intent(inout) :: D( : ) ! On entry, the array to be sorted. On exit, D has been sorted into increasing/decreasing order, depending on ID ! Local variable INTEGER :: INFO ! = 0: successful exit; < 0: if INFO = -i, the i-th argument had an illegal value @@ -79,7 +79,7 @@ SUBROUTINE ScaLAPACK_SLASRT2( ID, N, D, KEY, ErrStat, ErrMsg ) ! .. Array Arguments .. INTEGER, intent(inout) :: KEY( : ) - REAL, intent(inout) :: D( : ) ! On entry, the array to be sorted. On exit, D has been sorted into increasing/decreasing order, depending on ID + REAL(R4Ki), intent(inout) :: D( : ) ! On entry, the array to be sorted. On exit, D has been sorted into increasing/decreasing order, depending on ID ! Local variable INTEGER :: INFO ! = 0: successful exit; < 0: if INFO = -i, the i-th argument had an illegal value diff --git a/modules/nwtc-library/src/NetLib/slatec/NWTC_SLATEC.f90 b/modules/nwtc-library/src/NetLib/slatec/NWTC_SLATEC.f90 index 68fe207779..bd95760387 100644 --- a/modules/nwtc-library/src/NetLib/slatec/NWTC_SLATEC.f90 +++ b/modules/nwtc-library/src/NetLib/slatec/NWTC_SLATEC.f90 @@ -47,20 +47,20 @@ MODULE NWTC_SLATEC !> Single precision wrapper for the qk61 integration routine from the slatec library !! Note that the qk61 routine follows -fdefault-real-8 setting, so it is of type ReKi subroutine wrap_qk61(func,low,hi,answer,abserr,resabs,resasc) - real(ReKi), intent(in ) :: low,hi ! integration limits - real(ReKi), intent( out) :: answer - real(ReKi), intent(in ) :: abserr,resabs,resasc - real(ReKi), external :: func ! function + real(R4Ki), intent(in ) :: low,hi ! integration limits + real(R4Ki), intent( out) :: answer + real(R4Ki), intent(in ) :: abserr,resabs,resasc + real(R4Ki), external :: func ! function call qk61(func,low,hi,answer,abserr,resabs,resasc) end subroutine wrap_qk61 !> Double precision wrapper for the dqk61 integration routine from the slatec library !! Note that the qk61 routine follows -fdefault-real-8 setting, so it is of type DbKi subroutine wrap_dqk61(func,low,hi,answer,abserr,resabs,resasc) - real(DbKi), intent(in ) :: low,hi ! integration limits - real(DbKi), intent( out) :: answer - real(DbKi), intent(in ) :: abserr,resabs,resasc - real(DbKi), external :: func ! function + real(R8Ki), intent(in ) :: low,hi ! integration limits + real(R8Ki), intent( out) :: answer + real(R8Ki), intent(in ) :: abserr,resabs,resasc + real(R8Ki), external :: func ! function call dqk61(func,low,hi,answer,abserr,resabs,resasc) end subroutine wrap_dqk61 diff --git a/modules/nwtc-library/src/Polynomial/quartic.f90 b/modules/nwtc-library/src/Polynomial/quartic.f90 index 176549241f..ee88e26eda 100644 --- a/modules/nwtc-library/src/Polynomial/quartic.f90 +++ b/modules/nwtc-library/src/Polynomial/quartic.f90 @@ -410,9 +410,9 @@ SUBROUTINE QuarticRoots(a,z) ! THE RESOLVENT CUBIC HAS ONLY REAL ROOTS ! REORDER THE ROOTS IN INCREASING ORDER - x1 = DBLE(z(1)) - x2 = DBLE(z(2)) - x3 = DBLE(z(3)) + x1 = REAL(z(1),8) + x2 = REAL(z(2),8) + x3 = REAL(z(3),8) IF (x1 > x2) CALL Swap(x1,x2) IF (x2 > x3) CALL Swap(x2,x3) IF (x1 > x2) CALL Swap(x1,x2) @@ -460,7 +460,7 @@ SUBROUTINE QuarticRoots(a,z) ! THE RESOLVENT CUBIC HAS COMPLEX ROOTS -60 t = DBLE(z(1)) +60 t = REAL(z(1),8) x = ZERO IF (t < ZERO) THEN GO TO 61 @@ -469,14 +469,14 @@ SUBROUTINE QuarticRoots(a,z) ELSE GO TO 62 END IF -61 h = ABS(DBLE(z(2))) + ABS(AIMAG(z(2))) +61 h = ABS(REAL(z(2),8)) + ABS(AIMAG(z(2))) IF (ABS(t) <= h) GO TO 70 GO TO 80 62 x = SQRT(t) IF (q > ZERO) x = -x 70 w = SQRT(z(2)) - u = TWO*DBLE(w) + u = TWO*REAL(w,8) v = TWO*ABS(AIMAG(w)) t = x - b x1 = t + u diff --git a/modules/nwtc-library/src/SingPrec.f90 b/modules/nwtc-library/src/SingPrec.f90 index 3f98240cda..edcfcf1740 100644 --- a/modules/nwtc-library/src/SingPrec.f90 +++ b/modules/nwtc-library/src/SingPrec.f90 @@ -21,10 +21,10 @@ !.................................................................................................................................. !> This module stores constants to specify the KIND of variables. !! -!! NOTE: When using preprocessor definition DOUBLE_PRECISION (which sets ReKi=R8Ki and DbKi=QuKi), you +!! NOTE: When using preprocessor definition DOUBLE_PRECISION (which sets ReKi=R8Ki), you !! may need to use a compile option to convert default reals to 8 bytes: \n -!! - Intel: /real_size:64 /double_size:128 -!! - Gnu: -fdefault-real-8 +!! - Intel: /real_size:64 +!! - Gnu: -fdefault-real-8 MODULE Precision !.................................................................................................................................. @@ -40,18 +40,15 @@ MODULE Precision INTEGER, PARAMETER :: B8Ki = SELECTED_INT_KIND( 18 ) !< Kind for eight-byte whole numbers #ifdef HAS_FORTRAN2008_FEATURES -INTEGER, PARAMETER :: QuKi = real128 !< Kind for 16-byte, floating-point numbers +INTEGER, PARAMETER :: R4Ki = real32 !< Kind for four-byte, floating-point numbers INTEGER, PARAMETER :: R8Ki = real64 !< Kind for eight-byte floating-point numbers -INTEGER, PARAMETER :: SiKi = real32 !< Kind for four-byte, floating-point numbers #else -INTEGER, PARAMETER :: QuKi = SELECTED_REAL_KIND( 20, 500 ) !< Kind for 16-byte, floating-point numbers +INTEGER, PARAMETER :: R4Ki = SELECTED_REAL_KIND( 6, 30 ) !< Kind for four-byte, floating-point numbers INTEGER, PARAMETER :: R8Ki = SELECTED_REAL_KIND( 14, 300 ) !< Kind for eight-byte floating-point numbers -INTEGER, PARAMETER :: SiKi = SELECTED_REAL_KIND( 6, 30 ) !< Kind for four-byte, floating-point numbers #endif -INTEGER, PARAMETER :: BYTES_IN_SiKi = 4 !< Number of bytes per SiKi number +INTEGER, PARAMETER :: BYTES_IN_R4Ki = 4 !< Number of bytes per R4Ki number INTEGER, PARAMETER :: BYTES_IN_R8Ki = 8 !< Number of bytes per R8Ki number -INTEGER, PARAMETER :: BYTES_IN_QuKi = 16 !< Number of bytes per QuKi number @@ -60,18 +57,18 @@ MODULE Precision INTEGER, PARAMETER :: IntKi = B4Ki !< Default kind for integers INTEGER, PARAMETER :: BYTES_IN_INT = 4 !< Number of bytes per IntKi number - use SIZEOF() -#if !defined (DOUBLE_PRECISION) && !defined (OPENFAST_DOUBLE_PRECISION) -INTEGER, PARAMETER :: ReKi = SiKi !< Default kind for floating-point numbers +INTEGER, PARAMETER :: SiKi = R4Ki !< Default kind for single floating-point numbers +INTEGER, PARAMETER :: BYTES_IN_SiKi = BYTES_IN_R4Ki !< Number of bytes per R4Ki number - use SIZEOF() + INTEGER, PARAMETER :: DbKi = R8Ki !< Default kind for double floating-point numbers - -INTEGER, PARAMETER :: BYTES_IN_REAL = BYTES_IN_SiKi !< Number of bytes per ReKi number - use SIZEOF() -INTEGER, PARAMETER :: BYTES_IN_DBL = BYTES_IN_R8Ki !< Number of bytes per DbKi number - use SIZEOF() -#else -INTEGER, PARAMETER :: ReKi = R8Ki !< Default kind for floating-point numbers -INTEGER, PARAMETER :: DbKi = QuKi !< Default kind for double floating-point numbers +INTEGER, PARAMETER :: BYTES_IN_DBL = BYTES_IN_R8Ki !< Number of bytes per R8Ki number - use SIZEOF() +#ifdef OPENFAST_DOUBLE_PRECISION +INTEGER, PARAMETER :: ReKi = R8Ki !< Default kind for floating-point numbers INTEGER, PARAMETER :: BYTES_IN_REAL = BYTES_IN_R8Ki !< Number of bytes per ReKi number - use SIZEOF() -INTEGER, PARAMETER :: BYTES_IN_DBL = BYTES_IN_QuKi !< Number of bytes per DbKi number - use SIZEOF() +#else +INTEGER, PARAMETER :: ReKi = R4Ki !< Default kind for floating-point numbers +INTEGER, PARAMETER :: BYTES_IN_REAL = BYTES_IN_R4Ki !< Number of bytes per ReKi number - use SIZEOF() #endif diff --git a/modules/nwtc-library/src/SysGnuLinux.f90 b/modules/nwtc-library/src/SysGnuLinux.f90 index 02d8fbb68c..d45d88b3c4 100644 --- a/modules/nwtc-library/src/SysGnuLinux.f90 +++ b/modules/nwtc-library/src/SysGnuLinux.f90 @@ -47,18 +47,16 @@ MODULE SysSubs INTERFACE NWTC_ERF ! Returns the ERF value of its argument MODULE PROCEDURE NWTC_ERFR4 MODULE PROCEDURE NWTC_ERFR8 - MODULE PROCEDURE NWTC_ERFR16 END INTERFACE INTERFACE NWTC_gamma ! Returns the gamma value of its argument ! note: gamma is part of the F08 standard, but may not be implemented everywhere... MODULE PROCEDURE NWTC_gammaR4 MODULE PROCEDURE NWTC_gammaR8 - MODULE PROCEDURE NWTC_gammaR16 END INTERFACE INTEGER, PARAMETER :: ConRecL = 120 ! The record length for console output. - INTEGER, PARAMETER :: CU = 6 ! The I/O unit for the console. Unit 6 causes ADAMS to crash. + INTEGER, PARAMETER :: CU = 6 ! The I/O unit for the console. INTEGER, PARAMETER :: MaxWrScrLen = 98 ! The maximum number of characters allowed to be written to a line in WrScr LOGICAL, PARAMETER :: KBInputOK = .TRUE. ! A flag to tell the program that keyboard input is allowed in the environment. CHARACTER(*), PARAMETER :: NewLine = ACHAR(10) ! The delimiter for New Lines [ Windows is CHAR(13)//CHAR(10); MAC is CHAR(13); Unix is CHAR(10) {CHAR(13)=\r is a line feed, CHAR(10)=\n is a new line}] @@ -131,18 +129,6 @@ FUNCTION NWTC_ERFR8( x ) END FUNCTION NWTC_ERFR8 !======================================================================= -FUNCTION NWTC_ERFR16( x ) - - ! Returns the ERF value of its argument. The result has a value equal - ! to the error function: 2/pi * integral_from_0_to_x of e^(-t^2) dt. - - REAL(QuKi), INTENT(IN) :: x ! input - REAL(QuKi) :: NWTC_ERFR16 ! result - - NWTC_ERFR16 = ERF( x ) - -END FUNCTION NWTC_ERFR16 -!======================================================================= FUNCTION NWTC_GammaR4( x ) ! Returns the gamma value of its argument. The result has a value equal @@ -167,18 +153,6 @@ FUNCTION NWTC_GammaR8( x ) END FUNCTION NWTC_GammaR8 !======================================================================= -FUNCTION NWTC_GammaR16( x ) - - ! Returns the gamma value of its argument. The result has a value equal - ! to a processor-dependent approximation to the gamma function of x. - - REAL(QuKi), INTENT(IN) :: x ! input - REAL(QuKi) :: NWTC_GammaR16 ! result - - NWTC_GammaR16 = gamma( x ) - -END FUNCTION NWTC_GammaR16 -!======================================================================= SUBROUTINE FlushOut ( Unit ) ! This subroutine flushes the buffer on the specified Unit. diff --git a/modules/nwtc-library/src/SysGnuWin.f90 b/modules/nwtc-library/src/SysGnuWin.f90 index 30ee9473e6..0905792bbc 100644 --- a/modules/nwtc-library/src/SysGnuWin.f90 +++ b/modules/nwtc-library/src/SysGnuWin.f90 @@ -47,18 +47,16 @@ MODULE SysSubs INTERFACE NWTC_ERF ! Returns the ERF value of its argument MODULE PROCEDURE NWTC_ERFR4 MODULE PROCEDURE NWTC_ERFR8 - MODULE PROCEDURE NWTC_ERFR16 END INTERFACE INTERFACE NWTC_gamma ! Returns the gamma value of its argument ! note: gamma is part of the F08 standard, but may not be implemented everywhere... MODULE PROCEDURE NWTC_gammaR4 MODULE PROCEDURE NWTC_gammaR8 - MODULE PROCEDURE NWTC_gammaR16 END INTERFACE INTEGER, PARAMETER :: ConRecL = 120 ! The record length for console output. - INTEGER, PARAMETER :: CU = 6 ! The I/O unit for the console. Unit 6 causes ADAMS to crash. + INTEGER, PARAMETER :: CU = 6 ! The I/O unit for the console. INTEGER, PARAMETER :: MaxWrScrLen = 98 ! The maximum number of characters allowed to be written to a line in WrScr LOGICAL, PARAMETER :: KBInputOK = .TRUE. ! A flag to tell the program that keyboard input is allowed in the environment. CHARACTER(*), PARAMETER :: NewLine = ACHAR(10) ! The delimiter for New Lines [ Windows is CHAR(13)//CHAR(10); MAC is CHAR(13); Unix is CHAR(10) {CHAR(13)=\r is a line feed, CHAR(10)=\n is a new line}] @@ -131,18 +129,6 @@ FUNCTION NWTC_ERFR8( x ) END FUNCTION NWTC_ERFR8 !======================================================================= -FUNCTION NWTC_ERFR16( x ) - - ! Returns the ERF value of its argument. The result has a value equal - ! to the error function: 2/pi * integral_from_0_to_x of e^(-t^2) dt. - - REAL(QuKi), INTENT(IN) :: x ! input - REAL(QuKi) :: NWTC_ERFR16 ! result - - NWTC_ERFR16 = ERF( x ) - -END FUNCTION NWTC_ERFR16 -!======================================================================= FUNCTION NWTC_GammaR4( x ) ! Returns the gamma value of its argument. The result has a value equal @@ -167,18 +153,6 @@ FUNCTION NWTC_GammaR8( x ) END FUNCTION NWTC_GammaR8 !======================================================================= -FUNCTION NWTC_GammaR16( x ) - - ! Returns the gamma value of its argument. The result has a value equal - ! to a processor-dependent approximation to the gamma function of x. - - REAL(QuKi), INTENT(IN) :: x ! input - REAL(QuKi) :: NWTC_GammaR16 ! result - - NWTC_GammaR16 = gamma( x ) - -END FUNCTION NWTC_GammaR16 -!======================================================================= SUBROUTINE FlushOut ( Unit ) ! This subroutine flushes the buffer on the specified Unit. diff --git a/modules/nwtc-library/src/SysIFL.f90 b/modules/nwtc-library/src/SysIFL.f90 index 4752deb39e..c6c439e890 100644 --- a/modules/nwtc-library/src/SysIFL.f90 +++ b/modules/nwtc-library/src/SysIFL.f90 @@ -47,18 +47,16 @@ MODULE SysSubs INTERFACE NWTC_ERF ! Returns the ERF value of its argument MODULE PROCEDURE NWTC_ERFR4 MODULE PROCEDURE NWTC_ERFR8 - MODULE PROCEDURE NWTC_ERFR16 END INTERFACE INTERFACE NWTC_gamma ! Returns the gamma value of its argument ! note: gamma is part of the F08 standard, but may not be implemented everywhere... MODULE PROCEDURE NWTC_gammaR4 MODULE PROCEDURE NWTC_gammaR8 - MODULE PROCEDURE NWTC_gammaR16 END INTERFACE INTEGER, PARAMETER :: ConRecL = 120 ! The record length for console output. - INTEGER, PARAMETER :: CU = 6 ! The I/O unit for the console. Unit 6 causes ADAMS to crash. + INTEGER, PARAMETER :: CU = 6 ! The I/O unit for the console. INTEGER, PARAMETER :: MaxWrScrLen = 98 ! The maximum number of characters allowed to be written to a line in WrScr LOGICAL, PARAMETER :: KBInputOK = .TRUE. ! A flag to tell the program that keyboard input is allowed in the environment. CHARACTER(*), PARAMETER :: NewLine = ACHAR(10) ! The delimiter for New Lines [ Windows is CHAR(13)//CHAR(10); MAC is CHAR(13); Unix is CHAR(10) {CHAR(13)=\r is a line feed, CHAR(10)=\n is a new line}] @@ -134,18 +132,6 @@ FUNCTION NWTC_ERFR8( x ) END FUNCTION NWTC_ERFR8 !======================================================================= -FUNCTION NWTC_ERFR16( x ) - - ! Returns the ERF value of its argument. The result has a value equal - ! to the error function: 2/pi * integral_from_0_to_x of e^(-t^2) dt. - - REAL(QuKi), INTENT(IN) :: x ! input - REAL(QuKi) :: NWTC_ERFR16 ! result - - NWTC_ERFR16 = ERF( x ) - -END FUNCTION NWTC_ERFR16 -!======================================================================= FUNCTION NWTC_GammaR4( x ) ! Returns the gamma value of its argument. The result has a value equal @@ -170,18 +156,6 @@ FUNCTION NWTC_GammaR8( x ) END FUNCTION NWTC_GammaR8 !======================================================================= -FUNCTION NWTC_GammaR16( x ) - - ! Returns the gamma value of its argument. The result has a value equal - ! to a processor-dependent approximation to the gamma function of x. - - REAL(QuKi), INTENT(IN) :: x ! input - REAL(QuKi) :: NWTC_GammaR16 ! result - - NWTC_GammaR16 = gamma( x ) - -END FUNCTION NWTC_GammaR16 -!======================================================================= SUBROUTINE FlushOut ( Unit ) ! This subroutine flushes the buffer on the specified Unit. diff --git a/modules/nwtc-library/src/SysIVF.f90 b/modules/nwtc-library/src/SysIVF.f90 index b05b5cccde..603ad6da7e 100644 --- a/modules/nwtc-library/src/SysIVF.f90 +++ b/modules/nwtc-library/src/SysIVF.f90 @@ -47,18 +47,16 @@ MODULE SysSubs INTERFACE NWTC_ERF ! Returns the ERF value of its argument MODULE PROCEDURE NWTC_ERFR4 MODULE PROCEDURE NWTC_ERFR8 - MODULE PROCEDURE NWTC_ERFR16 END INTERFACE INTERFACE NWTC_gamma ! Returns the gamma value of its argument ! note: gamma is part of the F08 standard, but may not be implemented everywhere... MODULE PROCEDURE NWTC_gammaR4 MODULE PROCEDURE NWTC_gammaR8 - MODULE PROCEDURE NWTC_gammaR16 END INTERFACE INTEGER, PARAMETER :: ConRecL = 120 ! The record length for console output. - INTEGER, PARAMETER :: CU = 7 ! The I/O unit for the console. Unit 6 causes ADAMS to crash. + INTEGER, PARAMETER :: CU = 7 ! The I/O unit for the console. INTEGER, PARAMETER :: MaxWrScrLen = 98 ! The maximum number of characters allowed to be written to a line in WrScr LOGICAL, PARAMETER :: KBInputOK = .TRUE. ! A flag to tell the program that keyboard input is allowed in the environment. CHARACTER(*), PARAMETER :: NewLine = ACHAR(10) ! The delimiter for New Lines [ Windows is CHAR(13)//CHAR(10); MAC is CHAR(13); Unix is CHAR(10) {CHAR(13)=\r is a line feed, CHAR(10)=\n is a new line}]; Note: NewLine change to ACHAR(10) here on Windows to fix issues with C/Fortran interoperability using WrScr @@ -137,19 +135,6 @@ FUNCTION NWTC_ERFR8( x ) END FUNCTION NWTC_ERFR8 !======================================================================= -!> \copydoc syssubs::nwtc_erfr4 -FUNCTION NWTC_ERFR16( x ) - - ! Returns the ERF value of its argument. The result has a value equal - ! to the error function: 2/pi * integral_from_0_to_x of e^(-t^2) dt. - - REAL(QuKi), INTENT(IN) :: x ! input - REAL(QuKi) :: NWTC_ERFR16 ! result - - NWTC_ERFR16 = ERF( x ) - -END FUNCTION NWTC_ERFR16 -!======================================================================= !> Returns the gamma value of its argument. The result has a value equal !! to a processor-dependent approximation to the gamma function of x: !! \f{equation}{ @@ -177,16 +162,6 @@ FUNCTION NWTC_GammaR8( x ) END FUNCTION NWTC_GammaR8 !======================================================================= -!> \copydoc syssubs::nwtc_gammar4 -FUNCTION NWTC_GammaR16( x ) - - REAL(QuKi), INTENT(IN) :: x ! input - REAL(QuKi) :: NWTC_GammaR16 ! result - - NWTC_GammaR16 = gamma( x ) - -END FUNCTION NWTC_GammaR16 -!======================================================================= !> This subroutine flushes the buffer on the specified Unit. !! It is especially useful when printing "running..." type messages. SUBROUTINE FlushOut ( Unit ) diff --git a/modules/nwtc-library/src/SysIVF_Labview.f90 b/modules/nwtc-library/src/SysIVF_Labview.f90 index 40b1600e9d..529ed52f32 100644 --- a/modules/nwtc-library/src/SysIVF_Labview.f90 +++ b/modules/nwtc-library/src/SysIVF_Labview.f90 @@ -60,13 +60,11 @@ MODULE SysSubs INTERFACE NWTC_gamma ! Returns the gamma value of its argument MODULE PROCEDURE NWTC_gammaR4 MODULE PROCEDURE NWTC_gammaR8 - MODULE PROCEDURE NWTC_gammaR16 END INTERFACE INTERFACE NWTC_ERF ! Returns the ERF value of its argument MODULE PROCEDURE NWTC_ERFR4 MODULE PROCEDURE NWTC_ERFR8 - MODULE PROCEDURE NWTC_ERFR16 END INTERFACE @@ -75,7 +73,7 @@ MODULE SysSubs INTEGER, PARAMETER :: ConRecL = 120 ! The record length for console output. - INTEGER, PARAMETER :: CU = 7 ! The I/O unit for the console. Unit 6 causes ADAMS to crash. + INTEGER, PARAMETER :: CU = 7 ! The I/O unit for the console. INTEGER, PARAMETER :: MaxWrScrLen = 98 ! The maximum number of characters allowed to be written to a line in WrScr LOGICAL, PARAMETER :: KBInputOK = .FALSE. ! A flag to tell the program that keyboard input is allowed in the environment. @@ -217,19 +215,6 @@ FUNCTION NWTC_ERFR8( x ) NWTC_ERFR8 = ERF( x ) END FUNCTION NWTC_ERFR8 -!======================================================================= - FUNCTION NWTC_ERFR16( x ) - - ! Returns the ERF value of its argument. The result has a value equal - ! to the error function: 2/pi * integral_from_0_to_x of e^(-t^2) dt. - - REAL(QuKi), INTENT(IN) :: x ! input - REAL(QuKi) :: NWTC_ERFR16 ! result - - - NWTC_ERFR16 = ERF( x ) - - END FUNCTION NWTC_ERFR16 !======================================================================= FUNCTION NWTC_GammaR4( x ) @@ -256,19 +241,6 @@ FUNCTION NWTC_GammaR8( x ) NWTC_GammaR8 = gamma( x ) END FUNCTION NWTC_GammaR8 -!======================================================================= - FUNCTION NWTC_GammaR16( x ) - - ! Returns the gamma value of its argument. The result has a value equal - ! to a processor-dependent approximation to the gamma function of x. - - REAL(QuKi), INTENT(IN) :: x ! input - REAL(QuKi) :: NWTC_GammaR16 ! result - - - NWTC_GammaR16 = gamma( x ) - - END FUNCTION NWTC_GammaR16 !======================================================================= SUBROUTINE OpenCon diff --git a/modules/nwtc-library/src/SysMatlabLinuxGnu.f90 b/modules/nwtc-library/src/SysMatlabLinuxGnu.f90 index faee037394..d69f227433 100644 --- a/modules/nwtc-library/src/SysMatlabLinuxGnu.f90 +++ b/modules/nwtc-library/src/SysMatlabLinuxGnu.f90 @@ -50,18 +50,16 @@ MODULE SysSubs INTERFACE NWTC_ERF ! Returns the ERF value of its argument MODULE PROCEDURE NWTC_ERFR4 MODULE PROCEDURE NWTC_ERFR8 - MODULE PROCEDURE NWTC_ERFR16 END INTERFACE INTERFACE NWTC_gamma ! Returns the gamma value of its argument ! note: gamma is part of the F08 standard, but may not be implemented everywhere... MODULE PROCEDURE NWTC_gammaR4 MODULE PROCEDURE NWTC_gammaR8 - MODULE PROCEDURE NWTC_gammaR16 END INTERFACE INTEGER, PARAMETER :: ConRecL = 120 ! The record length for console output. - INTEGER, PARAMETER :: CU = 6 ! The I/O unit for the console. Unit 6 causes ADAMS to crash. + INTEGER, PARAMETER :: CU = 6 ! The I/O unit for the console. INTEGER, PARAMETER :: MaxWrScrLen = 98 ! The maximum number of characters allowed to be written to a line in WrScr LOGICAL, PARAMETER :: KBInputOK = .FALSE. ! A flag to tell the program that keyboard input is allowed in the environment. CHARACTER(*), PARAMETER :: NewLine = ACHAR(10) ! The delimiter for New Lines [ Windows is CHAR(13)//CHAR(10); MAC is CHAR(13); Unix is CHAR(10) {CHAR(13)=\r is a line feed, CHAR(10)=\n is a new line}] @@ -134,18 +132,6 @@ FUNCTION NWTC_ERFR8( x ) END FUNCTION NWTC_ERFR8 !======================================================================= -FUNCTION NWTC_ERFR16( x ) - - ! Returns the ERF value of its argument. The result has a value equal - ! to the error function: 2/pi * integral_from_0_to_x of e^(-t^2) dt. - - REAL(QuKi), INTENT(IN) :: x ! input - REAL(QuKi) :: NWTC_ERFR16 ! result - - NWTC_ERFR16 = ERF( x ) - -END FUNCTION NWTC_ERFR16 -!======================================================================= FUNCTION NWTC_GammaR4( x ) ! Returns the gamma value of its argument. The result has a value equal @@ -170,18 +156,6 @@ FUNCTION NWTC_GammaR8( x ) END FUNCTION NWTC_GammaR8 !======================================================================= -FUNCTION NWTC_GammaR16( x ) - - ! Returns the gamma value of its argument. The result has a value equal - ! to a processor-dependent approximation to the gamma function of x. - - REAL(QuKi), INTENT(IN) :: x ! input - REAL(QuKi) :: NWTC_GammaR16 ! result - - NWTC_GammaR16 = gamma( x ) - -END FUNCTION NWTC_GammaR16 -!======================================================================= SUBROUTINE FlushOut ( Unit ) ! This subroutine flushes the buffer on the specified Unit. diff --git a/modules/nwtc-library/src/SysMatlabLinuxIntel.f90 b/modules/nwtc-library/src/SysMatlabLinuxIntel.f90 index daa14592e5..c521e449f0 100644 --- a/modules/nwtc-library/src/SysMatlabLinuxIntel.f90 +++ b/modules/nwtc-library/src/SysMatlabLinuxIntel.f90 @@ -50,18 +50,16 @@ MODULE SysSubs INTERFACE NWTC_ERF ! Returns the ERF value of its argument MODULE PROCEDURE NWTC_ERFR4 MODULE PROCEDURE NWTC_ERFR8 - MODULE PROCEDURE NWTC_ERFR16 END INTERFACE INTERFACE NWTC_gamma ! Returns the gamma value of its argument ! note: gamma is part of the F08 standard, but may not be implemented everywhere... MODULE PROCEDURE NWTC_gammaR4 MODULE PROCEDURE NWTC_gammaR8 - MODULE PROCEDURE NWTC_gammaR16 END INTERFACE INTEGER, PARAMETER :: ConRecL = 120 ! The record length for console output. - INTEGER, PARAMETER :: CU = 6 ! The I/O unit for the console. Unit 6 causes ADAMS to crash. + INTEGER, PARAMETER :: CU = 6 ! The I/O unit for the console. INTEGER, PARAMETER :: MaxWrScrLen = 98 ! The maximum number of characters allowed to be written to a line in WrScr LOGICAL, PARAMETER :: KBInputOK = .FALSE. ! A flag to tell the program that keyboard input is allowed in the environment. CHARACTER(*), PARAMETER :: NewLine = ACHAR(10) ! The delimiter for New Lines [ Windows is CHAR(13)//CHAR(10); MAC is CHAR(13); Unix is CHAR(10) {CHAR(13)=\r is a line feed, CHAR(10)=\n is a new line}] @@ -137,18 +135,6 @@ FUNCTION NWTC_ERFR8( x ) END FUNCTION NWTC_ERFR8 !======================================================================= -FUNCTION NWTC_ERFR16( x ) - - ! Returns the ERF value of its argument. The result has a value equal - ! to the error function: 2/pi * integral_from_0_to_x of e^(-t^2) dt. - - REAL(QuKi), INTENT(IN) :: x ! input - REAL(QuKi) :: NWTC_ERFR16 ! result - - NWTC_ERFR16 = ERF( x ) - -END FUNCTION NWTC_ERFR16 -!======================================================================= FUNCTION NWTC_GammaR4( x ) ! Returns the gamma value of its argument. The result has a value equal @@ -173,18 +159,6 @@ FUNCTION NWTC_GammaR8( x ) END FUNCTION NWTC_GammaR8 !======================================================================= -FUNCTION NWTC_GammaR16( x ) - - ! Returns the gamma value of its argument. The result has a value equal - ! to a processor-dependent approximation to the gamma function of x. - - REAL(QuKi), INTENT(IN) :: x ! input - REAL(QuKi) :: NWTC_GammaR16 ! result - - NWTC_GammaR16 = gamma( x ) - -END FUNCTION NWTC_GammaR16 -!======================================================================= SUBROUTINE FlushOut ( Unit ) ! This subroutine flushes the buffer on the specified Unit. diff --git a/modules/nwtc-library/src/SysMatlabWindows.f90 b/modules/nwtc-library/src/SysMatlabWindows.f90 index 07ecad85ec..ff266e9b13 100644 --- a/modules/nwtc-library/src/SysMatlabWindows.f90 +++ b/modules/nwtc-library/src/SysMatlabWindows.f90 @@ -36,21 +36,19 @@ MODULE SysSubs INTERFACE NWTC_ERF ! Returns the ERF value of its argument MODULE PROCEDURE NWTC_ERFR4 MODULE PROCEDURE NWTC_ERFR8 - MODULE PROCEDURE NWTC_ERFR16 END INTERFACE INTERFACE NWTC_gamma ! Returns the gamma value of its argument ! note: gamma is part of the F08 standard, but may not be implemented everywhere... MODULE PROCEDURE NWTC_gammaR4 MODULE PROCEDURE NWTC_gammaR8 - MODULE PROCEDURE NWTC_gammaR16 END INTERFACE !======================================================================= INTEGER, PARAMETER :: ConRecL = 120 ! The record length for console output. - INTEGER, PARAMETER :: CU = 6 ! The I/O unit for the console. Unit 6 causes ADAMS to crash. + INTEGER, PARAMETER :: CU = 6 ! The I/O unit for the console. INTEGER, PARAMETER :: MaxWrScrLen = 98 ! The maximum number of characters allowed to be written to a line in WrScr LOGICAL, PARAMETER :: KBInputOK = .FALSE. ! A flag to tell the program that keyboard input is allowed in the environment. @@ -175,19 +173,6 @@ FUNCTION NWTC_ERFR8( x ) END FUNCTION NWTC_ERFR8 !======================================================================= -!> \copydoc syssubs::nwtc_erfr4 -FUNCTION NWTC_ERFR16( x ) - - ! Returns the ERF value of its argument. The result has a value equal - ! to the error function: 2/pi * integral_from_0_to_x of e^(-t^2) dt. - - REAL(QuKi), INTENT(IN) :: x ! input - REAL(QuKi) :: NWTC_ERFR16 ! result - - NWTC_ERFR16 = ERF( x ) - -END FUNCTION NWTC_ERFR16 -!======================================================================= !> Returns the gamma value of its argument. The result has a value equal !! to a processor-dependent approximation to the gamma function of x: !! \f{equation}{ @@ -215,16 +200,6 @@ FUNCTION NWTC_GammaR8( x ) END FUNCTION NWTC_GammaR8 !======================================================================= -!> \copydoc syssubs::nwtc_gammar4 -FUNCTION NWTC_GammaR16( x ) - - REAL(QuKi), INTENT(IN) :: x ! input - REAL(QuKi) :: NWTC_GammaR16 ! result - - NWTC_GammaR16 = gamma( x ) - -END FUNCTION NWTC_GammaR16 -!======================================================================= !> This routine creates a given directory if it does not already exist. SUBROUTINE MKDIR ( new_directory_path ) diff --git a/modules/nwtc-library/src/YAML.f90 b/modules/nwtc-library/src/YAML.f90 index 8e39a0b476..5af02a2097 100644 --- a/modules/nwtc-library/src/YAML.f90 +++ b/modules/nwtc-library/src/YAML.f90 @@ -18,7 +18,7 @@ ! !********************************************************************************************************************************** module YAML - use Precision, only: IntKi, SiKi, R8Ki, QuKi + use Precision, only: IntKi, SiKi, R8Ki use NWTC_Base, only: ErrID_None, ErrID_Fatal use NWTC_IO, only: num2lstr @@ -34,8 +34,6 @@ module YAML module procedure yaml_write_array1R8 ! Single dimension array (Ary) of R8Ki module procedure yaml_write_array2R8 ! Two dimension array of R8Ki module procedure yaml_write_array2I ! Two dimension array of IntKi - module procedure yaml_write_array1R16 ! Single dimension array (Ary) of QuKi - module procedure yaml_write_array2R16 ! Two dimension array of QuKi end interface !> Write list to file @@ -43,7 +41,6 @@ module YAML module procedure yaml_write_listI ! Single dimension array (Ary) of IntKi module procedure yaml_write_listR4 ! Single dimension array (Ary) of SiKi module procedure yaml_write_listR8 ! Single dimension array (Ary) of R8Ki - module procedure yaml_write_listR16 ! Single dimension array (Ary) of QuKi end interface !> Write variable to file @@ -52,7 +49,6 @@ module YAML module procedure yaml_write_varI ! IntKi module procedure yaml_write_varR4 ! SiKi module procedure yaml_write_varR8 ! R8Ki - module procedure yaml_write_varR16 ! QuKi end interface private @@ -189,34 +185,6 @@ subroutine yaml_write_varR8(fid, key, val, VarFmt, ErrStat, ErrMsg, level, comme endif end subroutine yaml_write_varR8 -subroutine yaml_write_varR16(fid, key, val, VarFmt, ErrStat, ErrMsg, level, comment) - integer(IntKi), intent(in ) :: fid !< File Unit - character(len=*), intent(in ) :: key !< Variable name - real(QuKi), intent(in ) :: val !< Value - character(len=*), intent(in ) :: VarFmt !< Format for printing real numbers - integer, intent( out) :: ErrStat !< A non-zero value indicates an error occurred - character(len=*), intent( out) :: ErrMsg !< Error message if errstat /= errid_none - integer(IntKi), optional, intent(in ) :: level !< indentation level - character(len=*), optional, intent(in ) :: comment !< - character(256) :: Fmt - ErrStat = ErrID_None - ErrMsg = "" - Fmt = '' - if (present(level)) Fmt = trim(Num2LStr(level*INDENT_SPACES))//'X,' - if (present(comment)) then - Fmt = '('//trim(Fmt)//'A,": ",'//trim(VarFmt)//', " # ",A)' - write(fid, Fmt, iostat=ErrStat) key, val, comment - else - Fmt = '('//trim(Fmt)//'A,": ",'//trim(VarFmt)//')' - write(fid, Fmt, iostat=ErrStat) key, val - endif - if (ErrStat /= 0) then - ErrStat = ErrID_Fatal - ErrMsg = 'Error writing variable '//trim(key)//' to YAML file' - endif -end subroutine yaml_write_varR16 - - ! --------------------------------------------------------------------------------} ! --- Write List @@ -347,47 +315,6 @@ subroutine yaml_write_listR8(fid, key, A, VarFmt, ErrStat, ErrMsg, level, commen end if end subroutine yaml_write_listR8 -subroutine yaml_write_listR16(fid, key, A, VarFmt, ErrStat, ErrMsg, level, comment) - integer(IntKi), intent(in ) :: fid !< File Unit - character(len=*), intent(in ) :: key !< list name - real(QuKi), dimension(:), intent(in ) :: A !< list - character(len=*), intent(in ) :: VarFmt !< Format for printing real numbers - integer, intent( out) :: ErrStat !< A non-zero value indicates an error occurred - character(len=*), intent( out) :: ErrMsg !< Error message if errstat /= errid_none - integer(IntKi), optional, intent(in ) :: level !< indentation level - character(len=*), optional, intent(in ) :: comment !< - integer :: nc ! size (rows and columns) of A - character(256) :: Fmt - ErrStat = ErrID_None - ErrMsg = "" - nc = size(A,1) - Fmt = '' - if (present(level)) Fmt = trim(Num2LStr(level*INDENT_SPACES))//'X,' - if (nc==0) then - if (present(comment)) then - write(fid, '('//trim(Fmt)//'A,": []",1X,"#",1X,A)', iostat=ErrStat) trim(key), trim(comment) - else - write(fid, '('//trim(Fmt)//'A,": []")', iostat=ErrStat) trim(key) - endif - else - if (nc==1) then - Fmt = '('//trim(Fmt)//'A,": [",'//VarFmt//',"]"' - else - Fmt = '('//trim(Fmt)//'A,": [",'//trim(Num2LStr(nc-1))//'('//VarFmt//',","), '//VarFmt//'"]"' - endif - if (present(comment)) then - Fmt = trim(Fmt)//',1X,"#",1X,A)' - write(fid, Fmt, iostat=ErrStat)trim(key), A(:), trim(comment) - else - Fmt = trim(Fmt)//')' - write(fid, Fmt, iostat=ErrStat)trim(key), A(:) - endif - endif - if (ErrStat /= 0) then - ErrStat = ErrID_Fatal - ErrMsg = 'Error writing list '//trim(key)//' to YAML file' - end if -end subroutine yaml_write_listR16 ! -------------------------------------------------------------------------------- ! --- Write 1D array @@ -506,45 +433,6 @@ subroutine yaml_write_array1R8(fid, key, A, VarFmt, ErrStat, ErrMsg, level, comm end if end subroutine yaml_write_array1R8 -subroutine yaml_write_array1R16(fid, key, A, VarFmt, ErrStat, ErrMsg, level, comment) - integer(IntKi), intent(in ) :: fid !< File Unit - character(len=*), intent(in ) :: key !< Array name - real(QuKi), dimension(:), intent(in ) :: A !< Array - character(len=*), intent(in ) :: VarFmt !< Format for printing real numbers - integer, intent( out) :: ErrStat !< A non-zero value indicates an error occurred - character(len=*), intent( out) :: ErrMsg !< Error message if errstat /= errid_none - integer(IntKi), optional, intent(in ) :: level !< indentation level - character(len=*), optional, intent(in ) :: comment !< - integer :: nc ! size (rows and columns) of A - character(256) :: Fmt - ErrStat = ErrID_None - ErrMsg = "" - nc = size(A,1) - Fmt = '' - if (present(level)) Fmt = trim(Num2LStr(level*INDENT_SPACES))//'X,' - if (present(comment)) then - write(fid, '('//trim(Fmt)//'A,": # ",I0," x ",I0,1X,A)', iostat=ErrStat ) trim(key), 1, nc, trim(comment) - else - write(fid, '('//trim(Fmt)//'A,": # ",I0," x ",I0)' , iostat=ErrStat ) trim(key),1,nc - end if - if (present(level)) then - Fmt = trim(Num2LStr((level+1)*INDENT_SPACES))//'X,' - else - Fmt = trim(Num2LStr(INDENT_SPACES))//'X,' - endif - if (nc==0) then - write(fid, '('//trim(Fmt)//'"- [ ]")', iostat=ErrStat) - else - Fmt = '('//trim(Fmt)//'"- [",'//trim(Num2LStr(nc))//'('//VarFmt//',","),"]")' - write(fid, Fmt, iostat=ErrStat) A(:) - endif - if (ErrStat /= 0) then - ErrStat = ErrID_Fatal - ErrMsg = 'Error writing array '//trim(key)//' to YAML file' - end if -end subroutine yaml_write_array1R16 - - ! --------------------------------------------------------------------------------} ! --- Write Array 2D @@ -718,58 +606,4 @@ subroutine yaml_write_array2R8(fid, key, A, VarFmt, ErrStat, ErrMsg, level, comm end if end subroutine yaml_write_array2R8 -subroutine yaml_write_array2R16(fid, key, A, VarFmt, ErrStat, ErrMsg, level, comment, AllFmt) - integer(IntKi), intent(in ) :: fid !< File Unit - character(len=*), intent(in ) :: key !< Array name - real(QuKi), dimension(:,:), intent(in ) :: A !< Array - character(len=*), intent(in ) :: VarFmt !< Format for printing real numbers - integer, intent( out) :: ErrStat !< A non-zero value indicates an error occurred - character(len=*), intent( out) :: ErrMsg !< Error message if errstat /= errid_none - integer(IntKi), optional, intent(in ) :: level !< indentation level - character(len=*), optional, intent(in ) :: comment !< - character(len=*), optional, intent(in ) :: AllFmt !< Format for printing a line - integer :: nr, nc, i ! size (rows and columns) of A - character(256) :: Fmt - ErrStat = ErrID_None - ErrMsg = "" - nr = size(A,1) - nc = size(A,2) - Fmt='' - - ! Indent and Key - if (present(level)) Fmt = trim(Num2LStr(level*INDENT_SPACES))//'X,' - if (present(comment)) then - write(fid, '('//trim(Fmt)//'A,": # ",I0," x ",I0,1X,A)', iostat=ErrStat ) trim(key), nr, nc, trim(comment) - else - write(fid, '('//trim(Fmt)//'A,": # ",I0," x ",I0)' , iostat=ErrStat ) trim(key),nr,nc - end if - if (present(level)) then - Fmt = trim(Num2LStr((level+1)*INDENT_SPACES))//'X,' - else - Fmt = trim(Num2LStr(INDENT_SPACES))//'X,' - endif - ! Data - if (nr==0) then - write(fid, '('//trim(Fmt)//'"- [ ]")', iostat=ErrStat) - else - ! YAML Line format - if (present(AllFmt)) then - Fmt = '('//trim(Fmt)//'"- [",'//trim(AllFmt)//'"]")' - elseif (nc==1) then - Fmt = '('//trim(Fmt)//'"- [", '//trim(Num2LStr(nc))//'('//VarFmt//'), "]")' - else - Fmt = '('//trim(Fmt)//'"- [", '//trim(Num2LStr(nc-1))//'('//VarFmt//', ","), '//VarFmt//', "]")' - endif - ! Write line by line - do i=1,nr - write(fid, Fmt, iostat=ErrStat) A(i,:) - end do - endif - if (ErrStat /= 0) then - ErrStat = ErrID_Fatal - ErrMsg = 'Error writing array '//trim(key)//' to YAML file' - end if -end subroutine yaml_write_array2R16 - - end module YAML diff --git a/modules/openfast-library/src/FAST_Mods.f90 b/modules/openfast-library/src/FAST_Mods.f90 index c0215f53ad..a98e8d15b8 100644 --- a/modules/openfast-library/src/FAST_Mods.f90 +++ b/modules/openfast-library/src/FAST_Mods.f90 @@ -64,8 +64,6 @@ MODULE FAST_ModTypes INTEGER(IntKi), PARAMETER :: SizeJac_ED_HD = 12 - LOGICAL, PARAMETER :: GenerateAdamsModel = .FALSE. - LOGICAL, PARAMETER :: BD_Solve_Option1 = .TRUE. diff --git a/modules/openfast-library/src/FAST_Solver.f90 b/modules/openfast-library/src/FAST_Solver.f90 index c7ab928448..54c3d5dc48 100644 --- a/modules/openfast-library/src/FAST_Solver.f90 +++ b/modules/openfast-library/src/FAST_Solver.f90 @@ -3312,6 +3312,7 @@ END SUBROUTINE U_FullOpt1_Residual !............................................................................................................................... SUBROUTINE CleanUp() INTEGER(IntKi) :: ErrStat3 ! The error identifier (ErrStat) + INTEGER(IntKi) :: nb CHARACTER(ErrMsgLen) :: ErrMsg3 ! The error message (ErrMsg) INTEGER(IntKi) :: nb_local diff --git a/modules/servodyn/src/PitchCntrl_ACH.f90 b/modules/servodyn/src/PitchCntrl_ACH.f90 index 167851ce23..f1d9533963 100644 --- a/modules/servodyn/src/PitchCntrl_ACH.f90 +++ b/modules/servodyn/src/PitchCntrl_ACH.f90 @@ -11,15 +11,14 @@ SUBROUTINE PitchCntrl ( BlPitch, ElecPwr, LSS_Spd, TwrAccel, NB, ZTime, DT, DirR ! This routine reads a data file containing user specified transfer - ! function information to allow the use of control systems in FAST - ! and ADAMS. The parameters read in, and array dimensions may be - ! adjusted to suit the users need. + ! function information to allow the use of control systems in FAST. + ! The parameters read in, and array dimensions may be adjusted to + ! suit the users need. ! The transfer function coefficients are read in, then converted to ! state space form for integration using a fourth order Runge-Kutta ! integration scheme. ! This routine was originally written by C. Hansen in Fortran 77 for - ! use with FAST and ADAMS. It was converted to Modern Fortran by - ! J. Jonkman. + ! use with FAST. It was converted to Modern Fortran by J. Jonkman. USE NWTC_Library @@ -429,8 +428,7 @@ SUBROUTINE CTRL4 ( CNST, AC, BC, NORDER, MSZ, NSZ, & ! Now apply fourth transfer function to represent the actuator - ! (Do not use this actuator in ADAMS. If order of 4th - ! transfer function is zero, this transfer function is not applied) + ! (If order of 4th transfer function is zero, this transfer function is not applied) IF ( NORDER(4) == 0 ) THEN DO K=1,NB diff --git a/modules/servodyn/src/StrucCtrl.f90 b/modules/servodyn/src/StrucCtrl.f90 index 04598a739e..60c9efd530 100644 --- a/modules/servodyn/src/StrucCtrl.f90 +++ b/modules/servodyn/src/StrucCtrl.f90 @@ -50,6 +50,7 @@ MODULE StrucCtrl INTEGER(IntKi), PRIVATE, PARAMETER :: DOFMode_Omni = 2 !< omni-directional INTEGER(IntKi), PRIVATE, PARAMETER :: DOFMode_TLCD = 3 !< tuned liquid column dampers !MEG & SP INTEGER(IntKi), PRIVATE, PARAMETER :: DOFMode_Prescribed = 4 !< prescribed force series + INTEGER(IntKi), PRIVATE, PARAMETER :: DOFMode_ForceDLL = 5 !< prescribed force series INTEGER(IntKi), PRIVATE, PARAMETER :: CMODE_Semi = 1 !< semi-active control INTEGER(IntKi), PRIVATE, PARAMETER :: CMODE_ActiveEXTERN = 4 !< active control @@ -971,6 +972,23 @@ SUBROUTINE StC_CalcOutput( Time, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrM y%Mesh(i_pt)%Moment(1:3,1) = matmul(transpose(u%Mesh(i_pt)%Orientation(:,:,1)), m%M_P(1:3,i_pt)) enddo endif + ELSEIF ( p%StC_DOF_MODE == DOFMode_ForceDLL ) THEN + ! Note that the prescribed force is applied the same to all Mesh pts + ! that are passed into this instance of the StC + if (p%PrescribedForcesCoordSys == PRESCRIBED_FORCE_GLOBAL) then + ! Global coords + do i_pt=1,p%NumMeshPts + y%Mesh(i_pt)%Force(1:3,1) = m%F_ext(1:3,i_pt) + y%Mesh(i_pt)%Moment(1:3,1) = 0 + enddo + ! Leave in for now just in case we decide there is a use case for a follower force from the DLL + ! elseif (p%PrescribedForcesCoordSys == PRESCRIBED_FORCE_LOCAL) then + ! ! local coords + ! do i_pt=1,p%NumMeshPts + ! y%Mesh(i_pt)%Force(1:3,1) = matmul(transpose(u%Mesh(i_pt)%Orientation(:,:,1)), m%F_P(1:3,i_pt)) + ! y%Mesh(i_pt)%Moment(1:3,1) = matmul(transpose(u%Mesh(i_pt)%Orientation(:,:,1)), m%M_P(1:3,i_pt)) + ! enddo + endif END IF ! Set output values for the measured displacements for @@ -1256,7 +1274,7 @@ SUBROUTINE StC_CalcContStateDeriv( Time, u, p, x, xd, z, OtherState, m, dxdt, Er dxdt%StC_x(6,i_pt) = 0.0_ReKi ! Z is off enddo - ELSE IF ( p%StC_DOF_MODE == DOFMode_Prescribed ) THEN + ELSE IF ( p%StC_DOF_MODE == DOFMode_Prescribed .or. p%StC_DOF_MODE == DOFMode_ForceDLL) THEN ! if prescribed forces, there are no states to advance, so return do i_pt=1,p%NumMeshPts dxdt%StC_x(1,i_pt) = 0 @@ -2139,9 +2157,10 @@ subroutine StC_ValidatePrimaryData( InputFileData, InitInp, ErrStat, ErrMsg ) InputFileData%StC_DOF_MODE /= DOFMode_Indept .and. & InputFileData%StC_DOF_MODE /= DOFMode_Omni .and. & InputFileData%StC_DOF_MODE /= DOFMode_TLCD .and. & - InputFileData%StC_DOF_MODE /= DOFMode_Prescribed) & + InputFileData%StC_DOF_MODE /= DOFMode_Prescribed .and. & + InputFileData%StC_DOF_MODE /= DOFMode_ForceDLL) & CALL SetErrStat( ErrID_Fatal, 'DOF mode (StC_DOF_MODE) must be 0 (no DOF), 1 (two independent DOFs), '// & - 'or 2 (omni-directional), or 3 (TLCD), or 4 (prescribed force time-series).', ErrStat, ErrMsg, RoutineName ) + 'or 2 (omni-directional), or 3 (TLCD), 4 (prescribed force time-series), or 5 (force from external DLL).', ErrStat, ErrMsg, RoutineName ) ! Check control modes IF ( InputFileData%StC_CMODE /= ControlMode_None .and. & @@ -2153,9 +2172,12 @@ subroutine StC_ValidatePrimaryData( InputFileData, InitInp, ErrStat, ErrMsg ) ! Check control channel if ( InputFileData%StC_CMode == CMODE_ActiveDLL ) then - if ( InputFileData%StC_DOF_MODE /= DOFMode_Indept .and. InputFileData%StC_DOF_MODE /= DOFMode_Omni ) then + if ( InputFileData%StC_DOF_MODE /= DOFMode_Indept .and. & + InputFileData%StC_DOF_MODE /= DOFMode_Omni .and. & + InputFileData%StC_DOF_MODE /= DOFMode_ForceDLL) then call SetErrStat( ErrID_Fatal, 'Control mode 4 (active with Simulink control), or 5 (active with DLL control) '// & - 'can only be used with independent or omni DOF (StC_DOF_Mode=1 or 2) in this version of StrucCtrl.', ErrStat, ErrMsg, RoutineName ) + 'can only be used with independent or omni DOF (StC_DOF_Mode=1 or 2) or force from external DLL '// & + '(StC_DOF_Mode = 5) in this version of StrucCtrl.', ErrStat, ErrMsg, RoutineName ) endif if (InitInp%NumMeshPts > 1) then do i=2,InitInp%NumMeshPts ! Warn if controlling multiple mesh points with single instance (blade TMD) @@ -2191,6 +2213,21 @@ subroutine StC_ValidatePrimaryData( InputFileData, InitInp, ErrStat, ErrMsg ) endif endif + ! DLL Force - not sure if necessary, but nothing happens if these inputs are incorrect + if (InputFileData%StC_DOF_MODE == DOFMode_ForceDLL) then + + ! Need global force coord + if (InputFileData%PrescribedForcesCoordSys /= PRESCRIBED_FORCE_GLOBAL) THEN + call SetErrStat( ErrID_Fatal, 'PrescribedForcesCoordSys must be global ('//trim(Num2LStr(PRESCRIBED_FORCE_GLOBAL))// & + ') when StC_DOF_MODE is '//trim(Num2LStr(DOFMode_ForceDLL)) , ErrStat, ErrMsg, RoutineName ) + endif + + ! Need active DLL control + if (InputFileData%StC_CMODE /= CMODE_ActiveDLL) THEN + call SetErrStat( ErrID_Fatal, 'StC_CMODE must be '//trim(Num2LStr(CMODE_ActiveDLL))// & + ' when StC_DOF_MODE is '//trim(Num2LStr(DOFMode_ForceDLL)) , ErrStat, ErrMsg, RoutineName ) + endif + endif ! Check masses make some kind of sense if (InputFileData%StC_DOF_MODE == DOFMode_Indept .and. InputFileData%StC_X_DOF .and. (InputFileData%StC_X_M <= 0.0_ReKi) ) & diff --git a/modules/servodyn/src/UserSubs.f90 b/modules/servodyn/src/UserSubs.f90 index 64c3501f65..7ac97a52f4 100644 --- a/modules/servodyn/src/UserSubs.f90 +++ b/modules/servodyn/src/UserSubs.f90 @@ -85,9 +85,6 @@ module UserSubs ! ! the DOF, respectively. Turning off the DOF forces the ! ! current RATE to remain fixed. If the rate is currently zero, ! ! the current POSITION will remain fixed as well. -! ! Note that this technique WILL NOT work for user-defined routines -! ! written for ADAMS datasets extracted using the FAST-to-ADAMS -! ! preprocessor. ! ! !USE Precision @@ -148,9 +145,6 @@ SUBROUTINE UserHSSBr ( GenTrq, ElecPwr, HSS_Spd, NumBl, ZTime, DT, DirRoot, HSSB ! the DOF, respectively. Turning off the DOF forces the ! current RATE to remain fixed. If the rate is currently zero, ! the current POSITION will remain fixed as well. - ! Note that this technique WILL NOT work for user-defined routines - ! written for ADAMS datasets extracted using the FAST-to-ADAMS - ! preprocessor. USE Precision @@ -174,7 +168,7 @@ SUBROUTINE UserHSSBr ( GenTrq, ElecPwr, HSS_Spd, NumBl, ZTime, DT, DirRoot, HSSB -HSSBrFrac = 0.0 ! NOTE: This must be specified as a real number between 0.0 (off - no brake torque) and 1.0 (full - max brake torque = HSSBrTqF); FAST/ADAMS will Abort otherwise. +HSSBrFrac = 0.0 ! NOTE: This must be specified as a real number between 0.0 (off - no brake torque) and 1.0 (full - max brake torque = HSSBrTqF); FAST will Abort otherwise. @@ -256,9 +250,6 @@ END SUBROUTINE UserTFin ! ! the DOF, respectively. Turning off the DOF forces the ! ! current RATE to remain fixed. If the rate is currently zero, ! ! the current POSITION will remain fixed as well. -! ! Note that this technique WILL NOT work for user-defined routines -! ! written for ADAMS datasets extracted using the FAST-to-ADAMS -! ! preprocessor. ! ! !USE Precision @@ -419,10 +410,7 @@ SUBROUTINE UserYawCont ( YawPos, YawRate, WindDir, YawError, NumBl, ZTime, DT, D ! setting YawDOF to False. ! This technique is useful, for example, if the yaw bearing has ! an electromagnetic latch that will unlock and relock the hinge under - ! certain specified conditions. - ! Note that this technique WILL NOT work for user-defined routines - ! written for ADAMS datasets extracted using the FAST-to-ADAMS - ! preprocessor. + ! certain specified conditions.. USE Precision diff --git a/modules/subdyn/src/SubDyn.f90 b/modules/subdyn/src/SubDyn.f90 index 14e603f2af..e4f411a8c7 100644 --- a/modules/subdyn/src/SubDyn.f90 +++ b/modules/subdyn/src/SubDyn.f90 @@ -1260,7 +1260,7 @@ SUBROUTINE SD_Input(SDInputFile, Init, p, ErrStat,ErrMsg) !---------------------------- OUTPUT: SUMMARY & OUTFILE ------------------------------ CALL ReadCom (UnIn, SDInputFile, 'OUTPUT' ,ErrStat2, ErrMsg2, UnEc ); if(Failed()) return -CALL ReadLVar(UnIn, SDInputFile, Init%SSSum , 'SSSum' , 'Summary File Logic Variable' ,ErrStat2, ErrMsg2, UnEc ); if(Failed()) return +CALL ReadLVar(UnIn, SDInputFile, Init%SSSum , 'SumPrint' , 'Summary File Logic Variable' ,ErrStat2, ErrMsg2, UnEc ); if(Failed()) return ! --- Reading OutCBModes and OutFEM Modes (temporary backward compatibility if missing) !CALL ReadIVar( UnIn, SDInputFile, p%OutCBModes , 'OutCBModes' , 'Output of CB Modes' , ErrStat2 , ErrMsg2 , UnEc ); if(Failed()) return read(UnIn,'(A)',iostat=ErrStat2) Line diff --git a/modules/wakedynamics/src/WakeDynamics.f90 b/modules/wakedynamics/src/WakeDynamics.f90 index 9435f3e4ca..afa31e4304 100644 --- a/modules/wakedynamics/src/WakeDynamics.f90 +++ b/modules/wakedynamics/src/WakeDynamics.f90 @@ -25,6 +25,7 @@ module WakeDynamics use NWTC_Library + use VTK use WakeDynamics_Types implicit none @@ -458,6 +459,10 @@ subroutine WD_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut p%FilterInit = InitInp%InputFileData%FilterInit p%k_vCurl = InitInp%InputFileData%k_vCurl p%OutAllPlanes = InitInp%InputFileData%OutAllPlanes + ! Wake-Added Turbulence (WAT) variables + p%WAT = InitInp%InputFileData%WAT + p%WAT_k_Def = InitInp%InputFileData%WAT_k_Def + p%WAT_k_Grad = InitInp%InputFileData%WAT_k_Grad ! Finite difference grid coordinates r, y, z allocate( p%r(0:p%NumRadii-1),stat=errStat2) @@ -635,6 +640,8 @@ subroutine WD_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut if (errStat2 /= 0) call SetErrStat ( ErrID_Fatal, 'Could not allocate memory for y%D_wake.', errStat, errMsg, RoutineName ) allocate ( y%x_plane (0:p%NumPlanes-1), STAT=ErrStat2 ) if (errStat2 /= 0) call SetErrStat ( ErrID_Fatal, 'Could not allocate memory for y%x_plane.', errStat, errMsg, RoutineName ) + allocate ( y%WAT_k_mt (-p%NumRadii+1:p%NumRadii-1,-p%NumRadii+1:p%NumRadii-1,0:p%NumPlanes-1), STAT=ErrStat2 ) + if (errStat2 /= 0) call SetErrStat ( ErrID_Fatal, 'Could not allocate memory for y%WAT_k_mt.', errStat, errMsg, RoutineName ) if (errStat /= ErrID_None) return y%xhat_plane = 0.0_Reki @@ -646,7 +653,7 @@ subroutine WD_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut y%Vz_wake2 = 0.0_Reki y%D_wake = 0.0_Reki y%x_plane = 0.0_Reki - + y%WAT_k_mt = 0.0_Reki end subroutine WD_Init @@ -1497,6 +1504,7 @@ subroutine WD_CalcOutput( t, u, p, x, xd, z, OtherState, y, m, errStat, errMsg ) character(ErrMsgLen) :: ErrMsg2 character(*), parameter :: RoutineName = 'WD_CalcOutput' real(ReKi) :: correction(3) + real(ReKi) :: C, S, dvdr, dvdtheta_r, R, r_tmp character(1024) :: Filename type(VTK_Misc) :: mvtk real(ReKi), dimension(3) :: dx @@ -1577,6 +1585,37 @@ subroutine WD_CalcOutput( t, u, p, x, xd, z, OtherState, y, m, errStat, errMsg ) enddo endif ! Curl or Polar + ! --- WAT - Compute k_mt and add turbulence + if ( p%WAT ) then + R = u%D_Rotor /2 + do i = 1,maxPln + if ( EqualRealNos( xd%Vx_wind_disk_filt(i), 0.0_ReKi ) ) then + y%WAT_k_mt(:,:,i) = 0.0_ReKi + else + do iz = -p%NumRadii+1, p%NumRadii-1 + do iy = -p%NumRadii+1, p%NumRadii-1 + ! Polar gradients + r_tmp = sqrt(p%y(iy)**2 + p%z(iz)**2) + if (EqualRealNos(r_tmp,0.0_ReKi) ) then + S = 0.0_ReKi + C = 0.0_ReKi + dvdtheta_r = 0.0_ReKi + else + S=p%z(iz)/r_tmp ! Sine + C=p%y(iy)/r_tmp ! Cosine + dvdtheta_r = (m%dvx_dy(iy,iz,i) * (-p%z(iz)) + m%dvx_dz(iy,iz,i) * p%y(iy)) / r_tmp + endif + dvdr = m%dvx_dy(iy,iz,i) * C + m%dvx_dz(iy,iz,i) * S + ! Calculate scaling factor k_mt for wake-added Turbulence + y%WAT_k_mt(iy,iz,i) = p%WAT_k_Def * abs(1 - ((xd%Vx_wind_disk_filt(i)+y%Vx_wake2(iy,iz,i))/xd%Vx_wind_disk_filt(i)) ) & + + p%WAT_k_Grad/xd%Vx_wind_disk_filt(i) * R * ( abs(dvdr) + abs(dvdtheta_r) ) + end do ! iy + end do ! iz + endif + end do ! i, plane + + end if + ! --- VTK outputs per plane if (p%OutAllPlanes) then call vtk_misc_init(mvtk) @@ -1596,9 +1635,9 @@ subroutine WD_CalcOutput( t, u, p, x, xd, z, OtherState, y, m, errStat, errMsg ) ! dx(3) = p%dr ! call vtk_dataset_structured_points((/xd%p_plane(1,i),xd%p_plane(2,i)-dx*p%NumRadii, xd%p_plane(3,i)-dx*p%NumRadii /),dx,(/1,p%NumRadii*2-1,p%NumRadii*2-1/),mvtk) ! call vtk_point_data_init(mvtk) -! call vtk_point_data_scalar_2D(xd%Vx_wake2(:,:,i),'Vx',mvtk) -! call vtk_point_data_scalar_2D(xd%Vy_wake2(:,:,i),'Vy',mvtk) -! call vtk_point_data_scalar_2D(xd%Vz_wake2(:,:,i),'Vz',mvtk) +! call vtk_point_data_scalar(xd%Vx_wake2(:,:,i),'Vx',mvtk) +! call vtk_point_data_scalar(xd%Vy_wake2(:,:,i),'Vy',mvtk) +! call vtk_point_data_scalar(xd%Vz_wake2(:,:,i),'Vz',mvtk) ! call vtk_close_file(mvtk) ! endif @@ -1621,7 +1660,9 @@ subroutine WD_CalcOutput( t, u, p, x, xd, z, OtherState, y, m, errStat, errMsg ) call vtk_point_data_scalar(m%dvx_dy(:,:,i),'dvx_dy', mvtk) call vtk_point_data_scalar(m%dvx_dz(:,:,i),'dvx_dz', mvtk) endif - + if (p%WAT) then + call vtk_point_data_scalar(y%WAT_k_mt(:,:,i),'k_mt', mvtk) + endif call vtk_close_file(mvtk) endif enddo ! loop on planes diff --git a/modules/wakedynamics/src/WakeDynamics_Registry.txt b/modules/wakedynamics/src/WakeDynamics_Registry.txt index d402857528..c43ed68667 100644 --- a/modules/wakedynamics/src/WakeDynamics_Registry.txt +++ b/modules/wakedynamics/src/WakeDynamics_Registry.txt @@ -53,6 +53,11 @@ typedef ^ WD_InputFileType IntKi NumVortices - - typedef ^ WD_InputFileType IntKi FilterInit - - - "Switch to filter the initial wake plane deficit and select the number of grid points for the filter {0: no filter, 1: filter of size 1} or DEFAULT [DEFAULT=0: if Mod_Wake is 1 or 3, or DEFAULT=2: if Mod_Wwake is 2] (switch)" typedef ^ WD_InputFileType ReKi k_vCurl - - - "Calibrated parameter for the eddy viscosity in curled-wake model [>=0.0]" - typedef ^ WD_InputFileType Logical OutAllPlanes - - - "Output all planes" - +# wake added turbulence (WAT) inputs +typedef ^ WD_InputFileType LOGICAL WAT - - - "Switch for turning on and off wake-added turbulence" - +typedef ^ WD_InputFileType ReKi WAT_k_Def - - - "Calibrated parameter for the influence of the wake deficit in the wake-added Turbulence (-) [>=0.0] or DEFAULT [DEFAULT=0.6]" - +typedef ^ WD_InputFileType ReKi WAT_k_Grad - - - "Calibrated parameter for the influence of the radial velocity gradient of the wake deficit in the wake-added Turbulence (-) [>=0.0] or DEFAULT [DEFAULT=0.35]" - + # ..... Initialization data ....................................................................................................... # Define inputs that the initialization routine may need here: @@ -167,6 +172,10 @@ typedef ^ ParameterType Logical OutAllPlanes - - - "Output all pl typedef ^ ParameterType CHARACTER(1024) OutFileRoot - - - "The root name derived from the primary FAST.Farm input file" - typedef ^ ParameterType CHARACTER(1024) OutFileVTKDir - - - "The parent directory for all VTK files written by WD" - typedef ^ ParameterType IntKi TurbNum - 0 - "Turbine ID number (start with 1; end with number of turbines)" - +# wake added turbulence (WAT) parameters +typedef ^ ParameterType LOGICAL WAT - - - "Switch for turning on and off wake-added turbulence" - +typedef ^ ParameterType ReKi WAT_k_Def - - - "Calibrated parameter for the influence of the wake deficit in the wake-added Turbulence (-) [>=0.0] or DEFAULT [DEFAULT=0.6]" - +typedef ^ ParameterType ReKi WAT_k_Grad - - - "Calibrated parameter for the influence of the radial velocity gradient of the wake deficit in the wake-added Turbulence (-) [>=0.0] or DEFAULT [DEFAULT=0.35]" - # ..... Inputs .................................................................................................................... # Define inputs that are contained on the mesh here: typedef ^ InputType ReKi xhat_disk {3} - - "Orientation of rotor centerline, normal to disk" - @@ -194,4 +203,5 @@ typedef ^ OutputType ReKi Vy_wake2 {:}{:}{:} typedef ^ OutputType ReKi Vz_wake2 {:}{:}{:} - - "Transverse nominally vertical wake velocity deficit at wake planes, distributed across the plane" m/s typedef ^ OutputType ReKi D_wake {:} - - "Wake diameters at wake planes" m typedef ^ OutputType ReKi x_plane {:} - - "Downwind distance from rotor to each wake plane" m +typedef ^ OutputType ReKi WAT_k_mt {:}{:}{:} - - "Scaling factor k_mt(iP,y,z) for wake-added turbulence" - diff --git a/modules/wakedynamics/src/WakeDynamics_Types.f90 b/modules/wakedynamics/src/WakeDynamics_Types.f90 index 56693a3135..72d92c9089 100644 --- a/modules/wakedynamics/src/WakeDynamics_Types.f90 +++ b/modules/wakedynamics/src/WakeDynamics_Types.f90 @@ -71,6 +71,9 @@ MODULE WakeDynamics_Types INTEGER(IntKi) :: FilterInit !< Switch to filter the initial wake plane deficit and select the number of grid points for the filter {0: no filter, 1: filter of size 1} or DEFAULT [DEFAULT=0: if Mod_Wake is 1 or 3, or DEFAULT=2: if Mod_Wwake is 2] (switch) [-] REAL(ReKi) :: k_vCurl !< Calibrated parameter for the eddy viscosity in curled-wake model [>=0.0] [-] LOGICAL :: OutAllPlanes !< Output all planes [-] + LOGICAL :: WAT !< Switch for turning on and off wake-added turbulence [-] + REAL(ReKi) :: WAT_k_Def !< Calibrated parameter for the influence of the wake deficit in the wake-added Turbulence (-) [>=0.0] or DEFAULT [DEFAULT=0.6] [-] + REAL(ReKi) :: WAT_k_Grad !< Calibrated parameter for the influence of the radial velocity gradient of the wake deficit in the wake-added Turbulence (-) [>=0.0] or DEFAULT [DEFAULT=0.35] [-] END TYPE WD_InputFileType ! ======================= ! ========= WD_InitInputType ======= @@ -190,6 +193,9 @@ MODULE WakeDynamics_Types CHARACTER(1024) :: OutFileRoot !< The root name derived from the primary FAST.Farm input file [-] CHARACTER(1024) :: OutFileVTKDir !< The parent directory for all VTK files written by WD [-] INTEGER(IntKi) :: TurbNum = 0 !< Turbine ID number (start with 1; end with number of turbines) [-] + LOGICAL :: WAT !< Switch for turning on and off wake-added turbulence [-] + REAL(ReKi) :: WAT_k_Def !< Calibrated parameter for the influence of the wake deficit in the wake-added Turbulence (-) [>=0.0] or DEFAULT [DEFAULT=0.6] [-] + REAL(ReKi) :: WAT_k_Grad !< Calibrated parameter for the influence of the radial velocity gradient of the wake deficit in the wake-added Turbulence (-) [>=0.0] or DEFAULT [DEFAULT=0.35] [-] END TYPE WD_ParameterType ! ======================= ! ========= WD_InputType ======= @@ -219,6 +225,7 @@ MODULE WakeDynamics_Types REAL(ReKi) , DIMENSION(:,:,:), ALLOCATABLE :: Vz_wake2 !< Transverse nominally vertical wake velocity deficit at wake planes, distributed across the plane [m/s] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: D_wake !< Wake diameters at wake planes [m] REAL(ReKi) , DIMENSION(:), ALLOCATABLE :: x_plane !< Downwind distance from rotor to each wake plane [m] + REAL(ReKi) , DIMENSION(:,:,:), ALLOCATABLE :: WAT_k_mt !< Scaling factor k_mt(iP,y,z) for wake-added turbulence [-] END TYPE WD_OutputType ! ======================= CONTAINS @@ -268,6 +275,9 @@ SUBROUTINE WD_CopyInputFileType( SrcInputFileTypeData, DstInputFileTypeData, Ctr DstInputFileTypeData%FilterInit = SrcInputFileTypeData%FilterInit DstInputFileTypeData%k_vCurl = SrcInputFileTypeData%k_vCurl DstInputFileTypeData%OutAllPlanes = SrcInputFileTypeData%OutAllPlanes + DstInputFileTypeData%WAT = SrcInputFileTypeData%WAT + DstInputFileTypeData%WAT_k_Def = SrcInputFileTypeData%WAT_k_Def + DstInputFileTypeData%WAT_k_Grad = SrcInputFileTypeData%WAT_k_Grad END SUBROUTINE WD_CopyInputFileType SUBROUTINE WD_DestroyInputFileType( InputFileTypeData, ErrStat, ErrMsg, DEALLOCATEpointers ) @@ -357,6 +367,9 @@ SUBROUTINE WD_PackInputFileType( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, Er Int_BufSz = Int_BufSz + 1 ! FilterInit Re_BufSz = Re_BufSz + 1 ! k_vCurl Int_BufSz = Int_BufSz + 1 ! OutAllPlanes + Int_BufSz = Int_BufSz + 1 ! WAT + Re_BufSz = Re_BufSz + 1 ! WAT_k_Def + Re_BufSz = Re_BufSz + 1 ! WAT_k_Grad IF ( Re_BufSz .GT. 0 ) THEN ALLOCATE( ReKiBuf( Re_BufSz ), STAT=ErrStat2 ) IF (ErrStat2 /= 0) THEN @@ -442,6 +455,12 @@ SUBROUTINE WD_PackInputFileType( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, Er Re_Xferred = Re_Xferred + 1 IntKiBuf(Int_Xferred) = TRANSFER(InData%OutAllPlanes, IntKiBuf(1)) Int_Xferred = Int_Xferred + 1 + IntKiBuf(Int_Xferred) = TRANSFER(InData%WAT, IntKiBuf(1)) + Int_Xferred = Int_Xferred + 1 + ReKiBuf(Re_Xferred) = InData%WAT_k_Def + Re_Xferred = Re_Xferred + 1 + ReKiBuf(Re_Xferred) = InData%WAT_k_Grad + Re_Xferred = Re_Xferred + 1 END SUBROUTINE WD_PackInputFileType SUBROUTINE WD_UnPackInputFileType( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) @@ -531,6 +550,12 @@ SUBROUTINE WD_UnPackInputFileType( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, Re_Xferred = Re_Xferred + 1 OutData%OutAllPlanes = TRANSFER(IntKiBuf(Int_Xferred), OutData%OutAllPlanes) Int_Xferred = Int_Xferred + 1 + OutData%WAT = TRANSFER(IntKiBuf(Int_Xferred), OutData%WAT) + Int_Xferred = Int_Xferred + 1 + OutData%WAT_k_Def = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 + OutData%WAT_k_Grad = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 END SUBROUTINE WD_UnPackInputFileType SUBROUTINE WD_CopyInitInput( SrcInitInputData, DstInitInputData, CtrlCode, ErrStat, ErrMsg ) @@ -4153,6 +4178,9 @@ SUBROUTINE WD_CopyParam( SrcParamData, DstParamData, CtrlCode, ErrStat, ErrMsg ) DstParamData%OutFileRoot = SrcParamData%OutFileRoot DstParamData%OutFileVTKDir = SrcParamData%OutFileVTKDir DstParamData%TurbNum = SrcParamData%TurbNum + DstParamData%WAT = SrcParamData%WAT + DstParamData%WAT_k_Def = SrcParamData%WAT_k_Def + DstParamData%WAT_k_Grad = SrcParamData%WAT_k_Grad END SUBROUTINE WD_CopyParam SUBROUTINE WD_DestroyParam( ParamData, ErrStat, ErrMsg, DEALLOCATEpointers ) @@ -4271,6 +4299,9 @@ SUBROUTINE WD_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si Int_BufSz = Int_BufSz + 1*LEN(InData%OutFileRoot) ! OutFileRoot Int_BufSz = Int_BufSz + 1*LEN(InData%OutFileVTKDir) ! OutFileVTKDir Int_BufSz = Int_BufSz + 1 ! TurbNum + Int_BufSz = Int_BufSz + 1 ! WAT + Re_BufSz = Re_BufSz + 1 ! WAT_k_Def + Re_BufSz = Re_BufSz + 1 ! WAT_k_Grad IF ( Re_BufSz .GT. 0 ) THEN ALLOCATE( ReKiBuf( Re_BufSz ), STAT=ErrStat2 ) IF (ErrStat2 /= 0) THEN @@ -4415,6 +4446,12 @@ SUBROUTINE WD_PackParam( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, Si END DO ! I IntKiBuf(Int_Xferred) = InData%TurbNum Int_Xferred = Int_Xferred + 1 + IntKiBuf(Int_Xferred) = TRANSFER(InData%WAT, IntKiBuf(1)) + Int_Xferred = Int_Xferred + 1 + ReKiBuf(Re_Xferred) = InData%WAT_k_Def + Re_Xferred = Re_Xferred + 1 + ReKiBuf(Re_Xferred) = InData%WAT_k_Grad + Re_Xferred = Re_Xferred + 1 END SUBROUTINE WD_PackParam SUBROUTINE WD_UnPackParam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) @@ -4570,6 +4607,12 @@ SUBROUTINE WD_UnPackParam( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg END DO ! I OutData%TurbNum = IntKiBuf(Int_Xferred) Int_Xferred = Int_Xferred + 1 + OutData%WAT = TRANSFER(IntKiBuf(Int_Xferred), OutData%WAT) + Int_Xferred = Int_Xferred + 1 + OutData%WAT_k_Def = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 + OutData%WAT_k_Grad = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 END SUBROUTINE WD_UnPackParam SUBROUTINE WD_CopyInput( SrcInputData, DstInputData, CtrlCode, ErrStat, ErrMsg ) @@ -5088,6 +5131,22 @@ SUBROUTINE WD_CopyOutput( SrcOutputData, DstOutputData, CtrlCode, ErrStat, ErrMs END IF END IF DstOutputData%x_plane = SrcOutputData%x_plane +ENDIF +IF (ALLOCATED(SrcOutputData%WAT_k_mt)) THEN + i1_l = LBOUND(SrcOutputData%WAT_k_mt,1) + i1_u = UBOUND(SrcOutputData%WAT_k_mt,1) + i2_l = LBOUND(SrcOutputData%WAT_k_mt,2) + i2_u = UBOUND(SrcOutputData%WAT_k_mt,2) + i3_l = LBOUND(SrcOutputData%WAT_k_mt,3) + i3_u = UBOUND(SrcOutputData%WAT_k_mt,3) + IF (.NOT. ALLOCATED(DstOutputData%WAT_k_mt)) THEN + ALLOCATE(DstOutputData%WAT_k_mt(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) + IF (ErrStat2 /= 0) THEN + CALL SetErrStat(ErrID_Fatal, 'Error allocating DstOutputData%WAT_k_mt.', ErrStat, ErrMsg,RoutineName) + RETURN + END IF + END IF + DstOutputData%WAT_k_mt = SrcOutputData%WAT_k_mt ENDIF END SUBROUTINE WD_CopyOutput @@ -5138,6 +5197,9 @@ SUBROUTINE WD_DestroyOutput( OutputData, ErrStat, ErrMsg, DEALLOCATEpointers ) ENDIF IF (ALLOCATED(OutputData%x_plane)) THEN DEALLOCATE(OutputData%x_plane) +ENDIF +IF (ALLOCATED(OutputData%WAT_k_mt)) THEN + DEALLOCATE(OutputData%WAT_k_mt) ENDIF END SUBROUTINE WD_DestroyOutput @@ -5221,6 +5283,11 @@ SUBROUTINE WD_PackOutput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, S Int_BufSz = Int_BufSz + 2*1 ! x_plane upper/lower bounds for each dimension Re_BufSz = Re_BufSz + SIZE(InData%x_plane) ! x_plane END IF + Int_BufSz = Int_BufSz + 1 ! WAT_k_mt allocated yes/no + IF ( ALLOCATED(InData%WAT_k_mt) ) THEN + Int_BufSz = Int_BufSz + 2*3 ! WAT_k_mt upper/lower bounds for each dimension + Re_BufSz = Re_BufSz + SIZE(InData%WAT_k_mt) ! WAT_k_mt + END IF IF ( Re_BufSz .GT. 0 ) THEN ALLOCATE( ReKiBuf( Re_BufSz ), STAT=ErrStat2 ) IF (ErrStat2 /= 0) THEN @@ -5433,6 +5500,31 @@ SUBROUTINE WD_PackOutput( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, ErrMsg, S Re_Xferred = Re_Xferred + 1 END DO END IF + IF ( .NOT. ALLOCATED(InData%WAT_k_mt) ) THEN + IntKiBuf( Int_Xferred ) = 0 + Int_Xferred = Int_Xferred + 1 + ELSE + IntKiBuf( Int_Xferred ) = 1 + Int_Xferred = Int_Xferred + 1 + IntKiBuf( Int_Xferred ) = LBOUND(InData%WAT_k_mt,1) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%WAT_k_mt,1) + Int_Xferred = Int_Xferred + 2 + IntKiBuf( Int_Xferred ) = LBOUND(InData%WAT_k_mt,2) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%WAT_k_mt,2) + Int_Xferred = Int_Xferred + 2 + IntKiBuf( Int_Xferred ) = LBOUND(InData%WAT_k_mt,3) + IntKiBuf( Int_Xferred + 1) = UBOUND(InData%WAT_k_mt,3) + Int_Xferred = Int_Xferred + 2 + + DO i3 = LBOUND(InData%WAT_k_mt,3), UBOUND(InData%WAT_k_mt,3) + DO i2 = LBOUND(InData%WAT_k_mt,2), UBOUND(InData%WAT_k_mt,2) + DO i1 = LBOUND(InData%WAT_k_mt,1), UBOUND(InData%WAT_k_mt,1) + ReKiBuf(Re_Xferred) = InData%WAT_k_mt(i1,i2,i3) + Re_Xferred = Re_Xferred + 1 + END DO + END DO + END DO + END IF END SUBROUTINE WD_PackOutput SUBROUTINE WD_UnPackOutput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg ) @@ -5676,6 +5768,34 @@ SUBROUTINE WD_UnPackOutput( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrStat, ErrMsg Re_Xferred = Re_Xferred + 1 END DO END IF + IF ( IntKiBuf( Int_Xferred ) == 0 ) THEN ! WAT_k_mt not allocated + Int_Xferred = Int_Xferred + 1 + ELSE + Int_Xferred = Int_Xferred + 1 + i1_l = IntKiBuf( Int_Xferred ) + i1_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + i2_l = IntKiBuf( Int_Xferred ) + i2_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + i3_l = IntKiBuf( Int_Xferred ) + i3_u = IntKiBuf( Int_Xferred + 1) + Int_Xferred = Int_Xferred + 2 + IF (ALLOCATED(OutData%WAT_k_mt)) DEALLOCATE(OutData%WAT_k_mt) + ALLOCATE(OutData%WAT_k_mt(i1_l:i1_u,i2_l:i2_u,i3_l:i3_u),STAT=ErrStat2) + IF (ErrStat2 /= 0) THEN + CALL SetErrStat(ErrID_Fatal, 'Error allocating OutData%WAT_k_mt.', ErrStat, ErrMsg,RoutineName) + RETURN + END IF + DO i3 = LBOUND(OutData%WAT_k_mt,3), UBOUND(OutData%WAT_k_mt,3) + DO i2 = LBOUND(OutData%WAT_k_mt,2), UBOUND(OutData%WAT_k_mt,2) + DO i1 = LBOUND(OutData%WAT_k_mt,1), UBOUND(OutData%WAT_k_mt,1) + OutData%WAT_k_mt(i1,i2,i3) = ReKiBuf(Re_Xferred) + Re_Xferred = Re_Xferred + 1 + END DO + END DO + END DO + END IF END SUBROUTINE WD_UnPackOutput END MODULE WakeDynamics_Types diff --git a/reg_tests/CTestList.cmake b/reg_tests/CTestList.cmake index 18f73c04a3..0bea1964e7 100644 --- a/reg_tests/CTestList.cmake +++ b/reg_tests/CTestList.cmake @@ -276,6 +276,7 @@ of_regression("5MW_TLP_DLL_WTurb_WavesIrr_WavesMulti" "openfast;elastodyn;aerod of_regression("5MW_OC3Spar_DLL_WTurb_WavesIrr" "openfast;elastodyn;aerodyn15;servodyn;hydrodyn;map;offshore") of_regression("5MW_OC4Semi_WSt_WavesWN" "openfast;elastodyn;aerodyn15;servodyn;hydrodyn;moordyn;offshore") of_regression("5MW_Land_BD_DLL_WTurb" "openfast;beamdyn;aerodyn15;servodyn") +of_regression("5MW_Land_BD_Init" "openfast;beamdyn;aerodyn15;servodyn") of_regression("5MW_OC4Jckt_ExtPtfm" "openfast;elastodyn;extptfm") of_regression("HelicalWake_OLAF" "openfast;aerodyn15;olaf") of_regression("EllipticalWing_OLAF" "openfast;aerodyn15;olaf") @@ -357,6 +358,10 @@ hd_regression("hd_5MW_OC3Spar_DLL_WTurb_WavesIrr" "hydrodyn;offshore") hd_regression("hd_5MW_OC4Semi_WSt_WavesWN" "hydrodyn;offshore") hd_regression("hd_5MW_TLP_DLL_WTurb_WavesIrr_WavesMulti" "hydrodyn;offshore") hd_regression("hd_TaperCylinderPitchMoment" "hydrodyn;offshore") +hd_regression("hd_NBodyMod1" "hydrodyn;offshore") +hd_regression("hd_NBodyMod2" "hydrodyn;offshore") +hd_regression("hd_NBodyMod3" "hydrodyn;offshore") + # Py-HydroDyn regression tests py_hd_regression("py_hd_5MW_OC4Semi_WSt_WavesWN" "hydrodyn;offshore;python") diff --git a/reg_tests/README.md b/reg_tests/README.md index 12f84f2f01..aaa320639b 100644 --- a/reg_tests/README.md +++ b/reg_tests/README.md @@ -10,7 +10,7 @@ Dependencies required to run the regression test suite are - Python 3.7+ - Numpy - CMake and CTest -- Bokeh 1.4 (optional) +- Bokeh 2.4+ (optional) ## Execution The automated regression test runs CTest and can be executed by running either of the commands `make test` or `ctest` from the build directory. If the entire OpenFAST package is to be built, CMake will configure CTest to find the new binary at `openfast/build/glue-codes/openfast/openfast`. However, if the intention is to build only the test suite, the OpenFAST binary should be specified in the CMake configuration under the `CTEST_OPENFAST_EXECUTABLE` flag. There is also a corresponding `CTEST_[MODULE]_NAME` flag for each module that is included in the regression test. diff --git a/reg_tests/executeHydrodynRegressionCase.py b/reg_tests/executeHydrodynRegressionCase.py index ae67452dbc..445c21294b 100644 --- a/reg_tests/executeHydrodynRegressionCase.py +++ b/reg_tests/executeHydrodynRegressionCase.py @@ -37,7 +37,7 @@ from errorPlotting import exportCaseSummary ##### Main program -excludeExt=['.out','.outb','.ech','.yaml','.sum','.log'] +excludeExt=['.out','.outb','.ech','.yaml','.sum','.log','.rst'] ### Store the python executable for future python calls pythonCommand = sys.executable @@ -92,13 +92,7 @@ # create the local output directory if it does not already exist # and initialize it with input files for all test cases if not os.path.isdir(testBuildDirectory): - os.makedirs(testBuildDirectory) - for file in glob.glob(os.path.join(inputsDirectory,"hd_*inp")): - filename = file.split(os.path.sep)[-1] - shutil.copy(os.path.join(inputsDirectory,filename), os.path.join(testBuildDirectory,filename)) - for file in glob.glob(os.path.join(inputsDirectory,"*dat")): - filename = file.split(os.path.sep)[-1] - shutil.copy(os.path.join(inputsDirectory,filename), os.path.join(testBuildDirectory,filename)) + rtl.copyTree(inputsDirectory, testBuildDirectory, excludeExt=excludeExt) dirToCopy = os.path.join("glue-codes","openfast","5MW_Baseline","HydroData") buildDirectoryGlue = os.path.join(buildDirectory,os.pardir,os.pardir,dirToCopy) diff --git a/vs-build/AeroDyn/AeroDyn_Driver.vfproj b/vs-build/AeroDyn/AeroDyn_Driver.vfproj index 983b487a2f..51fe9aa8d6 100644 --- a/vs-build/AeroDyn/AeroDyn_Driver.vfproj +++ b/vs-build/AeroDyn/AeroDyn_Driver.vfproj @@ -45,7 +45,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -75,7 +75,7 @@ - + diff --git a/vs-build/AeroDyn_Inflow_c_binding/AeroDyn_Inflow_c_binding.vfproj b/vs-build/AeroDyn_Inflow_c_binding/AeroDyn_Inflow_c_binding.vfproj index 107f6daa1c..06eca6093b 100644 --- a/vs-build/AeroDyn_Inflow_c_binding/AeroDyn_Inflow_c_binding.vfproj +++ b/vs-build/AeroDyn_Inflow_c_binding/AeroDyn_Inflow_c_binding.vfproj @@ -45,7 +45,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -75,7 +75,7 @@ - + diff --git a/vs-build/BeamDyn/BeamDyn.vfproj b/vs-build/BeamDyn/BeamDyn.vfproj index 426a40303d..dd6a721d7a 100644 --- a/vs-build/BeamDyn/BeamDyn.vfproj +++ b/vs-build/BeamDyn/BeamDyn.vfproj @@ -45,7 +45,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -75,7 +75,7 @@ - + diff --git a/vs-build/FAST/FAST.vfproj b/vs-build/FAST/FAST.vfproj index 53f74b95ad..2f4a763474 100644 --- a/vs-build/FAST/FAST.vfproj +++ b/vs-build/FAST/FAST.vfproj @@ -45,7 +45,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -75,7 +75,7 @@ - + diff --git a/vs-build/FASTlib/FASTlib.vfproj b/vs-build/FASTlib/FASTlib.vfproj index c3db39d721..925cf1d7ac 100644 --- a/vs-build/FASTlib/FASTlib.vfproj +++ b/vs-build/FASTlib/FASTlib.vfproj @@ -77,7 +77,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -95,7 +95,7 @@ - + @@ -104,7 +104,7 @@ - + diff --git a/vs-build/HydroDyn/HydroDynDriver.vfproj b/vs-build/HydroDyn/HydroDynDriver.vfproj index 4339f99674..d85e36bc12 100644 --- a/vs-build/HydroDyn/HydroDynDriver.vfproj +++ b/vs-build/HydroDyn/HydroDynDriver.vfproj @@ -45,7 +45,7 @@ - + @@ -55,7 +55,7 @@ - + diff --git a/vs-build/HydroDyn_c_binding/HydroDyn_c_binding.vfproj b/vs-build/HydroDyn_c_binding/HydroDyn_c_binding.vfproj index baa9e1ce94..a38ba6f1d4 100644 --- a/vs-build/HydroDyn_c_binding/HydroDyn_c_binding.vfproj +++ b/vs-build/HydroDyn_c_binding/HydroDyn_c_binding.vfproj @@ -45,7 +45,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -75,7 +75,7 @@ - + diff --git a/vs-build/InflowWind/InflowWind_driver.vfproj b/vs-build/InflowWind/InflowWind_driver.vfproj index 788cc71568..7ef4ac242d 100644 --- a/vs-build/InflowWind/InflowWind_driver.vfproj +++ b/vs-build/InflowWind/InflowWind_driver.vfproj @@ -45,7 +45,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -75,7 +75,7 @@ - + diff --git a/vs-build/InflowWind_c_binding/InflowWind_c_binding.vfproj b/vs-build/InflowWind_c_binding/InflowWind_c_binding.vfproj index a1568f26f8..09ec865b54 100644 --- a/vs-build/InflowWind_c_binding/InflowWind_c_binding.vfproj +++ b/vs-build/InflowWind_c_binding/InflowWind_c_binding.vfproj @@ -45,7 +45,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -75,7 +75,7 @@ - + diff --git a/vs-build/MoorDyn/MoorDynDriver.vfproj b/vs-build/MoorDyn/MoorDynDriver.vfproj index 60d1aee7f5..40e2ca66b1 100644 --- a/vs-build/MoorDyn/MoorDynDriver.vfproj +++ b/vs-build/MoorDyn/MoorDynDriver.vfproj @@ -45,7 +45,7 @@ - + @@ -55,7 +55,7 @@ - + diff --git a/vs-build/MoorDyn_c_binding/MoorDyn_c_binding.vfproj b/vs-build/MoorDyn_c_binding/MoorDyn_c_binding.vfproj index 2805621a84..3a83e1872e 100644 --- a/vs-build/MoorDyn_c_binding/MoorDyn_c_binding.vfproj +++ b/vs-build/MoorDyn_c_binding/MoorDyn_c_binding.vfproj @@ -14,7 +14,7 @@ - + @@ -34,7 +34,7 @@ - + @@ -45,7 +45,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -75,7 +75,7 @@ - + diff --git a/vs-build/SubDyn/SubDyn.vfproj b/vs-build/SubDyn/SubDyn.vfproj index 27288b5403..2ba3cd699a 100644 --- a/vs-build/SubDyn/SubDyn.vfproj +++ b/vs-build/SubDyn/SubDyn.vfproj @@ -45,7 +45,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -75,7 +75,7 @@ - + diff --git a/vs-build/UnsteadyAero/UnsteadyAero.vfproj b/vs-build/UnsteadyAero/UnsteadyAero.vfproj index b565e71409..383d7de0fa 100644 --- a/vs-build/UnsteadyAero/UnsteadyAero.vfproj +++ b/vs-build/UnsteadyAero/UnsteadyAero.vfproj @@ -45,7 +45,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -75,7 +75,7 @@ - +