firemodels / fds

Fire Dynamics Simulator
https://pages.nist.gov/fds-smv/
Other
670 stars 626 forks source link

floating invalid error in evac.f90 #1589

Closed gforney closed 9 years ago

gforney commented 9 years ago
 Fire Dynamics Simulator

 Compilation Date : Wed, 18 Apr 2012
 Current Date     : April 19, 2012  07:53:55

 Version: 6.0.0; MPI Disabled; OpenMP Disabled
 SVN Revision No. : 10509

 Job TITLE        : Test 2, evac meshes
 Job ID string    : evac_smv_testcase2

 Time Step:   -199,    Simulation Time:      0.00 s
 Time Step:   -149,    Simulation Time:      0.50 s
 Time Step:    -99,    Simulation Time:      1.00 s
 Time Step:    -49,    Simulation Time:      1.50 s
forrtl: error (65): floating invalid
Image              PC                Routine            Line        Source
fds_intel_linux_6  0000000001275F57  evacevacuate_huma       11055  evac.f90
fds_intel_linux_6  00000000011E9486  evac_mp_evacuate_        8793  evac.f90
fds_intel_linux_6  00000000027A0A53  fds_IP_evac_main_        2845  main.f90
fds_intel_linux_6  00000000026162DA  MAIN__                    632  main.f90

Original issue reported on code.google.com by mcgratta on 2012-04-19 11:56:55

gforney commented 9 years ago
Ok, I should commit a couple of IF .. EVACUATION_ONLY .. to
the divg.f90. These might help. Well, wait a couple of minutes,
I just updated divg.f90, so I should compile and to some checks.

Timo

Original issue reported on code.google.com by tkorhon1 on 2012-04-19 12:45:17

gforney commented 9 years ago
Put the IF statements outside the loops so that we do not evaluate this same thing for
every grid cell.

Original issue reported on code.google.com by mcgratta on 2012-04-19 12:55:35

gforney commented 9 years ago
Well,

I did not have the same error. But I should check this,
might be something to do with random numbers (random
initial agent positions and properties) that could
be compiler and computer specific.

line  6429    REAL(EB) :: evel, TNOW

line 11054      EVEL = SQRT(UBAR**2 + VBAR**2)  ! (UBAR,VBAR) is an unit vector
line 11055      IF (EVEL > 0.0_EB) THEN
line 11056         UBAR = UBAR/EVEL ; VBAR = VBAR/EVEL
line 11057      ELSE

Well, should I use " EVEL > ZERO_P " ?

CygWin (~/FDS_ScriptRuns/Evacuation): ../../FDS_Source_Latest/fds_intel_linux_64
 evac_smv_testcase2.fds
 EVAC: Emesh     1 MainEvacGrid has     4 door flow fields
 EVAC: Emesh     2 MainEvacGrid2 has     2 door flow fields

 Fire Dynamics Simulator

 Compilation Date : Thu, 19 Apr 2012
 Current Date     : April 19, 2012  15:49:09

 Version: 6.0.0; MPI Disabled; OpenMP Disabled
 SVN Revision No. : 10515

 Job TITLE        : Test 2, evac meshes
 Job ID string    : evac_smv_testcase2

 Time Step:   -199,    Simulation Time:      0.01 s
 Time Step:   -149,    Simulation Time:      0.51 s
 Time Step:    -99,    Simulation Time:      1.01 s
 Time Step:    -49,    Simulation Time:      1.51 s
 Time Step:      1,    Simulation Time:      0.05 s
 Time Step:      2,    Simulation Time:      0.10 s
 Time Step:      3,    Simulation Time:      0.15 s
 Time Step:      4,    Simulation Time:      0.20 s
 Time Step:      5,    Simulation Time:      0.25 s
 Time Step:      6,    Simulation Time:      0.30 s
 Time Step:      7,    Simulation Time:      0.35 s
 Time Step:      8,    Simulation Time:      0.40 s
 Time Step:      9,    Simulation Time:      0.45 s
 Time Step:     10,    Simulation Time:      0.50 s
 Time Step:     20,    Simulation Time:      1.00 s
 Time Step:     30,    Simulation Time:      1.50 s
 Time Step:     40,    Simulation Time:      2.00 s
 Time Step:     50,    Simulation Time:      2.50 s
 Time Step:     60,    Simulation Time:      3.00 s
 Time Step:     70,    Simulation Time:      3.50 s
 Time Step:     80,    Simulation Time:      4.00 s
 Time Step:     90,    Simulation Time:      4.50 s
 Time Step:    100,    Simulation Time:      5.00 s
 Time Step:    200,    Simulation Time:     10.00 s

