mirror of
https://github.com/QuantumPackage/qp2.git
synced 2025-04-25 17:54:44 +02:00
Fixed trexio bug when $USERB is not specified
This commit is contained in:
parent
9c1f811800
commit
66ce7bba22
@ -72,7 +72,7 @@ subroutine export_trexio(update,full_path)
|
|||||||
character*(64) :: code(100), author(100), user
|
character*(64) :: code(100), author(100), user
|
||||||
character*(64), parameter :: qp2_code = "QuantumPackage"
|
character*(64), parameter :: qp2_code = "QuantumPackage"
|
||||||
|
|
||||||
call getenv("USER",user)
|
call getenv('USER',user)
|
||||||
do k=1,N_states
|
do k=1,N_states
|
||||||
rc = trexio_read_metadata_code_num(f(k), code_num)
|
rc = trexio_read_metadata_code_num(f(k), code_num)
|
||||||
if (rc == TREXIO_ATTR_MISSING) then
|
if (rc == TREXIO_ATTR_MISSING) then
|
||||||
@ -95,25 +95,27 @@ subroutine export_trexio(update,full_path)
|
|||||||
call trexio_assert(rc, TREXIO_SUCCESS)
|
call trexio_assert(rc, TREXIO_SUCCESS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
rc = trexio_read_metadata_author_num(f(k), author_num)
|
if (trim(user) /= '') then
|
||||||
if (rc == TREXIO_ATTR_MISSING) then
|
rc = trexio_read_metadata_author_num(f(k), author_num)
|
||||||
i = 1
|
if (rc == TREXIO_ATTR_MISSING) then
|
||||||
author_num = 0
|
i = 1
|
||||||
author(:) = ""
|
author_num = 0
|
||||||
else
|
author(:) = ""
|
||||||
rc = trexio_read_metadata_author(f(k), author, 64)
|
else
|
||||||
do i=1, author_num
|
rc = trexio_read_metadata_author(f(k), author, 64)
|
||||||
if (trim(author(i)) == trim(user)) then
|
do i=1, author_num
|
||||||
exit
|
if (trim(author(i)) == trim(user)) then
|
||||||
endif
|
exit
|
||||||
enddo
|
endif
|
||||||
endif
|
enddo
|
||||||
if (i == author_num+1) then
|
endif
|
||||||
author(i) = user
|
if (i == author_num+1) then
|
||||||
rc = trexio_write_metadata_author_num(f(k), i)
|
author(i) = user
|
||||||
call trexio_assert(rc, TREXIO_SUCCESS)
|
rc = trexio_write_metadata_author_num(f(k), i)
|
||||||
rc = trexio_write_metadata_author(f(k), author, 64)
|
call trexio_assert(rc, TREXIO_SUCCESS)
|
||||||
call trexio_assert(rc, TREXIO_SUCCESS)
|
rc = trexio_write_metadata_author(f(k), author, 64)
|
||||||
|
call trexio_assert(rc, TREXIO_SUCCESS)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user