1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-07-18 17:03:43 +02:00
qmckl/src/qmckl.org

65 lines
1.6 KiB
Org Mode
Raw Normal View History

2020-11-05 15:34:58 +01:00
** =qmckl.h= header file
2020-10-16 13:58:05 +02:00
2020-11-05 15:34:58 +01:00
This file produces the =qmckl.h= header file, which is to be included
when qmckl functions are used.
2020-10-22 01:24:14 +02:00
2020-11-05 15:34:58 +01:00
We also create here the =qmckl_f.f90= which is the Fortran interface file.
2020-10-16 13:58:05 +02:00
2020-11-05 15:34:58 +01:00
*** Top of header files :noexport:
2020-11-05 15:27:25 +01:00
2020-11-05 15:34:58 +01:00
#+BEGIN_SRC C :tangle qmckl.h
2020-10-16 13:58:05 +02:00
#ifndef QMCKL_H
#define QMCKL_H
2020-10-22 00:50:07 +02:00
#include <stdlib.h>
#include <stdint.h>
2020-11-06 12:10:20 +01:00
#include <math.h>
2020-11-05 15:34:58 +01:00
#+END_SRC
2020-10-16 13:58:05 +02:00
2020-11-05 15:34:58 +01:00
#+BEGIN_SRC f90 :tangle qmckl_f.f90
2020-11-05 12:57:39 +01:00
module qmckl
use, intrinsic :: iso_c_binding
2020-11-05 15:34:58 +01:00
#+END_SRC
2020-11-05 12:57:39 +01:00
2020-11-05 15:34:58 +01:00
The bottoms of the files are located in the [[qmckl_footer.org]] file.
2020-11-05 15:27:25 +01:00
2020-11-05 15:34:58 +01:00
*** Constants
2020-10-16 13:58:05 +02:00
2020-11-05 15:34:58 +01:00
**** Success/failure
2020-10-16 13:58:05 +02:00
2020-11-05 15:34:58 +01:00
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=.
2020-10-16 13:58:05 +02:00
2020-11-05 15:34:58 +01:00
#+BEGIN_SRC C :comments org :tangle qmckl.h
2020-10-16 13:58:05 +02:00
#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-11-05 15:34:58 +01:00
#+END_SRC
2020-10-16 13:58:05 +02:00
2020-11-05 15:34:58 +01:00
#+BEGIN_SRC f90 :comments org :tangle qmckl_f.f90
2020-11-05 12:57:39 +01:00
integer, parameter :: QMCKL_SUCCESS = 0
integer, parameter :: QMCKL_FAILURE = 0
2020-11-05 15:34:58 +01:00
#+END_SRC
2020-10-16 13:58:05 +02:00
2020-11-05 15:34:58 +01:00
**** Precision-related constants
2020-10-16 13:58:05 +02:00
2020-11-05 15:34:58 +01:00
Controlling numerical precision enables optimizations. Here, the
default parameters determining the target numerical precision and
range are defined.
2020-10-16 19:42:12 +02:00
2020-11-05 15:34:58 +01:00
#+BEGIN_SRC C :comments org :tangle qmckl.h
2020-10-16 13:58:05 +02:00
#define QMCKL_DEFAULT_PRECISION 53
2020-10-16 19:42:12 +02:00
#define QMCKL_DEFAULT_RANGE 11
2020-11-05 15:34:58 +01:00
#+END_SRC
2020-10-16 13:58:05 +02:00
2020-11-05 15:34:58 +01:00
#+BEGIN_SRC f90 :comments org :tangle qmckl_f.f90
2020-11-05 12:57:39 +01:00
integer, parameter :: QMCKL_DEFAULT_PRECISION = 53
integer, parameter :: QMCKL_DEFAULT_RANGE = 11
2020-11-05 15:34:58 +01:00
#+END_SRC
2020-11-05 15:27:25 +01:00
2020-10-22 00:50:07 +02:00
2020-11-05 15:34:58 +01:00
# -*- mode: org -*-
# vim: syntax=c