2020-10-16 13:58:05 +02:00
|
|
|
# -*- mode: org -*-
|
|
|
|
# vim: syntax=c
|
|
|
|
#+TITLE: QMCkl C header
|
|
|
|
|
2020-10-22 01:24:14 +02:00
|
|
|
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/htmlize.css"/>
|
|
|
|
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/readtheorg.css"/>
|
|
|
|
#+HTML_HEAD: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
|
|
|
#+HTML_HEAD: <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
|
|
|
|
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/lib/js/jquery.stickytableheaders.js"></script>
|
|
|
|
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/readtheorg/js/readtheorg.js"></script>
|
|
|
|
|
2020-10-16 19:42:12 +02:00
|
|
|
This file produces the =qmckl.h= header file, which is included in all
|
|
|
|
other C header files. It is the main entry point to the library.
|
2020-10-16 13:58:05 +02:00
|
|
|
|
2020-11-05 12:57:39 +01:00
|
|
|
We also create the =qmckl_f.f90= which is the Fortran equivalent.
|
|
|
|
|
2020-10-16 13:58:05 +02:00
|
|
|
#+BEGIN_SRC C :tangle qmckl.h
|
|
|
|
#ifndef QMCKL_H
|
|
|
|
#define QMCKL_H
|
2020-10-22 00:50:07 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdint.h>
|
2020-10-16 13:58:05 +02:00
|
|
|
#+END_SRC
|
|
|
|
|
2020-11-05 12:57:39 +01:00
|
|
|
#+BEGIN_SRC f90 :tangle qmckl_f.f90
|
|
|
|
module qmckl
|
|
|
|
use, intrinsic :: iso_c_binding
|
|
|
|
#+END_SRC
|
|
|
|
|
2020-10-16 13:58:05 +02:00
|
|
|
* Constants
|
|
|
|
|
|
|
|
** Success/failure
|
|
|
|
|
|
|
|
These are the codes returned by the functions to indicate success
|
|
|
|
or failure. All such functions should have as a return type =qmckl_exit_code=.
|
|
|
|
|
|
|
|
#+BEGIN_SRC C :tangle qmckl.h
|
|
|
|
#define QMCKL_SUCCESS 0
|
|
|
|
#define QMCKL_FAILURE 1
|
|
|
|
|
2020-10-22 00:50:07 +02:00
|
|
|
typedef int32_t qmckl_exit_code;
|
|
|
|
typedef int64_t qmckl_context ;
|
|
|
|
|
2020-10-16 13:58:05 +02:00
|
|
|
#+END_SRC
|
|
|
|
|
2020-11-05 12:57:39 +01:00
|
|
|
#+BEGIN_SRC f90 :tangle qmckl_f.f90
|
|
|
|
integer, parameter :: QMCKL_SUCCESS = 0
|
|
|
|
integer, parameter :: QMCKL_FAILURE = 0
|
|
|
|
#+END_SRC
|
2020-10-16 13:58:05 +02:00
|
|
|
|
|
|
|
** Precision-related constants
|
|
|
|
|
2020-10-16 19:42:12 +02:00
|
|
|
Controlling numerical precision enables optimizations. Here, the
|
|
|
|
default parameters determining the target numerical precision and
|
|
|
|
range are defined.
|
|
|
|
|
2020-10-16 13:58:05 +02:00
|
|
|
#+BEGIN_SRC C :tangle qmckl.h
|
|
|
|
#define QMCKL_DEFAULT_PRECISION 53
|
2020-10-16 19:42:12 +02:00
|
|
|
#define QMCKL_DEFAULT_RANGE 11
|
2020-10-16 13:58:05 +02:00
|
|
|
#+END_SRC
|
|
|
|
|
2020-11-05 12:57:39 +01:00
|
|
|
#+BEGIN_SRC f90 :tangle qmckl_f.f90
|
|
|
|
integer, parameter :: QMCKL_DEFAULT_PRECISION = 53
|
|
|
|
integer, parameter :: QMCKL_DEFAULT_RANGE = 11
|
|
|
|
#+END_SRC
|
|
|
|
|
2020-10-16 13:58:05 +02:00
|
|
|
* Header files
|
|
|
|
|
2020-10-16 19:42:12 +02:00
|
|
|
All the functions expoed in the API are defined in the following
|
|
|
|
header files.
|
|
|
|
|
2020-10-16 13:58:05 +02:00
|
|
|
#+BEGIN_SRC C :tangle qmckl.h
|
2020-10-22 00:50:07 +02:00
|
|
|
|
2020-10-16 23:56:22 +02:00
|
|
|
#include "qmckl_memory.h"
|
2020-10-16 13:58:05 +02:00
|
|
|
#include "qmckl_context.h"
|
2020-10-22 00:50:07 +02:00
|
|
|
|
|
|
|
#include "qmckl_distance.h"
|
2020-10-25 15:02:37 +01:00
|
|
|
#include "qmckl_ao.h"
|
2020-10-16 13:58:05 +02:00
|
|
|
#+END_SRC
|
|
|
|
|
2020-11-05 12:57:39 +01:00
|
|
|
#+BEGIN_SRC f90 :tangle qmckl_f.f90
|
|
|
|
! include 'qmckl_memory.fh'
|
|
|
|
include 'qmckl_context.fh'
|
|
|
|
include 'qmckl_distance.fh'
|
|
|
|
include 'qmckl_ao.fh'
|
|
|
|
#+END_SRC
|
|
|
|
|
2020-10-16 13:58:05 +02:00
|
|
|
* End of header
|
|
|
|
|
|
|
|
#+BEGIN_SRC C :tangle qmckl.h
|
|
|
|
#endif
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
2020-11-05 12:57:39 +01:00
|
|
|
#+BEGIN_SRC f90 :tangle qmckl_f.f90
|
|
|
|
end module qmckl
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
|
|
* Include all other org files here :noexport:
|
|
|
|
|
|
|
|
#+INCLUDE: qmckl_memory.org
|
|
|
|
#+INCLUDE: qmckl_context.org
|
|
|
|
#+INCLUDE: qmckl_distance.org
|
|
|
|
#+INCLUDE: qmckl_ao.org
|