STOP: FDS completed successfully
CygWin (~/FDS_ScriptRuns/Evacuation):

Timo

Original issue reported on code.google.com by tkorhon1 on 2012-04-19 13:09:47

gforney commented 9 years ago

> Put the IF statements outside the loops so that we do not evaluate this same thing
 for every grid cell.

Well, there was already an if statement in the innermost
loop for the SOLID, so that is why I put the evacuation
if there. It might even be that the compiler is clever
enough to take the evacuation if away from the loop, it
is a constant if statement inside the loop. So, this might
be just an issue of "programming styles". Next time I'll
need these kind of if statement, I'll put them around the
loops. And change older ones, if I see those somewhere.

IF (.NOT.EVACUATION_ONLY(NM)) THEN
   DO K=1,KBAR
      DO J=1,JBAR
         DO I=1,IBAR
            IF (SOLID(CELL_INDEX(I,J,K))) CYCLE
            RTRM(I,J,K) = 1._EB/(RHOP(I,J,K)*CP(I,J,K)*TMP(I,J,K))
            DP(I,J,K) = RTRM(I,J,K)*DP(I,J,K)
         ENDDO
      ENDDO 
   ENDDO
ENDIF

Original issue reported on code.google.com by tkorhon1 on 2012-04-19 13:16:03

gforney commented 9 years ago
You may be right, but I guess that it is slightly less work to evaluate the EVAC statement
once.

Original issue reported on code.google.com by mcgratta on 2012-04-19 13:19:12

gforney commented 9 years ago
The case is still not working:

 EVAC: Emesh     1 MainEvacGrid has     4 door flow fields
 EVAC: Emesh     2 MainEvacGrid2 has     2 door flow fields

 Fire Dynamics Simulator

 Compilation Date : Tue, 15 May 2012
 Current Date     : May 15, 2012  16:39:03

 Version: 6.0.0; MPI Disabled; OpenMP Disabled
 SVN Revision No. : 10722

 Job TITLE        : Test 2, evac meshes
 Job ID string    : evac_smv_testcase2

 Time Step:   -199,    Simulation Time:      0.00 s
 Time Step:   -149,    Simulation Time:      0.50 s
 Time Step:    -99,    Simulation Time:      1.00 s
 Time Step:    -49,    Simulation Time:      1.50 s
forrtl: error (65): floating invalid
Image              PC                Routine            Line        Source
fds_intel_linux_6  000000000124DE4B  evacevacuate_huma       11055  evac.f90
fds_intel_linux_6  00000000011C137A  evac_mp_evacuate_        8793  evac.f90
fds_intel_linux_6  0000000002739B1D  fds_IP_evac_main_        2788  main.f90

Original issue reported on code.google.com by mcgratta on 2012-05-15 20:49:17

gforney commented 9 years ago
Well svn 10715 (Monday) did run, at least as a _dv version.
So, I'll do the svn update and see how it does today. Yesterday
I was too busy to update the version.

