fmetis icon indicating copy to clipboard operation
fmetis copied to clipboard

Boz constants not allowed in select case construct

Open ivan-pi opened this issue 6 years ago • 3 comments

The Intel Fortran compiler shows warning when compiling the read_graph and write_graph routines in metis_oo_interface.f90 due to the use of BOZ constants (e.g. b'001', b '101') in the select case construct used to discern different types of graphs.

One solution is to simply convert the Boz constant to integers with the int intrinsic, or simply code their integer values their directly (and put the binary pattern in a comment).

ivan-pi avatar Jun 16 '19 11:06 ivan-pi

Yes, running into this one...Could you elaborate more on this please?

One solution is to simply convert the Boz constant to integers with the int intrinsic

krober10nd avatar Aug 25 '21 14:08 krober10nd

This only matters if you are using the read_graph or write_graph routines which are not thoroughly tested yet. If not, I would recommend simply copying metis_interface.f90 into your project.

Concerning the boz constants, the issue is here in the construct:

        select case(fmt)
        case(b'000')
           ! ...
        case(b'001') ! edge weights
           ! ...
        case(b'010') ! vertex weights
           ! ...
        case(b'100') ! vertex sizes
           ! ...
        case(b'011')
           ! ...
        case(b'110')
           ! ...
        case(b'101')
           ! ...
        case(b'111')
           ! ...
        case default
            write(*,*) '[write_graph] Error occured'
        end select

The boz constants of form b'001' must be replaced with int(b'001'). Or the integers could be coded directly, i.e.

b`000` -> 0
b`001` -> 1
b`010` -> 2
b`011` -> 3
b`100` -> 4
b`101` -> 5
b`110` -> 6
b`111` -> 7

and a comment block added to the code.

The same needs to be done at line 272 in metis_oo_interface.f90.

ivan-pi avatar Aug 25 '21 16:08 ivan-pi

Thanks! I ended up just trimming this file. I really just need a subset of functions from the interface.

krober10nd avatar Aug 25 '21 16:08 krober10nd