53 if (fwrite (& thermo ->
id,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);
54 if (fwrite (& thermo -> type,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);
55 if (fwrite (& thermo -> sys,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);
56 if (fwrite (& thermo -> show,
sizeof(gboolean), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);
57 if (fwrite (thermo -> params,
sizeof(
double), 4,
fp) != 4)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);
58 if (fwrite (& thermo -> natoms,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);
75 if (fwrite (& fixatoms,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);
80 if (fwrite (fixlist,
sizeof(
int), fixatoms,
fp) != fixatoms)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);
89 for (i=0; i<fixatoms; i++)
if (fwrite (fixcoord[i],
sizeof(
int), 3,
fp) != 3)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);
112 if (this_proj -> cpmd_input[cid] == NULL)
120 if (fwrite (& this_proj -> cpmd_input[cid] -> calc_type,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);
123 if (fwrite (& this_proj -> cpmd_input[cid] -> thermostats,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);
124 if (this_proj -> cpmd_input[cid] -> thermostats)
126 thermostat * thermo = this_proj -> cpmd_input[cid] -> ions_thermostat;
136 thermo = thermo -> next;
138 i = (this_proj -> cpmd_input[cid] -> elec_thermostat) ? 1 : 0;
140 if (this_proj -> cpmd_input[cid] -> elec_thermostat)
142 if (
save_thermo (
fp, this_proj -> cpmd_input[cid] -> elec_thermostat) !=
OK)
149 if (
save_fixed_atoms (
fp, this_proj -> cpmd_input[cid] -> fixat, this_proj -> cpmd_input[cid] -> fixlist, this_proj -> cpmd_input[cid] -> fixcoord) !=
OK)
154 if (fwrite (& this_proj -> cpmd_input[cid] -> dummies,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);
155 if (this_proj -> cpmd_input[cid] -> dummies)
173 for (i=0; i<this_proj -> nspec; i++)
175 if (fwrite (this_proj -> cpmd_input[cid] -> pp[i],
sizeof(
int), 2,
fp) != 2)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);
192 if (this_proj -> cp2k_input[cid] == NULL)
200 if (fwrite (& this_proj -> cp2k_input[cid] -> input_type,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);
201 if (fwrite (this_proj -> cp2k_input[cid] -> opts,
sizeof(
double), 42,
fp) != 42)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);
204 if (fwrite (this_proj -> cp2k_input[cid] -> extra_opts[i],
sizeof(
double), 4,
fp) != 4)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);
206 if (fwrite (& this_proj -> cp2k_input[cid] -> thermostats,
sizeof(
int), 1,
fp) != 1)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);
207 if (this_proj -> cp2k_input[cid] -> thermostats)
209 thermostat * thermo = this_proj -> cp2k_input[cid] -> ions_thermostat;
217 thermo = thermo -> next;
222 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)
228 for (i=0; i<this_proj -> nspec; i++)
230 if (fwrite (this_proj -> cp2k_input[cid] -> spec_data[i],
sizeof(
int), 2,
fp) != 2)
return signal_error (__FILE__, __func__, __LINE__,
ERROR_QM);