OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
dynlib_mod.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| dynlib_mod ../engine/share/modules/dynlib_mod.F
25!||--- called by ------------------------------------------------------
26!|| arret ../engine/source/system/arret.F
27!|| radioss0 ../engine/source/engine/radioss0.F
28!|| radioss2 ../engine/source/engine/radioss2.F
29!|| resol ../engine/source/engine/resol.F
30!||====================================================================
32!$COMMENT
33! DYNLIB_MOD :
34! * define a structure DLIB_STRUCT in order to manage the user routine calls :
35! * up to 100 user routines (--> NBR_DLIB variable)
36! * DLIB_NAME_LEN : maximal user routine name length
37! * DLIB_NAME : name of the user routine
38! * DLIB_BOOL : boolean : true = user routine available
39! * initialize the DLIB_STRUCT structure
40! * pointer to the DLIB_STRUCT : ID_name_of_the_user_routine
41! * add the name of the user routine (%DLIB_NAME)
42! * the DLIB_BOOL boolean is initialized with the array DLIB_ARRAY :
43! - DLIB_ARRAY is initialized in dyn_userlib.c
44!
45! For a new user routine :
46! o create the pointer to DLIB_STRUCT struct : add a new ID_name_of_the_user_routine
47! o add the name of the user routine (%DLIB_NAME)
48! o manage the DLIB_ARRAY in dyn_userlib.c
49!
50! DLIB_STRUCT organization :
51! (1) --> ENGINE_USER_CHECK
52! (2) --> ENGINE_USER_FINALIZE
53! (3) --> ENGINE_USER_INITIALIZE
54! (4:100) --> empty, not used
55!$ENDCOMMENT
56C-----------------------------------------------
57C m y _ r e a l
58C-----------------------------------------------
59#include "my_real.inc"
60C-----------------------------------------------
61C D e r i v e d T y p e D e f i n i t i o n s
62C-----------------------------------------------
63 INTEGER, PARAMETER :: nbr_dlib=100
64 INTEGER, PARAMETER :: dlib_name_len=100
65 INTEGER, DIMENSION(NBR_DLIB) :: dlib_array
66
68 CHARACTER(len=DLIB_NAME_LEN) :: dlib_name
69 LOGICAL :: dlib_bool
70 END TYPE dyn_lib_type
71
72 TYPE(dyn_lib_type),DIMENSION(:), ALLOCATABLE :: dlib_struct
73
74 ! local user variables
75 INTEGER :: ispmd_user ! --> ispmd : proc ID
76 INTEGER :: nspmd_user ! --> nspmd : total number of mpi tasks
77 INTEGER :: ntask_user ! --> ntask : total number of openmp tasks
78 INTEGER :: mstop_user ! --> mstop : 0 = ok ; 1 = stop the run
79 INTEGER :: ncycle_user ! --> ncycle : number of cycle
80 REAL(kind=8) :: tstop_user ! --> tstop : stop time
81 REAL(kind=8) :: tt_user ! --> tt : current time
82
83 ! pointer to the DLIB_STRUCT : ID_name_of_the_user_routine
84 INTEGER, PARAMETER :: id_engine_user_check=1
85 INTEGER, PARAMETER :: id_engine_user_finalize = 2
86 INTEGER, PARAMETER :: id_engine_user_initialize = 3
87
88 CONTAINS
89! -----------------------------------------------
90!||====================================================================
91!|| init_dyn_lib_struc ../engine/share/modules/dynlib_mod.F
92!||--- called by ------------------------------------------------------
93!|| radioss0 ../engine/source/engine/radioss0.F
94!|| radioss2 ../engine/source/engine/radioss2.F
95!||====================================================================
96 SUBROUTINE init_dyn_lib_struc(MODE)
97!$COMMENT
98! INIT_DYN_LIB_STRUC description
99! INIT_DYN_LIB_STRUC initializes the name of user routines and
100! the DLIB_BOOL flag available / non-available
101!$ENDCOMMENT
102! -----------------------------------------------
103! I m p l i c i t T y p e s
104! -----------------------------------------------
105#include "implicit_f.inc"
106 INTEGER :: I,MODE
107! -----------------------------------------------
108 IF(mode==0) THEN
109 DO i=1,nbr_dlib
110 dlib_struct(i)%DLIB_NAME(1:dlib_name_len) = ''
111 dlib_struct(i)%DLIB_BOOL=.false.
112 ENDDO
113
114 ELSE
115 DO i=1,nbr_dlib
116 IF(dlib_array(i)/=0) dlib_struct(i)%DLIB_BOOL=.true.
117 ENDDO
118
119 dlib_struct(id_engine_user_check)%DLIB_NAME(1:17) = "ENGINE_USER_CHECK"
120 dlib_struct(id_engine_user_finalize)%DLIB_NAME(1:20) = "ENGINE_USER_FINALIZE"
121 dlib_struct(id_engine_user_initialize)%DLIB_NAME(1:22) = "ENGINE_USER_INITIALIZE"
122 ENDIF
123
124 RETURN
125 END SUBROUTINE init_dyn_lib_struc
126
127
128 END MODULE dynlib_mod
integer, dimension(nbr_dlib) dlib_array
Definition dynlib_mod.F:65
real(kind=8) tstop_user
Definition dynlib_mod.F:80
integer, parameter dlib_name_len
Definition dynlib_mod.F:64
integer, parameter id_engine_user_initialize
Definition dynlib_mod.F:86
type(dyn_lib_type), dimension(:), allocatable dlib_struct
Definition dynlib_mod.F:72
real(kind=8) tt_user
Definition dynlib_mod.F:81
integer ncycle_user
Definition dynlib_mod.F:79
integer nspmd_user
Definition dynlib_mod.F:76
integer ispmd_user
Definition dynlib_mod.F:75
integer mstop_user
Definition dynlib_mod.F:78
subroutine init_dyn_lib_struc(mode)
Definition dynlib_mod.F:97
integer, parameter nbr_dlib
Definition dynlib_mod.F:63
integer ntask_user
Definition dynlib_mod.F:77
integer, parameter id_engine_user_check
Definition dynlib_mod.F:84
integer, parameter id_engine_user_finalize
Definition dynlib_mod.F:85