Segmentation fault

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
zzyfathead
Posts: 22
Joined: Wed Sep 18, 2019 1:53 pm
Location: ANU

Segmentation fault

#1 Unread post by zzyfathead »

Hi all,

I tried to run a easy case and met a segmentation fault. So I turned on the USER_DEBUG, the results show belows:

I tried to figured out the problem but still have no idea yet.

Hope anyone have met this problem. Thanks lol

User avatar
zzyfathead
Posts: 22
Joined: Wed Sep 18, 2019 1:53 pm
Location: ANU

Re: Segmentation fault

#2 Unread post by zzyfathead »

Model Input Parameters: ROMS/TOMS version 3.7
Friday - January 3, 2020 - 4:44:40 PM
-----------------------------------------------------------------------------

test

Code: Select all

Operating system : Linux
 CPU/hardware     : x86_64
 Compiler system  : gfortran
 Compiler command : /usr/bin/mpif90
 Compiler flags   : -frepack-arrays -g -fbounds-check -I/usr/include -ffree-form -ffree-form

 Input Script  : 

 SVN Root URL  : https:://myroms.org/svn/src
 SVN Revision  : 65M

 Local Root    : /home/ubuntu/app/COAWST_V3.2
 Header Dir    : /home/ubuntu/app/COAWST_V3.2/Projects/test
 Header file   : test.h
 Analytical Dir: /home/ubuntu/app/COAWST_V3.2/Projects/test

 Resolution, Grid 01: 0176x0279x025,  Parallel Nodes:   1,  Tiling: 001x001


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

      24000  ntimes            Number of timesteps for 3-D equations.
      0.100  dt                Timestep size (s) for 3-D equations.
         10  ndtfast           Number of timesteps for 2-D equations between
                                 each 3D timestep.
          1  ERstr             Starting ensemble/perturbation run number.
          1  ERend             Ending ensemble/perturbation run number.
          0  nrrec             Number of restart records to read from disk.
          T  LcycleRST         Switch to recycle time-records in restart file.
        120  nRST              Number of timesteps between the writing of data
                                 into restart fields.
          1  ninfo             Number of timesteps between print of information
                                 to standard output.
          T  ldefout           Switch to create a new output NetCDF file(s).
         10  nHIS              Number of timesteps between the writing fields
                                 into history file.
          1  ntsAVG            Starting timestep for the accumulation of output
                                 time-averaged data.
        360  nAVG              Number of timesteps between the writing of
                                 time-averaged data into averages file.
 2.0000E-01  nl_tnu2(01)       NLM Horizontal, harmonic mixing coefficient
                                 (m2/s) for tracer 01: temp
 2.0000E-01  nl_tnu2(02)       NLM Horizontal, harmonic mixing coefficient
                                 (m2/s) for tracer 02: salt
 1.0000E-01  nl_visc2          NLM Horizontal, harmonic mixing coefficient
                                 (m2/s) for momentum.
          F  LuvSponge         Turning OFF sponge on horizontal momentum.
          F  LtracerSponge(01) Turning OFF sponge on tracer 01: temp
          F  LtracerSponge(02) Turning OFF sponge on tracer 02: salt
 1.0000E-06  Akt_bak(01)       Background vertical mixing coefficient (m2/s)
                                 for tracer 01: temp
 1.0000E-06  Akt_bak(02)       Background vertical mixing coefficient (m2/s)
                                 for tracer 02: salt
 1.0000E-05  Akv_bak           Background vertical mixing coefficient (m2/s)
                                 for momentum.
 5.0000E-06  Akk_bak           Background vertical mixing coefficient (m2/s)
                                 for turbulent energy.
 5.0000E-06  Akp_bak           Background vertical mixing coefficient (m2/s)
                                 for turbulent generic statistical field.
      3.000  gls_p             GLS stability exponent.
      1.500  gls_m             GLS turbulent kinetic energy exponent.
     -1.000  gls_n             GLS turbulent length scale exponent.
 7.6000E-06  gls_Kmin          GLS minimum value of turbulent kinetic energy.
 1.0000E-12  gls_Pmin          GLS minimum value of dissipation.
 5.4770E-01  gls_cmu0          GLS stability coefficient.
 1.4400E+00  gls_c1            GLS shear production coefficient.
 1.9200E+00  gls_c2            GLS dissipation coefficient.
