diff --git a/src/shared/read_parameter_file.F90 b/src/shared/read_parameter_file.F90 index 3ededff71..9e65d0274 100644 --- a/src/shared/read_parameter_file.F90 +++ b/src/shared/read_parameter_file.F90 @@ -1395,8 +1395,8 @@ subroutine read_parameter_file_only() if (some_parameters_missing_from_Par_file) then write(*,*) - write(*,*) 'All the above parameters are missing from your Par_file.' - write(*,*) 'Please cut and paste them somewhere in your Par_file (any place is fine), change their values if needed' + write(*,*) 'All the above parameters are either in a wrong number format or missing from your Par_file.' + write(*,*) 'Please correct or cut&paste them somewhere in your Par_file (any place is fine), change their values if needed' write(*,*) '(the above values are just default values), and restart your run.' write(*,*) call stop_the_code('Error: some parameters are missing in your Par_file, it is incomplete or in an older format, & diff --git a/src/shared/read_source_file.f90 b/src/shared/read_source_file.f90 index 674b7d316..c91e0e62c 100644 --- a/src/shared/read_source_file.f90 +++ b/src/shared/read_source_file.f90 @@ -52,6 +52,7 @@ subroutine read_source_file(NSOURCES,BROADCAST_AFTER_READ) character(len=256) string_read character(len=MAX_STRING_LEN) :: source_filename,path_to_add integer, parameter :: IIN_SOURCE = 22 + logical :: stf_exists ! user output if (myrank == 0) then @@ -315,6 +316,17 @@ subroutine read_source_file(NSOURCES,BROADCAST_AFTER_READ) write(IMAIN,*) ' Multiplying factor = ',factor(i_source) write(IMAIN,*) + ! check if external stf file exists + if (time_function_type(i_source) == 8) then + inquire(file=trim(name_of_source_file(i_source)),exist=stf_exists) + if (.not. stf_exists) then + write(*,*) '' + write(*,*) 'Error external source time function file: ',trim(name_of_source_file(i_source)),' not found.' + write(*,*) '' + call stop_the_code('Error reading SOURCE file: could not find specified external source time function file') + endif + endif + enddo ! do i_source= 1,NSOURCES close(IIN_SOURCE) diff --git a/src/shared/read_value_parameters.f90 b/src/shared/read_value_parameters.f90 index b07e4b5a0..8721919eb 100644 --- a/src/shared/read_value_parameters.f90 +++ b/src/shared/read_value_parameters.f90 @@ -197,7 +197,7 @@ subroutine read_value_integer_p(value_to_read, name) call param_read(string_read, len(string_read), name, len(name), ierr) if (ierr /= 0) return - read(string_read,*) value_to_read + read(string_read,*,iostat=ierr) value_to_read end subroutine read_value_integer_p @@ -217,7 +217,7 @@ subroutine read_value_double_precision_p(value_to_read, name) call param_read(string_read, len(string_read), name, len(name), ierr) if (ierr /= 0) return - read(string_read,*) value_to_read + read(string_read,*,iostat=ierr) value_to_read end subroutine read_value_double_precision_p @@ -237,7 +237,7 @@ subroutine read_value_logical_p(value_to_read, name) call param_read(string_read, len(string_read), name, len(name), ierr) if (ierr /= 0) return - read(string_read,*) value_to_read + read(string_read,*,iostat=ierr) value_to_read end subroutine read_value_logical_p @@ -277,7 +277,7 @@ subroutine read_value_integer_next_p(value_to_read, name) call param_read_nextparam(string_read, len(string_read), name, len(name), ierr) if (ierr /= 0) return - read(string_read,*) value_to_read + read(string_read,*,iostat=ierr) value_to_read end subroutine read_value_integer_next_p @@ -297,7 +297,7 @@ subroutine read_value_double_prec_next_p(value_to_read, name) call param_read_nextparam(string_read, len(string_read), name, len(name), ierr) if (ierr /= 0) return - read(string_read,*) value_to_read + read(string_read,*,iostat=ierr) value_to_read end subroutine read_value_double_prec_next_p @@ -317,7 +317,7 @@ subroutine read_value_logical_next_p(value_to_read, name) call param_read_nextparam(string_read, len(string_read), name, len(name), ierr) if (ierr /= 0) return - read(string_read,*) value_to_read + read(string_read,*,iostat=ierr) value_to_read end subroutine read_value_logical_next_p diff --git a/src/specfem2D/setup_sources_receivers.F90 b/src/specfem2D/setup_sources_receivers.F90 index b4f083d22..ce0cb3a96 100644 --- a/src/specfem2D/setup_sources_receivers.F90 +++ b/src/specfem2D/setup_sources_receivers.F90 @@ -140,10 +140,12 @@ subroutine setup_sources() ! user output if (not_in_mesh_domain) then - write(IMAIN,*) 'Source ',i - write(IMAIN,*) ' Position (x,z) of the source = ',x_source(i),z_source(i) - write(IMAIN,*) 'Invalid position, mesh dimensions are: xmin/max = ',xmin,xmax,'zmin/zmax',zmin,zmax - write(IMAIN,*) 'Please fix source location, exiting...' + write(IMAIN,*) 'Error: Source ',i + write(IMAIN,*) ' Position (x,z) of the source = ',x_source(i),z_source(i) + write(IMAIN,*) + write(IMAIN,*) ' Invalid position, mesh dimensions are: xmin/max = ',xmin,xmax,'zmin/zmax',zmin,zmax + write(IMAIN,*) ' Please fix source location, exiting...' + write(IMAIN,*) if (x_source(i) < xmin) call stop_the_code('Error: at least one source has x < xmin of the mesh') if (x_source(i) > xmax) call stop_the_code('Error: at least one source has x > xmax of the mesh') if (z_source(i) < zmin) call stop_the_code('Error: at least one source has z < zmin of the mesh')