Changes between Initial Version and Version 2 of Ticket #183


Ignore:
Timestamp:
08/05/08 20:37:57 (16 years ago)
Author:
arango
Comment:

Yes, I also notice this one. This seems to be a compiler dependent problem. I found this problem when compiling with gfortran. I did the fix by redefining Npts as:

    Npts=Nfloats(1)+1

I will provably revise this in the future to

    Npts=MAXVAL(Nfloats)+1

for nested grid considerations. I have to think more about it. Thank you for reporting this problem. This issue was fixed in src:ticket:184

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #183

    • Property ResolutionFixed
    • Property Status newclosed
  • Ticket #183 – Description

    initial v2  
    1 The following addresses bounds-checking failures for the LAKE_SIGNELL case.
     1The following addresses bounds-checking failures for the '''LAKE_SIGNELL''' case.
    22
    3 Subroutine read_FloatsPar in ROMS/Utility/inp_par.F reads data from the floats parameter file into local, allocatable variables Fcoor, Fcount, Ftype, Ft0, Fx0, Fy0, Fz0, Fdt, Fdx, Fdy & Fdz. Data is then copied from these variables into the structure variable FLT(ng).
     3Subroutine read_FloatsPar in '''ROMS/Utility/inp_par.F''' reads data from the floats parameter file into local, allocatable variables '''Fcoor''', '''Fcount''', '''Ftype''', '''Ft0''', '''Fx0''', '''Fy0''', '''Fz0''', '''Fdt''', '''Fdx''', '''Fdy''' and '''Fdz'''. Data is then copied from these variables into the structure variable '''FLT(ng).'''
    44
    55The variables in question are allocated as follows (lines 7208-7218)
     
    1717            allocate ( Fdz(Npts,Ngrids) )
    1818}}}
    19 where Npts is equal to the maximum number of floats.
     19where '''Npts''' is equal to the maximum number of floats.
    2020
    2121In fact, the first dimension of these variables does not have to be large enough to accommodate the number of floats, but only to accommodate the number of entries in the floats data file. It is assumed, obviously, that the latter can be be greater than the former. This assumption is normally very conservative, ''except'' that it does not allow for the fact that when the entries in the floats file are read, one extra entry is always read to trigger the ERR= or END= condition in the READ statement.
    2222
    23 The floats data file for the LAKE_SIGNELL test case sets NFLOATS=4 and then has 4 entries sspecifying initial locations, with 1 float per entry. This cause the READ statement to be executed 5 times. If compiler bounds-checking is turned on, then the 5th time it is executed, there are out-of-bounds references to the arrays being read.
     23The floats data file for the '''LAKE_SIGNELL''' test case sets '''NFLOATS=4''' and then has 4 entries sspecifying initial locations, with 1 float per entry. This cause the READ statement to be executed 5 times. If compiler bounds-checking is turned on, then the 5th time it is executed, there are out-of-bounds references to the arrays being read.
    2424
    2525The solution is to increase the first dimension of these variables by 1: