Skip to content

Commit

Permalink
code cleaning (whitespace)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeter committed Jun 5, 2024
1 parent ca6d753 commit 0e64075
Show file tree
Hide file tree
Showing 18 changed files with 97 additions and 97 deletions.
26 changes: 13 additions & 13 deletions src/shared/read_material_table.f90
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ subroutine read_material_table()
rho_s_read,rho_f_read, &
phi_read,tortuosity_read, &
permxx_read,permxz_read,permzz_read,kappa_s_read,kappa_f_read,kappa_fr_read, &
eta_f_read,mu_fr_read,mu0_read,e0_read,e11_read,e33_read,sig11_read,sig33_read,&
eta_f_read,mu_fr_read,mu0_read,e0_read,e11_read,e33_read,sig11_read,sig33_read, &
Qe11_read,Qe33_read,Qs11_read,Qs33_read, &
compaction_grad

Expand Down Expand Up @@ -167,7 +167,7 @@ subroutine read_material_table()
call stop_the_code('Invalid poroelastic material: non-positive value of Qmu')

else if (icodemat(i) == ELECTROMAGNETIC_MATERIAL) then
! electromagnetic material
! electromagnetic material
mu0_read(i) = val0read
e0_read(i) = val1read
e11_read(i) = val2read
Expand Down Expand Up @@ -248,7 +248,7 @@ subroutine initialize_material_properties()
eta_f_read,mu_fr_read

! electromagnetic
use shared_parameters, only: mu0_read,e0_read,e11_read,e33_read,sig11_read,sig33_read,&
use shared_parameters, only: mu0_read,e0_read,e11_read,e33_read,sig11_read,sig33_read, &
Qe11_read,Qe33_read,Qs11_read,Qs33_read

implicit none
Expand Down Expand Up @@ -289,15 +289,15 @@ subroutine initialize_material_properties()
eta_f_read(nbmodels), &
mu_fr_read(nbmodels))

