OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
hm_get_current_option.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_get_current_option ../starter/source/devtools/hm_reader/hm_get_current_option.F
25!||--- called by ------------------------------------------------------
26!|| ngr2usr ../starter/source/system/nintrr.F
27!||--- calls -----------------------------------------------------
28!||--- uses -----------------------------------------------------
29!|| message_mod ../starter/share/message_module/message_mod.F
30!||====================================================================
31 SUBROUTINE hm_get_current_option(OPTION_ID,UNIT_ID,OPTION_TITR,
32 . KEYWORD1,KEYWORD2,KEYWORD3,KEYWORD4)
33C-----------------------------------------------
34C ROUTINE DESCRIPTION :
35C ===================
36C GENERIC ROUTINE USING OPTIONAL FIELDS
37C REQUEST DATA INTO MODEL NEUTRAL OBJECT DATABASE USING HM_READER
38C IN CARD :
39C /KEYWORD1/KEYWORD2/KEYWORD3/KEYWORD4/OPTION_ID/UNIT_ID
40C OPTION_TITR
41C-----------------------------------------------
42C DUMMY ARGUMENTS DESCRIPTION:
43C ===================
44C
45C NAME DESCRIPTION
46C
47C OPTION_ID OPTIONAL : ID OF THE OPTION
48C UNIT_ID OPTIONAL : UNIT ID OF THE OPTION
49C OPTION_TITR OPTIONAL : TITLE OF THE OPTION
50C KEYWORD1 OPTIONAL : KEYWORD1 OF THE OPTION
51C KEYWORD2 OPTIONAL : KEYWORD2 OF THE OPTION
52C KEYWORD3 OPTIONAL : KEYWORD3 OF THE OPTION
53C KEYWORD4 OPTIONAL : KEYWORD4 OF THE OPTION
54C============================================================================
55C M o d u l e s
56C-----------------------------------------------
57 USE message_mod
59C-----------------------------------------------
60C I m p l i c i t T y p e s
61C-----------------------------------------------
62#include "implicit_f.inc"
63C-----------------------------------------------
64C D u m m y A r g u m e n t s
65C-----------------------------------------------
66 INTEGER ,INTENT(OUT) :: OPTION_ID,UNIT_ID
67 CHARACTER(len=ncharkey),INTENT(OUT) :: KEYWORD1,KEYWORD2,KEYWORD3,KEYWORD4
68 CHARACTER(len=nchartitle),INTENT(OUT) :: OPTION_TITR
69 OPTIONAL :: option_id,unit_id,keyword1,keyword2,keyword3,keyword4,option_titr
70C-----------------------------------------------
71C L o c a l V a r i a b l e s
72C-----------------------------------------------
73 INTEGER :: CPT, CPT1,CPT2,IOK,S_KEYWORD,S_TITR_TMP,TMP_OPTION_ID,TMP_UNIT_ID,TMP_SUBMODEL_INDEX,MY_POSITION
74 CHARACTER(LEN=NCHARLINE) :: KEYWORD,TITR_TMP
75C-----------------------------------------------
76 keyword=''
77 tmp_option_id = 0
78 tmp_unit_id = 0
79 tmp_submodel_index = 0
80 IF(PRESENT(option_titr)) option_titr=''
81 IF(PRESENT(keyword1)) keyword1=''
82 IF(PRESENT(keyword2)) keyword2=''
83 IF(PRESENT(keyword3)) keyword3=''
84 IF(PRESENT(keyword4)) keyword4=''
85 my_position = 0
86C--------------------------------------------------
87 CALL cpp_current_option(tmp_option_id,tmp_unit_id,tmp_submodel_index,keyword,s_keyword,
88 . titr_tmp,s_titr_tmp)
89C--------------------------------------------------
90 IF(PRESENT(option_id)) option_id = tmp_option_id
91 IF(PRESENT(unit_id)) unit_id = tmp_unit_id
92 IF(PRESENT(option_titr)) option_titr(1:s_titr_tmp) = titr_tmp(1:s_titr_tmp)
93C--------------------------------------------------
94 cpt = 2
95 cpt1 = 2
96 cpt2 = 2
97 iok = 0
98
99 DO WHILE (cpt < ncharline .AND. iok == 0)
100 IF(keyword(cpt:cpt) == '/' .OR. keyword(cpt:cpt) == ' ') THEN
101 cpt2 = cpt
102 iok = 1
103 ENDIF
104 cpt = cpt + 1
105 ENDDO
106 IF(PRESENT(keyword1)) keyword1(1:cpt2-cpt1) = keyword(cpt1:min((cpt2-1),s_keyword))
107 cpt1 = cpt2+1
108 iok = 0
109 DO WHILE (cpt < ncharline .AND. iok == 0)
110 IF(keyword(cpt:cpt) == '/' .OR. keyword(cpt:cpt) == ' ') THEN
111 CPT2 = CPT
112 IOK = 1
113 ENDIF
114 CPT = CPT + 1
115 ENDDO
116 IF(PRESENT(KEYWORD2)) KEYWORD2(1:CPT2-CPT1) = KEYWORD(CPT1:MIN((CPT2-1),S_KEYWORD))
117 CPT1 = CPT2+1
118 IOK = 0
119.AND. DO WHILE (CPT < ncharline IOK == 0)
120 IF(KEYWORD(CPT:CPT) == '/.OR.' KEYWORD(CPT:CPT) == ' ') THEN
121 CPT2 = CPT
122 IOK = 1
123 ENDIF
124 CPT = CPT + 1
125 ENDDO
126 IF(PRESENT(KEYWORD3)) KEYWORD3(1:CPT2-CPT1) = KEYWORD(CPT1:MIN((CPT2-1),S_KEYWORD))
127 CPT1 = CPT2+1
128 IOK = 0
129.AND. DO WHILE (CPT < ncharline IOK == 0)
130 IF(KEYWORD(CPT:CPT) == '/.OR.' KEYWORD(CPT:CPT) == ' ') THEN
131 CPT2 = CPT
132 IOK = 1
133 ENDIF
134 CPT = CPT + 1
135 ENDDO
136 IF(PRESENT(KEYWORD4)) KEYWORD4(1:CPT2-CPT1) = KEYWORD(CPT1:MIN((CPT2-1),S_KEYWORD))
137C--------------------------------------------------
138 RETURN
139C
140 END
141
subroutine hm_get_current_option(option_id, unit_id, option_titr, keyword1, keyword2, keyword3, keyword4)
#define min(a, b)
Definition macros.h:20
integer, parameter nchartitle
integer, parameter ncharkey
integer, parameter ncharline