Encyclopaedia Index

DEBUG

----- PIL logical; default=F; group 25 --- -

DEBUG....is the parameter governing all EARTH debug print-out.

When DEBUG=F, no such print-out will appear, irrespective of the settings of more specific debug parameters.

When DEBUG=T, debug information is printed within the first and last:...
sweeps, set by ISWDB1 and ISWDB2;
slabs, " " IZDB1 and IZDB2;
time steps, " " ISTDB1 and ISTDB2;
slabwise iterations, " " ITHDB1 and ITHDB2.

It is printed for those variables for which DBGPHI(name) = T, and for subroutines selected by the setting of other logicals beginning with the characters DB... , including:

variablemeaning
dbrhodensity and d rho / dp
dbemueffective viscosity
dbgeomvariables related to geometry
dbgamexchange coefficients, if the relevant dbgphi = T
dbtcalculation of temperature, also specific heat and thermal-expansion coefficient
dblcalculation of turbulence length scale
doutregarding output
dbindxF-array indices
dbcompassembly of terms in the equations
dbcmpeterms for the east-west direction (x)
dbcmpnterms in the north-south direction
dbcmphterms in the high-low direction
dbcompassembly of terms in the equations
dbfluxregarding mass fluxes, with dbgphi(9) or (10) = T
dbconvconvection fluxes, and pressure-correction coefficients
dbcmprrelated to the calculation of R1/2
dbcmp2regarding 2-phase flow

See also help and PHENC entries concerning the above, and also about FLAG, DBGRND, and DBSOL1, DBSOL2, DBSOL3, and SEARCH.


DEBUG print-out from EARTH

When EARTH runs fail through errors detected either by EARTH itself or by the Fortran (eg "floating-point division by zero"), the location and cause of the error may be determined by activating the PHOENICS debug facility:

The location of failure is best determined by setting in the Q1 file:


DEBUG=T; FLAG=T; DBGRND=T; DBINDX=T
ISWDB2=LSWEEP; IZDB2=NZ; ISTDB2=LSTEP; ITHDB2=LITHYD 

However, this can create a very large amount of print-out indeed, of which only the last few lines may be significant. These lines show in which sweep, slab, time step and iteration the failure occurred, and also which variable was being processed at the time.

The debug print-out also permits determination of which were the recently accessed sub-routines, information which is most useful to users if the sub-routines are open-source ones which can be accessed and altered.

The cause of the error may be less easy to determine; and it can indeed sometimes be impossible for anyone but a member of CHAM's user-support team, who has access to the complete source code.

However, even without that access, some insight into the nature of the problem can sometimes be gained by setting to T the variable DBSOL1, DBSOL2 or DBSOL3 according to whether the workings of the 1D, 2D or 3D solver are to be enquired into; and by setting also DBGPHI(name)=T, where name refers to the value of INDVAR (also called MPHI) which is in question at the time of the failure.

The coefficients can then be inspected, and compared with expectations, a process which can help the insightful user to find out where he went wrong (if indeeed he did).

A typical extract from such print-out is shown, with explanatory remarks, not forming part of that print-out, enclosed in [ ]'s.

[The print-out below is elicited when the following line is added to the Q1 file of core-library case 249, the square cavity with a moving lid:

DEBUG=T;DBSOL2=T;DBGPHI(U1)=T;ISWDB1=10;ISWDB2=10;LSWEEP=10

Different versions of PHOENICS, and different computers, may give somewhat different numbers, and indeed print-out lay-outs. However the general principles of debug interpretation remain the same.]


 cell-by-cell imbalances before solution
 for mphi=     3 &  ithyd=     1  at   iz=     1 & isweep=    10
 imbl    =    5524
 IY=  10  -2.798E-08   1.184E-06  -9.002E-06   3.794E-05  -3.464E-05
 IY=   8   2.652E-08   2.037E-06   2.741E-06   2.384E-05   3.442E-06
 IY=   6   1.615E-08   2.768E-07  -3.398E-06  -1.374E-05  -4.174E-07
 IY=   4  -1.152E-08  -6.524E-07  -3.707E-06  -4.373E-06  -4.201E-07
 IY=   2  -4.407E-09  -2.448E-07  -1.232E-06  -8.692E-07  -1.997E-08
  IX=       1           3           5           7           9

