Fortran runtime error: Index '12' of dimension 2 of array 'lbc' above upper bound of 11

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
Study_fish
Posts: 31
Joined: Thu Sep 21, 2023 2:52 pm
Location: Sun Yat-sen University

Fortran runtime error: Index '12' of dimension 2 of array 'lbc' above upper bound of 11

#1 Unread post by Study_fish »

Dear ROMS Experts,

I apologize for reaching out with multiple requests for assistance in a short period. However, I am troubled by an elusive error that I cannot comprehend, nor can I ascertain the conditions under which it occurs. While defining the WEC-related switches in my ROMS application, I generally experience smooth operations; however, I occasionally encounter perplexing errors:
--------------------------------------------------------------------------------
Model Input Parameters: ROMS/TOMS version 3.9
Saturday - November 2, 2024 - 8:19:01 PM
--------------------------------------------------------------------------------

current simulation in Fujian coastal area

Operating system : Linux
CPU/hardware : x86_64
Compiler system : gfortran
Compiler command : /mnt/sdc/littlemarcoleung/COAWST/LIBRARIES/mpich/bin/mpif90
Compiler flags : -frepack-arrays -g -fbounds-check -fbacktrace -fcheck=all -fsanitize=address -fsanitize=undefined -finit-real=nan -ffpe-trap=invalid,zero,overflow -g -fbounds-check -fbacktrace -finit-real=nan -ffpe-trap=invalid,zero,overflow -I/usr/include -
OCN Communicator : 1140850688, PET size = 4

Input Script :

SVN Root URL :
SVN Revision :

Local Root : /mnt/sdd/cy22/COAWST-master
Header Dir : /mnt/sdd/cy22/COAWST-master/Projects/N_20/
Header file : n_20.h
Analytical Dir : /mnt/sdd/cy22/COAWST-master//ROMS/Functionals

Resolution, Grid 01: 204x100x20, Parallel Nodes: 4, Tiling: 2x2
...
Lateral Boundary Conditions: NLM
============================

Variable Grid West Edge South Edge East Edge North Edge
--------- ---- ---------- ---------- ---------- ----------

zeta 1 Chapman Imp Chapman Imp Chapman Imp Closed

ubar 1 Flather Flather Flather Closed

vbar 1 Flather Flather Flather Closed

u 1 Rad + Nud Rad + Nud Rad + Nud Closed

v 1 Rad + Nud Rad + Nud Rad + Nud Closed

temp 1 Rad + Nud Rad + Nud Rad + Nud Closed

salt 1 Rad + Nud Rad + Nud Rad + Nud Closed

ubar_stokes 1

vbar_stokes 1 Gradient Gradient Gradient Closed

u_stokes 1 Gradient Gradient Gradient Closed

v_stokes 1 Rad + Nud Rad + Nud Rad + Nud Closed
...
TIME-STEP YYYY-MM-DD hh:mm:ss.ss KINETIC_ENRG POTEN_ENRG TOTAL_ENRG NET_VOLUME
C => (i,j,k) Cu Cv Cw Max Speed

0 2024-07-27 00:00:00.00 3.636007E-02 4.920164E+02 4.920528E+02 6.805730E+12
(152,022,15) 8.908654E-03 7.640659E-03 0.000000E+00 1.183086E+00
At line 259 of file vs3dbc_im.f90
Fortran runtime error: Index '12' of dimension 2 of array 'lbc' above upper bound of 11

Error termination. Backtrace:
At line 160 of file vs3dbc_im.f90
Fortran runtime error: Index '12' of dimension 2 of array 'lbc' above upper bound of 11

Error termination. Backtrace:
At line 259 of file vs3dbc_im.f90
Fortran runtime error: Index '12' of dimension 2 of array 'lbc' above upper bound of 11

Error termination. Backtrace:
At line 160 of file vs3dbc_im.f90
Fortran runtime error: Index '12' of dimension 2 of array 'lbc' above upper bound of 11

