Fortran Runtime Error - Already allocated array 'frc'

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
robjenkinsiii
Posts: 34
Joined: Tue Jan 22, 2013 5:28 pm
Location: University of Delaware

Fortran Runtime Error - Already allocated array 'frc'

#1 Unread post by robjenkinsiii »

Hi All,

I'm attempting to set up and run a realistic application of my own using the most recent version of ROMS. I have all of the necessary netcdf files for grid and forcing (tide, winds & river discharge). The build goes smoothly but upon running I receive the following error:

Code: Select all

 Model Input Parameters:  ROMS/TOMS version 3.7
                          Wednesday - October 2, 2013 - 11:31:11 AM
 -----------------------------------------------------------------------------
At line 1067 of file read_phypar.f90
Fortran runtime error: Attempting to allocate already allocated array 'frc'
Looking to read_phypar.f90, around line 1067, I find the following, 'relevant' block of code in the midst of an extensive CASE selection block.

Code: Select all

            CASE ('NFFILES')
              Npts=load_i(Nval, Rval, Ngrids, nFfiles)
              DO ng=1,Ngrids
                IF (nFfiles(ng).le.0) THEN
                  IF (Master) WRITE (out,260) 'NFFILES', nFfiles(ng),   &
     &              'Must be equal or greater than one.'
                  exit_flag=4
                  RETURN
                END IF
              END DO
              mFfiles=MAXVAL(nFfiles)
              allocate ( FRC(mFfiles,Ngrids) )
              allocate ( FRCids(mFfiles,Ngrids) )
              allocate ( Ncount(mFfiles,Ngrids) )
              FRCids(1:mFfiles,1:Ngrids)=-1
              Ncount(1:mFfiles,1:Ngrids)=0
            CASE ('FRCNAME')
              label='FRC - forcing fields'
              Npts=load_s2d(Nval, Cval, line, label, ifile, igrid,      &
     &                      Ncount, mFfiles, FRC)
Clearly, in the block is a line which allocates the size of an array 'FRC' which is a NFFILES x NGRIDS array.
I have 3 forcing files and NFFILES set equal to 3 in my ocean*.in.

I cannot, for the life of me, figure out why this array is being re-allocated. Searching through the scripts in the same scratch directory shows no other place were the array 'FRC' is allocated. A search of the forum reveals no other identical problems.
I'll soon go about trying different compilers, because nothing about the set up of my application seems to be amiss.

Any ideas on where to look next?

Any advice is appreciated, as always.

robjenkinsiii
Posts: 34
Joined: Tue Jan 22, 2013 5:28 pm
Location: University of Delaware

Re: Fortran Runtime Error - Already allocated array 'frc'

#2 Unread post by robjenkinsiii »

After much trial and error, The error disappeared once I swapped the gfortran compiler in favor of pgi.
Although, I have no idea why.

Post Reply