Here is a guess about your problem. For a code where two modules define the same subroutine display
module date_ymd_mod
implicit none
type date_ymd
integer :: year, month, day
end type date_ymd
contains
subroutine display(date)
type(date_ymd), intent(in) :: date
print "(i4.4,2('-',i2.2))", date
end subroutine display
end module date_ymd_mod
!
module date_ym_mod
implicit none
type date_ym
integer :: year, month
end type date_ym
contains
subroutine display(date)
type(date_ym), intent(in) :: date
print "(i4.4,'-',i2.2)", date
end subroutine display
end module date_ym_mod
!
program main
use date_ymd_mod
use date_ym_mod
implicit none
call display(date_ymd(2024,2,10))
call display(date_ym(2024,2))
end program main
ifx correctly complains
display.f90(29): error #6405: The same named entity from different modules and/or program units cannot be referenced. [DISPLAY]
call display(date_ymd(2024,2,10))
-----^
display.f90(30): error #6405: The same named entity from different modules and/or program units cannot be referenced. [DISPLAY]
call display(date_ym(2024,2))
-----^
compilation aborted for display.f90 (code 1)
but when two modules have an interface for display
ifx and gfortran accept the code:
module date_ymd_mod
implicit none
type date_ymd
integer :: year, month, day
end type date_ymd
interface display
module procedure display_ymd
end interface display
contains
subroutine display_ymd(date)
type(date_ymd), intent(in) :: date
print "(i4.4,2('-',i2.2))", date
end subroutine display_ymd
end module date_ymd_mod
!
module date_ym_mod
implicit none
type date_ym
integer :: year, month
end type date_ym
interface display
module procedure display_ym
end interface display
contains
subroutine display_ym(date)
type(date_ym), intent(in) :: date
print "(i4.4,'-',i2.2)", date
end subroutine display_ym
end module date_ym_mod
!
program main
use date_ymd_mod
use date_ym_mod
implicit none
call display(date_ymd(2024,2,10))
call display(date_ym(2024,2))
end program main
Output:
2024-02-10
2024-02