[The above print-out comes from the subroutine which calls the linear-equation solver. The same values appear below beneath the index k3su, the value of which is the zero-location of the variable in th F-array.

It will be seen that the parameters NXPRIN and NYPRIN (here 2 and 2), which govern the frequency of variable-field print-out are effective also for debug print-out.]


 start of subroutine solver (170800)
  MFI/ITHY=     3  IZSTEP=     1  ISWEEP=    10  ISTEP=     1
                         variable is U1
 dbg1    =    T  dbg2    =    T  dbg3    =    F  slbsol  =    T
 pbp     =    F  sol     =    T  selref  =    T
 resref  = 5.275407E-08 endit   = 1.000000E-03
                       slbsol.or..not.sol
 3d coefficients arranged slab-by-slab
 first iz=       1 last iz =       1
 iz      =       1
 k3ap    =    5424
 IY=  10   3.065E-04   9.920E-04   1.450E-03   1.357E-03   9.959E-04
 IY=   8   5.441E-04   1.525E-03   2.145E-03   1.637E-03   1.198E-03
 IY=   6   7.732E-04   2.408E-03   3.732E-03   2.844E-03   1.281E-03
 IY=   4   5.803E-04   1.786E-03   2.693E-03   1.880E-03   6.260E-04
 IY=   2   2.439E-04   7.452E-04   1.127E-03   7.627E-04   2.485E-04
  IX=       1           3           5           7           9
 
 iz      =       1
 k3su    =    5524
 IY=  10  -2.798E-08   1.184E-06  -9.002E-06   3.794E-05  -3.464E-05
 IY=   8   2.652E-08   2.037E-06   2.741E-06   2.384E-05   3.442E-06
 IY=   6   1.615E-08   2.768E-07  -3.398E-06  -1.374E-05  -4.174E-07
 IY=   4  -1.152E-08  -6.524E-07  -3.707E-06  -4.373E-06  -4.201E-07
 IY=   2  -4.407E-09  -2.448E-07  -1.232E-06  -8.692E-07  -1.997E-08
  IX=       1           3           5           7           9
 
 
 iz      =       1
 k3ae    =    4124
 IY=  10   0.000E+00   0.000E+00   0.000E+00   0.000E+00   0.000E+00
 IY=   8   0.000E+00   0.000E+00   0.000E+00   0.000E+00   0.000E+00
 IY=   6   2.002E-05   0.000E+00   0.000E+00   0.000E+00   0.000E+00
 IY=   4   1.813E-05   0.000E+00   0.000E+00   0.000E+00   0.000E+00
 IY=   2   8.209E-06   0.000E+00   0.000E+00   0.000E+00   0.000E+00
  IX=       1           3           5           7           9
 
 iz      =       1
 k3aw    =    4224
 IY=  10   0.000E+00   0.000E+00   0.000E+00   0.000E+00   0.000E+00
 IY=   8   0.000E+00   0.000E+00   0.000E+00   0.000E+00   0.000E+00
 IY=   6   0.000E+00   0.000E+00   0.000E+00   0.000E+00   0.000E+00
 IY=   4   0.000E+00   0.000E+00   0.000E+00   0.000E+00   0.000E+00
 IY=   2   0.000E+00   1.787E-07   0.000E+00   0.000E+00   5.888E-06
  IX=       1           3           5           7           9
 
 iz      =       1
 k3an    =    4724
 IY=  10   0.000E+00   0.000E+00   0.000E+00   0.000E+00   0.000E+00
 IY=   8   0.000E+00   0.000E+00   0.000E+00   0.000E+00   0.000E+00
 IY=   6   0.000E+00   0.000E+00   0.000E+00   0.000E+00   0.000E+00
 IY=   4   0.000E+00   0.000E+00   0.000E+00   0.000E+00   0.000E+00
 IY=   2   3.208E-06   8.205E-06   1.761E-05   5.805E-06   7.443E-07
  IX=       1           3           5           7           9
 
 iz      =       1
 k3as    =    4824
 IY=  10   0.000E+00   0.000E+00   0.000E+00   5.998E-06   0.000E+00
 IY=   8   0.000E+00   0.000E+00   0.000E+00   0.000E+00   0.000E+00
 IY=   6   0.000E+00   0.000E+00   0.000E+00   0.000E+00   0.000E+00
 IY=   4   0.000E+00   0.000E+00   1.973E-06   0.000E+00   0.000E+00
 IY=   2   9.822E-06   2.925E-05   4.421E-05   2.888E-05   9.412E-06
  IX=       1           3           5           7           9

[Solution of these equations leads to the following corrections to the field of velocities (fval) and the corresponding residuals (errors) in the equations: ]


    
 fval    =    6224
 IY=  10  -9.129E-05   1.194E-03  -6.209E-03   2.787E-02  -3.479E-02
 IY=   8   4.874E-05   1.335E-03   1.278E-03   1.456E-02   2.872E-03
 IY=   6   2.228E-05   1.150E-04  -9.106E-04  -4.831E-03  -3.259E-04
 IY=   4  -2.324E-05  -3.652E-04  -1.376E-03  -2.326E-03  -6.712E-04
 IY=   2  -2.061E-05  -3.201E-04  -1.067E-03  -1.114E-03  -8.888E-05
  IX=       1           3           5           7           9
 residuals after solution sweep
 resi    =    6324
 IY=  10  -7.120E-16   8.870E-14   4.715E-13   3.020E-12  -1.720E-12
 IY=   8   8.512E-16  -1.056E-14   4.364E-14   5.030E-13   2.859E-15
 IY=   6  -4.924E-16   5.084E-15   7.945E-14   6.124E-13   2.229E-15
 IY=   4  -8.894E-16  -5.803E-14  -1.584E-13  -1.340E-13  -1.872E-14
 IY=   2  -7.287E-12  -7.886E-13   4.006E-14  -1.393E-12  -6.078E-12
  IX=       1           3           5           7           9

wbs