Commit a9dbe680 authored by ofgeorg's avatar ofgeorg

changed the way arrays are written when flggendata is set

parent 2db481bb
...@@ -369,7 +369,18 @@ ...@@ -369,7 +369,18 @@
& // '.txt' & // '.txt'
OPEN(unit=uNum+19,file=tmp_dir,status='replace',& OPEN(unit=uNum+19,file=tmp_dir,status='replace',&
& action='write', iostat=ioError) & action='write', iostat=ioError)
tmp_dir=trim(adjustl(options%output_folder))&
& // '/popsize'&
& // trim(adjustl(proc)) &
& // '.txt'
OPEN(unit=uNum+20,file=tmp_dir,status='replace',&
& action='write', iostat=ioError)
tmp_dir=trim(adjustl(options%output_folder))&
& // '/histsize'&
& // trim(adjustl(proc)) &
& // '.txt'
OPEN(unit=uNum+21,file=tmp_dir,status='replace',&
& action='write', iostat=ioError)
IF(ioError .NE. 0) THEN IF(ioError .NE. 0) THEN
WRITE(*,*) 'I/O-Error writing Generation Data.' WRITE(*,*) 'I/O-Error writing Generation Data.'
STOP STOP
...@@ -1379,7 +1390,7 @@ ...@@ -1379,7 +1390,7 @@
! Close Generation Data Files ! Close Generation Data Files
!------------------------------------------------------------------------- !-------------------------------------------------------------------------
IF(options%flgGenData) THEN IF(options%flgGenData) THEN
DO i = 0, 19 DO i = 0, 21
CLOSE(unit=uNum+i) CLOSE(unit=uNum+i)
END DO END DO
END IF END IF
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
CHARACTER(len=20),SAVE :: formN,formHist,formInt,formFit CHARACTER(len=20),SAVE :: formN,formHist,formInt,formFit
INTEGER :: i INTEGER :: i
INTEGER,SAVE :: calls = 0 INTEGER,SAVE :: calls = 0
INTEGER :: histsize
!------------------------------------------------------------------------- !-------------------------------------------------------------------------
! Get Array Formatter (only once) ! Get Array Formatter (only once)
...@@ -99,20 +100,26 @@ ...@@ -99,20 +100,26 @@
!WRITE(unit+8,formN) arxvalid(1:m,i) !WRITE(unit+8,formN) arxvalid(1:m,i)
!END DO !END DO
DO i = 1, m DO i = 1, n
WRITE(unit+7,formFit) arx(i,1:n) WRITE(unit+7,formN) arx(1:m,i)
WRITE(unit+8,formFit) arxvalid(i,1:n) WRITE(unit+8,formN) arxvalid(1:m,i)
END DO END DO
!------------------------------------------------------------------------- !-------------------------------------------------------------------------
! Write Fitness Values ! Write Fitness Values
!------------------------------------------------------------------------- !-------------------------------------------------------------------------
WRITE(unit+9,formFit) fitness%raw DO i = 1, n
WRITE(unit+10,formInt) fitness%idx WRITE(unit+11,*) fitness%sel(i)
WRITE(unit+11,formFit) fitness%sel WRITE(unit+9, *) fitness%raw(i)
WRITE(unit+12,formInt) fitness%idxsel WRITE(unit+10,*) fitness%idx(i)
WRITE(unit+13,formHist) fitness%hist WRITE(unit+12, *) fitness%idxsel(i)
WRITE(unit+14,formHist) fitness%histsel END DO
histsize = size(fitness%hist)
DO i = 1, histsize
WRITE(unit+13,*) fitness%hist(i)
WRITE(unit+14,*) fitness%histsel(i)
END DO
WRITE(unit+15,*) countEval WRITE(unit+15,*) countEval
! Benis code ! Benis code
!WRITE(unit+16,*) abs(options%global_min - bestever%f) !WRITE(unit+16,*) abs(options%global_min - bestever%f)
...@@ -122,11 +129,14 @@ ...@@ -122,11 +129,14 @@
#ifdef __HAVE_MPI__ #ifdef __HAVE_MPI__
WRITE(unit+18,formN) GLOBAL_X_BEST WRITE(unit+18,formN) GLOBAL_X_BEST
#endif #endif
WRITE(unit+20,*) n
WRITE(unit+21,*) histsize
ELSEIF (options%flgGenTrace) THEN ELSEIF (options%flgGenTrace) THEN
WRITE(unit+16,*) bestever%f WRITE(unit+16,*) bestever%f
WRITE(unit+17,formN) bestever%x WRITE(unit+17,formN) bestever%x
END IF END IF
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment