Skip to content

DRY m_checker #591

@henryleberre

Description

@henryleberre

From #544 (comment):

Take this example adapted from m_checker (there are literally hundreds of lines like this):

if (acoustic(j)%npulse >= 5 .and. acoustic(j)%dipole) then
   call s_mpi_abort('acoustic('//trim(jStr)//')%dipole is not '// &
                     'supported for support >= 5 '// &
                     '(non-planar supports). Exiting ...')
end if

This can be simplified to:

@:PROHIBIT(acoustic(j)%npulse >= 5 .and. acoustic(j)%dipole, 'for acoustic source '//trim(jStr))

This is what would get printed (I actually ran this):

m_checker.fpp:186: Prohibited condition: acoustic(j)%npulse >= 5 .and. acoustic(j)%dipole. for > acoustic source 1

I think it's much better than our current solution. Less code and less duplication. Of course you can still make this example better but I hope this proves my point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions