Populate json_data with basic unfragmented calculation results
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(json_output_data_t), | intent(out) | :: | json_data | |||
| type(calculation_result_t), | intent(in) | :: | result |
subroutine populate_unfragmented_json_data(json_data, result) !! Populate json_data with basic unfragmented calculation results use mqc_json_output_types, only: json_output_data_t, OUTPUT_MODE_UNFRAGMENTED type(json_output_data_t), intent(out) :: json_data type(calculation_result_t), intent(in) :: result json_data%output_mode = OUTPUT_MODE_UNFRAGMENTED json_data%total_energy = result%energy%total() json_data%has_energy = .true. ! Copy gradient if available if (result%has_gradient) then allocate (json_data%gradient(size(result%gradient, 1), size(result%gradient, 2))) json_data%gradient = result%gradient json_data%has_gradient = .true. end if ! Copy dipole if available if (result%has_dipole) then allocate (json_data%dipole(3)) json_data%dipole = result%dipole json_data%has_dipole = .true. end if ! Copy Hessian if available if (result%has_hessian) then allocate (json_data%hessian(size(result%hessian, 1), size(result%hessian, 2))) json_data%hessian = result%hessian json_data%has_hessian = .true. end if end subroutine populate_unfragmented_json_data