TABLE OF CONTENTS


ABINIT/m_errors [ Modules ]

[ Top ] [ Modules ]

NAME

  m_errors

FUNCTION

  This module contains low-level procedures to check assertions and handle errors.

COPYRIGHT

 Copyright (C) 2008-2018 ABINIT group (MG,YP,NCJ,MT)
 This file is distributed under the terms of the
 GNU General Public License, see ~abinit/COPYING
 or http://www.gnu.org/copyleft/gpl.txt .

PARENTS

CHILDREN

SOURCE

21 #if defined HAVE_CONFIG_H
22 #include "config.h"
23 #endif
24 
25 #include "abi_common.h"
26 
27 MODULE m_errors
28 
29  use defs_basis
30  use m_profiling_abi
31  use m_xmpi
32  use m_specialmsg, only : wrtout
33 #ifdef HAVE_NETCDF
34  use netcdf
35 #endif
36 #ifdef HAVE_ETSF_IO
37  use etsf_io_low_level
38  use etsf_io
39 #endif
40 #ifdef HAVE_MPI2
41  use mpi
42 #endif
43 #ifdef FC_NAG
44  use f90_unix_proc
45 #endif
46 #ifdef FC_INTEL
47  use ifcore
48 #endif
49 
50  use m_io_tools,        only : flush_unit, lock_and_write, file_exists, num_opened_units, show_units, open_file
51  use m_fstrings,        only : toupper, basename, indent, lstrip, atoi, strcat, itoa
52  use m_build_info,      only : dump_config, abinit_version
53  use m_cppopts_dumper,  only : dump_cpp_options
54  use m_optim_dumper,    only : dump_optim
55 
56  implicit none
57 
58 #if defined HAVE_MPI1
59 include 'mpif.h'
60 #endif
61 
62 #ifdef FC_IBM
63 include "fexcp.h"
64 #endif
65 
66  private

