- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi folks
Steve posted this back in 2001:http://software.intel.com/en-us/forums/showthread.php?t=45268
I've been trying to apply this in order to have a character variable printed to an output file each iteration of a DO loop with an incrementally larger numeric addendum equal to the number of that loop appended to the name each time.
CHARACTER*4 CONP
CHARACTER*1 LSTRING
CHARACTER*5 CONPO
INTEGER LPRINTI
DATA CONP/'CONP'/
IF(LMAX.GT.O) THEN
DO LPRINT=1,LMAX
LPRINTI=LPRINT (not sure if this is really necessary or if I could use LPRINT as is)
IF(NST/NPRR(LPRINT)*NPRR(LPRINT) .EQ. NST)THEN
KREC=KREC+1
WRITE(LSTRING,'(I1)') LPRINTI
CONPO=CONP//LSTRING
WRITE(NUBINARY,REC=KREC)CONPO,NST,((RP(N,M,LPRINT), M=1,MMAX),N=1,NMAX)
ENDIF
ENDDO
ENDIF
I'm getting the following error referring to the line I have in bold italics:
Test_Case (042809)FTLOADDSUpdatesout.f(230): error #6303: The assignment operation or the binary expression operation is invalid for the data types of the two operands.
Much 'bliged
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's difficult to figure out whether you have homed in on a single problem when so many things are wrong:
stub.f90(8): error #12143: "LMAX" is uninitialized
stub.f90(8): error #12143: "O" is uninitialized
stub.f90(14): error #12143: "NST" is uninitialized
stub.f90(15): error #12143: "KREC" is uninitialized
stub.f90(18): error #12143: "MMAX" is uninitialized
stub.f90(18): error #12143: "NMAX" is uninitialized
stub.f90(18): error #12143: "NUBINARY" is uninitialized
For example, maybe you meant the constant 0 rather than another implicit variable declaration "O". In fact, some nonsensical error reports might go away if other errors were corrected.
It does seem you could have stuck closer to the example you mentioned.
stub.f90(8): error #12143: "LMAX" is uninitialized
stub.f90(8): error #12143: "O" is uninitialized
stub.f90(14): error #12143: "NST" is uninitialized
stub.f90(15): error #12143: "KREC" is uninitialized
stub.f90(18): error #12143: "MMAX" is uninitialized
stub.f90(18): error #12143: "NMAX" is uninitialized
stub.f90(18): error #12143: "NUBINARY" is uninitialized
For example, maybe you meant the constant 0 rather than another implicit variable declaration "O". In fact, some nonsensical error reports might go away if other errors were corrected.
It does seem you could have stuck closer to the example you mentioned.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, I was attempting to keep the code brief but functionally clear enough for someone to see what I was trying to do. It's a fairly large piece of code that I know works perfectly already (it's in a well-established model that I have used for a while), but to which I have tried to add some changes to automate the output printing that is currently controlled by manually editing code each time.
If you would prefer I can include it all, but I assure you everything is initialized.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - stubaan
Sorry, I was attempting to keep the code brief but functionally clear enough for someone to see what I was trying to do. It's a fairly large piece of code that I know works perfectly already (it's in a well-established model that I have used for a while), but to which I have tried to add some changes to automate the output printing that is currently controlled by manually editing code each time.
If you would prefer I can include it all, but I assure you everything is initialized.
Ugh! Apologies - it looks like it may simply have been a matter of misnamed variables in the code (CONPO vs CONPNO)
Thanks for now... hopefully for good :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - stubaan
IF(NST/NPRR(LPRINT)*NPRR(LPRINT) .EQ. NST)THEN
KREC=KREC+1
WRITE(LSTRING,'(I1)') LPRINTI
CONPO=CONP//LSTRING
WRITE(NUBINARY,REC=KREC)CONPO,NST,((RP(N,M,LPRINT), M=1,MMAX),N=1,NMAX)
ENDIF
IF (MOD(nprr(lprint), nst) == 0) THEN
krec = krec + 1
WRITE (conp(5:5), '(I1)') lprint
WRITE (nubinary, REC=krec) conp, nst, .... etc...
END IF
and somewhere upstream of your loop you need to initialize krec.
![](/skins/images/BC9A7A3465121B56B278007F4EE8899F/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page