Skip to content

Commit 301462d

Browse files
committed
Completed transition to stdout%print.
1 parent 6b7f383 commit 301462d

File tree

4 files changed

+37
-27
lines changed

4 files changed

+37
-27
lines changed

src/IO/Spherical_IO.F90

+35-23
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,7 @@ Subroutine Initialize_Diagnostic_Info(self,computes,mpi_tag, &
849849
Integer :: avg_axes(1:3), ecode
850850
Integer, Allocatable :: indices(:,:)
851851
Real*8, Allocatable :: avg_weights(:,:)
852+
Character*8 :: cache_str, rec_str
852853
Class(DiagnosticInfo) :: self
853854

854855
nonstandard=.false.
@@ -892,19 +893,21 @@ Subroutine Initialize_Diagnostic_Info(self,computes,mpi_tag, &
892893

893894

894895
!Check that the cache size is appropriate
896+
Write(cache_str,'(i8)')self%cache_size
897+
Write(rec_str,'(i8)')self%rec_per_file
895898
If (present(cache_size)) Then
896899
If (cache_size .ge. 1) Then
897900
self%cache_size = cache_size
898901
Endif
899902
Endif
900903
If (self%cache_size .lt. 1) Then
901904
If (myid .eq. 0) Then
902-
Write(6,*)'////////////////////////////////////////////////////////////////////'
903-
Write(6,*)' Warning: Incorrect cache_size specification for ',self%file_prefix
904-
Write(6,*)' Cache_size must be at least 1.'
905-
Write(6,*)' Specified cache_size: ', self%cache_size
906-
Write(6,*)' Caching has been deactivated for ', self%file_prefix
907-
Write(6,*)'////////////////////////////////////////////////////////////////////'
905+
Call stdout%print('////////////////////////////////////////////////////////////////////')
906+
Call stdout%print(' Warning: Incorrect cache_size specification for '//TRIM(ADJUSTL(self%file_prefix)))
907+
Call stdout%print(' Cache_size must be at least 1.')
908+
Call stdout%print(' Specified cache_size: '//TRIM(ADJUSTL(cache_str)) )
909+
Call stdout%print(' Caching has been deactivated for '//TRIM(ADJUSTL(self%file_prefix)) )
910+
Call stdout%print('////////////////////////////////////////////////////////////////////')
908911
Endif
909912
self%cache_size = 1
910913
Endif
@@ -913,13 +916,13 @@ Subroutine Initialize_Diagnostic_Info(self,computes,mpi_tag, &
913916
If (modcheck .ne. 0) Then
914917

915918
If (myid .eq. 0) Then
916-
Write(6,*)'////////////////////////////////////////////////////////////////////'
917-
Write(6,*)' Warning: Incorrect cache_size specification for ',self%file_prefix
918-
Write(6,*)' Cache_size cannot be larger than nrec.'
919-
Write(6,*)' Cache_size: ', self%cache_size
920-
Write(6,*)' nrec : ', self%rec_per_file
921-
Write(6,*)' Cache_size has been set to nrec.'
922-
Write(6,*)'////////////////////////////////////////////////////////////////////'
919+
Call stdout%print('////////////////////////////////////////////////////////////////////')
920+
Call stdout%print(' Warning: Incorrect cache_size specification for '//TRIM(ADJUSTL(self%file_prefix)) )
921+
Call stdout%print(' Cache_size cannot be larger than nrec.')
922+
Call stdout%print(' Cache_size: '//TRIM(ADJUSTL(cache_str)))
923+
Call stdout%print(' nrec : '//TRIM(ADJUSTL(rec_str)))
924+
Call stdout%print(' Cache_size has been set to nrec.')
925+
Call stdout%print('////////////////////////////////////////////////////////////////////')
923926
Endif
924927
self%cache_size = self%rec_per_file
925928
Endif
@@ -930,13 +933,13 @@ Subroutine Initialize_Diagnostic_Info(self,computes,mpi_tag, &
930933
If (modcheck .ne. 0) Then
931934

932935
If (myid .eq. 0) Then
933-
Write(6,*)'////////////////////////////////////////////////////////////////////'
934-
Write(6,*)' Warning: Incorrect cache_size specification for ',self%file_prefix
935-
Write(6,*)' Cache_size must divide evenly into nrec.'
936-
Write(6,*)' Cache_size: ', self%cache_size
937-
Write(6,*)' nrec : ', self%rec_per_file
938-
Write(6,*)' Caching has been deactivated for ', self%file_prefix
939-
Write(6,*)'////////////////////////////////////////////////////////////////////'
936+
Call stdout%print('////////////////////////////////////////////////////////////////////')
937+
Call stdout%print(' Warning: Incorrect cache_size specification for '//TRIM(ADJUSTL(self%file_prefix)) )
938+
Call stdout%print(' Cache_size must divide evenly into nrec.')
939+
Call stdout%print(' Cache_size: '//TRIM(ADJUSTL(cache_str)))
940+
Call stdout%print(' nrec : '//TRIM(ADJUSTL(rec_str)))
941+
Call stdout%print(' Caching has been deactivated for '//TRIM(ADJUSTL(self%file_prefix)) )
942+
Call stdout%print('////////////////////////////////////////////////////////////////////')
940943
Endif
941944
self%cache_size = 1
942945
Endif
@@ -1295,13 +1298,18 @@ Subroutine CloseFile_Par(self)
12951298
Implicit None
12961299
integer :: ierr, buffsize
12971300
integer(kind=MPI_OFFSET_KIND) :: disp
1301+
Character*8 :: err_str, id_str
12981302
!Parallel File Close
12991303
!Peforms the same task as closefile, but using MPI-IO
13001304
Class(DiagnosticInfo) :: self
13011305
disp = 8
13021306
Call MPI_File_Seek(self%file_unit,disp,MPI_SEEK_SET,ierr)
1307+
13031308
If (ierr .ne. 0) Then
1304-
Write(6,*)'Error rewinding to header. Error code: ', ierr, myid, self%file_prefix
1309+
Write(err_str,'(i8)')ierr
1310+
Write(id_str,'(i8)')myid
1311+
Call stdout%print('Error rewinding to header. Error code: '//TRIM(err_str)//','//TRIM(id_str)//self%file_prefix)
1312+
13051313
Endif
13061314
! Without this barrier, the record update below can occurs before some ranks
13071315
! have read the original record count (leading to oversized, corrupted files).
@@ -1312,10 +1320,14 @@ Subroutine CloseFile_Par(self)
13121320

13131321
call MPI_FILE_WRITE(self%file_unit,self%current_rec , buffsize, MPI_INTEGER, &
13141322
MPI_STATUS_IGNORE, ierr)
1315-
If (ierr .ne. 0) Write(6,*)'Error writing to header. Error code: ', ierr, myid, self%file_prefix
1323+
If (ierr .ne. 0) Then
1324+
Call stdout%print('Error writing to header. Error code: '//TRIM(err_str)//','//TRIM(id_str)//self%file_prefix)
1325+
Endif
13161326
Endif
13171327
Call MPI_FILE_CLOSE(self%file_unit, ierr)
1318-
If (ierr .ne. 0) Write(6,*)'Error closing file. Error code: ',ierr, myid, self%file_prefix
1328+
If (ierr .ne. 0) Then
1329+
Call stdout%print('Error closing file. Error code: '//TRIM(err_str)//','//TRIM(id_str)//self%file_prefix)
1330+
Endif
13191331
End Subroutine CloseFile_Par
13201332

13211333
Subroutine getq_now(self,yesno)

src/Makefile.fdeps

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Sphere_Hybrid_Space.o : Sphere_Hybrid_Space.F90 indices.F PDE_Coefficients.o Clo
6868
Sphere_Linear_Terms.o : Sphere_Linear_Terms.F90 Math_Constants.o PDE_Coefficients.o ClockInfo.o Timers.o BoundaryConditions.o Fields.o Linear_Solve.o ProblemSize.o Controls.o Load_Balance.o
6969
Sphere_Physical_Space.o : Sphere_Physical_Space.F90 indices.F Benchmarking.o Math_Constants.o PDE_Coefficients.o ClockInfo.o Timers.o General_MPI.o Diagnostics_Interface.o Fields.o Spectral_Derivatives.o Fourier_Transform.o ProblemSize.o Controls.o Parallel_Framework.o
7070
Sphere_Spectral_Space.o : Sphere_Spectral_Space.F90 Sphere_Linear_Terms.o Timers.o ClockInfo.o BoundaryConditions.o Fields.o Linear_Solve.o Finite_Difference.o ProblemSize.o Controls.o Parallel_Framework.o Load_Balance.o
71-
Spherical_Buffer.o : Spherical_Buffer.F90 Timers.o General_MPI.o Load_Balance.o Structures.o Parallel_Framework.o MPI_LAYER.o
71+
Spherical_Buffer.o : Spherical_Buffer.F90 BufferedOutput.o Timers.o General_MPI.o Load_Balance.o Structures.o Parallel_Framework.o MPI_LAYER.o
7272
Spherical_IO.o : Spherical_IO.F90 Ra_MPI_Base.o Parallel_IO.o MakeDir.o Math_Constants.o BufferedOutput.o Legendre_Transforms.o Fourier_Transform.o General_MPI.o ISendReceive.o SendReceive.o Parallel_Framework.o Spherical_Buffer.o
7373
Structures.o : Structures.F90
7474
TestSuite.o : TestSuite.F90 ProblemSize.o Test_Cheby.o Test_SHT.o

src/Parallel_Framework/MPI_LAYER.F90

-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ Subroutine RowColSplit(grp,rgrp,cgrp,nprow, err)
9595
Call mpi_comm_size(cgrp%comm, cgrp%np, err)
9696
Call mpi_comm_rank(cgrp%comm, cgrp%rank, err)
9797

98-
If (cgrp%rank .ne. col_rank) Write(6,*)'Error - ', cgrp%rank, col_rank
99-
If (rgrp%rank .ne. row_rank) Write(6,*)'Error - ', rgrp%rank, row_rank
10098
End Subroutine RowColSplit
10199

102100
Subroutine Exit_Comm_Lib(err)

src/Parallel_Framework/Parallel_Framework.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ Subroutine Spherical_Init(self)
301301
Allocate(self%all_3s(0:self%nprow-1))
302302
Call Standard_Balance(self%all_3s,self%n3s,self%rcomm)
303303
self%my_3s = self%all_3s(self%rcomm%rank)
304-
!Write(6,*), self%my_3s%min, self%my_3s%max,self%rcomm%rank, self%my_3s%delta
304+
305305
! We assume a high-low pairing of m-values.
306306
! This means that we need to set up an index array
307307
! for the m-values that tells how many each processor has.

0 commit comments

Comments
 (0)