HPhi++  3.1.0
Add new input-file for Expert mode

When you add a new input file to namelist file, the following procedures must be needed. In the following, we add the keyword "Test" as an example.

  1. Add a new keyword to the end of cKWListOfFileNameList in readdef.cpp.
    static char cKWListOfFileNameList[][D_CharTmpReadDef]
    ={
    "CalcMod",
    "ModPara",
    "LocSpin",
    "Trans",
    "CoulombIntra",
    "CoulombInter",
    "Hund",
    "PairHop",
    "Exchange",
    "InterAll",
    "OneBodyG",
    "TwoBodyG",
    "PairLift",
    "Ising",
    "Boost",
    "SingleExcitation",
    "PairExcitation",
    "SpectrumVec",
    "Laser",
    "TEOneBody",
    "TETwoBody"
    "Test"
    }
    Here, D_CharTmpReadDef is set as 200 in readdef.h. If the the character number of added keyword exceeds 200, please change the value.
  2. Define the index of keyword (such as KWCalcMod, KWModPara...) in readdef.h.
    #define KWCalcMod 0
    #define KWModPara 1
    #define KWLocSpin 2
    #define KWTrans 3
    #define KWCoulombIntra 4
    #define KWCoulombInter 5
    #define KWHund 6
    #define KWPairHop 7
    #define KWExchange 8
    #define KWInterAll 9
    #define KWOneBodyG 10
    #define KWTwoBodyG 11
    #define KWPairLift 12
    #define KWIsing 13
    #define KWBoost 14
    #define KWSingleExcitation 15
    #define KWPairExcitation 16
    #define KWSpectrumVec 17
    #define KWLaser 18
    #define KWTEOneBody 19
    #define KWTETwoBody 20
    #define KWTest 21
    The defined value must be same as the index of cKWListOfFileNameList to get the name of keyword, i.e. cKWListOfFileNameList[KWTest] = "Test".
  3. Add procedure of reading the file in ReadDefFileNInt function in readdef.cpp.
    for(iKWidx=0; iKWidx< D_iKWNumDef; iKWidx++) {
    strcpy(defname, cFileNameListFile[iKWidx]);
    if (strcmp(defname, "") == 0) continue;
    if(iKWidx==KWSpectrumVec){
    continue;
    }
    fprintf(stdoutMPI, " Read File %s for %s.\n", defname, cKWListOfFileNameList[iKWidx]);
    fp = fopenMPI(defname, "r");
    if (fp == NULL) return ReadDefFileError(defname);
    switch (iKWidx) {
    case KWTest:
    fgetsMPI(...); //Add the procedure to read-line here.
    }
    See also
    ReadDefFileNInt
  4. Use InitializeInteractionNum function to initialize variables.
    (
    struct DefineList *X
    )
    {
    X->NTransfer=0;
    X->NInterAll=0;
    X->NCisAjt=0;
    //[s] Time Evolution
    X->NLaser=0;
    //[e] Time Evolution
    X->NTest = 0;
    }
    See also
    InitializeInteractionNum
  5. The memories of arrays are stored by setmem_def function in xsetmem.cpp.
    See also
    setmem_def