[cig-commits] [commit] devel, master: Remove get_value_string subroutine. (0705089)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Thu Nov 6 08:20:24 PST 2014


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

On branches: devel,master
Link       : https://github.com/geodynamics/specfem3d_globe/compare/bc58e579b3b0838a0968725a076f5904845437ca...be63f20cbb6f462104e949894dbe205d2398cd7f

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

commit 07050891060cbb88005a12e1e72b72db429c71e7
Author: Elliott Sales de Andrade <esalesde at physics.utoronto.ca>
Date:   Sun Jun 1 02:30:23 2014 -0400

    Remove get_value_string subroutine.
    
    All it does is copy the default value to the result.


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

07050891060cbb88005a12e1e72b72db429c71e7
 src/auxiliaries/combine_AVS_DX.f90              |   2 +-
 src/auxiliaries/create_movie_GMT_global.f90     |   5 +-
 src/auxiliaries/rules.mk                        |   1 -
 src/compute_optimized_dumping_undo_att/rules.mk |   1 -
 src/create_header_file/create_header_file.f90   |   4 +-
 src/create_header_file/rules.mk                 |   1 -
 src/meshfem3D/create_chunk_buffers.f90          |   8 +-
 src/meshfem3D/initialize_mesher.f90             |   4 +-
 src/meshfem3D/model_aniso_mantle.f90            |   8 +-
 src/meshfem3D/model_crust_2_0.f90               |   5 +-
 src/meshfem3D/model_crustmaps.f90               |   7 +-
 src/meshfem3D/model_epcrust.f90                 |   7 +-
 src/meshfem3D/model_eucrust.f90                 |   3 +-
 src/meshfem3D/model_gapp2.f90                   |   3 +-
 src/meshfem3D/model_ppm.f90                     |  20 +++--
 src/meshfem3D/model_s20rts.f90                  |   6 +-
 src/meshfem3D/model_s40rts.f90                  |   6 +-
 src/meshfem3D/rules.mk                          |   1 -
 src/shared/count_number_of_sources.f90          |   8 +-
 src/shared/exit_mpi.f90                         |   4 +-
 src/shared/get_value_parameters.f90             | 101 ------------------------
 src/shared/model_topo_bathy.f90                 |   7 +-
 src/shared/read_parameter_file.f90              |   4 +-
 src/shared/rules.mk                             |   1 -
 src/shared/save_header_file.F90                 |   4 +-
 src/specfem3D/get_cmt.f90                       |   6 +-
 src/specfem3D/get_event_info.f90                |   8 +-
 src/specfem3D/initialize_simulation.f90         |   6 +-
 src/specfem3D/locate_receivers.f90              |  14 ++--
 src/specfem3D/locate_sources.f90                |  15 +---
 src/specfem3D/rules.mk                          |   1 -
 src/specfem3D/write_seismograms.f90             |   4 +-
 src/specfem3D/write_specfem_adios_header.F90    |  12 ++-
 33 files changed, 63 insertions(+), 224 deletions(-)

diff --git a/src/auxiliaries/combine_AVS_DX.f90 b/src/auxiliaries/combine_AVS_DX.f90
index 8471074..78da285 100644
--- a/src/auxiliaries/combine_AVS_DX.f90
+++ b/src/auxiliaries/combine_AVS_DX.f90
@@ -145,7 +145,7 @@
   if(.not. SAVE_MESH_FILES) stop 'AVS or DX files were not saved by the mesher'
 
 ! get the base pathname for output files
-  call get_value_string(OUTPUT_FILES, 'OUTPUT_FILES', 'OUTPUT_FILES')
+  OUTPUT_FILES = 'OUTPUT_FILES'
 
   print *,'1 = create files in OpenDX format'
   print *,'2 = create files in AVS UCD format'
diff --git a/src/auxiliaries/create_movie_GMT_global.f90 b/src/auxiliaries/create_movie_GMT_global.f90
index 8896036..1723442 100644
--- a/src/auxiliaries/create_movie_GMT_global.f90
+++ b/src/auxiliaries/create_movie_GMT_global.f90
@@ -110,7 +110,6 @@
   integer :: istamp1,istamp2
 
   character(len=256) :: line
-  character(len=150) :: CMTSOLUTION
 
 ! ************** PROGRAM STARTS HERE **************
 
@@ -273,10 +272,8 @@
     cmt_t_shift = 0.0
     cmt_hdur = 0.0
 
-    call get_value_string(CMTSOLUTION, 'solver.CMTSOLUTION','DATA/CMTSOLUTION')
-
     ! reads in source lat/lon
-    open(IIN,file=trim(CMTSOLUTION),status='old',action='read',iostat=ierror )
+    open(IIN,file='DATA/CMTSOLUTION',status='old',action='read',iostat=ierror )
     if( ierror == 0 ) then
       ! skip first line, event name,timeshift,half duration
       read(IIN,*,iostat=ierror ) line ! PDE line
diff --git a/src/auxiliaries/rules.mk b/src/auxiliaries/rules.mk
index e6ea1e6..fe8d144 100644
--- a/src/auxiliaries/rules.mk
+++ b/src/auxiliaries/rules.mk
@@ -70,7 +70,6 @@ auxiliaries_SHARED_OBJECTS = \
 	$O/get_global.shared.o \
 	$O/get_model_parameters.shared.o \
 	$O/get_timestep_and_layers.shared.o \
-	$O/get_value_parameters.shared.o \
 	$O/param_reader.cc.o \
 	$O/read_compute_parameters.shared.o \
 	$O/read_parameter_file.shared.o \
diff --git a/src/compute_optimized_dumping_undo_att/rules.mk b/src/compute_optimized_dumping_undo_att/rules.mk
index a3b89d1..9bcdd9c 100644
--- a/src/compute_optimized_dumping_undo_att/rules.mk
+++ b/src/compute_optimized_dumping_undo_att/rules.mk
@@ -47,7 +47,6 @@ compute_optimized_dumping_undo_att_SHARED_OBJECTS = \
 	$O/force_ftz.cc.o \
 	$O/get_model_parameters.shared.o \
 	$O/get_timestep_and_layers.shared.o \
