DOI-USGS / COAWST

COAWST modeling system git repository
Other
100 stars 48 forks source link

Lateral boundary condition display error #279

Open MobJerry opened 4 days ago

MobJerry commented 4 days ago

I'm not sure if I should discuss the issue here, because it seems more like a problem about ROMS. But there are a few details about the COAWST WEC_VF module enablement that I think Warner is probably more familiar with, so I took the liberty of bringing up here:

In my early research, I wanted to explore the effects of wave effect on current by feeding wave data directly into the ROMS rather than running wave models coupled to ocean models. My CPP is defined as follows:

#define ROMS_MODEL
#define NESTING

#define UV_ADV
#define CURVGRID
#define UV_COR
#define UV_LOGDRAG
#define LIMIT_BSTRESS
#define UV_VIS2
#define TS_U3HADVECTION
#define TS_C4VADVECTION
#define SALINITY
#define TS_DIF2

#define NONLIN_EOS
#define BULK_FLUXES
#define EMINUSP
#define ATM_PRESS
#define SOLAR_SOURCE

#define DIAGNOSTICS_TS
#define DIAGNOSTICS_UV

#define SOLVE3D
#define SPLINES_VVISC
#define SPLINES_VDIFF
#define MASKING
#define SPHERICAL
#define DEBUGGING
#define MIX_GEO_UV
#define MIX_GEO_TS

#define LMD_MIXING
#define LMD_SKPP
#define LMD_BKPP
#define LMD_NONLOCAL
#define LMD_SHAPIRO
#define RI_SPLINES

#define WEC_VF
#define WET_DRY
#define WDISS_THORGUZA

#define HDF5

After some debugging, the case ran successfully, but I ran into a strange problem: the ubar_stokes LBCs showed a bunch of garbled code in log file, but the rest of the Wec boundary conditions were fine. But because the run was OK, I didn't pay much attention to it at the time.

Recently I read Kumar et al(2012) "Implementation of the vortex force formalism in the coupled ocean-atmosphere-wave-sediment transport (COAWST) modeling system for inner shelf and surf zone applications ",I am more concerned about the contribution of wave induced non-conservative effects in my example. Therefore, I redefine my .h file as:

#define ROMS_MODEL
#define NESTING

#define UV_ADV
#define CURVGRID
#define UV_COR
#define UV_LOGDRAG
#define LIMIT_BSTRESS
#define UV_VIS2
#define TS_U3HADVECTION
#define TS_C4VADVECTION
#define SALINITY
#define TS_DIF2

#define NONLIN_EOS
#define BULK_FLUXES
#define EMINUSP
#define ATM_PRESS
#define SOLAR_SOURCE

#define DIAGNOSTICS_TS
#define DIAGNOSTICS_UV

#define SOLVE3D
#define SPLINES_VVISC
#define SPLINES_VDIFF
#define MASKING
#define SPHERICAL
#define DEBUGGING
#define MIX_GEO_UV
#define MIX_GEO_TS

#define LMD_MIXING
#define LMD_SKPP
#define LMD_BKPP
#define LMD_NONLOCAL
#define LMD_SHAPIRO
#define RI_SPLINES

#define WEC_VF
#define WET_DRY
#define WDISS_THORGUZA
#define WEC_BREAKING
#define WEC_ROLLER
#define WEC_WCAP
#define BOTTOM_STREAMING
#ifdef BOTTOM_STREAMING
# define BOTTOM_STREAMING_YU
#endif #define SURFACE_STREAMING
#define HDF5

It compiles successfully, but there are problems at runtime. After I enable USER_DEBUG and output log files:

--------------------------------------------------------------------------------
 Model Input Parameters:  ROMS/TOMS version 3.9
                          Thursday - July 4, 2024 -  3:41:14 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 = 16

 Input Script      :

 SVN Root URL     :
 SVN Revision     :

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

 Resolution, Grid 01: 285x214x40,  Parallel Nodes: 16,  Tiling: 4x4

 Physical Parameters, Grid: 01
 =============================

       9600  ntimes            Number of timesteps for 3-D equations.
     90.000  dt                Timestep size (s) for 3-D equations.

