1 static char Version_OpenMX[30] = "3.8.5"; /* version of OpenMX */ 2 3 #define PI 3.1415926535897932384626 4 #define BYTESIZE 8 /* Don't change!! */ 5 #define kB 0.00008617251324000000 /* eV/K */ 6 #define BohrR 0.529177249 /* Angstrom */ 7 #define eV2Hartree 27.2113845 8 #define electron_mass 0.000910938291 /* [10^{-27} kg] */ 9 #define unified_atomic_mass_unit 1.660538921 /* [10^{-27} kg] */ 10 11 #define NYOUSO 60 /* # of YOUSO */ 12 /* #define YOUSO1 # of atoms in the system */ 13 /* #define YOUSO2 # of atoms in hopping cluster */ 14 /* #define YOUSO3 maximum # of recursion levels for GEVP */ 15 /* #define YOUSO4 # of 1D-copied cells */ 16 /* #define YOUSO5 size of the first index of HNL */ 17 #define YOUSO6 130 /* no role */ 18 /* #define YOUSO7 max # of orbitals including an atom */ 19 /* #define YOUSO8 max # of atoms in a rcut-off cluster */ 20 /* #define YOUSO9 maximum # of recursion levels for inverse S */ 21 #define YOUSO10 500 /* length of a file name */ 22 /* #define YOUSO11 max # of grids for an atom */ 23 /* #define YOUSO12 max # of overlapping grids */ 24 #define YOUSO14 104 /* number of elements in the periodic table */ 25 /* #define YOUSO15 max # of normK-grids */ 26 /* #define YOUSO16 max # of previous steps in real-space Pulay mixing */ 27 /* #define YOUSO17 max # of 1D-grids for FFT in the unit cell */ 28 /* #define YOUSO18 max # of species in the system */ 29 /* #define YOUSO19 # of radial projection obitals in KB potential */ 30 /* #define YOUSO20 # of total projection obitals in KB potential */ 31 /* #define YOUSO21 # of mesh for radial wave functions */ 32 /* #define YOUSO22 # of mesh VPS */ 33 /* #define YOUSO23 # of spin polization */ 34 /* #define YOUSO24 max multiplicity of radial wave functions */ 35 /* #define YOUSO25 max # of L for orbital */ 36 #define YOUSO26 61 /* size of the second index in Gxyz[][] */ 37 /* #define YOUSO27 # of grids along "x"-axis in the k-space */ 38 /* #define YOUSO28 # of grids along "y"-axis in the k-space */ 39 /* #define YOUSO29 # of grids along "z"-axis in the k-space */ 40 /* #define YOUSO30 max # of L for KB projectors */ 41 /* #define YOUSO31 # of HOMOs for output */ 42 /* #define YOUSO32 # of LUMOs for output */ 43 /* #define YOUSO33 # of MO_Nkpoint */ 44 /* #define YOUSO34 # of radial parts in VNA projector expansion */ 45 /* #define YOUSO35 max L of projectors in VNA projector expansion */ 46 #define YOUSO36 14 /* max L in Comp2Real array */ 47 /* #define YOUSO37 max # of charge states in LESP */ 48 /* #define YOUSO38 max # of previous steps in k-space Pulay mixing */ 49 /* #define YOUSO39 max # of previous steps in h-space Pulay mixing */ 50 51 #define Supported_MaxL 4 /* supported max angular momentum for basis orbital */ 52 53 #define Radial_kmin 10e-7 /* the minimum radius in the radial k-space */ 54 #define CoarseGL_Mesh 150 /* # of grids in coarse Gauss-Legendre quadrature */ 55 #define GL_Mesh 300 /* # of grids in Gauss-Legendre quadrature */ 56 #define FineGL_Mesh 1500 /* # of grids in fine Gauss-Legendre quadrature */ 57 58 #define Threshold_OLP_Eigen 1.0e-9 /* threshold for cutting off eigenvalues of OLP */ 59 #define fp_bsize 2097152 /* buffer size for setvbuf */ 60 #define Shift_K_Point 1.0e-6 /* disturbance for stabilization of eigenvalue routine */ 61 #define LAPACK_ABSTOL 6.0e-15 /* absolute error tolerance for lapack routines */ 62 63 #define Host_ID 0 /* ID of the host CPU in MPI */ 64 65 66 int Temp_MD_iter; 67 68 69 typedef float Type_DS_VNA; /* type of DS_VNA */ 70 #define MPI_Type_DS_VNA MPI_FLOAT /* type of DS_VNA */ 71 72 typedef float Type_Orbs_Grid; /* type of Orbs_Grid */ 73 #define ___Type_Orbs_Grid_definition___ 74 #define MPI_Type_Orbs_Grid MPI_FLOAT /* type of Orbs_Grid */ 75 76 77 #ifndef ___INTEGER_definition___ 78 typedef int INTEGER; /* for fortran integer */ 79 #define ___INTEGER_definition___ 80 #endif 81 82 #ifndef ___dcomplex_definition___ 83 typedef struct { double r,i; } dcomplex; 84 #define ___dcomplex_definition___ 85 #endif 86 87 /* FFT radix */ 88 static int NfundamentalNum=4; 89 static int fundamentalNum[4]={2,3,5,7}; 90 91 #ifndef __sqr_definition___ 92 #define sqr(x) ( (x)*(x) ) 93 #define __sqr_definition___ 94 #endif 95 96 #ifdef nompi 97 98 #ifndef ___MPI_Comm_definition___ 99 typedef int MPI_Comm; 100 #define ___MPI_Comm_definition___ 101 #endif 102 103 #ifndef ___MPI_Status_definition___ 104 typedef struct MPIStatus{int i;} MPI_Status; 105 #define ___MPI_Status_definition___ 106 #endif 107 108 #ifndef ___MPI_Request_definition___ 109 typedef struct MPIRequest{int i;} MPI_Request; 110 #define ___MPI_Request_definition___ 111 #endif 112 113 #else 114 #include "mpi.h" 115 #endif 116 117 MPI_Comm mpi_comm_level1; 118 MPI_Comm MPI_COMM_WORLD1; 119 120 #include "f77func.h" 121 122 /*---------- added by TOYODA 08/JAN/2010 */ 123 #include "exx_interface_openmx.h" 124 /*---------- until here */ 125 126 127 #ifndef ___logical_definition___ 128 typedef long int logical; 129 #define ___logical_definition___ 130 #endif 131 132 typedef long int integer; 133 typedef double doublereal; 134 typedef short ftnlen; 135 typedef short flag; 136 typedef short ftnint; 137 138 139 /***************************************************************************** 140 once allocated arrays 141 *****************************************************************************/ 142 143 /******************************************************* 144 char **SpeName; 145 character symbol of species 146 size: SpeName[SpeciesNum][YOUSO10] 147 allocation: call as Allocate_Arrays(0) in Input_std.c 148 free: call as Free_Arrays(0) in openmx.c 149 *******************************************************/ 150 char **SpeName; 151 152 /******************************************************* 153 char **SpeBasis; 154 character symbol of a basis set assigned to species 155 size: SpeBasis[SpeciesNum][YOUSO10] 156 allocation: call as Allocate_Arrays(0) in Input_std.c 157 free: call as Free_Arrays(0) in openmx.c 158 *******************************************************/ 159 char **SpeBasis; 160 161 /******************************************************* 162 char **SpeBasisName; 163 file name of a basis set assigned to species 164 size: SpeBasisName[SpeciesNum][YOUSO10] 165 allocation: call as Allocate_Arrays(0) in Input_std.c 166 free: call as Free_Arrays(0) in openmx.c 167 *******************************************************/ 168 char **SpeBasisName; 169 170 /******************************************************* 171 char **SpeVPS; 172 file name of pseudo potentials set assigned to species 173 size: SpeBasisVPS[SpeciesNum][YOUSO10] 174 allocation: call as Allocate_Arrays(0) in Input_std.c 175 free: call as Free_Arrays(0) in openmx.c 176 *******************************************************/ 177 char **SpeVPS; 178 179 /******************************************************* 180 double *Spe_AtomicMass; 181 atomic mass of each species, where hydrogen is 1. 182 size: Spe_AtomicMass[SpeciesNum] 183 allocation: call as Allocate_Arrays(0) in Input_std.c 184 free: call as Free_Arrays(0) in openmx.c 185 *******************************************************/ 186 double *Spe_AtomicMass; 187 188 /******************************************************* 189 int *Spe_MaxL_Basis; 190 the maximum "l" component of used atomic orbitals inv 191 each species 192 size: Spe_MaxL_Basis[SpeciesNum] 193 allocation: call as Allocate_Arrays(0) in Input_std.c 194 free: call as Free_Arrays(0) in openmx.c 195 *******************************************************/ 196 int *Spe_MaxL_Basis; 197 198 /******************************************************* 199 int **Spe_Num_Basis; 200 the number of multiplicity of primitive radial parts 201 for each "l" component in an species 202 size: Spe_Num_Basis[SpeciesNum][6] 203 allocation: call as Allocate_Arrays(0) in Input_std.c 204 free: call as Free_Arrays(0) in openmx.c 205 *******************************************************/ 206 int **Spe_Num_Basis; 207 208 /******************************************************* 209 int **Spe_Num_CBasis; 210 the number of multiplicity of contracted radial parts 211 for each "l" component in an species 212 size: Spe_Num_CBasis[SpeciesNum][6] 213 allocation: call as Allocate_Arrays(0) in Input_std.c 214 free: call as Free_Arrays(0) in openmx.c 215 *******************************************************/ 216 int **Spe_Num_CBasis; 217 218 /******************************************************* 219 double **EH0_scaling; 220 scaling factors to vanish Ecore plus EH0 221 at the cutoff radius 222 size: EH0_scaling[SpeciesNum][SpeciesNum] 223 allocation: call as Allocate_Arrays(0) in Input_std.c 224 free: call as Free_Arrays(0) in openmx.c 225 *******************************************************/ 226 double **EH0_scaling; 227 228 /******************************************************* 229 double **SO_factor; 230 scaling factors of spin-orbit coupling 231 size: SO_factor[SpeciesNum][4] 232 allocation: call as Allocate_Arrays(0) in Input_std.c 233 free: call as Free_Arrays(0) in openmx.c 234 *******************************************************/ 235 double **SO_factor; 236 237 /******************************************************* 238 double ***Hub_U_Basis --- added by MJ 239 the value of Hubbard U for LDA+U calculation 240 size: Hub_U_Basis[SpeciesNum][Spe_MaxL_Basis+1][Spe_Num_Basis] 241 allocation: call as Allocate_Arrays(1) in Input_std.c 242 free: call as Free_Arrays(0) in openmx.c 243 *******************************************************/ 244 double ***Hub_U_Basis ; /* --- added by MJ */ 245 246 /******************************************************* 247 int *OrbPol_flag --- added by MJ and TO 248 flag that spefifies how orbital is polarized 249 size: OrbPol[atomnum+1] 250 allocation: call as Allocate_Arrays(1) in Input_std.c 251 free: call as Free_Arrays(0) in openmx.c 252 *******************************************************/ 253 int *OrbPol_flag ; /* --- added by MJ and TO */ 254 255 /******************************************************* 256 double **Gxyz; 257 atomic global coordinates, velocities, and gradients of 258 the total energy with respect to the atomic coordinates 259 size: Gxyz[atomnum+4][YOUSO26] 260 allocation: call as Allocate_Arrays(1) in Input_std.c 261 free: call as Free_Arrays(0) in openmx.c 262 *******************************************************/ 263 double **Gxyz; 264 265 /******************************************************** 266 double ***GxyzHistoryIn; 267 History of atomic global coordinates 268 size GxyzHistoryIn[M_GDIIS_HISTORY+1][atomnum+4][4]; 269 allocation: call as Allocate_Arrays(1) in Input_std.c 270 free: call as Free_Arrays(0) in openmx.c 271 *******************************************************/ 272 double ***GxyzHistoryIn; 273 274 /******************************************************** 275 double ***GxyzHistoryR; 276 History of residual global coordinates 277 size GxyzHistoryR[M_GDIIS_HISTORY+1][atomnum+4][4]; 278 allocation: call as Allocate_Arrays(1) in Input_std.c 279 free: call as Free_Arrays(0) in openmx.c 280 *******************************************************/ 281 double ***GxyzHistoryR; 282 283 /******************************************************** 284 double **His_Gxyz; 285 history of atomic global coordinates for charge extrapolation 286 size His_Gxyz[Extrapolated_Charge_History][3*atomnum]; 287 allocation: call as Allocate_Arrays(1) in Input_std.c 288 free: call as Free_Arrays(0) in openmx.c 289 *******************************************************/ 290 double **His_Gxyz; 291 292 /******************************************************* 293 int **atom_Fixed_XYZ; 294 atomic global coordinates, =0 relax, =1 fix position 295 size: atom_Fixed_XYZ[atomnum+1][3]; 296 allocation: call as Allocate_Arrays(1) in Input_std.c 297 free: call as Free_Arrays(0) in openmx.c 298 *******************************************************/ 299 int **atom_Fixed_XYZ; 300 301 /******************************************************* 302 double **Cell_Gxyz; 303 atomic global coordinates spanned 304 by the unit cell vectors 305 size: Cell_Gxyz[atomnum+1][4] 306 allocation: call as Allocate_Arrays(1) in Input_std.c 307 free: call as Free_Arrays(0) in openmx.c 308 *******************************************************/ 309 double **Cell_Gxyz; 310 311 /******************************************************* 312 double *InitN_USpin; 313 the number of the upspin electon of initial atoms 314 size: InitN_USpin[atomnum+1] 315 allocation: call as Allocate_Arrays(1) in Input_std.c 316 free: call as Free_Arrays(0) in openmx.c 317 *******************************************************/ 318 double *InitN_USpin; 319 320 /******************************************************* 321 double *InitN_DSpin; 322 the number of the upspin electon of initial atoms 323 size: InitN_DSpin[atomnum+1] 324 allocation: call as Allocate_Arrays(1) in Input_std.c 325 free: call as Free_Arrays(0) in openmx.c 326 *******************************************************/ 327 double *InitN_DSpin; 328 329 /******************************************************* 330 double *InitMagneticMoment; 331 initial magnetic moment of each atom 332 size: InitMagneticMoment[atomnum+1] 333 allocation: call as Allocate_Arrays(1) in Input_std.c 334 free: call as Free_Arrays(0) in openmx.c 335 *******************************************************/ 336 double *InitMagneticMoment; 337 338 /******************************************************* 339 double *Angle0_Spin; 340 angle of theta for atomic projected spin moment 341 size: Angle0_Spin[atomnum+1] 342 allocation: call as Allocate_Arrays(1) in Input_std.c 343 free: call as Free_Arrays(0) in openmx.c 344 *******************************************************/ 345 double *Angle0_Spin; 346 347 /******************************************************* 348 double *Angle1_Spin; 349 angle of phi for atomic projected spin moment 350 size: Angle1_Spin[atomnum+1] 351 allocation: call as Allocate_Arrays(1) in Input_std.c 352 free: call as Free_Arrays(0) in openmx.c 353 *******************************************************/ 354 double *Angle1_Spin; 355 356 /******************************************************* 357 double *InitAngle0_Spin; 358 initial angle of theta for atomic projected spin moment 359 size: InitAngle0_Spin[atomnum+1] 360 allocation: call as Allocate_Arrays(1) in Input_std.c 361 free: call as Free_Arrays(0) in openmx.c 362 *******************************************************/ 363 double *InitAngle0_Spin; 364 365 /******************************************************* 366 double *InitAngle1_Spin; 367 initial angle of phi for atomic projected spin moment 368 size: InitAngle1_Spin[atomnum+1] 369 allocation: call as Allocate_Arrays(1) in Input_std.c 370 free: call as Free_Arrays(0) in openmx.c 371 *******************************************************/ 372 double *InitAngle1_Spin; 373 374 /******************************************************* 375 double *Angle0_Orbital; 376 angle of theta for atomic projected orbital moment 377 size: Angle0_Orbital[atomnum+1] 378 allocation: call as Allocate_Arrays(1) in Input_std.c 379 free: call as Free_Arrays(0) in openmx.c 380 *******************************************************/ 381 double *Angle0_Orbital; 382 383 /******************************************************* 384 double *Angle1_Orbital; 385 angle of phi for atomic projected orbital moment 386 size: Angle1_Orbital[atomnum+1] 387 allocation: call as Allocate_Arrays(1) in Input_std.c 388 free: call as Free_Arrays(0) in openmx.c 389 *******************************************************/ 390 double *Angle1_Orbital; 391 392 /******************************************************* 393 double *OrbitalMoment; 394 magnitude of atomic projected orbital moment 395 size: OrbitalMoment[atomnum+1] 396 allocation: call as Allocate_Arrays(1) in Input_std.c 397 free: call as Free_Arrays(0) in openmx.c 398 *******************************************************/ 399 double *OrbitalMoment; 400 401 /******************************************************* 402 int *Constraint_SpinAngle; 403 flag for constraining the spin angle of atomic projected spin 404 size: Constraint_SpinAngle[atomnum+1] 405 allocation: call as Allocate_Arrays(1) in Input_std.c 406 free: call as Free_Arrays(0) in openmx.c 407 *******************************************************/ 408 int *Constraint_SpinAngle; 409 410 /******************************************************* 411 double *InitAngle0_Orbital; 412 initial angle of theta for atomic projected orbital moment 413 size: InitAngle0_Orbital[atomnum+1] 414 allocation: call as Allocate_Arrays(1) in Input_std.c 415 free: call as Free_Arrays(0) in openmx.c 416 *******************************************************/ 417 double *InitAngle0_Orbital; 418 419 /******************************************************* 420 double *InitAngle1_Orbital; 421 initial angle of phi for atomic projected orbital moment 422 size: InitAngle1_Orbital[atomnum+1] 423 allocation: call as Allocate_Arrays(1) in Input_std.c 424 free: call as Free_Arrays(0) in openmx.c 425 *******************************************************/ 426 double *InitAngle1_Orbital; 427 428 /******************************************************* 429 double **Orbital_Moment_XYZ; 430 x-, y-, and z- components of orbital moment calculated 431 at each atomic site 432 size: Orbital_Moment_XYZ[atomnum+1][3] 433 allocation: call as Allocate_Arrays(1) in Input_std.c 434 free: call as Free_Arrays(0) in openmx.c 435 *******************************************************/ 436 double **Orbital_Moment_XYZ; 437 438 /******************************************************* 439 int *Constraint_OrbitalAngle; 440 flag for constraining the orbital moment angle of atomic 441 projected orbital moment 442 size: Constraint_OrbitalAngle[atomnum+1] 443 allocation: call as Allocate_Arrays(1) in Input_std.c 444 free: call as Free_Arrays(0) in openmx.c 445 *******************************************************/ 446 int *Constraint_OrbitalAngle; 447 448 /******************************************************* 449 int *WhatSpecies; 450 array to specify species for each atom in the system 451 size: WhatSpecies[atomnum+1] 452 allocation: call as Allocate_Arrays(1) in Input_std.c 453 free: call as Free_Arrays(0) in openmx.c 454 *******************************************************/ 455 int *WhatSpecies; 456 457 /******************************************************* 458 int *GridN_Atom; 459 the number of grids overlaping to each atom 460 size: GridN_Atom[atomnum+1] 461 allocation: call as Allocate_Arrays(1) in Input_std.c 462 free: call as Free_Arrays(0) in openmx.c 463 *******************************************************/ 464 int *GridN_Atom; 465 466 /******************************************************* 467 double *NormK; 468 radial grid values in the reciprocal space 469 size: NormK[Ngrid_NormK+1] 470 allocation: call as Allocate_Arrays(2) in readfile.c 471 free: call as Free_Arrays(0) in openmx.c 472 *******************************************************/ 473 double *NormK; 474 475 /******************************************************* 476 double *Spe_Atom_Cut1; 477 cutoff radius of atomic orbitals for each species 478 size: Spe_Atom_Cut1[SpeciesNum] 479 allocation: call as Allocate_Arrays(2) in readfile.c 480 free: call as Free_Arrays(0) in openmx.c 481 *******************************************************/ 482 double *Spe_Atom_Cut1; 483 484 /******************************************************* 485 double *Spe_Core_Charge; 486 effective core charge of each species 487 size: Spe_Core_Charge[SpeciesNum] 488 allocation: call as Allocate_Arrays(2) in readfile.c 489 free: call as Free_Arrays(0) in openmx.c 490 *******************************************************/ 491 double *Spe_Core_Charge; 492 493 /******************************************************* 494 int *TGN_EH0; 495 the number of 3D grids for calculating EH0 in 496 Correction_Energy.c 497 size: TGN_EH0[SpeciesNum] 498 allocation: call as Allocate_Arrays(2) in readfile.c 499 free: call as Free_Arrays(0) in openmx.c 500 *******************************************************/ 501 int *TGN_EH0; 502 503 /******************************************************* 504 double *dv_EH0; 505 the volume of a grid for calculating EH0 in 506 Correction_Energy.c 507 size: dv_EH0[SpeciesNum] 508 allocation: call as Allocate_Arrays(2) in readfile.c 509 free: call as Free_Arrays(0) in openmx.c 510 *******************************************************/ 511 double *dv_EH0; 512 513 /******************************************************* 514 int *Spe_Num_Mesh_VPS; 515 the number of grids for pseudo potentials 516 size: Spe_Num_Mesh_VPS[SpeciesNum] 517 allocation: call as Allocate_Arrays(2) in readfile.c 518 free: call as Free_Arrays(0) in openmx.c 519 *******************************************************/ 520 int *Spe_Num_Mesh_VPS; 521 522 /******************************************************* 523 int *Spe_Num_Mesh_PAO; 524 the number of grids for atomic orbitals 525 size: Spe_Num_Mesh_PAO[SpeciesNum] 526 allocation: call as Allocate_Arrays(2) in readfile.c 527 free: call as Free_Arrays(0) in openmx.c 528 *******************************************************/ 529 int *Spe_Num_Mesh_PAO; 530 531 /******************************************************* 532 int *Spe_Total_VPS_Pro; 533 the total number of projector in KB nonlocal potentials 534 size: Spe_Total_VPS_Pro[SpeciesNum] 535 allocation: call as Allocate_Arrays(2) in readfile.c 536 free: call as Free_Arrays(0) in openmx.c 537 *******************************************************/ 538 int *Spe_Total_VPS_Pro; 539 540 /******************************************************* 541 int *Spe_Num_RVPS; 542 the number of radial projectors in KB nonlocal potentials 543 size: Spe_Num_RVPS[SpeciesNum] 544 allocation: call as Allocate_Arrays(2) in readfile.c 545 free: call as Free_Arrays(0) in openmx.c 546 *******************************************************/ 547 int *Spe_Num_RVPS; 548 549 /******************************************************* 550 int *Spe_PAO_LMAX; 551 the maximum "l" component of atomic orbitals stored 552 in the file of each species 553 size: Spe_PAO_LMAX[SpeciesNum] 554 allocation: call as Allocate_Arrays(2) in readfile.c 555 free: call as Free_Arrays(0) in openmx.c 556 *******************************************************/ 557 int *Spe_PAO_LMAX; 558 559 /******************************************************* 560 int *Spe_PAO_Mul; 561 the multiplicity of radial wave functions for each "l" 562 component of atomic orbitals stored in the file of each 563 species 564 size: Spe_PAO_Mul[SpeciesNum] 565 allocation: call as Allocate_Arrays(2) in readfile.c 566 free: call as Free_Arrays(0) in openmx.c 567 *******************************************************/ 568 int *Spe_PAO_Mul; 569 570 /******************************************************* 571 int *Spe_WhatAtom; 572 atomic number in the periodic table for each species 573 size: Spe_WhatAtom[SpeciesNum] 574 allocation: call as Allocate_Arrays(2) in readfile.c 575 free: call as Free_Arrays(0) in openmx.c 576 *******************************************************/ 577 int *Spe_WhatAtom; 578 579 /******************************************************* 580 int *Spe_Total_NO; 581 the number of primitive atomic orbitals in a species 582 size: Spe_Total_NO[SpeciesNum] 583 allocation: call as Allocate_Arrays(2) in readfile.c 584 free: call as Free_Arrays(0) in openmx.c 585 *******************************************************/ 586 int *Spe_Total_NO; 587 588 /******************************************************* 589 int *Spe_Total_CNO; 590 the number of contracted atomic orbitals in a species 591 size: Spe_Total_CNO[SpeciesNum] 592 allocation: call as Allocate_Arrays(2) in readfile.c 593 free: call as Free_Arrays(0) in openmx.c 594 *******************************************************/ 595 int *Spe_Total_CNO; 596 597 /******************************************************* 598 int *FNAN; 599 the number of first neighboring atoms 600 size: FNAN[atomnum+1] 601 allocation: call as Allocate_Arrays(2) in readfile.c 602 free: call as Free_Arrays(0) in openmx.c 603 *******************************************************/ 604 int *FNAN; 605 606 /******************************************************* 607 int *SNAN; 608 the number of second neighboring atoms 609 size: SNAN[atomnum+1] 610 allocation: call as Allocate_Arrays(2) in readfile.c 611 free: call as Free_Arrays(0) in openmx.c 612 *******************************************************/ 613 int *SNAN; 614 615 /******************************************************* 616 int **natn; 617 grobal index number of neighboring atoms of an atom ct_AN 618 size: natn[atomnum+1][Max_FSNAN*ScaleSize+1] 619 allocation: call as Allocate_Arrays(3) in truncation.c 620 free: call as Free_Arrays(0) in openmx.c 621 *******************************************************/ 622 int **natn; 623 624 /******************************************************* 625 int **ncn; 626 grobal index number for cell of neighboring atoms of 627 an atom ct_AN 628 size: ncn[atomnum+1][Max_FSNAN*ScaleSize+1] 629 allocation: call as Allocate_Arrays(3) in truncation.c 630 free: call as Free_Arrays(0) in openmx.c 631 *******************************************************/ 632 int **ncn; 633 634 /******************************************************* 635 double **Dis; 636 distance to neighboring atoms of an atom ct_AN 637 size: Dis[atomnum+1][Max_FSNAN*ScaleSize+1] 638 allocation: call as Allocate_Arrays(3) in truncation.c 639 free: call as Free_Arrays(0) in openmx.c 640 *******************************************************/ 641 double **Dis; 642 643 /******************************************************* 644 double **GridX_EH0, **GridY_EH0, **GridZ_EH0 ; 645 x,y,and z-coordinates of grids for calculating EH0 in 646 Correction_Energy.c 647 size: GridX_EH0[SpeciesNum][Max_TGN_EH0] 648 allocation: call as Allocate_Arrays(4) 649 in Correcion_Energy.c 650 free: call as Free_Arrays(0) in openmx.c 651 *******************************************************/ 652 double **GridX_EH0,**GridY_EH0,**GridZ_EH0; 653 654 /******************************************************* 655 double **Arho_EH0; 656 atomic density on grids for calculating EH0 in 657 Correction_Energy.c 658 size: Arho_EH0[SpeciesNum][Max_TGN_EH0] 659 allocation: call as Allocate_Arrays(4) 660 in Correcion_Energy.c 661 free: call as Free_Arrays(0) in openmx.c 662 *******************************************************/ 663 double **Arho_EH0; 664 665 /******************************************************* 666 double **Wt_EH0; 667 quadrature weight of grids for calculating EH0 668 in Correction_Energy.c 669 size: Wt_EH0[SpeciesNum][Max_TGN_EH0] 670 allocation: call as Allocate_Arrays(4) 671 in Correcion_Energy.c 672 free: call as Free_Arrays(0) in openmx.c 673 *******************************************************/ 674 double **Wt_EH0; 675 676 /******************************************************* 677 double **atv; 678 xyz translation vectors of periodically copied cells 679 size: atv[TCpyCell+1][4] 680 allocation: in Set_Periodic() of truncation.c 681 free: call as Free_Arrays(0) in openmx.c 682 *******************************************************/ 683 double **atv; 684 685 /******************************************************* 686 int **ratv; 687 queue number of periodically copied cells 688 size: ratv[TCpyCell*2+4][TCpyCell*2+4][TCpyCell*2+4]; 689 allocation: in Set_Periodic() of truncation.c 690 free: call as Free_Arrays(0) in openmx.c 691 *******************************************************/ 692 int ***ratv; 693 694 /******************************************************* 695 int **atv_ijk; 696 i,j,and j number of periodically copied cells 697 size: atv_ijk[TCpyCell+1][4]; 698 allocation: in Set_Periodic() of truncation.c 699 free: call as Free_Arrays(0) in openmx.c 700 *******************************************************/ 701 int **atv_ijk; 702 703 /******************************************************* 704 double **MO_kpoint; 705 kpoints at which wave functions are calculated. 706 size: MO_kpoint[MO_Nkpoint+1][4] 707 allocation: call as Allocate_Arrays(5) in Input_std.c 708 free: call as Free_Arrays(0) in openmx.c 709 *******************************************************/ 710 double **MO_kpoint; 711 712 /******************************************************* 713 double **Spe_PAO_XV; 714 radial mesh (x=log(r)) for PAO 715 size: Spe_PAO_XV[List_YOUSO[18]] 716 [List_YOUSO[21]] 717 allocation: call as Allocate_Arrays(6) in SetPara_DFT.c 718 free: call as Free_Arrays(0) in openmx.c 719 *******************************************************/ 720 double **Spe_PAO_XV; 721 722 /******************************************************* 723 double **Spe_PAO_RV; 724 logarithmic radial mesh (r=exp(r)) for PAO 725 size: Spe_PAO_XV[List_YOUSO[18]] 726 [List_YOUSO[21]] 727 allocation: call as Allocate_Arrays(6) in SetPara_DFT.c 728 free: call as Free_Arrays(0) in openmx.c 729 *******************************************************/ 730 double **Spe_PAO_RV; 731 732 /******************************************************* 733 double **Spe_Atomic_Den; 734 atomic charge densities on radial mesh of PAO 735 size: Spe_Atomic_Den[List_YOUSO[18]] 736 [List_YOUSO[21]] 737 allocation: call as Allocate_Arrays(6) in SetPara_DFT.c 738 free: call as Free_Arrays(0) in openmx.c 739 *******************************************************/ 740 double **Spe_Atomic_Den; 741 742 /******************************************************* 743 double **Spe_Atomic_Den2; 744 atomic charge densities+PCC charge on radial mesh of PAO, 745 where both the edges are extended by adding one more. 746 size: Spe_Atomic_Den[List_YOUSO[18]] 747 [List_YOUSO[21]+2] 748 allocation: call as Allocate_Arrays(6) in SetPara_DFT.c 749 free: call as Free_Arrays(0) in openmx.c 750 *******************************************************/ 751 double **Spe_Atomic_Den2; 752 753 /******************************************************* 754 double ****Spe_PAO_RWF; 755 radial parts of basis orbitals on radial mesh of PAO 756 size: Spe_PAO_RWF[List_YOUSO[18]] 757 [List_YOUSO[25]+1] 758 [List_YOUSO[24]] 759 [List_YOUSO[21]] 760 allocation: call as Allocate_Arrays(6) in SetPara_DFT.c 761 free: call as Free_Arrays(0) in openmx.c 762 *******************************************************/ 763 double ****Spe_PAO_RWF; 764 765 /******************************************************* 766 double ****Spe_RF_Bessel; 767 radial parts of basis orbitals on radial mesh in the 768 momentum space 769 size: Spe_RF_Bessel[List_YOUSO[18]] 770 [List_YOUSO[25]+1] 771 [List_YOUSO[24]] 772 [List_YOUSO[15]] 773 allocation: call as Allocate_Arrays(6) in SetPara_DFT.c 774 free: call as Free_Arrays(0) in openmx.c 775 *******************************************************/ 776 double ****Spe_RF_Bessel; 777 778 /******************************************************* 779 double **Spe_VPS_XV; 780 radial mesh (x=log(r)) for VPS 781 size: Spe_VPS_XV[List_YOUSO[18]] 782 [List_YOUSO[22]] 783 allocation: call as Allocate_Arrays(7) in SetPara_DFT.c 784 free: call as Free_Arrays(0) in openmx.c 785 *******************************************************/ 786 double **Spe_VPS_XV; 787 788 /******************************************************* 789 double **Spe_VPS_XV; 790 logarithmic radial mesh (r=exp(x)) for VPS 791 size: Spe_VPS_RV[List_YOUSO[18]] 792 [List_YOUSO[22]] 793 allocation: call as Allocate_Arrays(7) in SetPara_DFT.c 794 free: call as Free_Arrays(0) in openmx.c 795 *******************************************************/ 796 double **Spe_VPS_RV; 797 798 /******************************************************* 799 double **Spe_Vna; 800 neutral atom potentials on radial mesh of VPS 801 size: Spe_Vna[List_YOUSO[18]] 802 [List_YOUSO[22]] 803 allocation: call as Allocate_Arrays(7) in SetPara_DFT.c 804 free: call as Free_Arrays(0) in openmx.c 805 *******************************************************/ 806 double **Spe_Vna; 807 808 /******************************************************* 809 double **Spe_VH_Atom; 810 Hartree potentials of atomic charge densities 811 on radial mesh of VPS 812 size: Spe_VH_Atom[List_YOUSO[18]] 813 [List_YOUSO[22]] 814 allocation: call as Allocate_Arrays(7) in SetPara_DFT.c 815 free: call as Free_Arrays(0) in openmx.c 816 *******************************************************/ 817 double **Spe_VH_Atom; 818 819 /******************************************************* 820 double **Spe_Atomic_PCC; 821 partial core correction charge densities on radial 822 mesh of VPS 823 size: Spe_Atomic_PCC[List_YOUSO[18]] 824 [List_YOUSO[22]] 825 allocation: call as Allocate_Arrays(7) in SetPara_DFT.c 826 free: call as Free_Arrays(0) in openmx.c 827 *******************************************************/ 828 double **Spe_Atomic_PCC; 829 830 /******************************************************* 831 double ****Spe_VNL; 832 radial parts of projectors of non-local potentials 833 on radial mesh of VPS 834 size: Spe_VNL[SO_switch+1] 835 [List_YOUSO[18]] 836 [List_YOUSO[19]] 837 [List_YOUSO[22]] 838 allocation: call as Allocate_Arrays(7) in SetPara_DFT.c 839 free: call as Free_Arrays(0) in openmx.c 840 *******************************************************/ 841 double ****Spe_VNL; 842 843 /******************************************************* 844 double ***Spe_VNLE; 845 projection energies of projectors of non-local 846 potentials on radial mesh of VPS 847 size: Spe_VNLE[SO_switch+1] 848 [List_YOUSO[18]] 849 [List_YOUSO[19]] 850 allocation: call as Allocate_Arrays(7) in SetPara_DFT.c 851 free: call as Free_Arrays(0) in openmx.c 852 *******************************************************/ 853 double ***Spe_VNLE; 854 855 /******************************************************* 856 int **Spe_VPS_List; 857 angular momentum numbers of projectors of non-local 858 potentials 859 size: Spe_VPS_List[List_YOUSO[18]] 860 [List_YOUSO[19]] 861 allocation: call as Allocate_Arrays(7) in SetPara_DFT.c 862 free: call as Free_Arrays(0) in openmx.c 863 *******************************************************/ 864 int **Spe_VPS_List; 865 866 /******************************************************* 867 double ****Spe_NLRF_Bessel; 868 radial parts of projectors of non-local potentials 869 on radial mesh in the momentum space 870 size: Spe_RF_Bessel[SO_switch+1] 871 [List_YOUSO[18]] 872 [List_YOUSO[19]+2] 873 [List_YOUSO[15]] 874 allocation: call as Allocate_Arrays(7) in SetPara_DFT.c 875 free: call as Free_Arrays(0) in openmx.c 876 *******************************************************/ 877 double ****Spe_NLRF_Bessel; 878 879 /***************************************************************************** 880 allocated arrays at every MD step 881 *****************************************************************************/ 882 883 /******************************************************* 884 int ***GListTAtoms1; 885 grid index (local for ct_AN) overlaping between 886 two orbitals 887 size: GListTAtoms1[Matomnum+1] 888 [FNAN[Gc_AN]+1] 889 [NumOLG[Mc_AN][h_AN]] 890 allocation: UCell_Box() of truncation.c 891 free: truncation.c and Free_Arrays(0) in openmx.c 892 *******************************************************/ 893 int ***GListTAtoms1; 894 895 /******************************************************* 896 int ***GListTAtoms2; 897 grid index (local for h_AN) overlaping between 898 two orbitals 899 size: GListTAtoms2[Matomnum+1] 900 [FNAN[Gc_AN]+1] 901 [NumOLG[Mc_AN][h_AN]] 902 allocation: UCell_Box() of truncation.c 903 free: truncation.c and Free_Arrays(0) in openmx.c 904 *******************************************************/ 905 int ***GListTAtoms2; 906 907 /******************************************************* 908 int **GridListAtom; 909 neighboring grid points of an atom Mc_AN 910 size: GridListAtom[Matomnum+1][Max_GridN_Atom*ScaleSize+1] 911 allocation: allocate in UCell_Box() of truncation.c 912 free: call as Free_Arrays(0) in openmx.c 913 *******************************************************/ 914 int **GridListAtom; 915 916 /******************************************************* 917 int **CellListAtom; 918 cell number of neighboring grid points of an atom Mc_AN 919 size: CellListAtom[Matomnum+1][Max_GridN_Atom*ScaleSize+1] 920 allocation: allocate in UCell_Box() of truncation.c 921 free: call as Free_Arrays(0) in openmx.c 922 *******************************************************/ 923 int **CellListAtom; 924 925 /******************************************************* 926 int **MGridListAtom; 927 neighboring grid points (medium variable) of an atom Mc_AN 928 size: MGridListAtom[Matomnum+1][Max_GridN_Atom*ScaleSize+1] 929 allocation: allocate in UCell_Box() of truncation.c 930 free: call as Free_Arrays(0) in openmx.c 931 *******************************************************/ 932 int **MGridListAtom; 933 934 /******************************************************* 935 double **Density_Grid; 936 electron densities on grids in the partition C 937 size: Density_Grid[2 or 4][My_NumGridC] 938 allocation: allocate in truncation.c 939 free: call as Free_Arrays(0) in openmx.c 940 *******************************************************/ 941 double **Density_Grid; 942 943 /******************************************************* 944 double **Density_Grid_B; 945 electron densities on grids in the partition B 946 size: Density_Grid[2 or 4][My_NumGridB_AB] 947 allocation: allocate in truncation.c 948 free: call as Free_Arrays(0) in openmx.c 949 *******************************************************/ 950 double **Density_Grid_B; 951 952 /******************************************************* 953 double **Density_Grid_D; 954 electron densities on grids in the partition D 955 size: Density_Grid[2 or 4][My_NumGridD] 956 allocation: allocate in truncation.c 957 free: call as Free_Arrays(0) in openmx.c 958 *******************************************************/ 959 double **Density_Grid_D; 960 961 /******************************************************* 962 double *ADensity_Grid_B; 963 superposed atomic density on grids in the partition B 964 size: ADensity_Grid_B[My_NumGridB_AB] 965 allocation: allocate in truncation.c 966 free: call as Free_Arrays(0) in openmx.c 967 *******************************************************/ 968 double *ADensity_Grid_B; 969 970 /******************************************************* 971 double **PCCDensity_Grid_B; 972 electron densities by the superposition of partial 973 core correction densities on grids in the partition B 974 size: PCCDensity_Grid[2][My_NumGridB_AB] 975 allocation: allocate in truncation.c 976 free: call as Free_Arrays(0) in openmx.c 977 *******************************************************/ 978 double **PCCDensity_Grid_B; 979 980 /******************************************************* 981 double **PCCDensity_Grid_D; 982 electron densities by the superposition of partial 983 core correction densities on grids in the partition D 984 size: PCCDensity_Grid[2][My_NumGridD] 985 allocation: allocate in truncation.c 986 free: call as Free_Arrays(0) in openmx.c 987 *******************************************************/ 988 double **PCCDensity_Grid_D; 989 990 /******************************************************* 991 double **Vxc_Grid; 992 exchange-correlation potentials on grids in the partition C 993 size: Vxc_Grid[2 or 4][My_NumGridC] 994 allocation: allocate in truncation.c 995 free: call as Free_Arrays(0) in openmx.c 996 *******************************************************/ 997 double **Vxc_Grid; 998 999 /******************************************************* 1000 double **Vxc_Grid_B; 1001 exchange-correlation potentials on grids in the partition B 1002 size: Vxc_Grid_B[2 or 4][My_NumGridB] 1003 allocation: allocate in truncation.c 1004 free: call as Free_Arrays(0) in openmx.c 1005 *******************************************************/ 1006 double **Vxc_Grid_B; 1007 1008 /******************************************************* 1009 double **Vxc_Grid_D; 1010 exchange-correlation potentials on grids in the partition D 1011 size: Vxc_Grid_D[2 or 4][My_NumGridD] 1012 allocation: allocate in truncation.c 1013 free: call as Free_Arrays(0) in openmx.c 1014 *******************************************************/ 1015 double **Vxc_Grid_D; 1016 1017 /******************************************************* 1018 double *RefVxc_Grid; 1019 exchange-correlation potentials on grids in the partition C 1020 for the reference charge density 1021 size: RefVxc_Grid[My_NumGridC] 1022 allocation: allocate in truncation.c 1023 free: call as Free_Arrays(0) in openmx.c 1024 *******************************************************/ 1025 double *RefVxc_Grid; 1026 1027 /******************************************************* 1028 double *RefVxc_Grid_B; 1029 exchange-correlation potentials on grids in the partition B 1030 for the reference charge density 1031 size: RefVxc_Grid[My_NumGridB_AB] 1032 allocation: allocate in truncation.c 1033 free: call as Free_Arrays(0) in openmx.c 1034 *******************************************************/ 1035 double *RefVxc_Grid_B; 1036 1037 /******************************************************* 1038 double *VNA_Grid; 1039 neutral atom potential on grids in the partition C 1040 size: VNA_Grid[My_NumGridC] 1041 allocation: allocate in truncation.c 1042 free: call as Free_Arrays(0) in openmx.c 1043 *******************************************************/ 1044 double *VNA_Grid; 1045 1046 /******************************************************* 1047 double *VNA_Grid_B; 1048 neutral atom potential on grids in the partition B 1049 size: VNA_Grid[My_NumGridB_AB] 1050 allocation: allocate in truncation.c 1051 free: call as Free_Arrays(0) in openmx.c 1052 *******************************************************/ 1053 double *VNA_Grid_B; 1054 1055 /******************************************************* 1056 double *VEF_Grid; 1057 potential on grids in the partition C by external electric field 1058 size: VEF_Grid[My_NumGridC] 1059 allocation: allocate in truncation.c 1060 free: call as Free_Arrays(0) in openmx.c 1061 *******************************************************/ 1062 double *VEF_Grid; 1063 1064 /******************************************************* 1065 double *VEF_Grid_B; 1066 potential on grids in the partition B by external electric field 1067 size: VEF_Grid_B[My_NumGridB_AB] 1068 allocation: allocate in truncation.c 1069 free: call as Free_Arrays(0) in openmx.c 1070 *******************************************************/ 1071 double *VEF_Grid_B; 1072 1073 /******************************************************* 1074 double *dVHart_Grid; 1075 Hartree potential of the differential 1076 electron density on grids in the partition C 1077 size: dVHart_Grid[My_NumGridC] 1078 allocation: allocate in truncation.c 1079 free: call as Free_Arrays(0) in openmx.c 1080 *******************************************************/ 1081 double *dVHart_Grid; 1082 1083 /******************************************************* 1084 double *dVHart_Grid_B; 1085 Hartree potential of the differential 1086 electron density on grids in the partition B 1087 size: dVHart_Grid[My_Max_NumGridB] 1088 allocation: allocate in truncation.c 1089 free: call as Free_Arrays(0) in openmx.c 1090 *******************************************************/ 1091 double *dVHart_Grid_B; 1092 1093 /******************************************************* 1094 double **Vpot_Grid; 1095 Kohn-Sham effective potentials on grids in the partition C 1096 size: Vpot_Grid[2 or 4][My_NumGridC] 1097 allocation: allocate in truncation.c 1098 free: call as Free_Arrays(0) in openmx.c 1099 *******************************************************/ 1100 double **Vpot_Grid; 1101 1102 /******************************************************* 1103 double **Vpot_Grid_B; 1104 Kohn-Sham effective potentials on grids in the partition B 1105 size: Vpot_Grid[2 or 4][My_NumGridB_AB] 1106 allocation: allocate in truncation.c 1107 free: call as Free_Arrays(0) in openmx.c 1108 *******************************************************/ 1109 double **Vpot_Grid_B; 1110 1111 /******************************************************* 1112 Type_Orbs_Grid ***Orbs_Grid; 1113 values of basis orbitals on grids 1114 size: Orbs_Grid[Matomnum+1] 1115 [GridN_Atom[Gc_AN]] 1116 [Spe_Total_NO[Cwan]] 1117 allocation: allocate in truncation.c 1118 free: call as Free_Arrays(0) in openmx.c 1119 *******************************************************/ 1120 Type_Orbs_Grid ***Orbs_Grid; 1121 1122 /******************************************************* 1123 Type_Orbs_Grid ***COrbs_Grid; 1124 values of contrated basis orbitals on grids 1125 size: COrbs_Grid[Matomnum+MatomnumF+1] 1126 [Spe_Total_NO[Cwan]] 1127 [GridN_Atom[Gc_AN]] 1128 allocation: allocate in truncation.c 1129 free: call as Free_Arrays(0) in openmx.c 1130 *******************************************************/ 1131 Type_Orbs_Grid ***COrbs_Grid; 1132 1133 /******************************************************* 1134 Type_Orbs_Grid ***Orbs_Grid_FNAN; 1135 values of basis orbitals on grids for neighbor atoms 1136 which do not belong to my process. 1137 size: Orbs_Grid_FNAN[Matomnum+1] 1138 [FNAN[Gc_AN]+1] 1139 [NumOLG[Mc_AN][h_AN]] 1140 [Spe_Total_NO[Cwan]] 1141 allocation: allocate in truncation.c 1142 free: call as Free_Arrays(0) in openmx.c 1143 *******************************************************/ 1144 Type_Orbs_Grid ****Orbs_Grid_FNAN; 1145 1146 /******************************************************* 1147 double *****H0; 1148 matrix elements of basis orbitals for T+VNL 1149 size: H0[4] 1150 [Matomnum+1] 1151 [FNAN[Gc_AN]+1] 1152 [Spe_Total_NO[Cwan]] 1153 [Spe_Total_NO[Hwan]] 1154 allocation: allocate in truncation.c 1155 free: in truncation.c 1156 and call as Free_Arrays(0) in openmx.c 1157 *******************************************************/ 1158 double *****H0; 1159 1160 /******************************************************* 1161 double *****CntH0; 1162 matrix elements of contracted basis orbitals for T+VNL 1163 size: CntH0[4] 1164 [Matomnum+1] 1165 [FNAN[Gc_AN]+1] 1166 [Spe_Total_CNO[Cwan]] 1167 [Spe_Total_CNO[Hwan]] 1168 allocation: allocate in truncation.c 1169 free: in truncation.c 1170 and call as Free_Arrays(0) in openmx.c 1171 *******************************************************/ 1172 double *****CntH0; 1173 1174 /******************************************************* 1175 double *****HNL; 1176 real matrix elements of basis orbitals for non-local VPS 1177 size: HNL[List_YOUSO[5]] 1178 [Matomnum+1] 1179 [FNAN[Gc_AN]+1] 1180 [Spe_Total_NO[Cwan]] 1181 [Spe_Total_NO[Hwan]] 1182 allocation: allocate in truncation.c 1183 free: in truncation.c 1184 and call as Free_Arrays(0) in openmx.c 1185 *******************************************************/ 1186 double *****HNL; 1187 1188 /******************************************************* 1189 double *****iHNL; 1190 imaginary matrix elements of basis orbitals for non-local VPS 1191 size: iHNL[List_YOUSO[5]] 1192 [Matomnum+MatomnumF+MatomnumS+1] 1193 [FNAN[Gc_AN]+1] 1194 [Spe_Total_NO[Cwan]] 1195 [Spe_Total_NO[Hwan]] 1196 allocation: allocate in truncation.c 1197 free: in truncation.c 1198 and call as Free_Arrays(0) in openmx.c 1199 *******************************************************/ 1200 double *****iHNL; 1201 1202 /******************************************************* 1203 double *****iCntHNL; 1204 imaginary matrix elements of contracted basis orbitals 1205 for non-local VPS 1206 size: iCntHNL[List_YOUSO[5]] 1207 [Matomnum+MatomnumF+MatomnumS+1] 1208 [FNAN[Gc_AN]+1] 1209 [Spe_Total_CNO[Cwan]] 1210 [Spe_Total_CNO[Hwan]] 1211 allocation: allocate in truncation.c 1212 free: in truncation.c 1213 and call as Free_Arrays(0) in openmx.c 1214 *******************************************************/ 1215 double *****iCntHNL; 1216 1217 /******************************************************* 1218 double *****OLP_L; 1219 <i|lx,ly,lz|j> overlap matrix elements with lx,y,z 1220 operator of basis orbitals which are used to calculate 1221 orbital moment 1222 size: OLP_L[3] 1223 [Matomnum+1] 1224 [FNAN[Gc_AN]+1] 1225 [Spe_Total_NO[Cwan]] 1226 [Spe_Total_NO[Hwan]] 1227 allocation: allocate in truncation.c 1228 free: in truncation.c 1229 and call as Free_Arrays(0) in openmx.c 1230 *******************************************************/ 1231 double *****OLP_L; 1232 1233 /******************************************************* 1234 double *****OLP; 1235 overlap matrix elements of basis orbitals 1236 size: OLP[4] 1237 [Matomnum+MatomnumF+MatomnumS+1] 1238 [FNAN[Gc_AN]+1] 1239 [Spe_Total_NO[Cwan]] 1240 [Spe_Total_NO[Hwan]] 1241 allocation: allocate in truncation.c 1242 free: in truncation.c 1243 and call as Free_Arrays(0) in openmx.c 1244 *******************************************************/ 1245 double *****OLP; 1246 1247 /******************************************************* 1248 double *****CntOLP; 1249 overlap matrix elements of contracted basis orbitals 1250 size: CntOLP[4] 1251 [Matomnum+MatomnumF+MatomnumS+1] 1252 [FNAN[Gc_AN]+1] 1253 [Spe_Total_CNO[Cwan]] 1254 [Spe_Total_CNO[Hwan]] 1255 allocation: allocate in truncation.c 1256 free: in truncation.c 1257 and call as Free_Arrays(0) in openmx.c 1258 *******************************************************/ 1259 double *****CntOLP; 1260 1261 /******************************************************* 1262 double *****H; 1263 Kohn-Sham matrix elements of basis orbitals 1264 size: H[SpinP_switch+1] 1265 [Matomnum+MatomnumF+MatomnumS+1] 1266 [FNAN[Gc_AN]+1] 1267 [Spe_Total_NO[Cwan]] 1268 [Spe_Total_NO[Hwan]] 1269 allocation: allocate in truncation.c 1270 free: in truncation.c 1271 and call as Free_Arrays(0) in openmx.c 1272 *******************************************************/ 1273 double *****H; 1274 1275 /******************************************************* 1276 double *****CntH; 1277 Kohn-Sham matrix elements of contracted basis orbitals 1278 size: CntH[SpinP_switch+1] 1279 [Matomnum+MatomnumF+MatomnumS+1] 1280 [FNAN[Gc_AN]+1] 1281 [Spe_Total_CNO[Cwan]] 1282 [Spe_Total_CNO[Hwan]] 1283 allocation: allocate in truncation.c 1284 free: in truncation.c 1285 and call as Free_Arrays(0) in openmx.c 1286 *******************************************************/ 1287 double *****CntH; 1288 1289 /******************************************************* 1290 double ******HisH1; 1291 historical matrix elements corresponding to "H" in 1292 the Kohn-Sham matrix elements 1293 size: HisH1[List_YOUSO[39]] 1294 [SpinP_switch+1] 1295 [Matomnum+1] 1296 [FNAN[Gc_AN]+1] 1297 [Spe_Total_NO[Cwan]] 1298 [Spe_Total_NO[Hwan]] 1299 allocation: allocate in truncation.c 1300 free: in truncation.c 1301 and call as Free_Arrays(0) in openmx.c 1302 *******************************************************/ 1303 double ******HisH1; 1304 1305 /******************************************************* 1306 double ******HisH2; 1307 historical matrix elements corresponding to "iHNL" in 1308 the Kohn-Sham matrix elements 1309 size: HisH2[List_YOUSO[39]] 1310 [SpinP_switch] 1311 [Matomnum+1] 1312 [FNAN[Gc_AN]+1] 1313 [Spe_Total_NO[Cwan]] 1314 [Spe_Total_NO[Hwan]] 1315 allocation: allocate in truncation.c 1316 free: in truncation.c 1317 and call as Free_Arrays(0) in openmx.c 1318 *******************************************************/ 1319 double ******HisH2; 1320 1321 /******************************************************* 1322 double ******ResidualH1; 1323 historical matrix elements corresponding to "H" in 1324 the Kohn-Sham matrix elements 1325 size: ResidualH1[List_YOUSO[39]] 1326 [SpinP_switch+1] 1327 [Matomnum+1] 1328 [FNAN[Gc_AN]+1] 1329 [Spe_Total_NO[Cwan]] 1330 [Spe_Total_NO[Hwan]] 1331 allocation: allocate in truncation.c 1332 free: in truncation.c 1333 and call as Free_Arrays(0) in openmx.c 1334 *******************************************************/ 1335 double ******ResidualH1; 1336 1337 /******************************************************* 1338 double ******ResidualH2; 1339 residual matrix elements corresponding to "iHNL" in 1340 the Kohn-Sham matrix elements 1341 size: ResidualH2[List_YOUSO[39]] 1342 [SpinP_switch] 1343 [Matomnum+1] 1344 [FNAN[Gc_AN]+1] 1345 [Spe_Total_NO[Cwan]] 1346 [Spe_Total_NO[Hwan]] 1347 allocation: allocate in truncation.c 1348 free: in truncation.c 1349 and call as Free_Arrays(0) in openmx.c 1350 *******************************************************/ 1351 double ******ResidualH2; 1352 1353 /******************************************************* 1354 double *****H_Hub; --- added by MJ 1355 real part of effective Hubbard Hamiltonian; 1356 same structure with OLP but the first dimension of OLP, 1357 the dimensions for derivatives, is not required in H_Hub. 1358 instead of it, H_Hub should have spin index. 1359 size: H_Hub[spin] 1360 [Matomnum+1 --> Mc_AN] 1361 [FNAN[Gc_AN]+1] 1362 [Spe_Total_NO[Cwan]] 1363 [Spe_Total_NO[Hwan]] 1364 allocation: allocate in truncation.c 1365 free: in truncation.c 1366 and call as Free_Arrays(0) in openmx.c 1367 *******************************************************/ 1368 double *****H_Hub; /* --- added by MJ */ 1369 1370 /******************************************************* 1371 double *****iHNL0; --- added by TO 1372 imaginary matrix elements for non-local VPS 1373 size: iHNL[List_YOUSO[5]] 1374 [Matomnum+1] 1375 [FNAN[Gc_AN]+1] 1376 [Spe_Total_NO[Cwan]] 1377 [Spe_Total_NO[Hwan]] 1378 allocation: allocate in truncation.c 1379 free: in truncation.c 1380 and call as Free_Arrays(0) in openmx.c 1381 *******************************************************/ 1382 double *****iHNL0; /* --- added by TO */ 1383 1384 /******************************************************* 1385 double ******DS_NL; 1386 overlap matrix elements between projectors, 1387 of non-local potentials, and basis orbitals 1388 size: DS_NL[SO_switch+1] 1389 [4] 1390 [Matomnum+2] 1391 [FNAN[Gc_AN]+1] 1392 [Spe_Total_NO[Cwan]] 1393 [Spe_Total_VPS_Pro[Hwan]+2] 1394 allocation: allocate in truncation.c 1395 free: in truncation.c 1396 and call as Free_Arrays(0) in openmx.c 1397 *******************************************************/ 1398 double ******DS_NL; 1399 1400 /******************************************************* 1401 double ******CntDS_NL; 1402 overlap matrix elements between projectors, of non-local 1403 potentials, and contracted basis orbitals 1404 size: CntDS_NL[SO_switch+1] 1405 [4] 1406 [Matomnum+2] 1407 [FNAN[Gc_AN]+1] 1408 [Spe_Total_CNO[Cwan]] 1409 [Spe_Total_VPS_Pro[Hwan]+2] 1410 allocation: allocate in truncation.c 1411 free: in truncation.c 1412 and call as Free_Arrays(0) in openmx.c 1413 *******************************************************/ 1414 double ******CntDS_NL; 1415 1416 /******************************************************* 1417 double ***H_Zeeman_NCO; 1418 matrix element introduced by the constraint for orbital 1419 magnetic moments. Note that the matrix elements are purely 1420 imaginary. 1421 size: H_Zeeman_NCO[Matomnum+1] 1422 [Spe_Total_NO[Cwan]] 1423 [Spe_Total_NO[Hwan]] 1424 allocation: allocate in truncation.c 1425 free: in truncation.c 1426 and call as Free_Arrays(0) in openmx.c 1427 *******************************************************/ 1428 double ***H_Zeeman_NCO; 1429 1430 /******************************************************* 1431 double ***TRAN_DecMulP; 1432 partial decomposed Mulliken population by CL or CR 1433 overlapping 1434 size: TRAN_DecMulP 1435 [SpinP_switch+1] 1436 [Matomnum+1] 1437 [List_YOUSO[7]] 1438 allocation: allocate in truncation.c 1439 free: in truncation.c 1440 and call as Free_Arrays(0) in openmx.c 1441 *******************************************************/ 1442 double ***TRAN_DecMulP; 1443 1444 /******************************************************* 1445 double ******DM; 1446 current and old density matrices 1447 size: DM[List_YOUSO[16]] 1448 [SpinP_switch+1] 1449 [Matomnum+1] 1450 [FNAN[Gc_AN]+1] 1451 [Spe_Total_NO[Cwan]] 1452 [Spe_Total_NO[Hwan]] 1453 allocation: allocate in truncation.c 1454 free: in truncation.c 1455 and call as Free_Arrays(0) in openmx.c 1456 *******************************************************/ 1457 double ******DM; 1458 1459 /******************************************************* 1460 double *****Partial_DM; 1461 partial density matrix to calculate partial density 1462 in an energy window specified by 1463 a keyword, scf.energy.window.partial.charge. 1464 1465 size: Partial_DM 1466 [2] 1467 [Matomnum+1] 1468 [FNAN[Gc_AN]+1] 1469 [Spe_Total_NO[Cwan]] 1470 [Spe_Total_NO[Hwan]] 1471 allocation: allocate in truncation.c 1472 free: in truncation.c 1473 and call as Free_Arrays(0) in openmx.c 1474 *******************************************************/ 1475 double *****Partial_DM; 1476 1477 /******************************************************* 1478 double ****DM_onsite; --- added by MJ 1479 current 'onsite' density matrices 1480 ; same with ******DM, but [List_YOUSO[16] = 0],[FNAN[Gc_AN]+1 = 0] 1481 i.e. DM_onsite[][][][][] is defined as DM[0][][][0][][]. 1482 To make DM_onsite physically meaninful(H_Hub must be Hermitian), 1483 it is set to be diagonal in the U_Mulliken_Charge.c. 1484 Therefore, last two dimensions are equivalent, i.e., 1485 if [Spe_Total_NO[Cwan]] != [Spe_Total_NO[Hwan]] then 1486 DM_onsite = 0. 1487 So, it is possible to reduce the dimension of this array into 3, 1488 but it remains for the future generalization. 1489 1490 size: DM_onsite 1491 [2] 1492 [SpinP_switch+1] 1493 [Matomnum+1] 1494 [Spe_Total_NO[Cwan]] 1495 [Spe_Total_NO[Hwan]] 1496 allocation: allocate in truncation.c 1497 free: in truncation.c 1498 and call as Free_Arrays(0) in openmx.c 1499 *******************************************************/ 1500 double *****DM_onsite; /* --- added by MJ */ 1501 1502 /******************************************************* 1503 double ****v_eff; --- added by MJ 1504 temporary effective Hubbard type potential which will be used 1505 to construct the effective Hubbard potential, V_eff. 1506 (cf. MJ's LDA+U note at 14, April 2004) 1507 1508 size: v_eff 1509 [SpinP_switch+1] 1510 [Matomnum+MatomnumF+1] 1511 [Spe_Total_NO[Cwan]] 1512 [Spe_Total_NO[Cwan]] 1513 allocation: allocate in truncation.c 1514 free: in truncation.c 1515 and call as Free_Arrays(0) in openmx.c 1516 *******************************************************/ 1517 double ****v_eff; /* --- added by MJ */ 1518 1519 /******************************************************* 1520 dcomplex ******NC_OcpN; 1521 matrix consisting of occupation numbers which are used in 1522 the non-collinear LDA+U method and a constraint DFT for 1523 the spin orientation at each site. 1524 1525 size: NC_OcpN 1526 [2] 1527 [2] 1528 [2] 1529 [Matomnum+1] 1530 [Spe_Total_NO[Cwan]] 1531 [Spe_Total_NO[Cwan]] 1532 allocation: allocate in truncation.c 1533 free: in truncation.c 1534 and call as Free_Arrays(0) in openmx.c 1535 *******************************************************/ 1536 dcomplex ******NC_OcpN; 1537 1538 /******************************************************* 1539 dcomplex *****NC_v_eff; 1540 effectiv potential which are used in the non-collinear 1541 LDA+U method and a constraint DFT for the spin orientation 1542 at each site. 1543 1544 size: NC_v_eff 1545 [2] 1546 [2] 1547 [Matomnum+MatomnumF+1] 1548 [Spe_Total_NO[Cwan]] 1549 [Spe_Total_NO[Cwan]] 1550 allocation: allocate in truncation.c 1551 free: in truncation.c 1552 and call as Free_Arrays(0) in openmx.c 1553 *******************************************************/ 1554 dcomplex *****NC_v_eff; 1555 1556 /******************************************************* 1557 double ******ResidualDM; 1558 current and old residual real density matrices, which are 1559 defined as the difference between input and output 1560 density matrices 1561 size: ResidualDM[List_YOUSO[16]] 1562 [SpinP_switch+1] 1563 [Matomnum+1] 1564 [FNAN[Gc_AN]+1] 1565 [Spe_Total_NO[Cwan]] 1566 [Spe_Total_NO[Hwan]] 1567 allocation: allocate in truncation.c 1568 free: in truncation.c 1569 and call as Free_Arrays(0) in openmx.c 1570 *******************************************************/ 1571 double ******ResidualDM; 1572 1573 /******************************************************* 1574 double ******iResidualDM; 1575 current and old residual imaginary density matrices, 1576 which are defined as the difference between input and 1577 output density matrices 1578 size: iResidualDM[List_YOUSO[16]] 1579 [2] 1580 [Matomnum+1] 1581 [FNAN[Gc_AN]+1] 1582 [Spe_Total_NO[Cwan]] 1583 [Spe_Total_NO[Hwan]] 1584 allocation: allocate in truncation.c 1585 free: in truncation.c 1586 and call as Free_Arrays(0) in openmx.c 1587 *******************************************************/ 1588 double ******iResidualDM; 1589 1590 /******************************************************* 1591 double *****EDM; 1592 current energy density matrices 1593 size: EDM[SpinP_switch+1] 1594 [Matomnum+1] 1595 [FNAN[Gc_AN]+1] 1596 [Spe_Total_NO[Cwan]] 1597 [Spe_Total_NO[Hwan]] 1598 allocation: allocate in truncation.c 1599 free: in truncation.c 1600 and call as Free_Arrays(0) in openmx.c 1601 *******************************************************/ 1602 double *****EDM; 1603 1604 /******************************************************* 1605 double *****PDM; 1606 density matrix at one-step before 1607 size: PDM[SpinP_switch+1] 1608 [Matomnum+1] 1609 [FNAN[Gc_AN]+1] 1610 [Spe_Total_NO[Cwan]] 1611 [Spe_Total_NO[Hwan]] 1612 allocation: allocate in truncation.c 1613 free: in truncation.c 1614 and call as Free_Arrays(0) in openmx.c 1615 *******************************************************/ 1616 double *****PDM; 1617 1618 /******************************************************* 1619 double *****iDM; 1620 imaginary density matrix 1621 size: iDM[List_YOUSO[16]] 1622 [2] 1623 [Matomnum+1] 1624 [FNAN[Gc_AN]+1] 1625 [Spe_Total_NO[Cwan]] 1626 [Spe_Total_NO[Hwan]] 1627 allocation: allocate in truncation.c 1628 free: in truncation.c 1629 and call as Free_Arrays(0) in openmx.c 1630 *******************************************************/ 1631 double ******iDM; 1632 1633 /******************************************************* 1634 double ***S12; 1635 S^{-1/2} of overlap matrix in divide-conquer (DC) method. 1636 1637 size: S12[Matomnum +1][n2][n2] for DC method 1638 allocation: allocate in truncation.c 1639 free: in truncation.c 1640 and call as Free_Arrays(0) in openmx.c 1641 *******************************************************/ 1642 double ***S12; 1643 1644 /******************************************************* 1645 int **NumOLG; 1646 the number of overlapping grids between atom Mc_AN 1647 and atom Lh_AN 1648 size: NumOLG[Matomnum+1] 1649 [FNAN[Gc_AN]+1] 1650 allocation: allocate in truncation.c 1651 free: in truncation.c 1652 and call as Free_Arrays(0) in openmx.c 1653 *******************************************************/ 1654 int **NumOLG; 1655 1656 /******************************************************* 1657 int *RNUM; 1658 the number of initial recusion levels of each atom 1659 size: RNUM[atomnum+1] 1660 allocation: call as Allocate_Arrays(1) in Input_std.c 1661 free: call as Free_Arrays(0) in openmx.c 1662 *******************************************************/ 1663 int *RNUM; 1664 1665 /******************************************************* 1666 int *RNUM2; 1667 the number of current recusion levels of each atom 1668 size: RNUM2[atomnum+1] 1669 allocation: call as Allocate_Arrays(1) in Input_std.c 1670 free: call as Free_Arrays(0) in openmx.c 1671 *******************************************************/ 1672 int *RNUM2; 1673 1674 /******************************************************* 1675 int ***RMI1; 1676 a table which converts local atomic index to global 1677 atomic index. 1678 size: RMI1[Matomnum+1] 1679 [FNAN[Gc_AN]+SNAN[Gc_AN]+1] 1680 [FNAN[Gc_AN]+SNAN[Gc_AN]+1] 1681 allocation: in Trn_System() of truncation.c 1682 free: truncation.c 1683 and call as Free_Arrays(0) in openmx.c 1684 *******************************************************/ 1685 int ***RMI1; 1686 1687 /******************************************************* 1688 int ***RMI2; 1689 a table which converts local atomic index to global 1690 atomic index. 1691 size: RMI2[Matomnum+1] 1692 [FNAN[Gc_AN]+SNAN[Gc_AN]+1] 1693 [FNAN[Gc_AN]+SNAN[Gc_AN]+1] 1694 allocation: in Trn_System() of truncation.c 1695 free: truncation.c 1696 and call as Free_Arrays(0) in openmx.c 1697 *******************************************************/ 1698 int ***RMI2; 1699 1700 /******************************************************* 1701 double *NE_KGrids1, *NE_KGrids2, *NE_KGrids3; 1702 non equivalent k-points along reciprocal a-, b-, and c-axes. 1703 size: NE_KGrids1[num_non_eq_kpt] 1704 NE_KGrids2[num_non_eq_kpt] 1705 NE_KGrids3[num_non_eq_kpt] 1706 allocation: in Generating_MP_Special_Kpt 1707 free: call as Free_Arrays(0) in openmx.c 1708 *******************************************************/ 1709 double *NE_KGrids1,*NE_KGrids2,*NE_KGrids3; 1710 1711 /******************************************************* 1712 int *NE_T_k_op; 1713 weight of the non equivalent k-points 1714 size: NE_T_k_op[num_non_eq_kpt] 1715 allocation: in Generating_MP_Special_Kpt 1716 free: call as Free_Arrays(0) in openmx.c 1717 *******************************************************/ 1718 int *NE_T_k_op; 1719 1720 /******************************************************* 1721 dcomplex *****HOMOs_Coef; 1722 LCAO coefficients of HOMOs 1723 size: HOMOs_Coef[List_YOUSO[33]] 1724 [2] 1725 [List_YOUSO[31]] 1726 [List_YOUSO[1]] 1727 [List_YOUSO[7]] 1728 allocation: in SetPara_DFT.c 1729 free: call as Free_Arrays(0) in openmx.c 1730 *******************************************************/ 1731 dcomplex *****HOMOs_Coef; 1732 1733 /******************************************************* 1734 dcomplex *****LUMOs_Coef; 1735 LCAO coefficients of HOMOs 1736 size: HOMOs_Coef[List_YOUSO[33]] 1737 [2] 1738 [List_YOUSO[32]] 1739 [List_YOUSO[1]] 1740 [List_YOUSO[7]] 1741 allocation: in SetPara_DFT.c 1742 free: call as Free_Arrays(0) in openmx.c 1743 *******************************************************/ 1744 dcomplex *****LUMOs_Coef; 1745 1746 /******************************************************* 1747 int **Spe_Specified_Num; 1748 a table which converts index of contracted orbitals 1749 to that of primitive orbitals 1750 size: Spe_Specified_Num[List_YOUSO[18]] 1751 [Spe_Total_NO[spe]] 1752 allocation: in Set_BasisPara() of SetPara_DFT.c 1753 free: call as Free_Arrays(0) in openmx.c 1754 *******************************************************/ 1755 int **Spe_Specified_Num; 1756 1757 /******************************************************* 1758 int ***Spe_Trans_Orbital; 1759 a table which converts index of contracted orbitals 1760 to that of primitive orbitals 1761 size: Spe_Trans_Orbital[List_YOUSO[18]] 1762 [Spe_Total_NO[spe]] 1763 [List_YOUSO[24]] 1764 allocation: in Set_BasisPara() of SetPara_DFT.c 1765 free: call as Free_Arrays(0) in openmx.c 1766 *******************************************************/ 1767 int ***Spe_Trans_Orbital; 1768 1769 /******************************************************* 1770 int *Spe_OpenCore_flag; 1771 flag to open core pseudopotential. In case of 1, partial 1772 core charge is fully spin-polarized. 1773 size: Spe_Spe2Ban[List_YOUSO[18]] 1774 allocation: Allocation_Arrays(0) in Input_std() 1775 free: call as Free_Arrays(0) in openmx.c 1776 *******************************************************/ 1777 int *Spe_OpenCore_flag; 1778 1779 /******************************************************* 1780 int *Spe_Spe2Ban; 1781 intermediate variable used in Correction_Energy.c 1782 size: Spe_Spe2Ban[List_YOUSO[18]] 1783 allocation: Allocation_Arrays(0) in Input_std() 1784 of SetPara_DFT.c 1785 free: call as Free_Arrays(0) in openmx.c 1786 *******************************************************/ 1787 int *Spe_Spe2Ban; 1788 1789 /******************************************************* 1790 int *Bulk_Num_HOMOs; 1791 the number of HOMOs of bulk for outputting to files 1792 size: Bulk_Num_HOMOs[List_YOUSO[33]] 1793 allocation: in SetPara_DFT.c 1794 free: call as Free_Arrays(0) in openmx.c 1795 *******************************************************/ 1796 int *Bulk_Num_HOMOs; 1797 1798 /******************************************************* 1799 int *Bulk_Num_LUMOs; 1800 the number of LUMOs of bulk for outputting to files 1801 size: Bulk_Num_HOMOs[List_YOUSO[33]] 1802 allocation: in SetPara_DFT.c 1803 free: call as Free_Arrays(0) in openmx.c 1804 *******************************************************/ 1805 int *Bulk_Num_LUMOs; 1806 1807 /******************************************************* 1808 int **Bulk_HOMO; 1809 HOMOs of up and down spins in the bulk systems 1810 size: Bulk_HOMO[List_YOUSO[33]][2] 1811 allocation: in SetPara_DFT.c 1812 free: call as Free_Arrays(0) in openmx.c 1813 *******************************************************/ 1814 int **Bulk_HOMO; 1815 1816 /******************************************************* 1817 double ***CntCoes; 1818 contraction coefficients of basis orbitals 1819 size: CntCoes[Matomnum+MatomnumF+1] 1820 [List_YOUSO[7]] 1821 [List_YOUSO[24]] 1822 allocation: in truncation.c 1823 free: in truncation.c 1824 and call as Free_Arrays(0) in openmx.c 1825 *******************************************************/ 1826 double ***CntCoes; 1827 1828 /******************************************************* 1829 double ***CntCoes_Species; 1830 contraction coefficients of basis orbitals 1831 size: CntCoes_Species 1832 [SpeciesNum+1] 1833 [List_YOUSO[7]] 1834 [List_YOUSO[24]] 1835 allocation: in truncation.c 1836 free: in truncation.c 1837 and call as Free_Arrays(0) in openmx.c 1838 *******************************************************/ 1839 double ***CntCoes_Species; 1840 1841 /******************************************************* 1842 int *CntOrb_Atoms; 1843 atoms for outputting contraction coefficients of 1844 basis orbitals to files 1845 size: CntOrb_Atoms[Num_CntOrb_Atoms] 1846 allocation: in Input_std.c 1847 free: call as Free_Arrays(0) in openmx.c 1848 *******************************************************/ 1849 int *CntOrb_Atoms; 1850 1851 /******************************************************* 1852 double **S; 1853 a full overlap matrix 1854 size: S[Size_Total_Matrix+2][Size_Total_Matrix+2] 1855 allocation: in SetPara_DFT.c 1856 free: call as Free_Arrays(0) in openmx.c 1857 *******************************************************/ 1858 double **S; 1859 1860 /******************************************************* 1861 double *EV_S; 1862 the eigenvalues of a full overlap matrix 1863 size: EV_S[Size_Total_Matrix+2] 1864 allocation: in SetPara_DFT.c 1865 free: call as Free_Arrays(0) in openmx.c 1866 *******************************************************/ 1867 double *EV_S; 1868 1869 /******************************************************* 1870 double *IEV_S; 1871 the inverse of eigenvalues of a full overlap matrix 1872 size: IEV_S[Size_Total_Matrix+2] 1873 allocation: in SetPara_DFT.c 1874 free: call as Free_Arrays(0) in openmx.c 1875 *******************************************************/ 1876 double *IEV_S; 1877 1878 /******************************************************* 1879 int *M2G 1880 M2G gives a conversion from the medium 1881 index to the global indicies of atoms. 1882 size: M2G[Matomnum+1] 1883 allocation: in Set_Allocate_Atom2CPU.c 1884 free: call as Free_Arrays(0) in openmx.c 1885 and in Set_Allocate_Atom2CPU.c 1886 *******************************************************/ 1887 int *M2G; 1888 1889 /******************************************************* 1890 int *F_M2G, *S_M2G; 1891 F_M2G, and S_M2G give a conversion from the medium 1892 index (Matomnum+MatomnumF, 1893 Matomnum+MatomnumF+MatomnumS) 1894 to the global indicies of atoms. 1895 size: F_M2G[Matomnum+MatomnumF+1], 1896 S_M2G[Matomnum+MatomnumF+MatomnumS+1], 1897 allocation: in truncation.c 1898 free: call as Free_Arrays(0) in openmx.c 1899 and in truncation.c 1900 *******************************************************/ 1901 int *F_M2G,*S_M2G; 1902 1903 /******************************************************* 1904 int *VPS_j_dependency; 1905 VPS_j_dependency gives a flag whethere the VPS depends 1906 on total moment j. 1907 size: VPS_j_dependency[SpeciesNum], 1908 allocation: call as Allocate_Arrays(0) in Input_std.c 1909 free: call as Free_Arrays(0) in openmx.c 1910 *******************************************************/ 1911 int *VPS_j_dependency; 1912 1913 /******************************************************* 1914 double ***Projector_VNA; 1915 Projectors for a projector expansion of VNA 1916 size: Projector_VNA[List_YOUSO[18]][YOUSO35+1][YOUSO34][List_YOUSO[22]] 1917 allocation: call Allocate_Arrays(7) in SetPara_DFT.c 1918 free: call Free_Arrays(0) in openmx.c 1919 *******************************************************/ 1920 double ****Projector_VNA; 1921 1922 /******************************************************* 1923 double **VNA_proj_ene; 1924 Projector energy for a projector expansion of VNA 1925 size: VNA_proj_ene[List_YOUSO[18]][YOUSO35+1][YOUSO34] 1926 allocation: call Allocate_Arrays(7) in SetPara_DFT.c 1927 free: call Free_Arrays(0) in openmx.c 1928 *******************************************************/ 1929 double ***VNA_proj_ene; 1930 1931 /******************************************************* 1932 double ***Spe_VNA_Bessel; 1933 radial parts of projectors of VNA on radial mesh 1934 in the momentum space 1935 size: Spe_VNA_Bessel[List_YOUSO[18]][YOUSO35+1][YOUSO34][List_YOUSO[15]] 1936 allocation: call Allocate_Arrays(7) in SetPara_DFT.c 1937 free: call Free_Arrays(0) in openmx.c 1938 *******************************************************/ 1939 double ****Spe_VNA_Bessel; 1940 1941 /******************************************************* 1942 double **Spe_CrudeVNA_Bessel; 1943 radial parts of crude VNA potentials on 1944 Gauss-Legendre radial mesh in the momentum space 1945 size: Spe_CrudeVNA_Bessel[List_YOUSO[18]][GL_Mesh+2] 1946 allocation: call Allocate_Arrays(7) in SetPara_DFT.c 1947 free: call Free_Arrays(0) in openmx.c 1948 *******************************************************/ 1949 double **Spe_CrudeVNA_Bessel; 1950 1951 /******************************************************* 1952 double *******Spe_ProductRF_Bessel; 1953 radial parts of product of two PAOs on 1954 Gauss-Legendre radial mesh in the momentum space 1955 size: Spe_ProductRF_Bessel[List_YOUSO[18]] 1956 [Spe_MaxL_Basis[i]+1] 1957 [Spe_Num_Basis[i][j]] 1958 [Spe_MaxL_Basis[i]+1] 1959 [Spe_Num_Basis[i][l]] 1960 [Lmax+1] 1961 [GL_Mesh+2] 1962 allocation: call Allocate_Arrays(7) in SetPara_DFT.c 1963 free: call Free_Arrays(0) in openmx.c 1964 *******************************************************/ 1965 double *******Spe_ProductRF_Bessel; 1966 1967 /******************************************************* 1968 double ****HVNA; 1969 real matrix elements of basis orbitals for VNA projectors 1970 size: HVNA[Matomnum+1] 1971 [FNAN[Gc_AN]+1] 1972 [Spe_Total_NO[Cwan]] 1973 [Spe_Total_NO[Hwan]] 1974 allocation: allocate in truncation.c 1975 free: in truncation.c 1976 and call as Free_Arrays(0) in openmx.c 1977 *******************************************************/ 1978 double ****HVNA; 1979 1980 /******************************************************* 1981 Type_DS_VNA *****DS_VNA; 1982 overlap matrix elements between projectors of VNA 1983 potentials, and basis orbitals 1984 size: DS_VNA[4] 1985 [Matomnum+4] 1986 [FNAN[Gc_AN]+1] 1987 [Spe_Total_NO[Cwan]] 1988 [(YOUSO35+1)*(YOUSO35+1)*YOUSO34] 1989 allocation: allocate in truncation.c 1990 free: in truncation.c 1991 and call as Free_Arrays(0) in openmx.c 1992 *******************************************************/ 1993 Type_DS_VNA *****DS_VNA; 1994 1995 /******************************************************* 1996 Type_DS_VNA *****CntDS_VNA; 1997 overlap matrix elements between projectors of VNA 1998 potentials, and contracted basis orbitals 1999 size: CntDS_VNA[4] 2000 [Matomnum+MatomnumF+1] 2001 [FNAN[Gc_AN]+1] 2002 [Spe_Total_CNO[Cwan]] 2003 [(YOUSO35+1)*(YOUSO35+1)*YOUSO34] 2004 allocation: allocate in truncation.c 2005 free: in truncation.c 2006 and call as Free_Arrays(0) in openmx.c 2007 *******************************************************/ 2008 Type_DS_VNA *****CntDS_VNA; 2009 2010 /******************************************************* 2011 double ****HVNA2; 2012 real matrix elements of basis orbitals for VNA projectors 2013 <Phi_{LM,L'M'}|VNA> 2014 size: HVNA2[4] 2015 [Matomnum+1] 2016 [FNAN[Gc_AN]+1] 2017 [Spe_Total_NO[Cwan]] 2018 [Spe_Total_NO[Cwan]] 2019 allocation: allocate in truncation.c 2020 free: in truncation.c 2021 and call as Free_Arrays(0) in openmx.c 2022 *******************************************************/ 2023 double *****HVNA2; 2024 2025 /******************************************************* 2026 double ****HVNA3; 2027 real matrix elements of basis orbitals for VNA projectors 2028 <VNA|Phi_{LM,L'M'}> 2029 size: HVNA3[4] 2030 [Matomnum+1] 2031 [FNAN[Gc_AN]+1] 2032 [Spe_Total_NO[Cwan]] 2033 [Spe_Total_NO[Cwan]] 2034 allocation: allocate in truncation.c 2035 free: in truncation.c 2036 and call as Free_Arrays(0) in openmx.c 2037 *******************************************************/ 2038 double *****HVNA3; 2039 2040 /******************************************************* 2041 double ****CntHVNA2; 2042 real matrix elements of basis orbitals for VNA projectors 2043 <Phi_{LM,L'M'}|VNA> 2044 size: CntHVNA2[4] 2045 [Matomnum+1] 2046 [FNAN[Gc_AN]+1] 2047 [Spe_Total_CNO[Cwan]] 2048 [Spe_Total_CNO[Cwan]] 2049 allocation: allocate in truncation.c 2050 free: in truncation.c 2051 and call as Free_Arrays(0) in openmx.c 2052 *******************************************************/ 2053 double *****CntHVNA2; 2054 2055 /******************************************************* 2056 double ****CntHVNA3; 2057 real matrix elements of basis orbitals for VNA projectors 2058 <VNA|Phi_{LM,L'M'}> 2059 size: CntHVNA3[4] 2060 [Matomnum+1] 2061 [FNAN[Gc_AN]+1] 2062 [Spe_Total_CNO[Cwan]] 2063 [Spe_Total_CNO[Cwan]] 2064 allocation: allocate in truncation.c 2065 free: in truncation.c 2066 and call as Free_Arrays(0) in openmx.c 2067 *******************************************************/ 2068 double *****CntHVNA3; 2069 2070 /******************************************************* 2071 int *Msize_EC 2072 The dimension of matrix consisting of (central atom)+ 2073 FNAN+SNAN in the EC method 2074 size: Msize_EC[Matomnum+1] 2075 allocation: allocate in truncation.c 2076 free: in truncation.c 2077 and call as Free_Arrays(0) in openmx.c 2078 *******************************************************/ 2079 int *Msize_EC; 2080 2081 /******************************************************* 2082 int *Each_EC_Sub_Dim 2083 The dimension of subspace for each atom in the EC method 2084 size: Each_EC_Sub_Dim[Matomnum+1] 2085 allocation: allocate in truncation.c 2086 free: in truncation.c 2087 and call as Free_Arrays(0) in openmx.c 2088 *******************************************************/ 2089 int *Each_EC_Sub_Dim; 2090 2091 /******************************************************* 2092 int *rl_EC 2093 recursion level to generate Krylov subspae for each atom 2094 in the EC method 2095 size: Each_EC_Sub_Dim[Matomnum+1] 2096 allocation: allocate in truncation.c 2097 free: in truncation.c 2098 and call as Free_Arrays(0) in openmx.c 2099 *******************************************************/ 2100 int *rl_EC; 2101 2102 /******************************************************* 2103 double ***EVal_EC 2104 eigenvalues of the embedded clusters in the EC method 2105 size: EVal_EC[SpinP_switch+1] 2106 [Matomnum+1] 2107 [rl_EC[Mc_AN]*tno1+2] 2108 allocation: allocate in truncation.c 2109 free: in truncation.c 2110 and call as Free_Arrays(0) in openmx.c 2111 *******************************************************/ 2112 double ***EVal_EC; 2113 2114 /******************************************************* 2115 double ******Residues_EC 2116 residues of the embedded clusters in the EC method 2117 size: Residues_EC[SpinP_switch+1] 2118 [Matomnum+1] 2119 [FNAN[Gc_AN]+1] 2120 [tno1] 2121 [tno2] 2122 [rl_EC[Mc_AN]*tno1+2] 2123 allocation: allocate in truncation.c 2124 free: in truncation.c 2125 and call as Free_Arrays(0) in openmx.c 2126 *******************************************************/ 2127 double ******Residues_EC; 2128 2129 /******************************************************* 2130 double ***PDOS_EC 2131 PDOS of the embedded clusters in the EC method 2132 size: PDOS_EC[SpinP_switch+1] 2133 [Matomnum+1] 2134 [rl_EC[Mc_AN]*tno+2] 2135 allocation: allocate in truncation.c 2136 free: in truncation.c 2137 and call as Free_Arrays(0) in openmx.c 2138 *******************************************************/ 2139 double ***PDOS_EC; 2140 2141 /******************************************************* 2142 double ***SubSpace_EC 2143 a set of vectors spanning a subspace of the embedded 2144 clusters in the EC method 2145 size: SubSpace_EC[SpinP_switch+1] 2146 [Matomnum+1] 2147 [(rl_EC[Mc_AN]*tno+2)*Msize_EC[Mc_AN]] 2148 allocation: allocate in truncation.c 2149 free: in truncation.c 2150 and call as Free_Arrays(0) in openmx.c 2151 *******************************************************/ 2152 double ***SubSpace_EC; 2153 2154 /******************************************************* 2155 double ***Krylov_U (for BLAS3 version) 2156 a Krylov matrix used in the embedding cluster method 2157 size: Krylov_U[SpinP_switch+1] 2158 [Matomnum+1] 2159 [List_YOUSO[3]*List_YOUSO[7]*(Max_FNAN+1)*List_YOUSO[7]] 2160 allocation: allocate in truncation.c 2161 free: in truncation.c 2162 and call as Free_Arrays(0) in openmx.c 2163 *******************************************************/ 2164 double ***Krylov_U; 2165 2166 /******************************************************* 2167 double ***First_Moment_EC 2168 double ***Second_Moment_EC 2169 First moments of projected density of states used 2170 in the embedding cluster method 2171 size: First_Moment_EC[SpinP_switch+1] 2172 [atomnum+1] 2173 [List_YOUSO[7]] 2174 allocation: call as Allocate_Arrays(1) in Input_std.c 2175 free: call as Free_Arrays(0) in openmx.c 2176 *******************************************************/ 2177 double ***First_Moment_EC; 2178 double ***Second_Moment_EC; 2179 2180 /******************************************************* 2181 double ****EC_matrix 2182 a perturbation matrix used in the embedding cluster method 2183 size: EC_matrix[SpinP_switch+1] 2184 [Matomnum+1] 2185 [List_YOUSO[3]*List_YOUSO[7]] 2186 [List_YOUSO[3]*List_YOUSO[7]] 2187 allocation: allocate in truncation.c 2188 free: in truncation.c 2189 and call as Free_Arrays(0) in openmx.c 2190 *******************************************************/ 2191 double ****EC_matrix; 2192 2193 /******************************************************* 2194 int *rlmax_EC; 2195 recursion level to generate the preconditioning matrix 2196 for Hamiltonian in EC method 2197 size: rlmax_EC[Matomnum+1] 2198 allocation: allocate in truncation.c 2199 free: in truncation.c 2200 and call as Free_Arrays(0) in openmx.c 2201 *******************************************************/ 2202 int *rlmax_EC; 2203 2204 /******************************************************* 2205 int *rlmax_EC2; 2206 recursion level to generate the preconditioning matrix 2207 for overlap matrix in EC method 2208 size: rlmax_EC2[Matomnum+1] 2209 allocation: allocate in truncation.c 2210 free: in truncation.c 2211 and call as Free_Arrays(0) in openmx.c 2212 *******************************************************/ 2213 int *rlmax_EC2; 2214 2215 /******************************************************* 2216 int *EKC_core_size; 2217 core size in EKC method 2218 size: EKC_core_size[Matomnum+1] 2219 allocation: allocate in truncation.c 2220 free: in truncation.c 2221 and call as Free_Arrays(0) in openmx.c 2222 *******************************************************/ 2223 int *EKC_core_size; 2224 2225 /******************************************************* 2226 double *scale_rc_EKC; 2227 scale factor to determine the core size in EKC method 2228 size: scale_rc_EKC[Matomnum+1] 2229 allocation: allocate in truncation.c 2230 free: in truncation.c 2231 and call as Free_Arrays(0) in openmx.c 2232 *******************************************************/ 2233 double *scale_rc_EKC; 2234 2235 /******************************************************* 2236 double **InvHessian 2237 an approximate inverse of Hessian matrix 2238 size: InvHessian[3*atomnum+2][3*atomnum+2] 2239 allocation: allocate as Allocate_Arrays(1) 2240 free: Free_Arrays(0) in openmx.c 2241 *******************************************************/ 2242 double **InvHessian; 2243 2244 /******************************************************* 2245 double **Hessian 2246 an approximate Hessian matrix 2247 size: Hessian[3*atomnum+2][3*atomnum+2] 2248 allocation: allocate as Allocate_Arrays(1) 2249 free: Free_Arrays(0) in openmx.c 2250 *******************************************************/ 2251 double **Hessian; 2252 2253 /******************************************************* 2254 double ***DecEkin 2255 decomposed kinetic energy 2256 size: DecEkin[2][Matomnum+1][List_YOUSO[7]] 2257 allocation: allocate in truncation.c 2258 free: in truncation.c 2259 and call as Free_Arrays(0) in openmx.c 2260 *******************************************************/ 2261 double ***DecEkin; 2262 2263 /******************************************************* 2264 double ***DecEna 2265 decomposed neutral atom energy 2266 size: DecEna[2][Matomnum+1][List_YOUSO[7]] 2267 allocation: allocate in truncation.c 2268 free: in truncation.c 2269 and call as Free_Arrays(0) in openmx.c 2270 *******************************************************/ 2271 double ***DecEna; 2272 2273 /******************************************************* 2274 double ***DecEnl 2275 decomposed energy of nonlocal pseudopotential 2276 size: DecEnl[2][Matomnum+1][List_YOUSO[7]] 2277 allocation: allocate in truncation.c 2278 free: in truncation.c 2279 and call as Free_Arrays(0) in openmx.c 2280 *******************************************************/ 2281 double ***DecEnl; 2282 2283 /******************************************************* 2284 double ***DecEdee 2285 decomposed energy of delta Hartree potential 2286 size: DecEdee[2][Matomnum+1][List_YOUSO[7]] 2287 allocation: allocate in truncation.c 2288 free: in truncation.c 2289 and call as Free_Arrays(0) in openmx.c 2290 *******************************************************/ 2291 double ***DecEdee; 2292 2293 /******************************************************* 2294 double ***DecExc 2295 decomposed exchange-correlation energy 2296 size: DecExc[2][Matomnum+1][List_YOUSO[7]] 2297 allocation: allocate in truncation.c 2298 free: in truncation.c 2299 and call as Free_Arrays(0) in openmx.c 2300 *******************************************************/ 2301 double ***DecExc; 2302 2303 /******************************************************* 2304 double ***DecEef 2305 decomposed electric field energy 2306 size: DecEef[2][Matomnum+1][List_YOUSO[7]] 2307 allocation: allocate in truncation.c 2308 free: in truncation.c 2309 and call as Free_Arrays(0) in openmx.c 2310 *******************************************************/ 2311 double ***DecEef; 2312 2313 /******************************************************* 2314 double ***DecEscc 2315 decomposed energy of screened core-core repulsion energy 2316 size: DecEscc[2][Matomnum+1][List_YOUSO[7]] 2317 allocation: allocate in truncation.c 2318 free: in truncation.c 2319 and call as Free_Arrays(0) in openmx.c 2320 *******************************************************/ 2321 double ***DecEscc; 2322 2323 /******************************************************* 2324 double ***DecEhub 2325 decomposed Hubbard energy 2326 size: DecEhub[2][Matomnum+1][List_YOUSO[7]] 2327 allocation: allocate in truncation.c 2328 free: in truncation.c 2329 and call as Free_Arrays(0) in openmx.c 2330 *******************************************************/ 2331 double ***DecEhub; 2332 2333 /******************************************************* 2334 double ***DecEcs 2335 decomposed constraint energy 2336 size: DecEcs[2][Matomnum+1][List_YOUSO[7]] 2337 allocation: allocate in truncation.c 2338 free: in truncation.c 2339 and call as Free_Arrays(0) in openmx.c 2340 *******************************************************/ 2341 double ***DecEcs; 2342 2343 /******************************************************* 2344 double ***DecEvdw 2345 decomposed van der Waals energy (D2 or D3) by Dion 2346 size: DecEvdw[2][Matomnum+1][List_YOUSO[7]] 2347 allocation: allocate in truncation.c 2348 free: in truncation.c 2349 and call as Free_Arrays(0) in openmx.c 2350 *******************************************************/ 2351 double ***DecEvdw; 2352 2353 /******************************************************* 2354 double ***DecEzs 2355 decomposed Zeeman erergy for spin moment 2356 size: DecEzs[2][Matomnum+1][List_YOUSO[7]] 2357 allocation: allocate in truncation.c 2358 free: in truncation.c 2359 and call as Free_Arrays(0) in openmx.c 2360 *******************************************************/ 2361 double ***DecEzs; 2362 2363 /******************************************************* 2364 double ***DecEzo 2365 decomposed Zeeman erergy for orbital moment 2366 size: DecEzo[2][Matomnum+1][List_YOUSO[7]] 2367 allocation: allocate in truncation.c 2368 free: in truncation.c 2369 and call as Free_Arrays(0) in openmx.c 2370 *******************************************************/ 2371 double ***DecEzo; 2372 2373 2374 2375 dcomplex *zp,*Ep,*Rp; 2376 double GL_Abscissae[GL_Mesh+2],GL_Weight[GL_Mesh+2]; 2377 double FineGL_Abscissae[FineGL_Mesh+2],FineGL_Weight[FineGL_Mesh+2]; 2378 double CoarseGL_Abscissae[CoarseGL_Mesh+2],CoarseGL_Weight[CoarseGL_Mesh+2]; 2379 double GL_NormK[GL_Mesh+2]; 2380 char Atom_Symbol[YOUSO14][4]; 2381 double Atom_Weight[YOUSO14]; 2382 double tv[4][4],rtv[4][4]; 2383 double Left_tv[4][4],Right_tv[4][4]; 2384 double gtv[4][4],rgtv[4][4],length_gtv[4]; 2385 double gtv_FE[4][4],rgtv_FE[4][4]; 2386 double Stress_Tensor[9]; 2387 2388 double Grid_Origin[4]; 2389 double dipole_moment[4][4]; 2390 double TempPara[30][3],PrePara[30][3]; 2391 double MD_TimeStep,ChemP,Beta; 2392 double CN_Error,E_Temp,Original_E_Temp,FCR,BCR; 2393 double GP,GT,T,Weight,Cell_Volume,Uele,Uele2,Ukc,Uvdw; 2394 double Uele_OS0,Uele_OS1,Uele_IS0,Uele_IS1,Uxc0,Uxc1; 2395 double UH0,UH1,UH2,Ucore,Uhub,Ucs,Uef,Ukin,Unl,Una,Uzs,Uzo,UvdW; 2396 double Ucc,Ucoh,Uatom,Udc,Utot,Uxc,Given_Total_Charge,Calc_Total_Charge; 2397 double Min_Mixing_weight,Max_Mixing_weight,Max_Mixing_weight2,Mixing_weight; 2398 double Kerker_factor,Criterion_MP_Special_Kpt; 2399 double Gdiis_Mixing,system_charge,VNA_reduce_ratio,Total_Num_Electrons; 2400 double Total_SpinS,Total_SpinSx,Total_SpinSy,Total_SpinSz; 2401 double Total_OrbitalMoment,Total_OrbitalMomentx; 2402 double Total_OrbitalMomenty,Total_OrbitalMomentz; 2403 double Total_SpinAngle0,Total_SpinAngle1; 2404 double Total_OrbitalMomentAngle0,Total_OrbitalMomentAngle1; 2405 double ScaleSize,Pin[4][4],Ptot[4][4]; 2406 double LastBoxCenterX,LastBoxCenterY,LastBoxCenterZ; 2407 double Vol,Vol1,Vol2,Vol3,W; 2408 double SCF_Criterion,NormRD[5],BestNormRD,History_Uele[5]; 2409 double PAO_Nkmax,Grid_Ecut,Finite_Elements_Ecut,rcut_FEB; 2410 double orbitalOpt_criterion,MD_Opt_criterion,orbitalOpt_SD_step; 2411 double MD_EvsLattice_Step; 2412 int MD_EvsLattice_flag[3]; 2413 int MD_OutABC; 2414 double X_Center_Coordinate,Y_Center_Coordinate,Z_Center_Coordinate; 2415 dcomplex Comp2Real[YOUSO36+1][2*(YOUSO36+1)+1][2*(YOUSO36+1)+1]; 2416 /* added by mari (May 2004) */ 2417 double TempScale[30],RatScale[30],Temp; 2418 int IntScale[30],NumScale[30]; 2419 /* added by mari (May 2004) */ 2420 /* for Nose-Hoover algorithm */ 2421 double NH_R,NH_nzeta,NH_czeta,TempQ,GivenTemp,NH_Ham; 2422 2423 /* for VS4 (added by T.Ohwaki) */ 2424 int num_AtGr,*AtomGr,*atnum_AtGr; 2425 double *Temp_AtGr; 2426 2427 /* for Langevin heat-bath (added by T.Ohwaki) */ 2428 double FricFac,GivenTemp,RandomF; 2429 2430 int NUMPROCS_MPI_COMM_WORLD,MYID_MPI_COMM_WORLD; 2431 int alloc_first[40],Last_TNumGrid; 2432 int Scf_RestartFromFile,Band_disp_switch; 2433 int GeoOpt_RestartFromFile,OutData_bin_flag; 2434 int coordinates_unit,unitvector_unit; 2435 int Size_Total_Matrix,SP_PEV,EKC_core_size_max; 2436 int specified_system,MO_fileout,num_HOMOs,num_LUMOs; 2437 int Cluster_HOMO[2],MO_Nkpoint,ML_flag,ForceConsistency_flag,force_flag; 2438 int StressConsistency_flag,stress_flag,scf_stress_flag,MD_cellopt_flag,cellopt_swtich; 2439 int rediagonalize_flag_overlap_matrix; 2440 int rediagonalize_flag_overlap_matrix_ELPA1; 2441 int CntOrb_fileout,Num_CntOrb_Atoms; 2442 int num_non_eq_kpt,way_of_kpoint; 2443 int remake_headfile,OneD_Grid,Ngrid1,Ngrid2,Ngrid3; 2444 int Ngrid1_FE,Ngrid2_FE,Ngrid3_FE; 2445 int TNumGrid,Kspace_grid1,Kspace_grid2,Kspace_grid3; 2446 int DFTSCF_loop,Ngrid_NormK,SCF_RENZOKU; 2447 int Mixing_switch,MD_IterNumber,MD_Current_Iter,Av_num,T_switch,IS_switch; 2448 int MD_Init_Velocity,Correct_Position_flag; 2449 int rlmax_IS,XC_switch,PCC_switch,SpinP_switch,SpeciesNum,real_SpeciesNum; 2450 int Hub_U_switch,Hub_U_occupation,Hub_U_Enhance_OrbPol; /* --- added by MJ */ 2451 int SO_switch,MPI_tunedgrid_flag,Voronoi_Charge_flag,Voronoi_OrbM_flag; 2452 int Constraint_NCS_switch,openmp_threads_eq_procs,openmp_threads_num; 2453 int Zeeman_NCS_switch,Zeeman_NCO_switch; 2454 int atomnum,Catomnum,Latomnum,Ratomnum; 2455 int POLES,rlmax,Solver,dste_flag,Ngrid_fixed_flag,scf_eigen_lib_flag; 2456 int KrylovH_order,KrylovS_order,recalc_EM,EKC_invS_flag; 2457 int EC_Sub_Dim,Energy_Decomposition_flag; 2458 int EKC_Exact_invS_flag,EKC_expand_core_flag,orderN_FNAN_SNAN_flag; 2459 int MD_switch,PeriodicGamma_flag,CellOpt_switch; 2460 int Max_FNAN,Max_FSNAN,Max_GridN_Atom,Max_NumOLG,Max_OneD_Grids; 2461 int Max_Nd,Max_TGN_EH0,CellNN_flag,Kmixing_flag; 2462 int NN_B_AB2CA_S,NN_B_AB2CA_R,NN_B_CA2CB_S,NN_B_CA2CB_R; 2463 int NN_A2B_S,NN_A2B_R,NN_B2C_S,NN_B2C_R,NN_B2D_S,NN_B2D_R; 2464 int List_YOUSO[NYOUSO]; 2465 int PreNum,TempNum,TCpyCell,CpyCell; 2466 int Runtest_flag; 2467 int Num_Mixing_pDM,level_stdout,level_fileout,HS_fileout; 2468 int memoryusage_fileout; 2469 int Pulay_SCF,Pulay_SCF_original,EveryPulay_SCF,SCF_Control_Temp; 2470 int Cnt_switch,RCnt_switch,SICnt_switch,ACnt_switch,SCnt_switch; 2471 int E_Field_switch,Simple_InitCnt[10]; 2472 int MD_Opt_OK,orbitalOpt_SCF,orbitalOpt_MD,orbitalOpt_per_MDIter; 2473 int orbitalOpt_History,orbitalOpt_StartPulay,OrbOpt_OptMethod; 2474 int orbitalOpt_Force_Skip,Initial_Hessian_flag; 2475 int NOHS_L,NOHS_C,ProExpn_VNA,BufferL_ProVNA; 2476 int M_GDIIS_HISTORY,OptStartDIIS,OptEveryDIIS; 2477 int Extrapolated_Charge_History; 2478 int orderN_Kgrid,FT_files_save,FT_files_read; 2479 int NEB_Num_Images,NEB_Spring_Const; 2480 int Min_Grid_Index[4],Max_Grid_Index[4]; 2481 int Min_Grid_Index_D[4],Max_Grid_Index_D[4]; 2482 int SO_factor_flag; 2483 int Cell_Fixed_XYZ[4][4]; 2484 2485 double **CompTime; 2486 2487 char filename[YOUSO10],filepath[YOUSO10],command[YOUSO10]; 2488 char DFT_DATA_PATH[YOUSO10]; 2489 double Oopt_NormD[10]; 2490 double bias_weight,Past_Utot[10],Past_Norm[10]; 2491 double Max_Force,GridVol,W_OrthoNorm; 2492 double SD_scaling,SD_scaling_user; 2493 double Constraint_NCS_V; 2494 double Mag_Field_Orbital,Mag_Field_Spin; 2495 double scf_fixed_origin[4]; 2496 int F_dVHart_flag,F_Vxc_flag,F_VNA_flag; 2497 int F_VEF_flag,F_Kin_flag,F_NL_flag,F_U_flag; 2498 int F_dftD_flag; /* okuno */ 2499 2500 /* partial charge for STM simulation */ 2501 int cal_partial_charge; 2502 double ene_win_partial_charge; 2503 2504 /* band dispersion */ 2505 int Band_Nkpath,Band_kPathUnit; 2506 double Band_UnitCell[4][4]; 2507 int *Band_N_perpath; 2508 double ***Band_kpath; 2509 char ***Band_kname; 2510 2511 /* DOS */ 2512 int DosGauss_fileout; 2513 int Dos_fileout; 2514 int DosGauss_Num_Mesh; 2515 double DosGauss_Width; 2516 double Dos_Erange[2]; 2517 int Dos_Kgrid[3]; 2518 int Opticalconductivity_fileout; 2519 2520 /* electric field */ 2521 double E_Field[3]; 2522 2523 /* O(N^2) method */ 2524 int ON2_Npoles,ON2_Npoles_f; 2525 dcomplex *ON2_zp,*ON2_Rp,*ON2_zp_f,*ON2_Rp_f; 2526 int *ON2_method,*ON2_method_f; 2527 2528 /* Wannier funtions by hmweng */ 2529 2530 int Wannier_Func_Calc; 2531 int Wannier_Func_Num; 2532 double Wannier_Outer_Window_Bottom; 2533 double Wannier_Outer_Window_Top; 2534 double Wannier_Inner_Window_Bottom; 2535 double Wannier_Inner_Window_Top; 2536 int Wannier_Initial_Guess; 2537 int Wannier_unit; 2538 int Wannier_Num_Kinds_Projectors; 2539 int Num_Wannier_Template_Projectors; 2540 int Wannier_grid1,Wannier_grid2,Wannier_grid3; 2541 int Wannier_MaxShells; 2542 int Wannier_Minimizing_Max_Steps; 2543 char **Wannier_ProSpeName; 2544 char **Wannier_ProName; 2545 double **Wannier_Pos, **Wannier_Guide; 2546 double **Wannier_X_Direction; 2547 double **Wannier_Z_Direction; 2548 int *Wannier_Num_Pro, *Wannier_ProName2Num; 2549 int **Wannier_NumL_Pro; 2550 int *WannierPro2SpeciesNum; 2551 int Wannier_Draw_Int_Bands,Wannier_Draw_MLWF; 2552 int Wannier_Plot_SuperCells[3]; 2553 double Wannier_Dis_Mixing_Para, Wannier_Dis_Conv_Criterion; 2554 int Wannier_Dis_SCF_Max_Steps; 2555 int Wannier_Min_Scheme, Wannier_Min_Secant_Steps; 2556 double Wannier_Min_StepLength, Wannier_Min_Secant_StepLength; 2557 double Wannier_Min_Conv_Criterion; 2558 int Wannier_Output_Overlap_Matrix, Wannier_Output_Projection_Matrix; 2559 int Wannier_Output_kmesh, Wannier_Readin_Overlap_Matrix,Wannier_Readin_Projection_Matrix; 2560 2561 double **Wannier_Euler_Rotation_Angle; /* for each ProSpe */ 2562 double ****Wannier_RotMat_for_Real_Func; /* Rotation Matrix of real Orbitals for each kind of projectors */ 2563 2564 int **Wannier_Select_Matrix; 2565 double ***Wannier_Projector_Hybridize_Matrix; 2566 /* For interface with Wannier90 */ 2567 int Wannier90_fileout; 2568 /*-------------------------------------------------------------Wannier*/ 2569 2570 void Show_DFT_DATA(char *argv[]); 2571 void Maketest(char *mode, int argc, char *argv[]); 2572 void Runtest(char *mode, int argc, char *argv[]); 2573 void Memory_Leak_test(int argc, char *argv[]); 2574 void Get_VSZ(int MD_iter); 2575 void Force_test(int argc, char *argv[]); 2576 void Check_Force(char *argv[]); 2577 void Stress_test(int argc, char *argv[]); 2578 void Check_Stress(char *argv[]); 2579 2580 double RF_BesselF(int Gensi, int GL, int Mul, double R); 2581 double Nonlocal_RadialF(int Gensi, int l, int so, double R); 2582 double PhiF(double R, double *phi0, double *MRV, int Grid_Num); 2583 double AngularF(int l, int m, double Q, double P, int Use_switch, 2584 double siQ, double coQ, double siP, double coP); 2585 double RadialF(int Gensi, int L, int Mul, double R); 2586 void Dr_RadialF(int Gensi, int L, int Mul, double R, double Deri_RF[3]); 2587 double Smoothing_Func(double rcut,double r1); 2588 double VNAF(int Gensi, double R); 2589 double Dr_VNAF(int Gensi, double R); 2590 double VH_AtomF(int spe, int N, double x, double r, double *xv, double *rv, double *yv); 2591 double Dr_VH_AtomF(int spe, int N, double x, double r, double *xv, double *rv, double *yv); 2592 double KumoF(int N, double x, double *xv, double *rv, double *yv); 2593 double Dr_KumoF(int N, double x, double r, double *xv, double *rv, double *yv); 2594 2595 double AtomicCoreDenF(int Gensi, double R); 2596 double Nonlocal_Basis(int wan, int Lnum_index, int Mnum, int so, 2597 double r, double theta, double phi); 2598 2599 void Get_Orbitals(int wan, double x, double y, double z, double *Chi); 2600 void Get_dOrbitals(int wan, double R, double Q, double P, double **dChi); 2601 void Get_Cnt_Orbitals(int Mc_AN, double x, double y, double z, double *Chi); 2602 void Get_Cnt_dOrbitals(int Mc_AN, double x, double y, double z, double **dChi); 2603 2604 double Set_Orbitals_Grid(int Cnt_kind); 2605 double Set_Aden_Grid(); 2606 double Set_Density_Grid(int Cnt_kind, int Calc_CntOrbital_ON, double *****CDM); 2607 void diagonalize_nc_density(); 2608 void Data_Grid_Copy_B2C_1(double *data_B, double *data_C); 2609 void Data_Grid_Copy_B2C_2(double **data_B, double **data_C); 2610 void Density_Grid_Copy_B2D(); 2611 double Set_Initial_DM(double *****CDM, double *****H); 2612 double Mulliken_Charge( char *mode ); 2613 /* added by MJ */ 2614 void Occupation_Number_LDA_U(int SCF_iter, int SucceedReadingDMfile, double dUele, double ECE[], char *mode); 2615 /* added by MJ */ 2616 void Eff_Hub_Pot(int SCF_iter, double ****OLP0); 2617 void EulerAngle_Spin( int quickcalc_flag, 2618 double Re11, double Re22, 2619 double Re12, double Im12, 2620 double Re21, double Im21, 2621 double Nup[2], double Ndown[2], 2622 double t[2], double p[2] ); 2623 2624 void Orbital_Moment(char *mode); 2625 2626 double Mixing_DM(int MD_iter, 2627 int SCF_iter, 2628 int SCF_iter0, 2629 int SucceedReadingDMfile, 2630 double ***ReRhok, 2631 double ***ImRhok, 2632 double **Residual_ReRhok, 2633 double **Residual_ImRhok, 2634 double *ReVk, 2635 double *ImVk, 2636 double *ReRhoAtomk, 2637 double *ImRhoAtomk); 2638 2639 double Mixing_H( int MD_iter, 2640 int SCF_iter, 2641 int SCF_iter0 ); 2642 2643 void Simple_Mixing_DM(int Change_switch, 2644 double Mix_wgt, 2645 double *****CDM, 2646 double *****PDM, 2647 double *****P2DM, 2648 double *****iCDM, 2649 double *****iPDM, 2650 double *****iP2DM, 2651 double *****RDM, 2652 double *****iRDM 2653 /*---------- modified by TOYODA 18/JAN/2010 */ 2654 #if EXX_MIX_DM 2655 , EXX_t *exx 2656 , dcomplex ****exx_CDM 2657 , dcomplex ****exx_PDM 2658 , dcomplex ****exx_P2DM 2659 #endif 2660 ); 2661 2662 void DIIS_Mixing_DM(int SCF_iter, double ******ResidualDM, double ******iResidualDM); 2663 void ADIIS_Mixing_DM(int SCF_iter, double ******ResidualDM, double ******iResidualDM); 2664 void GR_Pulay_DM(int SCF_iter, double ******ResidualDM); 2665 2666 2667 void Kerker_Mixing_Rhok(int Change_switch, 2668 double Mix_wgt, 2669 double ***ReRhok, 2670 double ***ImRhok, 2671 double **Residual_ReRhok, 2672 double **Residual_ImRhok, 2673 double *ReVk, 2674 double *ImVk, 2675 double *ReRhoAtomk, 2676 double *ImRhoAtomk); 2677 2678 void DIIS_Mixing_Rhok(int SCF_iter, 2679 double Mix_wgt, 2680 double ***ReRhok, 2681 double ***ImRhok, 2682 double **Residual_ReRhok, 2683 double **Residual_ImRhok, 2684 double *ReVk, 2685 double *ImVk, 2686 double *ReRhoAtomk, 2687 double *ImRhoAtomk); 2688 2689 2690 void Overlap_Cluster(double ****OLP, double **S,int *MP); 2691 void Hamiltonian_Cluster(double ****RH, double **H, int *MP); 2692 void Hamiltonian_Cluster_Hs(double ****RH, double *Hs, int *MP, int spin, int myworld1); 2693 void Hamiltonian_Cluster_NC(double *****RH, double *****IH, 2694 dcomplex **H, int *MP); 2695 void Hamiltonian_Cluster_SO(double ****RH, double ****IH, dcomplex **H, int *MP); 2696 void Hamiltonian_Band(int Host_ID1, double ****RH, 2697 dcomplex **H, int *MP, 2698 double k1, double k2, double k3); 2699 void Hamiltonian_Band_NC(int Host_ID1, double *****RH, double *****IH, 2700 dcomplex **H, int *MP, 2701 double k1, double k2, double k3); 2702 int Get_OneD_HS_Col(int set_flag, double ****RH, double *H1, int *MP, 2703 int *order_GA, int *My_NZeros, int *is1, int *is2); 2704 void Overlap_Band(int Host_ID1, double ****OLP, dcomplex **S, int *MP, 2705 double k1, double k2, double k3); 2706 2707 void Initial_CntCoes(double *****nh, double *****OLP); 2708 void Initial_CntCoes2(double *****nh, double *****OLP); 2709 double Opt_Contraction( 2710 int orbitalOpt_iter, 2711 double TotalE, 2712 double *****H, 2713 double *****OLP, 2714 double *****CDM, 2715 double *****EDM, 2716 double ****His_CntCoes, 2717 double ****His_D_CntCoes, 2718 double ****His_CntCoes_Species, 2719 double ****His_D_CntCoes_Species, 2720 double *His_OrbOpt_Etot, 2721 double **OrbOpt_Hessian); 2722 2723 void Contract_Hamiltonian(double *****H, double *****CntH, 2724 double *****OLP, double *****CntOLP); 2725 void Contract_iHNL(double *****iHNL, double *****iCntHNL); 2726 void Cont_Matrix0(double ****Mat, double ****CMat); 2727 void Cont_Matrix1(double ****Mat, double ****CMat); 2728 void Cont_Matrix2(Type_DS_VNA ****Mat, Type_DS_VNA ****CMat); 2729 void Cont_Matrix3(double ****Mat, double ****CMat); 2730 void Cont_Matrix4(double ****Mat, double ****CMat); 2731 2732 /* hmweng */ 2733 void Generate_Wannier(); 2734 2735 double EC(char *mode, 2736 int SCF_iter, 2737 double *****Hks, 2738 double *****ImNL, 2739 double ****OLP0, 2740 double *****CDM, 2741 double *****EDM, 2742 double Eele0[2], double Eele1[2]); 2743 2744 double Divide_Conquer(char *mode, 2745 int SCF_iter, 2746 double *****Hks, 2747 double *****ImNL, 2748 double ****OLP0, 2749 double *****CDM, 2750 double *****EDM, 2751 double Eele0[2], double Eele1[2]); 2752 2753 double Krylov(char *mode, 2754 int SCF_iter, 2755 double *****Hks, 2756 double *****ImNL, 2757 double ****OLP0, 2758 double *****CDM, 2759 double *****EDM, 2760 double Eele0[2], double Eele1[2]); 2761 double Divide_Conquer_Dosout(double *****Hks, 2762 double *****ImNL, 2763 double ****OLP0); 2764 void Gauss_Legendre(int n, double x[], double w[], int *ncof, int *flag); 2765 void zero_cfrac(int n, dcomplex *zp, dcomplex *Rp ); 2766 2767 double dampingF(double rcut, double r); 2768 double deri_dampingF(double rcut, double r); 2769 2770 void xyz2spherical(double x, double y, double z, 2771 double xo, double yo, double zo, 2772 double S_coordinate[3]); 2773 int RestartFileDFT(char *mode, int MD_iter, double *Uele, double *****H, double *****CntH, double *etime); 2774 void FT_PAO(); 2775 void FT_NLP(); 2776 void FT_ProExpn_VNA(); 2777 void FT_VNA(); 2778 void FT_ProductPAO(); 2779 2780 double Poisson(int fft_charge_flag, 2781 double *ReDenk, double *ImDenk); 2782 2783 double FFT_Density(int den_flag, 2784 double *ReDenk, double *ImDenk); 2785 2786 void Get_Value_inReal(int complex_flag, 2787 double *ReVr, double *ImVr, 2788 double *ReVk, double *ImVk); 2789 2790 /** Effective Screening Medium (ESM) Method Calculation (added by T.Ohwaki) **/ 2791 2792 double Poisson_ESM(int fft_charge_flag, 2793 double *ReRhok, double *ImRhok); 2794 2795 /** ESM end **/ 2796 2797 double Set_Hamiltonian(char *mode, 2798 int SCF_iter, 2799 int SucceedReadingDMfile, 2800 int Cnt_kind, 2801 double *****H0, 2802 double *****HNL, 2803 double *****CDM, 2804 double *****H); 2805 double Total_Energy(int MD_iter, double *****CDM, double ECE[]); 2806 double Force(double *****H0, 2807 double ******DS_NL, 2808 double *****OLP, 2809 double *****CDM, 2810 double *****EDM); 2811 double Stress(double *****H0, 2812 double ******DS_NL, 2813 double *****OLP, 2814 double *****CDM, 2815 double *****EDM); 2816 double Set_OLP_Kin(double *****OLP, double *****H0); 2817 double Set_Nonlocal(double *****HNL, double ******DS_NL); 2818 double Set_ProExpn_VNA(double ****HVNA, double *****HVNA2, Type_DS_VNA *****DS_VNA); 2819 void Set_WbyVNA(); 2820 void Set_Vpot(int SCF_iter, int XC_P_switch, double *****CDM); 2821 void Set_XC_Grid(int XC_P_switch, int XC_switch, 2822 double *Den0, double *Den1, 2823 double *Den2, double *Den3, 2824 double *Vxc0, double *Vxc1, 2825 double *Vxc2, double *Vxc3, 2826 double ***dEXC_dGD, 2827 double ***dDen_Grid); 2828 double Pot_NeutralAtom(int ct_AN, double Gx, double Gy, double Gz); 2829 double XC_Ceperly_Alder(double den, int P_switch); 2830 void XC_CA_LSDA(double den0, double den1, double XC[2],int P_switch); 2831 void XC_PW92C(double dens[2], double Ec[1], double Vc[2]); 2832 void XC_PBE(double dens[2], double GDENS[3][2], double Exc[2], 2833 double DEXDD[2], double DECDD[2], 2834 double DEXDGD[3][2], double DECDGD[3][2]); 2835 void XC_EX(int NSP, double DS0, double DS[2], double EX[1], double VX[2]); 2836 void Voronoi_Charge(); 2837 void Voronoi_Orbital_Moment(); 2838 2839 double Fuzzy_Weight(int ct_AN, int Mc_AN, int Rn, double x, double y, double z); 2840 2841 void neb(int argc, char *argv[]); 2842 void neb_run(char *argv[], MPI_Comm mpi_commWD, int index_images, double ***neb_atom_coordinates, 2843 int *WhatSpecies_NEB, int *Spe_WhatAtom_NEB, char **SpeName_NEB); 2844 int neb_check(char *argv[]); 2845 void cellopt(char *argv[], double **CompTime); 2846 2847 2848 /** Natural Bond Orbital (NBO) Analysis (added by T.Ohwaki) **/ 2849 int NBO_switch; 2850 int NAO_only; 2851 int Num_NBO_FCenter; 2852 int *NBO_FCenter; 2853 int *Num_NHOs; 2854 int Total_Num_NHO,Total_Num_NBO; 2855 int NHO_fileout,NBO_fileout; 2856 int NBO_SmallCell_Switch; 2857 double NAO_Occ_or_Ryd; 2858 double **NBO_CDMn_tmp, **NBO_OLPn_tmp, **NBO_Fock_tmp, ***NAO_vec_tmp; 2859 double **NAO_partial_pop, **NAO_ene_level, ***NAO_coefficient; 2860 double ****NHOs_Coef,****NBOs_Coef_b,****NBOs_Coef_a; 2861 double NBO_SmallCellFrac[4][3]; 2862 2863 int NAO_Nkpoint; 2864 double **NAO_kpoint; 2865 2866 int *rlmax_EC_NAO, *rlmax_EC2_NAO, *EKC_core_size_NAO; 2867 int *F_Snd_Num_NAO, *S_Snd_Num_NAO, *F_Rcv_Num_NAO, *S_Rcv_Num_NAO; 2868 int **Snd_MAN_NAO, **Snd_GAN_NAO, **Rcv_GAN_NAO; 2869 int *F_TopMAN_NAO, *S_TopMAN_NAO; 2870 int *F_G2M_NAO, *S_G2M_NAO; 2871 int *F_M2G_NAO, *S_M2G_NAO; 2872 int MatomnumF_NAO, MatomnumS_NAO; 2873 int *Snd_HFS_Size_NAO, *Rcv_HFS_Size_NAO; 2874 2875 void Calc_NAO_Cluster(double *****CDM); 2876 void Calc_NAO_Band( 2877 int nkpoint, double **kpoint, 2878 int SpinP_switch, 2879 double *****nh, 2880 double ****OLP); 2881 2882 void Calc_NAO_Krylov(double *****Hks, double ****OLP0, double *****CDM); 2883 /** NBO end **/ 2884 2885 2886 /*-----------------------------------------------------------------------*/ 2887 2888 double readfile(char *argv[]); 2889 void Input_std(char *filename); 2890 2891 double truncation(int MD_iter, int UCell_flag); 2892 double DFT(int MD_iter, int Cnt_Now); 2893 2894 double Cluster_DFT(char *mode, 2895 int SCF_iter, 2896 int SpinP_switch, 2897 double ***Cluster_ReCoes, 2898 double **Cluster_ko, 2899 double *****nh, 2900 double *****ImNL, 2901 double ****CntOLP, 2902 double *****CDM, 2903 double *****EDM, 2904 /*---------- added by TOYODA 08/JAN/2010 */ 2905 EXX_t *exx, 2906 dcomplex ****exx_CDM, 2907 double *Uexx, 2908 /*---------- until here */ 2909 double Eele0[2], double Eele1[2]); 2910 2911 double Cluster_DFT_ScaLAPACK( 2912 char *mode, 2913 int SCF_iter, 2914 int SpinP_switch, 2915 double ***Cluster_ReCoes, 2916 double **Cluster_ko, 2917 double *****nh, 2918 double *****ImNL, 2919 double ****CntOLP, 2920 double *****CDM, 2921 double *****EDM, 2922 EXX_t *exx, 2923 dcomplex ****exx_CDM, 2924 double *Uexx, 2925 double Eele0[2], double Eele1[2], 2926 int myworld1, 2927 int *NPROCS_ID1, 2928 int *Comm_World1, 2929 int *NPROCS_WD1, 2930 int *Comm_World_StartID1, 2931 MPI_Comm *MPI_CommWD1, 2932 double *Ss, 2933 double *Cs, 2934 double *Hs); 2935 2936 2937 double Cluster_DFT_Dosout( int SpinP_switch, 2938 double *****nh, 2939 double *****ImNL, 2940 double ****CntOLP); 2941 2942 double Cluster_DFT_ON2(char *mode, 2943 int SCF_iter, 2944 int SpinP_switch, 2945 double ***Cluster_ReCoes, 2946 double **Cluster_ko, 2947 double *****nh, 2948 double *****ImNL, 2949 double ****CntOLP, 2950 double *****CDM, 2951 double *****EDM, 2952 double Eele0[2], double Eele1[2]); 2953 2954 2955 double Band_DFT_NonCol(int SCF_iter, 2956 double *koS, 2957 dcomplex **S, 2958 int knum_i, int knum_j, int knum_k, 2959 int SpinP_switch, 2960 double *****nh, 2961 double *****ImNL, 2962 double ****CntOLP, 2963 double *****CDM, 2964 double *****EDM, 2965 double Eele0[2], double Eele1[2]); 2966 2967 double Band_DFT_Col(int SCF_iter, 2968 int knum_i, int knum_j, int knum_k, 2969 int SpinP_switch, 2970 double *****nh, 2971 double *****ImNL, 2972 double ****CntOLP, 2973 double *****CDM, 2974 double *****EDM, 2975 double Eele0[2], 2976 double Eele1[2], 2977 int *MP, 2978 int *order_GA, 2979 double *ko, 2980 double *koS, 2981 double ***EIGEN, 2982 double *H1, 2983 double *S1, 2984 double *CDM1, 2985 double *EDM1, 2986 dcomplex **H, 2987 dcomplex **S, 2988 dcomplex **C, 2989 dcomplex *BLAS_S, 2990 int ***k_op, 2991 int *T_k_op, 2992 int **T_k_ID, 2993 double *T_KGrids1, 2994 double *T_KGrids2, 2995 double *T_KGrids3, 2996 int myworld1, 2997 int *NPROCS_ID1, 2998 int *Comm_World1, 2999 int *NPROCS_WD1, 3000 int *Comm_World_StartID1, 3001 MPI_Comm *MPI_CommWD1, 3002 int myworld2, 3003 int *NPROCS_ID2, 3004 int *NPROCS_WD2, 3005 int *Comm_World2, 3006 int *Comm_World_StartID2, 3007 MPI_Comm *MPI_CommWD2, 3008 EXX_t *exx, 3009 dcomplex ****exx_CDM, 3010 double *Uexx); 3011 3012 double Band_DFT_Col_ScaLAPACK( 3013 int SCF_iter, 3014 int knum_i, int knum_j, int knum_k, 3015 int SpinP_switch, 3016 double *****nh, 3017 double *****ImNL, 3018 double ****CntOLP, 3019 double *****CDM, 3020 double *****EDM, 3021 double Eele0[2], double Eele1[2], 3022 int *MP, 3023 int *order_GA, 3024 double *ko, 3025 double *koS, 3026 double ***EIGEN, 3027 double *H1, 3028 double *S1, 3029 double *CDM1, 3030 double *EDM1, 3031 dcomplex **H, 3032 dcomplex *Ss, 3033 dcomplex *Cs, 3034 dcomplex *Hs, 3035 int ***k_op, 3036 int *T_k_op, 3037 int **T_k_ID, 3038 double *T_KGrids1, 3039 double *T_KGrids2, 3040 double *T_KGrids3, 3041 int myworld1, 3042 int *NPROCS_ID1, 3043 int *Comm_World1, 3044 int *NPROCS_WD1, 3045 int *Comm_World_StartID1, 3046 MPI_Comm *MPI_CommWD1, 3047 int myworld2, 3048 int *NPROCS_ID2, 3049 int *NPROCS_WD2, 3050 int *Comm_World2, 3051 int *Comm_World_StartID2, 3052 MPI_Comm *MPI_CommWD2, 3053 EXX_t *exx, 3054 dcomplex ****exx_CDM, 3055 double *Uexx); 3056 3057 3058 void k_inversion(int i, int j, int k, 3059 int mi, int mj, int mk, 3060 int *ii, int *ij, int *ik ); 3061 void Band_DFT_kpath( int nkpath, int *n_perk, 3062 double ***kpath, char ***kname, 3063 int SpinP_switch, 3064 double *****nh, 3065 double *****ImNL, 3066 double ****CntOLP); 3067 void Band_DFT_MO( int nkpoint, double **kpoint, 3068 int SpinP_switch, 3069 double *****nh, 3070 double *****ImNL, 3071 double ****CntOLP); 3072 double Band_DFT_Dosout( int knum_i, int knum_j, int knum_k, 3073 int SpinP_switch, 3074 double *****nh, 3075 double *****ImNL, 3076 double ****CntOLP ); 3077 3078 void Unfolding_Bands( int nkpoint, double **kpoint, 3079 int SpinP_switch, 3080 double *****nh, 3081 double *****ImNL, 3082 double ****CntOLP); 3083 3084 double MD_pac(int iter, char *fname_input); 3085 void Calc_Temp_Atoms(int iter); 3086 int Species2int(char Species[YOUSO10]); 3087 int R_atv(int CpyCell, int i, int j, int k); 3088 int SEQ(char str1[YOUSO10], char str2[YOUSO10]); 3089 void Generation_ATV(int CpyCell); 3090 char *string_tolower(char *buf, char *buf1); 3091 void iterout(int iter,double drctime,char fileE[YOUSO10],char fileDRC[YOUSO10]); 3092 void iterout_md(int iter,double drctime,char fileSE[YOUSO10]); 3093 void outputfile1(int f_switch, int MD_iter, int orbitalOpt_iter, 3094 int Cnt_Now, int SCF_iter, char fname[YOUSO10], 3095 double ChemP_e0[2]); 3096 void init(); 3097 void Find_CGrids(int Real_Position, int n1, int n2, int n3, 3098 double Cxyz[4], int NOC[4]); 3099 void Diamond_structure(double aa); 3100 void HCP_structure(double aa, double coa); 3101 void FCC_structure(double aa); 3102 void SetPara_DFT(); 3103 void Output_CompTime(); 3104 void Output_Energy_Decomposition(); 3105 void Make_FracCoord(char *file); 3106 void Merge_LogFile(char *file); 3107 void Make_InputFile_with_FinalCoord(char *file, int MD_iter); 3108 void Eigen_lapack(double **a, double *ko, int n, int EVmax); 3109 void Eigen_lapack2(double *a, int csize, double *ko, int n, int EVmax); 3110 void Eigen_lapack3(double *a, double *ko, int n, int EVmax); 3111 void EigenBand_lapack(dcomplex **A, double *W, int N0, int MaxN, int ev_flag); 3112 void Eigen_PReHH(MPI_Comm MPI_Current_Comm_WD, 3113 double **ac, double *ko, int n, int EVmax, int bcast_flag); 3114 void Eigen_PHH(MPI_Comm MPI_Current_Comm_WD, 3115 dcomplex **ac, double *ko, int n, int EVmax, int bcast_flag); 3116 void BroadCast_ReMatrix(MPI_Comm MPI_Curret_Comm_WD, 3117 double **Mat, int n, int *is1,int *ie1, int myid, int numprocs, 3118 MPI_Status *stat_send, 3119 MPI_Request *request_send, 3120 MPI_Request *request_recv); 3121 void BroadCast_ComplexMatrix(MPI_Comm MPI_Current_Comm_WD, 3122 dcomplex **Mat, int n, int *is1, int *ie1, int myid, int numprocs, 3123 MPI_Status *stat_send, 3124 MPI_Request *request_send, 3125 MPI_Request *request_recv); 3126 void lapack_dstedc1(INTEGER N, double *D, double *E, double *W, double **ev); 3127 void lapack_dstedc2(INTEGER N, double *D, double *E, double *W, dcomplex **ev); 3128 void lapack_dstedc3(INTEGER N, double *D, double *E, double *W, double *ev, INTEGER csize); 3129 void lapack_dstegr1(INTEGER N, INTEGER EVmax, double *D, double *E, double *W, double **ev); 3130 void lapack_dstegr2(INTEGER N, INTEGER EVmax, double *D, double *E, double *W, dcomplex **ev); 3131 void lapack_dstegr3(INTEGER N, INTEGER EVmax, double *D, double *E, double *W, double *ev, INTEGER csize); 3132 3133 void lapack_dstevx1(INTEGER N, INTEGER EVmax, double *D, double *E, double *W, double **ev); 3134 void lapack_dstevx2(INTEGER N, INTEGER EVmax, double *D, double *E, double *W, dcomplex **ev, int ev_flag); 3135 void lapack_dstevx3(INTEGER N, INTEGER EVmax, double *D, double *E, double *W, double *ev, INTEGER csize); 3136 void lapack_dstevx4(INTEGER N, INTEGER IL, INTEGER IU, double *D, double *E, double *W, double **ev); 3137 void lapack_dstevx5(INTEGER N, INTEGER IL, INTEGER IU, double *D, double *E, double *W, dcomplex **ev, int ev_flag); 3138 void lapack_dsteqr1(INTEGER N, double *D, double *E, double *W, double **ev); 3139 3140 void LU_inverse(int n, dcomplex **a); 3141 void ReLU_inverse(int n, double **a, double **ia); 3142 void spline3(double r, double r1, double rcut, 3143 double g, double dg, double value[2]); 3144 void Cswap(dcomplex *a, dcomplex *b); 3145 void fnjoint(char name1[YOUSO10],char name2[YOUSO10],char name3[YOUSO10]); 3146 void fnjoint2(char name1[YOUSO10], char name2[YOUSO10], 3147 char name3[YOUSO10], char name4[YOUSO10]); 3148 void chcp(char name1[YOUSO10],char name2[YOUSO10]); 3149 void Init_List_YOUSO(); 3150 void Allocate_Arrays(int wherefrom); 3151 void Free_Arrays(int dokokara); 3152 double OutData(char *inputfile); 3153 double OutData_Binary(char *inputfile); 3154 void init_alloc_first(); 3155 int File_CntCoes(char *mode); 3156 void SCF2File(char *mode, char *inputfile); 3157 void Determine_Cell_from_ECutoff(double tv[4][4], double ECut); 3158 #ifdef kcomp 3159 void Spherical_Bessel( double x, int lmax, double *sb, double *dsb ); 3160 #else 3161 inline void Spherical_Bessel( double x, int lmax, double *sb, double *dsb ); 3162 #endif 3163 3164 3165 void Generating_MP_Special_Kpt(/* input */ 3166 int atomnum, 3167 int SpeciesNum, 3168 double tv[4][4], 3169 double **Gxyz, 3170 double *InitN_USpin, 3171 double *InitN_DSpin, 3172 double criterion_geo, 3173 int SpinP_switch, 3174 int *WhatSpecies, 3175 int knum_i, int knum_j, int knum_k 3176 /* implicit output 3177 num_non_eq_kpt, 3178 NE_KGrids1, NE_KGrids2, NE_KGrids3, 3179 NE_T_k_op */ ); 3180 3181 void Make_Comm_Worlds( 3182 MPI_Comm MPI_Current_Comm_WD, 3183 int myid0, 3184 int numprocs0, 3185 int Num_Comm_World, 3186 int *myworld1, 3187 MPI_Comm *MPI_CommWD, /* size: Num_Comm_World */ 3188 int *NPROCS1_ID, /* size: numprocs0 */ 3189 int *Comm_World1, /* size: numprocs0 */ 3190 int *NPROCS1_WD, /* size: Num_Comm_World */ 3191 int *Comm_World_StartID /* size: Num_Comm_World */ 3192 ); 3193 3194 3195 3196 /*********************** openmx_common.c **************************/ 3197 3198 void Cross_Product(double a[4], double b[4], double c[4]); 3199 double Dot_Product(double a[4], double b[4]); 3200 void ComplexSH(int l, int m, double theta, double phi, 3201 double SH[2], double dSHt[2], double dSHp[2]); 3202 void asbessel(int n, double x, double sbe[2]); 3203 double Gaunt(int l,int m,int l1,int m1,int l2,int m2); 3204 void Associated_Legendre(int l, int m, double x, double ALeg[2]); 3205 void qsort_double(long n, double *a, double *b); 3206 void qsort_double3(long n, double *a, int *b, int *c); 3207 void qsort_double3B(long n, double *a, int *b, int *c); 3208 void qsort_int(long n, int *a, int *b); 3209 void qsort_int1(long n, int *a); 3210 void qsort_int3(long n, int *a, int *b, int *c); 3211 void qsort_double_int(long n, double *a, int *b); 3212 void GN2N(int GN, int N3[4]); 3213 int AproxFactN(int N0); 3214 void Get_Grid_XYZ(int GN, double xyz[4]); 3215 double rnd(double width); 3216 double rnd0to1(void); 3217 double largest(double a, double b); 3218 double smallest(double a, double b); 3219 double Cabs(dcomplex z); 3220 double sgn(double nu); 3221 double isgn(int nu); 3222 dcomplex Complex(double re, double im); 3223 dcomplex Cadd(dcomplex a, dcomplex b); 3224 dcomplex Csub(dcomplex a, dcomplex b); 3225 dcomplex Cmul(dcomplex a, dcomplex b); 3226 dcomplex Conjg(dcomplex z); 3227 dcomplex Cdiv(dcomplex a, dcomplex b); 3228 dcomplex Csqrt(dcomplex z); 3229 dcomplex RCadd(double x, dcomplex a); 3230 dcomplex RCsub(double x, dcomplex a); 3231 dcomplex RCmul(double x, dcomplex a); 3232 dcomplex CRmul(dcomplex a, double x); 3233 dcomplex RCdiv(double x, dcomplex a); 3234 dcomplex CRC(dcomplex a, double x, dcomplex b); 3235 dcomplex Im_pow(int fu, int Ls); 3236 dcomplex Csin(dcomplex a); 3237 dcomplex Ccos(dcomplex a); 3238 dcomplex Cexp(dcomplex a); 3239 3240 void PrintMemory_Fix(); 3241 void PrintMemory(char *name, long int size0, char *mode); 3242 void dtime(double *); 3243 3244 /* okuno */ 3245 void DFTDvdW_SetNeighborShell(double rij[3],double** distR, 3246 double* distR2,int*nrm); 3247 void DFTDvdW_init(); 3248 void DFTD3vdW_init(); /* Ellner */ 3249 3250 3251 /****************************************************************/ 3252 3253 void *malloc_multidimarray(char *type, int N, int *size); 3254 void free_multidimarray(void **p, int N, int *size); 3255 3256 /**************************************************************** 3257 subroutines and common variables for MPI 3258 ****************************************************************/ 3259 3260 /******************************************************* 3261 int *G2ID; 3262 G2ID gives a proccesor ID allocated to each atom 3263 with a global atom index. 3264 size: G2ID[atomnum+1]; 3265 allocation: Allocation_Arrays(1) in Input_std() 3266 free: call as Free_Arrays(0) in openmx.c 3267 *******************************************************/ 3268 int *G2ID; 3269 3270 /******************************************************* 3271 int *Species_Top,*Species_End; 3272 arrays, Species_Top and Species_End, give global 3273 indices of the first and last species in species 3274 allocated to each processor. 3275 size: Species_Top[numprocs],Species_End[numprocs] 3276 allocation: Allocation_Arrays(0) in Input_std() 3277 free: call as Free_Arrays(0) in openmx.c 3278 *******************************************************/ 3279 int *Species_Top,*Species_End; 3280 3281 /******************************************************* 3282 int *F_Snd_Num; 3283 3284 F_Snd_Num gives the number of atoms of which informations, 3285 related by FNAN, are transfered from myid to ID. 3286 size: F_Snd_Num[numprocs] 3287 allocation: Allocation_Arrays(0) in Input_std() 3288 free: call as Free_Arrays(0) in openmx.c 3289 *******************************************************/ 3290 int *F_Snd_Num; 3291 3292 /******************************************************* 3293 int *F_Snd_Num_WK; 3294 3295 F_Snd_Num_WK is a work array for F_Snd_Num. 3296 size: F_Snd_Num_WK[numprocs] 3297 allocation: Allocation_Arrays(0) in Input_std() 3298 free: call as Free_Arrays(0) in openmx.c 3299 *******************************************************/ 3300 int *F_Snd_Num_WK; 3301 3302 /******************************************************* 3303 int *S_Snd_Num; 3304 3305 S_Snd_Num gives the number of atoms of which informations, 3306 related by SNAN, are transfered from myid to ID. 3307 size: S_Snd_Num[numprocs] 3308 allocation: Allocation_Arrays(0) in Input_std() 3309 free: call as Free_Arrays(0) in openmx.c 3310 *******************************************************/ 3311 int *S_Snd_Num; 3312 3313 /******************************************************* 3314 int *F_Rcv_Num; 3315 3316 F_Rcv_Num gives the number of atoms of which informations, 3317 related by FNAN, are recieved at myid from ID. 3318 size: F_Rcv_Num[numprocs] 3319 allocation: Allocation_Arrays(0) in Input_std() 3320 free: call as Free_Arrays(0) in openmx.c 3321 *******************************************************/ 3322 int *F_Rcv_Num; 3323 3324 /******************************************************* 3325 int *F_Rcv_Num_WK; 3326 3327 F_Rcv_Num_WK is a work array for F_Rcv_Num. 3328 size: F_Rcv_Num_WK[numprocs] 3329 allocation: Allocation_Arrays(0) in Input_std() 3330 free: call as Free_Arrays(0) in openmx.c 3331 *******************************************************/ 3332 int *F_Rcv_Num_WK; 3333 3334 /******************************************************* 3335 int *S_Rcv_Num; 3336 3337 S_Rcv_Num gives the number of atoms of which informations, 3338 related by SNAN, are recieved at myid from ID. 3339 size: S_Rcv_Num[numprocs] 3340 allocation: Allocation_Arrays(0) in Input_std() 3341 free: call as Free_Arrays(0) in openmx.c 3342 *******************************************************/ 3343 int *S_Rcv_Num; 3344 3345 /******************************************************* 3346 int *Snd_DS_NL_Size; 3347 3348 Snd_DS_NL_Size gives the size of data for DS_NL 3349 which are transfered from myid to ID. 3350 size: Snd_DS_NL_Size[numprocs] 3351 allocation: Allocation_Arrays(0) in Input_std() 3352 free: call as Free_Arrays(0) in openmx.c 3353 *******************************************************/ 3354 int *Snd_DS_NL_Size; 3355 3356 /******************************************************* 3357 int *Rcv_DS_NL_Size; 3358 3359 Rcv_DS_NL_Size gives the size of data for DS_NL 3360 which are received from ID. 3361 size: Rcv_DS_NL_Size[numprocs] 3362 allocation: Allocation_Arrays(0) in Input_std() 3363 free: call as Free_Arrays(0) in openmx.c 3364 *******************************************************/ 3365 int *Rcv_DS_NL_Size; 3366 3367 /******************************************************* 3368 int *Snd_HFS_Size; 3369 3370 Snd_HFS_Size gives the size of data for Hks including 3371 the FNAN and SNAN atoms which are transfered from myid 3372 to ID. 3373 size: Snd_HFS_Size[numprocs] 3374 allocation: Allocation_Arrays(0) in Input_std() 3375 free: call as Free_Arrays(0) in openmx.c 3376 *******************************************************/ 3377 int *Snd_HFS_Size; 3378 3379 /******************************************************* 3380 int *Rcv_HFS_Size; 3381 3382 Rcv_HFS_Size gives the size of data for Hks including 3383 the FNAN and SNAN atoms which are received from ID. 3384 size: Rcv_HFS_Size[numprocs] 3385 allocation: Allocation_Arrays(0) in Input_std() 3386 free: call as Free_Arrays(0) in openmx.c 3387 *******************************************************/ 3388 int *Rcv_HFS_Size; 3389 3390 /******************************************************* 3391 int *F_TopMAN,*S_TopMAN; 3392 3393 F_TopMAN and S_TopMAN give the first medium 3394 atom number in atoms sent from ID in the size of 3395 F_Rcv_Num[ID] and F_Rcv_Num[ID] + S_Rcv_Num[ID], 3396 respectively. 3397 size: F_TopMAN[numprocs],S_TopMAN[numprocs] 3398 allocation: Allocation_Arrays(0) in Input_std() 3399 free: call as Free_Arrays(0) in openmx.c 3400 *******************************************************/ 3401 int *F_TopMAN,*S_TopMAN; 3402 3403 /******************************************************* 3404 int *F_G2M,*S_G2M; 3405 3406 F_G2M and S_G2M give a conversion from the 3407 global atom number to the medium atom number 3408 for atoms sent from ID in the size of 3409 F_Rcv_Num[ID] and F_Rcv_Num[ID] + S_Rcv_Num[ID], 3410 respectively. 3411 size: F_G2M[atomnum+1],S_G2M[atomnum+1] 3412 allocation: Allocation_Arrays(1) in Input_std() 3413 free: call as Free_Arrays(0) in openmx.c 3414 *******************************************************/ 3415 int *F_G2M,*S_G2M; 3416 3417 /******************************************************* 3418 int **Snd_MAN; 3419 Snd_MAN is a medium atom index of which informations 3420 are sent to a processor ID. 3421 size: Snd_MAN[numprocs][FS_Snd_Num[ID]] 3422 allocation: Set_Inf_SndRcv() of truncation.c 3423 free: Set_Inf_SndRcv() of truncation.c 3424 and call as Free_Arrays(0) in openmx.c 3425 *******************************************************/ 3426 int **Snd_MAN; 3427 3428 /******************************************************* 3429 int **Snd_GAN; 3430 Snd_GAN and Snd_GAN are a global atom index of which 3431 informations are sent to a processor ID. 3432 size: Snd_GAN[numprocs][FS_Snd_Num[ID]] 3433 allocation: Set_Inf_SndRcv() of truncation.c 3434 free: Set_Inf_SndRcv() of truncation.c 3435 and call as Free_Arrays(0) in openmx.c 3436 *******************************************************/ 3437 int **Snd_GAN; 3438 3439 /******************************************************* 3440 int **Rcv_GAN; 3441 Rcv_GAN are a global atom index cell index of which 3442 informations are recieved at myid from a processor ID. 3443 size: Rcv_GAN[numprocs][F_Rcv_Num[ID]+S_Rcv_Num[ID]] 3444 allocation: Set_Inf_SndRcv() of truncation.c 3445 free: Set_Inf_SndRcv() of truncation.c 3446 and call as Free_Arrays(0) in openmx.c 3447 *******************************************************/ 3448 int **Rcv_GAN; 3449 3450 /******************************************************* 3451 int **Pro_Snd_GAtom; 3452 3453 Pro_Snd_GAtom gives the global atomic number used 3454 for MPI communication of DS_VNA and DS_NL 3455 size: Pro_Snd_GAtom[numprocs][Num_Pro_Snd[ID]] 3456 allocation: Set_Inf_SndRcv() of truncation.c 3457 free: Set_Inf_SndRcv() of truncation.c 3458 and call as Free_Arrays(0) in openmx.c 3459 *******************************************************/ 3460 int **Pro_Snd_GAtom; 3461 3462 /******************************************************* 3463 int **Pro_Snd_MAtom; 3464 3465 Pro_Snd_MAtom gives the intermedium atomic number used 3466 for MPI communication of DS_VNA and DS_NL 3467 size: Pro_Snd_MAtom[numprocs][Num_Pro_Snd[ID]] 3468 allocation: Set_Inf_SndRcv() of truncation.c 3469 free: Set_Inf_SndRcv() of truncation.c 3470 and call as Free_Arrays(0) in openmx.c 3471 *******************************************************/ 3472 int **Pro_Snd_MAtom; 3473 3474 /******************************************************* 3475 int **Pro_Snd_LAtom; 3476 3477 Pro_Snd_MAtom gives the local atomic number used 3478 for MPI communication of DS_VNA and DS_NL 3479 size: Pro_Snd_LAtom[numprocs][Num_Pro_Snd[ID]] 3480 allocation: Set_Inf_SndRcv() of truncation.c 3481 free: Set_Inf_SndRcv() of truncation.c 3482 and call as Free_Arrays(0) in openmx.c 3483 *******************************************************/ 3484 int **Pro_Snd_LAtom; 3485 3486 /******************************************************* 3487 int **Pro_Snd_LAtom2; 3488 3489 Pro_Snd_MAtom2 gives the local atomic number used 3490 for MPI communication of DS_VNA and DS_NL, and 3491 tells us the position of array which should be stored. 3492 size: Pro_Snd_LAtom2[numprocs][Num_Pro_Snd[ID]] 3493 allocation: Set_Inf_SndRcv() of truncation.c 3494 free: Set_Inf_SndRcv() of truncation.c 3495 and call as Free_Arrays(0) in openmx.c 3496 *******************************************************/ 3497 int **Pro_Snd_LAtom2; 3498 3499 /******************************************************* 3500 int *Num_Snd_Grid_A2B 3501 3502 Num_Snd_Grid_A2B gives the number of grids data of 3503 rho_i sent to ID. 3504 size: Num_Snd_Grid_A2B[numprocs] 3505 allocation: call Allocate_Arrays() in Input_std.c 3506 free: call Free_Arrays in openmx.c 3507 *******************************************************/ 3508 int *Num_Snd_Grid_A2B; 3509 3510 /******************************************************* 3511 int *Num_Rcv_Grid_A2B 3512 3513 Num_Rcv_Grid_A2B gives the number of grids data of 3514 rho_i received from ID. 3515 size: Num_Rcv_Grid_A2B[numprocs] 3516 allocation: call Allocate_Arrays() in Input_std.c 3517 free: call Free_Arrays in openmx.c 3518 *******************************************************/ 3519 int *Num_Rcv_Grid_A2B; 3520 3521 /******************************************************* 3522 int **Index_Snd_Grid_A2B 3523 3524 Index_Snd_Grid_A2B gives indices BN, atom, and Rn 3525 in the partition B associated with the grids data of 3526 rho_i sent to ID. 3527 size: Index_Snd_Grid_A2B[numprocs][3*Num_Snd_Grid_A2B[ID]] 3528 allocation: allocate_grids2atoms() in truncation.c 3529 free: allocate_grids2atoms() and 3530 call as Free_Arrays(0) in openmx.c 3531 *******************************************************/ 3532 int **Index_Snd_Grid_A2B; 3533 3534 /******************************************************* 3535 int **Index_Rcv_Grid_A2B 3536 3537 Index_Rcv_Grid_A2B gives indices BN, atom, and Rn 3538 in the partition B associated with the grids 3539 data of rho_i received from ID. 3540 size: Index_Rcv_Grid_A2B[numprocs][3*Num_Rcv_Grid_A2B[ID]] 3541 allocation: allocate_grids2atoms() in truncation.c 3542 free: allocate_grids2atoms() and 3543 call as Free_Arrays(0) in openmx.c 3544 *******************************************************/ 3545 int **Index_Rcv_Grid_A2B; 3546 3547 /******************************************************* 3548 int *Num_Snd_Grid_B2C 3549 3550 Num_Snd_Grid_B2C gives the number of grids data of 3551 rho sent to ID. 3552 size: Num_Snd_Grid_B2C[numprocs] 3553 allocation: call Allocate_Arrays() in Input_std.c 3554 free: call Free_Arrays in openmx.c 3555 *******************************************************/ 3556 int *Num_Snd_Grid_B2C; 3557 3558 /******************************************************* 3559 int *Num_Rcv_Grid_B2C 3560 3561 Num_Rcv_Grid_B2C gives the number of grids data of 3562 rho received from ID. 3563 size: Num_Rcv_Grid_B2C[numprocs] 3564 allocation: call Allocate_Arrays() in Input_std.c 3565 free: call Free_Arrays in openmx.c 3566 *******************************************************/ 3567 int *Num_Rcv_Grid_B2C; 3568 3569 /******************************************************* 3570 int **Index_Snd_Grid_B2C 3571 3572 Index_Snd_Grid_B2C gives index BN in the partition B 3573 associated with the grids data of rho sent to ID. 3574 size: Index_Snd_Grid_B2C[numprocs][# of grid to sent]. 3575 allocation: allocate_grids2atoms() in truncation.c 3576 free: allocate_grids2atoms() and 3577 call as Free_Arrays(0) in openmx.c 3578 *******************************************************/ 3579 int **Index_Snd_Grid_B2C; 3580 3581 /******************************************************* 3582 int *Index_Rcv_Grid_B2C 3583 3584 Index_Rcv_Grid_B2C gives index CN in the partition C 3585 associated with the grids data of rho received from ID. 3586 size: Index_Rcv_Grid_B2C[numprocs][# of grid to receive] 3587 allocation: allocate_grids2atoms() in truncation.c 3588 free: allocate_grids2atoms() and 3589 call as Free_Arrays(0) in openmx.c 3590 *******************************************************/ 3591 int **Index_Rcv_Grid_B2C; 3592 3593 /******************************************************* 3594 int *Num_Snd_Grid_B2D 3595 3596 Num_Snd_Grid_B2D gives the number of grids data of 3597 rho sent to ID. 3598 size: Num_Snd_Grid_B2D[numprocs] 3599 allocation: call Allocate_Arrays() in Input_std.c 3600 free: call Free_Arrays in openmx.c 3601 *******************************************************/ 3602 int *Num_Snd_Grid_B2D; 3603 3604 /******************************************************* 3605 int *Num_Rcv_Grid_B2D 3606 3607 Num_Rcv_Grid_B2D gives the number of grids data of 3608 rho received from ID. 3609 size: Num_Rcv_Grid_B2D[numprocs] 3610 allocation: call Allocate_Arrays() in Input_std.c 3611 free: call Free_Arrays in openmx.c 3612 *******************************************************/ 3613 int *Num_Rcv_Grid_B2D; 3614 3615 /******************************************************* 3616 int **Index_Snd_Grid_B2D 3617 3618 Index_Snd_Grid_B2D gives index BN in the partition B 3619 associated with the grids data of rho sent to ID. 3620 size: Index_Snd_Grid_B2D[numprocs][# of grid to sent]. 3621 allocation: allocate_grids2atoms() in truncation.c 3622 free: allocate_grids2atoms() and 3623 call as Free_Arrays(0) in openmx.c 3624 *******************************************************/ 3625 int **Index_Snd_Grid_B2D; 3626 3627 /******************************************************* 3628 int *Index_Rcv_Grid_B2D 3629 3630 Index_Rcv_Grid_B2D gives index DN in the partition D 3631 associated with the grids data of rho received from ID. 3632 size: Index_Rcv_Grid_B2D[numprocs][# of grid to receive] 3633 allocation: allocate_grids2atoms() in truncation.c 3634 free: allocate_grids2atoms() and 3635 call as Free_Arrays(0) in openmx.c 3636 *******************************************************/ 3637 int **Index_Rcv_Grid_B2D; 3638 3639 /******************************************************* 3640 int *Num_Snd_Grid_B_AB2CA 3641 3642 Num_Snd_Grid_B_AB2CA gives the number of grid data 3643 sent from the AB to CA partitions in the partion B. 3644 size: Num_Snd_Grid_B_AB2CA[numprocs] 3645 allocation: call Allocate_Arrays() in Input_std.c 3646 free: call Free_Arrays in openmx.c 3647 *******************************************************/ 3648 int *Num_Snd_Grid_B_AB2CA; 3649 3650 /******************************************************* 3651 int *Num_Rcv_Grid_B_AB2CA 3652 3653 Num_Rcv_Grid_B_AB2CA gives the number of grid data 3654 received in the CA partition and sent from the AB 3655 partition in the partion B. 3656 size: Num_Rcv_Grid_B_AB2CA[numprocs] 3657 allocation: call Allocate_Arrays() in Input_std.c 3658 free: call Free_Arrays in openmx.c 3659 *******************************************************/ 3660 int *Num_Rcv_Grid_B_AB2CA; 3661 /* added by mari 05.12.2014 */ 3662 int *Num_Snd_Grid_B_AB2C; 3663 3664 /******************************************************* 3665 int *Num_Snd_Grid_B_CA2CB 3666 3667 Num_Snd_Grid_B_CA2CB gives the number of grid data 3668 sent from the CA to CB partitions in the partion B. 3669 size: Num_Snd_Grid_B_CA2CB[numprocs] 3670 allocation: call Allocate_Arrays() in Input_std.c 3671 free: call Free_Arrays in openmx.c 3672 *******************************************************/ 3673 int *Num_Snd_Grid_B_CA2CB; 3674 /* added by mari 05.12.2014 */ 3675 int *Num_Rcv_Grid_B_AB2C; 3676 3677 /******************************************************* 3678 int *Num_Rcv_Grid_B_CA2CB 3679 3680 Num_Rcv_Grid_B_CA2CB gives the number of grid data 3681 received in the CB partition and sent from the CA 3682 partition in the partion B. 3683 size: Num_Rcv_Grid_B_CA2CB[numprocs] 3684 allocation: call Allocate_Arrays() in Input_std.c 3685 free: call Free_Arrays in openmx.c 3686 *******************************************************/ 3687 int *Num_Rcv_Grid_B_CA2CB; 3688 3689 /******************************************************* 3690 int **Index_Snd_Grid_B_AB2CA 3691 3692 Index_Snd_Grid_B_AB2CA gives index, BN_AB in the partition 3693 B_AB associated with the grids data of sent to ID. 3694 size: Index_Snd_Grid_B_AB2CA[numprocs][Num_Snd_Grid_B_AB2CA[ID]] 3695 allocation: allocate_grids2atoms() in truncation.c 3696 free: allocate_grids2atoms() and 3697 call as Free_Arrays(0) in openmx.c 3698 *******************************************************/ 3699 int **Index_Snd_Grid_B_AB2CA; 3700 /* added by mari 05.12.2014 */ 3701 int **Index_Snd_Grid_B_AB2C; 3702 3703 /******************************************************* 3704 int **Index_Rcv_Grid_B_AB2CA 3705 3706 Index_Rcv_Grid_B_AB2CA gives index, BN_AB in the partition 3707 B_AB associated with the grids data of sent to ID. 3708 size: Index_Rcv_Grid_B_AB2CA[numprocs][Num_Rcv_Grid_B_AB2CA[ID]] 3709 allocation: allocate_grids2atoms() in truncation.c 3710 free: allocate_grids2atoms() and 3711 call as Free_Arrays(0) in openmx.c 3712 *******************************************************/ 3713 int **Index_Rcv_Grid_B_AB2CA; 3714 /* added by mari 05.12.2014 */ 3715 int **Index_Rcv_Grid_B_AB2C; 3716 3717 /******************************************************* 3718 int **Index_Snd_Grid_B_CA2CB 3719 3720 Index_Snd_Grid_B_CA2CB gives index, BN_CA in the partition 3721 B_CA associated with the grids data of sent to ID. 3722 size: Index_Snd_Grid_B_CA2CB[numprocs][Num_Snd_Grid_B_CA2CB[ID]] 3723 allocation: allocate_grids2atoms() in truncation.c 3724 free: allocate_grids2atoms() and 3725 call as Free_Arrays(0) in openmx.c 3726 *******************************************************/ 3727 int **Index_Snd_Grid_B_CA2CB; 3728 3729 /******************************************************* 3730 int **Index_Rcv_Grid_B_CA2CB 3731 3732 Index_Rcv_Grid_B_CA2CB gives index, BN_CA in the partition 3733 B_CA associated with the grids data of sent to ID. 3734 size: Index_Rcv_Grid_B_CA2CB[numprocs][Num_Rcv_Grid_B_CA2CB[ID]] 3735 allocation: allocate_grids2atoms() in truncation.c 3736 free: allocate_grids2atoms() and 3737 call as Free_Arrays(0) in openmx.c 3738 *******************************************************/ 3739 int **Index_Rcv_Grid_B_CA2CB; 3740 3741 /******************************************************* 3742 int *ID_NN_B_AB2CA_S; 3743 int *ID_NN_B_AB2CA_R; 3744 3745 global process ID used for sending and receiving data 3746 in MPI commucation (AB to CA) of the structure B. 3747 3748 allocation: Construct_MPI_Data_Structure_Grid() in truncation.c 3749 free: Construct_MPI_Data_Structure_Grid() and 3750 call as Free_Arrays(0) in openmx.c 3751 *******************************************************/ 3752 int *ID_NN_B_AB2CA_S; 3753 int *ID_NN_B_AB2CA_R; 3754 3755 /******************************************************* 3756 int *GP_B_AB2CA_S; 3757 int *GP_B_AB2CA_R; 3758 3759 starting index to data used for sending and receiving data 3760 in MPI commucation (AB to CA) of the structure B. 3761 3762 allocation: Construct_MPI_Data_Structure_Grid() in truncation.c 3763 free: Construct_MPI_Data_Structure_Grid() and 3764 call as Free_Arrays(0) in openmx.c 3765 *******************************************************/ 3766 int *GP_B_AB2CA_S; 3767 int *GP_B_AB2CA_R; 3768 3769 /******************************************************* 3770 int *ID_NN_B_CA2CB_S; 3771 int *ID_NN_B_CA2CB_R; 3772 3773 global process ID used for sending and receiving data 3774 in MPI commucation (CA to CB) of the structure B. 3775 3776 allocation: Construct_MPI_Data_Structure_Grid() in truncation.c 3777 free: Construct_MPI_Data_Structure_Grid() and 3778 call as Free_Arrays(0) in openmx.c 3779 *******************************************************/ 3780 int *ID_NN_B_CA2CB_S; 3781 int *ID_NN_B_CA2CB_R; 3782 3783 /******************************************************* 3784 int *GP_B_CA2CB_S; 3785 int *GP_B_CA2CB_R; 3786 3787 starting index to data used for sending and receiving data 3788 in MPI commucation (CA to CB) of the structure B. 3789 3790 allocation: Construct_MPI_Data_Structure_Grid() in truncation.c 3791 free: Construct_MPI_Data_Structure_Grid() and 3792 call as Free_Arrays(0) in openmx.c 3793 *******************************************************/ 3794 int *GP_B_CA2CB_S; 3795 int *GP_B_CA2CB_R; 3796 3797 /******************************************************* 3798 int *ID_NN_B2C_S; 3799 int *ID_NN_B2C_R; 3800 3801 global process ID used for sending and receiving data 3802 in MPI commucation from the structure B to C. 3803 3804 allocation: Construct_MPI_Data_Structure_Grid() in truncation.c 3805 free: Construct_MPI_Data_Structure_Grid() and 3806 call as Free_Arrays(0) in openmx.c 3807 *******************************************************/ 3808 int *ID_NN_B2C_S; 3809 int *ID_NN_B2C_R; 3810 3811 /******************************************************* 3812 int *GP_B2C_S; 3813 int *GP_B2C_R; 3814 3815 starting index to data used for sending and receiving data 3816 in MPI commucation from the structure B to C. 3817 3818 allocation: Construct_MPI_Data_Structure_Grid() in truncation.c 3819 free: Construct_MPI_Data_Structure_Grid() and 3820 call as Free_Arrays(0) in openmx.c 3821 *******************************************************/ 3822 int *GP_B2C_S; 3823 int *GP_B2C_R; 3824 3825 /******************************************************* 3826 int *ID_NN_B2D_S; 3827 int *ID_NN_B2D_R; 3828 3829 global process ID used for sending and receiving data 3830 in MPI commucation from the structure B to D. 3831 3832 allocation: Construct_MPI_Data_Structure_Grid() in truncation.c 3833 free: Construct_MPI_Data_Structure_Grid() and 3834 call as Free_Arrays(0) in openmx.c 3835 *******************************************************/ 3836 int *ID_NN_B2D_S; 3837 int *ID_NN_B2D_R; 3838 3839 /******************************************************* 3840 int *GP_B2D_S; 3841 int *GP_B2D_R; 3842 3843 starting index to data used for sending and receiving data 3844 in MPI commucation from the structure B to D. 3845 3846 allocation: Construct_MPI_Data_Structure_Grid() in truncation.c 3847 free: Construct_MPI_Data_Structure_Grid() and 3848 call as Free_Arrays(0) in openmx.c 3849 *******************************************************/ 3850 int *GP_B2D_S; 3851 int *GP_B2D_R; 3852 3853 /******************************************************* 3854 double *time_per_atom; 3855 elapsed time which is required for each atom 3856 size: time_per_atom[atomnum+1] 3857 allocation: call as Allocate_Arrays(1) in Input_std.c 3858 free: call as Free_Arrays(0) in openmx.c 3859 *******************************************************/ 3860 double *time_per_atom; 3861 3862 /******************************************************* 3863 int *orderN_FNAN_SNAN; 3864 user defined FNAN_SNAN for O(N) calculations 3865 size: orderN_FNAN_SNAN[atomnum+1] 3866 allocation: call as Allocate_Arrays(1) in Input_std.c 3867 free: call as Free_Arrays(0) in openmx.c 3868 *******************************************************/ 3869 int *orderN_FNAN_SNAN; 3870 3871 int Matomnum,MatomnumF,MatomnumS,Max_Matomnum; 3872 int MSpeciesNum,Num_Procs,Num_Procs2; 3873 int Num_Cells0,My_NumGrid1,FNAN2_Grid; 3874 int Max_Num_Rcv_FNAN2_Grid; 3875 int Max_Num_Snd_FNAN2_Grid; 3876 int My_NGrid1_Poisson,My_NGrid2_Poisson; 3877 int My_NumGridB_AB,My_NumGridB_CB,My_NumGridB_CA; 3878 int My_Max_NumGridB,My_NumGridC,My_NumGridD; 3879 int Max_Num_Snd_Grid_B2C,Max_Num_Rcv_Grid_B2C; 3880 int Max_Num_Snd_Grid_B2D,Max_Num_Rcv_Grid_B2D; 3881 int Max_Num_Snd_Grid_B_AB2CA; 3882 int Max_Num_Rcv_Grid_B_AB2CA; 3883 /* added by mari 05.12.2014 */ 3884 int Max_Num_Snd_Grid_B_AB2C; 3885 int Max_Num_Rcv_Grid_B_AB2C; 3886 int Max_Num_Snd_Grid_B_CA2CB; 3887 int Max_Num_Rcv_Grid_B_CA2CB; 3888 3889 /** Effective Screening Medium (ESM) Method Calculation (added by T.Ohwaki) **/ 3890 3891 int ESM_switch,ESM_wall_switch; 3892 double V_ESM; 3893 double ESM_wall_position,ESM_wall_height; 3894 double ESM_buffer_range; 3895 3896 /** ESM end **/ 3897 3898 int Set_Allocate_Atom2CPU(int MD_iter, int isw, int weight_flag); 3899 3900 /* added by T.Ohwaki */ 3901 int Arti_Force; 3902 double Arti_Grad; 3903 /* added by T.Ohwaki */ 3904 3905 /* vdW DFT-D added by okuno*/ 3906 int dftD_switch; /* okuno */ 3907 int unit_dftD; /* unit Au or Ang */ 3908 int maxn_dftD; /* the maximum number of vectors dist2, disR */ 3909 double rcut_dftD; /* cut-off parameter for DFT-D */ 3910 double beta_dftD; /* damping factor for DFT-D */ 3911 double scal6_dftD; /* global scaling factor */ 3912 double *C6_dftD; /* for each species */ 3913 double *RvdW_dftD; /* for each species */ 3914 double **C6ij_dftD; /* C6 coefficient of each atom type pair */ 3915 double **Rsum_dftD; /* sum of VdW radii */ 3916 int n1_DFT_D,n2_DFT_D,n3_DFT_D; 3917 int DFTD_IntDir1,DFTD_IntDir2,DFTD_IntDir3; 3918 3919 /* vdW DFT-D3 added by Ellner*/ 3920 int version_dftD; /* 1-->DFT-D2 (Okuno), 2-->DFT-D3 with zero damping, 3--> DFT-D3 with BJ damping */ 3921 int DFTD3_damp_dftD; /* For DFTD3: 1 --> ZERO 2--> BJ */ 3922 double k1_dftD, k2_dftD, k3_dftD; /* used for calculating coordination number */ 3923 double s6_dftD, s8_dftD; /* global scaling factors (s6=1.0)*/ 3924 double sr6_dftD, sr8_dftD; /* parameters for zero damping function (sr8=1.0)*/ 3925 double alp6_dftD, alp8_dftD; /* exponent in zero damping function (alp6=14)*/ 3926 double **r0ab_dftD; /* parameters used in calculating zero damping function*/ 3927 double a1_dftD, a2_dftD; /* parameters for BJ damping function */ 3928 double *r2r4_dftD; /* intermediate used in r2r4ab_dftd */ 3929 double **r2r4ab_dftD; /* used in calculating C8 */ 3930 double cncut_dftD; /* coordination number cut-off radius. Also needs global cut-off radius defined above (okuno) as rcut_dftD */ 3931 int n1_CN_DFT_D,n2_CN_DFT_D,n3_CN_DFT_D; /* for cncut PBC */ 3932 int *maxcn_dftD; /* max number of C6 ref parameters per atom */ 3933 double *****C6ab_dftD; /* C6 info: m=1,2,3:parameter/CN_atomA/CN_atomB [atomA][atomB][CN_ref_atomA][CN_ref_atomB][m] */ 3934 double *rcov_dftD; /* intermediate used in rcovab_dftD */ 3935 double **rcovab_dftD; /* covalent radius used in calculating coordination number */ 3936 3937 /* unfolding added by Chi-Cheng Lee */ 3938 double **unfold_abc; 3939 double *unfold_origin; 3940 int *unfold_mapN2n; 3941 double unfold_lbound,unfold_ubound; 3942 int unfold_electronic_band; 3943 int unfold_Nkpoint; 3944 int unfold_nkpts; 3945 double **unfold_kpoint; 3946 char **unfold_kpoint_name; 3947 /* end unfolding */ 3948 3949 3950 /* scalapack */ 3951 3952 static int NBLK=128; 3953 int nblk,np_rows,np_cols,na_rows,na_cols,na_rows_max,na_cols_max; 3954 int my_prow,my_pcol; 3955 int bhandle0,bhandle1,bhandle2,ictxt0,ictxt1,ictxt2; 3956 int descS[9],descH[9],descC[9]; 3957