Skip to content

Commit

Permalink
Replace print w WrScr and minor organize of registry
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanDavies19 committed Jan 10, 2024
1 parent 5ebcc59 commit 5c67b99
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions modules/moordyn/src/MoorDyn_Body.f90
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ SUBROUTINE Body_AddPoint(Body, pointID, coords)
Body%AttachedC(Body%nAttachedC) = pointID
Body%rPointRel(:,Body%nAttachedC) = coords ! store relative position of point on body
ELSE
Print*, "too many Points attached to Body ", Body%IdNum, " in MoorDyn!"
call WrScr("too many Points attached to Body "//trim(num2lstr(Body%IdNum))//" in MoorDyn!")
END IF

END SUBROUTINE Body_AddPoint
Expand Down Expand Up @@ -601,7 +601,7 @@ SUBROUTINE Body_AddRod(Body, rodID, coords)
Body%r6RodRel(4:6, Body%nAttachedR) = tempUnitVec

ELSE
Print*, "too many rods attached to Body ", Body%IdNum, " in MoorDyn"
call WrScr("too many rods attached to Body "//trim(num2lstr(Body%IdNum))//" in MoorDyn")
END IF

END SUBROUTINE Body_AddRod
Expand Down
20 changes: 10 additions & 10 deletions modules/moordyn/src/MoorDyn_Misc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1350,15 +1350,15 @@ SUBROUTINE setupWaterKin(WaterKinString, p, Tmax, ErrStat, ErrMsg)

ELSE IF (SCAN(WaterKinString, "abcdfghijklmnopqrstuvwxyzABCDFGHIJKLMNOPQRSTUVWXYZ") == 0) THEN
! If the input has no letters, let's assume it's a number
print *, "ERROR WaveKin option does not currently support numeric entries. It must be a filename."
call WrScr( "ERROR WaveKin option does not currently support numeric entries. It must be a filename." )
p%WaveKin = 0
p%Current = 0
return
END IF


! otherwise interpret the input as a file name to load the bathymetry lookup data from
print *, " The waterKin input contains letters so will load a water kinematics input file"
call WrScr( " The waterKin input contains letters so will load a water kinematics input file" )


! -------- load water kinematics input file -------------
Expand Down Expand Up @@ -1413,7 +1413,7 @@ SUBROUTINE setupWaterKin(WaterKinString, p, Tmax, ErrStat, ErrMsg)
EXIT ! break out of the loop if it couldn't read the line (i.e. if at end of file)
end if
if (i == 100) then
print*,"WARNING: MD can handle a maximum of 100 current profile points"
call WrScr("WARNING: MD can handle a maximum of 100 current profile points")
exit
end if
END DO
Expand Down Expand Up @@ -1449,7 +1449,7 @@ SUBROUTINE setupWaterKin(WaterKinString, p, Tmax, ErrStat, ErrMsg)
! --------------------- set from inputted wave elevation time series, grid approach -------------------
if (p%WaveKin == 3) then

print *, 'Setting up WaveKin 3 option: read wave elevation time series from file'
call WrScr( 'Setting up WaveKin 3 option: read wave elevation time series from file' )

IF ( LEN_TRIM( WaveKinFile ) == 0 ) THEN
CALL SetErrStat( ErrID_Fatal,'WaveKinFile must not be an empty string.',ErrStat, ErrMsg, RoutineName); return
Expand All @@ -1467,7 +1467,7 @@ SUBROUTINE setupWaterKin(WaterKinString, p, Tmax, ErrStat, ErrMsg)

CALL OpenFInpFile ( UnElev, WaveKinFile, ErrStat2, ErrMsg2 ); if(Failed()) return

print *, 'Reading wave elevation data from ', trim(WaveKinFile)
call WrScr( 'Reading wave elevation data from '//trim(WaveKinFile) )

! Read through length of file to find its length
i = 1 ! start counter
Expand Down Expand Up @@ -1502,7 +1502,7 @@ SUBROUTINE setupWaterKin(WaterKinString, p, Tmax, ErrStat, ErrMsg)
! Close the inputs file
CLOSE ( UnElev )

print *, "Read ", ntIn, " time steps from input file."
call WrScr( "Read "//trim(num2lstr(ntIn))//" time steps from input file." )

! if (WaveTimeIn(ntIn) < TMax) then <<<< need to handle if time series is too short?

Expand Down Expand Up @@ -1714,7 +1714,7 @@ SUBROUTINE gridAxisCoords(coordtype, entries, coordarray, n, ErrStat, ErrMsg)
INTEGER(IntKi) :: nEntries, I

IF (len(trim(entries)) == len(entries)) THEN
print*, "Warning: Only 120 characters read from wave grid coordinates"
call WrScr("Warning: Only 120 characters read from wave grid coordinates")
END IF

IF (entries(len(entries):len(entries)) == ',') THEN
Expand All @@ -1732,7 +1732,7 @@ SUBROUTINE gridAxisCoords(coordtype, entries, coordarray, n, ErrStat, ErrMsg)
else if (coordtype==2) then ! 2: uniform specified by -xlim, xlim, num
n = int(tempArray(3))
else
print *, "Error: invalid coordinate type specified to gridAxisCoords"
call WrScr("Error: invalid coordinate type specified to gridAxisCoords")
end if

! allocate coordinate array
Expand All @@ -1755,7 +1755,7 @@ SUBROUTINE gridAxisCoords(coordtype, entries, coordarray, n, ErrStat, ErrMsg)
end do

else
print *, "Error: invalid coordinate type specified to gridAxisCoords"
call WrScr("Error: invalid coordinate type specified to gridAxisCoords")
end if

! print *, "Set water grid coordinates to :"
Expand Down Expand Up @@ -1791,7 +1791,7 @@ SUBROUTINE stringToArray(instring, n, outarray)
END IF
n = n + 1
if (n > 100) then
print *, "ERROR - stringToArray cannot do more than 100 entries"
call WrScr( "ERROR - stringToArray cannot do more than 100 entries")
end if
READ(instring(pos1:pos1+pos2-2), *) outarray(n)

Expand Down
4 changes: 2 additions & 2 deletions modules/moordyn/src/MoorDyn_Point.f90
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ SUBROUTINE Point_AddLine(Point, lineID, TopOfLine)
Point%Attached(Point%nAttached) = lineID
Point%Top(Point%nAttached) = TopOfLine ! attached to line ... 1 = top/fairlead(end B), 0 = bottom/anchor(end A)
ELSE
Print*, "Too many lines connected to Point ", Point%IdNum, " in MoorDyn!"
call WrScr("Too many lines connected to Point "//trim(num2lstr(Point%IdNum))//" in MoorDyn!")
END IF

END SUBROUTINE Point_AddLine
Expand Down Expand Up @@ -399,7 +399,7 @@ SUBROUTINE Point_RemoveLine(Point, lineID, TopOfLine, rEnd, rdEnd)
rdEnd(J) = Point%rd(J)
END DO

print*, "Detached line ", lineID, " from Point ", Point%IdNum
call WrScr( "Detached line "//trim(num2lstr(lineID))//" from Point "//trim(num2lstr(Point%IdNum)))

EXIT
END DO
Expand Down
4 changes: 2 additions & 2 deletions modules/moordyn/src/MoorDyn_Registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ typedef ^ ^ DbKi mu_kT -
typedef ^ ^ DbKi mu_kA - - - "axial kinetic friction coefficient" "(-)"
typedef ^ ^ DbKi mc - - - "ratio of the static friction coefficient to the kinetic friction coefficient" "(-)"
typedef ^ ^ DbKi cv - - - "saturated damping coefficient" "(-)"
typedef ^ ^ IntKi Standalone - - - "Indicates MoorDyn run as standalone code if 1, coupled if 0" -
typedef ^ ^ IntKi inertialF - 0 - "Indicates MoorDyn returning inertial moments for coupled 6DOF objects. 1 if yes, 0 if no" -
# --- parameters for wave and current ---
typedef ^ ^ IntKi nxWave - - - "number of x wave grid points" -
typedef ^ ^ IntKi nyWave - - - "number of y wave grid points" -
Expand Down Expand Up @@ -422,8 +424,6 @@ typedef ^ ^ Integer Jac_nx -
typedef ^ ^ Integer dxIdx_map2_xStateIdx {:} - - "Mapping array from index of dX array to corresponding state index" -
typedef ^ ^ Logical VisMeshes - - - "Using visualization meshes as requested by glue code" -
typedef ^ ^ VisDiam VisRodsDiam {:} - - "Diameters for visualization of rods" -
typedef ^ ^ IntKi Standalone - - - "Indicates MoorDyn run as standalone code if 1, coupled if 0" -
typedef ^ ^ IntKi inertialF - 0 - "Indicates MoorDyn returning inertial moments for coupled 6DOF objects. 1 if yes, 0 if no" -


# ============================== Inputs ============================================================================================================================================
Expand Down
8 changes: 4 additions & 4 deletions modules/moordyn/src/MoorDyn_Rod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ SUBROUTINE Rod_AddLine(Rod, lineID, TopOfLine, endB)
Rod%AttachedB(Rod%nAttachedB) = lineID
Rod%TopB(Rod%nAttachedB) = TopOfLine ! attached to line ... 1 = top/fairlead(end B), 0 = bottom/anchor(end A)
ELSE
Print*, "too many lines connected to Rod ", Rod%IdNum, " in MoorDyn!"
call WrScr("too many lines connected to Rod "//trim(num2lstr(Rod%IdNum))//" in MoorDyn!")
END IF

else ! attaching to end A
Expand All @@ -1093,7 +1093,7 @@ SUBROUTINE Rod_AddLine(Rod, lineID, TopOfLine, endB)
Rod%AttachedA(Rod%nAttachedA) = lineID
Rod%TopA(Rod%nAttachedA) = TopOfLine ! attached to line ... 1 = top/fairlead(end B), 0 = bottom/anchor(end A)
ELSE
Print*, "too many lines connected to Rod ", Rod%IdNum, " in MoorDyn!"
call WrScr("too many lines connected to Rod "//trim(num2lstr(Rod%IdNum))//" in MoorDyn!")
END IF

end if
Expand Down Expand Up @@ -1135,7 +1135,7 @@ SUBROUTINE Rod_RemoveLine(Rod, lineID, TopOfLine, endB, rEnd, rdEnd)
rdEnd(J) = Rod%rd(J,Rod%N)
END DO

print*, "Detached line ", lineID, " from Rod ", Rod%IdNum, " end B"
call WrScr( "Detached line "//trim(num2lstr(lineID))//" from Rod "//trim(num2lstr(Rod%IdNum))//" end B")

EXIT
END DO
Expand Down Expand Up @@ -1167,7 +1167,7 @@ SUBROUTINE Rod_RemoveLine(Rod, lineID, TopOfLine, endB, rEnd, rdEnd)
rdEnd(J) = Rod%rd(J,0)
END DO

print*, "Detached line ", lineID, " from Rod ", Rod%IdNum, " end A"
call WrScr( "Detached line "//trim(num2lstr(lineID))//" from Rod "//trim(num2lstr(Rod%IdNum))//" end A")

EXIT
END DO
Expand Down
4 changes: 2 additions & 2 deletions modules/moordyn/src/MoorDyn_Types.f90
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ MODULE MoorDyn_Types
REAL(DbKi) :: mu_kA !< axial kinetic friction coefficient [(-)]
REAL(DbKi) :: mc !< ratio of the static friction coefficient to the kinetic friction coefficient [(-)]
REAL(DbKi) :: cv !< saturated damping coefficient [(-)]
INTEGER(IntKi) :: Standalone !< Indicates MoorDyn run as standalone code if 1, coupled if 0 [-]
INTEGER(IntKi) :: inertialF = 0 !< Indicates MoorDyn returning inertial moments for coupled 6DOF objects. 1 if yes, 0 if no [-]
INTEGER(IntKi) :: nxWave !< number of x wave grid points [-]
INTEGER(IntKi) :: nyWave !< number of y wave grid points [-]
INTEGER(IntKi) :: nzWave !< number of z wave grid points [-]
Expand Down Expand Up @@ -455,8 +457,6 @@ MODULE MoorDyn_Types
INTEGER(IntKi) , DIMENSION(:), ALLOCATABLE :: dxIdx_map2_xStateIdx !< Mapping array from index of dX array to corresponding state index [-]
LOGICAL :: VisMeshes !< Using visualization meshes as requested by glue code [-]
TYPE(VisDiam) , DIMENSION(:), ALLOCATABLE :: VisRodsDiam !< Diameters for visualization of rods [-]
INTEGER(IntKi) :: Standalone !< Indicates MoorDyn run as standalone code if 1, coupled if 0 [-]
INTEGER(IntKi) :: inertialF = 0 !< Indicates MoorDyn returning inertial moments for coupled 6DOF objects. 1 if yes, 0 if no [-]
END TYPE MD_ParameterType
! =======================
! ========= MD_InputType =======
Expand Down

0 comments on commit 5c67b99

Please sign in to comment.