an error regarding array bounds, "TINTRP"

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
d.kobashi
Posts: 69
Joined: Tue Sep 28, 2010 11:59 pm
Location: Texas A&M University

an error regarding array bounds, "TINTRP"

#1 Unread post by d.kobashi »

Dear all,

I am having a problem running ROMS for internal wave modelling.
Compiling the ROMS code went well. But when I run ROMS, I've got the following error (x 12 times as I use 12 cores I think).
At line 73 of file set_ngfld.f90
Fortran runtime error: Array reference out of bounds for array 'tintrp', lower bound of dimension 1 exceeded (0 < 1)
I understand TINTRP is used for time interpolation and is called in set_ngfld.F, set_2dfld.F and set_3dfld.F(as far as I checked by using 'grep'). The lines which caused the error are from the following lines in set_ngfld.F.

Code: Select all

#if defined CRAY || defined SGI
      fac1=ANINT(Tintrp(it2,ifield,ng)-time(ng))
      fac2=ANINT(time(ng)-Tintrp(it1,ifield,ng))
#else
      fac1=ANINT(Tintrp(it2,ifield,ng)-time(ng),r8)
      fac2=ANINT(time(ng)-Tintrp(it1,ifield,ng),r8)
#endif
A strange thing is that this error did not occur when I run ROMS3.5, but occurred when I run ROMS3.4 with the same input data (Note: the code of this version has been modified by my colleague including additional mixing schemes).

I checked the time sequence for all files (initial, boundary netcdf) and it looks ok to me. I created initial and boundary netcdf files from a climatology netcdf file. Tidal forcing is based on OSU inverse tidal model with some modifications. No winds.
Initial netcdf file
ocean_time = 22032000 ; !sec

Boundary netcdf file (created from climatology netcdf file)
bry_time = 15, 45, 75, 105, 135, 165, 195, 225, 255, 285, 315, 345 ; !days

ocean.in
DSTART = 255.0d0 ! days
TIME_REF = 20090101.0d0 ! yyyymmdd.dd
I wonder if someone could point out what possibly went wrong and how to check the problem.
I had this error for Intel Fortran(11.1) as well as Gnu Fortran (gfortran). No difference between MPI run and non-MPI run (the same error).


I also would like to know how TINTRP is used for ROMS.
TINTRP is set in mod_ncparam.F as zeros array and does not seem to be called by any files before set_ngfld.F.

In mod_ncparam.F

Code: Select all

real(r8) :: Tintrp(2,NV,Ngrids)
       .
       .
!
!  Initialize IO information variables.
!
        DO ng=1,Ngrids
          DO i=1,NV
                 .
                 .
             Tintrp(1,i,ng)=0.0_r8
             Tintrp(2,i,ng)=0.0_r8
                 .
                 .
          END DO
        END DO
So values of TINTRP called in the variables, fac1 and fac2 in set_ngfld.F are simply zeros, aren't they?
Not sure if I understand correctly.

Any comments/input would be appreciated.

Thanks in advance.

Regards,

DJ

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: an error regarding array bounds, "TINTRP"

#2 Unread post by kate »

For your problem at hand, it seems that it1 and it2 are not set to 1 and 2, respectively (or vice versa). Perhaps you can find out what value gets into Tindex just above those lines.

Tintrp is use to interpolate the time from a value behind the current model time and a value ahead in time.

Post Reply