welcome: please sign in
location: Diff for "For BDF developers"
Differences between revisions 9 and 25 (spanning 16 versions)
Revision 9 as of 2014-04-21 09:42:56
Size: 3105
Editor: 10
Comment:
Revision 25 as of 2020-06-28 11:56:15
Size: 5290
Editor: bsuo
Comment:
Deletions are marked like this. Additions are marked like this.
Line 25: Line 25:
 2. Copy the directory "newmodule" into BDF source code directory $BDFHOME/source and add it to svn version control by "svn add newmodule".
 3. Copy a Makefile from any BDF module directory to "newmodule" to compile and link you program.
4. If you program is linked correctly, you will have a executable file name "newmodule.x" in the directory $BDFHOME/bin.
 5. Append a line with the content "newmodule" into the file "$BDFHOME/database/program.dat". This file defines all available BDF modules which can be executed by BDF driver.
 6
. Edit the file "$BDFHOME/database/xianest.mh". Add your module name "newmodule "into variable PRGLIST.
 2. Copy the directory "newmodule" into BDF source code directory $BDFHOME/source.
 #3. Copy a Makefile from any BDF module directory to "newmodule" to compile and link you program. 4. Append a line with the content "newmodule" into the file "$BDFHOME/database/program.dat". This file defines all available BDF modules which can be executed by BDF driver.
 3. Edit the file "$BDFHOME/database/xianest.mh". Add your module name "newmodule "into variable PRGLIST.
Line 31: Line 29:
 7. Edit the file "$BDFHOME/configure.in", add you module name "newmodule" into variable "xianlistf"
     xianlistf = "class module compass sys_util ... newmodule"
 8. Goto directory "$BDFHOME" and run command "autoconf" to generate new configure file.
 4. Edit the file "$BDFHOME/configure.in", add you module name "newmodule" into variable "xianlistf"(module)/"xianlistlib"(Library)/"xianlistprog"(program). For example: xianlistf = "class module compass sys_util ... newmodule"
 5. Edit $BDFHOME/config/extralib.mh to add library for you new module and program. For example:
ifeq ($(strip $(PROGNAME)),xianci)
  LEXTR = -lxianci_util -lmcmodule -lmcscf_util
endif
Line 35: Line 35:
After add module and generate new configure file, you can configure BDF package and compile BDF to check if your module is compiled correctly.  6. Goto directory "$BDFHOME" and run command "autoconf" to generate new configure file.
 7. Configure and make. If your program is linked correctly, you will have a executable file name "newmodule.x" in the directory $BDFHOME/bin.
 8. add it to git control by "git add newmodule". Add tests and run all the tests.


#After add module and generate new configure file, you can configure BDF package and compile BDF to check #if your module is compiled correctly.
Line 54: Line 59:
Add some codes to output some important numbers in standard out. In $BDFHOME/sys_util/sysutil.F90, there is a subroutine name "check data" 1 Add some codes to output some important numbers in standard out. In $BDFHOME/sys_util/sysutil.F90, there is a subroutine name "checkdata"
Line 70: Line 75:
You an write integer or real number as formatted form to standard out. The output looks link You can write integer or real number as formatted form to standard out. The output looks link
Line 72: Line 77:
  CHECKDATA:HF:ENERGY: -152.05437318
Line 73: Line 79:
For example, you want to print a number "ene=-152.05437318", you can add line
   call checkdata("c",1,8,1,ene,"HF","ENERGY")
Line 74: Line 82:
You will have a line
  CHECKDATA:HF:ENERGY: -152.05437318

2 Now, you can write down a BDF input file named "test070.inp" and put it into directory "$BDFHOME/tests/input".
   
3 You can generate check file name "test070.check" and put it into directory "$BDFHOME/tests/check". Support you have run BDF with input file test070.inp and redirect output into a file name log. You can generate check file via a sample command
  grep "CHECKDATA" log >test070.check
Line 76: Line 91:

== Some interesting libraries ==
Some libraries developed by Qinming Sun. It may useful but still not used in BDF.
{{{
  libcint - Gaussian integrals. https://github.com/sunqm/libcint
  pyscf - Python SCF. http://sunqm.net/pyscf/overview.html
}}}

== BDF atomic orbital order ==
The atomic orbital order of BDF is sorted as fortran array
{{{
    AO(ncgto,nsph,nshell)
}}}

== Spherical GTO order ==
{{{
  p - -1, 0, 1
  d - -2, -1, 0, 1, +1
  f - -3, -2, -1, 0, 1, +1, +2, +3
  etc.
}}}

== BDF directory ==
=== source ===
{{{
There are two kinds of directories in source. One type that contains a file named mail.F90, will be compiles into a executable file (BDF module). Another type that does not contain mail.F90, should be named as name_util. This type of directories will be compiled as libname.a that is share library.
}}}

=== tests ===
{{{
   input --- examples and test inputs
  check --- data used to check BDF codes
  failed --- failed tests
  molecule --- geometries of several molecules could be used to set up benchmark calculations.
}}}

