Hi All,
I am beginners in FORTRAN and dealing with huge FORTRAN project. I apologize in the beginning if my question sounded lame. Here is the issue
Blocks of Code where file was introduced and initiated. There are 300+ fortran files in the project. That's why using only a few blocks if thats helpful
open (178,file="instreamP.out")
write (178,12224)
12224 format ('Year Day Rch flow solp-in solp-out orgp
-in orgp-out EPC benp solp_benp orgp_benp so
lp_orgp ')
write (178,78) curyr,iida,jrch,flow,solpcon,dsolp,orgpcon,dorgp,
* epc,sedp_benthos(jrch),solp_benp_flux, orgp_benp_flux,
* solp_orgp_flux
The code executed successfully, and I ran the project, and my output file with name "instreamP.out is produced with headers, but there is no data in it.
I would appreciate any help in this matter. Also, I would appreciate any guidance on learning FORTRAN.
Thanks,
Sushant
write (178,78) curyr,iida,jrch,flow,solpcon,dsolp,orgpcon,dorgp,
* epc,sedp_benthos(jrch),solp_benp_flux, orgp_benp_flux,
* solp_orgp_flux
The code executed successfully, and I ran the project, and my output file
with name "instreamP.out is produced with headers, but there is no data in it.
Hi All,
I am beginners in FORTRAN and dealing with huge FORTRAN project. I apologize in the beginning if my question sounded lame. Here is the issue
Blocks of Code where file was introduced and initiated. There are 300+ fortran files in the project. That's why using only a few blocks if thats helpful
open (178,file="instreamP.out")
write (178,12224)
12224 format ('Year Day Rch flow solp-in solp-out orgp
-in orgp-out EPC benp solp_benp orgp_benp so
lp_orgp ')
write (178,78) curyr,iida,jrch,flow,solpcon,dsolp,orgpcon,dorgp,
* epc,sedp_benthos(jrch),solp_benp_flux, orgp_benp_flux,
* solp_orgp_flux
The code executed successfully,
and I ran the project, and my output file with name "instreamP.out is produced with headers, but there is no data in it.
I would appreciate any help in this matter. Also, I would appreciate any guidance on learning FORTRAN.
On Wednesday, November 9, 2022 at 7:28:39 AM UTC+13, sushan...@gmail.com wrote:in the actual program? What is format 78 and how were the things written with it declared and evaluated? We could possibly give useful help if provided with a minimal complete program, together with any error messages and warnings it gave at compile time
Hi All,
I am beginners in FORTRAN and dealing with huge FORTRAN project. I apologize in the beginning if my question sounded lame. Here is the issue
Blocks of Code where file was introduced and initiated. There are 300+ fortran files in the project. That's why using only a few blocks if thats helpful
open (178,file="instreamP.out")
write (178,12224)
12224 format ('Year Day Rch flow solp-in solp-out orgp
-in orgp-out EPC benp solp_benp orgp_benp so
lp_orgp ')
write (178,78) curyr,iida,jrch,flow,solpcon,dsolp,orgpcon,dorgp,
* epc,sedp_benthos(jrch),solp_benp_flux, orgp_benp_flux,
* solp_orgp_flux
The code executed successfully, and I ran the project, and my output file with name "instreamP.out is produced with headers, but there is no data in it.
I would appreciate any help in this matter. Also, I would appreciate any guidance on learning FORTRAN.
Thanks,Is the program in fixed or free source form? The * in the two last lines are valid only in fixed source form but the format statement makes me wonder. Are the ends of lines in what you posted (where format 12224 occupies 3 lines) at the ends of lines
Sushant
On Tuesday, November 8, 2022 at 10:28:39 AM UTC-8, sushan...@gmail.com wrote:
(snip)
write (178,78) curyr,iida,jrch,flow,solpcon,dsolp,orgpcon,dorgp,
* epc,sedp_benthos(jrch),solp_benp_flux, orgp_benp_flux,
* solp_orgp_flux
The code executed successfully, and I ran the project, and my output file with name "instreamP.out is produced with headers, but there is no data in it.Without non-advancing I/O, which yours doesn't have, the least a Fortran WRITE
statement can write is a blank line.
As noted previously, showing the FORMAT statement number 78 would be nice.
But, most likely, your program isn't exectuting this WRITE statement.
Easy test is to put a
STOP 78
statement after the WRITE statement.
(The 78 is a reminder of where it stopped.)
That also guarantees that the output buffer is written out.
If the STOP 78 statement is not executed, you know it didn't get there.
On Wednesday, November 9, 2022 at 5:28:39 AM UTC+11, sushan...@gmail.com wrote:
Hi All,
I am beginners in FORTRAN and dealing with huge FORTRAN project. I apologize in the beginning if my question sounded lame. Here is the issue
Blocks of Code where file was introduced and initiated. There are 300+ fortran files in the project. That's why using only a few blocks if thats helpful
open (178,file="instreamP.out")
write (178,12224)
12224 format ('Year Day Rch flow solp-in solp-out orgp
-in orgp-out EPC benp solp_benp orgp_benp so
lp_orgp ')
write (178,78) curyr,iida,jrch,flow,solpcon,dsolp,orgpcon,dorgp,
* epc,sedp_benthos(jrch),solp_benp_flux, orgp_benp_flux,
* solp_orgp_flux
The code executed successfully,No it didn't.
and I ran the project, and my output file with name "instreamP.out is produced with headers, but there is no data in it.
I would appreciate any help in this matter. Also, I would appreciate any guidance on learning FORTRAN.You need to show the FORMAT statement 78.
It would seem that the second WRITE statement is never executed.
Insert a simple PRINT statement (e,.g., PRINT *, 'GOT HERE')
just before the second WRITE.
That's the problem. I am not getting any error messages.
Apologies for my ignorance. I am not aware if the program is fixed or free. Since it is open source, so many people use it, and the convention changes from time to time. Unfortunately, there is no option here to link the *.f files else
I Would have shared the program.
But I will try it now by being more detailed
This is one chunk of code in one file
write (178,79) curyr,iida,jrch,flow,solpcon,dsolp,orgpcon,dorgp,
* epc,sedp_benthos(jrch),solp_benp_flux, orgp_benp_flux,
* solp_orgp_flux
!! end if
79 format(3i4,10f12.3)
These are the only two blocks where the code was called, and no other place it was mentioned. Note: I changed 78 to 79 because 78 was used in another file of the same project.
I am sorry I want to be more detailed with my problem
If this won't work, I will put my code on google drive and share the link.
On Tuesday, November 8, 2022 at 4:24:50 PM UTC-6, gah4 wrote:
On Tuesday, November 8, 2022 at 10:28:39 AM UTC-8, sushan...@gmail.com wrote:
(snip)
write (178,78) curyr,iida,jrch,flow,solpcon,dsolp,orgpcon,dorgp,Without non-advancing I/O, which yours doesn't have, the least a Fortran WRITE
* epc,sedp_benthos(jrch),solp_benp_flux, orgp_benp_flux,
* solp_orgp_flux
The code executed successfully, and I ran the project, and my output file >> > with name "instreamP.out is produced with headers, but there is no data in it.
statement can write is a blank line.
As noted previously, showing the FORMAT statement number 78 would be nice. >>
But, most likely, your program isn't exectuting this WRITE statement.
Easy test is to put a
STOP 78
statement after the WRITE statement.
(The 78 is a reminder of where it stopped.)
That also guarantees that the output buffer is written out.
If the STOP 78 statement is not executed, you know it didn't get there.
Hi Gah,
I think you were right. 78 was called in another file of the project. I replaced my 78 with 79 and tried running the project. Again, no error while compiling but the application is still not writing data to the "instreamP.out" file
This is one chunk of code in one file
write (178,79) curyr,iida,jrch,flow,solpcon,dsolp,orgpcon,dorgp,
* epc,sedp_benthos(jrch),solp_benp_flux, orgp_benp_flux,
* solp_orgp_flux
!! end if
79 format(3i4,10f12.3)
The other chunk is
open (178,file="instreamP.out")
write (178,12224)
12224 format ('Year Day Rch flow solp-in solp-out orgp
-in orgp-out EPC benp solp_benp orgp_benp so
lp_orgp ')
Any recommendations?
On Tuesday, November 8, 2022 at 2:54:06 PM UTC-6, jfh wrote:in the actual program? What is format 78 and how were the things written with it declared and evaluated? We could possibly give useful help if provided with a minimal complete program, together with any error messages and warnings it gave at compile time
On Wednesday, November 9, 2022 at 7:28:39 AM UTC+13, sushan...@gmail.com wrote:
Hi All,
I am beginners in FORTRAN and dealing with huge FORTRAN project. I apologize in the beginning if my question sounded lame. Here is the issue
Blocks of Code where file was introduced and initiated. There are 300+ fortran files in the project. That's why using only a few blocks if thats helpful
open (178,file="instreamP.out")
write (178,12224)
12224 format ('Year Day Rch flow solp-in solp-out orgp
-in orgp-out EPC benp solp_benp orgp_benp so
lp_orgp ')
write (178,78) curyr,iida,jrch,flow,solpcon,dsolp,orgpcon,dorgp,
* epc,sedp_benthos(jrch),solp_benp_flux, orgp_benp_flux,
* solp_orgp_flux
The code executed successfully, and I ran the project, and my output file with name "instreamP.out is produced with headers, but there is no data in it.
I would appreciate any help in this matter. Also, I would appreciate any guidance on learning FORTRAN.
Thanks,Is the program in fixed or free source form? The * in the two last lines are valid only in fixed source form but the format statement makes me wonder. Are the ends of lines in what you posted (where format 12224 occupies 3 lines) at the ends of lines
Sushant
That's the problem. I am not getting any error messages. Apologies for my ignorance. I am not aware if the program is fixed or free. Since it is open source, so many people use it, and the convention changes from time to time. Unfortunately, there isno option here to link the *.f files else I Would have shared the program.
But I will try it now by being more detailed.
This is one chunk of code in one file
write (178,79) curyr,iida,jrch,flow,solpcon,dsolp,orgpcon,dorgp,
* epc,sedp_benthos(jrch),solp_benp_flux, orgp_benp_flux,
* solp_orgp_flux
!! end if
79 format(3i4,10f12.3)
The other chunk is
open (178,file="instreamP.out")
write (178,12224)
12224 format ('Year Day Rch flow solp-in solp-out orgp
-in orgp-out EPC benp solp_benp orgp_benp so
lp_orgp ')
These are the only two blocks where the code was called, and no other place it was mentioned. Note: I changed 78 to 79 because 78 was used in another file of the same project.
..
I am beginners in FORTRAN and dealing with huge FORTRAN project. I apologize in the beginning if my question sounded lame. Here is the issue
..
I would appreciate any help in this matter. Also, I would appreciate any guidance on learning FORTRAN.
On Tuesday, November 8, 2022 at 1:28:39 PM UTC-5, sushan...@gmail.com wrote:I appreciate the link to the sources. Thanks!
..
I am beginners in FORTRAN and dealing with huge FORTRAN project. I apologize in the beginning if my question sounded lame. Here is the issue
..
I would appreciate any help in this matter. Also, I would appreciate any guidance on learning FORTRAN.
Hello @sushan...@gmail.com,
You may also want to inquire at the relatively recent Fortran Discourse site where you can attach Fortran source code with your posts, provide links, include code snippets with syntax highlighting, etc.
https://fortran-lang.discourse.group/
Re: learning Fortran, please see this page at fortran-lang.org that provides links to a lot of resources:
https://fortran-lang.discourse.group/
On Tuesday, November 8, 2022 at 8:04:02 PM UTC-8, sushan...@gmail.com wrote:Hi Gah,
(snip)
That's the problem. I am not getting any error messages.*.f files usually mean fixed form.
Apologies for my ignorance. I am not aware if the program is fixed or free. Since it is open source, so many people use it, and the convention changes from time to time. Unfortunately, there is no option here to link the *.f files else
I Would have shared the program.
Statements have to start in column 7 (or more), with blanks or statement number before that. But posting software likes to remove blanks at
the beginning of lines.
But I will try it now by being more detailed(snip)
This is one chunk of code in one file
write (178,79) curyr,iida,jrch,flow,solpcon,dsolp,orgpcon,dorgp,
* epc,sedp_benthos(jrch),solp_benp_flux, orgp_benp_flux,
* solp_orgp_flux
!! end if
79 format(3i4,10f12.3)
These are the only two blocks where the code was called, and no other place it was mentioned. Note: I changed 78 to 79 because 78 was used in another file of the same project.Statement numbers only need to be unique within the same subroutine,
function or main program. In most cases, that is within one file.
I am sorry I want to be more detailed with my problemSeems to be some version of SWAT:
If this won't work, I will put my code on google drive and share the link.
https://swat.tamu.edu/software/archive/
If you say which one, we can download it from the original source.
Though it seems that they supply already compiled versions.
Sushant Mehan <sushan...@gmail.com> schrieb:
On Tuesday, November 8, 2022 at 4:24:50 PM UTC-6, gah4 wrote:
On Tuesday, November 8, 2022 at 10:28:39 AM UTC-8, sushan...@gmail.com wrote:
(snip)
write (178,78) curyr,iida,jrch,flow,solpcon,dsolp,orgpcon,dorgp,Without non-advancing I/O, which yours doesn't have, the least a Fortran WRITE
* epc,sedp_benthos(jrch),solp_benp_flux, orgp_benp_flux,
* solp_orgp_flux
The code executed successfully, and I ran the project, and my output file
with name "instreamP.out is produced with headers, but there is no data in it.
statement can write is a blank line.
As noted previously, showing the FORMAT statement number 78 would be nice. >>
But, most likely, your program isn't exectuting this WRITE statement.
Easy test is to put a
STOP 78
statement after the WRITE statement.
(The 78 is a reminder of where it stopped.)
That also guarantees that the output buffer is written out.
If the STOP 78 statement is not executed, you know it didn't get there.
Hi Gah,
I think you were right. 78 was called in another file of the project. I replaced my 78 with 79 and tried running the project. Again, no error while compiling but the application is still not writing data to the "instreamP.out" file
This is one chunk of code in one file
write (178,79) curyr,iida,jrch,flow,solpcon,dsolp,orgpcon,dorgp,
* epc,sedp_benthos(jrch),solp_benp_flux, orgp_benp_flux,
* solp_orgp_flux
!! end if
79 format(3i4,10f12.3)
The other chunk is
open (178,file="instreamP.out")
write (178,12224)
12224 format ('Year Day Rch flow solp-in solp-out orgp
-in orgp-out EPC benp solp_benp orgp_benp so
lp_orgp ')
Any recommendations?Which system and which compiler are you running?
Is file 178 already open? In this case, calling open just modifies
the existing connection (which can be confusing). What happens
if you put a close(178) in front of the open?
What happens if you put a
flush 178
after each write? There was a bug in a version of Darwin which
impacted gfortran so that it did not flush files at program end.
On Wednesday, November 9, 2022 at 3:04:02 PM UTC+11, sushan...@gmail.com wrote:lines in the actual program? What is format 78 and how were the things written with it declared and evaluated? We could possibly give useful help if provided with a minimal complete program, together with any error messages and warnings it gave at
On Tuesday, November 8, 2022 at 2:54:06 PM UTC-6, jfh wrote:
On Wednesday, November 9, 2022 at 7:28:39 AM UTC+13, sushan...@gmail.com wrote:
Hi All,
I am beginners in FORTRAN and dealing with huge FORTRAN project. I apologize in the beginning if my question sounded lame. Here is the issue
Blocks of Code where file was introduced and initiated. There are 300+ fortran files in the project. That's why using only a few blocks if thats helpful
open (178,file="instreamP.out")
write (178,12224)
12224 format ('Year Day Rch flow solp-in solp-out orgp
-in orgp-out EPC benp solp_benp orgp_benp so
lp_orgp ')
write (178,78) curyr,iida,jrch,flow,solpcon,dsolp,orgpcon,dorgp,
* epc,sedp_benthos(jrch),solp_benp_flux, orgp_benp_flux,
* solp_orgp_flux
The code executed successfully, and I ran the project, and my output file with name "instreamP.out is produced with headers, but there is no data in it.
I would appreciate any help in this matter. Also, I would appreciate any guidance on learning FORTRAN.
Thanks,Is the program in fixed or free source form? The * in the two last lines are valid only in fixed source form but the format statement makes me wonder. Are the ends of lines in what you posted (where format 12224 occupies 3 lines) at the ends of
Sushant
no option here to link the *.f files else I Would have shared the program.That's the problem. I am not getting any error messages. Apologies for my ignorance. I am not aware if the program is fixed or free. Since it is open source, so many people use it, and the convention changes from time to time. Unfortunately, there is
But I will try it now by being more detailed
This is one chunk of code in one file
write (178,79) curyr,iida,jrch,flow,solpcon,dsolp,orgpcon,dorgp,
* epc,sedp_benthos(jrch),solp_benp_flux, orgp_benp_flux,
* solp_orgp_flux
!! end if
79 format(3i4,10f12.3)
The other chunk is.
open (178,file="instreamP.out")
write (178,12224)
12224 format ('Year Day Rch flow solp-in solp-out orgp
-in orgp-out EPC benp solp_benp orgp_benp so
lp_orgp ')
These are the only two blocks where the code was called, and no other place it was mentioned. Note: I changed 78 to 79 because 78 was used in another file of the same project.
The OPEN statement must be executed before the WRITE (178 .. statement.
If it is not, the output will be written to another file, possibly called FOR178.
.
I suggested inserting a simple PRINT statement, just before the WRITE statement.
You need to do this, in order to find out whether the WRITE statement is being executed.
You may also want to inquire at the relatively recent Fortran
Discourse site where you can attach Fortran source code with
your posts, provide links, include code snippets with syntax
highlighting, etc.
https://fortran-lang.discourse.group/
"FortranFan" wrote in message
news:3f6ce8bd-d99c-4150...@googlegroups.com...
You may also want to inquire at the relatively recent FortranWhy are you always trying to move users of this group to
Discourse site where you can attach Fortran source code with
your posts, provide links, include code snippets with syntax
highlighting, etc.
https://fortran-lang.discourse.group/
that Fortran discourse group? ..
To me, the forum is overall disappointing.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 159 |
Nodes: | 16 (0 / 16) |
Uptime: | 100:04:10 |
Calls: | 3,209 |
Files: | 10,563 |
Messages: | 3,009,979 |