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);
#if defined(_HPhi)
#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.h.
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.