mecej4
Joined: 31 Oct 2006 Posts: 1896
|
Posted: Sat Aug 13, 2022 3:37 am Post subject: |
|
|
[continuation: the source code of the test program]
Code: | Module Base
INTEGER, PARAMETER :: dp = selected_real_kind(15, 307)
INTEGER, PARAMETER :: sw = 32, sa = 33, nta = 100
REAL (KIND=dp), PARAMETER :: ZERO = 0.0_DP
end module Base
Module Elements
use base
implicit none
integer, parameter :: L = 3 !, nt = 120
INTEGER astat
Type Model
Integer id, NumTrias, NumBeams, ThicknessFlag
Character*70 Description
Real (kind = dp) asm(6,6,18)
Integer ism(6,6,18)
integer, allocatable :: indexM(:,:), nodes(:), offsetnodes(:)
integer i,j,k,N,NodeCount,MaxNodeNumber,LoadedNodes
integer :: flag = 0
REAL (KIND=dp) H, density
REAL (KIND=dp), allocatable :: sk(:,:), xf(:), skI(:,:),b(:)
END TYPE
TYPE sbeam
INTEGER id
integer acad
REAL (KIND=dp) width, depth, Ix, Iy, Iz, Area, Ratio, E, G1, &
Beta1, Beta2,rho,t,b,d,density
character*8 name
END TYPE
Type aBeam
INTEGER id, nodes(2), restraint(2), nodetype(2,6)
integer :: flag = 0
REAL (KIND=dp) x(2), y(2), z(2), mass(2), H(2)
REAL (KIND=dp) nu, em, x21, area2, esm(12,12), Ix,Iy,Iz,G, &
Area, E, Beta1, Beta2, length, gamma
end type
contains
subroutine Read_beams(sBeamIN, sBeams)
implicit none
TYPE (aBeam), TARGET :: sBeamIN
TYPE (sbeam), TARGET :: sBeams(nta)
Integer IV, MCON1, MCON2, beamid
REAL (KIND=dp) gammaa
TYPE (sbeam), POINTER :: beam => null()
CHARACTER (4) af
CHARACTER (120) iline
iline = 'BEAM 1 1 2 0.0 43'
READ(iline,*)af, IV, MCON1, MCON2,GAMMAA,beamID
beam => sbeams(beamID)
sBeamIN%ID = IV
sBeamIN%ESM = ZERO
sBeamIN%Nodes(1) = MCON1
sBeamIN%Nodes(2) = MCON2
sBeamIN%Iy = beam%iy ! undefined, should stop here
sBeamIN%Ix = beam%ix
sBeamIN%IZ = beam%IZ
return
end subroutine
Subroutine SetModel(ModelA, I, beams)
implicit none
TYPE (Model), TARGET :: ModelA ! holds the model data
Integer I
Integer Beams
ModelA%ID = 1
ModelA%NumTrias = 0
ModelA%NumBeams = 65
ModelA%MaxNodeNumber = 65
ModelA%LoadedNodes = 67
ModelA%Description = 'Dutch Bridge Goor'
ModelA%ThicknessFlag = 2
ModelA%H = 0.6
ModelA%density = 2400
I = 0
Beams = 65
return
end Subroutine
End module
program Borr
use Elements
implicit none
Integer Triangles, BeamNum, I
TYPE (Model), TARGET :: ModelA
TYPE (sbeam), allocatable, TARGET :: sBeams(:)
TYPE (aBeam), allocatable, TARGET :: saBeams(:)
Call SetModel(ModelA, Triangles, BeamNum)
ALLOCATE (ModelA%indexM(3,1), ModelA%nodes(1),ModelA%offsetnodes(1),&
sBeams(NTA), saBeams(Beamnum))
ModelA%nodes = -1
Do I = 1, Beamnum
print *,'Calling Read_beams with I = ',i
call Read_Beams(saBeams(I), sBeams)
stop 'Read_Beams done'
end do
end program Borr |
|
|