|
[Sponsors] |
August 7, 2003, 03:53 |
Problems of Duns Codes!
|
#1 |
Guest
Posts: n/a
|
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 .
|
|
August 7, 2003, 14:06 |
Re: Problems of Duns Codes!
|
#2 |
Guest
Posts: n/a
|
Did you look at the bugs on the sourceforge website for the DUNS? Bug #508861 is most likely your problem.
|
|
August 8, 2003, 04:15 |
Re: Problems of Duns Codes!
|
#3 |
Guest
Posts: n/a
|
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.
|
|
August 11, 2003, 04:36 |
Re: Problems of Duns Codes!
|
#4 |
Guest
Posts: n/a
|
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 |
|
August 11, 2003, 04:45 |
Re: Problems of Duns Codes!
|
#5 |
Guest
Posts: n/a
|
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 $< |
|
August 11, 2003, 06:12 |
Re: Problems of Duns Codes!
|
#6 |
Guest
Posts: n/a
|
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` |
|
August 11, 2003, 10:29 |
Re: Problems of Duns Codes!
|
#7 |
Guest
Posts: n/a
|
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. |
|
August 12, 2003, 09:16 |
Re: Problems of Duns Codes!
|
#8 |
Guest
Posts: n/a
|
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 |
|
August 14, 2003, 23:19 |
Re: Problems of Duns Codes!
|
#9 |
Guest
Posts: n/a
|
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 |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
BOOK ON OPTIMIZATION OF FORTRAN CODES | Alberto | Main CFD Forum | 3 | November 10, 2008 06:07 |
Help required to solve Hydraulic related problems | aero | CFX | 0 | October 30, 2006 11:00 |
Grid generation - Open source codes | Chris | Main CFD Forum | 5 | May 23, 2002 08:16 |
Using Fluent for Geophysical Problems | Hassid Samuel | FLUENT | 0 | February 23, 2001 06:04 |
salary range | Frank Muldoon | Main CFD Forum | 7 | August 3, 1998 19:04 |