CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Fortran program compiling error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 20, 2016, 15:58
Default Fortran program compiling error
  #1
New Member
 
Navsal Kumar
Join Date: Sep 2016
Posts: 1
Rep Power: 0
navsal123 is on a distinguished road
I have tried everything to remove the error, but it still doesnt go. The error comes in the last do loop.

program main
implicit none
integer::i,nnodes,time,tmax,iter,iconv,ib
real::satk,alpha,en,em,thetas,thetar,slength,delt, psiini,psitop,psibot,delz,epsilon,ndays,n2days,z(5 00),psinew(500),psiold(500),psiass(500),A(500),B(5 00)C(500),D(500),psifinal(500),thetaavail(500),the tazero(500),esatavail(500),thetares(500),esatzero( 500),kodeday(500),psires(500)
open(1,file='main.dat',status='new')

print *, "Enter the values of satk,alpha,en,thetas,thetar"
read *, satk,alpha,en,thetas,thetar
write(1,*) "Saturated conductivity=",satk,"Alpha=",alpha,"n=",en,"Satura ted MC =",thetas,"Residual MC =",thetar
em=(1-(1/en))
write(1,*) "Van genuchten m =",em
print *, "Enter the values of soil length, nnodes, delta T, Maximum time"
read *, slength,nnodes,delt,tmax
write(1,*) "Soil length=",slength,"Number of nodes=",nnodes,"Time interval=",delt,"Maximum time =",tmax
delz=(slength)/(nnodes-1)
write(1,*) "Node spacing is =",delz
print *, "Enter the values of initial, bottom, top pressure heads"
read *, psiini,psibot,psitop
write(1,*) "Initial pressure head=",psiini,"Bottom pressure head=",psibot,"Top pressure head=",psitop
print *, "Enter the values epsilon,ndays,n2days"
read *, eepsilon,ndays,n2days
write(1,*) "Prestipulated convergence factor=",eepsilon,"Number days simulation runs=",ndays,"hours of ndays=",n2days
do i=1,nnodes
z(i)=(nnodes-(i))*delz
write(1,*) "Node spacing at node number",(nnodes+1)-i, "is=",z(i)
enddo
print *, "Which boundary condition you want to apply?"
print *, "Enter 1 for Dirichlet boundary condition at top and bottom"
print *, "Enter 2 for flux at top and gravity drainage at bottom"
print *, "Enter 3 for Dirichlet at top and gravity drainage bottom"
print *, "Enter 4 for flux at top and Dirichlet at bottom"
read *, ib

if(ib.eq.1)then
do i=1,nnodes
if(i.eq.1)then
psiold(i)=psibot
elseif(i.eq.nnodes)then
psiold(i)=psitop
else
psiold(i)=psiini
endif
enddo
else
do i=1,nnodes
if(i.eq.1)then
psiold(i)=psibot
else
psiold(i)=psitop
endif
write(1,*) "Initial value of pressure head at",(nnodes+1)-i,"is",psiold(i)
enddo
endif

do i=1,nnodes
esatzero(i)=(1/(1+abs((psiold(i)*alpha))**en)**em)
thetazero(i)=(((esatzero(i))*(thetas-thetar))+thetar)
write(1,*) "thetazero=",thetazero(i),"esatzero=",esatzero (i)
enddo

close(1)
end program main
navsal123 is offline   Reply With Quote

Old   September 20, 2016, 16:32
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
please, write the compiler error you get
FMDenaro is offline   Reply With Quote

Old   September 20, 2016, 16:46
Default
  #3
Senior Member
 
DarylMusashi's Avatar
 
Holger Dietrich
Join Date: Apr 2011
Location: Germany
Posts: 174
Rep Power: 15
DarylMusashi is on a distinguished road
At first:
print *, "Enter the values epsilon,ndays,n2days"
read *, eepsilon,ndays,n2days

But you defined epsilon, not eepsilon.

Secondly the problem might be the exponential operation in the last do-loop. FORTRAN is not able to raise a negative number to a fractional power.
DarylMusashi is offline   Reply With Quote

Reply

Tags
fortran, fortran compiler, loop


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pressure outlet boundary condition rolando OpenFOAM Running, Solving & CFD 62 September 18, 2017 07:45
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch gschaider OpenFOAM Installation 225 August 25, 2015 20:43
[swak4Foam] installing funkySetFields igo OpenFOAM Community Contributions 1 November 20, 2012 21:16
issue compiling new turbulence model perplexed user OpenFOAM Programming & Development 1 January 13, 2012 04:40
How to install CGNS under windows xp? lzgwhy Main CFD Forum 1 January 11, 2011 19:44


All times are GMT -4. The time now is 15:44.