allocate( mu0_read(nbmodels),&
e0_read(nbmodels),&
e11_read(nbmodels),&
e33_read(nbmodels),&
sig11_read(nbmodels),&
sig33_read(nbmodels),&
Qe11_read(nbmodels),&
Qe33_read(nbmodels),&
Qs11_read(nbmodels),&
allocate( mu0_read(nbmodels), &
e0_read(nbmodels), &
e11_read(nbmodels), &
e33_read(nbmodels), &
sig11_read(nbmodels), &
sig33_read(nbmodels), &
Qe11_read(nbmodels), &
Qe33_read(nbmodels), &
Qs11_read(nbmodels), &
Qs33_read(nbmodels))

allocate(compaction_grad(nbmodels))
Expand Down Expand Up @@ -379,7 +379,7 @@ subroutine print_materials_info()
eta_f_read,mu_fr_read

! electromagnetic
use shared_parameters, only: mu0_read,e0_read,e11_read,e33_read,sig11_read,sig33_read,&
use shared_parameters, only: mu0_read,e0_read,e11_read,e33_read,sig11_read,sig33_read, &
Qe11_read,Qe33_read,Qs11_read,Qs33_read

implicit none
Expand Down
4 changes: 2 additions & 2 deletions src/shared/read_parameter_file.F90
Original file line number Diff line number Diff line change
Expand Up @@ -564,14 +564,14 @@ subroutine read_parameter_file_only()
write(*,'(a)') 'ATTENUATION_PERMITTIVITY = .false.'
write(*,*)
endif

call read_value_logical_p(ATTENUATION_CONDUCTIVITY, 'ATTENUATION_CONDUCTIVITY')
if (err_occurred() /= 0) then
some_parameters_missing_from_Par_file = .true.
write(*,'(a)') 'ATTENUATION_CONDUCTIVITY = .false.'
write(*,*)
endif

call read_value_double_precision_p(f0_electromagnetic, 'f0_electromagnetic')
if (err_occurred() /= 0) then
some_parameters_missing_from_Par_file = .true.
Expand Down
2 changes: 1 addition & 1 deletion src/shared/shared_par.F90
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ module shared_parameters
permzz_read,kappa_s_read,kappa_f_read,kappa_fr_read,eta_f_read,mu_fr_read

! electromagnetic (EM)
double precision, dimension(:),allocatable :: mu0_read,e0_read,e11_read,e33_read,sig11_read,sig33_read,&
double precision, dimension(:),allocatable :: mu0_read,e0_read,e11_read,e33_read,sig11_read,sig33_read, &
Qe11_read,Qe33_read,Qs11_read,Qs33_read

! compaction gradient
Expand Down
4 changes: 2 additions & 2 deletions src/specfem2D/check_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ subroutine check_grid()
cpIIloc = 0.d0
endif
cEloc = 0.d0

else
cpIloc = 0.d0
cpIIloc = 0.d0
Expand All @@ -241,7 +241,7 @@ subroutine check_grid()
! ignore fluid regions with Vs = 0
if (csloc > TINYVAL) vsmin = min(vsmin,csloc)
vsmax = max(vsmax,csloc)

if (cEloc > TINYVAL) vEmin = min(vEmin,cEloc)
vEmax = max(vEmax,cEloc)

Expand Down
6 changes: 3 additions & 3 deletions src/specfem2D/compute_add_sources_electromagnetic.f90
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ subroutine compute_add_sources_electromagnetic(accel_electromagnetic,it,i_stage)
use constants, only: CUSTOM_REAL,NGLLX,NGLLZ,NDIM,HALF,myrank

use specfem_par, only: P_SV,ispec_is_electromagnetic,nglob_electromagnetic, &
NSOURCES,source_time_function,&
NSOURCES,source_time_function, &
islice_selected_source,ispec_selected_source,sourcearrays, &
ibool
implicit none
Expand All @@ -58,7 +58,7 @@ subroutine compute_add_sources_electromagnetic(accel_electromagnetic,it,i_stage)

! element containing source
ispec = ispec_selected_source(i_source)

! source element is electromagnetic
if (ispec_is_electromagnetic(ispec)) then
! source time function
Expand All @@ -83,7 +83,7 @@ subroutine compute_add_sources_electromagnetic(accel_electromagnetic,it,i_stage)
! 2D: y-component uses array(1,..)
accel_electromagnetic(1,iglob) = accel_electromagnetic(1,iglob) - sourcearrays(1,i,j,i_source) * stf_used
enddo
enddo
enddo
endif

endif ! source element is electromagnetic
Expand Down
2 changes: 1 addition & 1 deletion src/specfem2D/compute_attenuation_electromagnetic.f90
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ subroutine compute_attenuation_electromagnetic()
permlxx = spermittivitystore(1,i,j,ispec)
permlzz = spermittivitystore(2,i,j,ispec)

permx_loc(i,j) = veloc_electromagnetic(1,iglob) * permlxx
permx_loc(i,j) = veloc_electromagnetic(1,iglob) * permlxx
permz_loc(i,j) = veloc_electromagnetic(2,iglob) * permlzz

! time stepping
Expand Down
8 changes: 4 additions & 4 deletions src/specfem2D/compute_forces_electromagnetic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
!========================================================================


subroutine compute_forces_electromagnetic(accel_electromagnetic,displ_electromagnetic,&
subroutine compute_forces_electromagnetic(accel_electromagnetic,displ_electromagnetic, &
rx_permattenuation,rz_permattenuation,iphase)

! compute forces for the electromagnetic elements
use constants, only: CUSTOM_REAL,NGLLX,NGLLZ,NGLJ,NDIM, &
ONE,HALF,PI,TINYVAL,FOUR_THIRDS

use specfem_par, only: nglob,&
use specfem_par, only: nglob, &
ibool,kmato,ispec_is_electromagnetic, &
xix,xiz,gammax,gammaz,jacobian, &
hprime_xx,hprimewgll_xx,hprime_zz,hprimewgll_zz,wxgll,wzgll, &
Expand Down Expand Up @@ -177,7 +177,7 @@ subroutine compute_forces_electromagnetic(accel_electromagnetic,displ_electromag
!--- if external medium, get electromagnetic parameters of current grid point
inv_mag_permeability = inv_magpermeabilitystore(i,j,ispec)

if(P_SV) then
if (P_SV) then
sigma_xx = inv_mag_permeability*(dux_dxl(i,j)+duz_dzl(i,j)) !
sigma_zz = inv_mag_permeability*(dux_dxl(i,j)+duz_dzl(i,j)) !
sigma_xz = inv_mag_permeability*(duz_dxl(i,j) - dux_dzl(i,j)) ! d_t \tilde{H}_xz = d_t H_y = mu^-1(dxEz-dzEx)
Expand Down Expand Up @@ -255,7 +255,7 @@ subroutine compute_forces_electromagnetic(accel_electromagnetic,displ_electromag
accel_electromagnetic(1,iglob) = accel_electromagnetic(1,iglob) - (wzgll(j) * tempx1l + wxgll(i) * tempx2l) &
- wxgll(i) * wzgll(j) * jacobian(i,j,ispec) * rx_permattenuation(i,j,ispec)
accel_electromagnetic(2,iglob) = 0.d0
endif
endif
else
if (P_SV) then
accel_electromagnetic(1,iglob) = accel_electromagnetic(1,iglob) - (wzgll(j) * tempx1l + wxgll(i) * tempx2l)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ subroutine compute_forces_electromagnetic_main()

! main solver for the electromagnetic elements
! electromagnetic term
call compute_forces_electromagnetic(accel_electromagnetic,displ_electromagnetic,&
call compute_forces_electromagnetic(accel_electromagnetic,displ_electromagnetic, &
rx_permattenuation,rz_permattenuation,iphase)
! PML_BOUNDARY_CONDITIONS,e1,e11,e13,iphase)

Expand All @@ -73,7 +73,7 @@ subroutine compute_forces_electromagnetic_main()

! ! PML boundary
! if (PML_BOUNDARY_CONDITIONS) then
! call pml_boundary_electromagnetic(accel_electromagnetic,veloc_electromagnetic,displ_electromagnetic,&
! call pml_boundary_electromagnetic(accel_electromagnetic,veloc_electromagnetic,displ_electromagnetic, &
! displ_electromagnetic_old)
! endif

Expand Down
46 changes: 23 additions & 23 deletions src/specfem2D/compute_stacey_electromagnetic.f90
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ subroutine compute_stacey_electromagnetic(accel_electromagnetic,veloc_electromag
b_absorb_electromagnetic_left,b_absorb_electromagnetic_right, &
b_absorb_electromagnetic_bottom,b_absorb_electromagnetic_top, &
ib_left,ib_right,ib_bottom,ib_top, &
anyabs,STACEY_ABSORBING_CONDITIONS,Qe11_electromagnetic,Qe33_electromagnetic,&
anyabs,STACEY_ABSORBING_CONDITIONS,Qe11_electromagnetic,Qe33_electromagnetic, &
Qs11_electromagnetic,Qs33_electromagnetic,P_SV

implicit none
Expand Down Expand Up @@ -101,14 +101,14 @@ subroutine compute_stacey_electromagnetic(accel_electromagnetic,veloc_electromag
permlxx = spermittivitystore(1,i,j,ispec) !e11
permlzz = spermittivitystore(2,i,j,ispec) !e33
condlxx = sconductivitystore(1,i,j,ispec) !sig11
condlzz = sconductivitystore(2,i,j,ispec) !sig33
condlzz = sconductivitystore(2,i,j,ispec) !sig33
two_inv_magpermeability = 2.d0 * inv_magpermeabilitystore(i,j,ispec) !2mu0^-1

call get_electromagnetic_velocities(cpxsquare,cpzsquare,econdl,eperml,ATTENUATION_CONDUCTIVITY, &
ATTENUATION_PERMITTIVITY,f0_electromagnetic,Qe11_electromagnetic(kmato(ispec)),Qe33_electromagnetic(kmato(ispec)),&
ATTENUATION_PERMITTIVITY,f0_electromagnetic,Qe11_electromagnetic(kmato(ispec)),Qe33_electromagnetic(kmato(ispec)), &
Qs11_electromagnetic(kmato(ispec)),Qs33_electromagnetic(kmato(ispec)), &
permlxx,permlzz,condlxx,condlzz,two_inv_magpermeability)

cpxl = sqrt(cpxsquare)
cpzl = sqrt(cpzsquare)

Expand All @@ -117,7 +117,7 @@ subroutine compute_stacey_electromagnetic(accel_electromagnetic,veloc_electromag

if (P_SV) then
! P_SV case
vx = veloc_electromagnetic(1,iglob)
vx = veloc_electromagnetic(1,iglob)
vz = veloc_electromagnetic(2,iglob)
vn = nx*vx + nz*vz

Expand All @@ -128,7 +128,7 @@ subroutine compute_stacey_electromagnetic(accel_electromagnetic,veloc_electromag
! with velocity's tangential component: veloc_tangential = v - vn * normal
! total traction
! T = T_normal + T_tangential
tx = rho_cpx*vn*nx
tx = rho_cpx*vn*nx
tz = rho_cpz*vn*nz

else
Expand Down Expand Up @@ -178,14 +178,14 @@ subroutine compute_stacey_electromagnetic(accel_electromagnetic,veloc_electromag
permlxx = spermittivitystore(1,i,j,ispec) !e11
permlzz = spermittivitystore(2,i,j,ispec) !e33
condlxx = sconductivitystore(1,i,j,ispec) !sig11
condlzz = sconductivitystore(2,i,j,ispec) !sig33
condlzz = sconductivitystore(2,i,j,ispec) !sig33
two_inv_magpermeability = 2.d0 * inv_magpermeabilitystore(i,j,ispec) !2mu0^-1

call get_electromagnetic_velocities(cpxsquare,cpzsquare,econdl,eperml,ATTENUATION_CONDUCTIVITY, &
ATTENUATION_PERMITTIVITY,f0_electromagnetic,Qe11_electromagnetic(kmato(ispec)),Qe33_electromagnetic(kmato(ispec)),&
ATTENUATION_PERMITTIVITY,f0_electromagnetic,Qe11_electromagnetic(kmato(ispec)),Qe33_electromagnetic(kmato(ispec)), &
Qs11_electromagnetic(kmato(ispec)),Qs33_electromagnetic(kmato(ispec)), &
permlxx,permlzz,condlxx,condlzz,two_inv_magpermeability)

cpxl = sqrt(cpxsquare)
cpzl = sqrt(cpzsquare)

Expand All @@ -194,7 +194,7 @@ subroutine compute_stacey_electromagnetic(accel_electromagnetic,veloc_electromag

if (P_SV) then
! P_SV case
vx = veloc_electromagnetic(1,iglob)
vx = veloc_electromagnetic(1,iglob)
vz = veloc_electromagnetic(2,iglob)
vn = nx*vx + nz*vz
tx = rho_cpx*vn*nx
Expand All @@ -215,7 +215,7 @@ subroutine compute_stacey_electromagnetic(accel_electromagnetic,veloc_electromag
! SH case
accel_electromagnetic(1,iglob) = accel_electromagnetic(1,iglob) - ty*weight
endif

if (SAVE_FORWARD .and. SIMULATION_TYPE == 1) then
if (P_SV) then
! P_SV case
Expand Down Expand Up @@ -245,14 +245,14 @@ subroutine compute_stacey_electromagnetic(accel_electromagnetic,veloc_electromag
permlxx = spermittivitystore(1,i,j,ispec) !e11
permlzz = spermittivitystore(2,i,j,ispec) !e33
condlxx = sconductivitystore(1,i,j,ispec) !sig11
condlzz = sconductivitystore(2,i,j,ispec) !sig33
condlzz = sconductivitystore(2,i,j,ispec) !sig33
two_inv_magpermeability = 2.d0 * inv_magpermeabilitystore(i,j,ispec) !2mu0^-1

call get_electromagnetic_velocities(cpxsquare,cpzsquare,econdl,eperml,ATTENUATION_CONDUCTIVITY, &
ATTENUATION_PERMITTIVITY,f0_electromagnetic,Qe11_electromagnetic(kmato(ispec)),Qe33_electromagnetic(kmato(ispec)),&
ATTENUATION_PERMITTIVITY,f0_electromagnetic,Qe11_electromagnetic(kmato(ispec)),Qe33_electromagnetic(kmato(ispec)), &
Qs11_electromagnetic(kmato(ispec)),Qs33_electromagnetic(kmato(ispec)), &
permlxx,permlzz,condlxx,condlzz,two_inv_magpermeability)

cpxl = sqrt(cpxsquare)
cpzl = sqrt(cpzsquare)

Expand All @@ -261,7 +261,7 @@ subroutine compute_stacey_electromagnetic(accel_electromagnetic,veloc_electromag

if (P_SV) then
! P_SV case
vx = veloc_electromagnetic(1,iglob)
vx = veloc_electromagnetic(1,iglob)
vz = veloc_electromagnetic(2,iglob)
vn = nx*vx+nz*vz
tx = rho_cpx*vn*nx
Expand Down Expand Up @@ -326,14 +326,14 @@ subroutine compute_stacey_electromagnetic(accel_electromagnetic,veloc_electromag
permlxx = spermittivitystore(1,i,j,ispec) !e11
permlzz = spermittivitystore(2,i,j,ispec) !e33
condlxx = sconductivitystore(1,i,j,ispec) !sig11
condlzz = sconductivitystore(2,i,j,ispec) !sig33
condlzz = sconductivitystore(2,i,j,ispec) !sig33
two_inv_magpermeability = 2.d0 * inv_magpermeabilitystore(i,j,ispec) !2mu0^-1

call get_electromagnetic_velocities(cpxsquare,cpzsquare,econdl,eperml,ATTENUATION_CONDUCTIVITY, &
ATTENUATION_PERMITTIVITY,f0_electromagnetic,Qe11_electromagnetic(kmato(ispec)),Qe33_electromagnetic(kmato(ispec)),&
ATTENUATION_PERMITTIVITY,f0_electromagnetic,Qe11_electromagnetic(kmato(ispec)),Qe33_electromagnetic(kmato(ispec)), &
Qs11_electromagnetic(kmato(ispec)),Qs33_electromagnetic(kmato(ispec)), &
permlxx,permlzz,condlxx,condlzz,two_inv_magpermeability)

cpxl = sqrt(cpxsquare)
cpzl = sqrt(cpzsquare)

Expand All @@ -342,7 +342,7 @@ subroutine compute_stacey_electromagnetic(accel_electromagnetic,veloc_electromag

if (P_SV) then
! P_SV case
vx = veloc_electromagnetic(1,iglob)
vx = veloc_electromagnetic(1,iglob)
vz = veloc_electromagnetic(2,iglob)
vn = nx*vx+nz*vz
tx = rho_cpx*vn*nx
Expand Down
Loading

0 comments on commit 0e64075

Please sign in to comment.