-4.0000E-01  gls_c3m           GLS stable buoyancy production coefficient.
 1.0000E+00  gls_c3p           GLS unstable buoyancy production coefficient.
 1.0000E+00  gls_sigk          GLS constant Schmidt number for TKE.
 1.3000E+00  gls_sigp          GLS constant Schmidt number for PSI.
   1400.000  charnok_alpha     Charnok factor for Zos calculation.
      0.500  zos_hsig_alpha    Factor for Zos calculation using Hsig(Awave).
      0.250  sz_alpha          Factor for Wave dissipation surface tke flux .
    100.000  crgban_cw         Factor for Craig/Banner surface tke flux.
      0.000  wec_alpha         WEC factor for roller/breaking energy distribution.
 3.0000E-04  rdrg              Linear bottom drag coefficient (m/s).
 2.5000E-02  rdrg2             Quadratic bottom drag coefficient.
 2.0000E-02  Zob               Bottom roughness (m).
 2.0000E-02  Zos               Surface roughness (m).
 1.0000E-01  Dcrit             Minimum depth for wetting and drying (m).
          1  lmd_Jwt           Jerlov water type.
          2  Vtransform        S-coordinate transformation equation.
          4  Vstretching       S-coordinate stretching function.
 6.0000E+00  theta_s           S-coordinate surface control parameter.
 4.0000E-01  theta_b           S-coordinate bottom  control parameter.
     10.000  Tcline            S-coordinate surface/bottom layer width (m) used
                                 in vertical coordinate stretching.
   1025.000  rho0              Mean density (kg/m3) for Boussinesq approximation.
      0.000  dstart            Time-stamp assigned to model initialization (days).
       0.00  time_ref          Reference time for units attribute (yyyymmdd.dd)
 0.0000E+00  Tnudg(01)         Nudging/relaxation time scale (days)
                                 for tracer 01: temp
 0.0000E+00  Tnudg(02)         Nudging/relaxation time scale (days)
                                 for tracer 02: salt
 0.0000E+00  Tnudg_SSS         Nudging/relaxation time scale (days)
                                 for sea surface salinity.
 0.0000E+00  Znudg             Nudging/relaxation time scale (days)
                                 for free-surface.
 0.0000E+00  M2nudg            Nudging/relaxation time scale (days)
                                 for 2D momentum.
 0.0000E+00  M3nudg            Nudging/relaxation time scale (days)
                                 for 3D momentum.
 0.0000E+00  obcfac            Factor between passive and active
                                 open boundary conditions.
          F  VolCons(1)        NLM western  edge boundary volume conservation.
          F  VolCons(2)        NLM southern edge boundary volume conservation.
          F  VolCons(3)        NLM eastern  edge boundary volume conservation.
          F  VolCons(4)        NLM northern edge boundary volume conservation.
     10.000  T0                Background potential temperature (C) constant.
     30.000  S0                Background salinity (PSU) constant.
      1.000  gamma2            Slipperiness variable: free-slip (1.0) or 
                                                      no-slip (-1.0).
          F  LuvSrc            Turning OFF momentum point Sources/Sinks.
          F  LwSrc             Turning OFF volume influx point Sources/Sinks.
          F  LtracerSrc(01)    Turning OFF point Sources/Sinks on tracer 01: temp
          F  LtracerSrc(02)    Turning OFF point Sources/Sinks on tracer 02: salt
          F  LsshCLM           Turning OFF processing of SSH climatology.
          F  Lm2CLM            Turning OFF processing of 2D momentum climatology.
          F  Lm3CLM            Turning OFF processing of 3D momentum climatology.
          F  LtracerCLM(01)    Turning OFF processing of climatology tracer 01: temp
          F  LtracerCLM(02)    Turning OFF processing of climatology tracer 02: salt
          F  LnudgeM2CLM       Turning OFF nudging of 2D momentum climatology.
          F  LnudgeM3CLM       Turning OFF nudging of 3D momentum climatology.
          F  LnudgeTCLM(01)    Turning OFF nudging of climatology tracer 01: temp
          F  LnudgeTCLM(02)    Turning OFF nudging of climatology tracer 02: salt
          T  Hout(idFsur)      Write out free-surface.
          T  Hout(idUvel)      Write out 3D U-momentum component.
          T  Hout(idVvel)      Write out 3D V-momentum component.
          T  Hout(idWvel)      Write out W-momentum component.


 Output/Input Files:

             Output Restart File:  test_rst.nc
             Output History File:  test_his.nc
            Output Averages File:  test_avg.nc
                 Input Grid File:  /home/ubuntu/app/COAWST_V3.2/Projects/test/test_grid.nc
    Input Nonlinear Initial File:  /home/ubuntu/app/COAWST_V3.2/Projects/test/test_init.nc

 Tile partition information for Grid 01:  0176x0279x0025  tiling: 001x001

     tile     Istr     Iend     Jstr     Jend     Npts

 Number of tracers:            2
        0        1      176        1      279  1227600

 Tile minimum and maximum fractional coordinates for Grid 01:
   (interior points only)

     tile     Xmin     Xmax     Ymin     Ymax     grid

        0     0.50   176.50     0.50   279.50  RHO-points

        0     1.00   176.00     0.50   279.50    U-points

        0     0.50   176.50     1.00   279.00    V-points

 Maximum halo size in XI and ETA directions:

               HaloSizeI(1) =     374
               HaloSizeJ(1) =     578
                TileSide(1) =     283
                TileSize(1) =   51223


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

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

 zeta                     1   Closed       Closed       Closed       Closed

 ubar                     1   Closed       Closed       Closed       Closed

 vbar                     1   Closed       Closed       Closed       Closed

 u                        1   Closed       Closed       Closed       Closed

 v                        1   Closed       Closed       Closed       Closed

 temp                     1   Closed       Closed       Closed       Closed

 salt                     1   Closed       Closed       Closed       Closed

 tke                      1   Closed       Closed       Closed       Closed

 Activated C-preprocessing Options:

 TEST                test
 ANA_BSFLUX          Analytical kinematic bottom salinity flux.
 ANA_BTFLUX          Analytical kinematic bottom temperature flux.
 ASSUMED_SHAPE       Using assumed-shape arrays.
 AVERAGES            Writing out time-averaged nonlinear model fields.
 CHARNOK             Charnok surface roughness from wind stress.
 CURVGRID            Orthogonal curvilinear grid.
 DJ_GRADPS           Parabolic Splines density Jacobian (Shchepetkin, 2002).
 DOUBLE_PRECISION    Double precision arithmetic.
 GLS_MIXING          Generic Length-Scale turbulence closure.
 KANTHA_CLAYSON      Kantha and Clayson stability function formulation.
 MASKING             Land/Sea masking.
 MIX_GEO_TS          Mixing of tracers along geopotential surfaces.
 MIX_S_UV            Mixing of momentum along constant S-surfaces.
 MPI                 MPI distributed-memory configuration.
 NONLINEAR           Nonlinear Model.
 NONLIN_EOS          Nonlinear Equation of State for seawater.
 N2S2_HORAVG         Horizontal smoothing of buoyancy and shear.
 POWER_LAW           Power-law shape time-averaging barotropic filter.
 PROFILE             Time profiling activated .
 K_GSCHEME           Third-order upstream advection of TKE fields.
 RADIATION_2D        Use tangential phase speed in radiation conditions.
 !RST_SINGLE         Double precision fields in restart NetCDF file.
 SALINITY            Using salinity.
 SOLAR_SOURCE        Solar Radiation Source Term.
 SOLVE3D             Solving 3D Primitive Equations.
 TS_U3HADVECTION     Third-order upstream horizontal advection of tracers.
 TS_C4VADVECTION     Fourth-order centered vertical advection of tracers.
 TS_DIF2             Harmonic mixing of tracers.
 UV_ADV              Advection of momentum.
 UV_U3HADVECTION     Third-order upstream horizontal advection of 3D momentum.
 UV_C4VADVECTION     Fourth-order centered vertical advection of momentum.
 UV_LOGDRAG          Logarithmic bottom stress.
 UV_VIS2             Harmonic mixing of momentum.
 VAR_RHO_2D          Variable density barotropic mode.
 WET_DRY             Wetting and drying activated.

 Process Information:

 Node #  0 (pid=   15904) is active.

 INITIAL: Configuring and initializing forward nonlinear model ...
 *******

 Vertical S-coordinate System, Grid 01:

 level   S-coord     Cs-curve   Z   at hmin       at hc    half way     at hmax

    25   0.0000000   0.0000000        0.000       0.000       0.000       0.000
    24  -0.0400000  -0.0001749       -0.004      -0.201      -0.461      -0.538
    23  -0.0800000  -0.0007098       -0.008      -0.404      -1.066      -1.368
    22  -0.1200000  -0.0016353       -0.012      -0.608      -1.829      -2.516
    21  -0.1600000  -0.0030046       -0.016      -0.815      -2.770      -4.025
    20  -0.2000000  -0.0048963       -0.020      -1.024      -3.921      -5.960
    19  -0.2400000  -0.0074189       -0.024      -1.237      -5.326      -8.407
    18  -0.2800000  -0.0107165       -0.028      -1.454      -7.042     -11.485
    17  -0.3200000  -0.0149770       -0.032      -1.675      -9.145     -15.347
    16  -0.3600000  -0.0204424       -0.036      -1.902     -11.733     -20.189
    15  -0.4000000  -0.0274214       -0.040      -2.137     -14.930     -26.262
    14  -0.4400000  -0.0363057       -0.044      -2.382     -18.892     -33.886
    13  -0.4800000  -0.0475899       -0.048      -2.638     -23.819     -43.462
    12  -0.5200000  -0.0618955       -0.052      -2.909     -29.961     -55.497
    11  -0.5600000  -0.0799996       -0.056      -3.200     -37.630     -70.622
    10  -0.6000000  -0.1028685       -0.060      -3.514     -47.214     -89.623
     9  -0.6400000  -0.1316956       -0.063      -3.858     -59.194    -113.473
     8  -0.6800000  -0.1679410       -0.067      -4.240     -74.157    -143.358
     7  -0.7200000  -0.2133714       -0.071      -4.667     -92.812    -180.716
     6  -0.7600000  -0.2700910       -0.076      -5.150    -116.006    -227.259
     5  -0.8000000  -0.3405555       -0.080      -5.703    -144.725    -284.985
     4  -0.8400000  -0.4275481       -0.084      -6.338    -180.090    -356.158
     3  -0.8800000  -0.5340940       -0.088      -7.070    -223.315    -443.241
     2  -0.9200000  -0.6632759       -0.092      -7.916    -275.642    -548.740
     1  -0.9600000  -0.8179050       -0.096      -8.890    -338.198    -674.944
     0  -1.0000000  -1.0000000       -0.100     -10.000    -411.797    -823.494

 Time Splitting Weights for Grid 01:    ndtfast =  10    nfast =  15
 ==================================

    Primary            Secondary            Accumulated to Current Step

  1 0.0014850648765542 0.1000000000000000 0.0014850648765542 0.1000000000000000
  2 0.0059386031399402 0.0998514935123446 0.0074236680164944 0.1998514935123445
  3 0.0133457074936657 0.0992576331983506 0.0207693755101601 0.2991091267106951
  4 0.0236484051180389 0.0979230624489840 0.0444177806281990 0.3970321891596791
  5 0.0366959666818608 0.0955582219371801 0.0811137473100598 0.4925904110968592
  6 0.0521753389587947 0.0918886252689940 0.1332890862688545 0.5844790363658532
  7 0.0695217010484137 0.0866710913731145 0.2028107873172682 0.6711501277389678
  8 0.0878091442019233 0.0797189212682732 0.2906199315191915 0.7508690490072409
  9 0.1056214752525633 0.0709380068480808 0.3962414067717548 0.8218070558553218
 10 0.1209031436506851 0.0603758593228245 0.5171445504224399 0.8821829151781463
 11 0.1307902921035067 0.0482855449577560 0.6479348425259466 0.9304684601359023
 12 0.1314219308195445 0.0352065157474053 0.7793567733454911 0.9656749758833076
 13 0.1177312353577226 0.0220643226654509 0.8970880087032138 0.9877392985487585
 14 0.0832169680811588 0.0102911991296786 0.9803049767843727 0.9980304976784371
 15 0.0196950232156274 0.0019695023215627 1.0000000000000000 0.9999999999999999

 ndtfast, nfast =   10  15   nfast/ndtfast =  1.50000

 Centers of gravity and integrals (values must be 1, 1, approx 1/2, 1, 1):

    1.000000000000 1.083803072626 0.541901536313 1.000000000000 1.000000000000

 Power filter parameters, Fgamma, gamma =  0.28400   0.00000

 Metrics information for Grid 01:
 ===============================

 Minimum X-grid spacing, DXmin =  1.00256452E-01 km
 Maximum X-grid spacing, DXmax =  1.00262565E-01 km
 Minimum Y-grid spacing, DYmin =  9.95247380E-02 km
 Maximum Y-grid spacing, DYmax =  9.95366015E-02 km
 Minimum Z-grid spacing, DZmin =  3.96056923E-03 m
 Maximum Z-grid spacing, DZmax =  1.48550344E+02 m

 Minimum barotropic Courant Number =  3.66827761E-04
 Maximum barotropic Courant Number =  1.27240519E-02
 Maximum Coriolis   Courant Number =  2.26677842E-07


 NLM: GET_STATE - Read state initial conditions,             t =     0 00:00:00
                   (Grid 01, File: test_init.nc, Rec=0001, Index=1)
                - free-surface
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
                - vertically integrated u-momentum component
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
                - vertically integrated v-momentum component
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
                - u-momentum component
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
                - v-momentum component
                   (Min =  0.00000000E+00 Max =  0.00000000E+00)
                - potential temperature
                   (Min =  2.00000000E+01 Max =  2.00000000E+01)
                - salinity
                   (Min =  3.50000000E+01 Max =  3.50000000E+01)
