Fortran Outputting Bitmap Images in Fortran without Record Delimiters

  • Thread starter Thread starter drp85
  • Start date Start date
  • Tags Tags
    Fortran Images
AI Thread Summary
In Fortran, issues with outputting data as a bitmap image are often caused by unwanted record delimiters that appear with WRITE statements. Users are seeking ways to disable these delimiters for cleaner output. Additionally, compilation errors are being encountered, particularly related to variable declarations and type mismatches. Common errors include invalid declarations of symbols and warnings about argument precision discrepancies in subroutines. The importance of using "implicit none" in code is emphasized to avoid implicit type assignments and to catch potential mistakes early. This practice helps ensure that all variables are explicitly declared, reducing the likelihood of errors during compilation.
drp85
Messages
1
Reaction score
0
In Fortran I need to output some data as a bitmap image, to visualise results. Problem is, with every WRITE statement it seems to append some unwanted bytes before and after the data itself. I have found out that these are called record delimiters, but I want to turn these off. How?
 
Technology news on Phys.org
I have played with f95, and when I ran into trouble I used to post on a site http://www.tek-tips.com
Try there to see if you get any answers.
 
Hi Friends,
Im trying to compile a small fortran code, but it gives me the following error.
g77 -o rayinv_vel_modl rayinv_vel_modl.f
dimension.inc: In subroutine `outputv':
dimension.inc:5:
integer mnsg, mnsg1, mnsgf
1
dimension.inc:17: (continued):
& mnsgf=nomi*mnsg, mnsd1=mnsd+mnsgf)
2
Invalid declaration of or reference to symbol `mnsgf' at (2) [initially seen at (1)]
dimension.inc:17:
& mnsgf=nomi*mnsg, mnsd1=mnsd+mnsgf)
^
Invalid form for PARAMETER statement at (^)Can someone help me, what's wrong with the code?

Thanking you in anticipation

cheers
 
Hi friends;
I have some problems with my fortran programma.When I compile it, the above errors occur;
dms0.f: In subroutine `ftltow':
dms0.f:123: warning:
call ftltow(gl,gw,S,dtau,0,nmax)
1
dms0.f:828: (continued):
subroutine ftltow(gl,gw,maxl,dtau,bose,nmax)
2
Argument #2 (named `gw') of `ftltow' is one precision at (2) but is some other precision at (1) [info -f g77 M GLOBALS]
dms0.f:123: warning:
call ftltow(gl,gw,S,dtau,0,nmax)
1
dms0.f:828: (continued):
subroutine ftltow(gl,gw,maxl,dtau,bose,nmax)
2
Argument #3 (named `maxl') of `ftltow' is one type at (2) but is some other type at (1) [info -f g77 M GLOBALS]

What is reason of these errors?

Thanks
 
They are not errors, they are warnings...it says it right there.

Also it say they are in regards to precision. That means that you have one variables declared with, say, REAL*4 but then you pass it to a function or subroutine and the variable catching this quantity is declared inside the subroutine with, say, REAL*8

...something along those line

Hope it helps.
 
selmayda said:
Hi;

Again I have a problem.what is the meaning of above warning?
thanks for helps

dms0.f: In subroutine `ftltow':
dms0.f:123: warning:
call ftltow(gl,gw,S,dtau,0,nmax)
1
dms0.f:828: (continued):
subroutine ftltow(gl,gw,maxl,dtau,bose,nmax)
2
Argument #3 (named `maxl') of `ftltow' is one type at (2) but is some other type at (1) [info -f g77 M GLOBALS]

Your variable "S" is defined as a different type (or kind) than that of your variable "maxl". It may be that one or other of these has been left undefined and is using an implicit type.

BTW. If you're not already doing so, I strongly recommend that you add the line "implicit none" to all of your programs and subroutines.
 
Thanks for your help
 
uart said:
I strongly recommend that you add the line "implicit none" to all of your programs and subroutines.

I second that recommendation. Besides situations like this one, it will prevent problems caused by simply misspelling a variable name. Without "implicit none", this creates a new variable of some default type, without your knowing it.
 

Similar threads

Replies
29
Views
5K
Replies
16
Views
2K
Replies
6
Views
3K
Replies
3
Views
3K
Replies
21
Views
3K
Replies
4
Views
2K
Replies
1
Views
2K
Back
Top