From dfd6a471dc92242785d03bdefb5dd5fb3e5b0331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E6=BE=A4=E8=B2=B4=E5=AE=8F?= Date: Tue, 16 Jan 2024 17:54:17 +0900 Subject: [PATCH] mod --- src/CalcByCanonicalTPQ.c | 9 ++++++--- src/include/readdef.h | 1 + src/include/struct.h | 3 +++ src/readdef.c | 17 ++++++++++------- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/CalcByCanonicalTPQ.c b/src/CalcByCanonicalTPQ.c index cbbd90dc..bd94fbcc 100644 --- a/src/CalcByCanonicalTPQ.c +++ b/src/CalcByCanonicalTPQ.c @@ -76,9 +76,12 @@ int CalcByCanonicalTPQ( rand_max = NumAve; step_spin = ExpecInterval; - flag_read_invtemp = 1; - if (flag_read_invtemp==1){ - strcpy(file_name,"inv_temp.dat"); + flag_read_invtemp = X->Bind.Def.flag_read_invtemp; + strcpy(file_name,X->Bind.Def.file_invtemp); + printf("check %d \n",X->Bind.Def.flag_read_invtemp); + printf("check %s \n",file_name); + if (X->Bind.Def.flag_read_invtemp==1){ + //strcpy(file_name,"inv_temp.dat"); num_line = func_read_invtemp(read_invtemp,read_nmax,read_physcal,file_name,0); /*count lines of files*/ //[s] allocate read_invtemp = (double*)malloc(num_line * sizeof(double)); diff --git a/src/include/readdef.h b/src/include/readdef.h index 5c01491d..f706362a 100644 --- a/src/include/readdef.h +++ b/src/include/readdef.h @@ -54,6 +54,7 @@ #define KWThreeBodyG 21 #define KWFourBodyG 22 #define KWSixBodyG 23 +#define KWInvTemp 24 int CheckSite( const int iListToSite, diff --git a/src/include/struct.h b/src/include/struct.h index e8b8b4c7..5c018066 100644 --- a/src/include/struct.h +++ b/src/include/struct.h @@ -188,6 +188,9 @@ struct DefineList { int **SBody;/**<@brief [DefineList::SBody][24] Indices of six-body correlation function. malloc in setmem_def().*/ unsigned int NSBody;/**<@brief Number of indices of six-body correlation function.*/ + int flag_read_invtemp; + char file_invtemp[D_FileNameMax]; + int **SingleExcitationOperator;/**<@brief [DefineList::NSingleExcitationOperator][3] Indices of single excitaion operator for spectrum. malloc in setmem_def().*/ unsigned int NSingleExcitationOperator;/**<@brief Number of single excitaion operator for spectrum.*/ diff --git a/src/readdef.c b/src/readdef.c index 80919d19..4bf490e8 100644 --- a/src/readdef.c +++ b/src/readdef.c @@ -67,7 +67,8 @@ static char cKWListOfFileNameList[][D_CharTmpReadDef]={ "TETwoBody", "ThreeBodyG", "FourBodyG", - "SixBodyG" + "SixBodyG", + "InvTemp" }; int D_iKWNumDef = sizeof(cKWListOfFileNameList)/sizeof(cKWListOfFileNameList[0]); @@ -744,7 +745,13 @@ int ReadDefFileNInt( fgetsMPI(ctmp2, 256, fp); sscanf(ctmp2, "%s %d\n", ctmp, &(X->NSBody)); break; - + + case KWInvTemp: + X->flag_read_invtemp = 1; + strcpy(X->file_invtemp,defname); + printf("CCC %s %s \n", X->file_invtemp,defname); + break; + case KWLaser: /* Read laser.def--------------------------------*/ fgetsMPI(ctmp, sizeof(ctmp)/sizeof(char), fp); @@ -1727,11 +1734,6 @@ int ReadDefFileIdxPara( } break; - - - - - case KWLaser: //printf("KWLaser\n"); /*laser.def----------------------------------*/ @@ -2815,6 +2817,7 @@ void InitializeInteractionNum X->NTBody=0; X->NFBody=0; X->NSBody=0; + X->flag_read_invtemp=0; X->NSingleExcitationOperator=0; X->NPairExcitationOperator=0; //[s] Time Evolution