OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
lecfun.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!|| lecfun ../engine/source/tools/curve/lecfun.F
25!||--- called by ------------------------------------------------------
26!|| lectur ../engine/source/input/lectur.F
27!||--- calls -----------------------------------------------------
28!|| ancmsg ../engine/source/output/message/message.F
29!|| arret ../engine/source/system/arret.F
30!||--- uses -----------------------------------------------------
31!|| message_mod ../engine/share/message_module/message_mod.F
32!|| table_mod ../engine/share/modules/table_mod.F
33!||====================================================================
34 SUBROUTINE lecfun(NPC,PLD,NFCT,NPTST,TABLE)
35C-----------------------------------------------
36C M o d u l e s
37C-----------------------------------------------
38 USE table_mod
39 USE message_mod
40C-----------------------------------------------
41C I m p l i c i t T y p e s
42C-----------------------------------------------
43#include "implicit_f.inc"
44C-----------------------------------------------
45C D u m m y A r g u m e n t s
46C-----------------------------------------------
47 INTEGER NFCT, NPTST
48 INTEGER NPC(*)
49C REAL
51 . pld(*)
52 TYPE(ttable) TABLE(*)
53C-----------------------------------------------
54C C o m m o n B l o c k s
55C-----------------------------------------------
56#include "com04_c.inc"
57#include "units_c.inc"
58#include "warn_c.inc"
59#include "task_c.inc"
60C-----------------------------------------------
61C L o c a l V a r i a b l e s
62C-----------------------------------------------
63 INTEGER L, LL, NPTS, I, J, IK, K, LLNEW, NPTSNEW,
64 . OK
65C REAL
67 . time, funct
68C-----------------------------------------------
69 IF(ispmd==0)
70 . WRITE (iout,2000) nfct
71C
72 DO k=1,nfct
73 READ (iin,'(2I10)') llnew,nptsnew
74 IF(ispmd==0)
75 . WRITE (iout,2200) llnew,nptsnew
76 ok=0
77 DO l=1,nfunct
78 ll=npc(nfunct+l+1)
79 IF(ll==llnew)THEN
80 ok=1
81 npts = (npc(l+1)-npc(l))/2
82 IF(npts==nptsnew)THEN
83 i=npc(l)
84 DO j=1,nptsnew
85C
86 READ(iin,'(2F16.0)') time,funct
87 IF(ispmd==0)
88 . WRITE(iout,'(3X,G12.4,2X,G12.4)') time,funct
89C
90 pld(i)=time
91 IF(j>1.AND.pld(i)<=pld(i-2)) THEN
92 ierr=ierr+1
93 ik=j/2+1
94 IF(ispmd==0)
95 . CALL ancmsg(msgid=105,anmode=aninfo_blind,
96 . i1=ll,i2=ik,i3=ik-1)
97 CALL arret(2)
98 ENDIF
99 i=i+1
100 pld(i)=funct
101 i=i+1
102 ENDDO
103 ELSE
104 ierr=ierr+1
105 IF(ispmd==0)THEN
106 CALL ancmsg(msgid=106,anmode=aninfo_blind,
107 . i1=ll)
108 END IF
109 CALL arret(2)
110 ENDIF
111 ENDIF
112 ENDDO
113 IF(ok==0)THEN
114 IF(ispmd==0)THEN
115 ierr=ierr+1
116 CALL ancmsg(msgid=107,anmode=aninfo,
117 . i1=ll)
118 END IF
119 ENDIF
120C
121 ok=0
122 DO l=1,nfunct
123C
124C par construction TABLE(L) == Function no L
125 ll=table(l)%NOTABLE
126 IF(ll==llnew)THEN
127 ok=1
128 npts = SIZE(table(l)%X(1)%VALUES)
129 IF(npts==nptsnew)THEN
130 i=npc(l)
131 DO j=1,nptsnew/2
132 table(l)%X(1)%VALUES(j)=pld(i)
133 IF(j>1.AND.
134 . table(l)%X(1)%VALUES(j)<=table(l)%X(1)%VALUES(j-1))THEN
135 ierr=ierr+1
136 ik=j
137 IF(ispmd==0)
138 . CALL ancmsg(msgid=105,anmode=aninfo_blind,
139 . i1=ll,i2=ik,i3=ik-1)
140 CALL arret(2)
141 ENDIF
142 i=i+1
143 table(l)%Y%VALUES(j)=pld(i)
144 i=i+1
145 ENDDO
146 ELSE
147 ierr=ierr+1
148 IF(ispmd==0)THEN
149 CALL ancmsg(msgid=106,anmode=aninfo_blind,
150 . i1=ll)
151 END IF
152 CALL arret(2)
153 ENDIF
154 ENDIF
155 ENDDO
156 IF(ok==0)THEN
157 IF(ispmd==0)THEN
158 ierr=ierr+1
159 CALL ancmsg(msgid=107,anmode=aninfo,
160 . i1=ll)
161 END IF
162 ENDIF
163 ENDDO
164C
165 RETURN
166C
1672000 FORMAT(' NEW LOAD CURVES' //
168 . ' NUMBER OF NEW LOAD CURVES. . . . . . =' ,i10 /)
1692100 FORMAT(' ** ERROR: LOAD CURVE NUMBER' )
1702200 FORMAT(///' LOAD FUNCTION NUMBER. . . . . =',i10/
171 . ' NUMBER OF TIME POINTS . . . . =',i8//
172 . ' TIME VALUE ' /)
173 END
#define my_real
Definition cppsort.cpp:32
subroutine lecfun(npc, pld, nfct, nptst, table)
Definition lecfun.F:35
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