Hi all,
I am struggling to get a module working, it returns the error:
$ gfortran -o executable variable1.f95
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20):
undefined reference to `main'
collect2: error: ld returned 1 exit status
I'm using Ubuntu MATE V16.04 running Gfortran v5.4
I've noticed I have to call the module with the actual name 'variable1 otherwise it Gfortran won't see it.
The module definition follows:
MODULE variable1
implicit none
SAVE
integer nmax !number of steps in problem
integer isn !integration step number
double precision stepsize,fintim
double precision printinterval, printtime
integer Imax !number of state variables
integer I,a,ii,b !a = 0, predictor step,
!1= corrector step
integer ifintim,Irecipstepsize,Itime
double precision, ALLOCATABLE :: y,
double precision, ALLOCATABLE :: ydot,
double precision, ALLOCATABLE :: ydum)
double precision, DIMENSION,, ALLOCATABLE :: dydt
double precision TMD,MM,VW,PO,B1,B2,MF,cpgmix,gasvi
double precision Twout,HW,TM,Xd,PI,HI,QM,HZ,htcw,di,tout
double precision KW,KTI,KTO,CPw,KTempd,KPecon,KPdrum
double precision KWgas,KTOgas,KTIgas,KTempg,CPgas
double precision TsoPL,HsoPL,RsoPL,TMPL,QMPL
double precision WsiPL,TgiPL,TgoPL,TgoPLD,WgiPL
double precision WgiFS,TMPLD,HsoPLD,PsoPL,QradPL,PgiPL,PgoPL
double precision RhogPL,RhogPLD,PsoPLD,TgoFS,Gasconst
double precision QMFS,WsiFS,WsoSM,TgoFSD
double precision WgiFRH,WgiPSH,TMFSD,HsoFSD,PsoFS,PsoFSD,PsoFS_D,QradFS
double precision PgoFS,RhogFS,RhogFSD,TgoFRH,HsoSM,TgoPSH
double precision HsoPSH,TMPSH,PsoPSH,RhogPSH,QradPSH,RsoPSH
double precision HsoPSHD,TMPSHD,PsoPSHD,RhogPSHD,TgoPSHD,QMPSH,WsiPSH
double precision PgoPSH,TsoPSH
double precision TsoFRH,HsoFRH,WgiPRHT,RsoFRH,TMFRH,PsoPRHT,HsoPRHT
double precision QMFRH,WsiFRH,WsoRSM,WsoRSMD,TgoFRHD,TMFRHD,HsoFRHD,PsoFRH
double precision PsoFRHD,QradFRH,PgoFRH,RhogFRH,RhogFRHD,TgoPRHT,HsoFRHSM
double precision TsoPRHT,RsoPRHT,TMPRHT,HsoPRHTD,TMPRHTD,TgoPRHTD
double precision PsoPRHTD,RhogPRHTD,PsoPRHB,HsoPRHB,QMPRHT,WsiPRHT
double precision WgiPRHB,QradPRHT,PgoPRHT,RhogPRHT,TgoPRHB,PsoCRHM
double precision WgiHGT,HsoCRHM
double precision TsoPRHB,RsoPRHB,TMPRHB,HsoPRHBD,TMPRHBD,TgoPRHBD
double precision PsoPRHBD,RhogPRHBD,QMPRHB,WsiPRHB,RhogPRHB,PgoPRHB
double precision QradPRHB
double precision PgoRHECON,RhogRHECON,WgiRHECON,WgiRHGDamper,RhogRHECOND
double precision PgoSHECON,RhogSHECON,WgiSHECON,WgiSHGDamper,RhogSHECOND
double precision WgiCGT,PgoECONmix,RhogECONmix,RhogECONmixD
double precision TgoECONmix,TgoECONmixD,WgiAHMILL,PgiAHMILL,RhoigAHMILL
double precision RhoigAHMILLD,TgiAHMILL,TgiAHMILLD
double precision TgoAHMILL,TgoAHMILLD,WleakAHMILL,TMAHMILL,TMAHMILLD
double precision WgoAHMILL,PgoAHMILL,RhogAHMILL,RhogAHMILLD,TgdownAHMILL
double precision MMAHMILL,AsurfaceAHMILL,khtcAHMILL
double precision WgiAHMAIN,PgiAHMAIN,RhoigAHMAIN,WgoAHMAIN
double precision RhoigAHMAIND,TgiAHMAIN,TgiAHMAIND
double precision TgoAHMAIN1,TgoAHMAIN1D,WleakAHMAIN1,TMAHMAIN1,TMAHMAIN1D
double precision WgiAHMAIN1,WgoAHMAIN1,PgoAHMAIN1,RhogAHMAIN1,RhogAHMAIN1D
double precision MMAHMAIN,AsurfaceAHMAIN,khtcAHMAIN,WgoAHMAIN1D
double precision TgoAHMAIN2,TgoAHMAIN2D,WleakAHMAIN2,TMAHMAIN2,TMAHMAIN2D
double precision WgoAHMAIN2,PgoAHMAIN2,WgiAHMAIN2
double precision RhogAHMAIN2,RhogAHMAIN2D
double precision TleakAHMILL,TleakAHMAIN1,TleakAHMAIN2
integer OPMOFRAHMILL,OPMOFRAHMAIN1,OPMOFRAHMAIN2
integer AHTYPEAHMILL,AHTYPEAHMAIN
double precision RhogiPL,RhogiPLD
double precision WgiDamper1,RhogDamper1D,WgiDamper2,RhogDamper2D
double precision TgiPRE,TgiPRED,WgiPRE,PgiPRE,VolgPRE,RhoigPRE,RhoigPRED
double precision TgoPRE,TgoPRED,WgoPRE,PgoPRE,VolgPRECIP,RhogPRE,RhogPRED
double precision IGVposA,IGVposAD,PgiPL_lag,PgiPL_lagD
double precision Intac, IntacD,Contr_out
double precision manDVID
integer AMFLAGID
double precision, parameter :: CPM = 0.465d0 !tube material specific heat capacity KJ/kgK
double precision, parameter :: RHOM = 7.833d3 ! carbon steel density kg/m3
! real(8) gasflow,gasvol
double precision PRhpt,R3hpt,HsoCRSH_fit,Tsihpt,wgIDfan
double precision vgIDfan, PgoID, Pgstack, KglossID
double precision Tgog1,Tgog2,Tgog3,Rhog1,Rhog2,Rhog3
double precision Tgog1D,Tgog2D,Tgog3D,Rhog1D,Rhog2D,Rhog3D
double precision time,Wgin1,Wgin2,Wgin3,Wgin4,Wgin5,Wgin6
double precision kgloss,pgo1,pgo2,pgo3,Tgdown3,KQloss1,volgas1
double precision Rgas,Tgin1,Wgo1,Wgo2,Wgo3,CPgas1,CPgas2,CPgas3
! set up pre calculated values
! fuel is FyF @ 2.09% O2 wet
double precision, parameter :: CO2 = 0.233d0
double precision, parameter :: H2O = 0.0345d0
double precision, parameter :: O2 = 0.0222d0
double precision, parameter :: N2 = 0.708d0
double precision, parameter :: SO2 = 0.0017d0
! determine gas constant for mixture
double precision, parameter :: Ro = 8.3144d0 !kJ/kmole K
double precision, parameter :: Mwcot = 44.d0
double precision, parameter :: Mwoxy = 32.d0
double precision, parameter :: Mwnit = 28.d0
double precision, parameter :: Mwsuldi = 64.d0
double precision, parameter :: Mwmoist = 18.d0
double precision, parameter :: qh1 = 1.d5 !kW
double precision, parameter :: qh2 = 1.d5
double precision, parameter :: qh3 = 1.d5
END MODULE variable1
!---------------------------------------------------------------
I am struggling to get a module working, it returns the error:
$ gfortran -o executable variable1.f95
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20):
undefined reference to `main'
collect2: error: ld returned 1 exit status
I'm using Ubuntu MATE V16.04 running Gfortran v5.4
I've noticed I have to call the module with the actual name 'variable1 otherwise it Gfortran won't see it.
The module definition follows:
MODULE variable1
implicit none
SAVE
integer nmax !number of steps in problem
integer isn !integration step number
double precision stepsize,fintim
double precision printinterval, printtime
integer Imax !number of state variables
integer I,a,ii,b !a = 0, predictor step,
!1= corrector step
integer ifintim,Irecipstepsize,Itime
double precision, ALLOCATABLE :: y,
double precision, ALLOCATABLE :: ydot,
double precision, ALLOCATABLE :: ydum)
double precision, DIMENSION,, ALLOCATABLE :: dydt
double precision TMD,MM,VW,PO,B1,B2,MF,cpgmix,gasvi
double precision Twout,HW,TM,Xd,PI,HI,QM,HZ,htcw,di,tout
double precision KW,KTI,KTO,CPw,KTempd,KPecon,KPdrum
double precision KWgas,KTOgas,KTIgas,KTempg,CPgas
double precision TsoPL,HsoPL,RsoPL,TMPL,QMPL
double precision WsiPL,TgiPL,TgoPL,TgoPLD,WgiPL
double precision WgiFS,TMPLD,HsoPLD,PsoPL,QradPL,PgiPL,PgoPL
double precision RhogPL,RhogPLD,PsoPLD,TgoFS,Gasconst
double precision QMFS,WsiFS,WsoSM,TgoFSD
double precision WgiFRH,WgiPSH,TMFSD,HsoFSD,PsoFS,PsoFSD,PsoFS_D,QradFS
double precision PgoFS,RhogFS,RhogFSD,TgoFRH,HsoSM,TgoPSH
double precision HsoPSH,TMPSH,PsoPSH,RhogPSH,QradPSH,RsoPSH
double precision HsoPSHD,TMPSHD,PsoPSHD,RhogPSHD,TgoPSHD,QMPSH,WsiPSH
double precision PgoPSH,TsoPSH
double precision TsoFRH,HsoFRH,WgiPRHT,RsoFRH,TMFRH,PsoPRHT,HsoPRHT
double precision QMFRH,WsiFRH,WsoRSM,WsoRSMD,TgoFRHD,TMFRHD,HsoFRHD,PsoFRH
double precision PsoFRHD,QradFRH,PgoFRH,RhogFRH,RhogFRHD,TgoPRHT,HsoFRHSM
double precision TsoPRHT,RsoPRHT,TMPRHT,HsoPRHTD,TMPRHTD,TgoPRHTD
double precision PsoPRHTD,RhogPRHTD,PsoPRHB,HsoPRHB,QMPRHT,WsiPRHT
double precision WgiPRHB,QradPRHT,PgoPRHT,RhogPRHT,TgoPRHB,PsoCRHM
double precision WgiHGT,HsoCRHM
double precision TsoPRHB,RsoPRHB,TMPRHB,HsoPRHBD,TMPRHBD,TgoPRHBD
double precision PsoPRHBD,RhogPRHBD,QMPRHB,WsiPRHB,RhogPRHB,PgoPRHB
double precision QradPRHB
double precision PgoRHECON,RhogRHECON,WgiRHECON,WgiRHGDamper,RhogRHECOND
double precision PgoSHECON,RhogSHECON,WgiSHECON,WgiSHGDamper,RhogSHECOND
double precision WgiCGT,PgoECONmix,RhogECONmix,RhogECONmixD
double precision TgoECONmix,TgoECONmixD,WgiAHMILL,PgiAHMILL,RhoigAHMILL
double precision RhoigAHMILLD,TgiAHMILL,TgiAHMILLD
double precision TgoAHMILL,TgoAHMILLD,WleakAHMILL,TMAHMILL,TMAHMILLD
double precision WgoAHMILL,PgoAHMILL,RhogAHMILL,RhogAHMILLD,TgdownAHMILL
double precision MMAHMILL,AsurfaceAHMILL,khtcAHMILL
double precision WgiAHMAIN,PgiAHMAIN,RhoigAHMAIN,WgoAHMAIN
double precision RhoigAHMAIND,TgiAHMAIN,TgiAHMAIND
double precision TgoAHMAIN1,TgoAHMAIN1D,WleakAHMAIN1,TMAHMAIN1,TMAHMAIN1D
double precision WgiAHMAIN1,WgoAHMAIN1,PgoAHMAIN1,RhogAHMAIN1,RhogAHMAIN1D
double precision MMAHMAIN,AsurfaceAHMAIN,khtcAHMAIN,WgoAHMAIN1D
double precision TgoAHMAIN2,TgoAHMAIN2D,WleakAHMAIN2,TMAHMAIN2,TMAHMAIN2D
double precision WgoAHMAIN2,PgoAHMAIN2,WgiAHMAIN2
double precision RhogAHMAIN2,RhogAHMAIN2D
double precision TleakAHMILL,TleakAHMAIN1,TleakAHMAIN2
integer OPMOFRAHMILL,OPMOFRAHMAIN1,OPMOFRAHMAIN2
integer AHTYPEAHMILL,AHTYPEAHMAIN
double precision RhogiPL,RhogiPLD
double precision WgiDamper1,RhogDamper1D,WgiDamper2,RhogDamper2D
double precision TgiPRE,TgiPRED,WgiPRE,PgiPRE,VolgPRE,RhoigPRE,RhoigPRED
double precision TgoPRE,TgoPRED,WgoPRE,PgoPRE,VolgPRECIP,RhogPRE,RhogPRED
double precision IGVposA,IGVposAD,PgiPL_lag,PgiPL_lagD
double precision Intac, IntacD,Contr_out
double precision manDVID
integer AMFLAGID
double precision, parameter :: CPM = 0.465d0 !tube material specific heat capacity KJ/kgK
double precision, parameter :: RHOM = 7.833d3 ! carbon steel density kg/m3
! real(8) gasflow,gasvol
double precision PRhpt,R3hpt,HsoCRSH_fit,Tsihpt,wgIDfan
double precision vgIDfan, PgoID, Pgstack, KglossID
double precision Tgog1,Tgog2,Tgog3,Rhog1,Rhog2,Rhog3
double precision Tgog1D,Tgog2D,Tgog3D,Rhog1D,Rhog2D,Rhog3D
double precision time,Wgin1,Wgin2,Wgin3,Wgin4,Wgin5,Wgin6
double precision kgloss,pgo1,pgo2,pgo3,Tgdown3,KQloss1,volgas1
double precision Rgas,Tgin1,Wgo1,Wgo2,Wgo3,CPgas1,CPgas2,CPgas3
! set up pre calculated values
! fuel is FyF @ 2.09% O2 wet
double precision, parameter :: CO2 = 0.233d0
double precision, parameter :: H2O = 0.0345d0
double precision, parameter :: O2 = 0.0222d0
double precision, parameter :: N2 = 0.708d0
double precision, parameter :: SO2 = 0.0017d0
! determine gas constant for mixture
double precision, parameter :: Ro = 8.3144d0 !kJ/kmole K
double precision, parameter :: Mwcot = 44.d0
double precision, parameter :: Mwoxy = 32.d0
double precision, parameter :: Mwnit = 28.d0
double precision, parameter :: Mwsuldi = 64.d0
double precision, parameter :: Mwmoist = 18.d0
double precision, parameter :: qh1 = 1.d5 !kW
double precision, parameter :: qh2 = 1.d5
double precision, parameter :: qh3 = 1.d5
END MODULE variable1
!---------------------------------------------------------------