OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_sms.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_sms ../starter/source/general_controls/computation/hm_read_sms.F
25!||--- called by ------------------------------------------------------
26!|| contrl ../starter/source/starter/contrl.F
27!||--- calls -----------------------------------------------------
28!|| find_yield_engine ../starter/source/general_controls/computation/hm_read_sms.F
29!|| hm_get_intv ../starter/source/devtools/hm_reader/hm_get_intv.F
30!|| hm_option_count ../starter/source/devtools/hm_reader/hm_option_count.F
31!|| hm_option_read_key ../starter/source/devtools/hm_reader/hm_option_read_key.F
32!|| hm_option_start ../starter/source/devtools/hm_reader/hm_option_start.F
33!||--- uses -----------------------------------------------------
34!|| hm_option_read_mod ../starter/share/modules1/hm_option_read_mod.F
35!|| submodel_mod ../starter/share/modules1/submodel_mod.F
36!||====================================================================
37 SUBROUTINE hm_read_sms(LSUBMODEL)
38C-----------------------------------------------
39C ROUTINE DESCRIPTION :
40C ===================
41C READ /AMS USING HM_READER
42C-----------------------------------------------
43C DUMMY ARGUMENTS DESCRIPTION:
44C ===================
45C NAME DESCRIPTION
46C LSUBMODEL SUBMODEL STRUCTURE
47C-----------------------------------------------
48C M o d u l e s
49C-----------------------------------------------
51 USE submodel_mod
52C-----------------------------------------------
53C I m p l i c i t T y p e s
54C-----------------------------------------------
55#include "implicit_f.inc"
56C-----------------------------------------------
57C C o m m o n B l o c k s
58C-----------------------------------------------
59#include "com01_c.inc"
60#include "sms_c.inc"
61#include "units_c.inc"
62C-----------------------------------------------
63C D u m m y A r g u m e n t s
64C-----------------------------------------------
65C INPUT ARGUMENTS
66 TYPE(submodel_data),INTENT(IN)::LSUBMODEL(*)
67C OUTPUT ARGUMENTS
68C-----------------------------------------------
69C L o c a l V a r i a b l e s
70C-----------------------------------------------
71 INTEGER I,NB_AMS,SUB_ID
72 LOGICAL IS_AVAILABLE
73 CHARACTER MESS*40
74 DATA mess /'SETTINGS FOR ADVANCED MASS SCALING '/
75C============================================================================
76 is_available = .false.
77C----------------------------------------------
78C ISMS_SELEC = 0 --> No AMS
79C ISMS_SELEC = 1 --> Full AMS
80C ISMS_SELEC = 2 --> AMS by parts
81C ISMS_SELEC = 3 --> AMS auto
82C ISMS_SELEC = 4 --> AMS auto + parts
83
84 isms=0
85 isms_selec = 0
86C
87 CALL hm_option_count('/AMS', nb_ams)
88 CALL hm_option_start('/AMS')
89 DO i=1,nb_ams
90 CALL hm_option_read_key(lsubmodel,
91 . submodel_id = sub_id)
92 isms=1
93 CALL hm_get_intv('GRPART_ID',idtgrs,is_available,lsubmodel)
94 ENDDO
95C
96 IF(isms /= 0)THEN
97C
98 WRITE(iout,2000)
99C
100C Engine file is checked for automatic element selection activation
101 dt_sms_switch = zero
102 CALL find_yield_engine(dt_sms_switch)
103C
104 IF (dt_sms_switch==zero) THEN
105 IF (idtgrs==0) THEN
106 WRITE(iout,2100)
107 isms_selec = 1
108 ELSE
109 WRITE(iout,2200) idtgrs
110 isms_selec = 2
111 ENDIF
112 ELSE
113 IF (idtgrs==0) THEN
114 isms_selec = 3
115 ELSE
116 WRITE(iout,2200) idtgrs
117 isms_selec = 4
118 ENDIF
119 WRITE(iout,2300) dt_sms_switch
120 ENDIF
121C
122 idtgrs = -idtgrs
123 irest_mselt=1
124 END IF
125C--------------------------------------------------
126 2000 FORMAT(//
127 . ' ADVANCED MASS SCALING: ',/
128 . ' --------------------- ')
129 2100 FORMAT(/
130 . ' SELECTIVE MASS SCALING APPLIED TO ALL PARTS')
131 2200 FORMAT(/
132 . ' ADVANCED MASS SCALING APPLIED ON GROUP OF PARTS . . . .',i10)
133 2300 FORMAT(/
134 . ' AUTOMATIC ELEMENT SELECTION ENABLED (/DT/CST_AMS DETECTED IN ENGINE INPUT FILE)',/
135 . ' TIME STEP CRITERIA FOR AMS ACTIVATION. . . . . . . . .',1pg20.13)
136C--------------------------------------------------
137 RETURN
138 END
139!||====================================================================
140!|| find_yield_engine ../starter/source/general_controls/computation/hm_read_sms.F
141!||--- called by ------------------------------------------------------
142!|| hm_read_sms ../starter/source/general_controls/computation/hm_read_sms.F
143!||--- calls -----------------------------------------------------
144!|| ancmsg ../starter/source/output/message/message.f
145!||--- uses -----------------------------------------------------
146!|| message_mod ../starter/share/message_module/message_mod.F
147!||====================================================================
148 SUBROUTINE find_yield_engine(DT_SMS_SWITCH)
149 USE inoutfile_mod
150C-----------------------------------------------
151C M o d u l e s
152C-----------------------------------------------
153 USE message_mod
154C-----------------------------------------------
155C I m p l i c i t T y p e s
156C-----------------------------------------------
157#include "implicit_f.inc"
158C-----------------------------------------------
159C C o m m o n B l o c k s
160C-----------------------------------------------
161#include "scr15_c.inc"
162C-----------------------------------------------
163C D u m m y A r g u m e n t s
164C-----------------------------------------------
165 my_real
166 . dt_sms_switch
167C-----------------------------------------------
168C L o c a l V a r i a b l e s
169C-----------------------------------------------
170 INTEGER IO_ERR1
171 CHARACTER FILNAM*109, KEYA*80, KEYA2*80
172 my_real
173 . dtsca,dtmini
174 INTEGER :: LEN_TMP_NAME
175 CHARACTER(len=2148) :: TMP_NAME
176C-----------------------------------------------
177
178C-----------------------------------------------
179C Lecture des donnes dans le fichier engine
180C-----------------------------------------------
181 filnam=rootnam(1:rootlen)//'_0001.rad'
182
183 len_tmp_name = infile_name_len+rootlen+9
184 tmp_name=infile_name(1:infile_name_len)//filnam(1:rootlen+9)
185 OPEN(unit=71,file=tmp_name(1:len_tmp_name),
186 . access='SEQUENTIAL',status='OLD',iostat=io_err1)
187C
188 IF (io_err1/=0) THEN
189 filnam=rootnam(1:rootlen)//'D01'
190 len_tmp_name = infile_name_len+rootlen+9
191 tmp_name=infile_name(1:infile_name_len)//filnam(1:rootlen+3)
192 OPEN(unit=71,file=tmp_name(1:len_tmp_name),
193 . access='SEQUENTIAL',status='OLD',iostat=io_err1)
194 ENDIF
195
196 IF (io_err1==0) THEN
197C
198 10 READ(71,'(A)',END=20) keya
199C
200 IF(keya(1:11)=='/DT/CST_AMS') THEN
201 30 READ(71,'(A)',END=20) keya
202 IF ((keya(1:1)=='#').OR.(keya(1:1)=='$')) THEN
203 GOTO 30
204 ELSE
205 backspace(71)
206 ENDIF
207 READ(71,*,END=20) DTSCA,dtmini
208 IF (dtsca == zero) dtsca = zep9
209 dt_sms_switch = dtmini / dtsca
210 ENDIF
211C
212 GOTO 10
213C
214 20 CONTINUE
215
216 CLOSE(71)
217C
218 ELSE
219C
220 CALL ancmsg(msgid=1570,
221 . msgtype=msgwarning,
222 . anmode=aninfo_blind_2,
223 . c1=rootnam(1:rootlen)//'_0001.rad',
224 . c2=rootnam(1:rootlen)//'D01')
225C
226 ENDIF
227
228C-------------------------------------------
229 RETURN
230 END
231!||====================================================================
232!|| inisms ../starter/source/general_controls/computation/hm_read_sms.F
233!||--- called by ------------------------------------------------------
234!|| lectur ../starter/source/starter/lectur.F
235!||--- uses -----------------------------------------------------
236!|| message_mod ../starter/share/message_module/message_mod.F
237!||====================================================================
238 SUBROUTINE inisms(
239 . IGRPART ,IPARTS ,IPARTQ ,IPARTC ,
240 . IPARTT ,IPARTP ,IPARTR ,IPARTTG ,
241 . IPARTX ,TAGPRT_SMS )
242C-----------------------------------------------
243C M o d u l e s
244C-----------------------------------------------
245 USE message_mod
246 USE groupdef_mod
247C-----------------------------------------------
248C I m p l i c i t T y p e s
249C-----------------------------------------------
250#include "implicit_f.inc"
251C-----------------------------------------------
252C C o m m o n B l o c k s
253C-----------------------------------------------
254#include "com04_c.inc"
255#include "sms_c.inc"
256C-----------------------------------------------
257C D u m m y A r g u m e n t s
258C-----------------------------------------------
259 INTEGER IPARTS(*),IPARTQ(*),IPARTC(*),IPARTT(*),
260 . IPARTP(*),IPARTR(*),IPARTTG(*),IPARTX(*),
261 . TAGPRT_SMS(*)
262C-----------------------------------------------
263 TYPE (GROUP_) , DIMENSION(NGRPART) :: IGRPART
264C-----------------------------------------------
265C L o c a l V a r i a b l e s
266C-----------------------------------------------
267 INTEGER KK, N, I, IAD, IP,
268 . NG, J, ITY, NEL, NFT
269C--------------------------------------------------
270 IF(idtgrs/=0)THEN
271C------
272 IF(idtgrs < 0)THEN
273 idtgrs=-idtgrs
274
275 kk=ngrnod+
276 + ngrbric+ngrquad+ngrshel+ngrsh3n+ngrtrus+ngrbeam+ngrspri
277 DO n=1,ngrpart
278 IF (igrpart(n)%ID == idtgrs) THEN
279 idtgrs=n
280 GO TO 100
281 END IF
282 END DO
283 200 CALL ancmsg(msgid=738,
284 . msgtype=msgerror,
285 . anmode=aninfo,
286 . i1=idtgrs)
287 100 CONTINUE
288 DO i=1,igrpart(idtgrs)%NENTITY
289 ip=igrpart(idtgrs)%ENTITY(i)
290 tagprt_sms(ip)=1
291 END DO
292 END IF
293C------
294 ELSEIF (isms_selec/=3) THEN
295C------
296 DO ip=1,npart
297 tagprt_sms(ip)=1
298 END DO
299C
300 END IF
301C--------------------------------------------------
302 RETURN
303 END
#define my_real
Definition cppsort.cpp:32
subroutine hm_get_intv(name, ival, is_available, lsubmodel)
subroutine hm_option_count(entity_type, hm_option_number)
subroutine hm_option_start(entity_type)
subroutine find_yield_engine(dt_sms_switch)
subroutine inisms(igrpart, iparts, ipartq, ipartc, ipartt, ipartp, ipartr, iparttg, ipartx, tagprt_sms)
subroutine hm_read_sms(lsubmodel)
Definition hm_read_sms.F:38
integer infile_name_len
character(len=infile_char_len) infile_name
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
program starter
Definition starter.F:39