# Forrtl: severe (408): fort: (11): Subscript #3 of the array XT has value 0 which is less than the lower bound of 1

**URL:** <https://fortran-lang.discourse.group/t/forrtl-severe-408-fort-11-subscript-3-of-the-array-xt-has-value-0-which-is-less-than-the-lower-bound-of-1/7003>\
**Category:** Visual Studio Code\
**Created:** [December 17, 2023, 12:36pm UTC](https://fortran-lang.discourse.group/t/forrtl-severe-408-fort-11-subscript-3-of-the-array-xt-has-value-0-which-is-less-than-the-lower-bound-of-1/7003 "2023-12-17T12:36:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hamza](https://avatars.discourse-cdn.com/v4/letter/h/a88e57/32.png) [@hamza](https://fortran-lang.discourse.group/u/hamza)\
**Post date:** [December 17, 2023, 12:36pm UTC](https://fortran-lang.discourse.group/t/forrtl-severe-408-fort-11-subscript-3-of-the-array-xt-has-value-0-which-is-less-than-the-lower-bound-of-1/7003/1 "2023-12-17T12:36:04Z")

</div>

I’m running a Fortran visual studio 2022 console application and the Fortran code crashes with “A breakpoint instruction (\_\_debugbreak() statement or a similar call) was executed” and when I press continue it gives me " forrtl: severe (408): fort: (11): Subscript #3 of the array XT has value 0 which is less than the lower bound of 1 ", when I back to the breakpoint I didn’t see in value 0  
I don’t know where is the problem here ?

 ![f1](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/0/06dc5070fb355724dbb9efb50f07702f521feecb.png)

---

<div class="post-metadata">

**Author:** ![mecej4](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/mecej4/32/855_2.png) [@mecej4](https://fortran-lang.discourse.group/u/mecej4)\
**Post date:** [December 17, 2023, 12:49pm UTC](https://fortran-lang.discourse.group/t/forrtl-severe-408-fort-11-subscript-3-of-the-array-xt-has-value-0-which-is-less-than-the-lower-bound-of-1/7003/2 "2023-12-17T12:49:00Z")

</div>

When kk = 1, the third subscript in the expression `xt(1, nj, kk-1)` has the value 0, which is less than the lower bound of 1 (I am guessing that the default lower bound of 1 applies, since you did not show the declaration of xt). When the breakpoint on the line has been hit, note the value of kk. Is it equal to 1 then?

Lines of code, when relevant, are more useful than screen shots.

---

<div class="post-metadata">

**Author:** ![hamza](https://avatars.discourse-cdn.com/v4/letter/h/a88e57/32.png) [@hamza](https://fortran-lang.discourse.group/u/hamza)\
**Post date:** [December 17, 2023, 3:21pm UTC](https://fortran-lang.discourse.group/t/forrtl-severe-408-fort-11-subscript-3-of-the-array-xt-has-value-0-which-is-less-than-the-lower-bound-of-1/7003/3 "2023-12-17T15:21:48Z")

</div>

c May have a problem with Rint if the difference between  
c cur and curold becomes too small. However, the bounds  
c from curlow and curhigh should still give valid answers.  
Rint=-(vv-vvold)/(cur-curold)+RG ! internal resistance  
OCP=vv+(Rint-RG)_cur  
curmax=OCP/Rint/2.d0 ! estimate of current at max power  
pwrmax=OCP\*\*2/Rint/4.d0 ! estimate of max power  
if(Lcount.eq.2) curhigh=2.d0_curmax  
endif  
curold=cur

```
  cur=cur-1.d0
  if(Lcount.gt.1) then
  if(curmax.gt.1.2d0*cur) curmax=1.2d0*cur
  cur=curmax
  if(cur.lt.curlow .or. cur.gt.curhigh) cur=0.5d0*(curlow+curhigh)
  endif
  if(Lcount.lt.18 .and. dabs(cur-curold).gt.1.d-5*dabs(cur)) go to 3
  if(Lcount.lt.5) go to 3
  cur=curold
  endif

  if ((xx(1,nj)/xt(1,nj,kk-1)).lt.0.75d0.and.xx(1,nj).lt.100.0d0)
 1rr=rr/2.0d0

```
