2525!
2626! =====================================================================
2727
28- subroutine read_external_source_time_function (isource ,user_source_time_function ,external_source_time_function_filename )
28+ subroutine read_external_stf (isource ,user_source_time_function ,external_stf_filename )
2929
3030! reads in an external source time function file
3131
@@ -41,7 +41,7 @@ subroutine read_external_source_time_function(isource,user_source_time_function,
4141 ! ! when .not. USE_EXTERNAL_SOURCE_FILE they are equal to 1,1.
4242 real (kind= CUSTOM_REAL), dimension (NSTEP_STF, NSOURCES_STF), intent (inout ) :: user_source_time_function
4343
44- character (len= MAX_STRING_LEN),intent (in ) :: external_source_time_function_filename
44+ character (len= MAX_STRING_LEN),intent (in ) :: external_stf_filename
4545
4646 ! local variables below
4747 integer :: i,ier,str_len
@@ -69,17 +69,17 @@ subroutine read_external_source_time_function(isource,user_source_time_function,
6969
7070 ! check file ending
7171 ! ".bin" for binary source time function files
72- str_len = len_trim (external_source_time_function_filename )
72+ str_len = len_trim (external_stf_filename )
7373 if (str_len > 4 ) then
74- if (external_source_time_function_filename (str_len-3 :str_len) == " .bin" ) then
74+ if (external_stf_filename (str_len-3 :str_len) == " .bin" ) then
7575 ! binary source time function file
7676 ! format: can only have numbers, no comment lines
7777 ! also, it must have the exact NSTEP length (and values) for the simulation as no further checks will be done
7878 !
7979 ! open binary file
80- open (IO_STF,file= trim (external_source_time_function_filename ),form= ' unformatted' ,status= ' old' ,action= ' read' ,iostat= ier)
80+ open (IO_STF,file= trim (external_stf_filename ),form= ' unformatted' ,status= ' old' ,action= ' read' ,iostat= ier)
8181 if (ier /= 0 ) then
82- print * ,' Error: could not open external binary source file: ' ,trim (external_source_time_function_filename )
82+ print * ,' Error: could not open external binary source file: ' ,trim (external_stf_filename )
8383 print * ,' for source index: ' ,isource
8484 stop ' Error opening external binary source time function file'
8585 endif
@@ -108,9 +108,9 @@ subroutine read_external_source_time_function(isource,user_source_time_function,
108108 ! stf_valueNSTEP
109109 !
110110 ! opens specified file
111- open (IO_STF,file= trim (external_source_time_function_filename ),status= ' old' ,action= ' read' ,iostat= ier)
111+ open (IO_STF,file= trim (external_stf_filename ),status= ' old' ,action= ' read' ,iostat= ier)
112112 if (ier /= 0 ) then
113- print * ,' Error: could not open external ASCII source file: ' ,trim (external_source_time_function_filename )
113+ print * ,' Error: could not open external ASCII source file: ' ,trim (external_stf_filename )
114114 print * ,' for source index: ' ,isource
115115 stop ' Error opening external ASCII source time function file'
116116 endif
@@ -126,7 +126,7 @@ subroutine read_external_source_time_function(isource,user_source_time_function,
126126 ! skip empty/comment lines
127127 if (len_trim (line) == 0 ) cycle
128128 if (line(1 :1 ) == ' #' .or. line(1 :1 ) == ' !' ) cycle
129- ! stop 'error in format of external_source_time_function_filename , no comments are allowed in it'
129+ ! stop 'error in format of external_stf_filename , no comments are allowed in it'
130130
131131 ! increases counter
132132 i = i + 1
@@ -136,16 +136,16 @@ subroutine read_external_source_time_function(isource,user_source_time_function,
136136
137137 ! checks
138138 if (i < 1 ) then
139- print * ,' Error: External ASCII source time function file ' ,trim (trim (external_source_time_function_filename )), &
139+ print * ,' Error: External ASCII source time function file ' ,trim (trim (external_stf_filename )), &
140140 ' has no valid data;'
141141 print * ,' the number of time steps is < 1. Please check the file...'
142- stop ' Error: the number of time steps in external_source_time_function_filename is < 1'
142+ stop ' Error: the number of time steps in external_stf_filename is < 1'
143143 endif
144144
145145 if (i > NSTEP_STF) then
146146 print *
147147 print * ,' ****************************************************************************************'
148- print * ,' Warning: ' ,trim (external_source_time_function_filename ), &
148+ print * ,' Warning: ' ,trim (external_stf_filename ), &
149149 ' contains ' ,i,' time steps'
150150 print * ,' only the first NSTEP_STF = ' ,NSTEP_STF,' will be read, all the others will be ignored.'
151151 print * ,' ****************************************************************************************'
@@ -154,7 +154,7 @@ subroutine read_external_source_time_function(isource,user_source_time_function,
154154
155155 ! checks number of time steps read
156156 if (i < NSTEP_STF) then
157- print * ,' Problem when reading external ASCII source time file: ' , trim (external_source_time_function_filename )
157+ print * ,' Problem when reading external ASCII source time file: ' , trim (external_stf_filename )
158158 print * ,' number of time steps in the simulation = ' ,NSTEP_STF
159159 print * ,' number of time steps read from the source time function = ' ,i
160160 print * ,' Please make sure that the number of time steps in the external ASCII source file read is greater or &
@@ -178,7 +178,7 @@ subroutine read_external_source_time_function(isource,user_source_time_function,
178178 ! reads the STF values
179179 read (line,* ,iostat= ier) stf_val
180180 if (ier /= 0 ) then
181- print * ,' Problem when reading external ASCII source time file: ' , trim (external_source_time_function_filename )
181+ print * ,' Problem when reading external ASCII source time file: ' , trim (external_stf_filename )
182182 print * ,' Please check, file format should be: '
183183 print * ,' # DT-time-step-size'
184184 print * ,' # stf-value'
@@ -193,7 +193,7 @@ subroutine read_external_source_time_function(isource,user_source_time_function,
193193 if (i == 1 .and. stf_val > SMALL_STF_VAL) then
194194 print *
195195 print * ,' ****************************************************************************************'
196- print * ,' Warning: ' ,trim (external_source_time_function_filename ), &
196+ print * ,' Warning: ' ,trim (external_stf_filename ), &
197197 ' starts with an STF value ' ,stf_val
198198 print * ,' Onset values should be close to zero to avoid numerical, high-frequency oscillations artifacts'
199199 print * ,' ****************************************************************************************'
@@ -215,5 +215,5 @@ subroutine read_external_source_time_function(isource,user_source_time_function,
215215 ! tCPU = wtime() - tstart
216216 ! print *,'debug: ascii read source ',isource,' - elapsed time: ',sngl(tCPU),'s'
217217
218- end subroutine read_external_source_time_function
218+ end subroutine read_external_stf
219219
0 commit comments