Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Equivalent of the C++ \n with fortran

$
0
0

I'm trying to read an ASCII file with MPI_FILE_READ. I found out that I need first of all to read the entire file and put it on a character string.

The problem is that I didn't found how to split this string on a lines because I don't know how to detect a new line in a character string with fortran.

In some way I'm searching the equivalent of this C++ code in Fortran :

nlines = 0;
for (int i=0; i<file_size;i++)
     if (data[i] == '\n') (*nlines)++;

 

Thanks,

Ines


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>