10
0
mirror of https://gitlab.com/scemama/EZFIO.git synced 2024-12-22 04:13:34 +01:00

Char array as 1D

Version:1.6.1
This commit is contained in:
Anthony Scemama 2019-10-27 23:46:36 +01:00
parent e27ef1c7f4
commit cfb61939bc
2 changed files with 5 additions and 7 deletions

View File

@ -416,7 +416,7 @@ subroutine ezfio_write_array_ch(dir,fil,rank,dims,dim_max,dat)
integer :: i integer :: i
character*(1024) :: l_filename(2) character*(1024) :: l_filename(2)
integer :: length integer :: length
character(len=:), allocatable :: buffer(:) character(len=:), allocatable :: buffer
if (libezfio_read_only) then if (libezfio_read_only) then
call ezfio_error(irp_here,'Read-only file.') call ezfio_error(irp_here,'Read-only file.')
endif endif
@ -431,13 +431,11 @@ subroutine ezfio_write_array_ch(dir,fil,rank,dims,dim_max,dat)
close(unit=libezfio_iunit) close(unit=libezfio_iunit)
length = len(dat(1)) length = len(dat(1))
allocate( character(len=length+1) :: buffer(dim_max) ) allocate( character(len=(length+1)*dim_max) :: buffer )
!$OMP PARALLEL DO PRIVATE(i)
do i=1,dim_max do i=1,dim_max
write(buffer(i)(1:length), '(A)') dat(i) write(buffer((i-1)*(length+1)+1:i*(length+1)-1), '(A)') dat(i)
buffer(i)(length+1:length+1) = ACHAR(10) buffer(i*(length+1):i*(length+1)) = ACHAR(10)
enddo enddo
!$OMP END PARALLEL DO
call libezfio_reopenz_unformatted(trim(l_filename(1)),'wb',err) call libezfio_reopenz_unformatted(trim(l_filename(1)),'wb',err)
write(libezfio_iunit) buffer write(libezfio_iunit) buffer
call libezfio_closez(trim(l_filename(1)),'w') call libezfio_closez(trim(l_filename(1)),'w')

View File

@ -1 +1 @@
VERSION=1.6.0 VERSION=1.6.1