Error termination. Backtrace:
#0 0x14ed56df22ed in ???
#1 0x14ed56df2ed5 in ???
#2 0x14ed56df32a7 in ???
#0 0x1517d2d2a2ed in ???
#1 0x1517d2d2aed5 in ???
#2 0x1517d2d2b2a7 in ???
#3 0x557692d0bd9b in __vs3dbc_mod_MOD_vs3dbc_tile
at /mnt/sdd/cy22/COAWST-master/Build/vs3dbc_im.f90:259
#3 0x55f59835c25a in __vs3dbc_mod_MOD_vs3dbc_tile
at /mnt/sdd/cy22/COAWST-master/Build/vs3dbc_im.f90:160
#0 0x154923ed32ed in ???
#1 0x154923ed3ed5 in ???
#2 0x154923ed42a7 in ???
#0 0x14e0681a52ed in ???
#1 0x14e0681a5ed5 in ???
#2 0x14e0681a62a7 in ???
#4 0x557692c080a8 in wec_stokes_tile
at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:328
#5 0x557692c2125f in __wec_stokes_mod_MOD_wec_stokes
at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:79
#6 0x5576915e189c in main3d_
at /mnt/sdd/cy22/COAWST-master/Build/main3d.f90:193
#7 0x5576915d9879 in __ocean_control_mod_MOD_roms_run
at /mnt/sdd/cy22/COAWST-master/Build/ocean_control.f90:192
#8 0x5576915d6361 in ocean
at /mnt/sdd/cy22/COAWST-master/Build/master.f90:108
#9 0x5576915d6516 in main
at /mnt/sdd/cy22/COAWST-master/Build/master.f90:50
#4 0x55f59826a0a8 in wec_stokes_tile
at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:328
#5 0x55f59828325f in __wec_stokes_mod_MOD_wec_stokes
at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:79
#6 0x55f596c4389c in main3d_
at /mnt/sdd/cy22/COAWST-master/Build/main3d.f90:193
#7 0x55f596c3b879 in __ocean_control_mod_MOD_roms_run
at /mnt/sdd/cy22/COAWST-master/Build/ocean_control.f90:192
#8 0x55f596c38361 in ocean
at /mnt/sdd/cy22/COAWST-master/Build/master.f90:108
#9 0x55f596c38516 in main
at /mnt/sdd/cy22/COAWST-master/Build/master.f90:50
#3 0x556b04cbfd9b in __vs3dbc_mod_MOD_vs3dbc_tile
at /mnt/sdd/cy22/COAWST-master/Build/vs3dbc_im.f90:259
#3 0x55a9940ae25a in __vs3dbc_mod_MOD_vs3dbc_tile
at /mnt/sdd/cy22/COAWST-master/Build/vs3dbc_im.f90:160
#4 0x556b04bbc0a8 in wec_stokes_tile
at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:328
#5 0x556b04bd525f in __wec_stokes_mod_MOD_wec_stokes
at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:79
#6 0x556b0359589c in main3d_
at /mnt/sdd/cy22/COAWST-master/Build/main3d.f90:193
#7 0x556b0358d879 in __ocean_control_mod_MOD_roms_run
at /mnt/sdd/cy22/COAWST-master/Build/ocean_control.f90:192
#8 0x556b0358a361 in ocean
at /mnt/sdd/cy22/COAWST-master/Build/master.f90:108
#9 0x556b0358a516 in main
at /mnt/sdd/cy22/COAWST-master/Build/master.f90:50
#4 0x55a993fbc0a8 in wec_stokes_tile
at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:328
#5 0x55a993fd525f in __wec_stokes_mod_MOD_wec_stokes
at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:79
#6 0x55a99299589c in main3d_
at /mnt/sdd/cy22/COAWST-master/Build/main3d.f90:193
#7 0x55a99298d879 in __ocean_control_mod_MOD_roms_run
at /mnt/sdd/cy22/COAWST-master/Build/ocean_control.f90:192
#8 0x55a99298a361 in ocean
at /mnt/sdd/cy22/COAWST-master/Build/master.f90:108
#9 0x55a99298a516 in main
at /mnt/sdd/cy22/COAWST-master/Build/master.f90:50
Although I am not well-versed in Fortran, I have reviewed the files vs3dbc_im.f90, lbc.F, and other relevant documents but have not identified any obvious issues. I have attached the log from a successful run (roms_wave_N10.log) and the log from the problematic run (roms_wave_N20.log) for your reference. The grid configurations, boundary conditions, forcing fields, and .in file settings for both model runs are nearly identical. I am puzzled as to why such an unusual error has arisen.

