Skip to content

Commit 36d0f94

Browse files
committed
shortens routine/variable names to avoid compiler warnings
1 parent 2ad7f3e commit 36d0f94

File tree

6 files changed

+43
-46
lines changed

6 files changed

+43
-46
lines changed

src/meshfem3D/earth_chunk.f90

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,8 @@ subroutine earth_chunk_HEX8_Mesher(NGNOD)
507507

508508

509509
call calc_gll_points(xelm,yelm,zelm,xstore,ystore,zstore,shape3D,NGNOD,NGLLX,NGLLY,NGLLZ)
510-
call write_all_chunk_surface_GLL_in_spherical_and_Cartesian_coords(xstore,ystore,zstore, &
511-
deg2rad,ilayer,iboun,ispec,nspec,longitud, &
512-
latitud,radius,rotation_matrix,updown)
510+
call write_all_chunk_surface_GLL(xstore,ystore,zstore,deg2rad,ilayer,iboun,ispec,nspec,longitud, &
511+
latitud,radius,rotation_matrix,updown)
513512

514513
endif
515514

@@ -1317,9 +1316,8 @@ subroutine earth_chunk_HEX27_Mesher(NGNOD)
13171316

13181317

13191318
call calc_gll_points(xelm,yelm,zelm,xstore,ystore,zstore,shape3D,NGNOD,NGLLX,NGLLY,NGLLZ)
1320-
call write_all_chunk_surface_GLL_in_spherical_and_Cartesian_coords(xstore,ystore,zstore, &
1321-
deg2rad,ilayer,iboun,ispec,nspec,longitud, &
1322-
latitud,radius,rotation_matrix,updown)
1319+
call write_all_chunk_surface_GLL(xstore,ystore,zstore,deg2rad,ilayer,iboun,ispec,nspec,longitud, &
1320+
latitud,radius,rotation_matrix,updown)
13231321

13241322
endif
13251323

@@ -1935,9 +1933,8 @@ end subroutine write_gllz_points
19351933
!
19361934
!! Used (among other) for VM coupling with AxiSEM
19371935

1938-
subroutine write_all_chunk_surface_GLL_in_spherical_and_Cartesian_coords(xstore,ystore,zstore, &
1939-
deg2rad,ilayer,iboun,ispec,nspec,longitud, &
1940-
latitud,radius,rotation_matrix,updown)
1936+
subroutine write_all_chunk_surface_GLL(xstore,ystore,zstore,deg2rad,ilayer,iboun,ispec,nspec,longitud, &
1937+
latitud,radius,rotation_matrix,updown)
19411938

