Opened 8 months ago

Last modified 30 hours ago

#254 accepted Defect

Segmentation Fault at first step in version 10.4

Reported by: mradenz Owned by: pesei
Priority: major Milestone:
Component: FP coding/compilation Version: FLEXPART 10.4
Keywords: Cc:

Description

Hi all,

I tried to redo some simulations that succeeded with Flexpart 9.0.2 and 9.0.3.
Using version 10.4, after compiling with eccodes and jasper and adapting the input files to the namelist, i get the following error:

Welcome to FLEXPART Version 10.4 (2019-07-23)
 FLEXPART is free software released under the GNU General Public License.
 FLEXPART WARNING: TIME DIFFERENCE BETWEEN TWO
 WIND FIELDS IS BIG. THIS MAY CAUSE A DEGRADATION
 OF SIMULATION QUALITY.
 NCEP metdata detected


Vertical levels in NCEP data:      31     31

Mother domain:
  Longitude range:    -179.00     181.00   Grid distance:       1.00
  Latitude range :     -90.00      90.00   Grid distance:       1.00

 Releasepoints :           24
 SPECIES file not in NAMELIST format, attempting to read as fixed format
 Average settling velocity:            1              NaN
   Below-cloud scavenging: OFF
   In-cloud scavenging: OFF
 Particles allocated (maxpart)  :       150000
 Particles released (numpartmax):       120000
 Total mass released: 2.4000000E+01
 Allocating fields for global output (x,y):          360          90
 Allocating fields for nested output (x,y):            0           0
 Concentrations are calculated using kernel
 Simulated     0.0 hours (            0 s),             0 particles
 Global NCEP fields: using cloud water
 Global NCEP fields: using cloud water

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7fc3510eb2da in ???
#1  0x7fc3510ea503 in ???
#2  0x7fc35171df1f in ???
#3  0x5571b5a3c530 in conccalc
        at /workingdir/flexpart_v10.4_e4925fb/src/conccalc.f90:128
#4  0x5571b5a49677 in timemanager_
        at /workingdir/flexpart_v10.4_e4925fb/src/timemanager.f90:377
#5  0x5571b5a23e80 in flexpart
        at /workingdir/flexpart_v10.4_e4925fb/src/FLEXPART.f90:472
#6  0x5571b5a24250 in main
        at /workingdir/flexpart_v10.4_e4925fb/src/FLEXPART.f90:50
Segmentation fault (core dumped)

As input data I used the NCEP FNL 1deg in grib2 format (the same ones with which the older versions succeeded).
Did I overlook anything?
Thanks for your help.
Regards, Martin

Change History (5)

comment:1 Changed 5 weeks ago by pesei

  • Owner set to pesei
  • Status changed from new to accepted

Your version string shows that you don't have the final release of v10.4. Could you please repeat with download:66?

comment:2 Changed 8 days ago by mradenz

Doesn't make a difference:

 Welcome to FLEXPART Version 10.4 (2019-11-12)
 FLEXPART is free software released under the GNU General Public License.
 FLEXPART WARNING: TIME DIFFERENCE BETWEEN TWO
 WIND FIELDS IS BIG. THIS MAY CAUSE A DEGRADATION
 OF SIMULATION QUALITY.
 NCEP metdata detected


Vertical levels in NCEP data:      31     31

Mother domain:
  Longitude range:    -179.00     181.00   Grid distance:       1.00
  Latitude range :     -90.00      90.00   Grid distance:       1.00

 Releasepoints :           24
 SPECIES file not in NAMELIST format, attempting to read as fixed format
 Average settling velocity:            1              NaN
   Below-cloud scavenging: OFF
   In-cloud scavenging: OFF
 Particles allocated (maxpart)  :       100000
 Particles released (numpartmax):        48000
 Total mass released: 2.4000000E+01
 Allocating fields for global output (x,y):          360          90
 Allocating fields for nested output (x,y):            0           0
 Concentrations are calculated using kernel
 Simulated     0.0 hours (            0 s),             0 particles
 Global NCEP fields: using cloud water
 Global NCEP fields: using cloud water

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7f925965c2da in ???
#1  0x7f925965b503 in ???
#2  0x7f9259c8ef1f in ???
#3  0x5569f4841530 in conccalc
        at /workingdir/flexpart_v10.4_3d7eebf/src/conccalc.f90:110
#4  0x5569f484e677 in timemanager_
        at /workingdir/flexpart_v10.4_3d7eebf/src/timemanager.f90:359
#5  0x5569f4828e80 in flexpart
        at /workingdir/flexpart_v10.4_3d7eebf/src/FLEXPART.f90:454
#6  0x5569f4829250 in main
        at /workingdir/flexpart_v10.4_3d7eebf/src/FLEXPART.f90:32
Segmentation fault (core dumped)

comment:3 Changed 7 days ago by mradenz

I tried to check what might cause the issue and it seems to be connected with
accessing the height array in conccalc.f90 (write statements added by myself):

      do il=2,nz
        WRITE(*,*) "il, i ", il, i
        if (height(il).gt.ztra1(i)) then
          indz=il-1
          indzp=il
          goto 6
        endif
      end do
6     continue

      WRITE(*,*) "i, indz ", i, indz
      dz1=ztra1(i)-height(indz)
      dz2=height(indzp)-ztra1(i)

Some diagnostics for a 2000 particle simulation

 i, indz         1995           2
 il, i            2        1996
 il, i            3        1996
 il, i            4        1996
 i, indz         1996           3
 il, i            2        1997
 il, i            3        1997
 il, i            4        1997
 i, indz         1997           3
 il, i            2        1998
 il, i            3        1998
 il, i            4        1998
 i, indz         1998           3
 il, i            2        1999
 il, i            3        1999
 il, i            4        1999
 i, indz         1999           3
 il, i            2        2000
 il, i            3        2000
 i, indz         2000           2
 il, i            2           1
 il, i            3           1
 il, i            4           1
 il, i            5           1
 il, i            6           1
 il, i            7           1
 il, i            8           1
 il, i            9           1
 il, i           10           1
 il, i           11           1
 il, i           12           1
 il, i           13           1
 il, i           14           1
 il, i           15           1
 il, i           16           1
 il, i           17           1
 il, i           18           1
 il, i           19           1
 il, i           20           1
 il, i           21           1
 il, i           22           1
 il, i           23           1
 il, i           24           1
 il, i           25           1
 il, i           26           1
 il, i           27           1
 il, i           28           1
 il, i           29           1
 il, i           30           1
 il, i           31           1
 i, indz            1  -618643636
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

When trying with 4000 particles, the error also occurs at the last one.

comment:4 Changed 5 days ago by espen

The program output shows "NaN" for the average settling velocity, this might indicate that your SPECIES file was read incorrectly (note that there was a change in SPECIES file format for V10). Could you look in your output directory for a file SPECIES_*.namelist and see if it contains what you would expect?

comment:5 Changed 30 hours ago by mradenz

Thanks for the advice, adding the settling velocity solved the issue.
Would it be possible to add a sanity check to the species input?
Sorry for bothering you.

Last edited 30 hours ago by mradenz (previous) (diff)
Note: See TracTickets for help on using tickets.
hosted by ZAMG