m_errors/abi_abort [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  abi_abort

FUNCTION

  Routine for clean exit of f90 code, taking into account possible parallelization.

  Note the this routine is private and should never be called explicitly.
  Please, use the macros:
    MSG_ERROR, MSG_BUG
  defined in abi_common.h to abort the execution.
  XG : this is not true, in very rare cases, ABINIT has to exit without giving an error (e.g. for non-zero prtkpt )

INPUTS

  exit_status=(optional, default=1 or -1, see below) the return code of the routine
  mode_paral=
   'COLL' if all procs are calling the routine with the same message to be
     written once only or
   'PERS' if the procs are calling the routine with different mesgs
     each to be written, or if one proc is calling the routine
  print_config=(optional, default=true)
       if true print out several information before leaving

OUTPUT

  (only writing, then stop)

NOTES

  By default, it uses "call exit(1)", that is not completely portable.

PARENTS

      m_errors,testkgrid,vtorho

CHILDREN

      dump_config,print_kinds,wrtout,xmpi_abort,xmpi_show_info

SOURCE

1788 subroutine abi_abort(mode_paral,exit_status,print_config)
1789 
1790 
1791 !This section has been created automatically by the script Abilint (TD).
1792 !Do not modify the following lines by hand.
1793 #undef ABI_FUNC
1794 #define ABI_FUNC 'abi_abort'
1795 !End of the abilint section
1796 
1797  implicit none
1798 
1799 !Arguments ------------------------------------
1800  character(len=4),intent(in) :: mode_paral
1801  integer,intent(in),optional :: exit_status
1802  logical,intent(in),optional :: print_config
1803 
1804 !Local variables-------------------------------
1805  logical :: print_config_
1806 
1807 ! **********************************************************************
1808 
1809  call wrtout(std_out,ch10//' abi_abort: decision taken to exit ...','PERS')
1810 
1811 ! Caveat: Do not use MPI collective calls!
1812  if (mode_paral == "COLL") then
1813    call wrtout(std_out,"Why are you using COLL? Are you sure that ALL the processors are calling abi_abort?")
1814  end if
1815 
1816 !Dump configuration before exiting
1817  print_config_=.False.; if (present(print_config)) print_config_=print_config
1818  if (print_config_) then
1819    call print_kinds()
1820    call xmpi_show_info()
1821    call dump_config(std_out)
1822  end if
1823 
1824  if (present(exit_status)) then
1825    call xmpi_abort(exit_status=exit_status)
1826  else
1827    call xmpi_abort()
1828  end if
1829 
1830 end subroutine abi_abort

m_errors/abi_cabort [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  abi_cabort

FUNCTION

  C-interoperable version of abi_abort

m_errors/abietsf_msg_hndl [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  abietsf_msg_hndl

FUNCTION

  Wrapper to interface the abinint error handlers with the error handling routines used in etsf-io.
  It is usually interfaced via the macro ETSF_* defined in abi_common.h

INPUTS

  lstat=Logical flag returned by etsf-io routines.
  Error_data<ETSF_io_low_error>=Structure storing the error returned by etsf-io calls.
  [line]=line number of the file where the problem occurred
  [file]=name of the f90 file containing the caller
  mode_paral=Either "COLL" or "PERS".

OUTPUT

  Only writing, then the code is stopped.

PARENTS

CHILDREN

      abimem_get_info,abimem_shutdown,show_units,wrtout

SOURCE

1413 #if defined HAVE_ETSF_IO
1414 
1415 subroutine abietsf_msg_hndl(lstat,Error_data,mode_paral,file,line)
1416 
1417 
1418 !This section has been created automatically by the script Abilint (TD).
1419 !Do not modify the following lines by hand.
1420 #undef ABI_FUNC
1421 #define ABI_FUNC 'abietsf_msg_hndl'
1422 !End of the abilint section
1423 
1424  implicit none
1425 
1426 !Arguments ------------------------------------
1427  integer,optional,intent(in) :: line
1428  character(len=*),optional,intent(in) :: file
1429  character(len=*),intent(in) :: mode_paral
1430  logical,intent(in) :: lstat
1431  type(ETSF_io_low_error),intent(in) :: Error_data
1432 
1433 !Local variables-------------------------------
1434  integer :: f90line=0
1435  character(len=500) :: f90name='Subroutine Unknown'
1436  character(len=etsf_io_low_error_len) :: errmess
1437 ! *********************************************************************
1438 
1439  if (lstat) RETURN
1440 
1441  if (PRESENT(line)) f90line=line
1442  if (PRESENT(file)) f90name = file
1443  call etsf_io_low_error_to_str(errmess,Error_data)
1444 
1445  call msg_hndl(errmess,"ERROR",mode_paral,f90name,f90line)
1446 
1447 end subroutine abietsf_msg_hndl

m_errors/abietsf_warn [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  abietsf_warn

FUNCTION

  Wrapper to write warning messages, only used for ETSF_IO routines
  It is usually interfaced via the macro ETSF_WARN defined in abi_common.h

INPUTS

  lstat=status error.
  Error_data<ETSF_io_low_error>=Structure storing the error returned by etsf-io calls.
  [line]=line number of the file where the problem occurred
  [file]=name of the f90 file containing the caller
  mode_paral=Either "COLL" or "PERS".

OUTPUT

  Only writing.

PARENTS

CHILDREN

      abimem_get_info,abimem_shutdown,show_units,wrtout

SOURCE

1478 subroutine abietsf_warn(lstat,Error_data,mode_paral,file,line)
1479 
1480 
1481 !This section has been created automatically by the script Abilint (TD).
1482 !Do not modify the following lines by hand.
1483 #undef ABI_FUNC
1484 #define ABI_FUNC 'abietsf_warn'
1485 !End of the abilint section
1486 
1487  implicit none
1488 
1489 !Arguments ------------------------------------
1490  integer,optional,intent(in) :: line
1491  logical,intent(in) :: lstat
1492  character(len=*),optional,intent(in) :: file
1493  character(len=*),intent(in) :: mode_paral
1494  type(ETSF_io_low_error),intent(in) :: Error_data
1495 
1496 !Local variables-------------------------------
1497  integer :: f90line=0
1498  character(len=500) :: f90name='Subroutine Unknown'
1499  character(len=etsf_io_low_error_len) :: errmess
1500 ! *********************************************************************
1501 
1502  if (lstat) RETURN
1503 
1504  if (PRESENT(line)) f90line=line
1505  if (PRESENT(file)) f90name = file
1506  call etsf_io_low_error_to_str(errmess,Error_data)
1507 
1508  call msg_hndl(errmess,"WARNING",mode_paral,f90name,f90line)
1509 
1510 end subroutine abietsf_warn

m_errors/abinit_doctor [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  abinit_doctor

FUNCTION

 Perform checks on memory leaks and leaking file descriptors at the end of the run.

INPUTS

  prefix=Prefix for output file  (usually "__nameofprogram" e.g. __cut3d)
  [print_mem_report]=0 to disable the test on memory leaks (used in Abinit if bigdft is activated).
    Default: 1, i.e. memory check is always activated.

PARENTS

      abinit,anaddb,conducti,cut3d,fftprof,fold2Bloch,ioprof,lapackprof
      macroave,mrgddb,mrgdv,mrggkk,mrgscr,multibinit,optic,ujdet
      vdw_kernelgen

CHILDREN

      abimem_get_info,abimem_shutdown,show_units,wrtout

SOURCE

1654 subroutine abinit_doctor(prefix, print_mem_report)
1655 
1656 
1657 !This section has been created automatically by the script Abilint (TD).
1658 !Do not modify the following lines by hand.
1659 #undef ABI_FUNC
1660 #define ABI_FUNC 'abinit_doctor'
1661 !End of the abilint section
1662 
1663  implicit none
1664 
1665 !Arguments ------------------------------------
1666  integer,optional,intent(in) :: print_mem_report
1667  character(len=*),intent(in) :: prefix
1668 
1669 !Local variables-------------------------------
1670 !scalars
1671  integer,parameter :: master=0
1672  integer :: do_mem_report, my_rank
1673 #ifdef HAVE_MEM_PROFILING
1674  integer :: ii,ierr,unt
1675  integer :: nalloc,ndealloc
1676  integer(kind=8) :: memtot
1677  character(len=fnlen) :: path
1678  character(len=500) :: msg
1679  character(len=2000) :: errmsg
1680 #endif
1681 
1682 ! *************************************************************************
1683  do_mem_report = 1; if (present(print_mem_report)) do_mem_report = print_mem_report
1684  my_rank = xmpi_comm_rank(xmpi_world)
1685 
1686 #ifdef HAVE_MEM_PROFILING
1687  errmsg = ""; ierr = 0
1688 
1689  ! Test on memory leaks.
1690  call abimem_get_info(nalloc, ndealloc, memtot)
1691  call abimem_shutdown()
1692 
1693  if (do_mem_report == 1) then
1694    if ((nalloc == ndealloc) .and. (memtot == 0)) then
1695      write(msg,'(3a,i0,a,i0,3a,i0)')&
1696 &      '- MEMORY CONSUMPTION REPORT:',ch10, &
1697 &      '-   There were ',nalloc,' allocations and ',ndealloc,' deallocations',ch10, &
1698 &      '-   Remaining memory at the end of the calculation is ',memtot
1699    else
1700      ! This msg will make the test fail if the memory leak occurs on master (no dash in the first column)
1701      write(msg,'(3a,i0,a,i0,3a,i0,6a)') 'MEMORY CONSUMPTION REPORT :',ch10, &
1702 &      '   There were ',nalloc,' allocations and ',ndealloc,' deallocations',ch10, &
1703 &      '   Remaining memory at the end of the calculation is ',memtot,ch10, &
1704 &      '   As a help for debugging, you might set call abimem_init(2) in the main program,', ch10,&
1705 &      '   then use tests/Scripts/abimem.py to analyse the file abimem_rank[num].mocc that has been created.',ch10,&
1706        '   Note that abimem files can easily be multiple GB in size so do not use this option normally!'
1707      ! And this will make the code call mpi_abort if the leak occurs on my_rank != master
1708      ierr = ierr + 1
1709      errmsg = strcat(errmsg, ch10, msg)
1710    end if
1711 
1712  else
1713    write(msg,'(3a)')&
1714 &    '- MEMORY CONSUMPTION REPORT :',ch10, &
1715 &    '- Memory profiling is activated but not yet usable when bigdft is used'
1716  end if
1717  if (my_rank == master) then
1718    call wrtout(ab_out, msg)
1719  end if
1720  ! Test whether all logical units have been closed.
1721  ! If you wonder why I'm doing this, remember that there's a per-user
1722  ! limit on the maximum number of open file descriptors. Hence descriptors
1723  ! represent a precious resource and we should close them as soon as possible.
1724  ii = num_opened_units(ignore=[std_err, std_in, std_out, ab_out])
1725  if (ii > 0) then
1726    path = strcat(prefix, "_lunits_rank", itoa(my_rank), ".flun")
1727    if (open_file(path, msg, newunit=unt) /= 0) then
1728      MSG_ERROR(msg)
1729    end if
1730    call show_units(unt)
1731    close(unt)
1732    write(msg, "(a,i0,2a)")"Leaking ",ii," Fortran logical units. See: ",trim(path)
1733    errmsg = strcat(errmsg, ch10, msg)
1734    ierr = ierr + 1
1735  end if
1736 
1737  if (my_rank == master) then
1738    call wrtout(ab_out, msg)
1739  end if
1740  if (ierr /= 0) then
1741    MSG_ERROR(errmsg)
1742  end if
1743 
1744 #else
1745  ABI_UNUSED(prefix)
1746 #endif
1747 
1748 end subroutine abinit_doctor

m_errors/assert1 [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  assert1

FUNCTION

  Routines for argument checking and error handling. Report and die if
  any logical is false (used for arg range checking).

INPUTS

  l1,l2,.. logical values to be checked (array version is also provided)
  message(len=*)=tag with additiona information

PARENTS

CHILDREN

      abimem_get_info,abimem_shutdown,show_units,wrtout

SOURCE

341 subroutine assert1(l1,message,file,line)
342 
343 
344 !This section has been created automatically by the script Abilint (TD).
345 !Do not modify the following lines by hand.
346 #undef ABI_FUNC
347 #define ABI_FUNC 'assert1'
348 !End of the abilint section
349 
350  implicit none
351 
352 !Arguments ------------------------------------
353  integer,optional,intent(in) :: line
354  character(len=*),intent(in) :: message
355  character(len=*),optional,intent(in) :: file
356  logical,intent(in) :: l1
357 
358 !Local variables-------------------------------
359  integer :: f90line=0
360  character(len=500) :: f90name='Subroutine Unknown'
361 ! *************************************************************************
362 
363  if (.not.l1) then
364    if (PRESENT(line)) f90line=line
365    if (PRESENT(file)) f90name= basename(file)
366    call msg_hndl(message,'ERROR','PERS',f90name,f90line)
367  end if
368 
369 end subroutine assert1

m_errors/assert2 [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  assert2

FUNCTION

  Routines for argument checking and error handling. Report and die if

INPUTS

  l1,l2,.. logical values to be checked (array version is also provided)
  message(len=*)=tag with additional information

PARENTS

CHILDREN

      abimem_get_info,abimem_shutdown,show_units,wrtout

SOURCE

393 subroutine assert2(l1,l2,message,file,line)
394 
395 
396 !This section has been created automatically by the script Abilint (TD).
397 !Do not modify the following lines by hand.
398 #undef ABI_FUNC
399 #define ABI_FUNC 'assert2'
400 !End of the abilint section
401 
402  implicit none
403 
404 !Arguments ------------------------------------
405  integer,optional,intent(in) :: line
406  character(len=*),intent(in) :: message
407  character(len=*),optional,intent(in) :: file
408  logical,intent(in) :: l1,l2
409 
410 !Local variables-------------------------------
411  integer :: f90line=0
412  character(len=500) :: f90name='Subroutine Unknown'
413 ! *************************************************************************
414 
415  if (.not.(l1.and.l2)) then
416   if (PRESENT(line)) f90line=line
417   if (PRESENT(file)) f90name= basename(file)
418   call msg_hndl(message,'ERROR','PERS',f90name,f90line)
419  end if
420 
421 end subroutine assert2

m_errors/assert3 [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  assert3

FUNCTION

  Routines for argument checking and error handling. Report and die if
  any logical is false (used for arg range checking).

INPUTS

  l1,l2,.. logical values to be checked (array version is also provided)
  message(len=*)=tag with additional information

PARENTS

CHILDREN

      abimem_get_info,abimem_shutdown,show_units,wrtout

SOURCE

445 subroutine assert3(l1,l2,l3,message,file,line)
446 
447 
448 !This section has been created automatically by the script Abilint (TD).
449 !Do not modify the following lines by hand.
450 #undef ABI_FUNC
451 #define ABI_FUNC 'assert3'
452 !End of the abilint section
453 
454  implicit none
455 
456 !Arguments ------------------------------------
457  integer,optional,intent(in) :: line
458  character(len=*),intent(in) :: message
459  character(len=*),optional,intent(in) :: file
460  logical,intent(in) :: l1,l2,l3
461 
462 !Local variables-------------------------------
463  integer :: f90line=0
464  character(len=500) :: f90name='Subroutine Unknown'
465 ! *************************************************************************
466 
467  if (.not.(l1.and.l2.and.l3)) then
468   if (PRESENT(line)) f90line=line
469   if (PRESENT(file)) f90name= basename(file)
470   call msg_hndl(message,'ERROR','PERS',f90name,f90line)
471  end if
472 
473 end subroutine assert3

m_errors/assert4 [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  assert4

FUNCTION

  Routines for argument checking and error handling. Report and die if
  any logical is false (used for arg range checking).

INPUTS

  l1,l2,.. logical values to be checked (array version is also provided)
  message(len=*)=tag with additional information

PARENTS

CHILDREN

      abimem_get_info,abimem_shutdown,show_units,wrtout

SOURCE

497 subroutine assert4(l1,l2,l3,l4,message,file,line)
498 
499 
500 !This section has been created automatically by the script Abilint (TD).
501 !Do not modify the following lines by hand.
502 #undef ABI_FUNC
503 #define ABI_FUNC 'assert4'
504 !End of the abilint section
505 
506  implicit none
507 
508 !Arguments ------------------------------------
509  integer,optional,intent(in) :: line
510  character(len=*),intent(in) :: message
511  character(len=*),optional,intent(in) :: file
512  logical,intent(in) :: l1,l2,l3,l4
513 
514 !Local variables-------------------------------
515  integer :: f90line=0
516  character(len=500) :: f90name='Subroutine Unknown'
517 ! *************************************************************************
518 
519  if (.not.(l1.and.l2.and.l3.and.l4)) then
520   if (PRESENT(line)) f90line=line
521   if (PRESENT(file)) f90name= basename(file)
522   call msg_hndl(message,'ERROR','PERS',f90name,f90line)
523  end if
524 
525 end subroutine assert4

m_errors/assert_eq2 [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  assert_eq2

FUNCTION

  Report and die gracefully if integers not all equal (used for size checking).

INPUTS

  l1,l2,.. Integers to be checked (array version is also provided)
  message(len=*)=tag with additional information

SOURCE

139 function assert_eq2(l1,l2,message,file,line)
140 
141 
142 !This section has been created automatically by the script Abilint (TD).
143 !Do not modify the following lines by hand.
144 #undef ABI_FUNC
145 #define ABI_FUNC 'assert_eq2'
146 !End of the abilint section
147 
148  implicit none
149 
150 !Arguments ------------------------------------
151  integer,intent(in) :: l1,l2
152  integer,optional,intent(in) :: line
153  integer :: assert_eq2
154  character(len=*),intent(in) :: message
155  character(len=*),optional,intent(in) :: file
156 
157 !Local variables-------------------------------
158  integer :: f90line=0
159  character(len=500) :: f90name='Subroutine Unknown'
160 
161 ! *************************************************************************
162 
163  if (l1==l2) then
164   assert_eq2=l1
165  else
166   if (PRESENT(line)) f90line=line
167   if (PRESENT(file)) f90name= basename(file)
168   call msg_hndl(message,'ERROR','PERS',f90name,line)
169  end if
170 
171 end function assert_eq2

m_errors/assert_eq3 [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  assert_eq3

FUNCTION

  Report and die gracefully if integers not all equal (used for size checking).

INPUTS

  l1,l2,.. Integers to be checked (array version is also provided)
  message(len=*)=tag with additional information

SOURCE

189 function assert_eq3(l1,l2,l3,message,file,line)
190 
191 
192 !This section has been created automatically by the script Abilint (TD).
193 !Do not modify the following lines by hand.
194 #undef ABI_FUNC
195 #define ABI_FUNC 'assert_eq3'
196 !End of the abilint section
197 
198  implicit none
199 
200 !Arguments ------------------------------------
201  integer,intent(in) :: l1,l2,l3
202  integer,optional,intent(in) :: line
203  integer :: assert_eq3
204  character(len=*),intent(in) :: message
205  character(len=*),optional,intent(in) :: file
206 
207 !Local variables-------------------------------
208  integer :: f90line=0
209  character(len=500) :: f90name='Subroutine Unknown'
210 ! *************************************************************************
211 
212  if (l1==l2.and.l2==l3) then
213   assert_eq3=l1
214  else
215   if (PRESENT(line)) f90line=line
216   if (PRESENT(file)) f90name= basename(file)
217   call msg_hndl(message,'ERROR','PERS',f90name,line)
218  end if
219 
220 end function assert_eq3

m_errors/assert_eq4 [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  assert_eq4

FUNCTION

  Report and die gracefully if integers not all equal (used for size checking).

INPUTS

  l1,l2,.. Integers to be checked (array version is also provided)
  message(len=*)=tag with additional information

SOURCE

238 function assert_eq4(l1,l2,l3,l4,message,file,line)
239 
240 
241 !This section has been created automatically by the script Abilint (TD).
242 !Do not modify the following lines by hand.
243 #undef ABI_FUNC
244 #define ABI_FUNC 'assert_eq4'
245 !End of the abilint section
246 
247  implicit none
248 
249 !Arguments ------------------------------------
250 !scalars
251  integer,intent(in) :: l1,l2,l3,l4
252  integer,optional,intent(in) :: line
253  integer :: assert_eq4
254  character(len=*),intent(in) :: message
255  character(len=*),optional,intent(in) :: file
256 
257 !Local variables-------------------------------
258  integer :: f90line=0
259  character(len=500) :: f90name='Subroutine Unknown'
260 ! *************************************************************************
261 
262  if (l1==l2.and.l2==l3.and.l3==l4) then
263   assert_eq4=l1
264  else
265   if (PRESENT(line)) f90line=line
266   if (PRESENT(file)) f90name= basename(file)
267   call msg_hndl(message,'ERROR','PERS',f90name,line)
268  end if
269 
270 end function assert_eq4

m_errors/assert_eqn [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  assert_eqn

FUNCTION

  Report and die gracefully if integers not all equal (used for size checking).

SOURCE

284 function assert_eqn(nn,message,file,line)
285 
286 
287 !This section has been created automatically by the script Abilint (TD).
288 !Do not modify the following lines by hand.
289 #undef ABI_FUNC
290 #define ABI_FUNC 'assert_eqn'
291 !End of the abilint section
292 
293  implicit none
294 
295 !Arguments ------------------------------------
296 !scalars
297  integer,optional,intent(in) :: line
298  integer :: assert_eqn
299  character(len=*),intent(in) :: message
300  character(len=*),optional,intent(in) :: file
301 !arrays
302  integer,intent(in) :: nn(:)
303 
304 !Local variables-------------------------------
305  integer :: f90line=0
306  character(len=500) :: f90name='Subroutine Unknown'
307 ! *************************************************************************
308 
309  if (ALL(nn(2:)==nn(1))) then
310   assert_eqn=nn(1)
311  else
312   if (PRESENT(line)) f90line=line
313   if (PRESENT(file)) f90name= basename(file)
314   call msg_hndl(message,'ERROR','PERS',f90name,line)
315  end if
316 
317 end function assert_eqn

m_errors/assert_v [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  assert_v

FUNCTION

  Routines for argument checking and error handling. Report and die if
  any logical is false (used for arg range checking).

PARENTS

CHILDREN

      abimem_get_info,abimem_shutdown,show_units,wrtout

SOURCE

545 subroutine assert_v(n,message,file,line)
546 
547 
548 !This section has been created automatically by the script Abilint (TD).
549 !Do not modify the following lines by hand.
550 #undef ABI_FUNC
551 #define ABI_FUNC 'assert_v'
552 !End of the abilint section
553 
554  implicit none
555 
556 !Arguments ------------------------------------
557  integer,optional,intent(in) :: line
558  character(len=*),intent(in) :: message
559  character(len=*),optional,intent(in) :: file
560  logical,intent(in) :: n(:)
561 
562 !Local variables-------------------------------
563  integer :: f90line=0
564  character(len=500) :: f90name='Subroutine Unknown'
565 ! *************************************************************************
566 
567  if (.not.ALL(n)) then
568   if (PRESENT(line)) f90line=line
569   if (PRESENT(file)) f90name= basename(file)
570   call msg_hndl(message,'ERROR','PERS',f90name,f90line)
571  end if
572 
573 end subroutine assert_v

m_errors/bigdft_lib_error [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  bigdft_lib_error

FUNCTION

  Stop the code if bigdft library has not been enabled.
  Interfaced with the CPP macro BIGDFT_NOTENABLED_ERROR

INPUTS

  line=line number of the file where problem occurred
  file=name of the f90 file containing the caller

PARENTS

CHILDREN

      abimem_get_info,abimem_shutdown,show_units,wrtout

SOURCE

1536 subroutine bigdft_lib_error(file,line)
1537 
1538 
1539 !This section has been created automatically by the script Abilint (TD).
1540 !Do not modify the following lines by hand.
1541 #undef ABI_FUNC
1542 #define ABI_FUNC 'bigdft_lib_error'
1543 !End of the abilint section
1544 
1545  implicit none
1546 
1547 !Arguments ------------------------------------
1548  integer,optional,intent(in) :: line
1549  character(len=*),optional,intent(in) :: file
1550 
1551 !Local variables-------------------------------
1552  character(len=500) :: message
1553 
1554 ! *********************************************************************
1555 
1556   write(message,'(4a)') ch10,&
1557 &  ' BigDFT support has not been enabled.', ch10, &
1558 &  ' Action, used the flag --enable-bigdft when configuring.'
1559 
1560  if (PRESENT(file) .and. PRESENT(line)) then
1561    call msg_hndl(message,"ERROR","PERS",file=file,line=line)
1562  else
1563    call msg_hndl(message,"ERROR", "PERS")
1564  end if
1565 
1566 end subroutine bigdft_lib_error

m_errors/check_mpi_ierr [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  check_mpi_ierr

FUNCTION

  Basic error handler for MPI calls. This routine is usually interfaced through some macro defined in abi_common.h

INPUTS

  ierr=Exit status reported by an MPI call.
  line=line number of the file where problem occurred
  file=name of the f90 file containing the caller

OUTPUT

  Write error message thep stop execution.

PARENTS

CHILDREN

      abimem_get_info,abimem_shutdown,show_units,wrtout

SOURCE

1037 subroutine check_mpi_ierr(ierr,msg,file,line)
1038 
1039 
1040 !This section has been created automatically by the script Abilint (TD).
1041 !Do not modify the following lines by hand.
1042 #undef ABI_FUNC
1043 #define ABI_FUNC 'check_mpi_ierr'
1044 !End of the abilint section
1045 
1046  implicit none
1047 
1048 !Arguments ------------------------------------
1049  integer,intent(in) :: ierr
1050  integer,optional,intent(in) :: line
1051  character(len=*),intent(in) :: msg
1052  character(len=*),optional,intent(in) :: file
1053 
1054 !Local variables-------------------------------
1055  integer,parameter :: mpi_msg_len=1000
1056  integer :: f90line,ilen,ierr2
1057  character(len=500) :: f90name='Subroutine Unknown'
1058  character(len=mpi_msg_len) :: mpi_msg_error
1059  character(len=mpi_msg_len+500) :: my_msg
1060 ! *********************************************************************
1061 
1062 #ifdef HAVE_MPI
1063  if (ierr==MPI_SUCCESS) RETURN
1064  call MPI_ERROR_STRING(ierr, mpi_msg_error, ilen, ierr2)
1065 #else
1066  ilen=0; ierr2=0
1067  mpi_msg_error = " Check_mpi_ierr should not be called in non-MPI mode!"
1068  if (ierr==0) RETURN
1069 #endif
1070 
1071  if (ilen>mpi_msg_len) write(std_out,*)" Warning_ MPI message has been truncated!"
1072  if (ierr2/=0) write(std_out,*)" Warning: MPI_ERROR_STRING returned ierr2= ",ierr2
1073 
1074  f90line=0; if (PRESENT(line)) f90line=line
1075  if (PRESENT(file)) f90name = basename(file)
1076  my_msg = TRIM(msg)//ch10//TRIM(mpi_msg_error)
1077 
1078  call msg_hndl(my_msg,"ERROR","PERS",file=f90name,line=f90line)
1079 
1080 end subroutine check_mpi_ierr

m_errors/die [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  die

FUNCTION

  Stop smoothly the execution in case of unexpected events reporting the
  line number and the file name where the error occurred as well as the
  MPI rank of the processor. This routine is usually interfaced through
  some macro defined in abi_common.h

INPUTS

  message=String containing additional information on the nature of the problem
  line=Line number of the file where problem occurred
  f90name=Name of the f90 file containing the caller

PARENTS

      m_errors,m_xc_vdw

CHILDREN

      abimem_get_info,abimem_shutdown,show_units,wrtout

SOURCE

773 subroutine die(message,file,line)
774 
775 
776 !This section has been created automatically by the script Abilint (TD).
777 !Do not modify the following lines by hand.
778 #undef ABI_FUNC
779 #define ABI_FUNC 'die'
780 !End of the abilint section
781 
782  implicit none
783 
784 !Arguments ------------------------------------
785  integer,optional,intent(in) :: line
786  character(len=*),intent(in) :: message
787  character(len=*),optional,intent(in) :: file
788 
789 !Local variables-------------------------------
790  integer :: rank
791  integer :: f90line=0
792  character(len=10) :: lnum,strank
793  character(len=500) :: f90name='Subroutine Unknown'
794  character(len=500) :: msg
795 
796 ! *********************************************************************
797 
798  if (PRESENT(line)) f90line=line
799  write(lnum,"(i0)")f90line
800 
801  ! === Determine my rank inside MPI_COMM_WORLD ===
802  rank = xmpi_comm_rank(xmpi_world)
803  write(strank,"(i0)")rank
804 
805  if (PRESENT(file)) f90name= basename(file)
806  msg=TRIM(f90name)//':'//TRIM(lnum)//' P'//TRIM(strank)
807 
808  write(msg,'(a,2x,2a,2x,a)')ch10,&
809 & TRIM(msg),ch10,&
810 & TRIM(message)
811 
812  call wrtout(std_out,msg,'PERS')
813  call abi_abort('PERS')
814 
815 end subroutine die

m_errors/msg_hndl [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  msg_hndl

FUNCTION

  Basic error handler for abinit. This routine is usually interfaced through some macro defined in abi_common.h

INPUTS

  message=string containing additional information on the nature of the problem
  level=string defining the type of problem. Possible values are
   COMMENT
   WARNING
   ERROR
   BUG
  line=line number of the file where problem occurred
  file=name of the f90 file containing the caller
  mode_paral=Either "COLL" or "PERS".
  NODUMP= (optional) if present dump config before stopping
  NOSTOP= (optional) if present don't stop even in the case of an error or a bug

OUTPUT

PARENTS

      m_errors

CHILDREN

      abimem_get_info,abimem_shutdown,show_units,wrtout

SOURCE

850 subroutine msg_hndl(message,level,mode_paral,file,line,NODUMP,NOSTOP)
851 
852 
853 !This section has been created automatically by the script Abilint (TD).
854 !Do not modify the following lines by hand.
855 #undef ABI_FUNC
856 #define ABI_FUNC 'msg_hndl'
857 !End of the abilint section
858 
859  implicit none
860 
861 !Arguments ------------------------------------
862  integer,optional,intent(in) :: line
863  logical,optional,intent(in) :: NODUMP,NOSTOP
864  character(len=*),intent(in) :: level,message
865  character(len=*),optional,intent(in) :: file
866  character(len=*),intent(in) :: mode_paral
867 
868 !Local variables-------------------------------
869  integer :: f90line,ierr
870  character(len=10) :: lnum
871  character(len=500) :: f90name
872  character(len=LEN(message)) :: my_msg
873  character(len=MAX(4*LEN(message),2000)) :: sbuf ! Increase size and keep fingers crossed!
874 
875 ! *********************************************************************
876 
877  if (PRESENT(line)) then
878    f90line=line
879  else
880    f90line=0
881  end if
882  write(lnum,"(i0)")f90line
883 
884  if (PRESENT(file)) then
885    f90name = basename(file)
886  else
887    f90name='Subroutine Unknown'
888  end if
889 
890  my_msg = lstrip(message)
891 
892  select case (toupper(level))
893 
894  case ('COMMENT','WARNING')
895 
896    write(sbuf,'(8a,i0,7a)')ch10,&
897      "--- !",TRIM(level),ch10,&
898      "src_file: ",TRIM(f90name),ch10,&
899      "src_line: ",f90line,ch10,&
900      "message: |",ch10,TRIM(indent(my_msg)),ch10,&
901      "...",ch10
902    call wrtout(std_out,sbuf,mode_paral)
903 
904  ! ERROR' or 'BUG'
905  case default
906 
907    if ((.not.present(NOSTOP)).and.(.not.present(NODUMP))) then
908      !call print_kinds()
909      !call xmpi_show_info()
910      !call dump_config(std_out)
911      ! Dump the backtrace if the compiler supports it.
912      if (m_errors_show_backtrace == 1) call show_backtrace()
913    end if
914 
915    write(sbuf,'(8a,i0,2a,i0,7a)')ch10,&
916      "--- !",TRIM(level),ch10,&
917      "src_file: ",TRIM(f90name),ch10,&
918      "src_line: ",f90line,ch10,&
919      "mpi_rank: ",xmpi_comm_rank(xmpi_world),ch10,&
920      "message: |",ch10,TRIM(indent(my_msg)),ch10,&
921      "...",ch10
922    call wrtout(std_out,sbuf,mode_paral)
923 
924    if (.not.present(NOSTOP)) then
925      ! The first MPI proc that gets here, writes the ABI_MPIABORTFILE with the message!
926      ! The file is written only if nprocs > 1. Do not change this behaviour!
927      if (.not. file_exists(ABI_MPIABORTFILE) .and. xmpi_comm_size(xmpi_world) > 1) then
928         call lock_and_write(ABI_MPIABORTFILE, sbuf, ierr)
929      end if
930      ! And now we die!
931      call abi_abort(mode_paral,print_config=.FALSE.)
932    end if
933 
934  end select
935 
936 end subroutine msg_hndl

m_errors/netcdf_check [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  netcdf_check

FUNCTION

  Error handler for Netcdf calls.

INPUTS

  ncerr=Status error returned by the Netcdf library.
  msg=User-defined string with info on the action that was performed
  file= name of the file.
  line= line number.

NOTES

  This routine is usually interfaced with the macros defined in abi_common.h

PARENTS

CHILDREN

      abimem_get_info,abimem_shutdown,show_units,wrtout

SOURCE

601 subroutine netcdf_check(ncerr,msg,file,line)
602 
603 
604 !This section has been created automatically by the script Abilint (TD).
605 !Do not modify the following lines by hand.
606 #undef ABI_FUNC
607 #define ABI_FUNC 'netcdf_check'
608 !End of the abilint section
609 
610  implicit none
611 
612 !Arguments ------------------------------------
613  integer,intent(in) :: ncerr
614  character(len=*),intent(in) :: msg
615  character(len=*),optional,intent(in) :: file
616  integer,optional,intent(in) :: line
617 
618 !Local variables-------------------------------
619  integer :: f90line
620  character(len=500) :: f90name
621  character(len=1024) :: nc_msg
622  character(len=2048) :: my_msg
623 
624 ! *************************************************************************
625 
626 #ifdef HAVE_NETCDF
627  if (ncerr /= NF90_NOERR) then
628    if (PRESENT(line)) then
629      f90line=line
630    else
631      f90line=0
632    end if
633    if (PRESENT(file)) then
634      f90name = basename(file)
635    else
636      f90name='Subroutine Unknown'
637    end if
638    !
639    ! Append Netcdf string to user-defined message.
640    write(nc_msg,'(a,2x,a)')' - NetCDF library returned:',TRIM(nf90_strerror(ncerr))
641    !write(std_out,*)TRIM(nf90_strerror(ncerr))
642    my_msg = TRIM(msg) // TRIM(nc_msg)
643 
644    call msg_hndl(my_msg,"ERROR","PERS",f90name,f90line)
645  end if
646 #endif
647 
648 end subroutine netcdf_check

m_errors/sentinel [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  sentinel

FUNCTION

  Announce the entering and the exiting from a function. Useful for poor-man debugging.

INPUTS

  level=1 when entering, 2 for exit.
  mode_paral= ['COLL'|'PERS'|'COLL_SILENT|PERS_SILENT']
   'COLL' and 'PERS' refer to the output mode used in wrtout to report the message.
   'COLL_SILENT' and 'PERS_SILENT' can be used if the procedure is called several times inside a loop.
   In this case sentinel will report only the first entry and the first exit using either 'COLL' or 'PERS' mode.
  file=File name
  func=Name of the procedure to be tested (passed through ABI_FUNC macro)
  [line]=Line number. Defaults to 0.

NOTES

  This routine is usually interfaced with the macros defined in abi_common.h

PARENTS

CHILDREN

      abimem_get_info,abimem_shutdown,show_units,wrtout

SOURCE

680 subroutine sentinel(level,mode_paral,file,func,line)
681 
682 
683 !This section has been created automatically by the script Abilint (TD).
684 !Do not modify the following lines by hand.
685 #undef ABI_FUNC
686 #define ABI_FUNC 'sentinel'
687 !End of the abilint section
688 
689  implicit none
690 
691 !Arguments ------------------------------------
692  integer,intent(in) :: level
693  integer,optional,intent(in) :: line
694  character(len=*),intent(in) :: mode_paral
695  character(len=*),optional,intent(in) :: func
696  character(len=*),optional,intent(in) :: file
697 
698 !Local variables-------------------------------
699  integer,save :: level_save=0
700  integer :: ii
701  integer :: f90line
702  character(len=500),save :: func_save
703  character(len=4) :: my_mode
704  character(len=10) :: lnum
705  character(len=500) :: my_func, my_file
706  character(len=500) :: msg
707 
708 ! *********************************************************************
709 
710  ! initialize the variable
711  my_func = 'Function Unknown'; if (PRESENT(func)) my_func = basename(func)
712  my_file = "File Unknown"; if (PRESENT(file)) my_file = basename(file)
713 
714  level_save=level; func_save=my_func
715 
716  f90line=0; if (PRESENT(line)) f90line=line
717 
718  if (toupper(mode_paral)=='COLL_SILENT'.or.toupper(mode_paral)=='PERS_SILENT') then
719     ! * Silent mode, check if we are inside a loop.
720     if (level==level_save .and. my_func==func_save) RETURN
721     ii = index( toupper(mode_paral), '_SILENT')
722     my_mode=toupper(mode_paral(1:ii-1))
723  else ! * Normal mode.
724     my_mode=mode_paral
725  end if
726 
727  if (my_mode/='COLL'.or.my_mode/='PERS') my_mode='COLL'
728 
729  write(lnum,"(i0)")f90line
730  my_func= TRIM(my_func)//"@"//TRIM(my_file)//":"//TRIM(lnum)
731 
732  if (level==1) then
733     msg = ' '//TRIM(my_func)//' >>>>> ENTER'//ch10
734  else if (level==2) then
735     msg = ' '//TRIM(my_func)//' >>>>> EXIT '//ch10
736  else
737     call die('Wrong level', &
738 &   __FILE__,&
739 &   __LINE__)
740  end if
741 
742  call wrtout(std_out,msg,my_mode)
743  call flush_unit(std_out)
744 
745 end subroutine sentinel

m_errors/set_backtrace_onerr [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

 set_backtrace_onerr

FUNCTION

  1 to activate show_backtrace call in msg_hndl. 0 to disable it

PARENTS

CHILDREN

      abimem_get_info,abimem_shutdown,show_units,wrtout

SOURCE

955 subroutine set_backtrace_onerr(iflag)
956 
957 !Arguments ------------------------------------
958 
959 !This section has been created automatically by the script Abilint (TD).
960 !Do not modify the following lines by hand.
961 #undef ABI_FUNC
962 #define ABI_FUNC 'set_backtrace_onerr'
963 !End of the abilint section
964 
965  integer,intent(in) :: iflag
966 ! *********************************************************************
967 
968   m_errors_show_backtrace = iflag
969 
970 end subroutine set_backtrace_onerr

m_errors/show_backtrace [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

 show_backtrace

FUNCTION

  shows a backtrace at an arbitrary place in user code.
  Program execution continues normally afterwards.
  The backtrace information is printed to the unit corresponding to ERROR_UNIT in ISO_FORTRAN_ENV.
  This is a (Gfortran extension| Ifort Extension)

PARENTS

      m_errors

CHILDREN

      abimem_get_info,abimem_shutdown,show_units,wrtout

SOURCE

 993 subroutine show_backtrace()
 994 
 995 
 996 !This section has been created automatically by the script Abilint (TD).
 997 !Do not modify the following lines by hand.
 998 #undef ABI_FUNC
 999 #define ABI_FUNC 'show_backtrace'
1000 !End of the abilint section
1001 
1002 
1003 #if defined FC_GNU && defined HAVE_FC_BACKTRACE
1004   call backtrace()  ! Gfortran extension
1005 
1006 #elif defined FC_INTEL
1007   call TRACEBACKQQ(USER_EXIT_CODE=-1)  ! Ifort extension
1008 #endif
1009 
1010 end subroutine show_backtrace

m_errors/unused_ch [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  unused_ch

FUNCTION

  Helper function used to silence compiler warnings due to unused variables.
  Interfaced via the ABI_UNUSED macro.

INPUTS

  var=Scalar character value

OUTPUT

  None

PARENTS

CHILDREN

      signal

SOURCE

1363 elemental subroutine unused_ch(var)
1364 
1365 
1366 !This section has been created automatically by the script Abilint (TD).
1367 !Do not modify the following lines by hand.
1368 #undef ABI_FUNC
1369 #define ABI_FUNC 'unused_ch'
1370 !End of the abilint section
1371 
1372  implicit none
1373 
1374 !Arguments ------------------------------------
1375  character(len=*),intent(in) :: var
1376 
1377 !Local variables-------------------------------
1378  character(len=LEN(var)) :: dummy
1379 ! *********************************************************************
1380 
1381  dummy = var
1382 
1383 end subroutine unused_ch

m_errors/unused_cplx_dpc [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  unused_cplx_dpc

FUNCTION

  Helper function used to silence compiler warnings due to unused variables.
  Interfaced via the ABI_UNUSED macro.

INPUTS

  var=Scalar complex value

OUTPUT

  None

PARENTS

CHILDREN

      signal

SOURCE

1271 elemental subroutine unused_cplx_dpc(var)
1272 
1273 
1274 !This section has been created automatically by the script Abilint (TD).
1275 !Do not modify the following lines by hand.
1276 #undef ABI_FUNC
1277 #define ABI_FUNC 'unused_cplx_dpc'
1278 !End of the abilint section
1279 
1280  implicit none
1281 
1282 !Arguments ------------------------------------
1283  complex(dpc),intent(in) :: var
1284 
1285 !Local variables-------------------------------
1286  complex(dpc) :: dummy
1287 ! *********************************************************************
1288 
1289  dummy = var
1290 
1291 end subroutine unused_cplx_dpc

m_errors/unused_cplx_spc [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  unused_cplx_spc

FUNCTION

  Helper function used to silence compiler warnings due to unused variables.
  Interfaced via the ABI_UNUSED macro.

INPUTS

  var=Scalar complex value

OUTPUT

  None

SOURCE

1225 elemental subroutine unused_cplx_spc(var)
1226 
1227 
1228 !This section has been created automatically by the script Abilint (TD).
1229 !Do not modify the following lines by hand.
1230 #undef ABI_FUNC
1231 #define ABI_FUNC 'unused_cplx_spc'
1232 !End of the abilint section
1233 
1234  implicit none
1235 
1236 !Arguments ------------------------------------
1237  complex(spc),intent(in) :: var
1238 
1239 !Local variables-------------------------------
1240  complex(spc) :: dummy
1241 ! *********************************************************************
1242 
1243  dummy = var
1244 
1245 end subroutine unused_cplx_spc

m_errors/unused_int [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  unused_int

FUNCTION

  Helper function used to silence compiler warnings due to unused variables.
  Interfaced via the ABI_UNUSED macro.

INPUTS

  var=Scalar integer value

OUTPUT

  None

PARENTS

SOURCE

1103 elemental subroutine unused_int(var)
1104 
1105 
1106 !This section has been created automatically by the script Abilint (TD).
1107 !Do not modify the following lines by hand.
1108 #undef ABI_FUNC
1109 #define ABI_FUNC 'unused_int'
1110 !End of the abilint section
1111 
1112  implicit none
1113 
1114 !Arguments ------------------------------------
1115  integer,intent(in) :: var
1116 
1117 !Local variables-------------------------------
1118  integer :: dummy
1119 ! *********************************************************************
1120 
1121  dummy = var
1122 
1123 end subroutine unused_int

m_errors/unused_logical [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  unused_logical

FUNCTION

  Helper function used to silence compiler warnings due to unused variables.
  Interfaced via the ABI_UNUSED macro.

INPUTS

  var=Scalar logical value

OUTPUT

  None

PARENTS

CHILDREN

      signal

SOURCE

1317 elemental subroutine unused_logical(var)
1318 
1319 
1320 !This section has been created automatically by the script Abilint (TD).
1321 !Do not modify the following lines by hand.
1322 #undef ABI_FUNC
1323 #define ABI_FUNC 'unused_logical'
1324 !End of the abilint section
1325 
1326  implicit none
1327 
1328 !Arguments ------------------------------------
1329  logical,intent(in) :: var
1330 
1331 !Local variables-------------------------------
1332  logical :: dummy
1333 ! *********************************************************************
1334 
1335  dummy = var
1336 
1337 end subroutine unused_logical

m_errors/unused_real_dp [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  unused_real_dp

FUNCTION

  Helper function used to silence warning messages due to unused variables.
  Interfaced via the ABI_UNUSED macro.

INPUTS

  var=Scalar real value.

OUTPUT

  None

PARENTS

CHILDREN

      signal

SOURCE

1149 elemental subroutine unused_real_dp(var)
1150 
1151 
1152 !This section has been created automatically by the script Abilint (TD).
1153 !Do not modify the following lines by hand.
1154 #undef ABI_FUNC
1155 #define ABI_FUNC 'unused_real_dp'
1156 !End of the abilint section
1157 
1158  implicit none
1159 
1160 !Arguments ------------------------------------
1161  real(dp),intent(in) :: var
1162 
1163 !Local variables-------------------------------
1164  real(dp) :: dummy
1165 ! *********************************************************************
1166 
1167  dummy = var
1168 
1169 end subroutine unused_real_dp

m_errors/unused_real_sp [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  unused_real_sp

FUNCTION

  Helper function used to silence compiler warnings due to unused variables.
  Interfaced via the ABI_UNUSED macro. Target: one-dimensional real(dp) vector.

SOURCE

1184 elemental subroutine unused_real_sp(var)
1185 
1186 
1187 !This section has been created automatically by the script Abilint (TD).
1188 !Do not modify the following lines by hand.
1189 #undef ABI_FUNC
1190 #define ABI_FUNC 'unused_real_sp'
1191 !End of the abilint section
1192 
1193  implicit none
1194 
1195 !Arguments ------------------------------------
1196  real(sp),intent(in) :: var
1197 
1198 !Local variables-------------------------------
1199  real(sp) :: dummy
1200 ! *********************************************************************
1201 
1202  dummy = var
1203 
1204 end subroutine unused_real_sp

m_errors/xlf_set_sighandler [ Functions ]

[ Top ] [ m_errors ] [ Functions ]

NAME

  xlf_set_sighandler

FUNCTION

   Set the signal handler for IBM XLF

NOTES

   See http://publib.boulder.ibm.com/infocenter/compbgpl/v9v111/index.jsp?topic=/com.ibm.xlf111.bg.doc/xlfopg/fptrap.htm
   The XL Fortran exception handlers and related routines are:
   xl__ieee
   Produces a traceback and an explanation of the signal and continues execution by supplying the default IEEE result
   for the failed computation. This handler allows the program to produce the same results as if exception detection was not turned on.
   xl__trce
   Produces a traceback and stops the program.
   xl__trcedump
   Produces a traceback and a core file and stops the program.
   xl__sigdump
   Provides a traceback that starts from the point at which it is called and provides information about the signal.
   You can only call it from inside a user-written signal handler.
   It does not stop the program. To successfully continue, the signal handler must perform some cleanup after calling this subprogram.
   xl__trbk
   Provides a traceback that starts from the point at which it is called.
   You call it as a subroutine from your code, rather than specifying it with the -qsigtrap option. It requires no parameters. It does not stop the program.

PARENTS

CHILDREN

      abimem_get_info,abimem_shutdown,show_units,wrtout

SOURCE

1603 subroutine xlf_set_sighandler()
1604 
1605 
1606 !This section has been created automatically by the script Abilint (TD).
1607 !Do not modify the following lines by hand.
1608 #undef ABI_FUNC
1609 #define ABI_FUNC 'xlf_set_sighandler'
1610 !End of the abilint section
1611 
1612  implicit none
1613 
1614 !This section has been created automatically by the script Abilint (TD).
1615 !Do not modify the following lines by hand.
1616 #undef ABI_FUNC
1617 #define ABI_FUNC 'xlf_set_sighandler'
1618 !End of the abilint section
1619 
1620 ! *************************************************************************
1621 
1622 #ifdef FC_IBM
1623  call SIGNAL(SIGTRAP, xl__trcedump)
1624  call SIGNAL(SIGFPE, xl__trcedump)
1625 #endif
1626 
1627 end subroutine xlf_set_sighandler