VTT Linux cluster: fds_intel_linux_6_dv evac_smv_testcase2.fds
 EVAC: Emesh     1 MainEvacGrid has     4 door flow fields
 EVAC: Emesh     2 MainEvacGrid2 has     2 door flow fields

 Fire Dynamics Simulator

 Compilation Date : Mon, 14 May 2012
 Current Date     : May 16, 2012  10:11:10

 Version: 6.0.0; MPI Disabled; OpenMP Disabled
 SVN Revision No. : 10715

 Job TITLE        : Test 2, evac meshes
 Job ID string    : evac_smv_testcase2

 Time Step:   -199,    Simulation Time:      0.01 s
 Time Step:   -149,    Simulation Time:      0.51 s
 Time Step:    -99,    Simulation Time:      1.01 s
 Time Step:    -49,    Simulation Time:      1.51 s
 Time Step:      1,    Simulation Time:      0.05 s
 Time Step:      2,    Simulation Time:      0.10 s
 Time Step:      3,    Simulation Time:      0.15 s
 Time Step:      4,    Simulation Time:      0.20 s
 Time Step:      5,    Simulation Time:      0.25 s
 Time Step:      6,    Simulation Time:      0.30 s
 Time Step:      7,    Simulation Time:      0.35 s
 Time Step:      8,    Simulation Time:      0.40 s
 Time Step:      9,    Simulation Time:      0.45 s
 Time Step:     10,    Simulation Time:      0.50 s
 Time Step:     20,    Simulation Time:      1.00 s
 Time Step:     30,    Simulation Time:      1.50 s
 Time Step:     40,    Simulation Time:      2.00 s
 Time Step:     50,    Simulation Time:      2.50 s
 Time Step:     60,    Simulation Time:      3.00 s
 Time Step:     70,    Simulation Time:      3.50 s
 Time Step:     80,    Simulation Time:      4.00 s
 Time Step:     90,    Simulation Time:      4.50 s
 Time Step:    100,    Simulation Time:      5.00 s
 Time Step:    200,    Simulation Time:     10.00 s

STOP: FDS completed successfully

Timo

Original issue reported on code.google.com by tkorhon1 on 2012-05-16 07:14:38

gforney commented 9 years ago
svn 10722 seems to run here at Finland.  I did also the
batch queueing system,  all three cases (evac_smv_testcase0-2.fds).
I might use a little bit different compiler options than those in
the SVN makefile, see below. But I have also run the test cases using the
debug version without any problems. I just compile the latest
(10722) debug version and see how it goes, just wait a little
bit.... Ok, thanks for wainting. The debug version did run nicely
also here at Finland.

intel_linux_64_dv : FFLAGS = -m64 -O3 -vec_report0 -ipo -ip -traceback
intel_linux_64_dv : LFLAGS = -static-intel
intel_linux_64_dv : FCOMPL = ifort
intel_linux_64_dv : obj = fds_intel_linux_64_dv
intel_linux_64_dv : setup $(obj_serial)
    $(FCOMPL) $(FFLAGS) $(LFLAGS) -o $(obj) $(obj_serial)

CygWin: ../../FDS_Source_Latest/fds_intel_linux_64_dv evac_smv_testcase2.fds
 EVAC: Emesh     1 MainEvacGrid has     4 door flow fields
 EVAC: Emesh     2 MainEvacGrid2 has     2 door flow fields

 Fire Dynamics Simulator

 Compilation Date : Tue, 15 May 2012
 Current Date     : May 16, 2012  10:26:37

 Version: 6.0.0; MPI Disabled; OpenMP Disabled
 SVN Revision No. : 10722

 Job TITLE        : Test 2, evac meshes
 Job ID string    : evac_smv_testcase2

 Time Step:   -199,    Simulation Time:      0.00 s
 Time Step:   -149,    Simulation Time:      0.50 s
 Time Step:    -99,    Simulation Time:      1.00 s
 Time Step:    -49,    Simulation Time:      1.50 s
 Time Step:      1,    Simulation Time:      0.05 s
 Time Step:      2,    Simulation Time:      0.10 s
 Time Step:      3,    Simulation Time:      0.15 s
 Time Step:      4,    Simulation Time:      0.20 s
 Time Step:      5,    Simulation Time:      0.25 s
 Time Step:      6,    Simulation Time:      0.30 s
 Time Step:      7,    Simulation Time:      0.35 s
 Time Step:      8,    Simulation Time:      0.40 s
 Time Step:      9,    Simulation Time:      0.45 s
 Time Step:     10,    Simulation Time:      0.50 s
 Time Step:     20,    Simulation Time:      1.00 s
 Time Step:     30,    Simulation Time:      1.50 s
 Time Step:     40,    Simulation Time:      2.00 s
 Time Step:     50,    Simulation Time:      2.50 s
 Time Step:     60,    Simulation Time:      3.00 s
 Time Step:     70,    Simulation Time:      3.50 s
 Time Step:     80,    Simulation Time:      4.00 s
 Time Step:     90,    Simulation Time:      4.50 s
 Time Step:    100,    Simulation Time:      5.00 s
 Time Step:    200,    Simulation Time:     10.00 s