......

 Lateral Boundary Conditions: NLM
 ============================

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

 zeta                     1   Chapman Imp  Chapman Imp  Chapman Imp  Chapman Imp
                          2   Nested       Nested       Nested       Nested

 ubar                     1   Shchepetkin  Shchepetkin  Shchepetkin  Shchepetkin
                          2   Nested       Nested       Nested       Nested

 vbar                     1   Shchepetkin  Shchepetkin  Shchepetkin  Shchepetkin
                          2   Nested       Nested       Nested       Nested

 u                        1   Rad + Nud    Rad + Nud    Rad + Nud    Rad + Nud
                          2   Nested       Nested       Nested       Nested

 v                        1   Rad + Nud    Rad + Nud    Rad + Nud    Rad + Nud
                          2   Nested       Nested       Nested       Nested

 temp                     1   Rad + Nud    Rad + Nud    Rad + Nud    Rad + Nud
                          2   Nested       Nested       Nested       Nested

 salt                     1   Rad + Nud    Rad + Nud    Rad + Nud    Rad + Nud
                          2   Nested       Nested       Nested       Nested

 ubar_stokes              1   �����������  �����������  �����������  �����������
                          2   �����������  �����������  �����������  �����������

 vbar_stokes              1   Gradient     Gradient     Gradient     Gradient
                          2   Nested       Nested       Nested       Nested

 u_stokes                 1   Gradient     Gradient     Gradient     Gradient
                          2   Nested       Nested       Nested       Nested

 v_stokes                 1   Gradient     Gradient     Gradient     Gradient
                          2   Nested       Nested       Nested       Nested

......

                   (Min =  1.43797231E+00 Max =  3.16076145E+01)
    GET_3DFLD   - salinity climatology,                            2024-07-21 03:00:00.00
                   (Grid=01, Rec=2, Index=2, File: 20230720000000_20230730000000_clm.nc)
                   (Tmin=     739087.0000 Tmax=     739097.0000)      t =     739087.1250
                   (Min =  2.48530331E+01 Max =  3.48742752E+01)

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

         0 2024-07-21 00:00:00.00  1.262584E-02  1.476683E+04  1.476685E+04  2.880806E+14  01
                     (235,037,39)  3.250710E-02  3.102869E-02  0.000000E+00  1.533661E+00
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 467 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 467 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 357 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 357 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 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 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  0x1515b14b02ed in ???
#1  0x1515b14b0ed5 in ???
#2  0x1515b14b12a7 in ???
#0  0x152cafbed2ed in ???
#1  0x152cafbeded5 in ???
#2  0x152cafbee2a7 in ???
#3  0x559bac4cb5c8 in __vs3dbc_mod_MOD_vs3dbc_tile
        at /mnt/sdd/cy22/COAWST-master/Build/vs3dbc_im.f90:160
#0  0x14f85c0c02ed in ???
#1  0x14f85c0c0ed5 in ???
#2  0x14f85c0c12a7 in ???
#3  0x559a885876b3 in __vs3dbc_mod_MOD_vs3dbc_tile
        at /mnt/sdd/cy22/COAWST-master/Build/vs3dbc_im.f90:467
#4  0x559bac3e2e98 in wec_stokes_tile
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:328
#5  0x559bac3fc04f in __wec_stokes_mod_MOD_wec_stokes
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:79
#0  0x1455f0b872ed in ???
#1  0x1455f0b87ed5 in ???
#2  0x1455f0b882a7 in ???
#6  0x559baace6ec9 in main3d_
        at /mnt/sdd/cy22/COAWST-master/Build/main3d.f90:203
#7  0x559baacde539 in __ocean_control_mod_MOD_roms_run
        at /mnt/sdd/cy22/COAWST-master/Build/ocean_control.f90:192
#8  0x559baacdb021 in ocean
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:108
#9  0x559baacdb1d6 in main
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:50
#4  0x559a88466e98 in wec_stokes_tile
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:328
#5  0x559a8848004f in __wec_stokes_mod_MOD_wec_stokes
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:79
#6  0x559a86d6aec9 in main3d_
        at /mnt/sdd/cy22/COAWST-master/Build/main3d.f90:203
#7  0x559a86d62539 in __ocean_control_mod_MOD_roms_run
        at /mnt/sdd/cy22/COAWST-master/Build/ocean_control.f90:192
#8  0x559a86d5f021 in ocean
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:108
#9  0x559a86d5f1d6 in main
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:50
#3  0x55aa772f25c8 in __vs3dbc_mod_MOD_vs3dbc_tile
        at /mnt/sdd/cy22/COAWST-master/Build/vs3dbc_im.f90:160
#3  0x55732a1e26b3 in __vs3dbc_mod_MOD_vs3dbc_tile
        at /mnt/sdd/cy22/COAWST-master/Build/vs3dbc_im.f90:467
#4  0x55aa77209e98 in wec_stokes_tile
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:328
#5  0x55aa7722304f in __wec_stokes_mod_MOD_wec_stokes
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:79
#0  0x15312415d2ed in ???
#1  0x15312415ded5 in ???
#2  0x15312415e2a7 in ???
#0  0x14a43acf22ed in ???
#1  0x14a43acf2ed5 in ???
#2  0x14a43acf32a7 in ???
#6  0x55aa75b0dec9 in main3d_
        at /mnt/sdd/cy22/COAWST-master/Build/main3d.f90:203
