Changeset d3482a for pcp/src/perturbed.c
- Timestamp:
- Apr 23, 2008, 4:03:13 PM (18 years ago)
- Children:
- 4f9fe2
- Parents:
- d52fb5
- File:
-
- 1 edited
-
pcp/src/perturbed.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pcp/src/perturbed.c
rd52fb5 rd3482a 2894 2894 double eta, delta_chi, S, A, iso; 2895 2895 int cross_lookup[4]; 2896 char *suffixchi; 2897 FILE *ChiFile; 2898 time_t seconds; 2896 2899 2897 2900 if(P->Call.out[NormalOut]) fprintf(stderr,"(%i)Calculating Magnetic Susceptibility \n", P->Par.me); … … 2950 2953 } 2951 2954 } 2955 2956 suffixchi = (char *) Malloc(sizeof(char)*255, "CalculateMagneticSusceptibility: *suffixchi"); 2952 2957 // store symmetrized matrix 2953 2958 for (in=0;in<NDIM;in++) … … 2956 2961 // output tensor to file 2957 2962 if (P->Par.me == 0) { 2958 FILE *ChiFile;2959 char suffixchi[255];2960 time_t seconds;2961 2962 2963 time(&seconds); // get current time 2963 2964 sprintf(&suffixchi[0], ".chi.L%i.csv", Lev0->LevelNo); … … 3004 3005 // output PAS tensor to file 3005 3006 if (P->Par.me == 0) { 3006 FILE *ChiFile;3007 char suffixchi[255];3008 time_t seconds;3009 3010 3007 time(&seconds); // get current time 3011 3008 sprintf(&suffixchi[0], ".chi_PAS.csv"); … … 3026 3023 gsl_vector_free(eval); 3027 3024 gsl_matrix_complex_free(H); 3025 Free(suffixchi, "CalculateMagneticSusceptibility: *suffixchi"); 3028 3026 } 3029 3027 … … 3069 3067 gsl_matrix_complex *H = gsl_matrix_complex_calloc(NDIM,NDIM); 3070 3068 FILE *SigmaFile; 3071 char suffixsigma[255];3069 char *suffixsigma = (char *) Malloc(sizeof(char)*255, "CalculateChemicalShieldingByReciprocalCurrentDensity: *suffixsigma"); 3072 3070 3073 3071 time_t seconds; … … 3160 3158 // output tensor to file 3161 3159 if (P->Par.me == 0) { 3162 sprintf( &suffixsigma[0], ".sigma_chi_rezi.L%i.csv", Lev0->LevelNo);3160 sprintf(suffixsigma, ".sigma_chi_rezi.L%i.csv", Lev0->LevelNo); 3163 3161 OpenFile(P, &SigmaFile, suffixsigma, "a", P->Call.out[ReadOut]); 3164 3162 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)); … … 3186 3184 // output tensor to file 3187 3185 if (P->Par.me == 0) { 3188 sprintf( &suffixsigma[0], ".sigma_i%i_%s_rezi.L%i.csv", ion, I->I[it].Symbol, Lev0->LevelNo);3186 sprintf(suffixsigma, ".sigma_i%i_%s_rezi.L%i.csv", ion, I->I[it].Symbol, Lev0->LevelNo); 3189 3187 OpenFile(P, &SigmaFile, suffixsigma, "a", P->Call.out[ReadOut]); 3190 3188 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)); … … 3232 3230 } 3233 3231 if (P->Par.me == 0) { 3234 FILE *SigmaFile; 3235 char suffixsigma[255]; 3236 sprintf(&suffixsigma[0], ".sigma_i%i_%s_PAS.csv", ion, I->I[it].Symbol); 3232 sprintf(suffixsigma, ".sigma_i%i_%s_PAS.csv", ion, I->I[it].Symbol); 3237 3233 if (Lev0->LevelNo == Lat->MaxLevel-2) { 3238 3234 OpenFile(P, &SigmaFile, suffixsigma, "w", P->Call.out[ReadOut]); … … 3304 3300 gsl_vector_free(eval); 3305 3301 gsl_matrix_complex_free(H); 3302 Free(suffixsigma, "CalculateChemicalShieldingByReciprocalCurrentDensity: *suffixsigma"); 3306 3303 } 3307 3304 … … 3337 3334 const int N0 = Lev0->Plan0.plan->local_nx; 3338 3335 FILE *MomentFile; 3339 char suffixmoment[255];3336 char *suffixmoment = (char *) Malloc(sizeof(char)*255, "CalculateMagneticMoment: *suffixmoment"); 3340 3337 time_t seconds; 3341 3338 time(&seconds); // get current time … … 3444 3441 3445 3442 gsl_matrix_complex_free(H); 3443 Free(suffixmoment, "CalculateMagneticMoment: *suffixmoment"); 3446 3444 } 3447 3445 … … 3776 3774 struct LatticeLevel *Lev0 = R->Lev0; 3777 3775 struct Density *Dens0 = Lev0->Dens; 3778 char filename[255];3776 char *filename; 3779 3777 char *suchpointer; 3780 3778 FILE *PlotFile = NULL; … … 3795 3793 if (!myPE) { // only process 0 writes to file 3796 3794 // open file 3795 filename = (char *) Malloc(sizeof(char)*255, "PlotVectorPlane: *filename"); 3797 3796 sprintf(&filename[0], ".current.L%i.csv", Lev0->LevelNo); 3798 3797 OpenFile(P, &PlotFile, filename, "w", P->Call.out[ReadOut]); … … 3805 3804 fprintf(PlotFile,"\n"); 3806 3805 } else { Error(SomeError, "PlotVectorPlane: Opening Plot File"); } 3806 Free(filename, "PlotVectorPlane: *filename"); 3807 3807 } 3808 3808
Note:
See TracChangeset
for help on using the changeset viewer.