STOP: FDS completed successfully

Timo

Original issue reported on code.google.com by tkorhon1 on 2012-05-16 07:56:45

gforney commented 9 years ago
I ran the case in debug (intel_linux_64_db) mode:

[mcgratta@blaze Evacuation]$ fds_db evac_smv_testcase2.fds
 EVAC: Emesh     1 MainEvacGrid has     4 door flow fields
 EVAC: Emesh     2 MainEvacGrid2 has     2 door flow fields

 Fire Dynamics Simulator

 Compilation Date : Tue, 15 May 2012
 Current Date     : May 16, 2012  08:12:32

 Version: 6.0.0; MPI Disabled; OpenMP Disabled
 SVN Revision No. : 10722

 Job TITLE        : Test 2, evac meshes
 Job ID string    : evac_smv_testcase2

 Time Step:   -199,    Simulation Time:      0.00 s
 Time Step:   -149,    Simulation Time:      0.50 s
 Time Step:    -99,    Simulation Time:      1.00 s
 Time Step:    -49,    Simulation Time:      1.50 s
forrtl: error (65): floating invalid
Image              PC                Routine            Line        Source
fds_intel_linux_6  000000000124DE4B  evacevacuate_huma       11055  evac.f90
fds_intel_linux_6  00000000011C137A  evac_mp_evacuate_        8793  evac.f90
fds_intel_linux_6  0000000002739B1D  fds_IP_evac_main_        2788  main.f90
fds_intel_linux_6  00000000025B2953  MAIN__                    634  main.f90
fds_intel_linux_6  00000000004036BC  Unknown               Unknown  Unknown
libc.so.6          000000334621D994  Unknown               Unknown  Unknown
fds_intel_linux_6  00000000004035C9  Unknown               Unknown  Unknown
Aborted

Original issue reported on code.google.com by mcgratta on 2012-05-16 12:13:50

gforney commented 9 years ago
I do not still get the error. SVN Revision No. : 10722
and I have the latest SVN update, see below (status
checked also, no uncommitted modifications, I even
downloaded using web browser the latest evac.f90 and
they match). 

Could you test by modifying the line 11055 in evac.f90:
      IF (EVEL > 0.0_EB) THEN
         UBAR = UBAR/EVEL ; VBAR = VBAR/EVEL
      ELSE

Change it to " IF (EVEL > 0.01_EB) THEN" or something 
like that. If this is the case, then I should change
these things somewhere else also. The EVEL is supposed
to be equal to 1.0 (the norm of an unit vector), if the
vector is set, otherwise the vector is a zero vector. 

Our Linux compiler is:

CygWin (~/FDS_ScriptRuns/Evacuation): ifort --version
ifort (IFORT) 12.1.3 20120212
Copyright (C) 1985-2012 Intel Corporation.  All rights reserved.

CygWin (/cygdrive/C/fds-smv/FDS/trunk/FDS_Source): lt
part.f90  main.f90  devc.f90  init.f90  fire.f90  evac.f90  mpis.f90
cons.f90  velo.f90  irad.f90  mass.f90  hvac.f90  vege.f90  mpip.f90
pres.f90  dump.f90  data.f90  mesh.f90  radi.f90  pois.f90  Deprecated_Files/
read.f90  scrc.f90  ctrl.f90  func.f90  geom.f90  prec.f90
type.f90  turb.f90  wall.f90  divg.f90  smvv.f90  ieva.f90
CygWin (/cygdrive/C/fds-smv/FDS/trunk/FDS_Source): svn status
CygWin (/cygdrive/C/fds-smv/FDS/trunk/FDS_Source): svn update
Updating '.':
At revision 10729.
CygWin (/cygdrive/C/fds-smv/FDS/trunk/FDS_Source): svn status
CygWin (/cygdrive/C/fds-smv/FDS/trunk/FDS_Source): \cp ????.f90 Y:/FDS_Source_La
test/.

CygWin (/cygdrive/C/fds-smv/FDS/trunk/FDS_Source): diff ../Verification/Evacuati
on/evac_smv_testcase2.fds Y:/FDS_ScriptRuns/Evacuation/evac_smv_testcase2.fds