I previously reported this issue on the COAWST GitHub page (https://github.com/DOI-USGS/COAWST/issues/279), but I have not received any responses thus far. I would greatly appreciate any insights or suggestions you may have.

Thank you for your assistance.
Attachments
n_20.in
(145.43 KiB) Downloaded 4 times
n_10.in
(145.47 KiB) Downloaded 4 times
roms_wave_N10.log
(987.98 KiB) Downloaded 5 times
roms_wave_N20.log
(62.7 KiB) Downloaded 4 times

User avatar
arango
Site Admin
Posts: 1367
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: Fortran runtime error: Index '12' of dimension 2 of array 'lbc' above upper bound of 11

#2 Unread post by arango »

What version of ROMS are you using? You can compare the logic of LBC allocation value in the latest https://github.com/myroms/roms develop branch.

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Fortran runtime error: Index '12' of dimension 2 of array 'lbc' above upper bound of 11

#3 Unread post by jcwarner »

ok. i see your earlier post on the coawst forum.
I see that you are running ROMS with WEC on, but you are not coupled to a wave model. You must be reading in a netcdf forcing file with the wave info?
I have not run that type of application in a long time. The waves are difficult to prescribe in a coastal setting so we always run a wave model coupled to ROMS.
I will try to figure this out soon, but it will be awhile.
Why can't you just couple to SWAN and use those waves?

Study_fish
Posts: 31
Joined: Thu Sep 21, 2023 2:52 pm
Location: Sun Yat-sen University

Re: Fortran runtime error: Index '12' of dimension 2 of array 'lbc' above upper bound of 11

#4 Unread post by Study_fish »

What version of ROMS are you using? You can compare the logic of LBC allocation value in the latest https://github.com/myroms/roms develop branch.
My ROMS version is 3.9. Thanks for your advice. I'll take a check.

Study_fish
Posts: 31
Joined: Thu Sep 21, 2023 2:52 pm
Location: Sun Yat-sen University

Re: Fortran runtime error: Index '12' of dimension 2 of array 'lbc' above upper bound of 11

#5 Unread post by Study_fish »

ok. i see your earlier post on the coawst forum.
I see that you are running ROMS with WEC on, but you are not coupled to a wave model. You must be reading in a netcdf forcing file with the wave info?
I have not run that type of application in a long time. The waves are difficult to prescribe in a coastal setting so we always run a wave model coupled to ROMS.
I will try to figure this out soon, but it will be awhile.
Why can't you just couple to SWAN and use those waves?
Thanks for your reply warner! I did try to read the wave info from the nc forcing file instead of coupling it to the wave model. A superficial reason is that I am more concerned with the wave effect on current than wave-current interaction.

lfparejar
Posts: 16
Joined: Sat Oct 05, 2013 5:21 am
Location: Rutgers University

Re: Fortran runtime error: Index '12' of dimension 2 of array 'lbc' above upper bound of 11

#6 Unread post by lfparejar »

Wave-current interaction and wave effect on currents are the same concept. You are trying to use WEC_VF with wave forcing variables, which is essentially what SWAN will provide in a streamlined way. Coupling with SWAN may sound daunting but it's actually more straightforward for wind generated waves than what you are trying to accomplish.

There are matlab functions in the source code folder that use a ROMS grid file and turn it into SWAN grid and bathymetry files. Then you would need a swan input file and use some of the coupled test cases to guide you.

You can activate or deactivate water elevation or current feedbacks into SWAN and customize your CPP options if you want WEC_VF, SSW_BBL, SSW_CALC_UB or not, and so on. You can decide how much wave effect on currents you want to compute.

Post Reply