Q:

Fortran split module into multiple files

I have something like this:
Module ModA
    contains
    subroutine FooA()
       ....
    end subroutine
    subroutine FooB()
       ....
    end subroutine
end mofule ModA

can I split the two subroutines each in a separate file and still both belongs to the same module.

A:

Yes.  You have two options.
The first is to simply INCLUDE the file with the source of a subroutine in the module subprogram part.
! Module.f90
MODULE ModA
CONTAINS
  INCLUDE 'FooA.f90'
  INCLUDE 'FooB.f90'
END MODULE ModA

! FooA.f90
SUBROUTINE FooA()
!...
END SUBROUTINE FooA

! FooB.f90
SUBROUTINE FooB()
!...
END SUBROUTINE FooB

The second option is to move each subroutine into its own submodule.
MODULE ModA
  INTERFACE
    MODULE SUBROUTINE FooA()
    END MODULE SUBROUTINE FooA
    MODULE SUBROUTINE FooB()
    END MODULE SUBROUTINE FooB()
  END INTERFACE
END MODULE ModA

! FooA.f90 (or whatever name you prefer)
SUBMODULE (ModA) FooA_submodule
CONTAINS
  MODULE PROCEDURE FooA
  !...
  END PROCEDURE FooA
END SUBMODULE FooA_submodule

! FooB.f90 (or whatever name you prefer).
SUBMODULE (ModA) FooB_submodule
CONTAINS
  MODULE PROCEDURE FooB
  !...
  END MODULE PROCEDURE FooB
END SUBMODULE FooB_submodule

But you will need to use a Fortran compiler that supports the Fortran 2008 submodule feature for this option.

