53 if (fwrite (& thermo ->
id,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
54 if (fwrite (& thermo -> type,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
55 if (fwrite (& thermo -> sys,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
56 if (fwrite (& thermo -> show,
sizeof(gboolean), 1,
fp) != 1)
return ERROR_RW;
57 if (fwrite (thermo -> params,
sizeof(
double), 4,
fp) != 4)
return ERROR_RW;
58 if (fwrite (& thermo -> natoms,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
112 if (this_proj -> cpmd_input[cid] == NULL)
115 if (fwrite (& i,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
119 if (fwrite (& i,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
120 if (fwrite (& this_proj -> cpmd_input[cid] -> calc_type,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
122 if (fwrite (this_proj -> cpmd_input[cid] ->
calc_opts,
sizeof(
double), 24,
fp) != 24)
return ERROR_RW;
123 if (fwrite (& this_proj -> cpmd_input[cid] -> thermostats,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
124 if (this_proj -> cpmd_input[cid] -> thermostats)
126 thermostat * thermo = this_proj -> cpmd_input[cid] -> ions_thermostat;
132 thermo = thermo -> next;
134 i = (this_proj -> cpmd_input[cid] -> elec_thermostat) ? 1 : 0;
135 if (fwrite (& i,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
136 if (this_proj -> cpmd_input[cid] -> elec_thermostat)
141 if (
save_fixed_atoms (
fp, this_proj -> cpmd_input[cid] -> fixat, this_proj -> cpmd_input[cid] -> fixlist, this_proj -> cpmd_input[cid] -> fixcoord) !=
OK)
145 if (fwrite (& this_proj -> cpmd_input[cid] -> dummies,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
146 if (this_proj -> cpmd_input[cid] -> dummies)
152 if (fwrite (&
dummy -> type,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
153 if (fwrite (&
dummy -> show,
sizeof(gboolean), 1,
fp) != 1)
return ERROR_RW;
154 if (fwrite (
dummy -> xyz,
sizeof(
double), 3,
fp) != 3)
return ERROR_RW;
156 if (fwrite (&
dummy -> natoms,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
164 for (i=0; i<this_proj -> nspec; i++)
166 if (fwrite (this_proj -> cpmd_input[cid] -> pp[i],
sizeof(
int), 2,
fp) != 2)
return ERROR_RW;
183 if (this_proj -> cp2k_input[cid] == NULL)
186 if (fwrite (& i,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
190 if (fwrite (& i,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
191 if (fwrite (& this_proj -> cp2k_input[cid] -> input_type,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
192 if (fwrite (this_proj -> cp2k_input[cid] -> opts,
sizeof(
double), 42,
fp) != 42)
return ERROR_RW;
195 if (fwrite (this_proj -> cp2k_input[cid] -> extra_opts[i],
sizeof(
double), 4,
fp) != 4)
return ERROR_RW;
197 if (fwrite (& this_proj -> cp2k_input[cid] -> thermostats,
sizeof(
int), 1,
fp) != 1)
return ERROR_RW;
198 if (this_proj -> cp2k_input[cid] -> thermostats)
200 thermostat * thermo = this_proj -> cp2k_input[cid] -> ions_thermostat;
204 thermo = thermo -> next;
209 if (
save_fixed_atoms (
fp, this_proj -> cp2k_input[cid] -> fixat[i], this_proj -> cp2k_input[cid] -> fixlist[i], this_proj -> cp2k_input[cid] -> fixcoord[i]) !=
OK)
214 for (i=0; i<this_proj -> nspec; i++)
216 if (fwrite (this_proj -> cp2k_input[cid] -> spec_data[i],
sizeof(
int), 2,
fp) != 2)
return ERROR_RW;
int save_fixed_atoms(FILE *fp, int fixatoms, int *fixlist, int **fixcoord)
save fixed atom(s) to file