while (fgets(ctmpline, 256, fp) != NULL) {
if (strncmp(ctmpline, "//", 2) == 0) {
fprintf(stdout, " Skipping a line.\n");
continue;
}
else if (ctmpline[0] == '\0') {
fprintf(stdout, " Skipping a line.\n");
continue;
}
keyword = strtok(ctmpline, "=");
value = strtok(NULL, "=");
if (value == NULL) {
fprintf(stdout, "\n ERROR ! \"=\" is NOT found !\n\n");
}
fprintf(stdout, " KEYWORD : %-20s | VALUE : %s \n", keyword, value);
else if (strcmp(keyword,
"cutoff_j") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->cutoff_j);
else if (strcmp(keyword,
"cutoff_jh") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_JR[2]);
else if (strcmp(keyword,
"cutoff_jl") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_JR[1]);
else if (strcmp(keyword,
"cutoff_jw") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_JR[0]);
else if (strcmp(keyword,
"cutoff_length_j") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->cutoff_length_J);
else if (strcmp(keyword,
"cutoff_length_u") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->cutoff_length_U);
else if (strcmp(keyword,
"cutoff_length_t") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->cutoff_length_t);
else if (strcmp(keyword,
"cutoff_t") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->cutoff_t);
else if (strcmp(keyword,
"cutoff_th") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_tR[2]);
else if (strcmp(keyword,
"cutoff_tl") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_tR[1]);
else if (strcmp(keyword,
"cutoff_tw") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_tR[0]);
else if (strcmp(keyword,
"cutoff_u") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->cutoff_u);
else if (strcmp(keyword,
"cutoff_uh") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_UR[2]);
else if (strcmp(keyword,
"cutoff_ul") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_UR[1]);
else if (strcmp(keyword,
"cutoff_uw") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->cutoff_UR[0]);
else if (strcmp(keyword,
"doublecounting") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->double_counting);
else if (strcmp(keyword,
"hlength") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->length[2]);
else if (strcmp(keyword,
"j0''x") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[0][0]);
else if (strcmp(keyword,
"j0''xy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[0][1]);
else if (strcmp(keyword,
"j0''xz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[0][2]);
else if (strcmp(keyword,
"j0''y") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[1][1]);
else if (strcmp(keyword,
"j0''yx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[1][0]);
else if (strcmp(keyword,
"j0''yz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[1][2]);
else if (strcmp(keyword,
"j0''z") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[2][2]);
else if (strcmp(keyword,
"j0''zx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[2][0]);
else if (strcmp(keyword,
"j0''zy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J0pp[2][1]);
else if (strcmp(keyword,
"j1''x") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[0][0]);
else if (strcmp(keyword,
"j1''xy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[0][1]);
else if (strcmp(keyword,
"j1''xz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[0][2]);
else if (strcmp(keyword,
"j1''y") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[1][1]);
else if (strcmp(keyword,
"j1''yx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[1][0]);
else if (strcmp(keyword,
"j1''yz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[1][2]);
else if (strcmp(keyword,
"j1''z") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[2][2]);
else if (strcmp(keyword,
"j1''zx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[2][0]);
else if (strcmp(keyword,
"j1''zy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J1pp[2][1]);
else if (strcmp(keyword,
"j2''x") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[0][0]);
else if (strcmp(keyword,
"j2''xy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[0][1]);
else if (strcmp(keyword,
"j2''xz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[0][2]);
else if (strcmp(keyword,
"j2''y") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[1][1]);
else if (strcmp(keyword,
"j2''yx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[1][0]);
else if (strcmp(keyword,
"j2''yz") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[1][2]);
else if (strcmp(keyword,
"j2''z") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[2][2]);
else if (strcmp(keyword,
"j2''zx") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[2][0]);
else if (strcmp(keyword,
"j2''zy") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->J2pp[2][1]);
else if (strcmp(keyword,
"llength") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->length[1]);
else if (strcmp(keyword,
"outputmode") == 0)
StoreWithCheckDup_sl(keyword, value, StdI->outputmode);
else if (strcmp(keyword,
"wlength") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->length[0]);
#if defined(_HPhi)
else if (strcmp(keyword,
"eigenvecio") == 0)
StoreWithCheckDup_sl(keyword, value, StdI->EigenVecIO);
else if (strcmp(keyword,
"expandcoef") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->ExpandCoef);
else if (strcmp(keyword,
"expecinterval") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->ExpecInterval);
else if (strcmp(keyword,
"cdatafilehead") == 0)
StoreWithCheckDup_s(keyword, value, StdI->CDataFileHead);
else if (strcmp(keyword,
"initialvectype") == 0)
StoreWithCheckDup_sl(keyword, value, StdI->InitialVecType);
else if (strcmp(keyword,
"initial_iv") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->initial_iv);
else if (strcmp(keyword,
"lanczoseps") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->LanczosEps);
else if (strcmp(keyword,
"lanczostarget") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->LanczosTarget);
else if (strcmp(keyword,
"lanczos_max") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->Lanczos_max);
else if (strcmp(keyword,
"largevalue") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->LargeValue);
else if (strcmp(keyword,
"omegamax") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->OmegaMax);
else if (strcmp(keyword,
"omegamin") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->OmegaMin);
else if (strcmp(keyword,
"spectrumqh") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->SpectrumQ[2]);
else if (strcmp(keyword,
"spectrumql") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->SpectrumQ[1]);
else if (strcmp(keyword,
"spectrumqw") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->SpectrumQ[0]);
else if (strcmp(keyword,
"spectrumtype") == 0)
StoreWithCheckDup_sl(keyword, value, StdI->SpectrumType);
else if (strcmp(keyword,
"vecpoth") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->VecPot[2]);
else if (strcmp(keyword,
"vecpotl") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->VecPot[1]);
else if (strcmp(keyword,
"vecpotw") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->VecPot[0]);
#elif defined(_mVMC)
else if (strcmp(keyword,
"a0hsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[0][2]);
else if (strcmp(keyword,
"a0lsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[0][1]);
else if (strcmp(keyword,
"a0wsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[0][0]);
else if (strcmp(keyword,
"a1hsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[1][2]);
else if (strcmp(keyword,
"a1lsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[1][1]);
else if (strcmp(keyword,
"a1wsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[1][0]);
else if (strcmp(keyword,
"a2hsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[2][2]);
else if (strcmp(keyword,
"a2lsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[2][1]);
else if (strcmp(keyword,
"a2wsub") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->boxsub[2][0]);
else if (strcmp(keyword,
"complextype") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->ComplexType);
else if (strcmp(keyword,
"cparafilehead") == 0)
StoreWithCheckDup_s(keyword, value, StdI->CParaFileHead);
else if (strcmp(keyword,
"dsroptredcut") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->DSROptRedCut);
else if (strcmp(keyword,
"dsroptstadel") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->DSROptStaDel);
else if (strcmp(keyword,
"dsroptstepdt") == 0)
StoreWithCheckDup_d(keyword, value, &StdI->DSROptStepDt);
else if (strcmp(keyword,
"nvmccalmode") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NVMCCalMode);
else if (strcmp(keyword,
"ndataidxstart") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NDataIdxStart);
else if (strcmp(keyword,
"ndataqtysmp") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NDataQtySmp);
else if (strcmp(keyword,
"nlanczosmode") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NLanczosMode);
else if (strcmp(keyword,
"nmptrans") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NMPTrans);
else if (strcmp(keyword,
"nspgaussleg") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NSPGaussLeg);
else if (strcmp(keyword,
"nsplitsize") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NSplitSize);
else if (strcmp(keyword,
"nsroptitrsmp") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NSROptItrSmp);
else if (strcmp(keyword,
"nsroptitrstep") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NSROptItrStep);
else if (strcmp(keyword,
"nvmcinterval") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NVMCInterval);
else if (strcmp(keyword,
"nvmcsample") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NVMCSample);
else if (strcmp(keyword,
"nvmcwarmup") == 0)
StoreWithCheckDup_i(keyword, value, &StdI->NVMCWarmUp);
#endif
else {
fprintf(stdout, "ERROR ! Unsupported Keyword in Standard mode!\n");
}
}
fflush(fp);
fclose(fp);
If the inputted variable should be shared among routines in Standard mode, we have to add it to the list in StdFace_vals.hpp.
Also, the variable should be intialized before it is read. This initiallization is performed in the function StdFace_ResetVals(). We have to initialize new variable in this function as:
for the string.