Compiling TurbSim under Linux

Good day everyone,
I am trying to compile TurbSim under Linux using g95 compiler.
At first I was getting an error message saying that my compiler needs 8 random seed instead of two. Taking this post [url]http://forums.nrel.gov/t/compiling-fast-under-linux-with-gfortran/421/6] as a reference I finally fixed this error.
Currently the error message I get is:

At line 7167 of file ./AllSource/TSsubs.f90 (unit = 16, file = ‘TurbSim.wnd’)
Fortran runtime error: I/O past end of record on unformatted file

Corresponding line is the write statement of the heading of binary BS file:

[code]IF ( WrBLFF ) THEN

  CALL WrScr ( ' Generating BLADED binary time-series file "'//TRIM( RootName )//'.wnd"' )



           ! Put header information into the binary data file.



  WRITE (UBFFW)   INT(  -99          , B2Ki )               ! -99 = New Bladed format

  WRITE (UBFFW)   INT(    4          , B2Ki )               ! 4 = improved von karman (but needed for next 7 inputs)

  WRITE (UBFFW)   INT(    3          , B8Ki )               ! 3 = number of wind components   <======== This is line 7167***********************************************************
  WRITE (UBFFW)  REAL( Latitude      , SiKi )               ! Latitude (degrees)

  WRITE (UBFFW)  REAL(   z0          , SiKi )               ! Roughness length (m)

  WRITE (UBFFW)  REAL( Ztmp          , SiKi )               ! Reference Height (m) ( Z(1) + GridHeight / 2.0 )

  WRITE (UBFFW)  REAL( 100.0*TI(1)   , SiKi )               ! Longitudinal turbulence intensity (%)

  WRITE (UBFFW)  REAL( 100.0*TI(2)   , SiKi )               ! Lateral turbulence intensity (%)

  WRITE (UBFFW)  REAL( 100.0*TI(3)   , SiKi )               ! Vertical turbulence intensity (%)



  WRITE (UBFFW)  REAL( GridRes_Z     , SiKi )               ! grid spacing in vertical direction, in m

  WRITE (UBFFW)  REAL( GridRes_Y     , SiKi )               ! grid spacing in lateral direction, in m

  WRITE (UBFFW)  REAL( TimeStep*UHub , SiKi )               ! grid spacing in longitudinal direciton, in m[/code]

Any help is highly appreciated.
Thank you
Alexandra

Hi Alexandra,

Which version of the NWTC Subroutine Library are you using?

My guess is that the NWTC Library’s OpenBinFile() subroutine is reason for the error you mention. Try to use the subroutine from SysGnu.f90 in the latest alpha version (v1.04.00c-mlb); it doesn’t read/write record block control words.

Thank you Bonnie,
Recompiling TurbSim and FAST using latest version of NWTC library eliminated my problem.

Unfortunately, running time for TurbSim under Linux is double the CPU time elapsed on Windows machine (comparable specifications if not better).
I did include optimization flag (-O3 -march=k8) in my makefile and it did make a slight improvement in the run time but I was wondering if there is something else I could do to decrease the running time of TurbSim. Is this a known issue? Lengthy run time really surprised me.
Any help and suggestions would be highly appreciated.
Thank you
Alexandra

Hi Alexandra,

I have not compiled TurbSim under Linux, so I don’t know if I can really help. I have heard others complain that FAST runs much slower when it’s compiled using some of the free compilers, so it could just be that the compiler does not optimize as well as comercial compilers. (I am not sure what you are using on Windows.)

The biggest time is spent doing the Cholesky factorization in TurbSim. That is done using LAPACK routines–it is possible you could replace the LAPACK routines with something optimized for your machine.