Issue when compiling .f90 with a module

In my shift from .f to .f90 I am moving the include references to modules.

I am doing so within a small step but keep getting the same error when I try to compile the system.

Basically, I have a file called modules.f90, which contains a series of modules incuding this…

module dummy_routines

	contains

		subroutine record_time(sf)

			<RECORDS START AND END TIME, THEN CALCULATES THE EXECUTION TIME>
			
		end subroutine
	
end module

I can compile this and I get a list of all the modules contained within the modules.f90, including one called dummy_routines.mod.

In the main code requiring this module I have this as the first 3 lines…

        use stellar_values, only: xm_sun, yr, grav
        use dummy_routines
        implicit none

stellar_values is another of the modules and this generates no error.

The error is…

C:\Users\garyn\OneDrive\stelcor>gfortran -O dummymain.o stelcor.o -o dummymain
c:/users/garyn/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: dummymain.o:dummymain.f90:(.text+0x124): undefined reference to `__dummy_routines_MOD_record_time'
c:/users/garyn/gcc/bin/../lib/gcc/x86_64-w64-mingw32/11.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: dummymain.o:dummymain.f90:(.text+0x597): undefined reference to `__dummy_routines_MOD_record_time'
collect2.exe: error: ld returned 1 exit status

I do note that I do not have this defines as main; could this be the issue?

Thank you; that makes total sense (now). :slight_smile: