Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill trailing whitespaces in source code files.
[simgrid.git] / teshsuite / smpi / fort_args / fort_args.f90
1 ! Copyright (c) 2018-2021. The SimGrid Team. All rights reserved.
2
3 ! This program is free software; you can redistribute it and/or modify it
4 ! under the terms of the license (GNU LGPL) which comes with this package.
5
6 ! Check that getarg does something sensible.
7 program getarg_1
8   use mpi
9   CHARACTER*10 ARGS, ARGS2
10   INTEGER*4 I
11   INTEGER*2 I2
12   INTEGER ierr
13   I = 0
14   call MPI_Init(ierr)
15   CALL GETARG(I,ARGS)
16   ! This should return the invoking command.  The actual value depends
17   ! on the OS, but a blank string is wrong no matter what.
18   ! ??? What about deep embedded systems?
19   if (args.eq.'') STOP 2
20   I = 1
21   CALL GETARG(I,ARGS)
22   if (args.ne.'a') STOP 3
23   I = -1
24   CALL GETARG(I,ARGS)
25   if (args.ne.'') STOP 4
26   ! Assume we won't have been called with more that 4 args.
27   I = 4
28   CALL GETARG(I,ARGS)
29   if (args.ne.'') STOP 5
30   I = 1000
31   CALL GETARG(I,ARGS)
32   if (args.ne.'') STOP 6
33   call MPI_Finalize(ierr)
34 end