FrontISTR 5.2.0
Large-scale structural analysis program with finit element method
Loading...
Searching...
No Matches
hecmw_allocate.f90
Go to the documentation of this file.
1!-------------------------------------------------------------------------------
2! Copyright (c) 2019 FrontISTR Commons
3! This software is released under the MIT License, see LICENSE.txt
4!-------------------------------------------------------------------------------
5
7contains
8
9 subroutine hecmw_allocate_matrix(hecMAT, mat, nBlock)
10 use hecmw_util
11
12 implicit none
13
14 type (hecmwST_matrix):: hecMAT, mat
15 integer:: nBlock
16 integer:: ierr
17
18 allocate( mat%AL( nblock*hecmat%NPL ), stat=ierr )
19 if ( ierr /= 0 ) then
20 write(0,*) 'Allocation error: Not enough memory for matrix!'
21 stop
22 end if
23 allocate( mat%AU( nblock*hecmat%NPU ), stat=ierr )
24 if ( ierr /= 0 ) then
25 write(0,*) 'Allocation error: Not enough memory for matrix!'
26 stop
27 end if
28 allocate( mat%D ( nblock*hecmat%NP ), stat=ierr )
29 if ( ierr /= 0 ) then
30 write(0,*) 'Allocation error: Not enough memory for matrix!'
31 stop
32 end if
33
34 mat%AL = 0.0d0
35 mat%AU = 0.0d0
36 mat%D = 0.0d0
37
38 end subroutine hecmw_allocate_matrix
39
40 subroutine hecmw_allocate_vector_i(vector, size)
41 use hecmw_util
42 implicit none
43
44 integer(kind=kint), pointer:: vector(:)
45 integer(kind=kint):: size
46 integer(kind=kint):: ierr
47
48 allocate( vector( size ), stat=ierr )
49 if ( ierr /= 0 ) then
50 write(0,*) 'Allocation error: Not enough memory for integer array!'
51 stop
52 end if
53
54 vector = 0
55 end subroutine hecmw_allocate_vector_i
56
57 subroutine hecmw_allocate_vector_r(vector, size)
58 use hecmw_util
59 implicit none
60
61 real(kind=kreal), pointer:: vector(:)
62 integer(kind=kint):: size
63 integer(kind=kint):: ierr
64
65 allocate( vector( size ), stat=ierr )
66 if ( ierr /= 0 ) then
67 write(0,*) 'Allocation error: Not enough memory for real array!'
68 stop
69 end if
70
71 vector = 0.0d0
72 end subroutine hecmw_allocate_vector_r
73
74end module hecmw_allocate
subroutine hecmw_allocate_vector_r(vector, size)
subroutine hecmw_allocate_vector_i(vector, size)
subroutine hecmw_allocate_matrix(hecmat, mat, nblock)
I/O and Utility.
Definition: hecmw_util_f.F90:7
integer(kind=4), parameter kreal