diff --git a/src/grid/grid_mech_FEM.f90 b/src/grid/grid_mech_FEM.f90 index 609561c80..aa9e705a6 100644 --- a/src/grid/grid_mech_FEM.f90 +++ b/src/grid/grid_mech_FEM.f90 @@ -235,10 +235,18 @@ subroutine grid_mechanical_FEM_init fileHandle = HDF5_openFile(getSolverJobName()//'_restart.hdf5','r') groupHandle = HDF5_openGroup(fileHandle,'solver') - call HDF5_read(groupHandle,P_aim, 'P_aim') - call HDF5_read(groupHandle,F_aim, 'F_aim') - call HDF5_read(groupHandle,F_aim_lastInc,'F_aim_lastInc') - call HDF5_read(groupHandle,F_aimDot, 'F_aimDot') + call HDF5_read(groupHandle,P_aim, 'P_aim',.false.) + call MPI_Bcast(P_aim,9,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' + call HDF5_read(groupHandle,F_aim, 'F_aim',.false.) + call MPI_Bcast(F_aim,9,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' + call HDF5_read(groupHandle,F_aim_lastInc,'F_aim_lastInc',.false.) + call MPI_Bcast(F_aim_lastInc,9,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' + call HDF5_read(groupHandle,F_aimDot, 'F_aimDot',.false.) + call MPI_Bcast(F_aimDot,9,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' call HDF5_read(groupHandle,F, 'F') call HDF5_read(groupHandle,F_lastInc, 'F_lastInc') call HDF5_read(groupHandle,u_current, 'u') @@ -261,8 +269,12 @@ subroutine grid_mechanical_FEM_init restartRead2: if (interface_restartInc > 0) then print'(a,i0,a)', ' reading more restart data of increment ', interface_restartInc, ' from file' - call HDF5_read(groupHandle,C_volAvg, 'C_volAvg') - call HDF5_read(groupHandle,C_volAvgLastInc,'C_volAvgLastInc') + call HDF5_read(groupHandle,C_volAvg, 'C_volAvg',.false.) + call MPI_Bcast(C_volAvg,81,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' + call HDF5_read(groupHandle,C_volAvgLastInc,'C_volAvgLastInc',.false.) + call MPI_Bcast(C_volAvgLastInc,81,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' call HDF5_closeGroup(groupHandle) call HDF5_closeFile(fileHandle) @@ -431,17 +443,17 @@ subroutine grid_mechanical_FEM_restartWrite fileHandle = HDF5_openFile(getSolverJobName()//'_restart.hdf5','w') groupHandle = HDF5_addGroup(fileHandle,'solver') - call HDF5_write(groupHandle,P_aim, 'P_aim') - call HDF5_write(groupHandle,F_aim, 'F_aim') - call HDF5_write(groupHandle,F_aim_lastInc,'F_aim_lastInc') - call HDF5_write(groupHandle,F_aimDot, 'F_aimDot') + call HDF5_write(groupHandle,P_aim, 'P_aim',.false.) + call HDF5_write(groupHandle,F_aim, 'F_aim',.false.) + call HDF5_write(groupHandle,F_aim_lastInc,'F_aim_lastInc',.false.) + call HDF5_write(groupHandle,F_aimDot, 'F_aimDot',.false.) call HDF5_write(groupHandle,F, 'F') call HDF5_write(groupHandle,F_lastInc, 'F_lastInc') call HDF5_write(groupHandle,u_current, 'u') call HDF5_write(groupHandle,u_lastInc, 'u_lastInc') - call HDF5_write(groupHandle,C_volAvg, 'C_volAvg') - call HDF5_write(groupHandle,C_volAvgLastInc,'C_volAvgLastInc') + call HDF5_write(groupHandle,C_volAvg, 'C_volAvg',.false.) + call HDF5_write(groupHandle,C_volAvgLastInc,'C_volAvgLastInc',.false.) call HDF5_closeGroup(groupHandle) call HDF5_closeFile(fileHandle) diff --git a/src/grid/grid_mech_spectral_basic.f90 b/src/grid/grid_mech_spectral_basic.f90 index e7690eb55..c8896e2eb 100644 --- a/src/grid/grid_mech_spectral_basic.f90 +++ b/src/grid/grid_mech_spectral_basic.f90 @@ -183,10 +183,18 @@ subroutine grid_mechanical_spectral_basic_init fileHandle = HDF5_openFile(getSolverJobName()//'_restart.hdf5','r') groupHandle = HDF5_openGroup(fileHandle,'solver') - call HDF5_read(groupHandle,P_aim, 'P_aim') - call HDF5_read(groupHandle,F_aim, 'F_aim') - call HDF5_read(groupHandle,F_aim_lastInc,'F_aim_lastInc') - call HDF5_read(groupHandle,F_aimDot, 'F_aimDot') + call HDF5_read(groupHandle,P_aim, 'P_aim',.false.) + call MPI_Bcast(P_aim,9,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' + call HDF5_read(groupHandle,F_aim, 'F_aim',.false.) + call MPI_Bcast(F_aim,9,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' + call HDF5_read(groupHandle,F_aim_lastInc,'F_aim_lastInc',.false.) + call MPI_Bcast(F_aim_lastInc,9,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' + call HDF5_read(groupHandle,F_aimDot, 'F_aimDot',.false.) + call MPI_Bcast(F_aimDot,9,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' call HDF5_read(groupHandle,F, 'F') call HDF5_read(groupHandle,F_lastInc, 'F_lastInc') @@ -204,8 +212,12 @@ subroutine grid_mechanical_spectral_basic_init restartRead2: if (interface_restartInc > 0) then print'(a,i0,a)', ' reading more restart data of increment ', interface_restartInc, ' from file' - call HDF5_read(groupHandle,C_volAvg, 'C_volAvg') - call HDF5_read(groupHandle,C_volAvgLastInc,'C_volAvgLastInc') + call HDF5_read(groupHandle,C_volAvg, 'C_volAvg',.false.) + call MPI_Bcast(C_volAvg,81,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' + call HDF5_read(groupHandle,C_volAvgLastInc,'C_volAvgLastInc',.false.) + call MPI_Bcast(C_volAvgLastInc,81,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' call HDF5_closeGroup(groupHandle) call HDF5_closeFile(fileHandle) @@ -370,16 +382,16 @@ subroutine grid_mechanical_spectral_basic_restartWrite fileHandle = HDF5_openFile(getSolverJobName()//'_restart.hdf5','w') groupHandle = HDF5_addGroup(fileHandle,'solver') - call HDF5_write(groupHandle,P_aim, 'P_aim') - call HDF5_write(groupHandle,F_aim, 'F_aim') - call HDF5_write(groupHandle,F_aim_lastInc,'F_aim_lastInc') - call HDF5_write(groupHandle,F_aimDot, 'F_aimDot') + call HDF5_write(groupHandle,P_aim, 'P_aim',.false.) + call HDF5_write(groupHandle,F_aim, 'F_aim',.false.) + call HDF5_write(groupHandle,F_aim_lastInc,'F_aim_lastInc',.false.) + call HDF5_write(groupHandle,F_aimDot, 'F_aimDot',.false.) call HDF5_write(groupHandle,F, 'F') call HDF5_write(groupHandle,F_lastInc, 'F_lastInc') - call HDF5_write(groupHandle,C_volAvg, 'C_volAvg') - call HDF5_write(groupHandle,C_volAvgLastInc,'C_volAvgLastInc') - call HDF5_write(groupHandle,C_minMaxAvg, 'C_minMaxAvg') + call HDF5_write(groupHandle,C_volAvg, 'C_volAvg',.false.) + call HDF5_write(groupHandle,C_volAvgLastInc,'C_volAvgLastInc',.false.) + call HDF5_write(groupHandle,C_minMaxAvg, 'C_minMaxAvg',.false.) call HDF5_closeGroup(groupHandle) call HDF5_closeFile(fileHandle) diff --git a/src/grid/grid_mech_spectral_polarisation.f90 b/src/grid/grid_mech_spectral_polarisation.f90 index 478df7fdf..5c26fc85c 100644 --- a/src/grid/grid_mech_spectral_polarisation.f90 +++ b/src/grid/grid_mech_spectral_polarisation.f90 @@ -205,10 +205,18 @@ subroutine grid_mechanical_spectral_polarisation_init fileHandle = HDF5_openFile(getSolverJobName()//'_restart.hdf5','r') groupHandle = HDF5_openGroup(fileHandle,'solver') - call HDF5_read(groupHandle,P_aim, 'P_aim') - call HDF5_read(groupHandle,F_aim, 'F_aim') - call HDF5_read(groupHandle,F_aim_lastInc,'F_aim_lastInc') - call HDF5_read(groupHandle,F_aimDot, 'F_aimDot') + call HDF5_read(groupHandle,P_aim, 'P_aim',.false.) + call MPI_Bcast(P_aim,9,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' + call HDF5_read(groupHandle,F_aim, 'F_aim',.false.) + call MPI_Bcast(F_aim,9,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' + call HDF5_read(groupHandle,F_aim_lastInc,'F_aim_lastInc',.false.) + call MPI_Bcast(F_aim_lastInc,9,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' + call HDF5_read(groupHandle,F_aimDot, 'F_aimDot',.false.) + call MPI_Bcast(F_aimDot,9,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' call HDF5_read(groupHandle,F, 'F') call HDF5_read(groupHandle,F_lastInc, 'F_lastInc') call HDF5_read(groupHandle,F_tau, 'F_tau') @@ -230,8 +238,12 @@ subroutine grid_mechanical_spectral_polarisation_init restartRead2: if (interface_restartInc > 0) then print'(a,i0,a)', ' reading more restart data of increment ', interface_restartInc, ' from file' - call HDF5_read(groupHandle,C_volAvg, 'C_volAvg') - call HDF5_read(groupHandle,C_volAvgLastInc,'C_volAvgLastInc') + call HDF5_read(groupHandle,C_volAvg, 'C_volAvg',.false.) + call MPI_Bcast(C_volAvg,81,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' + call HDF5_read(groupHandle,C_volAvgLastInc,'C_volAvgLastInc',.false.) + call MPI_Bcast(C_volAvgLastInc,81,MPI_DOUBLE,0,PETSC_COMM_WORLD,ierr) + if(ierr /=0) error stop 'MPI error' call HDF5_closeGroup(groupHandle) call HDF5_closeFile(fileHandle) @@ -426,17 +438,17 @@ subroutine grid_mechanical_spectral_polarisation_restartWrite fileHandle = HDF5_openFile(getSolverJobName()//'_restart.hdf5','w') groupHandle = HDF5_addGroup(fileHandle,'solver') - call HDF5_write(groupHandle,F_aim, 'P_aim') - call HDF5_write(groupHandle,F_aim, 'F_aim') - call HDF5_write(groupHandle,F_aim_lastInc,'F_aim_lastInc') - call HDF5_write(groupHandle,F_aimDot, 'F_aimDot') + call HDF5_write(groupHandle,F_aim, 'P_aim',.false.) + call HDF5_write(groupHandle,F_aim, 'F_aim',.false.) + call HDF5_write(groupHandle,F_aim_lastInc,'F_aim_lastInc',.false.) + call HDF5_write(groupHandle,F_aimDot, 'F_aimDot',.false.) call HDF5_write(groupHandle,F, 'F') call HDF5_write(groupHandle,F_lastInc, 'F_lastInc') call HDF5_write(groupHandle,F_tau, 'F_tau') call HDF5_write(groupHandle,F_tau_lastInc,'F_tau_lastInc') - call HDF5_write(groupHandle,C_volAvg, 'C_volAvg') - call HDF5_write(groupHandle,C_volAvgLastInc,'C_volAvgLastInc') + call HDF5_write(groupHandle,C_volAvg, 'C_volAvg',.false.) + call HDF5_write(groupHandle,C_volAvgLastInc,'C_volAvgLastInc',.false.) call HDF5_closeGroup(groupHandle) call HDF5_closeFile(fileHandle)