FrontISTR  5.7.0
Large-scale structural analysis program with finit element method
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 
7 contains
8 
9  subroutine hecmw_allocate_matrix(hecMAT, mat, nBlock)
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)
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)
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 
74 end module hecmw_allocate
hecmw_allocate
Definition: hecmw_allocate.f90:6
hecmw_allocate::hecmw_allocate_vector_i
subroutine hecmw_allocate_vector_i(vector, size)
Definition: hecmw_allocate.f90:41
hecmw_allocate::hecmw_allocate_matrix
subroutine hecmw_allocate_matrix(hecMAT, mat, nBlock)
Definition: hecmw_allocate.f90:10
hecmw_util
I/O and Utility.
Definition: hecmw_util_f.F90:7
hecmw_util::kreal
integer(kind=4), parameter kreal
Definition: hecmw_util_f.F90:16
hecmw_allocate::hecmw_allocate_vector_r
subroutine hecmw_allocate_vector_r(vector, size)
Definition: hecmw_allocate.f90:58