#7  0x55aa75b05539 in __ocean_control_mod_MOD_roms_run
        at /mnt/sdd/cy22/COAWST-master/Build/ocean_control.f90:192
#8  0x55aa75b02021 in ocean
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:108
#9  0x55aa75b021d6 in main
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:50
#4  0x55732a0c1e98 in wec_stokes_tile
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:328
#5  0x55732a0db04f in __wec_stokes_mod_MOD_wec_stokes
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:79
#0  0x1482b9b532ed in ???
#1  0x1482b9b53ed5 in ???
#2  0x1482b9b542a7 in ???
#0  0x14e81ab372ed in ???
#1  0x14e81ab37ed5 in ???
#2  0x14e81ab382a7 in ???
#0  0x14e729aeb2ed in ???
#1  0x14e729aebed5 in ???
#2  0x14e729aec2a7 in ???
#6  0x5573289c5ec9 in main3d_
        at /mnt/sdd/cy22/COAWST-master/Build/main3d.f90:203
#7  0x5573289bd539 in __ocean_control_mod_MOD_roms_run
        at /mnt/sdd/cy22/COAWST-master/Build/ocean_control.f90:192
#8  0x5573289ba021 in ocean
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:108
#9  0x5573289ba1d6 in main
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:50
#3  0x5653b0f5b109 in __vs3dbc_mod_MOD_vs3dbc_tile
        at /mnt/sdd/cy22/COAWST-master/Build/vs3dbc_im.f90:259
#3  0x5622d056cfb8 in __vs3dbc_mod_MOD_vs3dbc_tile
        at /mnt/sdd/cy22/COAWST-master/Build/vs3dbc_im.f90:357
#0  0x14ca5c3f82ed in ???
#1  0x14ca5c3f8ed5 in ???
#2  0x14ca5c3f92a7 in ???
#3  0x5645b16bf109 in __vs3dbc_mod_MOD_vs3dbc_tile
        at /mnt/sdd/cy22/COAWST-master/Build/vs3dbc_im.f90:259
#4  0x5653b0e60e98 in wec_stokes_tile
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:328
#5  0x5653b0e7a04f in __wec_stokes_mod_MOD_wec_stokes
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:79
#3  0x55c6b34355c8 in __vs3dbc_mod_MOD_vs3dbc_tile
        at /mnt/sdd/cy22/COAWST-master/Build/vs3dbc_im.f90:160
#4  0x5622d0460e98 in wec_stokes_tile
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:328
#5  0x5622d047a04f in __wec_stokes_mod_MOD_wec_stokes
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:79
#3  0x557328b8dfb8 in __vs3dbc_mod_MOD_vs3dbc_tile
        at /mnt/sdd/cy22/COAWST-master/Build/vs3dbc_im.f90:357
#6  0x5653af764ec9 in main3d_
        at /mnt/sdd/cy22/COAWST-master/Build/main3d.f90:203
#7  0x5653af75c539 in __ocean_control_mod_MOD_roms_run
        at /mnt/sdd/cy22/COAWST-master/Build/ocean_control.f90:192
#8  0x5653af759021 in ocean
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:108
#9  0x5653af7591d6 in main
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:50
#6  0x5622ced64ec9 in main3d_
        at /mnt/sdd/cy22/COAWST-master/Build/main3d.f90:203
#7  0x5622ced5c539 in __ocean_control_mod_MOD_roms_run
        at /mnt/sdd/cy22/COAWST-master/Build/ocean_control.f90:192
#8  0x5622ced59021 in ocean
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:108
#9  0x5622ced591d6 in main
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:50
#0  0x1495441cd2ed in ???
#1  0x1495441cded5 in ???
#2  0x1495441ce2a7 in ???
#4  0x5645b15c4e98 in wec_stokes_tile
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:328
#5  0x5645b15de04f in __wec_stokes_mod_MOD_wec_stokes
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:79
#4  0x55c6b334ce98 in wec_stokes_tile
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:328
#5  0x55c6b336604f in __wec_stokes_mod_MOD_wec_stokes
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:79
#4  0x557328a81e98 in wec_stokes_tile
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:328
#5  0x557328a9b04f in __wec_stokes_mod_MOD_wec_stokes
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:79
#3  0x555d73b8e109 in __vs3dbc_mod_MOD_vs3dbc_tile
        at /mnt/sdd/cy22/COAWST-master/Build/vs3dbc_im.f90:259
#6  0x5645afec8ec9 in main3d_
        at /mnt/sdd/cy22/COAWST-master/Build/main3d.f90:203
