[cig-commits] [commit] devel: updates output format in create_movie_GMT_global.f90 to avoid cray compiler separator issues; rewrites if-elseif as select-case statement in write_seismograms() (a44a8e9)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Tue Sep 16 08:26:11 PDT 2014


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

On branch  : devel
Link       : https://github.com/geodynamics/specfem3d_globe/compare/0aa2df069164153a157cf61edc5ea1bce1e70644...6034d3445ce173fc6a0a1cfd5c31dfd2558a2eaf

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

commit a44a8e9b0d72a12d5961fd8e06a16ae00491839a
Author: daniel peter <peterda at ethz.ch>
Date:   Tue Sep 2 11:01:28 2014 +0200

    updates output format in create_movie_GMT_global.f90 to avoid cray compiler separator issues; rewrites if-elseif as select-case statement in write_seismograms()


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

a44a8e9b0d72a12d5961fd8e06a16ae00491839a
 src/auxiliaries/create_movie_GMT_global.f90 | 26 ++++++++++++++++++--------
 src/specfem3D/write_seismograms.f90         | 13 +++++++------
 2 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/src/auxiliaries/create_movie_GMT_global.f90 b/src/auxiliaries/create_movie_GMT_global.f90
index 1095e6a..046e29e 100644
--- a/src/auxiliaries/create_movie_GMT_global.f90
+++ b/src/auxiliaries/create_movie_GMT_global.f90
@@ -825,9 +825,14 @@
        write(outputname,"('/bin_movie_',i6.6,'.E')") it
       endif
       open(unit=11,file=trim(OUTPUT_FILES)//trim(outputname),status='unknown', &
-            form='unformatted',action='write')
-      if (iframe == 1) open(unit=12,file=trim(OUTPUT_FILES)//'/bin_movie.xy', &
-                          status='unknown',form='unformatted',action='write')
+            form='unformatted',action='write',iostat=ierror)
+      if (ierror /= 0) stop 'Error opening bin_movie file'
+
+      if (iframe == 1) then
+        open(unit=12,file=trim(OUTPUT_FILES)//'/bin_movie.xy',status='unknown', &
+            form='unformatted',action='write',iostat=ierror)
+        if (ierror /= 0) stop 'Error opening bin_movie.xy file'
+      endif
     else
       if (USE_COMPONENT == 1) then
        write(outputname,"('/ascii_movie_',i6.6,'.d')") it
@@ -837,9 +842,14 @@
        write(outputname,"('/ascii_movie_',i6.6,'.E')") it
       endif
       open(unit=11,file=trim(OUTPUT_FILES)//trim(outputname),status='unknown', &
-            action='write')
-      if (iframe == 1) open(unit=12,file=trim(OUTPUT_FILES)//'/ascii_movie.xy', &
-                            status='unknown',action='write')
+            action='write',iostat=ierror)
+      if (ierror /= 0) stop 'Error opening ascii_movie file'
+
+      if (iframe == 1) then
+        open(unit=12,file=trim(OUTPUT_FILES)//'/ascii_movie.xy',status='unknown', &
+            action='write',iostat=ierror)
+        if (ierror /= 0) stop 'Error opening ascii_movie.xy file'
+      endif
     endif
     ! clear number of elements kept
     ispec = 0
@@ -889,13 +899,13 @@
             ! displacement
             disp = sngl(field_display(ieoff))
 
-            ! writes displacement and latitude/longitude to corresponding files
+            ! writes displacement and longitude/latitude to corresponding files
             if (OUTPUT_BINARY) then
               write(11) disp
               if (iframe == 1) write(12) long,lat
             else
               write(11,*) disp
-              if (iframe == 1) write(12,*) long,lat
+              if (iframe == 1) write(12,'(2f18.6)') long,lat
             endif
 
           enddo !i
diff --git a/src/specfem3D/write_seismograms.f90 b/src/specfem3D/write_seismograms.f90
index bb42779..1795447 100644
--- a/src/specfem3D/write_seismograms.f90
+++ b/src/specfem3D/write_seismograms.f90
@@ -91,8 +91,9 @@ contains
   if (seismo_current == NTSTEP_BETWEEN_OUTPUT_SEISMOS .or. it == it_end) then
 
     ! writes out seismogram files
-    if (SIMULATION_TYPE == 1 .or. SIMULATION_TYPE == 3) then
-
+    select case( SIMULATION_TYPE )
+    case( 1,3 )
+      ! forward/reconstructed wavefields
       call write_seismograms_to_file()
 
       ! user output
@@ -102,11 +103,11 @@ contains
         write(IMAIN,*)
         call flush_IMAIN()
       endif
-    else if (SIMULATION_TYPE == 2) then
-      if (nrec_local > 0 ) &
-        call write_adj_seismograms(nit_written)
+    case( 2 )
+      ! adjoint wavefield
+      if (nrec_local > 0 ) call write_adj_seismograms(nit_written)
       nit_written = it
-    endif
+    end select
 
     ! resets current seismogram position
     seismo_offset = seismo_offset + seismo_current



More information about the CIG-COMMITS mailing list