[cig-commits] r12541 - seismo/3D/SPECFEM3D_GLOBE/trunk

dkomati1 at geodynamics.org dkomati1 at geodynamics.org
Wed Aug 6 05:01:47 PDT 2008


Author: dkomati1
Date: 2008-08-06 05:01:47 -0700 (Wed, 06 Aug 2008)
New Revision: 12541

Modified:
   seismo/3D/SPECFEM3D_GLOBE/trunk/get_absorb.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/save_arrays_solver.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/specfem3D.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/write_seismograms.f90
Log:
added action='read' or action='write' to open() statements


Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/get_absorb.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/get_absorb.f90	2008-08-06 10:45:29 UTC (rev 12540)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/get_absorb.f90	2008-08-06 12:01:47 UTC (rev 12541)
@@ -131,8 +131,7 @@
     call exit_MPI(myrank,'ispecb5 should equal NSPEC2D_BOTTOM in absorbing boundary detection')
 
 ! save these temporary arrays for the solver for Stacey conditions
-
-      open(unit=27,file=prname(1:len_trim(prname))//'stacey.bin',status='unknown',form='unformatted')
+      open(unit=27,file=prname(1:len_trim(prname))//'stacey.bin',status='unknown',form='unformatted',action='write')
       write(27) nimin
       write(27) nimax
       write(27) njmin

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/save_arrays_solver.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/save_arrays_solver.f90	2008-08-06 10:45:29 UTC (rev 12540)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/save_arrays_solver.f90	2008-08-06 12:01:47 UTC (rev 12541)
@@ -159,7 +159,7 @@
   integer iregion_code
 
 ! save nspec and nglob, to be used in combine_paraview_data
-  open(unit=27,file=prname(1:len_trim(prname))//'array_dims.txt',status='unknown')
+  open(unit=27,file=prname(1:len_trim(prname))//'array_dims.txt',status='unknown',action='write')
   if (NCHUNKS == 6 .and. ichunk /= CHUNK_AB .and. iregion_code == IREGION_INNER_CORE) then
      nspec1 = nspec - (NEX_PER_PROC_XI/16) * (NEX_PER_PROC_ETA/16) * (NEX_XI/16)
      nglob1 = nglob -   ((NEX_PER_PROC_XI/16)*(NGLLX-1)+1) * ((NEX_PER_PROC_ETA/16)*(NGLLY-1)+1) &
@@ -172,7 +172,7 @@
   write(27,*) nglob1
   close(27)
 
-  open(unit=27,file=prname(1:len_trim(prname))//'solver_data_1.bin',status='unknown',form='unformatted')
+  open(unit=27,file=prname(1:len_trim(prname))//'solver_data_1.bin',status='unknown',form='unformatted',action='write')
 
   write(27) xixstore
   write(27) xiystore
@@ -188,8 +188,7 @@
   write(27) kappavstore
 
   if(HETEROGEN_3D_MANTLE) then
-     open(unit=29,file=prname(1:len_trim(prname))//'dvp.bin'&
-         ,status='unknown',form='unformatted')
+     open(unit=29,file=prname(1:len_trim(prname))//'dvp.bin',status='unknown',form='unformatted',action='write')
      write(29) dvpstore
      close(29)
   endif
@@ -263,7 +262,7 @@
 
   close(27)
 
-  open(unit=27,file=prname(1:len_trim(prname))//'solver_data_2.bin',status='unknown',form='unformatted')
+  open(unit=27,file=prname(1:len_trim(prname))//'solver_data_2.bin',status='unknown',form='unformatted',action='write')
 ! mesh arrays used in the solver to locate source and receivers
 ! and for anisotropy and gravity, save in single precision
 ! use rmass for temporary storage to perform conversion, since already saved
@@ -333,9 +332,8 @@
   close(27)
 
 ! boundary parameters
+  open(unit=27,file=prname(1:len_trim(prname))//'boundary.bin',status='unknown',form='unformatted',action='write')
 
-  open(unit=27,file=prname(1:len_trim(prname))//'boundary.bin',status='unknown',form='unformatted')
-
   write(27) nspec2D_xmin
   write(27) nspec2D_xmax
   write(27) nspec2D_ymin
@@ -367,7 +365,7 @@
   close(27)
 
   if(ATTENUATION .and. ATTENUATION_3D) then
-     open(unit=27, file=prname(1:len_trim(prname))//'attenuation3D.bin', status='unknown', form='unformatted')
+     open(unit=27, file=prname(1:len_trim(prname))//'attenuation3D.bin', status='unknown', form='unformatted',action='write')
      write(27) tau_s
      write(27) tau_e_store
      write(27) Qmu_store

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/specfem3D.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/specfem3D.f90	2008-08-06 10:45:29 UTC (rev 12540)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/specfem3D.f90	2008-08-06 12:01:47 UTC (rev 12541)
@@ -1094,7 +1094,7 @@
 
 ! open main output file, only written to by process 0
   if(myrank == 0 .and. IMAIN /= ISTANDARD_OUTPUT) &
-    open(unit=IMAIN,file=trim(OUTPUT_FILES)//'/output_solver.txt',status='unknown')
+    open(unit=IMAIN,file=trim(OUTPUT_FILES)//'/output_solver.txt',status='unknown',action='write')
 
   if(myrank == 0) then
 
@@ -1609,7 +1609,7 @@
   call create_name_database(prname,myrank,IREGION_CRUST_MANTLE,LOCAL_PATH)
 
 ! Stacey put back
-  open(unit=27,file=prname(1:len_trim(prname))//'boundary.bin',status='unknown',form='unformatted')
+  open(unit=27,file=prname(1:len_trim(prname))//'boundary.bin',status='unknown',form='unformatted',action='read')
   read(27) nspec2D_xmin_crust_mantle
   read(27) nspec2D_xmax_crust_mantle
   read(27) nspec2D_ymin_crust_mantle
@@ -1643,7 +1643,7 @@
 ! read arrays for Stacey conditions
 
   if(ABSORBING_CONDITIONS) then
-      open(unit=27,file=prname(1:len_trim(prname))//'stacey.bin',status='unknown',form='unformatted')
+      open(unit=27,file=prname(1:len_trim(prname))//'stacey.bin',status='unknown',form='unformatted',action='read')
       read(27) nimin_crust_mantle
       read(27) nimax_crust_mantle
       read(27) njmin_crust_mantle
@@ -1739,7 +1739,7 @@
 ! boundary parameters
 
 ! Stacey put back
-  open(unit=27,file=prname(1:len_trim(prname))//'boundary.bin',status='unknown',form='unformatted')
+  open(unit=27,file=prname(1:len_trim(prname))//'boundary.bin',status='unknown',form='unformatted',action='read')
   read(27) nspec2D_xmin_outer_core
   read(27) nspec2D_xmax_outer_core
   read(27) nspec2D_ymin_outer_core
@@ -1772,7 +1772,7 @@
 ! read arrays for Stacey conditions
 
   if(ABSORBING_CONDITIONS) then
-      open(unit=27,file=prname(1:len_trim(prname))//'stacey.bin',status='unknown',form='unformatted')
+      open(unit=27,file=prname(1:len_trim(prname))//'stacey.bin',status='unknown',form='unformatted',action='read')
       read(27) nimin_outer_core
       read(27) nimax_outer_core
       read(27) njmin_outer_core
@@ -2849,7 +2849,7 @@
 
 ! create an empty file to monitor the start of the simulation
   if(myrank == 0) then
-    open(unit=IOUT,file=trim(OUTPUT_FILES)//'/starttimeloop.txt',status='unknown')
+    open(unit=IOUT,file=trim(OUTPUT_FILES)//'/starttimeloop.txt',status='unknown',action='write')
     write(IOUT,*) 'hello, starting time loop'
     close(IOUT)
   endif
@@ -3082,7 +3082,7 @@
 ! write time stamp file to give information about progression of simulation
       write(outputname,"('/timestamp',i6.6)") it
 
-      open(unit=IOUT,file=trim(OUTPUT_FILES)//outputname,status='unknown')
+      open(unit=IOUT,file=trim(OUTPUT_FILES)//outputname,status='unknown',action='write')
 
       write(IOUT,*) 'Time step # ',it
       write(IOUT,*) 'Time: ',sngl(((it-1)*DT-t0)/60.d0),' minutes'
@@ -4891,7 +4891,7 @@
 ! save movie data to disk in home directory
     if(myrank == 0) then
       write(outputname,"('/moviedata',i6.6)") it
-      open(unit=IOUT,file=trim(OUTPUT_FILES)//outputname,status='unknown',form='unformatted')
+      open(unit=IOUT,file=trim(OUTPUT_FILES)//outputname,status='unknown',form='unformatted',action='write')
       write(IOUT) store_val_x_all
       write(IOUT) store_val_y_all
       write(IOUT) store_val_z_all
@@ -4948,7 +4948,7 @@
 ! save files to local disk or tape system if restart file
   if(NUMBER_OF_RUNS > 1 .and. NUMBER_OF_THIS_RUN < NUMBER_OF_RUNS) then
     write(outputname,"('dump_all_arrays',i6.6)") myrank
-    open(unit=55,file=trim(LOCAL_PATH)//'/'//outputname,status='unknown',form='unformatted')
+    open(unit=55,file=trim(LOCAL_PATH)//'/'//outputname,status='unknown',form='unformatted',action='write')
     write(55) displ_crust_mantle
     write(55) veloc_crust_mantle
     write(55) accel_crust_mantle
@@ -4970,7 +4970,7 @@
 ! save last frame of the forward simulation
   if (SIMULATION_TYPE == 1 .and. SAVE_FORWARD) then
     write(outputname,'(a,i6.6,a)') 'proc',myrank,'_save_forward_arrays.bin'
-    open(unit=55,file=trim(LOCAL_PATH)//'/'//outputname,status='unknown',form='unformatted')
+    open(unit=55,file=trim(LOCAL_PATH)//'/'//outputname,status='unknown',form='unformatted',action='write')
     write(55) displ_crust_mantle
     write(55) veloc_crust_mantle
     write(55) accel_crust_mantle
@@ -5044,22 +5044,22 @@
 ! For anisotropic kernels
     if (ANISOTROPIC_KL) then
 
-      open(unit=27,file=trim(prname)//'rho_kernel.bin',status='unknown',form='unformatted')
+      open(unit=27,file=trim(prname)//'rho_kernel.bin',status='unknown',form='unformatted',action='write')
       write(27) -rho_kl_crust_mantle
       close(27)
-      open(unit=27,file=trim(prname)//'cijkl_kernel.bin',status='unknown',form='unformatted')
+      open(unit=27,file=trim(prname)//'cijkl_kernel.bin',status='unknown',form='unformatted',action='write')
       write(27) -cijkl_kl_crust_mantle
       close(27)
 
     else
 
-      open(unit=27,file=trim(prname)//'rho_kernel.bin',status='unknown',form='unformatted')
+      open(unit=27,file=trim(prname)//'rho_kernel.bin',status='unknown',form='unformatted',action='write')
       write(27) rho_kl_crust_mantle
       close(27)
-      open(unit=27,file=trim(prname)//'alpha_kernel.bin',status='unknown',form='unformatted')
+      open(unit=27,file=trim(prname)//'alpha_kernel.bin',status='unknown',form='unformatted',action='write')
       write(27) alpha_kl_crust_mantle
       close(27)
-      open(unit=27,file=trim(prname)//'beta_kernel.bin',status='unknown',form='unformatted')
+      open(unit=27,file=trim(prname)//'beta_kernel.bin',status='unknown',form='unformatted',action='write')
       write(27) beta_kl_crust_mantle
       close(27)
 
@@ -5082,10 +5082,10 @@
     enddo
 
     call create_name_database(prname,myrank,IREGION_OUTER_CORE,LOCAL_PATH)
-    open(unit=27,file=trim(prname)//'rho_kernel.bin',status='unknown',form='unformatted')
+    open(unit=27,file=trim(prname)//'rho_kernel.bin',status='unknown',form='unformatted',action='write')
     write(27) rho_kl_outer_core
     close(27)
-    open(unit=27,file=trim(prname)//'alpha_kernel.bin',status='unknown',form='unformatted')
+    open(unit=27,file=trim(prname)//'alpha_kernel.bin',status='unknown',form='unformatted',action='write')
     write(27) alpha_kl_outer_core
     close(27)
 
@@ -5109,13 +5109,13 @@
     enddo
 
     call create_name_database(prname,myrank,IREGION_INNER_CORE,LOCAL_PATH)
-    open(unit=27,file=trim(prname)//'rho_kernel.bin',status='unknown',form='unformatted')
+    open(unit=27,file=trim(prname)//'rho_kernel.bin',status='unknown',form='unformatted',action='write')
     write(27) rho_kl_inner_core
     close(27)
-    open(unit=27,file=trim(prname)//'alpha_kernel.bin',status='unknown',form='unformatted')
+    open(unit=27,file=trim(prname)//'alpha_kernel.bin',status='unknown',form='unformatted',action='write')
     write(27) alpha_kl_inner_core
     close(27)
-    open(unit=27,file=trim(prname)//'beta_kernel.bin',status='unknown',form='unformatted')
+    open(unit=27,file=trim(prname)//'beta_kernel.bin',status='unknown',form='unformatted',action='write')
     write(27) beta_kl_inner_core
     close(27)
 
@@ -5131,21 +5131,21 @@
 
       call create_name_database(prname,myrank,IREGION_CRUST_MANTLE,LOCAL_PATH)
       if (.not. SUPPRESS_CRUSTAL_MESH .and. HONOR_1D_SPHERICAL_MOHO) then
-      open(unit=27,file=trim(prname)//'moho_kernel.bin',status='unknown',form='unformatted')
+      open(unit=27,file=trim(prname)//'moho_kernel.bin',status='unknown',form='unformatted',action='write')
       write(27) moho_kl
       close(27)
       endif
-      open(unit=27,file=trim(prname)//'d400_kernel.bin',status='unknown',form='unformatted')
+      open(unit=27,file=trim(prname)//'d400_kernel.bin',status='unknown',form='unformatted',action='write')
       write(27) d400_kl
       close(27)
-      open(unit=27,file=trim(prname)//'d670_kernel.bin',status='unknown',form='unformatted')
+      open(unit=27,file=trim(prname)//'d670_kernel.bin',status='unknown',form='unformatted',action='write')
       write(27) d670_kl
       close(27)
-      open(unit=27,file=trim(prname)//'CMB_kernel.bin',status='unknown',form='unformatted')
+      open(unit=27,file=trim(prname)//'CMB_kernel.bin',status='unknown',form='unformatted',action='write')
       write(27) cmb_kl
       close(27)
       call create_name_database(prname,myrank,IREGION_OUTER_CORE,LOCAL_PATH)
-      open(unit=27,file=trim(prname)//'ICB_kernel.bin',status='unknown',form='unformatted')
+      open(unit=27,file=trim(prname)//'ICB_kernel.bin',status='unknown',form='unformatted',action='write')
       write(27) icb_kl
       close(27)
     endif
@@ -5164,7 +5164,7 @@
                  transpose(nu_source(:,:,irec))) * scale_t ** 3 / scale_mass
 
       write(outputname,'(a,i5.5)') 'OUTPUT_FILES/src_frechet.',number_receiver_global(irec_local)
-      open(unit=27,file=trim(outputname),status='unknown')
+      open(unit=27,file=trim(outputname),status='unknown',action='write')
 !
 ! r -> z, theta -> -n, phi -> e, plus factor 2 for Mrt,Mrp,Mtp, and 1e-7 to dyne.cm
 !  Mrr =  Mzz

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/write_seismograms.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/write_seismograms.f90	2008-08-06 10:45:29 UTC (rev 12540)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/write_seismograms.f90	2008-08-06 12:01:47 UTC (rev 12541)
@@ -112,17 +112,17 @@
 
       if(USE_BINARY_FOR_LARGE_FILE) then
         if (seismo_offset==0) then
-          open(unit=IOUT,file=trim(OUTPUT_FILES)//trim(sisname)//'.bin',status='unknown',form='unformatted')
+          open(unit=IOUT,file=trim(OUTPUT_FILES)//trim(sisname)//'.bin',status='unknown',form='unformatted',action='write')
         else
           open(unit=IOUT,file=trim(OUTPUT_FILES)//trim(sisname)//'.bin',status='old',&
-               form='unformatted',position='append')
+               form='unformatted',position='append',action='write')
         endif
       else
         if (seismo_offset==0) then
-          open(unit=IOUT,file=trim(OUTPUT_FILES)//trim(sisname)//'.ascii',status='unknown',form='formatted')
+          open(unit=IOUT,file=trim(OUTPUT_FILES)//trim(sisname)//'.ascii',status='unknown',form='formatted',action='write')
         else
           open(unit=IOUT,file=trim(OUTPUT_FILES)//trim(sisname)//'.ascii',status='old',&
-               form='formatted',position='append')
+               form='formatted',position='append',action='write')
         endif
       endif
    endif
@@ -176,17 +176,17 @@
 
          if(USE_BINARY_FOR_LARGE_FILE) then
            if (seismo_offset==0) then
-             open(unit=IOUT,file=trim(OUTPUT_FILES)//trim(sisname)//'.bin',status='unknown',form='unformatted')
+             open(unit=IOUT,file=trim(OUTPUT_FILES)//trim(sisname)//'.bin',status='unknown',form='unformatted',action='write')
            else
              open(unit=IOUT,file=trim(OUTPUT_FILES)//trim(sisname)//'.bin',status='old',&
-                  form='unformatted',position='append')
+                  form='unformatted',position='append',action='write')
            endif
          else
            if (seismo_offset==0) then
-             open(unit=IOUT,file=trim(OUTPUT_FILES)//trim(sisname)//'.ascii',status='unknown',form='formatted')
+             open(unit=IOUT,file=trim(OUTPUT_FILES)//trim(sisname)//'.ascii',status='unknown',form='formatted',action='write')
            else
              open(unit=IOUT,file=trim(OUTPUT_FILES)//trim(sisname)//'.ascii',status='old',&
-                  form='formatted',position='append')
+                  form='formatted',position='append',action='write')
            endif
          endif
 
@@ -623,9 +623,9 @@
 ! add .sacan (sac alphanumeric) extension to seismogram file name for SAC seismograms
   write(sisname_2,"('/',a,'.sacan')") trim(sisname)
   if (seismo_offset == 0) then
-    open(unit=IOUT_SAC,file=trim(OUTPUT_FILES)//trim(sisname_2),status='unknown')
+    open(unit=IOUT_SAC,file=trim(OUTPUT_FILES)//trim(sisname_2),status='unknown',action='write')
   else
-    open(unit=IOUT_SAC,file=trim(OUTPUT_FILES)//trim(sisname_2),status='old', position='append')
+    open(unit=IOUT_SAC,file=trim(OUTPUT_FILES)//trim(sisname_2),status='old', position='append',action='write')
   endif
 
 ! Formats of alphanumerical SAC header fields
@@ -921,9 +921,9 @@
       endif
     else
       if (seismo_offset==0) then
-        open(unit=IOUT,file=trim(OUTPUT_FILES)//trim(sisname_2),status='unknown')
+        open(unit=IOUT,file=trim(OUTPUT_FILES)//trim(sisname_2),status='unknown',action='write')
       else
-        open(unit=IOUT,file=trim(OUTPUT_FILES)//trim(sisname_2),status='old',position='append')
+        open(unit=IOUT,file=trim(OUTPUT_FILES)//trim(sisname_2),status='old',position='append',action='write')
       endif
 
     endif
@@ -1027,11 +1027,11 @@
    if(it <= NTSTEP_BETWEEN_OUTPUT_SEISMOS) then
       !open new file
       open(unit=IOUT,file=final_LOCAL_PATH(1:len_trim(final_LOCAL_PATH))//sisname(1:len_trim(sisname)),&
-           status='unknown')
+           status='unknown',action='write')
    else if(it > NTSTEP_BETWEEN_OUTPUT_SEISMOS) then
       !append to existing file
       open(unit=IOUT,file=final_LOCAL_PATH(1:len_trim(final_LOCAL_PATH))//sisname(1:len_trim(sisname)),&
-           status='old',position='append')
+           status='old',position='append',action='write')
    endif
 ! make sure we never write more than the maximum number of time steps
 ! subtract half duration of the source to make sure travel time is correct



More information about the cig-commits mailing list