OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
execargcheck.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!|| execargcheck ../engine/source/engine/execargcheck.F
25!||--- called by ------------------------------------------------------
26!|| radioss0 ../engine/source/engine/radioss0.F
27!||--- calls -----------------------------------------------------
28!|| arret ../engine/source/system/arret.F
29!|| build_msg ../common_source/tools/memory/my_alloc.F90
30!|| isanargument ../engine/source/engine/execargcheck.F
31!|| pexecinfo ../engine/source/engine/execargcheck.F
32!|| phelpinfo ../engine/source/engine/execargcheck.F
33!|| read_msgfile ../engine/source/output/message/read_msgfile.F
34!|| upcase ../engine/source/engine/execargcheck.F
35!||--- uses -----------------------------------------------------
36!|| check_mod ../common_source/modules/check_mod.F
37!|| command_line_args_mod ../engine/share/modules/command_line_args.F
38!|| inoutfile_mod ../common_source/modules/inoutfile_mod.f
39!|| message_mod ../engine/share/message_module/message_mod.F
40!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
41!||====================================================================
42 SUBROUTINE execargcheck(GOT_INPUT,INPUT,LENI,
43 * GOT_PATH, PATH, LENP)
44 USE message_mod
45 USE check_mod
48C-----------------------------------------------
49C I m p l i c i t T y p e s
50C-----------------------------------------------
51 USE spmd_comm_world_mod, ONLY : spmd_comm_world
52#include "implicit_f.inc"
53C-----------------------------------------------
54C C o m m o n B l o c k s
55C-----------------------------------------------
56#include "warn_c.inc"
57#include "commandline.inc"
58#include "userlib.inc"
59C-----------------------------------------------
60C D u m m y A r g u m e n t s
61C-----------------------------------------------
62 INTEGER GOT_INPUT,LENI,GOT_PATH,LENP
63 CHARACTER*256 INPUT
64 CHARACTER*2048 PATH
65C-----------------------------------------------
66C L o c a l V a r i a b l e s
67C-----------------------------------------------
68 INTEGER ARGN
69 INTEGER PHELPI,PEXECI,PINPUTI, PNTHI,PUSERLNAMI,MDS_PATHI
70 INTEGER :: MDS_DIRI !< Flag for -mdsdir - stores Iteration in command line
71 INTEGER I,STRL,STRLN,ERR,LENLIST,ISIN,BEGIN,IERRMSG
72 INTEGER IDUM
73 CHARACTER*2096 ARGS,INPUTC,INPUTR,MSG,STRING
74 LOGICAL :: CONDITION
75 CHARACTER C
76 INTEGER IARGC,CDL_CASE,IJK
77 CHARACTER :: LAST_LETTER,SEPARATOR
78 CHARACTER(LEN=2096) ARGS2,ARGS_REDUCE,ARGP
79 CHARACTER(LEN=4096) ULIBC
80 parameter(lenlist=20)
81 CHARACTER(LEN=12):: ARGLIST(LENLIST)
82 EXTERNAL iargc
83 DATA arglist/
84 . '-VERSION', '-V',
85 . '-HELP' , '-H',
86 . '-INPUT' , '-I',
87 . '-NTHREAD' , '-NT',
88 . '-ERROR_MSG','-EM',
89 . '-NOTRAP',
90 . '-DYNAMIC_LIB',
91 . '-DYLIB',
92 . '-MEM-MAP' ,
93 . '-INSPIRE',
94 . '-PREVIEW',
95 . '-INSPIRE_ALM','-NORST',
96 . '-MDS_LIBPATH','-MDSDIR'/
97C-----------------------------------------------
98 idum=-1
99 got_input = 0
100 got_nth = 0
101 input=' '
102 leni=0
103 phelpi = 0
104 pexeci = 0
105 pinputi = 0
106 pnthi= 0
107 ierrmsg=0
108 puserlnami = 0
109 got_userl_altname=0
110 got_mem_map=0
111 got_inspire=0
112 got_inspire_alm=0
113 mds_path_len = 0
114 mds_pathi = 0
115 mds_diri = 0
116 got_preview= 0
117
118 ! Initialize MDS_PATH Array
119 mds_path=''
120
121 ! /RFILE/OFF or -norst command line --> avoid to write restart files during a run
122 ! default = write restart files
123 restart_file = 1
124 ! ---------------------
125 ! Infile / Outfile CDL Line
128 infile_bool=.false.
131 outfile_bool=.false.
132 inout_bool=.false.
133
134#if CPP_mach == CPP_w95 || CPP_mach == CPP_win64_spmd || CPP_mach == CPP_p4win64_spmd || CPP_mach == CPP_wnt || CPP_mach == CPP_wmr || CPP_mach == CPP_p4win64 || CPP_mach == CPP_p4win32
135 separator='\'
136#elif 1
137 separator='/'
138#endif
139
140 argn = command_argument_count()!IARGC()
141
142 DO i=1,argn
143 CALL getarg(i,args)
144 strl=len_trim(args)
145
146 args2(1:2096) = ''
147 args2(1:strl) = args(1:strl)
148 CALL upcase(args)
149
150 args_reduce(1:9) = args(1:9)
151 cdl_case = 0
152 IF(args_reduce(1:9)=='-OUTFILE=') cdl_case = 1
153 IF(args_reduce(1:8)=='-INFILE=') cdl_case = 2
154 IF(cdl_case==0) THEN
155 SELECT CASE (args)
156C------------------------------------------------
157C -NOTRAP
158 CASE ( '-NOTRAP')
159 itrace = -1
160C------------------------------------------------
161C -VERSION, -V
162 CASE ( '-VERSION')
163 pexeci = 1
164 CASE ( '-V')
165 pexeci = 1
166C------------------------------------------------
167C -HELP, -H
168 CASE ( '-HELP')
169 phelpi = 1
170 CASE ( '-H')
171 phelpi = 1
172C------------------------------------------------
173C -ERROR_MSG, -EM
174 CASE ( '-ERROR_MSG')
175 ierrmsg = i
176 CASE ( '-EM')
177 ierrmsg = i
178C------------------------------------------------
179C -INPUT, -I
180 CASE ( '-INPUT')
181 IF (pinputi==0) pinputi = i
182 CASE ( '-I')
183 IF (pinputi==0) pinputi = i
184C------------------------------------------------
185C -RST / MADYMO RESTART
186 CASE ( '-RST')
187 err = 0
188C------------------------------------------------
189C Madymo Option
190 CASE ( '--')
191 err = 0
192C------------------------------------------------
193C -NTHREAD, -NT
194 CASE ( '-NTHREAD')
195 IF (pnthi==0) pnthi = i
196 CASE ( '-NT')
197 IF (pnthi==0) pnthi = i
198C------------------------------------------------
199C -DYNAMIC_LIB, -DYLIB
200 CASE ( '-DYNAMIC_LIB')
201 IF (puserlnami==0) puserlnami=i
202 CASE ( '-DYLIB')
203 IF (puserlnami==0) puserlnami=i
204C------------------------------------------------
205C -MDS_LIBPATH
206 CASE ( '-MDS_LIBPATH')
207 IF (mds_pathi==0) mds_pathi=i
208C------------------------------------------------
209C -MDSDIR
210 CASE ( '-MDSDIR')
211 IF (mds_diri==0) mds_diri=i
212C------------------------------------------------
213C -MEM-MAP
214 CASE ( '-MEM-MAP')
215 got_mem_map=1
216 CASE ( '-PREVIEW')
218 CASE ( '-INSPIRE_ALM')
219 got_inspire_alm=1
220 CASE ( '-INSPIRE')
221 got_inspire=1
222C------------------------------------------------
223C -NORST : no restart file command
224 CASE ( '-NORST')
225 restart_file = 0
226C------------------------------------------------
227C Command lines that are not defined
228 CASE DEFAULT
229 err = 0
230 IF (i == 1)THEN
231 err = 1
232 ELSE
233 CALL getarg(i-1,argp)
234 CALL upcase(argp)
235 strln=len_trim(argp)
236C Check if argument string is a variable to an argument
237 IF (argp == '-I' .OR. argp =='-INPUT' .OR.
238 * argp == '-RST' .OR. argp =='-NT' .OR.
239 * argp == '-NTHREAD' .OR.
240 * argp == '-DYLIB' .OR. argp =='-DYNAMIC_LIB'.OR.
241 * argp == '-MDS_LIBPATH' .OR. argp == '-MDSDIR' )THEN
242 err = 0
243 ELSE
244 err = 1
245 ENDIF
246 ENDIF
247C
248C Specificife Radioss Madymo
249 IF (err == 1.AND.strl>4)THEN
250 IF (args(strl-3:strl)=='.XML')THEN
251 err = 0
252 ENDIF
253 ENDIF
254 IF (err == 1)THEN
255 CALL getarg(i,argp)
256 strln=len_trim(argp)
257 CALL phelpinfo(2,argp,strln)
258 CALL arret(7)
259 ENDIF
260C------------------------------------------------
261 END SELECT
262 ELSE
263! ------------------------------------------------
264 SELECT CASE(cdl_case)
265 ! -----------------------------
266 ! -OUTFILE=... option
267 ! -----------------------------
268 CASE(1)
269
270 outfile_name_len = len_trim(args2) - 9
271 outfile_name(1:outfile_name_len) = args2(10:len_trim(args2))
272 outfile_bool=.true.
273 DO ijk=1,outfile_name_len
274 last_letter = outfile_name(ijk:ijk)
275 ENDDO
276 IF(last_letter/=separator) THEN
278 . outfile_name(1:outfile_name_len)//separator
280 ENDIF
281 ! -----------------------------
282 ! -INFILE=... option
283 ! -----------------------------
284 CASE(2)
285 infile_name_len = len_trim(args2) - 8
286 infile_name(1:infile_name_len) = args2(9:len_trim(args2))
287 infile_bool=.true.
288 DO ijk=1,infile_name_len
289 last_letter = infile_name(ijk:ijk)
290 ENDDO
291 IF(last_letter/=separator) THEN
293 . infile_name(1:infile_name_len)//separator
295 ENDIF
296 END SELECT
297! ------------------------------------------------
298 ENDIF
299 ENDDO
300C------------------------------------------------
301C -VERSION SET
302C------------------------------------------------
303 IF (pexeci==1) THEN
304 CALL pexecinfo(idum)
305 ENDIF
306
307C------------------------------------------------
308C -HELP SET
309C------------------------------------------------
310 IF (phelpi==1) THEN
311 msg= ' '
312 CALL phelpinfo(0,msg,0)
313 ENDIF
314
315C------------------------------------------------
316C -ERROR_MSG SET
317C------------------------------------------------
318 IF (ierrmsg /= 0)THEN
319 IF (ierrmsg+1 > argn) THEN
320
321C Case -I is last argument in the list.
322
323 CALL getarg(ierrmsg,argp)
324 strln=len_trim(argp)
325 msg = argp
326 CALL phelpinfo(1,msg,strln)
327 CALL arret(7)
328 ELSE
329 CALL getarg(ierrmsg+1,inputr)
330 leni=len_trim(inputr)
331
332C check if -i has got an argument or if the next string is an input command
333
334 inputc = inputr
335 CALL upcase(inputc)
336 isin = 0
337 CALL isanargument(arglist,lenlist,inputc,isin)
338 IF ( isin==1 )THEN
339 CALL getarg(pinputi,argp)
340 strln=len_trim(argp)
341 msg=argp
342 CALL phelpinfo(1,msg,strln)
343 CALL arret(7)
344 ENDIF
345 CALL read_msgfile(leni,inputr)
346 CALL build_msg()
347 ENDIF
348 ENDIF
349
350C------------------------------------------------
351C -INPUT SET
352C------------------------------------------------
353 IF (pinputi /= 0)THEN
354 IF (pinputi+1 > argn) THEN
355
356C Case -I is last argument in the list.
357
358 CALL getarg(pinputi,argp)
359 strln=len_trim(argp)
360 msg = argp
361 CALL phelpinfo(1,msg,strln)
362 CALL arret(7)
363 ELSE
364 CALL getarg(pinputi+1,inputr)
365 leni=len_trim(inputr)
366 got_input = 1
367
368C check if -i has got an argument or if the next string is an input command
369
370 inputc = inputr
371 CALL upcase(inputc)
372 isin = 0
373 CALL isanargument(arglist,lenlist,inputc,isin)
374 IF ( isin==1 )THEN
375 CALL getarg(pinputi,argp)
376 strln=len_trim(argp)
377 msg=argp
378 CALL phelpinfo(1,msg,strln)
379 CALL arret(7)
380 ENDIF
381
382 begin=len_trim(inputr)
383 condition = .false.
384 DO WHILE (begin > 0 .AND. .NOT.condition)
385 c = inputr(begin:begin)
386 IF (ichar(c)==47 .OR. ichar(c)==92) THEN
387 condition=.true.
388 GOTO 150
389 ENDIF
390 begin=begin-1
391 ENDDO
392 150 CONTINUE
393 leni = len_trim(inputr) - begin
394 begin=begin+1
395 input(1:leni) = inputr(begin:len_trim(inputr))
396
397 IF (begin > 1)THEN
398 got_path=1
399 lenp=begin-1
400 path(1:lenp)=inputr(1:lenp)
401 ENDIF
402 ENDIF
403 ELSE
404 ! -input/-i was not set. Exiting with error message.
405 msg= ' '
406 CALL phelpinfo(6,msg,0)
407 CALL arret(7)
408 ENDIF
409
410C------------------------------------------------
411C -NTHREAD SET
412C------------------------------------------------
413 IF (pnthi /= 0)THEN
414 IF (pnthi+1 > argn) THEN
415C case -nt is last argument in the list.
416 CALL getarg(pnthi,argp)
417 strln=len_trim(argp)
418 msg = argp
419 CALL phelpinfo(1,msg,strln)
420 CALL arret(7)
421 ELSE
422 CALL getarg(pnthi+1,string)
423C check if -nt has got an argument or if the next string is an input command
424 CALL upcase(string)
425 isin = 0
426 CALL isanargument(arglist,lenlist,string,isin)
427 IF ( isin==1 )THEN
428 CALL getarg(pnthi,argp)
429 strln=len_trim(argp)
430 msg=argp
431 CALL phelpinfo(1,msg,strln)
432 CALL arret(7)
433 END IF
434 got_nth = 1
435C convert the argument to an Integer
436 CALL getarg(pnthi+1,string)
437 READ(string,'(I10)',err=1999) nth
438C Read converting was OK goto 2000
439 GOTO 2000
440 1999 CONTINUE
441C Error was found during Character to Integer translation
442 strln=len_trim(string)
443c CALL GETARG(PNTHI,ARGP)
444 msg=string
445 CALL phelpinfo(4,msg,strln)
446 CALL arret(7)
447 2000 CONTINUE
448 ENDIF
449 ENDIF
450C------------------------------------------------
451C -DYLIB SET
452C------------------------------------------------
453 IF (puserlnami /= 0)THEN
454 IF (puserlnami+1 > argn) THEN
455
456C Case -DYLIB is last argument in the list.
457
458 CALL getarg(puserlnami,argp)
459 strln=len_trim(argp)
460 CALL phelpinfo(1,argp,strln)
461
462 ELSE
463 CALL getarg(puserlnami+1,userl_altname)
464 len_userl_altname=len_trim(userl_altname)
465 got_userl_altname = 1
466C check if -dylib has got an argument or if the next string is an input command
467 ulibc=''
468 ulibc(1:len_userl_altname) = userl_altname(1:len_userl_altname)
469 CALL upcase(ulibc)
470 isin = 0
471 CALL isanargument(arglist,lenlist,ulibc,isin)
472 IF ( isin==1 )THEN
473 CALL getarg(puserlnami,argp)
474 strln=len_trim(argp)
475 CALL phelpinfo(1,argp,strln)
476 CALL arret(7)
477 ENDIF
478
479 ENDIF ! IF (PUSERLNAMI+1 > ARGN) THEN
480 ENDIF
481C------------------------------------------------
482C -MDS_LIBPATH
483C------------------------------------------------
484 IF (mds_pathi /= 0)THEN
485
486 IF (mds_pathi+1 > argn) THEN
487
488C Case -DYLIB is last argument in the list.
489
490 CALL get_command_argument(mds_pathi,argp)
491 strln=len_trim(argp)
492 CALL phelpinfo(1,argp,strln)
493
494 ELSE
495 CALL get_command_argument(mds_pathi+1,mds_path)
496 mds_path_len=len_trim(mds_path)
497C check if -mds has got an argument or if the next string is an input command
498
499 ulibc=''
500 ulibc(1:mds_path_len) = mds_path(1:mds_path_len)
501 CALL upcase(ulibc)
502 isin = 0
503 CALL isanargument(arglist,lenlist,ulibc,isin)
504
505 IF ( isin==1 )THEN
506 CALL getarg(mds_pathi,argp)
507 strln=len_trim(argp)
508 CALL phelpinfo(1,argp,strln)
509 CALL arret(7)
510 ENDIF
511
512 ENDIF ! IF (MDS_PATHI+1 > ARGN) THEN
513 ENDIF
514C------------------------------------------------
515C -MDSDIR
516C------------------------------------------------
517 IF (mds_diri /= 0)THEN
518
519 IF (mds_diri+1 > argn) THEN
520
521C Case -DYLIB is last argument in the list.
522 CALL get_command_argument(mds_diri,argp)
523 strln=len_trim(argp)
524 CALL phelpinfo(1,argp,strln)
525
526 ELSE
527
528 CALL get_command_argument(mds_diri+1,mds_path)
529 mds_path_len=len_trim(mds_path)
530
531 ! check if -mdsdir has got an argument or if the next string is an input command
532 ulibc=''
533 ulibc(1:mds_path_len) = mds_path(1:mds_path_len)
534 CALL upcase(ulibc)
535 isin = 0
536 CALL isanargument(arglist,lenlist,ulibc,isin)
537
538 IF ( isin==1 )THEN
539 CALL getarg(mds_diri,argp)
540 strln=len_trim(argp)
541 CALL phelpinfo(1,argp,strln)
542 CALL arret(7)
543 ENDIF
544
545 ENDIF ! IF (MDS_DIRI+1 > ARGN) THEN
546 ENDIF
547C------------------------------------------------
548
549 END
550
551
552
553!||====================================================================
554!|| upcase ../engine/source/engine/execargcheck.F
555!||--- called by ------------------------------------------------------
556!|| execargcheck ../engine/source/engine/execargcheck.F
557!||--- uses -----------------------------------------------------
558!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
559!||====================================================================
560 SUBROUTINE upcase (STRING)
561C-----------------------------------------------
562C I m p l i c i t T y p e s
563C-----------------------------------------------
564 USE spmd_comm_world_mod, ONLY : spmd_comm_world
565#include "implicit_f.inc"
566C-----------------------------------------------
567C D u m m y A r g u m e n t s
568C-----------------------------------------------
569 CHARACTER*(*) STRING
570C-----------------------------------------------
571C L o c a l V a r i a b l e s
572C-----------------------------------------------
573 INTEGER LS,LC
574C
575 LS = LEN (STRING)
576C
577 DO LC = 1,LS
578.AND. IF (LGE(STRING(LC:LC),'a')
579 1 LLE(STRING(LC:LC),'z')) THEN
580C
581 STRING (LC:LC) = CHAR (ICHAR (STRING(LC:LC)) - 32)
582 ELSE
583 ENDIF
584 END DO
585 RETURN
586 END
587!||====================================================================
588!|| isanargument ../engine/source/engine/execargcheck.F
589!||--- called by ------------------------------------------------------
590!|| execargcheck ../engine/source/engine/execargcheck.F
591!||--- uses -----------------------------------------------------
592!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
593!||====================================================================
594 SUBROUTINE ISANARGUMENT(ARGLIST,LENLIST,ARG,ISIN)
595C-----------------------------------------------
596C I m p l i c i t T y p e s
597C-----------------------------------------------
598 USE SPMD_COMM_WORLD_MOD, ONLY : SPMD_COMM_WORLD
599#include "implicit_f.inc"
600C-----------------------------------------------
601C D u m m y A r g u m e n t s
602C-----------------------------------------------
603 CHARACTER (LEN=12),INTENT(IN) :: ARGLIST(LENLIST)
604 CHARACTER ARG*2096
605 INTEGER LENLIST,ISIN
606C-----------------------------------------------
607C L o c a l V a r i a b l e s
608C-----------------------------------------------
609 INTEGER I,STRLEN
610 CHARACTER ARGC*2096
611C-----------------------------------------------
612 STRLEN=LEN_TRIM(ARG)
613 ARGC(1:2096)=''
614 I=1
615.AND. DO WHILE (I<=STRLEN ARG(I:I)/='=')
616 ARGC(I:I)=ARG(I:I)
617 I=I+1
618 IF(I>STRLEN)EXIT ! check bounds issue for ARG (I:I) if I=STRLEN+1
619 ENDDO
620
621 ISIN = 0
622 DO I=1,LENLIST
623 IF (TRIM(ARGLIST(I))==TRIM(ARGC)) ISIN=1
624 ENDDO
625 END
626
627
628
629!||====================================================================
630!|| pexecinfo ../engine/source/engine/execargcheck.F
631!||--- called by ------------------------------------------------------
632!|| execargcheck ../engine/source/engine/execargcheck.F
633!||--- calls -----------------------------------------------------
634!|| my_exit ../engine/source/system/my_exit.c
635!|| prexecinfo ../engine/source/engine/execargcheck.F
636!||--- uses -----------------------------------------------------
637!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
638!||====================================================================
639 SUBROUTINE PEXECINFO(IDUM)
640C-----------------------------------------------
641C I m p l i c i t T y p e s
642C-----------------------------------------------
643 USE SPMD_COMM_WORLD_MOD, ONLY : SPMD_COMM_WORLD
644#include "implicit_f.inc"
645C-----------------------------------------------
646C C o m m o n B l o c k s
647C-----------------------------------------------
648#include "spmd.inc"
649C-----------------------------------------------
650C L o c a l V a r i a b l e s
651C-----------------------------------------------
652#ifdef MPI
653 INTEGER IERROR
654 INTEGER MYRANK, NNODES
655 INTEGER KEY, IERR
656#endif
657 INTEGER IDUM
658 INTEGER :: COLOUR
659 LOGICAL :: VALID
660C-----------------------------------------------
661#ifdef MPI
662 KEY = 0
663 call MPI_INITIALIZED(KEY, IERR)
664 CALL MPI_INIT(IERROR)
665
666 CALL MPI_COMM_GET_ATTR(MPI_COMM_WORLD, MPI_APPNUM,
667 * COLOUR, VALID, IERROR)
668 CALL MPI_COMM_SPLIT(MPI_COMM_WORLD,COLOUR,KEY,
669 * SPMD_COMM_WORLD,IERROR)
670
671 CALL MPI_COMM_SIZE(SPMD_COMM_WORLD, NNODES, IERROR)
672 CALL MPI_COMM_RANK(SPMD_COMM_WORLD, MYRANK, IERROR)
673
674 if (MYRANK==0) CALL PREXECINFO(IDUM)
675
676 CALL MPI_BARRIER(SPMD_COMM_WORLD,IERROR)
677
678 CALL MPI_FINALIZE(IERROR)
679
680#elif 1
681 CALL PREXECINFO(IDUM)
682#endif
683 CALL MY_EXIT(0)
684 END
685
686!||====================================================================
687!|| prexecinfo ../engine/source/engine/execargcheck.F
688!||--- called by ------------------------------------------------------
689!|| pexecinfo ../engine/source/engine/execargcheck.F
690!||--- uses -----------------------------------------------------
691!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
692!||====================================================================
693 SUBROUTINE PREXECINFO(IDUM)
694C-----------------------------------------------
695C I m p l i c i t T y p e s
696C-----------------------------------------------
697 USE SPMD_COMM_WORLD_MOD, ONLY : SPMD_COMM_WORLD
698#include "implicit_f.inc"
699#include "r4r8_p.inc"
700C-----------------------------------------------
701C C o m m o n B l o c k s
702C-----------------------------------------------
703#include "build_info.inc"
704#include "titr_c.inc"
705C-----------------------------------------------
706C L o c a l V a r i a b l e s
707C-----------------------------------------------
708 CHARACTER*256 RFLEXNAM,GPUTITLE,ARCHTIT*66
709 INTEGER LEN,LBT
710 INTEGER RDFLEXCOMP
711 INTEGER IDUM
712C-----------------------------------------------
713#include "machine.inc"
714C-----------------------------------------------
715
716 LBT = LEN_TRIM(BTAG)
717 WRITE(6,'(A,A)') ' '
718 WRITE(6,'(A,A)') 'OpenRadios Engine '
719 WRITE(6,'(A,A)') ' '
720 WRITE(6,'(A,A)') 'Platform release : ',BNAME(1:LENBNAM)
721 WRITE(6,'(A,A)') 'Platform info : ',ARCHTITLE
722
723 IF (IR4R8==1)THEN
724 WRITE(6,'(A,A)')
725 * ' Extended Single Precision Version'
726 ENDIF
727 WRITE(6,'(A,A)') ' '
728 WRITE(6,'(A,A)') 'Time of build : ',BTIME
729 WRITE(6,'(A,A)') 'Date of build : ',BDATE
730 WRITE(6,'(A,A)') ' '
731
732
733 END
734
735!||====================================================================
736!|| phelpinfo ../engine/source/engine/execargcheck.F
737!||--- called by ------------------------------------------------------
738!|| execargcheck ../engine/source/engine/execargcheck.F
739!|| get_file_name_info ../engine/source/system/get_file_name_info.F
740!||--- calls -----------------------------------------------------
741!|| arret ../engine/source/system/arret.F
742!|| prhelpinfo ../engine/source/engine/execargcheck.F
743!||--- uses -----------------------------------------------------
744!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
745!||====================================================================
746 SUBROUTINE PHELPINFO(ERRN,EMSG,SMSG)
747C-----------------------------------------------
748C I m p l i c i t T y p e s
749C-----------------------------------------------
750 USE SPMD_COMM_WORLD_MOD, ONLY : SPMD_COMM_WORLD
751#include "implicit_f.inc"
752C-----------------------------------------------
753C C o m m o n B l o c k s
754C-----------------------------------------------
755#include "spmd.inc"
756C-----------------------------------------------
757C D u m m y A r g u m e n t s
758C-----------------------------------------------
759 INTEGER ERRN,SMSG
760 CHARACTER*256 ARGP,EMSG*256
761C-----------------------------------------------
762C L o c a l V a r i a b l e s
763C-----------------------------------------------
764#ifdef MPI
765 INTEGER STATUS(MPI_STATUS_SIZE),IERROR
766 INTEGER MYRANK, NNODES
767 INTEGER KEY, IERR
768#endif
769 INTEGER :: COLOUR
770 LOGICAL :: VALID
771C-----------------------------------------------
772#ifdef MPI
773 KEY = 0
774 CALL MPI_INITIALIZED(KEY, IERR)
775 CALL MPI_INIT(IERROR)
776
777 CALL MPI_COMM_GET_ATTR(MPI_COMM_WORLD, MPI_APPNUM,
778 * COLOUR, VALID, IERROR)
779 CALL MPI_COMM_SPLIT(MPI_COMM_WORLD,COLOUR,KEY,
780 * SPMD_COMM_WORLD,IERROR)
781 CALL MPI_COMM_SIZE(SPMD_COMM_WORLD, NNODES, IERROR)
782 CALL MPI_COMM_RANK(SPMD_COMM_WORLD, MYRANK, IERROR)
783
784 if (MYRANK==0) CALL PRHELPINFO(ERRN,EMSG,SMSG)
785
786 CALL MPI_BARRIER(SPMD_COMM_WORLD,IERROR)
787
788 CALL MPI_FINALIZE(IERROR)
789
790#elif 1
791 CALL PRHELPINFO(ERRN,EMSG,SMSG)
792#endif
793 CALL ARRET(7)
794 END
795
796!||====================================================================
797!|| prhelpinfo ../engine/source/engine/execargcheck.F
798!||--- called by ------------------------------------------------------
799!|| phelpinfo ../engine/source/engine/execargcheck.F
800!||--- uses -----------------------------------------------------
801!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
802!||====================================================================
803 SUBROUTINE PRHELPINFO(ERRN,EMSG,SMSG)
804C-----------------------------------------------
805C I m p l i c i t T y p e s
806C-----------------------------------------------
807 USE SPMD_COMM_WORLD_MOD, ONLY : SPMD_COMM_WORLD
808#include "implicit_f.inc"
809C-----------------------------------------------
810C C o m m o n B l o c k s
811C-----------------------------------------------
812#include "build_info.inc"
813C-----------------------------------------------
814C D u m m y A r g u m e n t s
815C-----------------------------------------------
816 INTEGER ERRN,SMSG
817 CHARACTER EMSG*256
818C-----------------------------------------------
819C L o c a l V a r i a b l e s
820C-----------------------------------------------
821 IF (ERRN == 1)THEN
822 WRITE(6,'(A)') ' '
823 WRITE(6,'(A,A)') '*** ERROR : Missing argument to ',
824 * EMSG(1:SMSG)
825 WRITE(6,'(A)') ' '
826 ENDIF
827
828 IF (ERRN == 2)THEN
829 WRITE(6,'(A)') ' '
830 WRITE(6,'(A,A)') '*** ERROR : Unknown command line argument:',
831 * EMSG(1:SMSG)
832 WRITE(6,'(A)') ' '
833 ENDIF
834
835 IF (ERRN == 3)THEN
836 WRITE(6,'(A)') ' '
837 WRITE(6,'(A,A)') 'WRONG RADIOSS INPUT FILE NAME: ',EMSG(1:SMSG)
838 WRITE(6,'(A)') ' '
839 ENDIF
840
841 IF (ERRN == 4)THEN
842 WRITE(6,'(A)') ' '
843 WRITE(6,'(A,A,A,A,A)')
844 * '*** ERROR : "',EMSG(1:SMSG),'" is not an integer value'
845 ENDIF
846
847 IF (ERRN == 5)THEN
848 WRITE(6,'(A)') ' '
849 WRITE(6,'(A,A,A,A,A)')
850 * '*** ERROR : Wrong "',EMSG(1:SMSG),'" option'
851 ENDIF
852
853 IF (ERRN == 6)THEN
854 WRITE(6,'(A)') ' '
855 WRITE(6,'(A)') '*** ERROR : No input deck set. Use -input [Engine input file] '
856 ENDIF
857
858 WRITE(6,'(A)') ' '
859 WRITE(6,'(A,A)') 'RADIOSS Engine version ',VERS(1:LEN_VERS)
860 WRITE(6,'(A)') ' '
861 WRITE(6,'(A)') 'Command line arguments help: '
862 WRITE(6,'(A,A)') ' -help / -h : ',
863 * 'Print this message'
864 WRITE(6,'(A,A)') ' -version / -v : ',
865 * 'Print RADIOSS release information'
866 WRITE(6,'(A,A)') ' -input [FILE] / -i [FILE] : ',
867 * 'Set RADIOSS Engine input file'
868 WRITE(6,'(A,A)') ' -nthread [INTEGER] / -nt [INTEGER] : ',
869 * 'Set Number of SMP threads per SPMD domain'
870 WRITE(6,'(A,A)') ' -notrap : ',
871 * 'Disable error trapping'
872 WRITE(6,'(A,A)') ' -norst : ',
873 * 'Do not write restart files'
874 WRITE(6,'(A,A)') ' -dynamic_lib [FILE] / -dylib [FILE] : ',
875 * 'Set name to the dynamic library for Radioss User Interface'
876 WRITE(6,'(A,A)') ' -mdsdir [PATH] / -mds_libpath [PATH] : ',
877#ifdef _WIN32
878 * 'Set directory to MDS Library (default is %ALTAIR_HOME%/hwsolver/MultiscaleDesigner/%arch%)'
879#else
880 * 'Set directory to MDS Library (default is $ALTAIR_HOME/hwsolver/MultiscaleDesigner/$arch)'
881#endif
882
883 WRITE(6,'(A,A)') ' -outfile=[PATH] : ',
884 * 'Set output file directory for all output and created files'
885 WRITE(6,'(A)') ' '
886
887
888 END
subroutine phelpinfo(errn, emsg, smsg)
subroutine execargcheck(got_input, input, leni, got_path, path, lenp)
subroutine isanargument(arglist, lenlist, arg, isin)
subroutine pexecinfo(idum)
subroutine upcase(string)
integer restart_file
Definition check_mod.F:52
integer infile_name_len
integer, parameter infile_char_len
character(len=outfile_char_len) outfile_name
logical infile_bool
character(len=infile_char_len) infile_name
logical outfile_bool
integer, parameter outfile_char_len
integer outfile_name_len
subroutine build_msg()
Definition build_msg.F:36
subroutine read_msgfile(leni, inputr)
subroutine arret(nn)
Definition arret.F:86