Skip to content

Commit

Permalink
Label debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrack committed Jan 8, 2020
1 parent 4f87de9 commit 50b3b8a
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/force_env_methods.F
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,6 @@ SUBROUTINE force_env_calc_num_pressure(force_env, dx)
CALL real_to_scaled(s, ref_pos_shell(i, 1:3), cell_local)
CALL scaled_to_real(shell_particles%els(i)%r, s, cell)
END DO
! Compute energies
CALL force_env_calc_energy_force(force_env, &
calc_force=.FALSE., &
Expand All @@ -625,12 +624,21 @@ SUBROUTINE force_env_calc_num_pressure(force_env, dx)
CALL init_cell(cell)
numer_stress(ip, iq) = 0.5_dp*(numer_energy(1) - numer_energy(2))/dx_w
IF (output_unit > 0) THEN
WRITE (UNIT=output_unit, FMT="(T7,A,F7.4,A,T27,A,F7.4,A,T49,A)") &
"E("//ACHAR(119 + ip)//ACHAR(119 + iq)//" +", dx_w, ")", &
"E("//ACHAR(119 + ip)//ACHAR(119 + iq)//" -", dx_w, ")", &
"f(numerical)"
WRITE (UNIT=output_unit, FMT="(3(1X,F19.8))") &
numer_energy(1:2), numer_stress(ip, iq)
IF (globenv%run_type_id == debug_run) THEN
WRITE (UNIT=output_unit, FMT="(T2,A,T19,A,F7.4,A,T44,A,F7.4,A,T69,A)") &
"DEBUG|", "E("//ACHAR(119 + ip)//ACHAR(119 + iq)//" +", dx_w, ")", &
"E("//ACHAR(119 + ip)//ACHAR(119 + iq)//" -", dx_w, ")", &
"f(numerical)"
WRITE (UNIT=output_unit, FMT="(T2,A,2(1X,F24.8),1X,F22.8)") &
"DEBUG|", numer_energy(1:2), numer_stress(ip, iq)
ELSE
WRITE (UNIT=output_unit, FMT="(T7,A,F7.4,A,T27,A,F7.4,A,T49,A)") &
"E("//ACHAR(119 + ip)//ACHAR(119 + iq)//" +", dx_w, ")", &
"E("//ACHAR(119 + ip)//ACHAR(119 + iq)//" -", dx_w, ")", &
"f(numerical)"
WRITE (UNIT=output_unit, FMT="(3(1X,F19.8))") &
numer_energy(1:2), numer_stress(ip, iq)
END IF
END IF
END DO
END DO
Expand Down

0 comments on commit 50b3b8a

Please sign in to comment.