OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_fail_user.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!|| hm_read_fail_user ../starter/source/materials/fail/failuser/hm_read_fail_user.f
25!||--- called by ------------------------------------------------------
26!|| hm_read_fail ../starter/source/materials/fail/hm_read_fail.F
27!||--- calls -----------------------------------------------------
28!|| ancmsg ../starter/source/output/message/message.F
29!|| arret ../starter/source/system/arret.F
30!|| hm_get_intv ../starter/source/devtools/hm_reader/hm_get_intv.F
31!|| hm_get_string_index ../starter/source/devtools/hm_reader/hm_get_string_index.F
32!|| user_output ../starter/source/user_interface/user_output.f
33!||--- uses -----------------------------------------------------
34!|| message_mod ../starter/share/message_module/message_mod.F
35!|| submodel_mod ../starter/share/modules1/submodel_mod.F
36!||====================================================================
37 SUBROUTINE hm_read_fail_user(FAIL ,IRUPT,IUSER_KEY,USERL_AVAIL,
38 . LSUBMODEL,UNITAB_SUB,MAT_ID)
39C-----------------------------------------------
40C ROUTINE DESCRIPTION :
41C ===================
42C Read user material failure - generic routine
43C------------------------------------------------------------------
44C DUMMY ARGUMENTS DESCRIPTION:
45C ===================
46C
47C NAME DESCRIPTION
48C
49C USERL_AVAIL Flag if userlibrary was load
50C IS_AVAILABLE Bool / Result of HM_interface
51C LSUBMODEL SUBMODEL Structure.
52C------------------------------------------------------------------
53C M o d u l e s
54C-----------------------------------------------
55 USE fail_param_mod
56 USE message_mod
57 USE submodel_mod
59C-----------------------------------------------
60C I m p l i c i t T y p e s
61C-----------------------------------------------
62#include "implicit_f.inc"
63C-----------------------------------------------
64C C o m m o n B l o c k s
65C-----------------------------------------------
66#include "scr15_c.inc"
67#include "units_c.inc"
68C-----------------------------------------------
69C D u m m y A r g u m e n t s
70C-----------------------------------------------
71 INTEGER IRUPT,MAT_ID
72 INTEGER USERL_AVAIL
73 TYPE(submodel_data),INTENT(IN) :: LSUBMODEL(*)
74 my_real, DIMENSION(4) :: unitab_sub
75 CHARACTER(LEN=NCHARLINE) :: IUSER_KEY
76 TYPE (FAIL_PARAM_) ,INTENT(INOUT) :: FAIL
77C-----------------------------------------------
78C L o c a l V a r i a b l e s
79C-----------------------------------------------
80 INTEGER NUPARAM,NUVAR,NFUNC
81 INTEGER, PARAMETER :: MAXFUNC = 100
82 INTEGER, PARAMETER :: MAXPARAM = 1000
83 INTEGER, DIMENSION(MAXFUNC) :: IFUNC
84 my_real, DIMENSION(MAXPARAM) :: uparam
85 CHARACTER(LEN=4096) :: SCR_FILE_NAME
86 CHARACTER(LEN=ncharline) :: RLINE
87 CHARACTER (LEN=4) :: CRUP
88 CHARACTER(LEN=nchartitle) :: TITLE
89 LOGICAL :: IS_AVAILABLE
90 INTEGER NLINES,J
91 INTEGER SCR_FILE_NAME_LEN
92!
93 CHARACTER OPTION*256
94 INTEGER SIZE
95C-----------------------------------------------
96 IF (userl_avail == 0)THEN
97 ! ERROR to be printed & exit
98 option='/FAIL/'//iuser_key
99 size=len_trim(option)
100 CALL ancmsg(msgid=1130,
101 . msgtype=msgerror,c1=option(1:size),anmode=aninfo)
102 CALL arret(2)
103 ENDIF
104
105 CALL hm_get_intv ('Number_of_datalines' ,nlines ,is_available, lsubmodel)
106
107 IF(nlines > 0)THEN
108
109 ! Create tempo file
110 WRITE(crup,'(I4.4)')irupt
111 scr_file_name='SI'//rootnam(1:rootlen)//'_'//crup//'.scr'
112 scr_file_name_len=len_trim(scr_file_name)
113 OPEN(unit=30,file=trim(scr_file_name),form='FORMATTED',recl=ncharline)
114
115 ! Read & Dump in scratch file
116 DO j=1,nlines
117 CALL hm_get_string_index('arraydatalines', rline, j, ncharline, is_available)
118 WRITE(30,fmt='(A)')trim(rline)
119 ENDDO
120 CLOSE(unit=30)
121!
122 CALL st_userlib_lecr(irupt,rootnam,rootlen,uparam,maxparam,nuparam,
123 . nuvar ,ifunc,maxfunc,nfunc,unitab_sub,
124 . mat_id)
125c
126 fail%KEYWORD = 'USER FAILURE MODEL'
127 fail%IRUPT = irupt
128 fail%FAIL_ID = 0
129 fail%NUPARAM = nuparam
130 fail%NIPARAM = 0
131 fail%NUVAR = nuvar
132 fail%NFUNC = nfunc
133 fail%NTABLE = 0
134 fail%NMOD = 0
135c
136 ALLOCATE (fail%UPARAM(fail%NUPARAM))
137 ALLOCATE (fail%IPARAM(fail%NIPARAM))
138 ALLOCATE (fail%IFUNC (fail%NFUNC))
139 ALLOCATE (fail%TABLE (fail%NTABLE))
140c
141 fail%UPARAM(1:nuparam) = uparam(1:nuparam)
142 fail%IFUNC (1:nfunc) = ifunc(1:nfunc)
143c
144 CALL user_output(iout,irupt,rootnam,rootlen,1)
145 ELSE
146 ! Error MESSAGE_Mess
147 ENDIF
148!---------
149 RETURN
150 END
#define my_real
Definition cppsort.cpp:32
subroutine hm_get_intv(name, ival, is_available, lsubmodel)
subroutine hm_get_string_index(name, sval, index, size, is_available)
subroutine hm_read_fail_user(fail, irupt, iuser_key, userl_avail, lsubmodel, unitab_sub, mat_id)
integer, parameter nchartitle
integer, parameter ncharline
subroutine ancmsg(msgid, msgtype, anmode, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, r1, r2, r3, r4, r5, r6, r7, r8, r9, c1, c2, c3, c4, c5, c6, c7, c8, c9, prmode)
Definition message.F:889
subroutine arret(nn)
Definition arret.F:87
subroutine user_output(iout, ilaw, rootn, rootlen, inpf)
Definition user_output.F:38
program starter
Definition starter.F:39