File: TRAN_Check_Input.c

package info (click to toggle)
openmx 3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 134,876 kB
  • sloc: ansic: 152,771; python: 876; makefile: 576; xml: 63; perl: 18; sh: 4
file content (91 lines) | stat: -rw-r--r-- 1,877 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/**********************************************************************
  TRAN_Check_Inputs.c:

  TRAN_Check_Input.c is a subroutine to check th input data.

  Log of TRAN_Check_Input.c:

     06/Oct./2008  Released by H.Kino and T.Ozaki

***********************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#include "Inputtools.h"
#include "openmx_common.h"

#ifdef nompi
#include "mimic_mpi.h"
#else
#include <mpi.h>
#endif

#include "tran_prototypes.h"
#include "tran_variables.h"

void TRAN_Check_Input(  MPI_Comm comm1, int Solver )
{
  int po=0;
  FILE *fp;
  char *s_vec[20];
  int i_vec[20];
  double r_vec[20];

  int myid,i,j,spe,spe_e; 
  char Species[YOUSO10];
  double Length_C, Length_L, Length_R;
  double angleCL, angleCR;
  double Lsign, Rsign; 

  if (Solver!=4) return; 

  MPI_Comm_rank(comm1,&myid);

  /* left */

  for (i=1; i<=Latomnum; i++){

    j = TRAN_Original_Id[i];
    spe   = WhatSpecies[i];
    spe_e = WhatSpecies_e[0][j];

    if (Spe_Total_NO_e[0][spe_e]!=Spe_Total_NO[spe]){

      if (myid==Host_ID){
        printf("The specification of species in the LEFT lead is inconsistent.\n");
        printf("Probably the basis set is different from that used in the band calculation.\n");
      }

      po++;
    }
  }

  /* right */

  for (i=1; i<=Ratomnum; i++){

    j = TRAN_Original_Id[Catomnum+Latomnum+i];
    spe   = WhatSpecies[Catomnum+Latomnum+i];
    spe_e = WhatSpecies_e[1][j];

    if (Spe_Total_NO_e[1][spe_e]!=Spe_Total_NO[spe]){

      if (myid==Host_ID){
        printf("The specification of species in the RIGHT lead is inconsistent.\n");
        printf("Probably the basis set is different from that used in the band calculation.\n");
      }

      po++;
    }
  }

  /* check po */

  if (po!=0){
    MPI_Finalize();
    exit(0);
  } 
}