OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
stock_msg.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!|| stock_msg ../starter/source/output/message/stock_msg.F
25!||--- called by ------------------------------------------------------
26!|| build_msg ../starter/source/output/message/build_msg.F
27!||--- uses -----------------------------------------------------
28!|| message_mod ../starter/share/message_module/message_mod.F
29!||====================================================================
30 SUBROUTINE stock_msg(ID,ITYPE,SBUFMSG,BUFMSG)
31C-----------------------------------------------
32C M o d u l e s
33C-----------------------------------------------
34 USE message_mod
36C-----------------------------------------------
37C I m p l i c i t T y p e s
38C-----------------------------------------------
39#include "implicit_f.inc"
40C-----------------------------------------------
41C C o m m o n B l o c k s
42C-----------------------------------------------
43C-----------------------------------------------
44C D u m m y A r g u m e n t s
45C-----------------------------------------------
46 INTEGER,INTENT(IN) :: ID,ITYPE,SBUFMSG
47 CHARACTER(LEN=NCHARLINE), INTENT(IN) :: BUFMSG(SBUFMSG)
48C-----------------------------------------------
49C L o c a l V a r i a b l e s
50C-----------------------------------------------
51 INTEGER I,J,JDX,IBACKSLASH
52 CHARACTER*1, PARAMETER :: BACKSLASH = char(92)
53C-----------------------------------------------
54C S o u r c e L i n e s
55C-----------------------------------------------
56 IF (ALLOCATED(messages(itype,id)%MESSAGE)) THEN
57 DEALLOCATE(messages(itype,id)%MESSAGE)
58 END IF
59 IF (sbufmsg==0) THEN
60 messages(itype,id)%SMESSAGE=1
61 ALLOCATE(messages(itype,id)%MESSAGE(1))
62 messages(itype,id)%MESSAGE(1)=' '
63 ELSE
64 ALLOCATE(messages(itype,id)%MESSAGE(sbufmsg))
65 messages(itype,id)%SMESSAGE=sbufmsg
66 DO i=1,sbufmsg
67 jdx=1
68 messages(itype,id)%MESSAGE(i)=' '
69 j=1
70 DO WHILE(j<=ncharline)
71 IF (bufmsg(i)(j:j)==backslash) THEN
72C => skip \ print next
73 IF (j<ncharline) THEN
74 j=j+1
75 IF (bufmsg(i)(j:j)=='n') THEN
76 messages(itype,id)%MESSAGE(i)(jdx:jdx)=char(10)
77 jdx=jdx+1
78C add here other special cases
79 ELSE
80C keep back slash for further use
81 messages(itype,id)%MESSAGE(i)(jdx:jdx)=bufmsg(i)(j-1:j-1)
82 jdx=jdx+1
83 messages(itype,id)%MESSAGE(i)(jdx:jdx)=bufmsg(i)(j:j)
84 jdx=jdx+1
85 END IF
86 ELSE
87C => end of loop
88 j=j+1
89 END IF
90 ELSE
91 messages(itype,id)%MESSAGE(i)(jdx:jdx)=bufmsg(i)(j:j)
92 jdx=jdx+1
93 END IF
94 j=j+1
95 END DO
96 END DO
97 END IF
98 RETURN
99 END SUBROUTINE
100C-----------------------------------------------
integer, parameter ncharline
subroutine stock_msg(id, itype, sbufmsg, bufmsg)
Definition stock_msg.F:31