<span style>Hi all !!</span><br style><br style><br style><span style>I have a simple code in fortran that reads a file, and outputs it as it is. I have two different versions of mpif90 in my system. When I compile the same program with the two different compilers and examine the output of the resulting two executables, they differ. This is just a toy program of course, actually I am using MPICH2 with PETSc/SLEPc, and I have the mpif90 that is configured with PETSc/SLEPc in  /home/shitij/Lib/MPI/</span><span style>mpich2-1.3.2/bin/. The problem is that this version of mpif90 is giving the wrong output. I am giving the -v outputs of both versions below:</span><br style>
<br style><span style>(this one is configured with PETSc/SLEPc and gives incorrect output)</span><br style><div style><font color="#660000"><i>shitij@shitij:~/JNCASR2012$ /home/shitij/Lib/MPI/mpich2-1.3.2/bin/mpif90 -v</i></font></div>
<div style><font color="#660000"><i>mpif90 for MPICH2 version 1.3.2</i></font></div><div style><font color="#660000"><i>Version 11.0 <br><br></i></font><div><i><span style="color:rgb(102,0,0)">shitij@shitij:~/JNCASR2012$</span><font color="#660000"> mpif90 -v</font></i></div>
<div><font color="#660000"><i>Using built-in specs.</i></font></div><div><font color="#660000"><i>COLLECT_GCC=/usr/bin/gfortran</i></font></div><div><font color="#660000"><i>COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/lto-wrapper</i></font></div>
<div><font color="#660000"><i>Target: x86_64-linux-gnu</i></font></div><div><font color="#660000"><i>Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.5.2-8ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.5 --enable-shared --enable-multiarch --with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/x86_64-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/x86_64-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu</i></font></div>
<div><font color="#660000"><i>Thread model: posix</i></font></div><div><font color="#660000"><i>gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)</i></font></div></div><div style><br></div><div style>The differences in the files I mentioned are varied (and weird), for example some lines are missing (always the same across different runs), some line is read half-way/incorrectly, for example a line:<br>
ATOM NE2  NR2    -0.70<br>is always read as<br>ATOM NE2      -0.70<br>for some reason.<br><br><b>This is the first time I am having a problem like this. Is this a problem with installation of MPICH2 ?</b></div><div style>
<br></div><span style>I am also giving the code below:</span><br style><br style><div style><i><font color="#006600">program exp4</font></i></div><div style><i><font color="#006600">implicit none</font></i></div><div style>
<i><font color="#006600"><br></font></i></div><div style><i><font color="#006600"><span style="white-space:pre-wrap"> </span>character(79)::line</font></i></div><div style><span style="white-space:pre-wrap"><i><font color="#006600">  </font></i></span></div>
<div style><i><font color="#006600"><span style="white-space:pre-wrap">     </span>open(unit=1,file='top_all27_prot_na_RTF.txt',action='read',ACCESS='STREAM',FORM='FORMATTED')</font></i></div><div style>
<i><font color="#006600"><br></font></i></div><div style><i><font color="#006600"><span style="white-space:pre-wrap"> </span>do</font></i></div><div style><i><font color="#006600"><span style="white-space:pre-wrap">   </span>read(1,'(a)',END=10)line   !! Read line as string</font></i></div>
<div style><i><font color="#006600"><span style="white-space:pre-wrap">     </span>write(*,*)line</font></i></div><div style><i><font color="#006600"><span style="white-space:pre-wrap">       </span>enddo</font></i></div><div style>
<i><font color="#006600"><span style="white-space:pre-wrap">      </span>10 write(*,*)'Done !!'</font></i></div><div style><span style="white-space:pre-wrap"><i><font color="#006600">               </font></i></span></div><div style>
<font><font color="#006600"><i>end program exp4</i></font><br><br>Thank you for your help in advance !!!</font></div>