CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   fortran common block (http://www.cfd-online.com/Forums/main/6656-fortran-common-block.html)

A.M.Memarzadegan October 4, 2003 06:17

fortran common block
 
Hi every body, I have a cfd code which declares variables through common block in a file named common.inc I can't add variables to it.for instance i want to increase some integer variables. What sould i do?

Jim Park October 4, 2003 09:31

Re: fortran common block
 
Don't understand the question. Why can't you add variables? Certainly FORTRAN allows for common blocks to be modified. Are you reading/writing files whose size and structure are tied to the size and structure of the common block?

A.M.Memarzadegan October 4, 2003 09:47

Re: fortran common block
 
Yeap It is realy amazing.when i add a line to declare other bunch of variables i face to lexical error(unrecognized statement) i want to add following line 2 ni1,ni2,nj1,nj2 under 1/alli/ni,nj,... in following file.

parameter(it=32,jt=32,kt=32,nphit=11)

common

1/pres/ipref,jpref,kpref

1/prin1/plane

1/prin2/indmon,imon,jmon,kmon

1/vecti/nsweep(nphit)

1/vectl/solve(nphit)

1/vectc/head(nphit)

1/vectr/phi(it,jt,kt,nphit),phio(it,jt,kt,nphit),prt(nphit ),

2 resor(nphit),reref(nphit),urf(nphit),ex(it),

3 deksi(it,jt,kt),deeta(it,jt,kt),dezeta(it,jt,kt),

4 dnksi(it,jt,kt),dneta(it,jt,kt),dnzeta(it,jt,kt),

5 dhksi(it,jt,kt),dheta(it,jt,kt),dhzeta(it,jt,kt),

6 conve(it,jt,kt),convn(it,jt,kt),convh(it,jt,kt),

7 smp(it,jt,kt),dtfals(nphit)

1/alli/ni,nj,nk,nim1,njm1,nkm1,iter,maxit,nphmax,itstep,n tstep

1/allr/great,small,sormax,betap,time,dt(10000),phimax(nph it),

2 phimin(nphit),dtv(it,jt,kt)

1/allc/scheme,schtur,name

1/alll/save,restrt,cycl,ortogo,steady,echo,wallq,polar

common

1/geom/xc(it,jt,kt),yc(it,jt,kt),zc(it,jt,kt),vol(it,jt,k t),

2 areaex(it,jt,kt),areaey(it,jt,kt),areaez(it,jt,kt) ,

3 areanx(it,jt,kt),areany(it,jt,kt),areanz(it,jt,kt) ,

4 areahx(it,jt,kt),areahy(it,jt,kt),areahz(it,jt,kt) ,

5 fx(it,jt,kt),fy(it,jt,kt),fz(it,jt,kt),

6 xp(it,jt,kt),yp(it,jt,kt),zp(it,jt,kt)

1/flupr/urfvis,viscos,densit,den(it,jt,kt),vis(it,jt,kt)

1/turb/cmucd,cmu,cd,c1,c2,cappa,elog,pfun,prandl

1/coef/ap(it,jt,kt),an(it,jt,kt),as(it,jt,kt),ae(it,jt,kt ),

2 aw(it,jt,kt),ah(it,jt,kt),al(it,jt,kt),

3 su(it,jt,kt),sp(it,jt,kt)

1/coefge/xksi(it,jt,kt),xeta(it,jt,kt),xzeta(it,jt,kt),

2 yksi(it,jt,kt),yeta(it,jt,kt),yzeta(it,jt,kt),

3 zksi(it,jt,kt),zeta(it,jt,kt),zzeta(it,jt,kt)

1/point/Tin,uin,u,v,w,p,pp,m,te,ed,t,f1,f2,f3

integer u,v,w,p,pp,m,te,ed,t,f1,f2,f3

logical solve,save,restrt,cycl,steady,ortogo,echo,wallq,po lar

character plane*2,head*24,scheme*2,schtur*2,name(nphit)*2 c end


TPallidum October 4, 2003 12:35

Re: fortran common block
 
Make sure the leading 2 in the new line is in the correct column for continuation and that there is a comma before ni1.


All times are GMT -4. The time now is 09:55.