[cig-commits] [commit] devel: Open IMAIN earlier in solver. (1aed3e6)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Mon Dec 8 18:11:56 PST 2014


Repository : https://github.com/geodynamics/specfem3d_globe

On branch  : devel
Link       : https://github.com/geodynamics/specfem3d_globe/compare/1c27735ab9cfb372cfbb37cfe2b86957d42b90da...49b9f654e6048d837b88aabb71cfc1227571e844

>---------------------------------------------------------------

commit 1aed3e62fc82e6737851ed29a1c94318a71edfd4
Author: Elliott Sales de Andrade <esalesde at physics.utoronto.ca>
Date:   Mon Dec 8 20:14:48 2014 -0500

    Open IMAIN earlier in solver.
    
    This allows any messages printed in the parameter-loader to go to the
    correct file.


>---------------------------------------------------------------

1aed3e62fc82e6737851ed29a1c94318a71edfd4
 src/specfem3D/initialize_simulation.f90 | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/src/specfem3D/initialize_simulation.f90 b/src/specfem3D/initialize_simulation.f90
index 584ce83..138bbf7 100644
--- a/src/specfem3D/initialize_simulation.f90
+++ b/src/specfem3D/initialize_simulation.f90
@@ -45,6 +45,22 @@
   call world_size(sizeprocs)
   call world_rank(myrank)
 
+  ! open main output file, only written to by process 0
+  if (myrank == 0) then
+    if (IMAIN /= ISTANDARD_OUTPUT) then
+      open(unit=IMAIN,file=trim(OUTPUT_FILES)//'/output_solver.txt',status='unknown',action='write',iostat=ier)
+      if (ier /= 0 ) call exit_MPI(myrank,'Error opening file output_solver.txt for writing output info')
+    endif
+
+    write(IMAIN,*)
+    write(IMAIN,*) '******************************'
+    write(IMAIN,*) '**** Specfem3D MPI Solver ****'
+    write(IMAIN,*) '******************************'
+    write(IMAIN,*)
+    write(IMAIN,*)
+    call flush_IMAIN()
+  endif
+
 !! DK DK for Roland_Sylvain
   if (ROLAND_SYLVAIN) call exit_MPI(myrank,'no need to run the solver to compute Roland_Sylvain integrals, only the mesher')
 
@@ -78,21 +94,8 @@
   ! See world split -> parallel.f90
   ! OUTPUT_FILES = 'OUTPUT_FILES'
 
-  ! open main output file, only written to by process 0
-  if (myrank == 0 .and. IMAIN /= ISTANDARD_OUTPUT) then
-    open(unit=IMAIN,file=trim(OUTPUT_FILES)//'/output_solver.txt',status='unknown',action='write',iostat=ier)
-    if (ier /= 0 ) call exit_MPI(myrank,'Error opening file output_solver.txt for writing output info')
-  endif
-
   if (myrank == 0) then
 
-    write(IMAIN,*)
-    write(IMAIN,*) '******************************'
-    write(IMAIN,*) '**** Specfem3D MPI Solver ****'
-    write(IMAIN,*) '******************************'
-    write(IMAIN,*)
-    write(IMAIN,*)
-
     if (FIX_UNDERFLOW_PROBLEM) write(IMAIN,*) 'Fixing slow underflow trapping problem using small initial field'
 
     write(IMAIN,*)



More information about the CIG-COMMITS mailing list