Compiling FAST under Linux with gfortran

Felix,

We have found that Fortran’s intrinsic random number generator, RANDOM_SEED, does not have a standard number of seeds. HydroDyn assumes 2 seeds works to initialize it, but it looks like your compiler needs 8. Here is some code you can put in place of the line that is giving you an error.

[code]!bjj: gfortran needs 8 or 12 seeds, not just 2…
!bjj start of proposed change v1.00.00a-bjj
!rm CALL RANDOM_SEED ( PUT=WaveSeed(1:2) )
CALL RANDOM_SEED ( SIZE = nSeeds )

  IF ( nSeeds /= 2 ) THEN
     CALL ProgWarn( ' The random number generator in use differs from the original code provided by NREL. This pRNG uses ' &
                              //TRIM(Int2LStr(nSeeds))//' seeds instead of the 2 in the HydroDyn input file.')
  END IF

  ALLOCATE ( TmpWaveSeeds ( nSeeds ), STAT=Sttus)
  IF (Sttus/= 0 ) THEN
     CALL ProgAbort( ' Error allocating space for TmpWaveSeeds array.' )
     RETURN
  END IF   

     ! We'll just populate this with odd seeds = Seed(1) and even seeds = Seed(2)
  DO I = 1,nSeeds,2
     TmpWaveSeeds(I) = WaveSeed(1)
  END DO
  DO I = 2,nSeeds,2
     TmpWaveSeeds(I) = WaveSeed(2)
  END DO
                 
              
  CALL RANDOM_SEED ( PUT=TmpWaveSeeds )
  DEALLOCATE(TmpWaveSeeds, STAT=Sttus)
  IF (Sttus/= 0 ) THEN
     CALL ProgWarn( ' Error deallocating space for TmpWaveSeeds array.' )
  END IF                            

!bjj end of proposed change [/code]

It requires that you declare these variables at the top of SUBROUTINE InitWaves(), too:

!bjj start of proposed change v1.00.00a-bjj INTEGER :: nSeeds ! number of seeds required to initialize the intrinsic random number generator INTEGER, ALLOCATABLE :: TmpWaveSeeds (:) ! A temporary array used for portability. IVF/CVF use a random number generator initialized with 2 seeds; other platforms can use different implementations (e.g. gfortran needs 8 or 12 seeds) !bjj end of proposed change