Optimization not working for Plasim

Hi,

some people want to use the following modell called PLASIM :
http://www.mi.uni-hamburg.de/Planet-Simulator.216.0.html

The code can only be compiled disabling -fast. Also It’s not possible
to use -O or any other kind of optimization. Then all results will be
NaN.
The intel compiler does not show this behavior.

Any idea ?
Everything is installed on a AMD64 running SuSE SLES 9.
Tested pgi 6.1.6 and 7.0-7.

Bye, Peer

Hi Peer,

Can you walk me through the steps you did to get the failures?

I downloaded “Most15.tgz” from the link you posted and used the “configure.sh” script to build “most.x”. Since this script is setup for 32-bits, I used the 7.0-6 32-bit compilers. PUMA seemed ok, at least it gave me several nice graphs. plasim did fail (below) but did so even with “-O0” so I think I’m not doing something correctly or missing a data file.

surfmod version: 26.02.2002 by larry

 &SURFPAR
 NSURF =            1,
 NOROMAX =           21,
 OROSCALE =    1.000000
 /
 *** Error while reading {doro} ***
  • Mat

Hi,

the error is caused by an error within the fseek call.
the following prog. shows the problem. When the pointer
is at the end of the file fseek causes an error and this
is also the problem when you try to compile the src.

bye, Peer

program fseek_test

integer :: i

open(35,file=‘surface.txt’,form=‘formatted’)
do
read (35,‘(1X)’,IOSTAT=iostat)
if (iostat /= 0) exit
enddo
write(,) ‘File at the end’
call fseek(35,0,0)
read(35,‘(I10)’) i
close(35)

end
taiga:/Net/Groups/SNWG/BTM/srichter/scratch # head -2 fseek_test/surface.txt
169 0 990100 -1 64 32 0 0
0.271150E+030.271150E+030.271150E+030.271150E+030.271150E+030.271150E+030.271150E+030.271150E+03

Hi Peer,

Sorry for the late reply.

Using fseek in this context wont work since fseek bypasses the normal F90 IO and operates directly on the file pointer. Instead, you should use the Fortran REWIND and/or BACKSPACE intrinsics.

Example:

% cat fseek.f90
program fseek_test

integer :: i

open(35,file='surface.txt',form='formatted')
do
read (35,'(1X)',IOSTAT=iostat)
if (iostat /= 0) exit
enddo
write(*,*) 'File at the end'
!call fseek(35,0,0)
REWIND(35)
read(35,'(I10)') i
close(35)
print *, i

end

Back to the original issue. After I modified the plasim makefile to use “fileseek.f90” instead of “fseek.f90”, I was able to build and run the code. However, I get the same output with “-O0” and “-fast” so still need some guidance on how to recreate your error.

Thanks,
Mat