At line 101 of file get_data.f90
Fortran runtime error: Index '1' of dimension 2 of array 'frc' above upper bound of 0

Error termination. Backtrace:
[b]#0  0x7ff3e1bdf2da in ???
#1  0x7ff3e1bdfec5 in ???
#2  0x7ff3e1be0297 in ???
#3  0x555ef59c8e30 in get_data_
	at /home/ubuntu/app/COAWST_V3.2/Build/get_data.f90:101
#4  0x555ef59c5c3e in initial_
	at /home/ubuntu/app/COAWST_V3.2/Build/initial.f90:296
#5  0x555ef57bfbbd in __ocean_control_mod_MOD_roms_initialize
	at /home/ubuntu/app/COAWST_V3.2/Build/ocean_control.f90:131
#6  0x555ef57bec15 in ocean
	at /home/ubuntu/app/COAWST_V3.2/Build/master.f90:95
#7  0x555ef57bede1 in main
	at /home/ubuntu/app/COAWST_V3.2/Build/master.f90:50[/b]
-------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
-------------------------------------------------------
--------------------------------------------------------------------------
mpirun detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:

  Process name: [[1340,1],0]
  Exit code:    2
--------------------------------------------------------------------------

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Segmentation fault

#3 Unread post by kate »

What is on this line?
at /home/ubuntu/app/COAWST_V3.2/Build/get_data.f90:101
Oops, didn't see this:
Fortran runtime error: Index '1' of dimension 2 of array 'frc' above upper bound of 0
Did you tell it NFFILES before the list of forcing files?

