Fixed need for JSON

This commit is contained in:
Anthony Scemama 2023-04-21 18:06:37 +02:00
parent 551f664166
commit 5039bb674d
8 changed files with 21 additions and 3 deletions

2
external/ezfio vendored

@ -1 +1 @@
Subproject commit ed1df9f3c1f51752656ca98da5693a4119add05c
Subproject commit d5805497fa0ef30e70e055cde1ecec2963303e93

2
external/irpf90 vendored

@ -1 +1 @@
Subproject commit 33ca5e1018f3bbb5e695e6ee558f5dac0753b271
Subproject commit 0007f72f677fe7d61c5e1ed461882cb239517102

@ -1 +1 @@
Subproject commit fd43778e12bb5858c4c780c34346be0f158b8cc7
Subproject commit e0d0e02e9f5ece138d1520106954a881ab0b8db2

View File

@ -10,6 +10,7 @@ BEGIN_PROVIDER [ character*(128), json_filename ]
prefix = trim(ezfio_filename)//'/json/'
call lock_io
exists = .True.
counter = 0
do while (exists)
@ -17,6 +18,7 @@ BEGIN_PROVIDER [ character*(128), json_filename ]
write(json_filename, '(A,I5.5,A)') trim(prefix), counter, '.json'
INQUIRE(FILE=trim(json_filename), EXIST=exists)
enddo
call unlock_io
END_PROVIDER
@ -27,13 +29,17 @@ BEGIN_PROVIDER [ integer, json_unit]
END_DOC
integer, external :: getUnitAndOpen
call ezfio_set_json_empty(.False.)
call lock_io
json_unit = getUnitAndOpen(json_filename, 'w')
write(json_unit, '(A)') '{'
call unlock_io
END_PROVIDER
subroutine json_close
call lock_io
write(json_unit, '(A)') '}'
close(json_unit)
call unlock_io
FREE json_unit
end

View File

@ -90,7 +90,11 @@ subroutine run
! Choose SCF algorithm
write(json_unit,*) '"scf" : ['
call Roothaan_Hall_SCF
write(json_unit,*) ']'
call json_close
end

View File

@ -93,7 +93,10 @@ subroutine run
level_shift += 1.d0
touch level_shift
write(json_unit,*) '"scf" : ['
call Roothaan_Hall_SCF
write(json_unit,*) ']'
call json_close
call ezfio_set_kohn_sham_rs_energy(SCF_energy)
write(*, '(A22,X,F16.10)') 'one_e_energy = ',one_e_energy

View File

@ -1,2 +1,3 @@
mo_guess
bitmask
json

View File

@ -153,6 +153,7 @@ END_DOC
! Write data in JSON file
call lock_io
if (iteration_SCF == 1) then
write(json_unit, *) '{'
else
@ -164,6 +165,7 @@ END_DOC
write(json_unit, json_real_fmt) 'max_error_DIIS', max_error_DIIS
write(json_unit, json_real_fmt) 'level_shift', level_shift
write(json_unit, json_int_fmt) 'dim_DIIS', dim_DIIS
call unlock_io
if (Delta_energy_SCF < 0.d0) then
call save_mos
@ -172,11 +174,13 @@ END_DOC
write(json_unit, json_false_fmt) 'saved'
endif
call lock_io
if (converged) then
write(json_unit, json_true_fmtx) 'converged'
else
write(json_unit, json_false_fmtx) 'converged'
endif
call unlock_io
if (qp_stop()) exit