-	$O/get_value_parameters.shared.o \
 	$O/memory_eval.shared.o \
 	$O/param_reader.cc.o \
 	$O/read_compute_parameters.shared.o \
diff --git a/src/create_header_file/create_header_file.f90 b/src/create_header_file/create_header_file.f90
index f5687bf..6fd1976 100644
--- a/src/create_header_file/create_header_file.f90
+++ b/src/create_header_file/create_header_file.f90
@@ -36,7 +36,6 @@
   implicit none
 
   double precision :: static_memory_size
-  character(len=150) HEADER_FILE
 
   integer :: NSPECMAX_ANISO_IC,NSPECMAX_ISO_MANTLE,NSPECMAX_TISO_MANTLE, &
          NSPECMAX_ANISO_MANTLE,NSPEC_CRUST_MANTLE_ATTENUATION, &
@@ -53,9 +52,8 @@
 
 ! ************** PROGRAM STARTS HERE **************
 
-  call get_value_string(HEADER_FILE, 'solver.HEADER_FILE', 'OUTPUT_FILES/values_from_mesher.h')
   print *
-  print *,'creating file ', trim(HEADER_FILE), ' to compile solver with correct values'
+  print *,'creating file OUTPUT_FILES/values_from_mesher.h to compile solver with correct values'
 
 ! read the parameter file and compute additional parameters
   call read_compute_parameters()
diff --git a/src/create_header_file/rules.mk b/src/create_header_file/rules.mk
index ce51be8..6242076 100644
--- a/src/create_header_file/rules.mk
+++ b/src/create_header_file/rules.mk
@@ -48,7 +48,6 @@ create_header_file_SHARED_OBJECTS = \
 	$O/force_ftz.cc.o \
 	$O/get_model_parameters.shared.o \
 	$O/get_timestep_and_layers.shared.o \
-	$O/get_value_parameters.shared.o \
 	$O/memory_eval.shared.o \
 	$O/param_reader.cc.o \
 	$O/read_compute_parameters.shared.o \
diff --git a/src/meshfem3D/create_chunk_buffers.f90 b/src/meshfem3D/create_chunk_buffers.f90
index 03f0223..6730434 100644
--- a/src/meshfem3D/create_chunk_buffers.f90
+++ b/src/meshfem3D/create_chunk_buffers.f90
@@ -75,7 +75,7 @@
   ! local parameters
   integer :: nglob
   integer :: NGLOB1D_RADIAL
-  character(len=150) :: OUTPUT_FILES,ERR_MSG
+  character(len=150) :: ERR_MSG
 
   ! mask for ibool to mark points already found
   logical, dimension(:), allocatable ::  mask_ibool
@@ -253,10 +253,8 @@
   ! file output
   if( DEBUG ) then
     if(myrank == 0) then
-      ! get the base pathname for output files
-      call get_value_string(OUTPUT_FILES, 'OUTPUT_FILES', 'OUTPUT_FILES')
       ! file to store the list of processors for each message for faces
