There is something basic I don’t understand about modules. I want to convert include files that shared data via the old common block structure by changing the files to modules.
Extracted the basic issue to a simple example. If I leave the module in the file with the program and other subroutines, no problem. If I take the module out as a separate file I get the following typical error:
E:\PGI_5-11-2013mod2\Source Files\fall.f90(8) : error F0004 : Corrupt or Old Module file E:\PGI_5-11-2013mod2\Include Files\constants.mod
error F0004 : Corrupt or Old Module file E:\PGI_5-11-2013mod2\Include Files\constants.mod
Could someone suggest what I’m doing wrong please?
module constants
integer, parameter :: np=2000, dbl=selected_real_kind(14,100)
real(dbl) :: g=9.807, dtmin=.001, kspg=10., mass = 100.0
end module constants
program fall
!
use constants
implicit none
!
! Program to calculate the dynamics of a falling body
!
real(dbl), allocatable :: v(:),z(:),t(:), zreal(:)
real(dbl) dt
integer nsteps
!
allocate (v(np),z(np),t(np),zreal(np))
call input(z,dt)
call odesolve(v,z,t,dt,nsteps)
call realans(t,z,nsteps,zreal)
call output (t,z,zreal,v,nsteps)
stop
end
subroutine input (z,dt)
use constants
implicit none
.
.
return
end
subroutine odesolve(v,z,t,dt,nsteps)
use constants
implicit none
!
real (dbl) v(*),z(*),t(*),dt,c0,c1
integer i,nsteps
.
.
return
end
subroutine realans(t,z,nsteps,zreal)
use constants
implicit none
.
.
return
end
subroutine output(t,z,zreal,v,nsteps)
use constants, only : dbl
implicit none
.
.
return
end
Same problem with either PVF 13.4 or 13.5 using VS2008 in Windows 7 64-bit.
Thanks