Linux (~/FDS_Source_Latest): make intel_linux_64_db
ifort -c -m64 -check -warn unused -O0 -auto -WB -traceback -g -fpe0 -fltconsiste
ncy -vec_report0 -stand:f03 prec.f90
etc...
ifort -m64 -check -warn unused -O0 -auto -WB -traceback -g -fpe0 -fltconsistency
 -vec_report0 -stand:f03 -static-intel -o fds_intel_linux_64_db prec.o mpis.o co
ns.o devc.o data.o type.o mesh.o func.o smvv.o irad.o ieva.o pois.o scrc.o radi.
o evac.o part.o vege.o ctrl.o turb.o geom.o dump.o hvac.o read.o mass.o wall.o f
ire.o divg.o init.o velo.o pres.o main.o

Linux (~/FDS_Source_Latest): cd ../FDS_ScriptRuns/Evacuation

Linux (~/FDS_ScriptRuns/Evacuation): ../../FDS_Source_Latest/fds_intel_linux_64
_db evac_smv_testcase2.fds
 EVAC: Emesh     1 MainEvacGrid has     4 door flow fields
 EVAC: Emesh     2 MainEvacGrid2 has     2 door flow fields

Fire Dynamics Simulator

Compilation Date : Tue, 15 May 2012
Current Date     : May 16, 2012  15:34:06

Version: 6.0.0; MPI Disabled; OpenMP Disabled
SVN Revision No. : 10722

Job TITLE        : Test 2, evac meshes
Job ID string    : evac_smv_testcase2

Time Step:   -199,    Simulation Time:      0.00 s
Time Step:   -149,    Simulation Time:      0.50 s
Time Step:    -99,    Simulation Time:      1.00 s
Time Step:    -49,    Simulation Time:      1.50 s
Time Step:      1,    Simulation Time:      0.05 s
Time Step:      2,    Simulation Time:      0.10 s
Time Step:      3,    Simulation Time:      0.15 s
Time Step:      4,    Simulation Time:      0.20 s
Time Step:      5,    Simulation Time:      0.25 s
Time Step:      6,    Simulation Time:      0.30 s
Time Step:      7,    Simulation Time:      0.35 s
Time Step:      8,    Simulation Time:      0.40 s
Time Step:      9,    Simulation Time:      0.45 s
Time Step:     10,    Simulation Time:      0.50 s
Time Step:     20,    Simulation Time:      1.00 s
Time Step:     30,    Simulation Time:      1.50 s
Time Step:     40,    Simulation Time:      2.00 s
Time Step:     50,    Simulation Time:      2.50 s
Time Step:     60,    Simulation Time:      3.00 s
Time Step:     70,    Simulation Time:      3.50 s
Time Step:     80,    Simulation Time:      4.00 s
Time Step:     90,    Simulation Time:      4.50 s
Time Step:    100,    Simulation Time:      5.00 s
Time Step:    200,    Simulation Time:     10.00 s

STOP: FDS completed successfully

And my evac.f90 and the evac.f90 at the google code are
the same, I download the latest evac.f90 at google code
using Firefox (saved as evac_svn.f90):

CygWin (/cygdrive/C/fds-smv/FDS/trunk/FDS_Source): diff evac.f90 evac_svn.f90
33,35c33,35
<   CHARACTER(255), PARAMETER :: evacid='$Id: evac.f90 10285 2012-03-19 07:57:31
Z tkorhon1@gmail.com $'
<   CHARACTER(255), PARAMETER :: evacrev='$Revision: 10285 $'
<   CHARACTER(255), PARAMETER :: evacdate='$Date: 2012-03-19 09:57:31 +0200 (Mon
, 19 Mar 2012) $'
---
>   CHARACTER(255), PARAMETER :: evacid='$Id$'
>   CHARACTER(255), PARAMETER :: evacrev='$Revision$'
>   CHARACTER(255), PARAMETER :: evacdate='$Date$'

TimoK

Original issue reported on code.google.com by tkorhon1 on 2012-05-16 12:45:46