#6  0x55c6b1c50ec9 in main3d_
        at /mnt/sdd/cy22/COAWST-master/Build/main3d.f90:203
#6  0x557327385ec9 in main3d_
        at /mnt/sdd/cy22/COAWST-master/Build/main3d.f90:203
#7  0x5645afec0539 in __ocean_control_mod_MOD_roms_run
        at /mnt/sdd/cy22/COAWST-master/Build/ocean_control.f90:192
#8  0x5645afebd021 in ocean
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:108
#9  0x5645afebd1d6 in main
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:50
#7  0x55c6b1c48539 in __ocean_control_mod_MOD_roms_run
        at /mnt/sdd/cy22/COAWST-master/Build/ocean_control.f90:192
#8  0x55c6b1c45021 in ocean
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:108
#9  0x55c6b1c451d6 in main
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:50
#7  0x55732737d539 in __ocean_control_mod_MOD_roms_run
        at /mnt/sdd/cy22/COAWST-master/Build/ocean_control.f90:192
#8  0x55732737a021 in ocean
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:108
#9  0x55732737a1d6 in main
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:50
#4  0x555d73a93e98 in wec_stokes_tile
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:328
#5  0x555d73aad04f in __wec_stokes_mod_MOD_wec_stokes
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:79
#6  0x555d72397ec9 in main3d_
        at /mnt/sdd/cy22/COAWST-master/Build/main3d.f90:203
#3  0x55fc0ebe6109 in __vs3dbc_mod_MOD_vs3dbc_tile
        at /mnt/sdd/cy22/COAWST-master/Build/vs3dbc_im.f90:259
#7  0x555d7238f539 in __ocean_control_mod_MOD_roms_run
        at /mnt/sdd/cy22/COAWST-master/Build/ocean_control.f90:192
#8  0x555d7238c021 in ocean
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:108
#9  0x555d7238c1d6 in main
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:50
#0  0x1514dc9322ed in ???
#1  0x1514dc932ed5 in ???
#2  0x1514dc9332a7 in ???
#4  0x55fc0eaebe98 in wec_stokes_tile
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:328
#5  0x55fc0eb0504f in __wec_stokes_mod_MOD_wec_stokes
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:79
#6  0x55fc0d3efec9 in main3d_
        at /mnt/sdd/cy22/COAWST-master/Build/main3d.f90:203
#7  0x55fc0d3e7539 in __ocean_control_mod_MOD_roms_run
        at /mnt/sdd/cy22/COAWST-master/Build/ocean_control.f90:192
#8  0x55fc0d3e4021 in ocean
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:108
#9  0x55fc0d3e41d6 in main
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:50
#3  0x56103466e5c8 in __vs3dbc_mod_MOD_vs3dbc_tile
        at /mnt/sdd/cy22/COAWST-master/Build/vs3dbc_im.f90:160
#4  0x561034585e98 in wec_stokes_tile
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:328
#5  0x56103459f04f in __wec_stokes_mod_MOD_wec_stokes
        at /mnt/sdd/cy22/COAWST-master/Build/wec_stokes.f90:79
#6  0x561032e89ec9 in main3d_
        at /mnt/sdd/cy22/COAWST-master/Build/main3d.f90:203
#7  0x561032e81539 in __ocean_control_mod_MOD_roms_run
        at /mnt/sdd/cy22/COAWST-master/Build/ocean_control.f90:192
#8  0x561032e7e021 in ocean
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:108
#9  0x561032e7e1d6 in main
        at /mnt/sdd/cy22/COAWST-master/Build/master.f90:50

The same error appeared. Confusingly, in my previous running with wave, I didn't define WEC_BREAKING, WEC_ROLLER, WEC_WCAP, BOTTOM_STREAMING and SURFACE_STREAMING, and the run was OK, But this time the run failed. I checked lbc.F and us2bc_im.F carefully and found nothing wrong.

At first I thought it was a problem with the setup of my .in file, but after checking it didn't seem to be the case:

! Wec boundary conditions

LBC(isU2Sd) == Gra Gra Gra Gra \ ! 2D U-stokes
                          Nes Nes Nes Nes
LBC(isV2Sd) == Gra Gra Gra Gra \ ! 2D V-stokes
                          Nes Nes Nes Nes
LBC(isU3Sd) == Gra Gra Gra Gra \ ! 3D U-stokes
                           Nes Nes Nes Nes
LBC(isV3Sd) == Gra Gra Gra Gra \ ! 3D V-stokes
                          Nes Nes Nes Nes

It looks normal. So, is it possible that there is a logical error in Nonlinear/Wec/'s internal program dealing with boundary conditions? Or is it simply a display error? roms.log in.txt