Changeset 76b3dc


Ignore:
Timestamp:
Apr 24, 2008, 11:14:27 AM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
464c6d
Parents:
090299
Message:

.csv files of linear response values are written on first level, appended on all latters. No more .L1.csv.

Essentially, this is a fix, as it was meant to be like that before. Level in filename is not needed anymore as we are writing the correct ecut (respective to the current level) into the file. Hence, we may easily pack all into one file. This was already implemented with one of the three values but not with all and not for each PAS and non-PAS. Now, we have a if (Lev0->LevelNo == MaxLevel-2) check everywhere and OpenFile either in write or in append mode and put a header only in the former case.
Also, PAS values are now also written for the magnetic moments which was not done before (only to screen).

Files:
1 edited
2 moved

Legend:

Unmodified
Added
Removed
  • pcp/src/perturbed.c

    r090299 r76b3dc  
    29832983  if (P->Par.me == 0) {
    29842984    time(&seconds); // get current time
    2985     sprintf(&suffixchi[0], ".chi.L%i.csv", Lev0->LevelNo);
    2986     OpenFile(P, &ChiFile, suffixchi, "a", P->Call.out[ReadOut]);
    2987     fprintf(ChiFile,"# magnetic susceptibility tensor chi[01,02,03,10,11,12,20,21,22], seed %i, config %s, run on %s", R->Seed, P->Files.default_path, ctime(&seconds));
    2988     fprintf(ChiFile,"%lg\t", Lev0->ECut/4.);  // ECut is in Rydberg
     2985    sprintf(&suffixchi[0], ".chi.csv");
     2986    if (Lev0->LevelNo == Lat->MaxLevel-2) { // if first level
     2987      OpenFile(P, &ChiFile, suffixchi, "w", P->Call.out[ReadOut]);
     2988      fprintf(ChiFile,"# magnetic susceptibility tensor chi[01,02,03,10,11,12,20,21,22], seed %i, config %s, run on %s", R->Seed, P->Files.default_path, ctime(&seconds));
     2989      fprintf(ChiFile,"%lg\t", Lev0->ECut/4.);  // ECut is in Rydberg
     2990    } else {
     2991      OpenFile(P, &ChiFile, suffixchi, "a", P->Call.out[ReadOut]);
     2992      fprintf(ChiFile,"%lg\t", Lev0->ECut/4.);  // ECut is in Rydberg
     2993    }
    29892994    for (in=0;in<NDIM*NDIM;in++)
    29902995      fprintf(ChiFile,"%e\t", Chi[in]);
     
    30353040    time(&seconds); // get current time
    30363041    sprintf(&suffixchi[0], ".chi_PAS.csv");
    3037     if (Lev0->LevelNo == Lat->MaxLevel-2) {
     3042    if (Lev0->LevelNo == Lat->MaxLevel-2) { // if first level
    30383043      OpenFile(P, &ChiFile, suffixchi, "w", P->Call.out[ReadOut]);
    30393044      fprintf(ChiFile,"# magnetic susceptibility tensor chi[00,11,22] Principal Axis System, seed %i, config %s, run on %s", R->Seed, P->Files.default_path, ctime(&seconds));
    3040       fprintf(ChiFile,"# Ecut\tChi_XX\t\tChi_YY\t\tChi_ZZ\tShielding\tanisotropy\tasymmetry\tS\t\tA\n");
     3045      fprintf(ChiFile,"# Ecut\tChi_XX\t\tChi_YY\t\tChi_ZZ\tsusceptib\tanisotropy\tasymmetry\tS\t\tA\n");
    30413046    } else
    30423047      OpenFile(P, &ChiFile, suffixchi, "a", P->Call.out[ReadOut]);
     
    31823187  // output tensor to file
    31833188  if (P->Par.me == 0) {
    3184     sprintf(suffixsigma, ".sigma_chi_rezi.L%i.csv", Lev0->LevelNo);
    3185     OpenFile(P, &SigmaFile, suffixsigma, "a", P->Call.out[ReadOut]);
    3186     fprintf(SigmaFile,"# chemical shielding tensor sigma_rezi[01,02,03,10,11,12,20,21,22], seed %i, config %s, run on %s", R->Seed, P->Files.default_path, ctime(&seconds));
    3187     fprintf(SigmaFile,"%lg\t", Lev0->ECut/4.);
     3189    sprintf(suffixsigma, ".sigma_chi.csv");
     3190    if (Lev0->LevelNo == Lat->MaxLevel-2) { // if first level
     3191      OpenFile(P, &SigmaFile, suffixsigma, "w", P->Call.out[ReadOut]);
     3192      fprintf(SigmaFile,"# chemical shielding tensor sigma_rezi[01,02,03,10,11,12,20,21,22], seed %i, config %s, run on %s", R->Seed, P->Files.default_path, ctime(&seconds));
     3193      fprintf(SigmaFile,"%lg\t", Lev0->ECut/4.);
     3194    } else {
     3195      OpenFile(P, &SigmaFile, suffixsigma, "a", P->Call.out[ReadOut]);
     3196      fprintf(SigmaFile,"%lg\t", Lev0->ECut/4.);
     3197    }
    31883198    for (in=0;in<NDIM;in++)
    31893199      for (dex=0;dex<NDIM;dex++)
     
    32093219      // output tensor to file
    32103220      if (P->Par.me == 0) {
    3211         sprintf(suffixsigma, ".sigma_i%i_%s_rezi.L%i.csv", ion, I->I[it].Symbol, Lev0->LevelNo);
    3212         OpenFile(P, &SigmaFile, suffixsigma, "a", P->Call.out[ReadOut]);
    3213         fprintf(SigmaFile,"# chemical shielding tensor sigma_rezi[01,02,03,10,11,12,20,21,22], seed %i, config %s, run on %s", R->Seed, P->Files.default_path, ctime(&seconds));
    3214         fprintf(SigmaFile,"%lg\t", Lev0->ECut/4.);  // ECut is in Rydberg
     3221        sprintf(suffixsigma, ".sigma_i%i_%s.csv", ion, I->I[it].Symbol);
     3222        if (Lev0->LevelNo == Lat->MaxLevel-2) { // if first level
     3223          OpenFile(P, &SigmaFile, suffixsigma, "w", P->Call.out[ReadOut]);
     3224          fprintf(SigmaFile,"# chemical shielding tensor sigma_rezi[01,02,03,10,11,12,20,21,22], seed %i, config %s, run on %s", R->Seed, P->Files.default_path, ctime(&seconds));
     3225          fprintf(SigmaFile,"%lg\t", Lev0->ECut/4.);  // ECut is in Rydberg
     3226        } else {
     3227          OpenFile(P, &SigmaFile, suffixsigma, "a", P->Call.out[ReadOut]);
     3228          fprintf(SigmaFile,"%lg\t", Lev0->ECut/4.);  // ECut is in Rydberg
     3229        }
    32153230        for (in=0;in<NDIM;in++)
    32163231          for (dex=0;dex<NDIM;dex++)
     
    34253440      // output tensor to file
    34263441      if (P->Par.me == 0) {
    3427         sprintf(&suffixmoment[0], ".moment_i%i_%s.L%i.csv", ion, I->I[it].Symbol, Lev0->LevelNo);
    3428         OpenFile(P, &MomentFile, suffixmoment, "a", P->Call.out[ReadOut]);
    3429         fprintf(MomentFile,"# magnetic tensor moment[01,02,03,10,11,12,20,21,22], seed %i, config %s, run on %s", R->Seed, P->Files.default_path, ctime(&seconds));
    3430         fprintf(MomentFile,"%lg\t", Lev0->ECut/4.);  // ECut is in Rydberg
     3442        sprintf(suffixmoment, ".moment_i%i_%s.csv", ion, I->I[it].Symbol);
     3443        if (Lev0->LevelNo == Lat->MaxLevel-2) { // if first level
     3444          OpenFile(P, &MomentFile, suffixmoment, "w", P->Call.out[ReadOut]);
     3445          fprintf(MomentFile,"# magnetic tensor moment[01,02,03,10,11,12,20,21,22], seed %i, config %s, run on %s", R->Seed, P->Files.default_path, ctime(&seconds));
     3446          fprintf(MomentFile,"%lg\t", Lev0->ECut/4.);  // ECut is in Rydberg
     3447        } else {
     3448          OpenFile(P, &MomentFile, suffixmoment, "a", P->Call.out[ReadOut]);
     3449          fprintf(MomentFile,"%lg\t", Lev0->ECut/4.);  // ECut is in Rydberg
     3450        }
    34313451        for (in=0;in<NDIM*NDIM;in++)
    34323452          fprintf(MomentFile,"%e\t", Moment[in]);
     
    34793499        fprintf(stderr,"A          : %e\n", A);
    34803500        fprintf(stderr,"==================\n");
    3481     }
     3501      }
     3502      if (P->Par.me == 0) {
     3503        sprintf(suffixmoment, ".moment_i%i_%s_PAS.csv", ion, I->I[it].Symbol);
     3504        if (Lev0->LevelNo == Lat->MaxLevel-2) {
     3505          OpenFile(P, &MomentFile, suffixmoment, "w", P->Call.out[ReadOut]);
     3506          fprintf(MomentFile,"# magnetic moment M[00,11,22] Principal Axis System, seed %i, config %s, run on %s", R->Seed, P->Files.default_path, ctime(&seconds));
     3507          fprintf(MomentFile,"# Ecut\tM_XX\tM_YY\tM_ZZ\tMagnitude\tanisotropy\tasymmetry\tS\t\tA\n");
     3508        } else
     3509          OpenFile(P, &MomentFile, suffixmoment, "a", P->Call.out[ReadOut]);
     3510        fprintf(MomentFile,"%lg\t", Lev0->ECut/4.);  // ECut is in Rydberg
     3511        for (i=0;i<NDIM;i++)
     3512          fprintf(MomentFile,"%lg\t", gsl_vector_get(eval,i));
     3513        fprintf(MomentFile,"%lg\t%lg\t%lg\t%lg\t%lg\t\n", iso, delta_moment, eta, S, A);
     3514        fclose(MomentFile);
     3515      }
    34823516      gsl_vector_free(eval);
    34833517    }
  • util/CreateFromXYZ.sh.in

    r090299 r76b3dc  
    99#pfad="${2}/`basename ${1}`"
    1010pfad="$2"
    11 molecuilder="/home/heber/workspace/pcp_alternate/bin/"
    12 pseudopot="/home/heber/workspace/pcp_alternate/defaults/pseudopot"
     11exec_prefix=@prefix@
     12molecuilder=@bindir@
     13pseudopot="${exec_prefix}/defaults/pseudopot"
    1314
    1415echo "Target dir is ${pfad}, using xyz file ${mol}."
  • util/dynamicANOVA.sh.in

    r090299 r76b3dc  
    55MPIRUN="/opt/packages/mpichgm-1.2.7..15/bin/mpirun.ch_gm"
    66#MPIRUN="/usr/bin/mpirun.mpich"
    7 MOLECUILDER="/home/heber/workspace/espack/pcp/bin/molecuilder"
    8 JOINER="/home/heber/workspace/espack/pcp/bin/joiner"
    9 PCP="/home/heber/workspace/espack/pcp/bin/pcp"
     7exec_prefix=@prefix@
     8MOLECUILDER=@bindir@/molecuilder
     9JOINER=@bindir@/joiner
     10PCP=@bindir@/pcp
    1011
    1112function check {
Note: See TracChangeset for help on using the changeset viewer.