OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_window_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_window_user ../starter/source/tools/userwi/hm_read_window_user.F
25!||--- called by ------------------------------------------------------
26!|| lectur ../starter/source/starter/lectur.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!|| hm_option_read_key ../starter/source/devtools/hm_reader/hm_option_read_key.F
33!|| hm_option_start ../starter/source/devtools/hm_reader/hm_option_start.F
34!|| user_output ../starter/source/user_interface/user_output.F
35!||--- uses -----------------------------------------------------
36!|| hm_option_read_mod ../starter/share/modules1/hm_option_read_mod.F
37!|| message_mod ../starter/share/message_module/message_mod.F
38!|| submodel_mod ../starter/share/modules1/submodel_mod.F
39!||====================================================================
40 SUBROUTINE hm_read_window_user(USER_WINDOWS, LSUBMODEL,ITAB,
41 * X, V, VR, MS, IN)
42C-----------------------------------------------
43C ROUTINE DESCRIPTION :
44C ===================
45C Read user global windows - generic routine
46C------------------------------------------------------------------
47C DUMMY ARGUMENTS DESCRIPTION:
48C ===================
49C
50C NAME DESCRIPTION
51C
52C USERL_AVAIL Flag if userlibrary was load
53C IS_AVAILABLE Bool / Result of HM_interface
54C LSUBMODEL SUBMODEL Structure.
55C------------------------------------------------------------------
56C
57C-----------------------------------------------
58C M o d u l e s
59C-----------------------------------------------
60 USE my_alloc_mod
61 USE message_mod
62 USE submodel_mod
66C-----------------------------------------------
67C I m p l i c i t T y p e s
68C-----------------------------------------------
69#include "implicit_f.inc"
70C-----------------------------------------------
71C C o m m o n B l o c k s
72C-----------------------------------------------
73#include "com01_c.inc"
74#include "com04_c.inc"
75#include "scr15_c.inc"
76#include "scr17_c.inc"
77#include "units_c.inc"
78#include "userlib.inc"
79#include "tabsiz_c.inc"
80C-----------------------------------------------
81C D u m m y A r g u m e n t s
82C-----------------------------------------------
83 TYPE(user_windows_),INTENT(INOUT) :: USER_WINDOWS
84 TYPE(submodel_data),INTENT(IN) :: LSUBMODEL(*)
85 INTEGER, DIMENSION(NUMNOD),INTENT(IN) :: ITAB
86 my_real, DIMENSION(3,NUMNOD),INTENT(IN) :: x, v, vr
87 my_real, DIMENSION(NUMNOD),INTENT(IN) :: ms,in
88C-----------------------------------------------
89C L o c a l V a r i a b l e s
90C-----------------------------------------------
91 CHARACTER(LEN=4096) :: SCR_FILE_NAME
92 CHARACTER(LEN=ncharline) :: RLINE
93 CHARACTER (LEN=4) :: CWIN
94 CHARACTER(LEN=nchartitle) :: TITLE
95 CHARACTER(LEN=ncharkey) :: KEY
96 LOGICAL :: IS_AVAILABLE
97 INTEGER ,DIMENSION(100) :: IUPARAM
98 INTEGER NLINES,I,J,STAT,USERWI_ID
99 INTEGER SCR_FILE_NAME_LEN
100 INTEGER NUVAR,NUVARI
101!
102 CHARACTER OPTION*256
103 INTEGER SIZE
104C-----------------------------------------------
105 is_available = .false.
106!
107 IF (userl_avail == 0)THEN
108 ! ERROR to be printed & exit
109 option='/USERWI'
110 size=len_trim(option)
111 CALL ancmsg(msgid=1130,
112 . msgtype=msgerror,c1=option(1:size),anmode=aninfo)
113 CALL arret(2)
114 ENDIF
115
116 CALL hm_option_start('/USERWI')
117!
118 CALL hm_option_read_key(lsubmodel,
119 * option_id = userwi_id)
120
121 user_windows%USER_WINDOWS_ID = userwi_id
122
123 CALL hm_get_intv ('Number_of_datalines' ,nlines ,is_available, lsubmodel)
124
125 ! Create tempo file
126 WRITE(cwin,'(I4.4)') 1
127 scr_file_name='SI'//rootnam(1:rootlen)//'_'//cwin//'.scr'
128 scr_file_name_len=len_trim(scr_file_name)
129 OPEN(unit=30,file=trim(scr_file_name),form='FORMATTED',recl=ncharline)
130 WRITE(30,'(A)') '/USERWI'
131!
132 IF (nlines > 0) THEN
133
134 ! Read & Dump in scratch file
135 DO j=1,nlines
136 CALL hm_get_string_index('arraydatalines', rline, j, ncharline, is_available)
137 WRITE(30,fmt='(A)')trim(rline)
138 ENDDO
139
140 ENDIF ! IF (NLINES > 0)
141!
142 CLOSE(unit=30)
143
144C----- memory (user buffer length estimation)
145 iuparam = 0
146 user_windows%NUVAR = 0
147 user_windows%NUVARI = 0
148!
149 CALL st_userlib_userwis_ini(rootnam,rootlen,
150 . iuparam ,numnod ,itab,
151 . x ,v ,vr ,ms ,in ,
152 . nuvar ,nuvari )
153 CALL user_output(iout,1,rootnam,rootlen,1)
154!
155 user_windows%NUVAR = nuvar
156 user_windows%NUVARI = nuvari
157
158 user_windows%S_USER = nuvar
159 user_windows%S_IUSER = nuvari+100
160
161 CALL my_alloc(user_windows%IUSER,user_windows%S_IUSER)
162 CALL my_alloc(user_windows%USER,user_windows%S_USER)
163
164 user_windows%USER(1:user_windows%S_USER) = zero
165 user_windows%IUSER(1:user_windows%S_IUSER) = 0
166
167 user_windows%IUSER(nuvari+1:nuvari+100)=iuparam(1:100)
168
169
170C----- Scratch file initialisation
171 WRITE(cwin,'(I4.4)') 1
172 scr_file_name='SI'//rootnam(1:rootlen)//'_'//cwin//'.scr'
173 scr_file_name_len=len_trim(scr_file_name)
174 OPEN(unit=30,file=trim(scr_file_name),form='FORMATTED',recl=ncharline)
175 WRITE(30,'(A)') '/USERWI'
176
177 ! Read & Dump in scratch file
178 DO j=1,nlines
179 CALL hm_get_string_index('arraydatalines', rline, j, ncharline, is_available)
180 WRITE(30,fmt='(A)')trim(rline)
181 ENDDO
182 CLOSE(unit=30)
183!
184 CALL st_userlib_userwis(rootnam, rootlen, numnod, itab,
185 . x, v, vr, ms, in,
186 . user_windows%NUVAR, user_windows%NUVARI,
187 . user_windows%USER, user_windows%IUSER )
188
189 CALL user_output(iout,1,rootnam,rootlen,1)
190!
191!---------
192 RETURN
193 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_option_start(entity_type)
subroutine hm_read_window_user(user_windows, lsubmodel, itab, x, v, vr, ms, in)
integer, parameter nchartitle
integer, parameter ncharkey
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