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
66 my_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.AND. IF(J>1PLD(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 By Table Construction (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.AND. IF(J>1
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 /)
1692200 FORMAT(///' LOAD FUNCTION NUMBER. . . . . =',I10/
170 . ' NUMBER OF TIME POINTS . . . . =',I8//
171 . ' TIME VALUE ' /)
172 END
#define my_real
Definition cppsort.cpp:32
subroutine lecfun(npc, pld, nfct, nptst, table)
Definition lecfun.F:35