-      open(unit=IOUT,file=trim(OUTPUT_FILES)//'/list_messages_faces.txt',status='unknown')
+      open(unit=IOUT,file='OUTPUT_FILES/list_messages_faces.txt',status='unknown')
     endif
   endif
 
@@ -927,7 +925,7 @@
   if( DEBUG ) then
     ! file to store the list of processors for each message for corners
     if(myrank == 0) &
-      open(unit=IOUT,file=trim(OUTPUT_FILES)//'/list_messages_corners.txt',status='unknown')
+      open(unit=IOUT,file='OUTPUT_FILES/list_messages_corners.txt',status='unknown')
   endif
 
   ! loop over all the messages to create the addressing
diff --git a/src/meshfem3D/initialize_mesher.f90 b/src/meshfem3D/initialize_mesher.f90
index 249fd73..bdedf5f 100644
--- a/src/meshfem3D/initialize_mesher.f90
+++ b/src/meshfem3D/initialize_mesher.f90
@@ -45,8 +45,8 @@
   call world_size(sizeprocs)
   call world_rank(myrank)
 
-! get the base pathname for output files
-  call get_value_string(OUTPUT_FILES, 'OUTPUT_FILES', 'OUTPUT_FILES')
+! set the base pathname for output files
+  OUTPUT_FILES = 'OUTPUT_FILES'
 
 ! open main output file, only written to by process 0
   if(myrank == 0 .and. IMAIN /= ISTANDARD_OUTPUT) &
diff --git a/src/meshfem3D/model_aniso_mantle.f90 b/src/meshfem3D/model_aniso_mantle.f90
index e259c1d..c39ed28 100644
--- a/src/meshfem3D/model_aniso_mantle.f90
+++ b/src/meshfem3D/model_aniso_mantle.f90
@@ -383,7 +383,8 @@
   double precision,dimension(:,:,:,:),allocatable :: bet2 ! bet2(14,34,37,73)
   double precision :: alph(73,37),ph(73,37)
   integer :: ier
-  character(len=150) :: glob_prem3sm01, globpreman3sm01
+  character(len=*), parameter :: glob_prem3sm01 = 'DATA/Montagner_model/glob-prem3sm01'
+  character(len=*), parameter :: globpreman3sm01 = 'DATA/Montagner_model/globpreman3sm01'
 
   ! dynamic allocation
   allocate(bet2(14,34,37,73),stat=ier)
@@ -396,7 +397,6 @@
 !
 ! glob-prem3sm01: model with rho,A,L,xi-1,1-phi,eta
 !
-  call get_value_string(glob_prem3sm01, 'model.glob_prem3sm01', 'DATA/Montagner_model/glob-prem3sm01')
   open(19,file=glob_prem3sm01,status='old',action='read',iostat=ier)
   if( ier /= 0 ) stop 'error opening file DATA/Montagner_model/glob-prem3sm01'
 
@@ -458,7 +458,6 @@
 ! beta(ipa,idep,ilat,ilon) are sorted in (amplitude, phase)
 ! normalized, in percents: 100 G/L
 !
-  call get_value_string(globpreman3sm01, 'model.globpreman3sm01', 'DATA/Montagner_model/globpreman3sm01')
   open(unit=15,file=globpreman3sm01,status='old',action='read',iostat=ier)
   if( ier /= 0 ) stop 'error opening file DATA/Montagner_model/globpreman3sm01'
 
@@ -555,12 +554,11 @@
   double precision corpar(21,47)
   double precision aa,an,al,af,ac,vpv,vph,vsv,vsh,rho,red,a2l
   character(len=80) nullval
-  character(len=150) Adrem119
+  character(len=150), parameter :: Adrem119 = 'DATA/Montagner_model/Adrem119'
 
      ifanis = 1
      nri = 47
 
-     call get_value_string(Adrem119, 'model.Adrem119', 'DATA/Montagner_model/Adrem119')
      open(unit=13,file=Adrem119,status='old',action='read')
      read(13,*,end = 77) nlayer,minlay,moho,nout,neff,nband,kiti,nullval
 
diff --git a/src/meshfem3D/model_crust_2_0.f90 b/src/meshfem3D/model_crust_2_0.f90
index 07c97b7..2d4e124 100644
--- a/src/meshfem3D/model_crust_2_0.f90
+++ b/src/meshfem3D/model_crust_2_0.f90
@@ -242,14 +242,14 @@
 
   double precision :: h_moho_min,h_moho_max
 
-  character(len=150) :: CNtype2, CNtype2_key_modif
+  character(len=*), parameter :: CNtype2 = 'DATA/crust2.0/CNtype2.txt'
+  character(len=*), parameter :: CNtype2_key_modif = 'DATA/crust2.0/CNtype2_key_modif.txt'
 
   ! user output
   write(IMAIN,*)
   write(IMAIN,*) 'incorporating crustal model: CRUST2.0'
   write(IMAIN,*)
 
-  call get_value_string(CNtype2, 'model.CNtype2', 'DATA/crust2.0/CNtype2.txt')
   open(unit=1,file=CNtype2,status='old',action='read',iostat=ier)
   if ( ier /= 0 ) then
     write(IMAIN,*) 'error opening "', trim(CNtype2), '": ', ier
@@ -263,7 +263,6 @@
   enddo
   close(1)
 
-  call get_value_string(CNtype2_key_modif, 'model.CNtype2_key_modif', 'DATA/crust2.0/CNtype2_key_modif.txt')
   open(unit=1,file=CNtype2_key_modif,status='old',action='read',iostat=ier)
   if ( ier /= 0 ) then
     write(IMAIN,*) 'error opening "', trim(CNtype2_key_modif), '": ', ier
diff --git a/src/meshfem3D/model_crustmaps.f90 b/src/meshfem3D/model_crustmaps.f90
index bf3b99d..d9f52a6 100644
--- a/src/meshfem3D/model_crustmaps.f90
+++ b/src/meshfem3D/model_crustmaps.f90
@@ -198,15 +198,10 @@
   integer, intent(in) :: ind
 
   ! local variables
-  character(len=50) :: config_name
-  character(len=150) :: default_name
   character(len=150) :: eucrust
   integer :: ier, ila, iln
 
-  write(config_name,'(a,a1,i1)') 'model.eucrust', var_letter, ind
-  write(default_name,'(a,a1,i1)') 'DATA/crustmap/eucrust', var_letter, ind
-
-  call get_value_string(eucrust, config_name, default_name)
+  write(eucrust,'(a,a1,i1)') 'DATA/crustmap/eucrust', var_letter, ind
 
   open(unit=1,file=trim(eucrust),status='old',action='read',iostat=ier)
   if ( ier /= 0 ) then
diff --git a/src/meshfem3D/model_epcrust.f90 b/src/meshfem3D/model_epcrust.f90
index b9d20a2..a14c828 100644
--- a/src/meshfem3D/model_epcrust.f90
+++ b/src/meshfem3D/model_epcrust.f90
@@ -104,7 +104,6 @@
 
   implicit none
 
-  character(len=150) EPCRUST_FNM
   character(len=150),dimension(15) :: header
   double precision,dimension(15) :: tmp
   integer:: ilon,jlat,ier
@@ -114,11 +113,9 @@
   write(IMAIN,*) 'incorporating crustal model: EPcrust 1.0'
   write(IMAIN,*)
 
-  call get_value_string(EPCRUST_FNM,'model.EPCRUST_FNM',PATHNAME_EPCRUST)
-
-  open(unit=1001,file=trim(EPCRUST_FNM),status='old',action='read',iostat=ier)
+  open(unit=1001,file=trim(PATHNAME_EPCRUST),status='old',action='read',iostat=ier)
   if ( ier /= 0 ) then
-    write(IMAIN,*) 'error opening "', trim(EPCRUST_FNM), '": ', ier
+    write(IMAIN,*) 'error opening "', trim(PATHNAME_EPCRUST), '": ', ier
     call flush_IMAIN()
     ! stop
     call exit_MPI(0, 'error model epcrust')
diff --git a/src/meshfem3D/model_eucrust.f90 b/src/meshfem3D/model_eucrust.f90
index d2e8336..39b765e 100644
--- a/src/meshfem3D/model_eucrust.f90
+++ b/src/meshfem3D/model_eucrust.f90
@@ -104,7 +104,7 @@
 
   ! local variables
   character(len=80):: line
-  character(len=150):: filename
+  character(len=*), parameter :: filename = 'DATA/eucrust-07/ds01.txt'
   integer:: i,ier
   double precision:: vp_uppercrust,vp_lowercrust,vp_avg,topo,basement
   double precision:: upper_lower_depth,moho_depth,lat,lon
@@ -122,7 +122,6 @@
   eucrust_ucdepth(:) = ZERO
 
   ! opens data file
-  call get_value_string(filename, 'model.eu', 'DATA/eucrust-07/ds01.txt')
   open(unit=11,file=filename,status='old',action='read',iostat=ier)
   if ( ier /= 0 ) then
     write(IMAIN,*) 'error opening "', trim(filename), '": ', ier
diff --git a/src/meshfem3D/model_gapp2.f90 b/src/meshfem3D/model_gapp2.f90
index f67b0fc..f2a900f 100644
--- a/src/meshfem3D/model_gapp2.f90
+++ b/src/meshfem3D/model_gapp2.f90
@@ -98,12 +98,11 @@
   implicit none
 
   integer i,ir,ia,io,ier
-  character(len=150) GAPP2
+  character(len=150), parameter :: GAPP2 = 'DATA/3dvpGAP_P2'
 
 !...........................................input data
 
   ! default model: 3dvpGAP_P2
-  call get_value_string(GAPP2, 'model.GAPP2', 'DATA/3dvpGAP_P2')
 
   ! reads in GAP-P2 model from Obayashi
   open(unit=10,file=GAPP2,status='old',action='read',iostat=ier)
diff --git a/src/meshfem3D/model_ppm.f90 b/src/meshfem3D/model_ppm.f90
index 690868d..3300677 100644
--- a/src/meshfem3D/model_ppm.f90
+++ b/src/meshfem3D/model_ppm.f90
@@ -146,16 +146,14 @@
   ! local parameters
   integer ::            ier,counter,i
   double precision ::    lon,lat,depth,dvs,vs
-  character(len=150) ::  filename,line
-
-  call get_value_string(filename, 'model.PPM', trim(PPM_file_path))
+  character(len=150) ::  line
 
   !e.g. Mediterranean model
   ! counts entries
   counter=0
-  open(unit=10,file=trim(filename),status='old',action='read',iostat=ier)
+  open(unit=10,file=trim(PPM_file_path),status='old',action='read',iostat=ier)
   if( ier /= 0 ) then
-    write(IMAIN,*) ' error opening: ',trim(filename)
+    write(IMAIN,*) ' error opening: ',trim(PPM_file_path)
     call flush_IMAIN()
     ! stop
     call exit_mpi(0,"error opening model ppm")
@@ -177,7 +175,7 @@
   PPM_num_v = counter
   if( counter < 1 ) then
     write(IMAIN,*)
-    write(IMAIN,*) '  model PPM:',filename
+    write(IMAIN,*) '  model PPM:',PPM_file_path
     write(IMAIN,*) '     no values read in!!!!!!'
     write(IMAIN,*)
     write(IMAIN,*)
@@ -186,7 +184,7 @@
     call exit_mpi(0,' no model PPM ')
   else
     write(IMAIN,*)
-    write(IMAIN,*) 'model PPM:',trim(filename)
+    write(IMAIN,*) 'model PPM:',trim(PPM_file_path)
     write(IMAIN,*) '  values: ',counter
     write(IMAIN,*)
     call flush_IMAIN()
@@ -198,9 +196,9 @@
   PPM_dvs(:) = 0.0
 
   ! vs values
-  open(unit=10,file=trim(filename),status='old',action='read',iostat=ier)
+  open(unit=10,file=trim(PPM_file_path),status='old',action='read',iostat=ier)
   if( ier /= 0 ) then
-    write(IMAIN,*) ' error opening: ',trim(filename)
+    write(IMAIN,*) ' error opening: ',trim(PPM_file_path)
     call exit_mpi(0,"error opening model ppm")
   endif
   read(10,'(a150)') line   ! first line is text
@@ -222,7 +220,7 @@
   close(10)
   if( counter /= PPM_num_v ) then
     write(IMAIN,*)
-    write(IMAIN,*) '  model PPM:',filename
+    write(IMAIN,*) '  model PPM:',PPM_file_path
     write(IMAIN,*) '     error values read in!!!!!!'
     write(IMAIN,*) '  expected: ',PPM_num_v
     write(IMAIN,*) '  got: ',counter
@@ -292,7 +290,7 @@
   enddo
 
   if( abs(PPM_dlat) < 1.e-15 .or. abs(PPM_dlon) < 1.e-15 .or. abs(PPM_ddepth) < 1.e-15) then
-    write(IMAIN,*) '  model PPM:',filename
+    write(IMAIN,*) '  model PPM:',PPM_file_path
     write(IMAIN,*) '     error in delta values:'
     write(IMAIN,*) '     dlat : ',PPM_dlat,' dlon: ',PPM_dlon,' ddepth: ',PPM_ddepth
     call flush_IMAIN()
diff --git a/src/meshfem3D/model_s20rts.f90 b/src/meshfem3D/model_s20rts.f90
index 975ef79..ce6a9d2 100644
--- a/src/meshfem3D/model_s20rts.f90
+++ b/src/meshfem3D/model_s20rts.f90
@@ -110,10 +110,8 @@
   ! local parameters
   integer :: k,l,m,ier
 
-  character(len=150) :: S20RTS, P12
-
-  call get_value_string(S20RTS, 'model.S20RTS', 'DATA/s20rts/S20RTS.dat')
-  call get_value_string(P12, 'model.P12', 'DATA/s20rts/P12.dat')
+  character(len=*), parameter :: S20RTS = 'DATA/s20rts/S20RTS.dat'
+  character(len=*), parameter :: P12 = 'DATA/s20rts/P12.dat'
 
   ! S20RTS degree 20 S model from Ritsema
   open(unit=10,file=S20RTS,status='old',action='read',iostat=ier)
diff --git a/src/meshfem3D/model_s40rts.f90 b/src/meshfem3D/model_s40rts.f90
index 8e58638..85b43ec 100644
--- a/src/meshfem3D/model_s40rts.f90
+++ b/src/meshfem3D/model_s40rts.f90
@@ -113,10 +113,8 @@
 
   ! local parameters
   integer :: k,l,m,ier
-  character(len=150) :: S40RTS, P12
-
-  call get_value_string(S40RTS, 'model.S40RTS', 'DATA/s40rts/S40RTS.dat')
-  call get_value_string(P12, 'model.P12', 'DATA/s20rts/P12.dat')    !model P12 is in s20rts data directory
+  character(len=*), parameter :: S40RTS = 'DATA/s40rts/S40RTS.dat'
+  character(len=*), parameter :: P12 = 'DATA/s20rts/P12.dat'    !model P12 is in s20rts data directory
 
   ! S40RTS degree 40 S model from Ritsema
   open(unit=10,file=trim(S40RTS),status='old',action='read',iostat=ier)
diff --git a/src/meshfem3D/rules.mk b/src/meshfem3D/rules.mk
index a6d8f4c..2f5cb11 100644
--- a/src/meshfem3D/rules.mk
+++ b/src/meshfem3D/rules.mk
@@ -166,7 +166,6 @@ meshfem3D_SHARED_OBJECTS = \
 	$O/get_global.shared.o \
 	$O/get_model_parameters.shared.o \
 	$O/get_timestep_and_layers.shared.o \
-	$O/get_value_parameters.shared.o \
 	$O/gll_library.shared.o \
 	$O/hex_nodes.shared.o \
 	$O/intgrl.shared.o \
diff --git a/src/shared/count_number_of_sources.f90 b/src/shared/count_number_of_sources.f90
index 6569c30..ef42e63 100644
--- a/src/shared/count_number_of_sources.f90
+++ b/src/shared/count_number_of_sources.f90
@@ -38,12 +38,10 @@
 
   integer :: ios,icounter
 
-  character(len=150) :: CMTSOLUTION,dummystring
+  character(len=150) :: dummystring
 
-  call get_value_string(CMTSOLUTION, 'solver.CMTSOLUTION', 'DATA/CMTSOLUTION')
-
-  open(unit=IIN,file=trim(CMTSOLUTION),status='old',action='read',iostat=ios)
-  if(ios /= 0) stop 'error opening CMTSOLUTION file'
+  open(unit=IIN,file='DATA/CMTSOLUTION',status='old',action='read',iostat=ios)
+  if(ios /= 0) stop 'error opening DATA/CMTSOLUTION file'
 
   icounter = 0
   do while(ios == 0)
diff --git a/src/shared/exit_mpi.f90 b/src/shared/exit_mpi.f90
index a7040da..8341363 100644
--- a/src/shared/exit_mpi.f90
+++ b/src/shared/exit_mpi.f90
@@ -44,16 +44,14 @@
   integer :: myrank
   character(len=*) :: error_msg
   character(len=80) :: outputname
-  character(len=150) :: OUTPUT_FILES
 
   ! write error message to screen
   write(*,*) error_msg(1:len(error_msg))
   write(*,*) 'Error detected, aborting MPI... proc ',myrank
 
   ! write error message to file
-  call get_value_string(OUTPUT_FILES, 'OUTPUT_FILES', 'OUTPUT_FILES')
   write(outputname,"('/error_message',i6.6,'.txt')") myrank
-  open(unit=IERROR,file=trim(OUTPUT_FILES)//outputname,status='unknown')
+  open(unit=IERROR,file='OUTPUT_FILES'//outputname,status='unknown')
   write(IERROR,*) error_msg(1:len(error_msg))
   write(IERROR,*) 'Error detected, aborting MPI... proc ',myrank
   close(IERROR)
diff --git a/src/shared/get_value_parameters.f90 b/src/shared/get_value_parameters.f90
deleted file mode 100644
index bfe0d38..0000000
--- a/src/shared/get_value_parameters.f90
+++ /dev/null
@@ -1,101 +0,0 @@
-!=====================================================================
-!
-!          S p e c f e m 3 D  G l o b e  V e r s i o n  6 . 0
-!          --------------------------------------------------
-!
-!     Main historical authors: Dimitri Komatitsch and Jeroen Tromp
-!                        Princeton University, USA
-!                and CNRS / University of Marseille, France
-!                 (there are currently many more authors!)
-! (c) Princeton University and CNRS / University of Marseille, April 2014
-!
-! This program is free software; you can redistribute it and/or modify
-! it under the terms of the GNU General Public License as published by
-! the Free Software Foundation; either version 2 of the License, or
-! (at your option) any later version.
-!
-! This program is distributed in the hope that it will be useful,
-! but WITHOUT ANY WARRANTY; without even the implied warranty of
-! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-! GNU General Public License for more details.
-!
-! You should have received a copy of the GNU General Public License along
-! with this program; if not, write to the Free Software Foundation, Inc.,
-! 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-!
-!=====================================================================
-
-
-  subroutine get_value_string(value_to_get, name, default_value)
-
-  implicit none
-
-  character(len=*) value_to_get, default_value
-  character(len=*) name
-
-  call unused_string(name)
-
-  value_to_get = default_value
-
-  end subroutine get_value_string
-
-!--------------------
-
-! dummy subroutine to avoid warnings about variable not used in other subroutines
-  subroutine unused_string(s)
-
-  character(len=*) s
-
-  if (len(s) == 1) continue
-
-  end subroutine unused_string
-
-!--------------------
-
-!
-! unused routines:
-!
-
-!  subroutine get_value_integer(value_to_get, name, default_value)
-!
-!  implicit none
-!
-!  integer value_to_get, default_value
-!  character(len=*) name
-!
-!  call unused_string(name)
-!
-!  value_to_get = default_value
-!
-!  end subroutine get_value_integer
-!
-!!--------------------
-!
-!  subroutine get_value_double_precision(value_to_get, name, default_value)
-!
-!  implicit none
-!
-!  double precision value_to_get, default_value
-!  character(len=*) name
-!
-!  call unused_string(name)
-!
-!  value_to_get = default_value
-!
-!  end subroutine get_value_double_precision
-!
-!!--------------------
-!
-!  subroutine get_value_logical(value_to_get, name, default_value)
-!
-!  implicit none
-!
-!  logical value_to_get, default_value
-!  character(len=*) name
-!
-!  call unused_string(name)
-!
-!  value_to_get = default_value
-!
-!  end subroutine get_value_logical
-
diff --git a/src/shared/model_topo_bathy.f90 b/src/shared/model_topo_bathy.f90
index 991fab8..6f9ac9d 100644
--- a/src/shared/model_topo_bathy.f90
+++ b/src/shared/model_topo_bathy.f90
@@ -83,14 +83,11 @@
   real :: val
   integer :: ival
   integer :: itopo_x,itopo_y,ier
-  character(len=150) :: topo_bathy_file
-
-  call get_value_string(topo_bathy_file, 'model.topoBathy.PATHNAME_TOPO_FILE', PATHNAME_TOPO_FILE)
 
   ! reads in topography values from file
-  open(unit=13,file=trim(topo_bathy_file),status='old',action='read',iostat=ier)
+  open(unit=13,file=trim(PATHNAME_TOPO_FILE),status='old',action='read',iostat=ier)
   if( ier /= 0 ) then
-    print*,'error opening:',trim(topo_bathy_file)
+    print*,'error opening:',trim(PATHNAME_TOPO_FILE)
     call exit_mpi(0,'error opening topography data file')
   endif
 
diff --git a/src/shared/read_parameter_file.f90 b/src/shared/read_parameter_file.f90
index ec7cf32..37d4ee4 100644
--- a/src/shared/read_parameter_file.f90
+++ b/src/shared/read_parameter_file.f90
@@ -44,8 +44,8 @@
   integer :: ierr
   integer, external :: err_occurred
 
-  ! gets the base pathname for output files
-  call get_value_string(OUTPUT_FILES, 'OUTPUT_FILES', 'OUTPUT_FILES')
+  ! sets the base pathname for output files
+  OUTPUT_FILES = 'OUTPUT_FILES'
 
   ! opens the parameter file: DATA/Par_file
   call open_parameter_file(ierr)
diff --git a/src/shared/rules.mk b/src/shared/rules.mk
index d441108..982fb53 100644
--- a/src/shared/rules.mk
+++ b/src/shared/rules.mk
@@ -48,7 +48,6 @@ shared_OBJECTS = \
 	$O/get_global.shared.o \
 	$O/get_model_parameters.shared.o \
 	$O/get_timestep_and_layers.shared.o \
-	$O/get_value_parameters.shared.o \
 	$O/gll_library.shared.o \
 	$O/hex_nodes.shared.o \
 	$O/intgrl.shared.o \
diff --git a/src/shared/save_header_file.F90 b/src/shared/save_header_file.F90
index 26b7652..bfb1572 100644
--- a/src/shared/save_header_file.F90
+++ b/src/shared/save_header_file.F90
@@ -121,11 +121,9 @@
   double precision vector_ori(3),vector_rotated(3)
   double precision r_corner,theta_corner,phi_corner,lat,long,colat_corner
   integer :: ier
-  character(len=150) HEADER_FILE
 
   ! copy number of elements and points in an include file for the solver
-  call get_value_string(HEADER_FILE, 'solver.HEADER_FILE', 'OUTPUT_FILES/values_from_mesher.h')
-  open(unit=IOUT,file=HEADER_FILE,status='unknown',iostat=ier)
+  open(unit=IOUT,file='OUTPUT_FILES/values_from_mesher.h',status='unknown',iostat=ier)
   if( ier /= 0 ) stop 'error opening OUTPUT_FILES/values_from_mesher.h'
 
   write(IOUT,*)
diff --git a/src/specfem3D/get_cmt.f90 b/src/specfem3D/get_cmt.f90
index 2ce97a9..bffa29a 100644
--- a/src/specfem3D/get_cmt.f90
+++ b/src/specfem3D/get_cmt.f90
@@ -48,7 +48,7 @@
   double precision scaleM
   double precision t_shift(NSOURCES)
   character(len=5) datasource
-  character(len=256) string, CMTSOLUTION
+  character(len=256) string
 
   ! initializes
   lat(:) = 0.d0
@@ -67,9 +67,7 @@
 !
 !---- read hypocenter info
 !
-  call get_value_string(CMTSOLUTION, 'solver.CMTSOLUTION', 'DATA/CMTSOLUTION')
-
-  open(unit=1,file=CMTSOLUTION,status='old',action='read')
+  open(unit=1,file='DATA/CMTSOLUTION',status='old',action='read')
 
 ! read source number isource
   do isource=1,NSOURCES
diff --git a/src/specfem3D/get_event_info.f90 b/src/specfem3D/get_event_info.f90
index 5081169..aecfc5f 100644
--- a/src/specfem3D/get_event_info.f90
+++ b/src/specfem3D/get_event_info.f90
@@ -139,15 +139,13 @@
   character(len=20), dimension(NSOURCES) :: e_n
   real :: ms
   character(len=5) :: datasource
-  character(len=150) :: string,CMTSOLUTION
+  character(len=150) :: string
 
 !
 !---- read hypocenter info
 !
-  call get_value_string(CMTSOLUTION, 'solver.CMTSOLUTION','DATA/CMTSOLUTION')
-
-  open(unit=IIN,file=trim(CMTSOLUTION),status='old',action='read',iostat=ios)
-  if(ios /= 0) stop 'error opening CMTSOLUTION file (in get_event_info_serial)'
+  open(unit=IIN,file='DATA/CMTSOLUTION',status='old',action='read',iostat=ios)
+  if(ios /= 0) stop 'error opening DATA/CMTSOLUTION file (in get_event_info_serial)'
 
   ! example header line of CMTSOLUTION file
   !PDE 2003 09 25 19 50 08.93  41.78  144.08  18.0 7.9 8.0 Hokkaido, Japan
diff --git a/src/specfem3D/initialize_simulation.f90 b/src/specfem3D/initialize_simulation.f90
index dedb6d4..04d3734 100644
--- a/src/specfem3D/initialize_simulation.f90
+++ b/src/specfem3D/initialize_simulation.f90
@@ -64,8 +64,8 @@
   ! synchronizes processes
   call synchronize_all()
 
-  ! get the base pathname for output files
-  call get_value_string(OUTPUT_FILES, 'OUTPUT_FILES', 'OUTPUT_FILES')
+  ! set the base pathname for output files
+  OUTPUT_FILES = 'OUTPUT_FILES'
 
   ! open main output file, only written to by process 0
   if(myrank == 0 .and. IMAIN /= ISTANDARD_OUTPUT) then
@@ -215,7 +215,7 @@
   else
     rec_filename = 'DATA/STATIONS_ADJOINT'
   endif
-  call get_value_string(STATIONS, 'solver.STATIONS', rec_filename)
+  STATIONS = rec_filename
 
   ! get total number of receivers
   if(myrank == 0) then
diff --git a/src/specfem3D/locate_receivers.f90 b/src/specfem3D/locate_receivers.f90
index 5889eb9..44df4cc 100644
--- a/src/specfem3D/locate_receivers.f90
+++ b/src/specfem3D/locate_receivers.f90
@@ -128,7 +128,6 @@
   character(len=MAX_LENGTH_STATION_NAME), dimension(nrec) :: station_name_found
   character(len=MAX_LENGTH_NETWORK_NAME), dimension(nrec) :: network_name_found
   double precision, dimension(nrec) :: stlat_found,stlon_found,stele_found,stbur_found,epidist_found
-  character(len=150) :: STATIONS
 
   integer, allocatable, dimension(:,:) :: ispec_selected_rec_all
   double precision, allocatable, dimension(:,:) :: xi_receiver_all,eta_receiver_all,gamma_receiver_all
@@ -139,7 +138,6 @@
   double precision :: typical_size
   logical :: located_target
 
-  character(len=150) :: OUTPUT_FILES
   character(len=2) :: bic
 
   integer :: nrec_SUBSET_current_size,irec_in_this_subset,irec_already_done
@@ -214,8 +212,7 @@
 
   ! read that STATIONS file on the master
   if(myrank == 0) then
-    call get_value_string(STATIONS, 'solver.STATIONS', trim(rec_filename))
-    open(unit=IIN,file=STATIONS,status='old',action='read',iostat=ier)
+    open(unit=IIN,file=trim(rec_filename),status='old',action='read',iostat=ier)
     if( ier /= 0 ) call exit_MPI(myrank,'error opening STATIONS file')
 
     ! loop on all the stations to read station information
@@ -501,14 +498,13 @@
   if(myrank == 0) then
 
     ! get the base pathname for output files
-    call get_value_string(OUTPUT_FILES, 'OUTPUT_FILES', 'OUTPUT_FILES')
     call band_instrument_code(DT,bic)
 
     ! create file for QmX Harvard
     ! Harvard format does not support the network name
     ! therefore only the station name is included below
     ! compute total number of samples for normal modes with 1 sample per second
-    open(unit=IOUT,file=trim(OUTPUT_FILES)//'/RECORDHEADERS', &
+    open(unit=IOUT,file='OUTPUT_FILES/RECORDHEADERS', &
           status='unknown',iostat=ier)
     if( ier /= 0 ) call exit_MPI(myrank,'error opening file RECORDHEADERS')
 
@@ -810,7 +806,7 @@
   if(myrank == 0) then
 
     ! appends receiver locations to sr.vtk file
-    open(IOUT_VTK,file=trim(OUTPUT_FILES)//'/sr_tmp.vtk', &
+    open(IOUT_VTK,file='OUTPUT_FILES/sr_tmp.vtk', &
           position='append',status='old',iostat=ier)
     if( ier /= 0 ) call exit_MPI(myrank,'Error opening and appending receivers to file sr_tmp.vtk')
 
@@ -904,7 +900,7 @@
     epidist(1:nrec) = epidist_found(1:nrec)
 
     ! write the list of stations and associated epicentral distance
-    open(unit=IOUT,file=trim(OUTPUT_FILES)//'/output_list_stations.txt', &
+    open(unit=IOUT,file='OUTPUT_FILES/output_list_stations.txt', &
           status='unknown',iostat=ier)
     if( ier /= 0 ) call exit_MPI(myrank,'error opening file output_list_stations.txt')
     write(IOUT,*)
@@ -919,7 +915,7 @@
 
     ! write out a filtered station list
     if( NCHUNKS_VAL /= 6 ) then
-      open(unit=IOUT,file=trim(OUTPUT_FILES)//'/STATIONS_FILTERED', &
+      open(unit=IOUT,file='OUTPUT_FILES/STATIONS_FILTERED', &
             status='unknown',iostat=ier)
       if( ier /= 0 ) call exit_MPI(myrank,'error opening file STATIONS_FILTERED')
       ! loop on all the stations to read station information
diff --git a/src/specfem3D/locate_sources.f90 b/src/specfem3D/locate_sources.f90
index a5899e0..24cdcf0 100644
--- a/src/specfem3D/locate_sources.f90
+++ b/src/specfem3D/locate_sources.f90
@@ -135,8 +135,6 @@
   double precision :: time_start,tCPU
   double precision, external :: wtime
 
-  character(len=150) :: OUTPUT_FILES
-
   ! get MPI starting time for all sources
   time_start = wtime()
 
@@ -176,10 +174,7 @@
 
   ! appends receiver locations to sr.vtk file
   if( myrank == 0 ) then
-    ! get the base pathname for output files
-    call get_value_string(OUTPUT_FILES, 'OUTPUT_FILES', 'OUTPUT_FILES')
-
-    open(IOUT_VTK,file=trim(OUTPUT_FILES)//'/sr_tmp.vtk', &
+    open(IOUT_VTK,file='OUTPUT_FILES/sr_tmp.vtk', &
           position='append',status='old',iostat=ier)
     if( ier /= 0 ) call exit_MPI(myrank,'Error opening and appending sources to file sr_tmp.vtk')
   endif
@@ -899,7 +894,6 @@
   double precision, external :: comp_source_time_function,comp_source_spectrum
   double precision, external :: comp_source_time_function_rickr
 
-  character(len=150) :: OUTPUT_FILES
   character(len=150) :: plot_file
 
   ! number of points to plot the source time function and spectrum
@@ -910,9 +904,6 @@
   write(IMAIN,*) 'printing the source-time function'
   call flush_IMAIN()
 
-  ! get the base pathname for output files
-  call get_value_string(OUTPUT_FILES, 'OUTPUT_FILES', 'OUTPUT_FILES')
-
   ! print the source-time function
   if(NSOURCES == 1) then
     plot_file = '/plot_source_time_function.txt'
@@ -927,7 +918,7 @@
   endif
 
   ! output file
-  open(unit=IOUT,file=trim(OUTPUT_FILES)//plot_file, &
+  open(unit=IOUT,file='OUTPUT_FILES'//plot_file, &
         status='unknown',iostat=ier)
   if( ier /= 0 ) call exit_mpi(0,'error opening plot_source_time_function file')
 
@@ -986,7 +977,7 @@
     endif
   endif
 
-  open(unit=IOUT,file=trim(OUTPUT_FILES)//plot_file, &
+  open(unit=IOUT,file='OUTPUT_FILES'//plot_file, &
         status='unknown',iostat=ier)
   if( ier /= 0 ) call exit_mpi(0,'error opening plot_source_spectrum file')
 
diff --git a/src/specfem3D/rules.mk b/src/specfem3D/rules.mk
index 79394a2..47885b4 100644
--- a/src/specfem3D/rules.mk
+++ b/src/specfem3D/rules.mk
@@ -131,7 +131,6 @@ specfem3D_SHARED_OBJECTS = \
 	$O/force_ftz.cc.o \
 	$O/get_model_parameters.shared.o \
 	$O/get_timestep_and_layers.shared.o \
-	$O/get_value_parameters.shared.o \
 	$O/gll_library.shared.o \
 	$O/hex_nodes.shared.o \
 	$O/intgrl.shared.o \
diff --git a/src/specfem3D/write_seismograms.f90 b/src/specfem3D/write_seismograms.f90
index 6d4dbeb..6825671 100644
--- a/src/specfem3D/write_seismograms.f90
+++ b/src/specfem3D/write_seismograms.f90
@@ -156,8 +156,8 @@ contains
   allocate(one_seismogram(NDIM,NTSTEP_BETWEEN_OUTPUT_SEISMOS),stat=ier)
   if(ier /= 0) call exit_mpi(myrank,'error while allocating one temporary seismogram')
 
-  ! get the base pathname for output files
-  call get_value_string(OUTPUT_FILES, 'OUTPUT_FILES', 'OUTPUT_FILES')
+  ! set the base pathname for output files
+  OUTPUT_FILES = 'OUTPUT_FILES'
 
   ! writes out seismograms
   if(.not. WRITE_SEISMOGRAMS_BY_MASTER) then
diff --git a/src/specfem3D/write_specfem_adios_header.F90 b/src/specfem3D/write_specfem_adios_header.F90
index d06a973..22a5147 100644
--- a/src/specfem3D/write_specfem_adios_header.F90
+++ b/src/specfem3D/write_specfem_adios_header.F90
@@ -408,13 +408,12 @@ subroutine read_raw_cmtsolution (yr, mo, da, ho, mi, sec, t_shift, hdur, lat,  &
   character(len=:), allocatable, intent(out)  :: datasource  ! F03 feature
   ! Local variables
   character(len=5)   :: datasource_tmp
-  character(len=256) :: CMTSOLUTION, string
+  character(len=256) :: string
   ! extract all unmodified values from CMTSOLUTION
   ! get_cmt() routine modify the read values
   ! TODO factorize what follows and get_cmt.f90 and probably one or two other
   !      routines
-  call get_value_string(CMTSOLUTION, 'solver.CMTSOLUTION', 'DATA/CMTSOLUTION')
-  open(unit=1,file=CMTSOLUTION,status='old',action='read')
+  open(unit=1,file='DATA/CMTSOLUTION',status='old',action='read')
   datasource_length = 4*NSOURCES ! a datasource is 4 character, by convention
   allocate(character(len=(datasource_length)) :: datasource, stat=ier)
   if (ier /=0) &
@@ -504,11 +503,10 @@ subroutine read_raw_stations (NSTATIONS, stlat, stlon, stele, stbur,           &
   ! Local variables
   character(len=MAX_LENGTH_STATION_NAME) :: station_name_tmp
   character(len=MAX_LENGTH_NETWORK_NAME) :: network_name_tmp
-  character(len=256) :: STATIONS, string
+  character(len=256) :: string
 
   ! Extract values from STATIONS File
-  call get_value_string(STATIONS, 'solver.STATIONS', 'DATA/STATIONS')
-  open(unit=1,file=STATIONS,iostat=ier,status='old',action='read')
+  open(unit=1,file='DATA/STATIONS',iostat=ier,status='old',action='read')
   NSTATIONS = 0
   do while(ier == 0)
   read(1,"(a)",iostat=ier) string
@@ -529,7 +527,7 @@ subroutine read_raw_stations (NSTATIONS, stlat, stlon, stele, stbur,           &
   stele(irec),      stbur(irec)
   if( ier /= 0 ) then
     write(IMAIN,*) 'error reading in station ',irec
-    call exit_MPI(myrank,'error reading in station in STATIONS file')
+    call exit_MPI(myrank,'error reading in station in DATA/STATIONS file')
   endif
   station_name = station_name // trim(station_name_tmp) // " "
   network_name = network_name // trim(network_name_tmp) // " "



More information about the CIG-COMMITS mailing list