gforney commented 9 years ago
write(0,*) 'UBAR=',UBAR,'  VBAR=',VBAR
      EVEL = SQRT(UBAR**2 + VBAR**2)  ! (UBAR,VBAR) is an unit vector
      IF (EVEL > 0.0_EB) THEN   <----- floating invalid here
         UBAR = UBAR/EVEL ; VBAR = VBAR/EVEL
      ELSE

 Time Step:   -199,    Simulation Time:      0.00 s
 Time Step:   -149,    Simulation Time:      0.50 s
 Time Step:    -99,    Simulation Time:      1.00 s
 Time Step:    -49,    Simulation Time:      1.50 s
 UBAR= NaN                       VBAR= NaN

I cannot determine when UBAR and VBAR become NaN. I believe that we're using the same
compiler version. I am using the intel_linux_64_db make entries.

[mcgratta@blaze Evacuation]$ ifort --version
ifort (IFORT) 12.1.3 20120212
Copyright (C) 1985-2012 Intel Corporation.  All rights reserved.

Original issue reported on code.google.com by mcgratta on 2012-05-16 13:06:33

gforney commented 9 years ago
Time Step:    -49,    Simulation Time:      1.50 s
*** tim,e ubar,vbar   1.641048408274060E-015  6.074214269347067E-008
 6.770723373961118E-008           1

(Well, "tim,e" should be "time,"...)

So, the problem is the first time step when the evacuation
flow fields calculation has ended. The evacuation flow
fields have time < t_begin. So, the problem might be that
the time is not 1.641048408274060E-015 in your computer,
but could be tiny negative number and then it might be
that the evacuation routine is called "too early", i.e.,
not all initializations  for evacuation are done.

I'll look this on Friday, tomorrow is the Ascension Day,
so the office is closed.

Timo

Original issue reported on code.google.com by tkorhon1 on 2012-05-16 13:54:37

gforney commented 9 years ago
Version: 6.0.0; MPI Disabled; OpenMP Disabled
SVN Revision Number: 11062
Compile Date: Fri, 15 Jun 2012

[mcgratta@blaze Verification]$ grep forrtl */*err
Evacuation/evac_smv_testcase1.err:forrtl: severe (174): SIGSEGV, segmentation fault
occurred

Original issue reported on code.google.com by mcgratta on 2012-06-15 22:39:05

gforney commented 9 years ago
Just committed a fix for the divergence_part_1_et subroutine.

Fire Dynamics Simulator

Compilation Date : Mon, 18 Jun 2012
Current Date     : June 18, 2012  16:52:05

Version: 6.0.0; MPI Disabled; OpenMP Disabled
SVN Revision No. : 11074

Job TITLE        : Test 2, evac meshes
Job ID string    : evac_smv_testcase2

Time Step:   -199,    Simulation Time:      0.00 s
Time Step:   -149,    Simulation Time:      0.50 s
Time Step:    -99,    Simulation Time:      1.00 s
Time Step:    -49,    Simulation Time:      1.50 s
Time Step:      1,    Simulation Time:      0.05 s
Time Step:      2,    Simulation Time:      0.10 s
Time Step:      3,    Simulation Time:      0.15 s
Time Step:      4,    Simulation Time:      0.20 s
Time Step:      5,    Simulation Time:      0.25 s
Time Step:      6,    Simulation Time:      0.30 s
Time Step:      7,    Simulation Time:      0.35 s
Time Step:      8,    Simulation Time:      0.40 s
Time Step:      9,    Simulation Time:      0.45 s
Time Step:     10,    Simulation Time:      0.50 s
Time Step:     20,    Simulation Time:      1.00 s
Time Step:     30,    Simulation Time:      1.50 s
Time Step:     40,    Simulation Time:      2.00 s
Time Step:     50,    Simulation Time:      2.50 s
Time Step:     60,    Simulation Time:      3.00 s
Time Step:     70,    Simulation Time:      3.50 s
Time Step:     80,    Simulation Time:      4.00 s
Time Step:     90,    Simulation Time:      4.50 s
Time Step:    100,    Simulation Time:      5.00 s
Time Step:    200,    Simulation Time:     10.00 s

STOP: FDS completed successfully

Timo

Original issue reported on code.google.com by tkorhon1 on 2012-06-18 13:53:45

gforney commented 9 years ago
It works now. Thanks.

Original issue reported on code.google.com by mcgratta on 2012-06-18 14:38:31