OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_read_table1_1.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_table1_1 ../starter/source/tools/curve/hm_read_table1_1.F
25!||--- called by ------------------------------------------------------
26!|| hm_read_table1 ../starter/source/tools/curve/hm_read_table.F
27!||--- calls -----------------------------------------------------
28!|| ancmsg ../starter/source/output/message/message.F
29!|| hm_get_float_array_index ../starter/source/devtools/hm_reader/hm_get_float_array_index.F
30!|| hm_get_intv ../starter/source/devtools/hm_reader/hm_get_intv.F
31!|| hm_option_is_encrypted ../starter/source/devtools/hm_reader/hm_option_is_encrypted.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!||--- uses -----------------------------------------------------
35!|| hm_option_read_mod ../starter/share/modules1/hm_option_read_mod.F
36!|| message_mod ../starter/share/message_module/message_mod.F
37!|| submodel_mod ../starter/share/modules1/submodel_mod.F
38!|| table_mod ../starter/share/modules1/table_mod.F
39!||====================================================================
40 SUBROUTINE hm_read_table1_1(NTABLE1,NTABLE, TABLE ,NFUNCT,
41 . NPC ,PLD,L,
42 . NOM_OPT,UNITAB, LSUBMODEL)
43C-----------------------------------------------
44C M o d u l e s
45C-----------------------------------------------
46 USE table_mod
47 USE message_mod
48 USE submodel_mod
50 USE unitab_mod
52C-----------------------------------------------
53C I m p l i c i t T y p e s
54C-----------------------------------------------
55#include "implicit_f.inc"
56C-----------------------------------------------
57C D u m m y A r g u m e n t s
58C-----------------------------------------------
59 INTEGER NTABLE, NTABLE1,L,NFUNCT,NPC(*)
60 my_real PLD(*)
61 TYPE(ttable) TABLE(*)
62 INTEGER NOM_OPT(LNOPT1,*)
63 TYPE(submodel_data), DIMENSION(NSUBMOD), INTENT(IN) :: LSUBMODEL
64 TYPE(unit_type_), INTENT(IN) :: UNITAB
65C-----------------------------------------------
66C C o m m o n B l o c k s
67C-----------------------------------------------
68#include "scr17_c.inc"
69#include "units_c.inc"
70C-----------------------------------------------
71C L o c a l V a r i a b l e s
72C-----------------------------------------------
73 INTEGER ITYPE, IBID, NFUNCT0
74 INTEGER I, J, K, II, N, NDIM, NX(4), NY,
75 . jrec, npts, stat, ll,npt,ipt
76 INTEGER IERROR, NF, IDFUNC, NP
77 my_real BID, F5(5), TIME, FUNCT
78 CHARACTER(LEN=NCHARTITLE) :: TITR,TITR1
79 CHARACTER MESS*40
80 CHARACTER(LEN=NCHARFIELD) :: KEY
81 DATA mess/' FUNCTION & TABLE DEFINITION '/
82 LOGICAL :: IS_ENCRYPTED, IS_AVAILABLE
83C======================================================================|
84 is_encrypted = .false.
85 is_available = .false.
86
87 CALL hm_option_start('/TABLE/1')
88 DO i=1,ntable1
89
90
91 CALL hm_option_read_key(lsubmodel,
92 . option_titr = titr,
93 . option_id = ll)
94 CALL hm_option_is_encrypted(is_encrypted)
95C-----------------------------------------------
96 nx(1) = 0
97 nx(2) = 0
98 nx(3) = 0
99 nx(4) = 0
100
101 CALL hm_get_intv('ORDER', ndim, is_available, lsubmodel)
102 IF(ndim/=1.AND.ndim/=2.AND.ndim/=3.AND.ndim/=4)THEN
103 CALL ancmsg(msgid=777,
104 . msgtype=msgerror,
105 . anmode=aninfo_blind_1,
106 . i1=ll,
107 . c1=titr)
108 END IF
109 CALL hm_get_intv('curverows', npt, is_available, lsubmodel) !size of X
110
111 IF(ndim==1)THEN
112 l=l+1
113 npts=npt
114 npc(nfunct+l+1)=ll
115 npc(l+1)=npc(l)
116
117 npts=0
118c read abscissa values
119 DO ipt = 1, npt
120 CALL hm_get_float_array_index('table2darray',time,2*ipt-1,is_available,lsubmodel,unitab)
121c read ordinate values
122 CALL hm_get_float_array_index('table2darray',funct,2*ipt,is_available,lsubmodel, unitab)
123 npts=npts+1
124 pld(npc(l+1))=time
125 IF(npts > 1 .AND. pld(npc(l+1)) <= pld(npc(l+1)-2))THEN
126 CALL ancmsg(msgid=156,
127 . msgtype=msgerror,
128 . anmode=aninfo_blind_1,
129 . i1=ll,
130 . c1=titr1,
131 . i2=npts,
132 . i3=npts-1)
133 ENDIF
134 npc(l+1)=npc(l+1)+1
135 pld(npc(l+1))=funct
136 npc(l+1)=npc(l+1)+1
137 ENDDO ! IPT
138
139C build table structure
140 table(l)%NOTABLE=ll
141 table(l)%NDIM =1
142 ALLOCATE(table(l)%X(1),stat=stat)
143 IF (stat /= 0) CALL ancmsg(msgid=268,anmode=aninfo,
144 . msgtype=msgerror,
145 . c1='TABLE')
146 ALLOCATE(table(l)%X(1)%VALUES(npts),stat=stat)
147 IF (stat /= 0) CALL ancmsg(msgid=268,anmode=aninfo,
148 . msgtype=msgerror,
149 . c1='TABLE')
150
151 ALLOCATE(table(l)%Y,stat=stat)
152 IF (stat /= 0) CALL ancmsg(msgid=268,anmode=aninfo,
153 . msgtype=msgerror,
154 . c1='TABLE')
155 ALLOCATE(table(l)%Y%VALUES(npts),stat=stat)
156 IF (stat /= 0) CALL ancmsg(msgid=268,anmode=aninfo,
157 . msgtype=msgerror,
158 . c1='TABLE')
159
160 DO n=1,npts
161 table(l)%X(1)%VALUES(n)=pld(npc(l)+2*n-2)
162 table(l)%Y%VALUES(n) =pld(npc(l)+2*n-1)
163 END DO
164C
165 IF (is_encrypted)THEN
166 WRITE(iout,'(5X,A,//)')'CONFIDENTIAL DATA'
167 ELSE
168 WRITE(iout,2100) table(l)%NOTABLE, table(l)%NDIM
169 DO k=1,table(l)%NDIM
170 nx(k)=SIZE( table(l)%X(k)%VALUES )
171 WRITE(iout,2200) k
172 WRITE(iout,2250) (table(l)%X(k)%VALUES(n),n=1,nx(k))
173 END DO
174 ny=SIZE(table(l)%Y%VALUES)
175 WRITE(iout,2300)
176 WRITE(iout,2350) (table(l)%Y%VALUES(n),n=1,ny)
177 END IF
178
179 endif!(NDIM==1)
180 ENDDO !I=1,NTABLE0
181
182 RETURN
183C-----------------------------------------------------------------
1842000 FORMAT(//
185 . ' TABLES'/
186 . ' ------'/
187 . ' NUMBER OF TABLES . . . . . . . . . . =',i10/)
1882100 FORMAT(/' TABLE ID . . . . . . . . . . . . . . =',i10/
189 . ' NUMBER OF PARAMETERS . . . . . . . . =',i10/)
1902200 FORMAT(/' VALUES FOR PARAMETER NUMBER. . . . . .',i4,':'/)
1912250 FORMAT((3x,5(1x,g20.13))/)
1922300 FORMAT(/' ORDINATE VALUES . . . . . . . . . . . :'/)
1932350 FORMAT((3x,5(1x,g20.13))/)
194 END
subroutine hm_get_float_array_index(name, rval, index, is_available, lsubmodel, unitab)
subroutine hm_get_intv(name, ival, is_available, lsubmodel)
subroutine hm_option_is_encrypted(is_encrypted)
subroutine hm_option_start(entity_type)
subroutine hm_read_table1_1(ntable1, ntable, table, nfunct, npc, pld, l, nom_opt, unitab, lsubmodel)
integer, parameter nchartitle
integer, parameter ncharfield
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