Skip to content

Commit

Permalink
Merge branch 'fix.variable.external.field.info' into 'master.dev'
Browse files Browse the repository at this point in the history
[fix.variable.external.field.info] Fixed error in "Read external field ..." output. Use correct index of variable in 2D mode.

See merge request piclas/piclas!662
  • Loading branch information
pnizenkov committed Jul 13, 2022
2 parents 58b1648 + 4a06a6d commit 157d61b
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/io_hdf5/hdf5_input_field.f90
Original file line number Diff line number Diff line change
Expand Up @@ -186,20 +186,19 @@ SUBROUTINE ReadVariableExternalFieldFromHDF5()
END DO ! iDir = 1, iDirMax

! Sanity check
IF(VariableExternalFieldDim.EQ.2)THEN
IF(MINVAL(DeltaExternalField(1:2)).LT.0.) CALL abort(__STAMP__,'Failed to calculate the deltas for variable external field.')
! z-dir: VariableExternalFieldN(1)
! r-dir: VariableExternalFieldN(2)
IF(NbrOfColumns.NE.VariableExternalFieldN(1)*VariableExternalFieldN(2)) CALL abort(__STAMP__,'Wrong number of points in 2D')
SWRITE (UNIT_stdOut,'(A,2(I0,A))') " Read external field with ",VariableExternalFieldN(3)," x ",VariableExternalFieldN(1),&
" data points"
ELSE
IF(MINVAL(DeltaExternalField).LT.0.) CALL abort(__STAMP__,'Failed to calculate the deltas for variable external field.')
IF(NbrOfColumns.NE.VariableExternalFieldN(1)*VariableExternalFieldN(2)*VariableExternalFieldN(3)) CALL abort(__STAMP__,&
'Wrong number of points in 3D')
SWRITE (UNIT_stdOut,'(A,3(I0,A))') " Read external field with ",VariableExternalFieldN(1)," x ",VariableExternalFieldN(2)," x ",&
VariableExternalFieldN(3)," data points"
END IF ! VariableExternalFieldDim.EQ.2
ASSOCIATE( x => VariableExternalFieldN(1:3) )
IF(VariableExternalFieldDim.EQ.2)THEN
IF(MINVAL(DeltaExternalField(1:2)).LT.0.) CALL abort(__STAMP__,'Failed to calculate the deltas for variable external field.')
! z-dir: x(1)
! r-dir: x(2)
IF(NbrOfColumns.NE.x(1)*x(2)) CALL abort(__STAMP__,'Wrong number of points in 2D')
SWRITE (UNIT_stdOut,'(A,2(I0,A))') " Read external field with ",x(1)," x ",x(2)," data points"
ELSE
IF(MINVAL(DeltaExternalField).LT.0.) CALL abort(__STAMP__,'Failed to calculate the deltas for variable external field.')
IF(NbrOfColumns.NE.x(1)*x(2)*x(3)) CALL abort(__STAMP__,'Wrong number of points in 3D')
SWRITE (UNIT_stdOut,'(A,3(I0,A))') " Read external field with ",x(1)," x ",x(2)," x ",x(3)," data points"
END IF ! VariableExternalFieldDim.EQ.2
END ASSOCIATE

!WRITE (*,*) " =", VariableExternalFieldMin
!WRITE (*,*) " =", VariableExternalFieldMax
Expand Down

0 comments on commit 157d61b

Please sign in to comment.