19421939
use constants, only: NGLLX, NGLLY, NGLLZ, &
19431940
INJECTION_TECHNIQUE_IS_DSM, INJECTION_TECHNIQUE_IS_AXISEM
@@ -2133,7 +2130,7 @@ subroutine write_all_chunk_surface_GLL_in_spherical_and_Cartesian_coords(xstore,
21332130

21342131
endif
21352132

2136-
end subroutine write_all_chunk_surface_GLL_in_spherical_and_Cartesian_coords
2133+
end subroutine write_all_chunk_surface_GLL
21372134

21382135
!
21392136
!=======================================================================================================

src/specfem3D/get_cmt.f90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ subroutine get_cmt(CMTSOLUTION,yr,jda,mo,da,ho,mi,sec, &
5959
integer :: i,itype,istart,iend,ier,ipos
6060
double precision :: t_shift(NSOURCES)
6161
character(len=256) :: string
62-
character(len=MAX_STRING_LEN) :: external_source_time_function_filename
62+
character(len=MAX_STRING_LEN) :: external_stf_filename
6363

6464
! initializes
6565
lat(:) = 0.d0
@@ -374,10 +374,10 @@ subroutine get_cmt(CMTSOLUTION,yr,jda,mo,da,ho,mi,sec, &
374374
read(IIN,"(a)") string
375375
! suppress white spaces if any
376376
string = adjustl(string)
377-
external_source_time_function_filename = trim(string)
378-
if (trim(external_source_time_function_filename) == 'REUSE' .or. &
379-
trim(external_source_time_function_filename) == 'Reuse' .or. &
380-
trim(external_source_time_function_filename) == 'reuse') then
377+
external_stf_filename = trim(string)
378+
if (trim(external_stf_filename) == 'REUSE' .or. &
379+
trim(external_stf_filename) == 'Reuse' .or. &
380+
trim(external_stf_filename) == 'reuse') then
381381
! Reuse the source time function of the first source.
382382
if (isource == 1) then
383383
stop 'Error: "reuse" option cannot be used for the first source!'
@@ -388,7 +388,7 @@ subroutine get_cmt(CMTSOLUTION,yr,jda,mo,da,ho,mi,sec, &
388388
user_source_time_function(ishift+1:NSTEP_STF,isource) = user_source_time_function(1:nright,1)
389389
else
390390
! reads in stf values
391-
call read_external_source_time_function(isource,user_source_time_function,external_source_time_function_filename)
391+
call read_external_stf(isource,user_source_time_function,external_stf_filename)
392392
endif
393393
endif
394394

src/specfem3D/get_force.f90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ subroutine get_force(FORCESOLUTION,tshift_src,hdur,lat,long,depth,NSOURCES, &
5858
double precision :: length
5959
character(len=7) :: dummy
6060
character(len=MAX_STRING_LEN) :: string
61-
character(len=MAX_STRING_LEN) :: external_source_time_function_filename
61+
character(len=MAX_STRING_LEN) :: external_stf_filename
6262

6363
! initializes
6464
lat(:) = 0.d0
@@ -201,10 +201,10 @@ subroutine get_force(FORCESOLUTION,tshift_src,hdur,lat,long,depth,NSOURCES, &
201201
read(IIN,"(a)") string
202202
! suppress white spaces if any
203203
string = adjustl(string)
204-
external_source_time_function_filename = trim(string)
205-
if (trim(external_source_time_function_filename) == 'REUSE' .or. &
206-
trim(external_source_time_function_filename) == 'Reuse' .or. &
207-
trim(external_source_time_function_filename) == 'reuse') then
204+
external_stf_filename = trim(string)
205+
if (trim(external_stf_filename) == 'REUSE' .or. &
206+
trim(external_stf_filename) == 'Reuse' .or. &
207+
trim(external_stf_filename) == 'reuse') then
208208
! Reuse the source time function of the first source.
209209
if (isource == 1) then
210210
stop 'Error: "reuse" option cannot be used for the first source!'
@@ -215,7 +215,7 @@ subroutine get_force(FORCESOLUTION,tshift_src,hdur,lat,long,depth,NSOURCES, &
215215
user_source_time_function(ishift+1:NSTEP_STF,isource) = user_source_time_function(1:nright,1)
216216
else
217217
! reads in stf values
218-
call read_external_source_time_function(isource,user_source_time_function,external_source_time_function_filename)
218+
call read_external_stf(isource,user_source_time_function,external_stf_filename)
219219
endif
220220
endif
221221

src/specfem3D/read_external_stf.f90

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
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

utils/scripts/clean_listings_specfem.pl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,12 @@
177177
# do not move this before the above line in which we change the keyword "function"
178178
$line =~ s#use_ricker_time_function#USE_RICKER_TIME_FUNCTION#ogi;
179179
$line =~ s#print_source_time_function#PRINT_SOURCE_TIME_FUNCTION#ogi;
180-
$line =~ s#external_source_time_function#EXTERNAL_SOURCE_TIME_FUNCTION#ogi;
181180
$line =~ s#sourceTimeFunction#sourceTimeFunction#ogi;
182181

183-
$line =~ s#external_stf#EXTERNAL_SOURCE_TIME_FUNCTION#ogi;
184-
$line =~ s#EXTERNAL_SOURCE_TIME_FUNCTION_filename#external_source_time_function_filename#ogi;
185-
$line =~ s#read_EXTERNAL_SOURCE_TIME_FUNCTION#read_external_source_time_function#ogi;
182+
#$line =~ s#external_source_time_function#EXTERNAL_SOURCE_TIME_FUNCTION#ogi;
183+
#$line =~ s#external_stf#EXTERNAL_SOURCE_TIME_FUNCTION#ogi;
184+
#$line =~ s#EXTERNAL_SOURCE_TIME_FUNCTION_filename#external_source_time_function_filename#ogi;
185+
#$line =~ s#read_EXTERNAL_SOURCE_TIME_FUNCTION#read_external_source_time_function#ogi;
186186
$line =~ s#USE_MAP_function#USE_MAP_FUNCTION#ogi;
187187

188188
$line =~ s#enddo_LOOP_IJK#ENDDO_LOOP_IJK#ogi;

utils/scripts/clean_listings_specfem.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@
7979
# do not move this before the above line in which we change the keyword "function"
8080
(r'use_ricker_time_function', 'USE_RICKER_TIME_FUNCTION'),
8181
(r'print_source_time_function', 'PRINT_SOURCE_TIME_FUNCTION'),
82-
(r'external_source_time_function', 'EXTERNAL_SOURCE_TIME_FUNCTION'),
8382
(r'sourceTimeFunction', 'sourceTimeFunction'),
84-
(r'external_stf', 'EXTERNAL_SOURCE_TIME_FUNCTION'),
85-
(r'EXTERNAL_SOURCE_TIME_FUNCTION_filename', 'external_source_time_function_filename'),
86-
(r'read_EXTERNAL_SOURCE_TIME_FUNCTION', 'read_external_source_time_function'),
83+
#(r'external_source_time_function', 'EXTERNAL_SOURCE_TIME_FUNCTION'),
84+
#(r'external_stf', 'EXTERNAL_SOURCE_TIME_FUNCTION'),
85+
#(r'EXTERNAL_SOURCE_TIME_FUNCTION_filename', 'external_source_time_function_filename'),
86+
#(r'read_EXTERNAL_SOURCE_TIME_FUNCTION', 'read_external_source_time_function'),
8787
(r'USE_MAP_function', 'USE_MAP_FUNCTION'),
8888
(r'enddo_LOOP_IJK', 'ENDDO_LOOP_IJK'),
8989
(r'enddo_LOOP_IJ', 'ENDDO_LOOP_IJ'),

0 commit comments

Comments
 (0)