OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
fac_descband_data_m.F
Go to the documentation of this file.
1C
2C This file is part of MUMPS 5.5.1, released
3C on Tue Jul 12 13:17:24 UTC 2022
4C
5C
6C Copyright 1991-2022 CERFACS, CNRS, ENS Lyon, INP Toulouse, Inria,
7C Mumps Technologies, University of Bordeaux.
8C
9C This version of MUMPS is provided to you free of charge. It is
10C released under the CeCILL-C license
11C (see doc/CeCILL-C_V1-en.txt, doc/CeCILL-C_V1-fr.txt, and
12C https://cecill.info/licences/Licence_CeCILL-C_V1-en.html)
13C
15 IMPLICIT NONE
16#if ! defined(NO_FDM_DESCBAND)
17 INTEGER, SAVE :: inode_waited_for
18 PRIVATE
25 INTEGER :: inode, lbufr
26 INTEGER, POINTER, DIMENSION(:) :: bufr
27 END TYPE descband_struc_t
28 TYPE (descband_struc_t), POINTER, DIMENSION(:), SAVE::fdbd_array
29 CONTAINS
30 SUBROUTINE mumps_fdbd_init( INITIAL_SIZE, INFO )
31 INTEGER, INTENT(IN) :: initial_size
32 INTEGER, INTENT(INOUT) :: info(2)
33 INTEGER :: i, ierr
34 ALLOCATE(fdbd_array( initial_size ), stat=ierr)
35 IF (ierr > 0 ) THEN
36 info(1)=-13
37 info(2)=initial_size
38 RETURN
39 ENDIF
40 DO i=1, initial_size
41 fdbd_array(i)%INODE=-9999
42 fdbd_array(i)%LBUFR=-9999
43 NULLIFY(fdbd_array(i)%BUFR)
44 ENDDO
46 RETURN
47 END SUBROUTINE mumps_fdbd_init
48 FUNCTION mumps_fdbd_is_descband_stored( INODE, IWHANDLER )
50 INTEGER, INTENT(IN) :: inode
51 INTEGER, INTENT(OUT) :: iwhandler
52 INTEGER :: i
53 DO i = 1, size(fdbd_array)
54 IF (fdbd_array(i)%INODE .EQ. inode) THEN
55 iwhandler = i
57 RETURN
58 ENDIF
59 ENDDO
61 RETURN
63 SUBROUTINE mumps_fdbd_save_descband(INODE, LBUFR, BUFR,
64 & IWHANDLER, INFO)
66 INTEGER, INTENT(IN) :: inode, lbufr, bufr(lbufr)
67 INTEGER, INTENT(INOUT) :: info(2)
68 INTEGER, INTENT(OUT) :: iwhandler
69 TYPE(descband_struc_t), POINTER, DIMENSION(:) :: fdbd_array_tmp
70 INTEGER :: old_size, new_size, I, ierr
71 iwhandler = -1
72 CALL mumps_fdm_start_idx('A', 'DESCBAND', iwhandler, info)
73 IF (info(1) .LT. 0) RETURN
74 IF (iwhandler > size(fdbd_array)) THEN
75 old_size = size(fdbd_array)
76 new_size = max( (old_size * 3) / 2 + 1, iwhandler)
77 ALLOCATE(fdbd_array_tmp(new_size),stat=ierr)
78 IF (ierr.GT.0) THEN
79 info(1)=-13
80 info(2)=new_size
81 RETURN
82 ENDIF
83 DO i=1, old_size
84 fdbd_array_tmp(i)=fdbd_array(i)
85 ENDDO
86 DO i=old_size+1, new_size
87 fdbd_array_tmp(i)%INODE = -9999
88 fdbd_array_tmp(i)%LBUFR = -9999
89 NULLIFY(fdbd_array_tmp(i)%BUFR)
90 ENDDO
91 DEALLOCATE(fdbd_array)
92 fdbd_array=>fdbd_array_tmp
93 NULLIFY(fdbd_array_tmp)
94 ENDIF
95 fdbd_array(iwhandler)%INODE = inode
96 fdbd_array(iwhandler)%LBUFR = lbufr
97 ALLOCATE(fdbd_array(iwhandler)%BUFR(lbufr), stat=ierr)
98 IF (ierr > 0 ) THEN
99 info(1)=-13
100 info(2)=lbufr
101 RETURN
102 ENDIF
103 fdbd_array(iwhandler)%BUFR = bufr
104 RETURN
105 END SUBROUTINE mumps_fdbd_save_descband
106 SUBROUTINE mumps_fdbd_retrieve_descband(IWHANDLER,DESCBAND_STRUC)
107 INTEGER, INTENT(IN) :: iwhandler
108#if defined(MUMPS_F2003)
109 TYPE (descband_struc_t), POINTER, INTENT(OUT) :: descband_struc
110#else
111 TYPE (descband_struc_t), POINTER :: descband_struc
112#endif
113 descband_struc => fdbd_array(iwhandler)
114 RETURN
115 END SUBROUTINE mumps_fdbd_retrieve_descband
116 SUBROUTINE mumps_fdbd_free_descband_struc(IWHANDLER)
118 INTEGER, INTENT(INOUT) :: iwhandler
119 TYPE (descband_struc_t), POINTER :: descband_struc
120 descband_struc => fdbd_array(iwhandler)
121 descband_struc%INODE = -7777
122 descband_struc%LBUFR = -7777
123 DEALLOCATE(descband_struc%BUFR)
124 NULLIFY(descband_struc%BUFR)
125 CALL mumps_fdm_end_idx('A', 'DESCBAND', iwhandler)
126 RETURN
127 END SUBROUTINE mumps_fdbd_free_descband_struc
128 SUBROUTINE mumps_fdbd_end(INFO1)
129 INTEGER, INTENT(IN) :: info1
130 INTEGER :: i, iwhandler
131 IF (.NOT. associated(fdbd_array)) THEN
132 WRITE(*,*) "Internal error 1 in MUMPS_FAC_FDBD_END"
133 CALL mumps_abort()
134 ENDIF
135 DO i=1, size(fdbd_array)
136 IF (fdbd_array(i)%INODE .GE. 0) THEN
137 IF (info1 .GE.0) THEN
138 WRITE(*,*) "Internal error 2 in MUMPS_FAC_FDBD_END",i
139 CALL mumps_abort()
140 ELSE
141 iwhandler=i
142 CALL mumps_fdbd_free_descband_struc(iwhandler)
143 ENDIF
144 ENDIF
145 ENDDO
146 DEALLOCATE(fdbd_array)
147 RETURN
148 END SUBROUTINE mumps_fdbd_end
149#endif
#define mumps_abort
Definition VE_Metis.h:25
#define max(a, b)
Definition macros.h:21
subroutine, public mumps_fdbd_retrieve_descband(iwhandler, descband_struc)
subroutine, public mumps_fdbd_init(initial_size, info)
subroutine, public mumps_fdbd_free_descband_struc(iwhandler)
logical function, public mumps_fdbd_is_descband_stored(inode, iwhandler)
type(descband_struc_t), dimension(:), pointer, save fdbd_array
integer, save, public inode_waited_for
subroutine, public mumps_fdbd_end(info1)
subroutine, public mumps_fdbd_save_descband(inode, lbufr, bufr, iwhandler, info)
subroutine, public mumps_fdm_end_idx(what, from, iwhandler)
subroutine, public mumps_fdm_start_idx(what, from, iwhandler, info)