• runtime error

    From Thando Mothogoane@21:1/5 to All on Mon Aug 1 05:14:17 2022
    Dear Fortran team,

    Can you please assist me with solving the error:

    compute-060:/idia/users/thando/magphys> ./make_zgrid
    0
    At line 64 of file make_zgrid.f
    Fortran runtime error: Index '0' of dimension 2 of array 'flux_obs' below lower bound of 1

    Error termination. Backtrace:
    #0 0x7f988749ad5a
    #1 0x7f988749b869
    #2 0x7f988749bee6
    #3 0x55d5dc7f7cb8
    #4 0x55d5dc7f8e1b
    #5 0x7f98871600b2
    #6 0x55d5dc7f718d
    #7 0xffffffffffffffff

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thomas Koenig@21:1/5 to Thando Mothogoane on Mon Aug 1 16:29:22 2022
    Thando Mothogoane <ramodubjane@gmail.com> schrieb:
    Dear Fortran team,

    Can you please assist me with solving the error:

    compute-060:/idia/users/thando/magphys> ./make_zgrid
    0
    At line 64 of file make_zgrid.f
    Fortran runtime error: Index '0' of dimension 2 of array 'flux_obs' below lower bound of 1

    The error message is quite informative.

    It's good that you compiled with bounds checking on. So, look at
    the line 64 of make_zgrid.f, check the second index of the array
    flux_obs and you will hopefully see where it is zero instead of 1
    (which is the default lower bound), so

    real :: flux_obj(10)

    will declare an array for which flux_obj(1) is the first and
    flux_obj(10) the last element. If you want indices ranging from
    0 to 9 instead, you can specify

    real :: flux_obj(0:9)

    Error termination. Backtrace:
    #0 0x7f988749ad5a
    #1 0x7f988749b869
    #2 0x7f988749bee6
    #3 0x55d5dc7f7cb8
    #4 0x55d5dc7f8e1b
    #5 0x7f98871600b2
    #6 0x55d5dc7f718d
    #7 0xffffffffffffffff

    That can be made a bit more informative (if necessary) by
    specifying -g as a compile option.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)