=== BDF easy input developing guide ===
[[ bdfeasyinputdevguid ]]

=== BDF daily test report ===
[[ bdfdailytest ]]

BDF development manual

 This manual is for developers. 

How to add a new module into BDF package

  1. Prepare you source codes and store it in a directory named "newmodule" .
  2. Copy the directory "newmodule" into BDF source code directory $BDFHOME/source. #3. Copy a Makefile from any BDF module directory to "newmodule" to compile and link you program. 4. Append a line with the content "newmodule" into the file "$BDFHOME/database/program.dat". This file defines all available BDF modules which can be executed by BDF driver.
  3. Edit the file "$BDFHOME/database/xianest.mh". Add your module name "newmodule "into variable PRGLIST.
    • PRGLIST = dpdmrpt2 compass xuanyuan mcscf ... newmode
  4. Edit the file "$BDFHOME/configure.in", add you module name "newmodule" into variable "xianlistf"(module)/"xianlistlib"(Library)/"xianlistprog"(program). For example: xianlistf = "class module compass sys_util ... newmodule"
  5. Edit $BDFHOME/config/extralib.mh to add library for you new module and program. For example:

ifeq ($(strip $(PROGNAME)),xianci)

  • LEXTR = -lxianci_util -lmcmodule -lmcscf_util

endif

  1. Goto directory "$BDFHOME" and run command "autoconf" to generate new configure file.
  2. Configure and make. If your program is linked correctly, you will have a executable file name "newmodule.x" in the directory $BDFHOME/bin.
  3. add it to git control by "git add newmodule". Add tests and run all the tests.

#After add module and generate new configure file, you can configure BDF package and compile BDF to check #if your module is compiled correctly.

Run all tests of BDF

In directory $BDFHOME/sbin, there is a shell script name "testall" can be used to run all BDF tests. If you use vi edit this file, you will see lines like

## May. 26, 2011 -BSUO- run all tests to check program automatically

export BDFHOME=~/bdfsrc #Anot/0.5.dev
export BDF_TMPDIR=/tmp/$RANDOM
...

You need to modify "BDFHOME". Run this script will test all examples in "$BDFHOME/tests/input". The check files in "$BDFHOME/tests/check" will be used to compare test results.

Set up a BDF tests

It is better to setup your test input in BDF package. Usually, we will test BDF package day automatically. To set up a BDF test, you need following steps.

1 Add some codes to output some important numbers in standard out. In $BDFHOME/sys_util/sysutil.F90, there is a subroutine name "checkdata"

  subroutine checkdata(c,n,m,idata,rdata,pname,dname)
  ! write check data into output for auto check
  implicit none
  character,intent(in) :: c ! data type, i for inter, r for real
  integer,  intent(in) :: n ! number of data
  integer,  intent(in) :: m ! number of significant digits to decimal digits, 1-9 
  integer,  intent(in) :: idata(n)  ! interger 
  real*8,   intent(in) :: rdata(n)  ! real
  character*(*), intent(in) :: pname ! program name
  character*(*), intent(in) :: dname ! data name
  !-------------------------------

  end subroutine checkdata

You can write integer or real number as formatted form to standard out. The output looks link

  CHECKDATA:HF:ENERGY:    -152.05437318

For example, you want to print a number "ene=-152.05437318", you can add line
   call  checkdata("c",1,8,1,ene,"HF","ENERGY")

You will have a line
  CHECKDATA:HF:ENERGY:    -152.05437318

2 Now, you can write down a BDF input file named "test070.inp" and put it into directory "$BDFHOME/tests/input". 
   
3 You can generate check file name "test070.check"  and put it into directory "$BDFHOME/tests/check". Support you have run BDF with input file test070.inp and redirect output into a file name log. You can generate check file via a sample command
  grep "CHECKDATA" log >test070.check

Some interesting libraries

Some libraries developed by Qinming Sun. It may useful but still not used in BDF.

  libcint - Gaussian integrals. https://github.com/sunqm/libcint
  pyscf  - Python SCF.           http://sunqm.net/pyscf/overview.html

BDF atomic orbital order

The atomic orbital order of BDF is sorted as fortran array

    AO(ncgto,nsph,nshell)

Spherical GTO order

  p  - -1,  0,  1
  d  - -2, -1,  0, 1, +1
  f   - -3, -2, -1, 0, 1, +1, +2, +3
  etc. 

BDF directory

source

There are two kinds of directories in source. One type that contains a file named mail.F90, will be compiles into a executable file (BDF module). Another type that does not contain mail.F90, should be named as name_util. This type of directories will be compiled as libname.a that is share library.

tests

   input --- examples and test inputs
  check --- data used to check BDF codes
  failed  ---  failed tests
  molecule --- geometries of several molecules could be used to set up benchmark calculations.

BDF easy input developing guide

bdfeasyinputdevguid

BDF daily test report

bdfdailytest

For BDF developers (last edited 2022-01-14 15:02:54 by bsuo)