CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   Problems of Duns Codes! (http://www.cfd-online.com/Forums/main/6423-problems-duns-codes.html)

Martin J August 7, 2003 04:53

Problems of Duns Codes!
 
dear all, i want to use the duns code to solve my N--S equations.when i run it in OS of Linux7.2, some warning happened. the major problem is the code: #if ...#endif . anybody run it successfully in linux os? or Unix? thanks a lot .

Douglas Schwer August 7, 2003 15:06

Re: Problems of Duns Codes!
 
Did you look at the bugs on the sourceforge website for the DUNS? Bug #508861 is most likely your problem.

Charles Crosby August 8, 2003 05:15

Re: Problems of Duns Codes!
 
I suspect that you have a problem with pre-processing. I found it necesssary to add the -traditional option for the cpp pre-processor in the MakeSystem file.

Martin J August 11, 2003 05:36

Re: Problems of Duns Codes!
 
fort77 -O2 -w -c prepar.f prepar.f:

prepar: Error on line 23 of prepar.f: Declaration error -- expected letter range Error on line 23 of prepar.f: syntax error Error on line 41 of prepar.f: Bad # line: "#ifdef PARALLEL" Error on line 43 of prepar.f: Bad # line: "#endif" Error on line 47 of prepar.f: impossible conversion Error on line 49 of prepar.f: impossible conversion Error on line 55 of prepar.f: Bad # line: "#ifdef TWOD" Error on line 56 of prepar.f: Bad # line: "#else" Error on line 59 of prepar.f: Bad # line: "#endif" Error on line 206 of prepar.f: Bad # line: "#ifndef PARALLEL" Error on line 208 of prepar.f: Bad # line: "#else" Error on line 211 of prepar.f: impossible conversion Error on line 211 of prepar.f: Bad # line: "#endif" Error on line 218 of prepar.f: concatenation of nonchar data Error on line 218 of prepar.f: bad file in open Error on line 218 of prepar.f: non-character control clause Error on line 219 of prepar.f: concatenation of nonchar data Error on line 219 of prepar.f: bad file in open Error on line 219 of prepar.f: non-character control clause Error on line 220 of prepar.f: Bad # line: "#ifdef SPECIES" Error on line 223 of prepar.f: concatenation of nonchar data Error on line 223 of prepar.f: bad file in open Error on line 223 of prepar.f: non-character control clause Error on line 223 of prepar.f: Bad # line: "#endif" Error on line 235 of prepar.f: Bad # line: "#ifdef TURB_qw" Error on line 239 of prepar.f: Bad # line: "#endif" Error on line 245 of prepar.f: unit specifier not of type integer or character Error on line 246 of prepar.f: unit specifier not of type integer or character Error on line 247 of prepar.f: unit specifier not of type integer or character Error on line 248 of prepar.f: unit specifier not of type integer or character Error on line 253 of prepar.f: unit specifier not of type integer or character Error on line 254 of prepar.f: unit specifier not of type integer or character Error on line 255 of prepar.f: unit specifier not of type integer or character Error on line 256 of prepar.f: unit specifier not of type integer or character Error on line 275 of prepar.f: unit specifier not of type integer or character Error on line 285 of prepar.f: Bad # line: "#ifdef SPECIES" Error on line 289 of prepar.f: Bad # line: "#endif"

i2ch: Error on line 330 of prepar.f: Declaration error -- expected letter range Error on line 330 of prepar.f: syntax error /usr/bin/fort77: aborting compilation make: *** [prepar.o] Error 25

this is the error i encounted. could you tell me how to revise the makesystem file? i do not learn linux well. Which line '-traditional -cpp' will be added to? thanks again and best regards Martin J

Martin J August 11, 2003 05:45

Re: Problems of Duns Codes!
 
could you tell me how to revised the file MakeSystem, that is which line -traditional is added to? best regards

ps:this is the makesystem file that i revised.is it right? the error exit too!

# # This makesystem was constructed on a PII machine running Linux. # We found we had to use fort77 (front-end to f2c) # instead of g77/f77 that comes with most distributions, although # we still link with the g2c directory. Enjoy. #

.SUFFIXES: .Inc .inc .o .F .C .f .cpp .c

F77 = fort77 CPP = gcc -C -x c -P -E CPLUS = g++ CC = gcc LINKER = gcc LIBMAKER= ar vr MKDIR = /bin/mkdir -p RM = /bin/rm -f CP = /bin/cp -f CHMOD = /bin/chmod

CPPFLAGS = -DFUNDER -DISNAN #CFLAGS = -DRANGECHECK CFLAGS = -O2 F77FLAGS = -O2 -w #CPLUSFLAGS= -DRANGECHECK CPLUSFLAGS= -O2 LFLAGS = -Xlinker -Bstatic SYSLIBS = -lg2c -lm GRAFLIBS = -lmbgrafic -lgrafic -L/usr/X11R6/lib -lX11 MACH = pcmach.o XGROBJ = Xunderscore.o

#CPREC = double #FPREC = "double precision" CPREC = float FPREC = real

VERSN = `cat VERSION`

.Inc.inc:

@if [ -f $*.inc ]; then mv -f $*.inc $*.inc.bak; fi

$(CPP) -traditional-cpp -D"real_precision"=$(FPREC) $(CPPFLAGS) $(FLOWFLAGS) $< >$*.inc

.F.f:

@if [ -f $*.f ]; then mv -f $*.f $*.f.bak; fi

$(CPP) -traditional-cpp -D"real_precision"=$(FPREC) $(CPPFLAGS) $(FLOWFLAGS) $< >$*.f

.cpp.c:

@if [ -f $*.c ]; then mv -f $*.c $*.c.bak; fi

$(CPP) -traditional-cpp -D"Include"="#include" -D"Define"="#define" -Dreal=$(CPREC) $(CPPFLAGS) $(FLOWFLAGS) $< >$*.c

.F.o:

$(CPP) -traditional-cpp -D"real_precision"=$(FPREC) $(CPPFLAGS) $(FLOWFLAGS) $< >$*.f

$(F77) $(F77FLAGS) -c $*.f

.C.o:

$(CPLUS) $(INCLUDE) -Dreal=$(CPREC) $(CPLUSFLAGS) -c $<

.f.o:

$(F77) $(F77FLAGS) -c $<

.c.o:

$(CC) $(CFLAGS) -DVERSION=\"$(VERSN)\" -c $<

Charles Crosby August 11, 2003 07:12

Re: Problems of Duns Codes!
 
Martin,

You can try changing the Makesystem file to look like this. Basically only 2 changes:

1. g77 actually works fine 2. add -traditional to the list of options for CPP

# # This makesystem was constructed on a PII machine running Linux. # We found we had to use fort77 (front-end to f2c) # instead of g77/f77 that comes with most distributions, although # we still link with the g2c directory. Enjoy. #

.SUFFIXES: .Inc .inc .o .F .C .f .cpp .c

#F77 = fort77 F77 = g77 CPP = gcc -C -x c -P -E -traditional CPLUS = g++ CC = gcc LINKER = gcc LIBMAKER= ar vr MKDIR = /bin/mkdir -p RM = /bin/rm -f CP = /bin/cp -f CHMOD = /bin/chmod

CPPFLAGS = -DFUNDER -DISNAN #CFLAGS = -DRANGECHECK CFLAGS = -O2 F77FLAGS = -O2 -w #CPLUSFLAGS= -DRANGECHECK CPLUSFLAGS= -O2 LFLAGS = -Xlinker -Bstatic SYSLIBS = -lg2c -lm GRAFLIBS = -lmbgrafic -lgrafic -L/usr/X11R6/lib -lX11 MACH = pcmach.o XGROBJ = Xunderscore.o

#CPREC = double #FPREC = "double precision" CPREC = float FPREC = real

VERSN = `cat VERSION`

andy August 11, 2003 11:29

Re: Problems of Duns Codes!
 
Trying to building on an old sun system problems seemed to lie with the (unnecessary) build scripts rather than cpp. Copying the src directory to a new directory, adding the "makesystem" parameters to the Makefile, adding the required cpp flags (-DTWOD -DFUNDER for a quick test) and the solver and plotting programs built OK. I also had to add a CHMOD parameter to the "makesystem" file and one or two other things to do with the graphics in order to build the library the plotting program seemed to want.

>>> fort77 -O2 -w -c prepar.f prepar.f

This command is wrong: it is using the same name for the source and object files.

The duns program is a fairly standard university CFD research code and is not a "FLUENT" substitute. To use it effectively I strongly suspect you are going to need to know how to program and how to use standard programming tools like cpp, cc, f77, ld, make,...

I also suspect there might be copyright issues if you try to work with the code. The copyright of almost all university developed code lies with the university and not the researchers and there is no mention in the HISTORY or COPYRIGHT files that MIT/Penn State/... have surrendered their rights. Perhaps they have but it would be an unusual omission given the efforts one would normally have to make to get this agreement.


Douglas Schwer August 12, 2003 10:16

Re: Problems of Duns Codes!
 
That looks like a pre-processing error; you should not have any #ifdef ... #else ... #endif lines in your FORTRAN (.f) files.

If you are running on Redhat 8 or 9 (this will probably work with 7 also), the CPP line should read:

CPP = gcc -C -x c -P -E -traditional-cpp

in makesystem/Makesystem_linux

and it should preprocess the files correctly. The newer versions of gcc will mess with the white-space unless the '-traditional-cpp' flag is used, which then messes up the FORTRAN compiler.

Try doing on of the test cases, such as serial/bfs, to see if things are set up correctly.

Good luck! Doug

Martin J August 15, 2003 00:19

Re: Problems of Duns Codes!
 
hi, i can not solve the problem, because the errors come again.

SUFFIXES: .Inc .inc .o .F .C .f .cpp .c

F77 = fort77 CPP = gcc -C -x c -P -E -traditional -cpp

is it right??

thanks for you help, best regards Martin

[root@sword src]# make fort77 -O2 -w -c prepar.f prepar.f:

prepar: Error on line 23 of prepar.f: Declaration error -- expected letter range Error on line 23 of prepar.f: syntax error Error on line 13 of include/variables.inc: Bad # line: "#ifdef BLOCKADI" Error on line 16 of include/variables.inc: Bad # line: "#else" Error on line 19 of include/variables.inc: Bad # line: "#endif" Error on line 21 of include/variables.inc: Bad # line: "#ifdef SPECIES" Error on line 27 of include/variables.inc: Bad # line: "#else" Error on line 30 of include/variables.inc: Bad # line: "#endif" Error on line 30 of include/variables.inc: Bad # line: "#ifdef TURB_qw" Error on line 32 of include/variables.inc: Bad # line: "#else" Error on line 38 of include/variables.inc: Bad # line: "#endif" Error on line 38 of include/variables.inc: Bad # line: "#ifdef TURB_sec" Error on line 40 of include/variables.inc: Bad # line: "#else" Error on line 44 of include/variables.inc: Bad # line: "#endif" Error on line 10 of include/properties.inc: Bad # line: "#ifdef CKLIB" Error on line 31 of include/properties.inc: Bad # line: "#endif" Error on line 42 of include/properties.inc: Bad # line: "#ifdef CKLIB" Error on line 51 of include/properties.inc: Bad # line: "#endif" Error on line 4 of include/reactions.inc: Bad # line: "#ifdef JACSAV" Error on line 12 of include/reactions.inc: Bad # line: "#else" Error on line 15 of include/reactions.inc: Bad # line: "#endif" Error on line 40 of include/dualtime.inc: Bad # line: "#ifdef DUALTIME" Error on line 9 of include/dualtime.inc: Bad # line: "#else" Error on line 14 of include/dualtime.inc: Bad # line: "#endif" Error on line 41 of prepar.f: Bad # line: "#ifdef PARALLEL" Error on line 43 of prepar.f: Bad # line: "#endif" Error processing equivalences before line 10 of include/turbulence.inc: subscripts on scalar variable dqn Error on line 55 of prepar.f: Bad # line: "#ifdef TWOD" Error on line 56 of prepar.f: Bad # line: "#else" Error on line 59 of prepar.f: Bad # line: "#endif" Error on line 206 of prepar.f: Bad # line: "#ifndef PARALLEL" Error on line 208 of prepar.f: Bad # line: "#else" Error on line 211 of prepar.f: Bad # line: "#endif" Error on line 220 of prepar.f: Bad # line: "#ifdef SPECIES" Error on line 223 of prepar.f: Bad # line: "#endif" Error on line 235 of prepar.f: Bad # line: "#ifdef TURB_qw" Error on line 239 of prepar.f: Bad # line: "#endif" Error on line 285 of prepar.f: Bad # line: "#ifdef SPECIES" Error on line 289 of prepar.f: Bad # line: "#endif"

i2ch: Error on line 330 of prepar.f: Declaration error -- expected letter range Error on line 330 of prepar.f: syntax error

arg 4: here logical variable, previously real variable. /usr/bin/fort77: aborting compilation make: *** [prepar.o] Error 25



All times are GMT -4. The time now is 23:45.