1
- C Copyright(C) 1999-2022 National Technology & Engineering Solutions
1
+ C Copyright(C) 1999-2022, 2025 National Technology & Engineering Solutions
2
2
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3
3
C NTESS, the U.S. Government retains certain rights in this software.
4
4
C
@@ -57,7 +57,7 @@ PROGRAM GREPOS
57
57
include ' gp_attrot.blk'
58
58
INCLUDE ' argparse.inc'
59
59
60
- CHARACTER * 2048 FILIN, FILOUT, SCRATCH, SYNTAX, HELP
60
+ CHARACTER * 2048 FILIN, FILOUT, SCRATCH, SYNTAX, HELP, VALUE
61
61
CHARACTER * 80 SCRSTR
62
62
63
63
C ... String containing name of common element topology in model
@@ -99,7 +99,8 @@ PROGRAM GREPOS
99
99
100
100
C .. Get filename from command line. If not specified, emit error message
101
101
SYNTAX =
102
- * ' Syntax is: "grepos [-name_length len] [-64] file_in file_out"'
102
+ * ' Syntax is: "grepos [-name_length len] [-64] ' //
103
+ $ ' [-change_set #] file_in file_out"'
103
104
HELP = ' Documentation: https://sandialabs.github.io' //
104
105
$ ' /seacas-docs/sphinx/html/index.html#grepos'
105
106
NARG = argument_count()
@@ -110,30 +111,6 @@ PROGRAM GREPOS
110
111
GOTO 60
111
112
end if
112
113
113
- C ... Parse options...
114
- name_len = 0
115
- l64bit = .false.
116
- if (narg .gt. 2 ) then
117
- iarg = 1
118
- do
119
- CALL get_argument(iarg,FILIN, LNAM)
120
- if (filin(:lnam) .eq. ' -name_length' ) then
121
- CALL get_argument(iarg+1 ,FILIN, LNAM)
122
- read (filin(:lnam), ' (i10)' ) name_len
123
- iarg = iarg + 2
124
- else if (filin(:lnam) .eq. ' -64' ) then
125
- l64bit = .true.
126
- iarg = iarg + 1
127
- else
128
- SCRATCH = ' Unrecognized command option "' // FILIN(:LNAM)// ' "'
129
- CALL PRTERR (' FATAL' , SCRATCH(:LENSTR(SCRATCH)))
130
- CALL PRTERR (' CMDSPEC' , SYNTAX(:LENSTR(SYNTAX)))
131
- CALL PRTERR (' CMDSPEC' , HELP(:LENSTR(HELP)))
132
- end if
133
- if (iarg .gt. narg-2 ) exit
134
- end do
135
- end if
136
-
137
114
C --Open the input database and read the initial variables
138
115
NDBIN = 9
139
116
NDBOUT = 10
@@ -160,6 +137,49 @@ PROGRAM GREPOS
160
137
GOTO 60
161
138
END IF
162
139
140
+ C ... Parse options...
141
+ name_len = 0
142
+ l64bit = .false.
143
+ if (narg .gt. 2 ) then
144
+ iarg = 1
145
+ do
146
+ CALL get_argument(iarg,FILIN, LNAM)
147
+ if (filin(:lnam) .eq. ' -name_length' ) then
148
+ CALL get_argument(iarg+1 ,FILIN, LNAM)
149
+ read (filin(:lnam), ' (i10)' ) name_len
150
+ iarg = iarg + 2
151
+ else if (filin(:lnam) .eq. ' -64' ) then
152
+ l64bit = .true.
153
+ iarg = iarg + 1
154
+ else if (filin(:lnam) .eq. ' -change_set' .or.
155
+ * filin(:lnam) .eq. ' --change_set' ) then
156
+ C ... Convert `value` to an integer.
157
+ CALL get_argument(iarg+1 ,value, lv)
158
+ iarg = iarg + 2
159
+ read (value(:lv), ' (i10)' ) nchange
160
+ write (* ,99 ) nchange
161
+ 99 format (1x ,' NOTE: Selecting change set ' , i3)
162
+ C ... Check that file contains at least that many change sets...
163
+ ndbr = iand (ndbin, EX_FILE_ID_MASK)
164
+ call exinq(ndbr, EX_INQ_NUM_CHILD_GROUPS,
165
+ $ idum, rdum, cdum, ierr)
166
+ if (nchange .gt. idum) then
167
+ write (* ,* ) ' ERROR: Selected change set' , nchange,
168
+ $ ' but there are only ' , idum, ' change sets in file.'
169
+ goto 60
170
+ else
171
+ ndbin = ndbr + nchange
172
+ end if
173
+ else
174
+ SCRATCH = ' Unrecognized command option "' // FILIN(:LNAM)// ' "'
175
+ CALL PRTERR (' FATAL' , SCRATCH(:LENSTR(SCRATCH)))
176
+ CALL PRTERR (' CMDSPEC' , SYNTAX(:LENSTR(SYNTAX)))
177
+ CALL PRTERR (' CMDSPEC' , HELP(:LENSTR(HELP)))
178
+ end if
179
+ if (iarg .gt. narg-2 ) exit
180
+ end do
181
+ end if
182
+
163
183
call exgini(ndbin, title, ndim, numnp, numel, nelblk,
164
184
* numnps, numess, ierr)
165
185
if (numnps .gt. 0 ) then
0 commit comments