User avatar
zzyfathead
Posts: 22
Joined: Wed Sep 18, 2019 1:53 pm
Location: ANU

Re: Segmentation fault

#4 Unread post by zzyfathead »

kate wrote: Fri Jan 03, 2020 5:32 pm What is on this line?
at /home/ubuntu/app/COAWST_V3.2/Build/get_data.f90:101
Oops, didn't see this:
Fortran runtime error: Index '1' of dimension 2 of array 'frc' above upper bound of 0
Did you tell it NFFILES before the list of forcing files?
Hi Kate,

Thanks for your reply.

I don't want to input any forcing file, so I use '!' to comment out the code, as shown in the figure below. And the problem happend.

Then I delete '!' and change this code to 'NFFILES=0' , but ROMS told me NFFILES must be greater than 1.

I wonder that if it's necessay to input forcing files.

Thanks!
Attachments
20200104144825.png
20200104144825.png (9.69 KiB) Viewed 4002 times

User avatar
zzyfathead
Posts: 22
Joined: Wed Sep 18, 2019 1:53 pm
Location: ANU

Re: Segmentation fault

#5 Unread post by zzyfathead »

zzyfathead wrote: Sat Jan 04, 2020 6:57 am
kate wrote: Fri Jan 03, 2020 5:32 pm What is on this line?
at /home/ubuntu/app/COAWST_V3.2/Build/get_data.f90:101
Oops, didn't see this:
Fortran runtime error: Index '1' of dimension 2 of array 'frc' above upper bound of 0
Did you tell it NFFILES before the list of forcing files?
Hi Kate,

Thanks for your reply.

I don't want to input any forcing file, so I use '!' to comment out the code, as shown in the figure below. And the problem happened.

Then I delete '!' and change this code to 'NFFILES=0' , but ROMS told me NFFILES must be greater than 1.

I wonder that if it's necessay to input forcing files (Because I don't want to do that).

Thanks!

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Segmentation fault

#6 Unread post by kate »

Well, you could try submitting a bug report for this case of no forcing files, but most of us just set NFFILES to 1 and move on.

User avatar
zzyfathead
Posts: 22
Joined: Wed Sep 18, 2019 1:53 pm
Location: ANU

Re: Segmentation fault

#7 Unread post by zzyfathead »

kate wrote: Sat Jan 04, 2020 7:34 am Well, you could try submitting a bug report for this case of no forcing files, but most of us just set NFFILES to 1 and move on.
Kate

Thanks for your reply, you really help me out! So people usually input at least one forcing file, my case is not common.

By the way, where can I submit a bug report?
Last edited by zzyfathead on Sat Jan 04, 2020 10:33 am, edited 2 times in total.

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Segmentation fault

#8 Unread post by kate »

If you log into: https://www.myroms.org/projects/src you can submit a bug report.

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

Re: Segmentation fault

#9 Unread post by arango »

This is not a bug. It always has to be equal or greater than one by design. If no input forcing files are needed, ROMS will ignore those values on standard input. I don't understand what it is the Fuzz about it. There are a lot of parameters in ROMS standard input that will be only relevant for a specific configuration. If not, they will be IGNORED!

NFFILES is needed to allocate an internal ROMS structure and initialize several parameters even if it is not used.

User avatar
zzyfathead
Posts: 22
Joined: Wed Sep 18, 2019 1:53 pm
Location: ANU

Re: Segmentation fault

#10 Unread post by zzyfathead »

arango wrote: Sat Jan 04, 2020 7:35 pm This is not a bug. It always has to be equal or greater than one by design. If no input forcing files are needed, ROMS will ignore those values on standard input. I don't understand what it is the Fuzz about it. There are a lot of parameters in ROMS standard input that will be only relevant for a specific configuration. If not, they will be IGNORED!

NFFILES is needed to allocate an internal ROMS structure and initialize several parameters even if it is not used.
Thanks, I set NFFILES = 1 and input forcing file(though values = 0), it works now. :D

Post Reply