From 639a70bc66309c299a54c17f1a097ac74f18b2d1 Mon Sep 17 00:00:00 2001 From: Daniel Peter Date: Tue, 20 Feb 2024 13:34:42 +0100 Subject: [PATCH 1/6] updates workflow name --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0c68749d8..e31803dfd 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -575,7 +575,7 @@ jobs: shell: bash linuxTest_12: - name: Test run example 11 - Marmousi2 + name: Test run example 12 - Marmousi2 runs-on: ubuntu-latest needs: [linuxCheck] From 8732e2914c1cc136bfb0288eb9529f35574db929 Mon Sep 17 00:00:00 2001 From: Daniel Peter Date: Thu, 21 Mar 2024 16:20:56 +0100 Subject: [PATCH 2/6] updates citation license format (zenodo fix) --- CITATION.cff | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 588be3318..673728fba 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -10,8 +10,7 @@ type: software identifiers: - type: doi - value: 10.5281/zenodo.10415228 -license: -- gpl-3.0-or-later +license: "GPL-3.0" authors: - family-names: Komatitsch From ba5c95a8c93802e645525664f6928f41bdfd0750 Mon Sep 17 00:00:00 2001 From: Daniel Peter Date: Thu, 21 Mar 2024 17:33:40 +0100 Subject: [PATCH 3/6] cleans files --- .../Industrial_Format_SEP/interpolate.f90 | 6 +- .../CUBIT_meshing/README.md | 10 +- EXAMPLES/README.md | 4 +- .../adj_seismogram_Tape2007.f90 | 2 +- .../adj_seismogram_Tromp2005.f90 | 2 +- ...lution_viscoacoustic_Carcione_version1.f90 | 182 +++---- ...lution_viscoacoustic_Carcione_version1.f90 | 182 +++---- ..._strain_Carcione_correct_with_1_over_L.f90 | 190 ++++---- ..._strain_Carcione_correct_with_1_over_L.f90 | 190 ++++---- ..._strain_Carcione_correct_with_1_over_L.f90 | 190 ++++---- ...lution_viscoacoustic_Carcione_version1.f90 | 182 +++---- .../generate_topo_sinusoide.f90 | 2 +- ...esh_AK135F_2D_with_central_cube_no_PML.F90 | 136 +++--- .../compute_adjoint_source.f90 | 6 +- EXAMPLES/thermocline/extract_thermocline.f90 | 4 +- setup/config.fh.in | 4 +- src/meshfem2D/decompose_mesh.F90 | 2 +- src/meshfem2D/rotate_mesh.f90 | 16 +- src/meshfem2D/save_gnuplot_file.f90 | 8 +- src/shared/gll_library.f90 | 32 +- src/specfem2D/attenuation_model.f90 | 448 +++++++++--------- src/specfem2D/calendar.f90 | 8 +- src/specfem2D/check_grid.F90 | 56 +-- src/specfem2D/compute_arrays_source.f90 | 24 +- .../compute_coupling_poro_viscoelastic.f90 | 24 +- src/specfem2D/compute_energy.f90 | 4 +- src/specfem2D/convert_time.f90 | 68 +-- src/specfem2D/createnum_fast.f90 | 20 +- src/specfem2D/createnum_slow.f90 | 2 +- src/specfem2D/enforce_fields.f90 | 40 +- src/specfem2D/moving_sources_par.F90 | 4 +- src/specfem2D/noise_tomography.f90 | 4 +- src/specfem2D/plot_post.F90 | 24 +- src/specfem2D/pml_compute.f90 | 2 +- src/specfem2D/pml_init.F90 | 4 +- src/specfem2D/prepare_timerun.F90 | 104 ++-- src/specfem2D/read_forward_arrays.f90 | 2 +- src/specfem2D/read_mesh_databases.F90 | 8 +- src/specfem2D/sort_array_coordinates.F90 | 20 +- src/specfem2D/write_wavefield_dumps.F90 | 4 +- .../combine_sem.F90 | 2 +- .../sum_kernels_ascii.f90 | 4 +- src/tomography/sum_kernels.f90 | 2 +- .../add_CPML_layers_to_an_existing_mesh.f90 | 2 +- ..._layers_of_a_given_mesh_to_CPML_layers.f90 | 2 +- .../GMT/permute_color_palette.f90 | 6 +- .../meshfem2D_circular_canyon.f90 | 164 +++---- .../meshfem2D_non_struct_2.f90 | 72 +-- .../meshfem2D_non_struct_3.f90 | 72 +-- .../save_databases_Ra_Cleave.f90 | 4 +- utils/small_utilities/decimate_mesh.f90 | 22 +- utils/small_utilities/filter_input_trace.f90 | 26 +- ...gradient_of_a_field_with_the_SEM_Earth.f90 | 6 +- ...ient_of_a_field_with_the_SEM_rectangle.f90 | 6 +- .../define_derivation_matrices.f90 | 8 +- .../gll_library.f90 | 28 +- .../lagrange_poly.f90 | 10 +- .../recompute_jacobian.f90 | 2 +- .../create_color_image.f90 | 2 +- .../createnum_slow.f90 | 12 +- .../define_derivation_matrices.f90 | 6 +- .../gll_library.f90 | 28 +- .../lagrange_poly.f90 | 10 +- .../plot_post.f90 | 18 +- .../plot_post_with_ITZ_for_Ting.f90 | 18 +- .../plot_post_with_modif_KH.f90 | 20 +- .../recompute_jacobian.f90 | 4 +- .../specfem2D_axisymmetric.f90 | 4 +- .../specfem2D_plane_strain.f90 | 4 +- ...ecfem2D_plane_strain_with_ITZ_for_Ting.f90 | 8 +- .../specfem2D_plane_strain_with_modif_KH.f90 | 4 +- 71 files changed, 1398 insertions(+), 1398 deletions(-) diff --git a/EXAMPLES/Industrial_Format_SEP/interpolate.f90 b/EXAMPLES/Industrial_Format_SEP/interpolate.f90 index e985edee1..d2d158ce2 100644 --- a/EXAMPLES/Industrial_Format_SEP/interpolate.f90 +++ b/EXAMPLES/Industrial_Format_SEP/interpolate.f90 @@ -343,7 +343,7 @@ subroutine READ_SEP_HEADER(sep_directory,sep_header_file, & integer :: ier character(len=512) :: junk,sep_header_file_complete - sep_header_file_complete=trim(adjustl(sep_directory))//trim(adjustl(sep_header_file)) + sep_header_file_complete = trim(adjustl(sep_directory))//trim(adjustl(sep_header_file)) open(unit=13,file=trim(adjustl(sep_header_file_complete)),status='old',iostat=ier) print * @@ -365,8 +365,8 @@ subroutine READ_SEP_HEADER(sep_directory,sep_header_file, & read(13,'(a6i10)') junk, esize read(13,'(a13a)') junk, data_format close(13) - sep_file=trim(adjustl(sep_directory))//trim(adjustl(sep_file)) - data_format=data_format(1:len_trim(adjustl(data_format))-1) + sep_file = trim(adjustl(sep_directory))//trim(adjustl(sep_file)) + data_format = data_format(1:len_trim(adjustl(data_format))-1) print * print *, 'sep file specified in the header file is: ', trim(adjustl(sep_file)) diff --git a/EXAMPLES/Marmousi_mesh_of_the_model/CUBIT_meshing/README.md b/EXAMPLES/Marmousi_mesh_of_the_model/CUBIT_meshing/README.md index 0b71a9dbe..409fca52b 100644 --- a/EXAMPLES/Marmousi_mesh_of_the_model/CUBIT_meshing/README.md +++ b/EXAMPLES/Marmousi_mesh_of_the_model/CUBIT_meshing/README.md @@ -28,7 +28,7 @@ Just run in consecutive order, or open in CUBIT/Trelis -> run script: ``` ./5_convert_surface_rock_to_velocities.py ``` - to create a file nummaterial_velocity_file_marmousi2. This will assign the original water layer to the mesh. + to create a file nummaterial_velocity_file_marmousi2. This will assign the original water layer to the mesh. To replace the water layer with solid velocities as in Capdeville et al. 2010, use ``` ./5_convert_surface_rock_to_velocities.py --without-water @@ -39,9 +39,9 @@ Just run in consecutive order, or open in CUBIT/Trelis -> run script: To run these python scripts in the command line, instead of opening the Cubit application and use the "run script"-Button, you will need to make sure that within the python environment you can load the "cubit" module. -The most recent Coreform-Cubit version is 2023.11. It uses internally a python3.10 version. +The most recent Coreform-Cubit version is 2023.11. It uses internally a python3.10 version. The details below describe how such a installation setup could look like for MacOS. - + * for MacOS: it requires to run this python script with the shipped Cubit version python (due to different architecture compilations). @@ -60,7 +60,7 @@ The details below describe how such a installation setup could look like for Mac ``` or create a symbolic link to the python version in `/usr/local/bin`: - ``` + ``` sudo ln -s /Applications/Coreform-Cubit-2023.11.app/Contents/lib/python3/Python.framework/Versions/3.10/python3.10 python-cubit ``` @@ -69,6 +69,6 @@ The details below describe how such a installation setup could look like for Mac - to import the cubit module, this also requires to add the Cubit library path to the `PYTHONPATH` environment variable, in `~/.bashrc` use: ``` export PYTHONPATH=$PYTHONPATH:${CUBITDIR}/Contents/lib/ - ``` + ``` diff --git a/EXAMPLES/README.md b/EXAMPLES/README.md index 7f316075e..d6fcda45e 100644 --- a/EXAMPLES/README.md +++ b/EXAMPLES/README.md @@ -3,13 +3,13 @@ README This directory contains a set of examples to familiarize yourself with different modeling setups and for testing purposes. -Each example requires a `Par_file`, `SOURCE`, and either a file of interfaces OR an external mesh. +Each example requires a `Par_file`, `SOURCE`, and either a file of interfaces OR an external mesh. The examples can be run in the current example directory, using the processing script: ``` ./run_this_example.sh ``` -If you're interested in how to setup and run a simple SPECFEM2D simulation, +If you're interested in how to setup and run a simple SPECFEM2D simulation, we suggest to look at the **simple_topography_and_also_a_simple_fluid_layer/** example. Please **consider submitting your own example** to this package! diff --git a/EXAMPLES/Tape2007_kernel/adj_seismogram_Tape2007.f90 b/EXAMPLES/Tape2007_kernel/adj_seismogram_Tape2007.f90 index 2061ba463..a274aba37 100644 --- a/EXAMPLES/Tape2007_kernel/adj_seismogram_Tape2007.f90 +++ b/EXAMPLES/Tape2007_kernel/adj_seismogram_Tape2007.f90 @@ -188,7 +188,7 @@ program adj_seismogram ft_bar(:) = 0.d0 endif - do itime =1,NSTEP + do itime = 1,NSTEP if (icomp == adj_comp) then write(11,*) (itime-1)*deltat - t0, ft_bar(itime) else diff --git a/EXAMPLES/Tromp2005_kernel/adj_seismogram_Tromp2005.f90 b/EXAMPLES/Tromp2005_kernel/adj_seismogram_Tromp2005.f90 index 112c8a93e..2c39b7266 100644 --- a/EXAMPLES/Tromp2005_kernel/adj_seismogram_Tromp2005.f90 +++ b/EXAMPLES/Tromp2005_kernel/adj_seismogram_Tromp2005.f90 @@ -221,7 +221,7 @@ program adj_seismogram ft_bar(:) = 0.d0 endif - do itime =1,NSTEP + do itime = 1,NSTEP if (icomp == adj_comp) then write(11,*) (itime-1)*deltat - t0, ft_bar(itime) else diff --git a/EXAMPLES/attenuation/viscoacoustic_attenuation_off_versus_analytical/no_attenuation_analytical/analytical_solution_viscoacoustic_Carcione_version1.f90 b/EXAMPLES/attenuation/viscoacoustic_attenuation_off_versus_analytical/no_attenuation_analytical/analytical_solution_viscoacoustic_Carcione_version1.f90 index 11329e288..78d6297cf 100644 --- a/EXAMPLES/attenuation/viscoacoustic_attenuation_off_versus_analytical/no_attenuation_analytical/analytical_solution_viscoacoustic_Carcione_version1.f90 +++ b/EXAMPLES/attenuation/viscoacoustic_attenuation_off_versus_analytical/no_attenuation_analytical/analytical_solution_viscoacoustic_Carcione_version1.f90 @@ -141,7 +141,7 @@ program analytical_solution deltat = 1.d0 / (freqmax*dble(iratio)) ! define the spectrum of the source - do ifreq=0,nfreq + do ifreq = 0,nfreq freq = deltafreq * dble(ifreq) omega = 2.d0 * pi * freq @@ -176,7 +176,7 @@ program analytical_solution ! ************** calcul solution analytique **************** ! d'apres Carcione GJI vol 95 p 611 (1988) - do ifreq=0,nfreq + do ifreq = 0,nfreq freq = deltafreq * dble(ifreq) omega = 2.d0 * pi * freq @@ -248,7 +248,7 @@ program analytical_solution ! use the Fourier values for pressure c(1) = cmplx(phi1(0)) - do ifreq=1,nfreq-2 + do ifreq = 1,nfreq-2 c(ifreq+1) = cmplx(phi1(ifreq)) c(nt+1-ifreq) = conjg(cmplx(phi1(ifreq))) enddo @@ -304,7 +304,7 @@ program analytical_solution endif endif - do it=1,nt + do it = 1,nt ! DK DK Dec 2011: subtract t0 to be consistent with the SPECFEM2D code time = dble(it-1)*deltat - t0 ! the seismograms are very long due to the very large number of FFT points used, @@ -404,7 +404,7 @@ subroutine CFFTB1 (N,C,CH,WA,IFAC) NA = 0 L1 = 1 IW = 1 - DO 116 K1=1,NF + DO 116 K1 = 1,NF IP = IFAC(K1+2) L2 = IP*L1 IDO = N/L2 @@ -454,7 +454,7 @@ subroutine CFFTB1 (N,C,CH,WA,IFAC) 116 continue if (NA == 0) return N2 = N+N - DO 117 I=1,N2 + DO 117 I = 1,N2 C(I) = CH(I) 117 continue END @@ -470,66 +470,66 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) IDP = IP*IDO if (IDO < L1) goto 106 - DO 103 J=2,IPPH + DO 103 J = 2,IPPH JC = IPP2-J - DO 102 K=1,L1 - DO 101 I=1,IDO + DO 102 K = 1,L1 + DO 101 I = 1,IDO CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 101 continue 102 continue 103 continue - DO 105 K=1,L1 - DO 104 I=1,IDO + DO 105 K = 1,L1 + DO 104 I = 1,IDO CH(I,K,1) = CC(I,1,K) 104 continue 105 continue goto 112 - 106 DO 109 J=2,IPPH + 106 DO 109 J = 2,IPPH JC = IPP2-J - DO 108 I=1,IDO - DO 107 K=1,L1 + DO 108 I = 1,IDO + DO 107 K = 1,L1 CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 107 continue 108 continue 109 continue - DO 111 I=1,IDO - DO 110 K=1,L1 + DO 111 I = 1,IDO + DO 110 K = 1,L1 CH(I,K,1) = CC(I,1,K) 110 continue 111 continue 112 IDL = 2-IDO INC = 0 - DO 116 L=2,IPPH + DO 116 L = 2,IPPH LC = IPP2-L IDL = IDL+IDO - DO 113 IK=1,IDL1 + DO 113 IK = 1,IDL1 C2(IK,L) = CH2(IK,1)+WA(IDL-1)*CH2(IK,2) C2(IK,LC) = WA(IDL)*CH2(IK,IP) 113 continue IDLJ = IDL INC = INC+IDO - DO 115 J=3,IPPH + DO 115 J = 3,IPPH JC = IPP2-J IDLJ = IDLJ+INC if (IDLJ > IDP) IDLJ = IDLJ-IDP WAR = WA(IDLJ-1) WAI = WA(IDLJ) - DO 114 IK=1,IDL1 + DO 114 IK = 1,IDL1 C2(IK,L) = C2(IK,L)+WAR*CH2(IK,J) C2(IK,LC) = C2(IK,LC)+WAI*CH2(IK,JC) 114 continue 115 continue 116 continue - DO 118 J=2,IPPH - DO 117 IK=1,IDL1 + DO 118 J = 2,IPPH + DO 117 IK = 1,IDL1 CH2(IK,1) = CH2(IK,1)+CH2(IK,J) 117 continue 118 continue - DO 120 J=2,IPPH + DO 120 J = 2,IPPH JC = IPP2-J - DO 119 IK=2,IDL1,2 + DO 119 IK = 2,IDL1,2 CH2(IK-1,J) = C2(IK-1,J)-C2(IK,JC) CH2(IK-1,JC) = C2(IK-1,J)+C2(IK,JC) CH2(IK,J) = C2(IK,J)+C2(IK-1,JC) @@ -539,22 +539,22 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) NAC = 1 if (IDO == 2) return NAC = 0 - DO 121 IK=1,IDL1 + DO 121 IK = 1,IDL1 C2(IK,1) = CH2(IK,1) 121 continue - DO 123 J=2,IP - DO 122 K=1,L1 + DO 123 J = 2,IP + DO 122 K = 1,L1 C1(1,K,J) = CH(1,K,J) C1(2,K,J) = CH(2,K,J) 122 continue 123 continue if (IDOT > L1) goto 127 IDIJ = 0 - DO 126 J=2,IP + DO 126 J = 2,IP IDIJ = IDIJ+2 - DO 125 I=4,IDO,2 + DO 125 I = 4,IDO,2 IDIJ = IDIJ+2 - DO 124 K=1,L1 + DO 124 K = 1,L1 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)-WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)+WA(IDIJ)*CH(I-1,K,J) 124 continue @@ -562,11 +562,11 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) 126 continue return 127 IDJ = 2-IDO - DO 130 J=2,IP + DO 130 J = 2,IP IDJ = IDJ+IDO - DO 129 K=1,L1 + DO 129 K = 1,L1 IDIJ = IDJ - DO 128 I=4,IDO,2 + DO 128 I = 4,IDO,2 IDIJ = IDIJ+2 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)-WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)+WA(IDIJ)*CH(I-1,K,J) @@ -579,15 +579,15 @@ subroutine PASSB2 (IDO,L1,CC,CH,WA1) DIMENSION CC(IDO,2,L1) ,CH(IDO,L1,2), & WA1(1) if (IDO > 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 CH(1,K,1) = CC(1,1,K)+CC(1,2,K) CH(1,K,2) = CC(1,1,K)-CC(1,2,K) CH(2,K,1) = CC(2,1,K)+CC(2,2,K) CH(2,K,2) = CC(2,1,K)-CC(2,2,K) 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 CH(I-1,K,1) = CC(I-1,1,K)+CC(I-1,2,K) TR2 = CC(I-1,1,K)-CC(I-1,2,K) CH(I,K,1) = CC(I,1,K)+CC(I,2,K) @@ -603,7 +603,7 @@ subroutine PASSB3 (IDO,L1,CC,CH,WA1,WA2) WA1(1) ,WA2(1) DATA TAUR,TAUI /-.5,.866025403784439/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TR2 = CC(1,2,K)+CC(1,3,K) CR2 = CC(1,1,K)+TAUR*TR2 CH(1,K,1) = CC(1,1,K)+TR2 @@ -618,8 +618,8 @@ subroutine PASSB3 (IDO,L1,CC,CH,WA1,WA2) CH(2,K,3) = CI2-CR3 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TR2 = CC(I-1,2,K)+CC(I-1,3,K) CR2 = CC(I-1,1,K)+TAUR*TR2 CH(I-1,K,1) = CC(I-1,1,K)+TR2 @@ -644,7 +644,7 @@ subroutine PASSB4 (IDO,L1,CC,CH,WA1,WA2,WA3) DIMENSION CC(IDO,4,L1) ,CH(IDO,L1,4), & WA1(1) ,WA2(1) ,WA3(1) if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI1 = CC(2,1,K)-CC(2,3,K) TI2 = CC(2,1,K)+CC(2,3,K) TR4 = CC(2,4,K)-CC(2,2,K) @@ -663,8 +663,8 @@ subroutine PASSB4 (IDO,L1,CC,CH,WA1,WA2,WA3) CH(2,K,4) = TI1-TI4 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI1 = CC(I,1,K)-CC(I,3,K) TI2 = CC(I,1,K)+CC(I,3,K) TI3 = CC(I,2,K)+CC(I,4,K) @@ -697,7 +697,7 @@ subroutine PASSB5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) DATA TR11,TI11,TR12,TI12 /.309016994374947,.951056516295154, & -.809016994374947,.587785252292473/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI5 = CC(2,2,K)-CC(2,5,K) TI2 = CC(2,2,K)+CC(2,5,K) TI4 = CC(2,3,K)-CC(2,4,K) @@ -726,8 +726,8 @@ subroutine PASSB5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) CH(2,K,5) = CI2-CR5 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI5 = CC(I,2,K)-CC(I,5,K) TI2 = CC(I,2,K)+CC(I,5,K) TI4 = CC(I,3,K)-CC(I,4,K) @@ -793,7 +793,7 @@ subroutine CFFTI1 (N,WA,IFAC) NL = NQ if (NTRY /= 2) goto 107 if (NF == 1) goto 107 - DO 106 I=2,NF + DO 106 I = 2,NF IB = NF-I+2 IFAC(IB+2) = IFAC(IB+1) 106 continue @@ -805,21 +805,21 @@ subroutine CFFTI1 (N,WA,IFAC) ARGH = TPI/FLOAT(N) I = 2 L1 = 1 - DO 110 K1=1,NF + DO 110 K1 = 1,NF IP = IFAC(K1+2) LD = 0 L2 = L1*IP IDO = N/L2 IDOT = IDO+IDO+2 IPM = IP-1 - DO 109 J=1,IPM + DO 109 J = 1,IPM I1 = I WA(I-1) = 1. WA(I) = 0. LD = LD+L1 FI = 0. ARGLD = FLOAT(LD)*ARGH - DO 108 II=4,IDOT,2 + DO 108 II = 4,IDOT,2 I = I+2 FI = FI+1. ARG = FI*ARGLD @@ -848,7 +848,7 @@ subroutine CFFTF1 (N,C,CH,WA,IFAC) NA = 0 L1 = 1 IW = 1 - DO 116 K1=1,NF + DO 116 K1 = 1,NF IP = IFAC(K1+2) L2 = IP*L1 IDO = N/L2 @@ -898,7 +898,7 @@ subroutine CFFTF1 (N,C,CH,WA,IFAC) 116 continue if (NA == 0) return N2 = N+N - DO 117 I=1,N2 + DO 117 I = 1,N2 C(I) = CH(I) 117 continue END @@ -914,66 +914,66 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) IDP = IP*IDO if (IDO < L1) goto 106 - DO 103 J=2,IPPH + DO 103 J = 2,IPPH JC = IPP2-J - DO 102 K=1,L1 - DO 101 I=1,IDO + DO 102 K = 1,L1 + DO 101 I = 1,IDO CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 101 continue 102 continue 103 continue - DO 105 K=1,L1 - DO 104 I=1,IDO + DO 105 K = 1,L1 + DO 104 I = 1,IDO CH(I,K,1) = CC(I,1,K) 104 continue 105 continue goto 112 - 106 DO 109 J=2,IPPH + 106 DO 109 J = 2,IPPH JC = IPP2-J - DO 108 I=1,IDO - DO 107 K=1,L1 + DO 108 I = 1,IDO + DO 107 K = 1,L1 CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 107 continue 108 continue 109 continue - DO 111 I=1,IDO - DO 110 K=1,L1 + DO 111 I = 1,IDO + DO 110 K = 1,L1 CH(I,K,1) = CC(I,1,K) 110 continue 111 continue 112 IDL = 2-IDO INC = 0 - DO 116 L=2,IPPH + DO 116 L = 2,IPPH LC = IPP2-L IDL = IDL+IDO - DO 113 IK=1,IDL1 + DO 113 IK = 1,IDL1 C2(IK,L) = CH2(IK,1)+WA(IDL-1)*CH2(IK,2) C2(IK,LC) = -WA(IDL)*CH2(IK,IP) 113 continue IDLJ = IDL INC = INC+IDO - DO 115 J=3,IPPH + DO 115 J = 3,IPPH JC = IPP2-J IDLJ = IDLJ+INC if (IDLJ > IDP) IDLJ = IDLJ-IDP WAR = WA(IDLJ-1) WAI = WA(IDLJ) - DO 114 IK=1,IDL1 + DO 114 IK = 1,IDL1 C2(IK,L) = C2(IK,L)+WAR*CH2(IK,J) C2(IK,LC) = C2(IK,LC)-WAI*CH2(IK,JC) 114 continue 115 continue 116 continue - DO 118 J=2,IPPH - DO 117 IK=1,IDL1 + DO 118 J = 2,IPPH + DO 117 IK = 1,IDL1 CH2(IK,1) = CH2(IK,1)+CH2(IK,J) 117 continue 118 continue - DO 120 J=2,IPPH + DO 120 J = 2,IPPH JC = IPP2-J - DO 119 IK=2,IDL1,2 + DO 119 IK = 2,IDL1,2 CH2(IK-1,J) = C2(IK-1,J)-C2(IK,JC) CH2(IK-1,JC) = C2(IK-1,J)+C2(IK,JC) CH2(IK,J) = C2(IK,J)+C2(IK-1,JC) @@ -983,22 +983,22 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) NAC = 1 if (IDO == 2) return NAC = 0 - DO 121 IK=1,IDL1 + DO 121 IK = 1,IDL1 C2(IK,1) = CH2(IK,1) 121 continue - DO 123 J=2,IP - DO 122 K=1,L1 + DO 123 J = 2,IP + DO 122 K = 1,L1 C1(1,K,J) = CH(1,K,J) C1(2,K,J) = CH(2,K,J) 122 continue 123 continue if (IDOT > L1) goto 127 IDIJ = 0 - DO 126 J=2,IP + DO 126 J = 2,IP IDIJ = IDIJ+2 - DO 125 I=4,IDO,2 + DO 125 I = 4,IDO,2 IDIJ = IDIJ+2 - DO 124 K=1,L1 + DO 124 K = 1,L1 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)+WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)-WA(IDIJ)*CH(I-1,K,J) 124 continue @@ -1006,11 +1006,11 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) 126 continue return 127 IDJ = 2-IDO - DO 130 J=2,IP + DO 130 J = 2,IP IDJ = IDJ+IDO - DO 129 K=1,L1 + DO 129 K = 1,L1 IDIJ = IDJ - DO 128 I=4,IDO,2 + DO 128 I = 4,IDO,2 IDIJ = IDIJ+2 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)+WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)-WA(IDIJ)*CH(I-1,K,J) @@ -1023,15 +1023,15 @@ subroutine PASSF2 (IDO,L1,CC,CH,WA1) DIMENSION CC(IDO,2,L1) ,CH(IDO,L1,2), & WA1(1) if (IDO > 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 CH(1,K,1) = CC(1,1,K)+CC(1,2,K) CH(1,K,2) = CC(1,1,K)-CC(1,2,K) CH(2,K,1) = CC(2,1,K)+CC(2,2,K) CH(2,K,2) = CC(2,1,K)-CC(2,2,K) 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 CH(I-1,K,1) = CC(I-1,1,K)+CC(I-1,2,K) TR2 = CC(I-1,1,K)-CC(I-1,2,K) CH(I,K,1) = CC(I,1,K)+CC(I,2,K) @@ -1047,7 +1047,7 @@ subroutine PASSF3 (IDO,L1,CC,CH,WA1,WA2) WA1(1) ,WA2(1) DATA TAUR,TAUI /-.5,-.866025403784439/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TR2 = CC(1,2,K)+CC(1,3,K) CR2 = CC(1,1,K)+TAUR*TR2 CH(1,K,1) = CC(1,1,K)+TR2 @@ -1062,8 +1062,8 @@ subroutine PASSF3 (IDO,L1,CC,CH,WA1,WA2) CH(2,K,3) = CI2-CR3 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TR2 = CC(I-1,2,K)+CC(I-1,3,K) CR2 = CC(I-1,1,K)+TAUR*TR2 CH(I-1,K,1) = CC(I-1,1,K)+TR2 @@ -1088,7 +1088,7 @@ subroutine PASSF4 (IDO,L1,CC,CH,WA1,WA2,WA3) DIMENSION CC(IDO,4,L1) ,CH(IDO,L1,4), & WA1(1) ,WA2(1) ,WA3(1) if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI1 = CC(2,1,K)-CC(2,3,K) TI2 = CC(2,1,K)+CC(2,3,K) TR4 = CC(2,2,K)-CC(2,4,K) @@ -1107,8 +1107,8 @@ subroutine PASSF4 (IDO,L1,CC,CH,WA1,WA2,WA3) CH(2,K,4) = TI1-TI4 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI1 = CC(I,1,K)-CC(I,3,K) TI2 = CC(I,1,K)+CC(I,3,K) TI3 = CC(I,2,K)+CC(I,4,K) @@ -1141,7 +1141,7 @@ subroutine PASSF5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) DATA TR11,TI11,TR12,TI12 /.309016994374947,-.951056516295154, & -.809016994374947,-.587785252292473/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI5 = CC(2,2,K)-CC(2,5,K) TI2 = CC(2,2,K)+CC(2,5,K) TI4 = CC(2,3,K)-CC(2,4,K) @@ -1170,8 +1170,8 @@ subroutine PASSF5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) CH(2,K,5) = CI2-CR5 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI5 = CC(I,2,K)-CC(I,5,K) TI2 = CC(I,2,K)+CC(I,5,K) TI4 = CC(I,3,K)-CC(I,4,K) @@ -7611,7 +7611,7 @@ subroutine X04BAE(NOUT,REC) if (REC(I:I) /= ' ') goto 40 20 continue ! Write record to external file - 40 WRITE (NOUT,FMT=99999) REC(1:I) + 40 WRITE (NOUT,FMT = 99999) REC(1:I) endif return ! diff --git a/EXAMPLES/attenuation/viscoacoustic_attenuation_on_versus_analytical/attenuation_viscoacoustic_NSLS_3/analytical_solution_viscoacoustic_Carcione_version1.f90 b/EXAMPLES/attenuation/viscoacoustic_attenuation_on_versus_analytical/attenuation_viscoacoustic_NSLS_3/analytical_solution_viscoacoustic_Carcione_version1.f90 index 298e3ff41..403275561 100644 --- a/EXAMPLES/attenuation/viscoacoustic_attenuation_on_versus_analytical/attenuation_viscoacoustic_NSLS_3/analytical_solution_viscoacoustic_Carcione_version1.f90 +++ b/EXAMPLES/attenuation/viscoacoustic_attenuation_on_versus_analytical/attenuation_viscoacoustic_NSLS_3/analytical_solution_viscoacoustic_Carcione_version1.f90 @@ -141,7 +141,7 @@ program analytical_solution deltat = 1.d0 / (freqmax*dble(iratio)) ! define the spectrum of the source - do ifreq=0,nfreq + do ifreq = 0,nfreq freq = deltafreq * dble(ifreq) omega = 2.d0 * pi * freq @@ -176,7 +176,7 @@ program analytical_solution ! ************** calcul solution analytique **************** ! d'apres Carcione GJI vol 95 p 611 (1988) - do ifreq=0,nfreq + do ifreq = 0,nfreq freq = deltafreq * dble(ifreq) omega = 2.d0 * pi * freq @@ -248,7 +248,7 @@ program analytical_solution ! use the Fourier values for pressure c(1) = cmplx(phi1(0)) - do ifreq=1,nfreq-2 + do ifreq = 1,nfreq-2 c(ifreq+1) = cmplx(phi1(ifreq)) c(nt+1-ifreq) = conjg(cmplx(phi1(ifreq))) enddo @@ -304,7 +304,7 @@ program analytical_solution endif endif - do it=1,nt + do it = 1,nt ! DK DK Dec 2011: subtract t0 to be consistent with the SPECFEM2D code time = dble(it-1)*deltat - t0 ! the seismograms are very long due to the very large number of FFT points used, @@ -404,7 +404,7 @@ subroutine CFFTB1 (N,C,CH,WA,IFAC) NA = 0 L1 = 1 IW = 1 - DO 116 K1=1,NF + DO 116 K1 = 1,NF IP = IFAC(K1+2) L2 = IP*L1 IDO = N/L2 @@ -454,7 +454,7 @@ subroutine CFFTB1 (N,C,CH,WA,IFAC) 116 continue if (NA == 0) return N2 = N+N - DO 117 I=1,N2 + DO 117 I = 1,N2 C(I) = CH(I) 117 continue END @@ -470,66 +470,66 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) IDP = IP*IDO if (IDO < L1) goto 106 - DO 103 J=2,IPPH + DO 103 J = 2,IPPH JC = IPP2-J - DO 102 K=1,L1 - DO 101 I=1,IDO + DO 102 K = 1,L1 + DO 101 I = 1,IDO CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 101 continue 102 continue 103 continue - DO 105 K=1,L1 - DO 104 I=1,IDO + DO 105 K = 1,L1 + DO 104 I = 1,IDO CH(I,K,1) = CC(I,1,K) 104 continue 105 continue goto 112 - 106 DO 109 J=2,IPPH + 106 DO 109 J = 2,IPPH JC = IPP2-J - DO 108 I=1,IDO - DO 107 K=1,L1 + DO 108 I = 1,IDO + DO 107 K = 1,L1 CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 107 continue 108 continue 109 continue - DO 111 I=1,IDO - DO 110 K=1,L1 + DO 111 I = 1,IDO + DO 110 K = 1,L1 CH(I,K,1) = CC(I,1,K) 110 continue 111 continue 112 IDL = 2-IDO INC = 0 - DO 116 L=2,IPPH + DO 116 L = 2,IPPH LC = IPP2-L IDL = IDL+IDO - DO 113 IK=1,IDL1 + DO 113 IK = 1,IDL1 C2(IK,L) = CH2(IK,1)+WA(IDL-1)*CH2(IK,2) C2(IK,LC) = WA(IDL)*CH2(IK,IP) 113 continue IDLJ = IDL INC = INC+IDO - DO 115 J=3,IPPH + DO 115 J = 3,IPPH JC = IPP2-J IDLJ = IDLJ+INC if (IDLJ > IDP) IDLJ = IDLJ-IDP WAR = WA(IDLJ-1) WAI = WA(IDLJ) - DO 114 IK=1,IDL1 + DO 114 IK = 1,IDL1 C2(IK,L) = C2(IK,L)+WAR*CH2(IK,J) C2(IK,LC) = C2(IK,LC)+WAI*CH2(IK,JC) 114 continue 115 continue 116 continue - DO 118 J=2,IPPH - DO 117 IK=1,IDL1 + DO 118 J = 2,IPPH + DO 117 IK = 1,IDL1 CH2(IK,1) = CH2(IK,1)+CH2(IK,J) 117 continue 118 continue - DO 120 J=2,IPPH + DO 120 J = 2,IPPH JC = IPP2-J - DO 119 IK=2,IDL1,2 + DO 119 IK = 2,IDL1,2 CH2(IK-1,J) = C2(IK-1,J)-C2(IK,JC) CH2(IK-1,JC) = C2(IK-1,J)+C2(IK,JC) CH2(IK,J) = C2(IK,J)+C2(IK-1,JC) @@ -539,22 +539,22 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) NAC = 1 if (IDO == 2) return NAC = 0 - DO 121 IK=1,IDL1 + DO 121 IK = 1,IDL1 C2(IK,1) = CH2(IK,1) 121 continue - DO 123 J=2,IP - DO 122 K=1,L1 + DO 123 J = 2,IP + DO 122 K = 1,L1 C1(1,K,J) = CH(1,K,J) C1(2,K,J) = CH(2,K,J) 122 continue 123 continue if (IDOT > L1) goto 127 IDIJ = 0 - DO 126 J=2,IP + DO 126 J = 2,IP IDIJ = IDIJ+2 - DO 125 I=4,IDO,2 + DO 125 I = 4,IDO,2 IDIJ = IDIJ+2 - DO 124 K=1,L1 + DO 124 K = 1,L1 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)-WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)+WA(IDIJ)*CH(I-1,K,J) 124 continue @@ -562,11 +562,11 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) 126 continue return 127 IDJ = 2-IDO - DO 130 J=2,IP + DO 130 J = 2,IP IDJ = IDJ+IDO - DO 129 K=1,L1 + DO 129 K = 1,L1 IDIJ = IDJ - DO 128 I=4,IDO,2 + DO 128 I = 4,IDO,2 IDIJ = IDIJ+2 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)-WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)+WA(IDIJ)*CH(I-1,K,J) @@ -579,15 +579,15 @@ subroutine PASSB2 (IDO,L1,CC,CH,WA1) DIMENSION CC(IDO,2,L1) ,CH(IDO,L1,2), & WA1(1) if (IDO > 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 CH(1,K,1) = CC(1,1,K)+CC(1,2,K) CH(1,K,2) = CC(1,1,K)-CC(1,2,K) CH(2,K,1) = CC(2,1,K)+CC(2,2,K) CH(2,K,2) = CC(2,1,K)-CC(2,2,K) 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 CH(I-1,K,1) = CC(I-1,1,K)+CC(I-1,2,K) TR2 = CC(I-1,1,K)-CC(I-1,2,K) CH(I,K,1) = CC(I,1,K)+CC(I,2,K) @@ -603,7 +603,7 @@ subroutine PASSB3 (IDO,L1,CC,CH,WA1,WA2) WA1(1) ,WA2(1) DATA TAUR,TAUI /-.5,.866025403784439/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TR2 = CC(1,2,K)+CC(1,3,K) CR2 = CC(1,1,K)+TAUR*TR2 CH(1,K,1) = CC(1,1,K)+TR2 @@ -618,8 +618,8 @@ subroutine PASSB3 (IDO,L1,CC,CH,WA1,WA2) CH(2,K,3) = CI2-CR3 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TR2 = CC(I-1,2,K)+CC(I-1,3,K) CR2 = CC(I-1,1,K)+TAUR*TR2 CH(I-1,K,1) = CC(I-1,1,K)+TR2 @@ -644,7 +644,7 @@ subroutine PASSB4 (IDO,L1,CC,CH,WA1,WA2,WA3) DIMENSION CC(IDO,4,L1) ,CH(IDO,L1,4), & WA1(1) ,WA2(1) ,WA3(1) if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI1 = CC(2,1,K)-CC(2,3,K) TI2 = CC(2,1,K)+CC(2,3,K) TR4 = CC(2,4,K)-CC(2,2,K) @@ -663,8 +663,8 @@ subroutine PASSB4 (IDO,L1,CC,CH,WA1,WA2,WA3) CH(2,K,4) = TI1-TI4 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI1 = CC(I,1,K)-CC(I,3,K) TI2 = CC(I,1,K)+CC(I,3,K) TI3 = CC(I,2,K)+CC(I,4,K) @@ -697,7 +697,7 @@ subroutine PASSB5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) DATA TR11,TI11,TR12,TI12 /.309016994374947,.951056516295154, & -.809016994374947,.587785252292473/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI5 = CC(2,2,K)-CC(2,5,K) TI2 = CC(2,2,K)+CC(2,5,K) TI4 = CC(2,3,K)-CC(2,4,K) @@ -726,8 +726,8 @@ subroutine PASSB5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) CH(2,K,5) = CI2-CR5 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI5 = CC(I,2,K)-CC(I,5,K) TI2 = CC(I,2,K)+CC(I,5,K) TI4 = CC(I,3,K)-CC(I,4,K) @@ -793,7 +793,7 @@ subroutine CFFTI1 (N,WA,IFAC) NL = NQ if (NTRY /= 2) goto 107 if (NF == 1) goto 107 - DO 106 I=2,NF + DO 106 I = 2,NF IB = NF-I+2 IFAC(IB+2) = IFAC(IB+1) 106 continue @@ -805,21 +805,21 @@ subroutine CFFTI1 (N,WA,IFAC) ARGH = TPI/FLOAT(N) I = 2 L1 = 1 - DO 110 K1=1,NF + DO 110 K1 = 1,NF IP = IFAC(K1+2) LD = 0 L2 = L1*IP IDO = N/L2 IDOT = IDO+IDO+2 IPM = IP-1 - DO 109 J=1,IPM + DO 109 J = 1,IPM I1 = I WA(I-1) = 1. WA(I) = 0. LD = LD+L1 FI = 0. ARGLD = FLOAT(LD)*ARGH - DO 108 II=4,IDOT,2 + DO 108 II = 4,IDOT,2 I = I+2 FI = FI+1. ARG = FI*ARGLD @@ -848,7 +848,7 @@ subroutine CFFTF1 (N,C,CH,WA,IFAC) NA = 0 L1 = 1 IW = 1 - DO 116 K1=1,NF + DO 116 K1 = 1,NF IP = IFAC(K1+2) L2 = IP*L1 IDO = N/L2 @@ -898,7 +898,7 @@ subroutine CFFTF1 (N,C,CH,WA,IFAC) 116 continue if (NA == 0) return N2 = N+N - DO 117 I=1,N2 + DO 117 I = 1,N2 C(I) = CH(I) 117 continue END @@ -914,66 +914,66 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) IDP = IP*IDO if (IDO < L1) goto 106 - DO 103 J=2,IPPH + DO 103 J = 2,IPPH JC = IPP2-J - DO 102 K=1,L1 - DO 101 I=1,IDO + DO 102 K = 1,L1 + DO 101 I = 1,IDO CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 101 continue 102 continue 103 continue - DO 105 K=1,L1 - DO 104 I=1,IDO + DO 105 K = 1,L1 + DO 104 I = 1,IDO CH(I,K,1) = CC(I,1,K) 104 continue 105 continue goto 112 - 106 DO 109 J=2,IPPH + 106 DO 109 J = 2,IPPH JC = IPP2-J - DO 108 I=1,IDO - DO 107 K=1,L1 + DO 108 I = 1,IDO + DO 107 K = 1,L1 CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 107 continue 108 continue 109 continue - DO 111 I=1,IDO - DO 110 K=1,L1 + DO 111 I = 1,IDO + DO 110 K = 1,L1 CH(I,K,1) = CC(I,1,K) 110 continue 111 continue 112 IDL = 2-IDO INC = 0 - DO 116 L=2,IPPH + DO 116 L = 2,IPPH LC = IPP2-L IDL = IDL+IDO - DO 113 IK=1,IDL1 + DO 113 IK = 1,IDL1 C2(IK,L) = CH2(IK,1)+WA(IDL-1)*CH2(IK,2) C2(IK,LC) = -WA(IDL)*CH2(IK,IP) 113 continue IDLJ = IDL INC = INC+IDO - DO 115 J=3,IPPH + DO 115 J = 3,IPPH JC = IPP2-J IDLJ = IDLJ+INC if (IDLJ > IDP) IDLJ = IDLJ-IDP WAR = WA(IDLJ-1) WAI = WA(IDLJ) - DO 114 IK=1,IDL1 + DO 114 IK = 1,IDL1 C2(IK,L) = C2(IK,L)+WAR*CH2(IK,J) C2(IK,LC) = C2(IK,LC)-WAI*CH2(IK,JC) 114 continue 115 continue 116 continue - DO 118 J=2,IPPH - DO 117 IK=1,IDL1 + DO 118 J = 2,IPPH + DO 117 IK = 1,IDL1 CH2(IK,1) = CH2(IK,1)+CH2(IK,J) 117 continue 118 continue - DO 120 J=2,IPPH + DO 120 J = 2,IPPH JC = IPP2-J - DO 119 IK=2,IDL1,2 + DO 119 IK = 2,IDL1,2 CH2(IK-1,J) = C2(IK-1,J)-C2(IK,JC) CH2(IK-1,JC) = C2(IK-1,J)+C2(IK,JC) CH2(IK,J) = C2(IK,J)+C2(IK-1,JC) @@ -983,22 +983,22 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) NAC = 1 if (IDO == 2) return NAC = 0 - DO 121 IK=1,IDL1 + DO 121 IK = 1,IDL1 C2(IK,1) = CH2(IK,1) 121 continue - DO 123 J=2,IP - DO 122 K=1,L1 + DO 123 J = 2,IP + DO 122 K = 1,L1 C1(1,K,J) = CH(1,K,J) C1(2,K,J) = CH(2,K,J) 122 continue 123 continue if (IDOT > L1) goto 127 IDIJ = 0 - DO 126 J=2,IP + DO 126 J = 2,IP IDIJ = IDIJ+2 - DO 125 I=4,IDO,2 + DO 125 I = 4,IDO,2 IDIJ = IDIJ+2 - DO 124 K=1,L1 + DO 124 K = 1,L1 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)+WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)-WA(IDIJ)*CH(I-1,K,J) 124 continue @@ -1006,11 +1006,11 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) 126 continue return 127 IDJ = 2-IDO - DO 130 J=2,IP + DO 130 J = 2,IP IDJ = IDJ+IDO - DO 129 K=1,L1 + DO 129 K = 1,L1 IDIJ = IDJ - DO 128 I=4,IDO,2 + DO 128 I = 4,IDO,2 IDIJ = IDIJ+2 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)+WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)-WA(IDIJ)*CH(I-1,K,J) @@ -1023,15 +1023,15 @@ subroutine PASSF2 (IDO,L1,CC,CH,WA1) DIMENSION CC(IDO,2,L1) ,CH(IDO,L1,2), & WA1(1) if (IDO > 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 CH(1,K,1) = CC(1,1,K)+CC(1,2,K) CH(1,K,2) = CC(1,1,K)-CC(1,2,K) CH(2,K,1) = CC(2,1,K)+CC(2,2,K) CH(2,K,2) = CC(2,1,K)-CC(2,2,K) 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 CH(I-1,K,1) = CC(I-1,1,K)+CC(I-1,2,K) TR2 = CC(I-1,1,K)-CC(I-1,2,K) CH(I,K,1) = CC(I,1,K)+CC(I,2,K) @@ -1047,7 +1047,7 @@ subroutine PASSF3 (IDO,L1,CC,CH,WA1,WA2) WA1(1) ,WA2(1) DATA TAUR,TAUI /-.5,-.866025403784439/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TR2 = CC(1,2,K)+CC(1,3,K) CR2 = CC(1,1,K)+TAUR*TR2 CH(1,K,1) = CC(1,1,K)+TR2 @@ -1062,8 +1062,8 @@ subroutine PASSF3 (IDO,L1,CC,CH,WA1,WA2) CH(2,K,3) = CI2-CR3 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TR2 = CC(I-1,2,K)+CC(I-1,3,K) CR2 = CC(I-1,1,K)+TAUR*TR2 CH(I-1,K,1) = CC(I-1,1,K)+TR2 @@ -1088,7 +1088,7 @@ subroutine PASSF4 (IDO,L1,CC,CH,WA1,WA2,WA3) DIMENSION CC(IDO,4,L1) ,CH(IDO,L1,4), & WA1(1) ,WA2(1) ,WA3(1) if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI1 = CC(2,1,K)-CC(2,3,K) TI2 = CC(2,1,K)+CC(2,3,K) TR4 = CC(2,2,K)-CC(2,4,K) @@ -1107,8 +1107,8 @@ subroutine PASSF4 (IDO,L1,CC,CH,WA1,WA2,WA3) CH(2,K,4) = TI1-TI4 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI1 = CC(I,1,K)-CC(I,3,K) TI2 = CC(I,1,K)+CC(I,3,K) TI3 = CC(I,2,K)+CC(I,4,K) @@ -1141,7 +1141,7 @@ subroutine PASSF5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) DATA TR11,TI11,TR12,TI12 /.309016994374947,-.951056516295154, & -.809016994374947,-.587785252292473/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI5 = CC(2,2,K)-CC(2,5,K) TI2 = CC(2,2,K)+CC(2,5,K) TI4 = CC(2,3,K)-CC(2,4,K) @@ -1170,8 +1170,8 @@ subroutine PASSF5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) CH(2,K,5) = CI2-CR5 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI5 = CC(I,2,K)-CC(I,5,K) TI2 = CC(I,2,K)+CC(I,5,K) TI4 = CC(I,3,K)-CC(I,4,K) @@ -7611,7 +7611,7 @@ subroutine X04BAE(NOUT,REC) if (REC(I:I) /= ' ') goto 40 20 continue ! Write record to external file - 40 WRITE (NOUT,FMT=99999) REC(1:I) + 40 WRITE (NOUT,FMT = 99999) REC(1:I) endif return ! diff --git a/EXAMPLES/attenuation/viscoelastic/analytical_solution_viscoelastic_2D_plane_strain_Carcione_correct_with_1_over_L.f90 b/EXAMPLES/attenuation/viscoelastic/analytical_solution_viscoelastic_2D_plane_strain_Carcione_correct_with_1_over_L.f90 index 0eecb1d65..4d2467ad2 100644 --- a/EXAMPLES/attenuation/viscoelastic/analytical_solution_viscoelastic_2D_plane_strain_Carcione_correct_with_1_over_L.f90 +++ b/EXAMPLES/attenuation/viscoelastic/analytical_solution_viscoelastic_2D_plane_strain_Carcione_correct_with_1_over_L.f90 @@ -153,7 +153,7 @@ program analytical_solution deltat = 1.d0 / (freqmax*dble(iratio)) ! define the spectrum of the source - do ifreq=0,nfreq + do ifreq = 0,nfreq freq = deltafreq * dble(ifreq) omega = 2.d0 * pi * freq @@ -188,7 +188,7 @@ program analytical_solution ! ************** calcul solution analytique **************** ! d'apres Carcione GJI vol 95 p 611 (1988) - do ifreq=0,nfreq + do ifreq = 0,nfreq freq = deltafreq * dble(ifreq) omega = 2.d0 * pi * freq @@ -198,14 +198,14 @@ program analytical_solution ! use standard infinite frequency (unrelaxed) reference, ! in which waves slow down when attenuation is turned on. temp = dcmplx(0.d0,0.d0) - do i=1,Lnu + do i = 1,Lnu temp = temp + dcmplx(1.d0,omega*tau_epsilon_nu1(i)) / dcmplx(1.d0,omega*tau_sigma_nu1(i)) enddo M1C = (M1_unrelaxed /(sum(tau_epsilon_nu1(:)/tau_sigma_nu1(:)))) * temp temp = dcmplx(0.d0,0.d0) - do i=1,Lnu + do i = 1,Lnu temp = temp + dcmplx(1.d0,omega*tau_epsilon_nu2(i)) / dcmplx(1.d0,omega*tau_sigma_nu2(i)) enddo @@ -267,7 +267,7 @@ program analytical_solution ! use the Fourier values for Ux c(1) = cmplx(phi1(0)) - do ifreq=1,nfreq-2 + do ifreq = 1,nfreq-2 c(ifreq+1) = cmplx(phi1(ifreq)) c(nt+1-ifreq) = conjg(cmplx(phi1(ifreq))) enddo @@ -316,7 +316,7 @@ program analytical_solution open(unit=11,file='Ux_time_analytical_solution_viscoelastic.dat',status='unknown') endif endif - do it=1,nt + do it = 1,nt ! DK DK Dec 2011: subtract t0 to be consistent with the SPECFEM2D code time = dble(it-1)*deltat - t0 ! the seismograms are very long due to the very large number of FFT points used, @@ -336,7 +336,7 @@ program analytical_solution ! use the Fourier values for Uz c(1) = cmplx(phi2(0)) - do ifreq=1,nfreq-2 + do ifreq = 1,nfreq-2 c(ifreq+1) = cmplx(phi2(ifreq)) c(nt+1-ifreq) = conjg(cmplx(phi2(ifreq))) enddo @@ -384,7 +384,7 @@ program analytical_solution open(unit=11,file='Uz_time_analytical_solution_viscoelastic.dat',status='unknown') endif endif - do it=1,nt + do it = 1,nt ! DK DK Dec 2011: subtract t0 to be consistent with the SPECFEM2D code time = dble(it-1)*deltat - t0 ! the seismograms are very long due to the very large number of FFT points used, @@ -569,7 +569,7 @@ subroutine CFFTB1 (N,C,CH,WA,IFAC) NA = 0 L1 = 1 IW = 1 - DO 116 K1=1,NF + DO 116 K1 = 1,NF IP = IFAC(K1+2) L2 = IP*L1 IDO = N/L2 @@ -619,7 +619,7 @@ subroutine CFFTB1 (N,C,CH,WA,IFAC) 116 continue if (NA == 0) return N2 = N+N - DO 117 I=1,N2 + DO 117 I = 1,N2 C(I) = CH(I) 117 continue return @@ -635,66 +635,66 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) IDP = IP*IDO ! if (IDO < L1) goto 106 - DO 103 J=2,IPPH + DO 103 J = 2,IPPH JC = IPP2-J - DO 102 K=1,L1 - DO 101 I=1,IDO + DO 102 K = 1,L1 + DO 101 I = 1,IDO CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 101 continue 102 continue 103 continue - DO 105 K=1,L1 - DO 104 I=1,IDO + DO 105 K = 1,L1 + DO 104 I = 1,IDO CH(I,K,1) = CC(I,1,K) 104 continue 105 continue goto 112 - 106 DO 109 J=2,IPPH + 106 DO 109 J = 2,IPPH JC = IPP2-J - DO 108 I=1,IDO - DO 107 K=1,L1 + DO 108 I = 1,IDO + DO 107 K = 1,L1 CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 107 continue 108 continue 109 continue - DO 111 I=1,IDO - DO 110 K=1,L1 + DO 111 I = 1,IDO + DO 110 K = 1,L1 CH(I,K,1) = CC(I,1,K) 110 continue 111 continue 112 IDL = 2-IDO INC = 0 - DO 116 L=2,IPPH + DO 116 L = 2,IPPH LC = IPP2-L IDL = IDL+IDO - DO 113 IK=1,IDL1 + DO 113 IK = 1,IDL1 C2(IK,L) = CH2(IK,1)+WA(IDL-1)*CH2(IK,2) C2(IK,LC) = WA(IDL)*CH2(IK,IP) 113 continue IDLJ = IDL INC = INC+IDO - DO 115 J=3,IPPH + DO 115 J = 3,IPPH JC = IPP2-J IDLJ = IDLJ+INC if (IDLJ > IDP) IDLJ = IDLJ-IDP WAR = WA(IDLJ-1) WAI = WA(IDLJ) - DO 114 IK=1,IDL1 + DO 114 IK = 1,IDL1 C2(IK,L) = C2(IK,L)+WAR*CH2(IK,J) C2(IK,LC) = C2(IK,LC)+WAI*CH2(IK,JC) 114 continue 115 continue 116 continue - DO 118 J=2,IPPH - DO 117 IK=1,IDL1 + DO 118 J = 2,IPPH + DO 117 IK = 1,IDL1 CH2(IK,1) = CH2(IK,1)+CH2(IK,J) 117 continue 118 continue - DO 120 J=2,IPPH + DO 120 J = 2,IPPH JC = IPP2-J - DO 119 IK=2,IDL1,2 + DO 119 IK = 2,IDL1,2 CH2(IK-1,J) = C2(IK-1,J)-C2(IK,JC) CH2(IK-1,JC) = C2(IK-1,J)+C2(IK,JC) CH2(IK,J) = C2(IK,J)+C2(IK-1,JC) @@ -704,22 +704,22 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) NAC = 1 if (IDO == 2) return NAC = 0 - DO 121 IK=1,IDL1 + DO 121 IK = 1,IDL1 C2(IK,1) = CH2(IK,1) 121 continue - DO 123 J=2,IP - DO 122 K=1,L1 + DO 123 J = 2,IP + DO 122 K = 1,L1 C1(1,K,J) = CH(1,K,J) C1(2,K,J) = CH(2,K,J) 122 continue 123 continue if (IDOT > L1) goto 127 IDIJ = 0 - DO 126 J=2,IP + DO 126 J = 2,IP IDIJ = IDIJ+2 - DO 125 I=4,IDO,2 + DO 125 I = 4,IDO,2 IDIJ = IDIJ+2 - DO 124 K=1,L1 + DO 124 K = 1,L1 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)-WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)+WA(IDIJ)*CH(I-1,K,J) 124 continue @@ -727,11 +727,11 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) 126 continue return 127 IDJ = 2-IDO - DO 130 J=2,IP + DO 130 J = 2,IP IDJ = IDJ+IDO - DO 129 K=1,L1 + DO 129 K = 1,L1 IDIJ = IDJ - DO 128 I=4,IDO,2 + DO 128 I = 4,IDO,2 IDIJ = IDIJ+2 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)-WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)+WA(IDIJ)*CH(I-1,K,J) @@ -744,15 +744,15 @@ subroutine PASSB2 (IDO,L1,CC,CH,WA1) DIMENSION CC(IDO,2,L1) ,CH(IDO,L1,2), & WA1(1) if (IDO > 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 CH(1,K,1) = CC(1,1,K)+CC(1,2,K) CH(1,K,2) = CC(1,1,K)-CC(1,2,K) CH(2,K,1) = CC(2,1,K)+CC(2,2,K) CH(2,K,2) = CC(2,1,K)-CC(2,2,K) 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 CH(I-1,K,1) = CC(I-1,1,K)+CC(I-1,2,K) TR2 = CC(I-1,1,K)-CC(I-1,2,K) CH(I,K,1) = CC(I,1,K)+CC(I,2,K) @@ -768,7 +768,7 @@ subroutine PASSB3 (IDO,L1,CC,CH,WA1,WA2) WA1(1) ,WA2(1) DATA TAUR,TAUI /-.5,.866025403784439/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TR2 = CC(1,2,K)+CC(1,3,K) CR2 = CC(1,1,K)+TAUR*TR2 CH(1,K,1) = CC(1,1,K)+TR2 @@ -783,8 +783,8 @@ subroutine PASSB3 (IDO,L1,CC,CH,WA1,WA2) CH(2,K,3) = CI2-CR3 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TR2 = CC(I-1,2,K)+CC(I-1,3,K) CR2 = CC(I-1,1,K)+TAUR*TR2 CH(I-1,K,1) = CC(I-1,1,K)+TR2 @@ -809,7 +809,7 @@ subroutine PASSB4 (IDO,L1,CC,CH,WA1,WA2,WA3) DIMENSION CC(IDO,4,L1) ,CH(IDO,L1,4), & WA1(1) ,WA2(1) ,WA3(1) if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI1 = CC(2,1,K)-CC(2,3,K) TI2 = CC(2,1,K)+CC(2,3,K) TR4 = CC(2,4,K)-CC(2,2,K) @@ -828,8 +828,8 @@ subroutine PASSB4 (IDO,L1,CC,CH,WA1,WA2,WA3) CH(2,K,4) = TI1-TI4 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI1 = CC(I,1,K)-CC(I,3,K) TI2 = CC(I,1,K)+CC(I,3,K) TI3 = CC(I,2,K)+CC(I,4,K) @@ -862,7 +862,7 @@ subroutine PASSB5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) DATA TR11,TI11,TR12,TI12 /.309016994374947,.951056516295154, & -.809016994374947,.587785252292473/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI5 = CC(2,2,K)-CC(2,5,K) TI2 = CC(2,2,K)+CC(2,5,K) TI4 = CC(2,3,K)-CC(2,4,K) @@ -891,8 +891,8 @@ subroutine PASSB5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) CH(2,K,5) = CI2-CR5 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI5 = CC(I,2,K)-CC(I,5,K) TI2 = CC(I,2,K)+CC(I,5,K) TI4 = CC(I,3,K)-CC(I,4,K) @@ -961,7 +961,7 @@ subroutine CFFTI1 (N,WA,IFAC) NL = NQ if (NTRY /= 2) goto 107 if (NF == 1) goto 107 - DO 106 I=2,NF + DO 106 I = 2,NF IB = NF-I+2 IFAC(IB+2) = IFAC(IB+1) 106 continue @@ -973,21 +973,21 @@ subroutine CFFTI1 (N,WA,IFAC) ARGH = TPI/FLOAT(N) I = 2 L1 = 1 - DO 110 K1=1,NF + DO 110 K1 = 1,NF IP = IFAC(K1+2) LD = 0 L2 = L1*IP IDO = N/L2 IDOT = IDO+IDO+2 IPM = IP-1 - DO 109 J=1,IPM + DO 109 J = 1,IPM I1 = I WA(I-1) = 1. WA(I) = 0. LD = LD+L1 FI = 0. ARGLD = FLOAT(LD)*ARGH - DO 108 II=4,IDOT,2 + DO 108 II = 4,IDOT,2 I = I+2 FI = FI+1. ARG = FI*ARGLD @@ -1021,7 +1021,7 @@ subroutine CFFTF1 (N,C,CH,WA,IFAC) NA = 0 L1 = 1 IW = 1 - DO 116 K1=1,NF + DO 116 K1 = 1,NF IP = IFAC(K1+2) L2 = IP*L1 IDO = N/L2 @@ -1071,7 +1071,7 @@ subroutine CFFTF1 (N,C,CH,WA,IFAC) 116 continue if (NA == 0) return N2 = N+N - DO 117 I=1,N2 + DO 117 I = 1,N2 C(I) = CH(I) 117 continue return @@ -1087,66 +1087,66 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) IDP = IP*IDO ! if (IDO < L1) goto 106 - DO 103 J=2,IPPH + DO 103 J = 2,IPPH JC = IPP2-J - DO 102 K=1,L1 - DO 101 I=1,IDO + DO 102 K = 1,L1 + DO 101 I = 1,IDO CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 101 continue 102 continue 103 continue - DO 105 K=1,L1 - DO 104 I=1,IDO + DO 105 K = 1,L1 + DO 104 I = 1,IDO CH(I,K,1) = CC(I,1,K) 104 continue 105 continue goto 112 - 106 DO 109 J=2,IPPH + 106 DO 109 J = 2,IPPH JC = IPP2-J - DO 108 I=1,IDO - DO 107 K=1,L1 + DO 108 I = 1,IDO + DO 107 K = 1,L1 CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 107 continue 108 continue 109 continue - DO 111 I=1,IDO - DO 110 K=1,L1 + DO 111 I = 1,IDO + DO 110 K = 1,L1 CH(I,K,1) = CC(I,1,K) 110 continue 111 continue 112 IDL = 2-IDO INC = 0 - DO 116 L=2,IPPH + DO 116 L = 2,IPPH LC = IPP2-L IDL = IDL+IDO - DO 113 IK=1,IDL1 + DO 113 IK = 1,IDL1 C2(IK,L) = CH2(IK,1)+WA(IDL-1)*CH2(IK,2) C2(IK,LC) = -WA(IDL)*CH2(IK,IP) 113 continue IDLJ = IDL INC = INC+IDO - DO 115 J=3,IPPH + DO 115 J = 3,IPPH JC = IPP2-J IDLJ = IDLJ+INC if (IDLJ > IDP) IDLJ = IDLJ-IDP WAR = WA(IDLJ-1) WAI = WA(IDLJ) - DO 114 IK=1,IDL1 + DO 114 IK = 1,IDL1 C2(IK,L) = C2(IK,L)+WAR*CH2(IK,J) C2(IK,LC) = C2(IK,LC)-WAI*CH2(IK,JC) 114 continue 115 continue 116 continue - DO 118 J=2,IPPH - DO 117 IK=1,IDL1 + DO 118 J = 2,IPPH + DO 117 IK = 1,IDL1 CH2(IK,1) = CH2(IK,1)+CH2(IK,J) 117 continue 118 continue - DO 120 J=2,IPPH + DO 120 J = 2,IPPH JC = IPP2-J - DO 119 IK=2,IDL1,2 + DO 119 IK = 2,IDL1,2 CH2(IK-1,J) = C2(IK-1,J)-C2(IK,JC) CH2(IK-1,JC) = C2(IK-1,J)+C2(IK,JC) CH2(IK,J) = C2(IK,J)+C2(IK-1,JC) @@ -1156,22 +1156,22 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) NAC = 1 if (IDO == 2) return NAC = 0 - DO 121 IK=1,IDL1 + DO 121 IK = 1,IDL1 C2(IK,1) = CH2(IK,1) 121 continue - DO 123 J=2,IP - DO 122 K=1,L1 + DO 123 J = 2,IP + DO 122 K = 1,L1 C1(1,K,J) = CH(1,K,J) C1(2,K,J) = CH(2,K,J) 122 continue 123 continue if (IDOT > L1) goto 127 IDIJ = 0 - DO 126 J=2,IP + DO 126 J = 2,IP IDIJ = IDIJ+2 - DO 125 I=4,IDO,2 + DO 125 I = 4,IDO,2 IDIJ = IDIJ+2 - DO 124 K=1,L1 + DO 124 K = 1,L1 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)+WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)-WA(IDIJ)*CH(I-1,K,J) 124 continue @@ -1179,11 +1179,11 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) 126 continue return 127 IDJ = 2-IDO - DO 130 J=2,IP + DO 130 J = 2,IP IDJ = IDJ+IDO - DO 129 K=1,L1 + DO 129 K = 1,L1 IDIJ = IDJ - DO 128 I=4,IDO,2 + DO 128 I = 4,IDO,2 IDIJ = IDIJ+2 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)+WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)-WA(IDIJ)*CH(I-1,K,J) @@ -1196,15 +1196,15 @@ subroutine PASSF2 (IDO,L1,CC,CH,WA1) DIMENSION CC(IDO,2,L1) ,CH(IDO,L1,2), & WA1(1) if (IDO > 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 CH(1,K,1) = CC(1,1,K)+CC(1,2,K) CH(1,K,2) = CC(1,1,K)-CC(1,2,K) CH(2,K,1) = CC(2,1,K)+CC(2,2,K) CH(2,K,2) = CC(2,1,K)-CC(2,2,K) 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 CH(I-1,K,1) = CC(I-1,1,K)+CC(I-1,2,K) TR2 = CC(I-1,1,K)-CC(I-1,2,K) CH(I,K,1) = CC(I,1,K)+CC(I,2,K) @@ -1220,7 +1220,7 @@ subroutine PASSF3 (IDO,L1,CC,CH,WA1,WA2) WA1(1) ,WA2(1) DATA TAUR,TAUI /-.5,-.866025403784439/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TR2 = CC(1,2,K)+CC(1,3,K) CR2 = CC(1,1,K)+TAUR*TR2 CH(1,K,1) = CC(1,1,K)+TR2 @@ -1235,8 +1235,8 @@ subroutine PASSF3 (IDO,L1,CC,CH,WA1,WA2) CH(2,K,3) = CI2-CR3 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TR2 = CC(I-1,2,K)+CC(I-1,3,K) CR2 = CC(I-1,1,K)+TAUR*TR2 CH(I-1,K,1) = CC(I-1,1,K)+TR2 @@ -1261,7 +1261,7 @@ subroutine PASSF4 (IDO,L1,CC,CH,WA1,WA2,WA3) DIMENSION CC(IDO,4,L1) ,CH(IDO,L1,4), & WA1(1) ,WA2(1) ,WA3(1) if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI1 = CC(2,1,K)-CC(2,3,K) TI2 = CC(2,1,K)+CC(2,3,K) TR4 = CC(2,2,K)-CC(2,4,K) @@ -1280,8 +1280,8 @@ subroutine PASSF4 (IDO,L1,CC,CH,WA1,WA2,WA3) CH(2,K,4) = TI1-TI4 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI1 = CC(I,1,K)-CC(I,3,K) TI2 = CC(I,1,K)+CC(I,3,K) TI3 = CC(I,2,K)+CC(I,4,K) @@ -1314,7 +1314,7 @@ subroutine PASSF5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) DATA TR11,TI11,TR12,TI12 /.309016994374947,-.951056516295154, & -.809016994374947,-.587785252292473/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI5 = CC(2,2,K)-CC(2,5,K) TI2 = CC(2,2,K)+CC(2,5,K) TI4 = CC(2,3,K)-CC(2,4,K) @@ -1343,8 +1343,8 @@ subroutine PASSF5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) CH(2,K,5) = CI2-CR5 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI5 = CC(I,2,K)-CC(I,5,K) TI2 = CC(I,2,K)+CC(I,5,K) TI4 = CC(I,3,K)-CC(I,4,K) @@ -7787,7 +7787,7 @@ subroutine X04BAE(NOUT,REC) if (REC(I:I) /= ' ') goto 40 20 continue ! Write record to external file - 40 WRITE (NOUT,FMT=99999) REC(1:I) + 40 WRITE (NOUT,FMT = 99999) REC(1:I) endif return ! diff --git a/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_elastic/analytical_solution_viscoelastic_2D_plane_strain_Carcione_correct_with_1_over_L.f90 b/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_elastic/analytical_solution_viscoelastic_2D_plane_strain_Carcione_correct_with_1_over_L.f90 index f8a6f632c..24c77f1f4 100644 --- a/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_elastic/analytical_solution_viscoelastic_2D_plane_strain_Carcione_correct_with_1_over_L.f90 +++ b/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_elastic/analytical_solution_viscoelastic_2D_plane_strain_Carcione_correct_with_1_over_L.f90 @@ -153,7 +153,7 @@ program analytical_solution deltat = 1.d0 / (freqmax*dble(iratio)) ! define the spectrum of the source - do ifreq=0,nfreq + do ifreq = 0,nfreq freq = deltafreq * dble(ifreq) omega = 2.d0 * pi * freq @@ -188,7 +188,7 @@ program analytical_solution ! ************** calcul solution analytique **************** ! d'apres Carcione GJI vol 95 p 611 (1988) - do ifreq=0,nfreq + do ifreq = 0,nfreq freq = deltafreq * dble(ifreq) omega = 2.d0 * pi * freq @@ -198,14 +198,14 @@ program analytical_solution ! use standard infinite frequency (unrelaxed) reference, ! in which waves slow down when attenuation is turned on. temp = dcmplx(0.d0,0.d0) - do i=1,Lnu + do i = 1,Lnu temp = temp + dcmplx(1.d0,omega*tau_epsilon_nu1(i)) / dcmplx(1.d0,omega*tau_sigma_nu1(i)) enddo M1C = (M1_unrelaxed /(sum(tau_epsilon_nu1(:)/tau_sigma_nu1(:)))) * temp temp = dcmplx(0.d0,0.d0) - do i=1,Lnu + do i = 1,Lnu temp = temp + dcmplx(1.d0,omega*tau_epsilon_nu2(i)) / dcmplx(1.d0,omega*tau_sigma_nu2(i)) enddo @@ -267,7 +267,7 @@ program analytical_solution ! use the Fourier values for Ux c(1) = cmplx(phi1(0)) - do ifreq=1,nfreq-2 + do ifreq = 1,nfreq-2 c(ifreq+1) = cmplx(phi1(ifreq)) c(nt+1-ifreq) = conjg(cmplx(phi1(ifreq))) enddo @@ -316,7 +316,7 @@ program analytical_solution open(unit=11,file='Ux_time_analytical_solution_viscoelastic.dat',status='unknown') endif endif - do it=1,nt + do it = 1,nt ! DK DK Dec 2011: subtract t0 to be consistent with the SPECFEM2D code time = dble(it-1)*deltat - t0 ! the seismograms are very long due to the very large number of FFT points used, @@ -336,7 +336,7 @@ program analytical_solution ! use the Fourier values for Uz c(1) = cmplx(phi2(0)) - do ifreq=1,nfreq-2 + do ifreq = 1,nfreq-2 c(ifreq+1) = cmplx(phi2(ifreq)) c(nt+1-ifreq) = conjg(cmplx(phi2(ifreq))) enddo @@ -384,7 +384,7 @@ program analytical_solution open(unit=11,file='Uz_time_analytical_solution_viscoelastic.dat',status='unknown') endif endif - do it=1,nt + do it = 1,nt ! DK DK Dec 2011: subtract t0 to be consistent with the SPECFEM2D code time = dble(it-1)*deltat - t0 ! the seismograms are very long due to the very large number of FFT points used, @@ -569,7 +569,7 @@ subroutine CFFTB1 (N,C,CH,WA,IFAC) NA = 0 L1 = 1 IW = 1 - DO 116 K1=1,NF + DO 116 K1 = 1,NF IP = IFAC(K1+2) L2 = IP*L1 IDO = N/L2 @@ -619,7 +619,7 @@ subroutine CFFTB1 (N,C,CH,WA,IFAC) 116 continue if (NA == 0) return N2 = N+N - DO 117 I=1,N2 + DO 117 I = 1,N2 C(I) = CH(I) 117 continue return @@ -635,66 +635,66 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) IDP = IP*IDO ! if (IDO < L1) goto 106 - DO 103 J=2,IPPH + DO 103 J = 2,IPPH JC = IPP2-J - DO 102 K=1,L1 - DO 101 I=1,IDO + DO 102 K = 1,L1 + DO 101 I = 1,IDO CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 101 continue 102 continue 103 continue - DO 105 K=1,L1 - DO 104 I=1,IDO + DO 105 K = 1,L1 + DO 104 I = 1,IDO CH(I,K,1) = CC(I,1,K) 104 continue 105 continue goto 112 - 106 DO 109 J=2,IPPH + 106 DO 109 J = 2,IPPH JC = IPP2-J - DO 108 I=1,IDO - DO 107 K=1,L1 + DO 108 I = 1,IDO + DO 107 K = 1,L1 CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 107 continue 108 continue 109 continue - DO 111 I=1,IDO - DO 110 K=1,L1 + DO 111 I = 1,IDO + DO 110 K = 1,L1 CH(I,K,1) = CC(I,1,K) 110 continue 111 continue 112 IDL = 2-IDO INC = 0 - DO 116 L=2,IPPH + DO 116 L = 2,IPPH LC = IPP2-L IDL = IDL+IDO - DO 113 IK=1,IDL1 + DO 113 IK = 1,IDL1 C2(IK,L) = CH2(IK,1)+WA(IDL-1)*CH2(IK,2) C2(IK,LC) = WA(IDL)*CH2(IK,IP) 113 continue IDLJ = IDL INC = INC+IDO - DO 115 J=3,IPPH + DO 115 J = 3,IPPH JC = IPP2-J IDLJ = IDLJ+INC if (IDLJ > IDP) IDLJ = IDLJ-IDP WAR = WA(IDLJ-1) WAI = WA(IDLJ) - DO 114 IK=1,IDL1 + DO 114 IK = 1,IDL1 C2(IK,L) = C2(IK,L)+WAR*CH2(IK,J) C2(IK,LC) = C2(IK,LC)+WAI*CH2(IK,JC) 114 continue 115 continue 116 continue - DO 118 J=2,IPPH - DO 117 IK=1,IDL1 + DO 118 J = 2,IPPH + DO 117 IK = 1,IDL1 CH2(IK,1) = CH2(IK,1)+CH2(IK,J) 117 continue 118 continue - DO 120 J=2,IPPH + DO 120 J = 2,IPPH JC = IPP2-J - DO 119 IK=2,IDL1,2 + DO 119 IK = 2,IDL1,2 CH2(IK-1,J) = C2(IK-1,J)-C2(IK,JC) CH2(IK-1,JC) = C2(IK-1,J)+C2(IK,JC) CH2(IK,J) = C2(IK,J)+C2(IK-1,JC) @@ -704,22 +704,22 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) NAC = 1 if (IDO == 2) return NAC = 0 - DO 121 IK=1,IDL1 + DO 121 IK = 1,IDL1 C2(IK,1) = CH2(IK,1) 121 continue - DO 123 J=2,IP - DO 122 K=1,L1 + DO 123 J = 2,IP + DO 122 K = 1,L1 C1(1,K,J) = CH(1,K,J) C1(2,K,J) = CH(2,K,J) 122 continue 123 continue if (IDOT > L1) goto 127 IDIJ = 0 - DO 126 J=2,IP + DO 126 J = 2,IP IDIJ = IDIJ+2 - DO 125 I=4,IDO,2 + DO 125 I = 4,IDO,2 IDIJ = IDIJ+2 - DO 124 K=1,L1 + DO 124 K = 1,L1 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)-WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)+WA(IDIJ)*CH(I-1,K,J) 124 continue @@ -727,11 +727,11 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) 126 continue return 127 IDJ = 2-IDO - DO 130 J=2,IP + DO 130 J = 2,IP IDJ = IDJ+IDO - DO 129 K=1,L1 + DO 129 K = 1,L1 IDIJ = IDJ - DO 128 I=4,IDO,2 + DO 128 I = 4,IDO,2 IDIJ = IDIJ+2 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)-WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)+WA(IDIJ)*CH(I-1,K,J) @@ -744,15 +744,15 @@ subroutine PASSB2 (IDO,L1,CC,CH,WA1) DIMENSION CC(IDO,2,L1) ,CH(IDO,L1,2), & WA1(1) if (IDO > 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 CH(1,K,1) = CC(1,1,K)+CC(1,2,K) CH(1,K,2) = CC(1,1,K)-CC(1,2,K) CH(2,K,1) = CC(2,1,K)+CC(2,2,K) CH(2,K,2) = CC(2,1,K)-CC(2,2,K) 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 CH(I-1,K,1) = CC(I-1,1,K)+CC(I-1,2,K) TR2 = CC(I-1,1,K)-CC(I-1,2,K) CH(I,K,1) = CC(I,1,K)+CC(I,2,K) @@ -768,7 +768,7 @@ subroutine PASSB3 (IDO,L1,CC,CH,WA1,WA2) WA1(1) ,WA2(1) DATA TAUR,TAUI /-.5,.866025403784439/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TR2 = CC(1,2,K)+CC(1,3,K) CR2 = CC(1,1,K)+TAUR*TR2 CH(1,K,1) = CC(1,1,K)+TR2 @@ -783,8 +783,8 @@ subroutine PASSB3 (IDO,L1,CC,CH,WA1,WA2) CH(2,K,3) = CI2-CR3 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TR2 = CC(I-1,2,K)+CC(I-1,3,K) CR2 = CC(I-1,1,K)+TAUR*TR2 CH(I-1,K,1) = CC(I-1,1,K)+TR2 @@ -809,7 +809,7 @@ subroutine PASSB4 (IDO,L1,CC,CH,WA1,WA2,WA3) DIMENSION CC(IDO,4,L1) ,CH(IDO,L1,4), & WA1(1) ,WA2(1) ,WA3(1) if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI1 = CC(2,1,K)-CC(2,3,K) TI2 = CC(2,1,K)+CC(2,3,K) TR4 = CC(2,4,K)-CC(2,2,K) @@ -828,8 +828,8 @@ subroutine PASSB4 (IDO,L1,CC,CH,WA1,WA2,WA3) CH(2,K,4) = TI1-TI4 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI1 = CC(I,1,K)-CC(I,3,K) TI2 = CC(I,1,K)+CC(I,3,K) TI3 = CC(I,2,K)+CC(I,4,K) @@ -862,7 +862,7 @@ subroutine PASSB5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) DATA TR11,TI11,TR12,TI12 /.309016994374947,.951056516295154, & -.809016994374947,.587785252292473/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI5 = CC(2,2,K)-CC(2,5,K) TI2 = CC(2,2,K)+CC(2,5,K) TI4 = CC(2,3,K)-CC(2,4,K) @@ -891,8 +891,8 @@ subroutine PASSB5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) CH(2,K,5) = CI2-CR5 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI5 = CC(I,2,K)-CC(I,5,K) TI2 = CC(I,2,K)+CC(I,5,K) TI4 = CC(I,3,K)-CC(I,4,K) @@ -961,7 +961,7 @@ subroutine CFFTI1 (N,WA,IFAC) NL = NQ if (NTRY /= 2) goto 107 if (NF == 1) goto 107 - DO 106 I=2,NF + DO 106 I = 2,NF IB = NF-I+2 IFAC(IB+2) = IFAC(IB+1) 106 continue @@ -973,21 +973,21 @@ subroutine CFFTI1 (N,WA,IFAC) ARGH = TPI/FLOAT(N) I = 2 L1 = 1 - DO 110 K1=1,NF + DO 110 K1 = 1,NF IP = IFAC(K1+2) LD = 0 L2 = L1*IP IDO = N/L2 IDOT = IDO+IDO+2 IPM = IP-1 - DO 109 J=1,IPM + DO 109 J = 1,IPM I1 = I WA(I-1) = 1. WA(I) = 0. LD = LD+L1 FI = 0. ARGLD = FLOAT(LD)*ARGH - DO 108 II=4,IDOT,2 + DO 108 II = 4,IDOT,2 I = I+2 FI = FI+1. ARG = FI*ARGLD @@ -1021,7 +1021,7 @@ subroutine CFFTF1 (N,C,CH,WA,IFAC) NA = 0 L1 = 1 IW = 1 - DO 116 K1=1,NF + DO 116 K1 = 1,NF IP = IFAC(K1+2) L2 = IP*L1 IDO = N/L2 @@ -1071,7 +1071,7 @@ subroutine CFFTF1 (N,C,CH,WA,IFAC) 116 continue if (NA == 0) return N2 = N+N - DO 117 I=1,N2 + DO 117 I = 1,N2 C(I) = CH(I) 117 continue return @@ -1087,66 +1087,66 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) IDP = IP*IDO ! if (IDO < L1) goto 106 - DO 103 J=2,IPPH + DO 103 J = 2,IPPH JC = IPP2-J - DO 102 K=1,L1 - DO 101 I=1,IDO + DO 102 K = 1,L1 + DO 101 I = 1,IDO CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 101 continue 102 continue 103 continue - DO 105 K=1,L1 - DO 104 I=1,IDO + DO 105 K = 1,L1 + DO 104 I = 1,IDO CH(I,K,1) = CC(I,1,K) 104 continue 105 continue goto 112 - 106 DO 109 J=2,IPPH + 106 DO 109 J = 2,IPPH JC = IPP2-J - DO 108 I=1,IDO - DO 107 K=1,L1 + DO 108 I = 1,IDO + DO 107 K = 1,L1 CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 107 continue 108 continue 109 continue - DO 111 I=1,IDO - DO 110 K=1,L1 + DO 111 I = 1,IDO + DO 110 K = 1,L1 CH(I,K,1) = CC(I,1,K) 110 continue 111 continue 112 IDL = 2-IDO INC = 0 - DO 116 L=2,IPPH + DO 116 L = 2,IPPH LC = IPP2-L IDL = IDL+IDO - DO 113 IK=1,IDL1 + DO 113 IK = 1,IDL1 C2(IK,L) = CH2(IK,1)+WA(IDL-1)*CH2(IK,2) C2(IK,LC) = -WA(IDL)*CH2(IK,IP) 113 continue IDLJ = IDL INC = INC+IDO - DO 115 J=3,IPPH + DO 115 J = 3,IPPH JC = IPP2-J IDLJ = IDLJ+INC if (IDLJ > IDP) IDLJ = IDLJ-IDP WAR = WA(IDLJ-1) WAI = WA(IDLJ) - DO 114 IK=1,IDL1 + DO 114 IK = 1,IDL1 C2(IK,L) = C2(IK,L)+WAR*CH2(IK,J) C2(IK,LC) = C2(IK,LC)-WAI*CH2(IK,JC) 114 continue 115 continue 116 continue - DO 118 J=2,IPPH - DO 117 IK=1,IDL1 + DO 118 J = 2,IPPH + DO 117 IK = 1,IDL1 CH2(IK,1) = CH2(IK,1)+CH2(IK,J) 117 continue 118 continue - DO 120 J=2,IPPH + DO 120 J = 2,IPPH JC = IPP2-J - DO 119 IK=2,IDL1,2 + DO 119 IK = 2,IDL1,2 CH2(IK-1,J) = C2(IK-1,J)-C2(IK,JC) CH2(IK-1,JC) = C2(IK-1,J)+C2(IK,JC) CH2(IK,J) = C2(IK,J)+C2(IK-1,JC) @@ -1156,22 +1156,22 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) NAC = 1 if (IDO == 2) return NAC = 0 - DO 121 IK=1,IDL1 + DO 121 IK = 1,IDL1 C2(IK,1) = CH2(IK,1) 121 continue - DO 123 J=2,IP - DO 122 K=1,L1 + DO 123 J = 2,IP + DO 122 K = 1,L1 C1(1,K,J) = CH(1,K,J) C1(2,K,J) = CH(2,K,J) 122 continue 123 continue if (IDOT > L1) goto 127 IDIJ = 0 - DO 126 J=2,IP + DO 126 J = 2,IP IDIJ = IDIJ+2 - DO 125 I=4,IDO,2 + DO 125 I = 4,IDO,2 IDIJ = IDIJ+2 - DO 124 K=1,L1 + DO 124 K = 1,L1 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)+WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)-WA(IDIJ)*CH(I-1,K,J) 124 continue @@ -1179,11 +1179,11 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) 126 continue return 127 IDJ = 2-IDO - DO 130 J=2,IP + DO 130 J = 2,IP IDJ = IDJ+IDO - DO 129 K=1,L1 + DO 129 K = 1,L1 IDIJ = IDJ - DO 128 I=4,IDO,2 + DO 128 I = 4,IDO,2 IDIJ = IDIJ+2 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)+WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)-WA(IDIJ)*CH(I-1,K,J) @@ -1196,15 +1196,15 @@ subroutine PASSF2 (IDO,L1,CC,CH,WA1) DIMENSION CC(IDO,2,L1) ,CH(IDO,L1,2), & WA1(1) if (IDO > 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 CH(1,K,1) = CC(1,1,K)+CC(1,2,K) CH(1,K,2) = CC(1,1,K)-CC(1,2,K) CH(2,K,1) = CC(2,1,K)+CC(2,2,K) CH(2,K,2) = CC(2,1,K)-CC(2,2,K) 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 CH(I-1,K,1) = CC(I-1,1,K)+CC(I-1,2,K) TR2 = CC(I-1,1,K)-CC(I-1,2,K) CH(I,K,1) = CC(I,1,K)+CC(I,2,K) @@ -1220,7 +1220,7 @@ subroutine PASSF3 (IDO,L1,CC,CH,WA1,WA2) WA1(1) ,WA2(1) DATA TAUR,TAUI /-.5,-.866025403784439/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TR2 = CC(1,2,K)+CC(1,3,K) CR2 = CC(1,1,K)+TAUR*TR2 CH(1,K,1) = CC(1,1,K)+TR2 @@ -1235,8 +1235,8 @@ subroutine PASSF3 (IDO,L1,CC,CH,WA1,WA2) CH(2,K,3) = CI2-CR3 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TR2 = CC(I-1,2,K)+CC(I-1,3,K) CR2 = CC(I-1,1,K)+TAUR*TR2 CH(I-1,K,1) = CC(I-1,1,K)+TR2 @@ -1261,7 +1261,7 @@ subroutine PASSF4 (IDO,L1,CC,CH,WA1,WA2,WA3) DIMENSION CC(IDO,4,L1) ,CH(IDO,L1,4), & WA1(1) ,WA2(1) ,WA3(1) if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI1 = CC(2,1,K)-CC(2,3,K) TI2 = CC(2,1,K)+CC(2,3,K) TR4 = CC(2,2,K)-CC(2,4,K) @@ -1280,8 +1280,8 @@ subroutine PASSF4 (IDO,L1,CC,CH,WA1,WA2,WA3) CH(2,K,4) = TI1-TI4 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI1 = CC(I,1,K)-CC(I,3,K) TI2 = CC(I,1,K)+CC(I,3,K) TI3 = CC(I,2,K)+CC(I,4,K) @@ -1314,7 +1314,7 @@ subroutine PASSF5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) DATA TR11,TI11,TR12,TI12 /.309016994374947,-.951056516295154, & -.809016994374947,-.587785252292473/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI5 = CC(2,2,K)-CC(2,5,K) TI2 = CC(2,2,K)+CC(2,5,K) TI4 = CC(2,3,K)-CC(2,4,K) @@ -1343,8 +1343,8 @@ subroutine PASSF5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) CH(2,K,5) = CI2-CR5 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI5 = CC(I,2,K)-CC(I,5,K) TI2 = CC(I,2,K)+CC(I,5,K) TI4 = CC(I,3,K)-CC(I,4,K) @@ -7787,7 +7787,7 @@ subroutine X04BAE(NOUT,REC) if (REC(I:I) /= ' ') goto 40 20 continue ! Write record to external file - 40 WRITE (NOUT,FMT=99999) REC(1:I) + 40 WRITE (NOUT,FMT = 99999) REC(1:I) endif return ! diff --git a/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_viscoelastic/analytical_solution_viscoelastic_2D_plane_strain_Carcione_correct_with_1_over_L.f90 b/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_viscoelastic/analytical_solution_viscoelastic_2D_plane_strain_Carcione_correct_with_1_over_L.f90 index 0eecb1d65..4d2467ad2 100644 --- a/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_viscoelastic/analytical_solution_viscoelastic_2D_plane_strain_Carcione_correct_with_1_over_L.f90 +++ b/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_viscoelastic/analytical_solution_viscoelastic_2D_plane_strain_Carcione_correct_with_1_over_L.f90 @@ -153,7 +153,7 @@ program analytical_solution deltat = 1.d0 / (freqmax*dble(iratio)) ! define the spectrum of the source - do ifreq=0,nfreq + do ifreq = 0,nfreq freq = deltafreq * dble(ifreq) omega = 2.d0 * pi * freq @@ -188,7 +188,7 @@ program analytical_solution ! ************** calcul solution analytique **************** ! d'apres Carcione GJI vol 95 p 611 (1988) - do ifreq=0,nfreq + do ifreq = 0,nfreq freq = deltafreq * dble(ifreq) omega = 2.d0 * pi * freq @@ -198,14 +198,14 @@ program analytical_solution ! use standard infinite frequency (unrelaxed) reference, ! in which waves slow down when attenuation is turned on. temp = dcmplx(0.d0,0.d0) - do i=1,Lnu + do i = 1,Lnu temp = temp + dcmplx(1.d0,omega*tau_epsilon_nu1(i)) / dcmplx(1.d0,omega*tau_sigma_nu1(i)) enddo M1C = (M1_unrelaxed /(sum(tau_epsilon_nu1(:)/tau_sigma_nu1(:)))) * temp temp = dcmplx(0.d0,0.d0) - do i=1,Lnu + do i = 1,Lnu temp = temp + dcmplx(1.d0,omega*tau_epsilon_nu2(i)) / dcmplx(1.d0,omega*tau_sigma_nu2(i)) enddo @@ -267,7 +267,7 @@ program analytical_solution ! use the Fourier values for Ux c(1) = cmplx(phi1(0)) - do ifreq=1,nfreq-2 + do ifreq = 1,nfreq-2 c(ifreq+1) = cmplx(phi1(ifreq)) c(nt+1-ifreq) = conjg(cmplx(phi1(ifreq))) enddo @@ -316,7 +316,7 @@ program analytical_solution open(unit=11,file='Ux_time_analytical_solution_viscoelastic.dat',status='unknown') endif endif - do it=1,nt + do it = 1,nt ! DK DK Dec 2011: subtract t0 to be consistent with the SPECFEM2D code time = dble(it-1)*deltat - t0 ! the seismograms are very long due to the very large number of FFT points used, @@ -336,7 +336,7 @@ program analytical_solution ! use the Fourier values for Uz c(1) = cmplx(phi2(0)) - do ifreq=1,nfreq-2 + do ifreq = 1,nfreq-2 c(ifreq+1) = cmplx(phi2(ifreq)) c(nt+1-ifreq) = conjg(cmplx(phi2(ifreq))) enddo @@ -384,7 +384,7 @@ program analytical_solution open(unit=11,file='Uz_time_analytical_solution_viscoelastic.dat',status='unknown') endif endif - do it=1,nt + do it = 1,nt ! DK DK Dec 2011: subtract t0 to be consistent with the SPECFEM2D code time = dble(it-1)*deltat - t0 ! the seismograms are very long due to the very large number of FFT points used, @@ -569,7 +569,7 @@ subroutine CFFTB1 (N,C,CH,WA,IFAC) NA = 0 L1 = 1 IW = 1 - DO 116 K1=1,NF + DO 116 K1 = 1,NF IP = IFAC(K1+2) L2 = IP*L1 IDO = N/L2 @@ -619,7 +619,7 @@ subroutine CFFTB1 (N,C,CH,WA,IFAC) 116 continue if (NA == 0) return N2 = N+N - DO 117 I=1,N2 + DO 117 I = 1,N2 C(I) = CH(I) 117 continue return @@ -635,66 +635,66 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) IDP = IP*IDO ! if (IDO < L1) goto 106 - DO 103 J=2,IPPH + DO 103 J = 2,IPPH JC = IPP2-J - DO 102 K=1,L1 - DO 101 I=1,IDO + DO 102 K = 1,L1 + DO 101 I = 1,IDO CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 101 continue 102 continue 103 continue - DO 105 K=1,L1 - DO 104 I=1,IDO + DO 105 K = 1,L1 + DO 104 I = 1,IDO CH(I,K,1) = CC(I,1,K) 104 continue 105 continue goto 112 - 106 DO 109 J=2,IPPH + 106 DO 109 J = 2,IPPH JC = IPP2-J - DO 108 I=1,IDO - DO 107 K=1,L1 + DO 108 I = 1,IDO + DO 107 K = 1,L1 CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 107 continue 108 continue 109 continue - DO 111 I=1,IDO - DO 110 K=1,L1 + DO 111 I = 1,IDO + DO 110 K = 1,L1 CH(I,K,1) = CC(I,1,K) 110 continue 111 continue 112 IDL = 2-IDO INC = 0 - DO 116 L=2,IPPH + DO 116 L = 2,IPPH LC = IPP2-L IDL = IDL+IDO - DO 113 IK=1,IDL1 + DO 113 IK = 1,IDL1 C2(IK,L) = CH2(IK,1)+WA(IDL-1)*CH2(IK,2) C2(IK,LC) = WA(IDL)*CH2(IK,IP) 113 continue IDLJ = IDL INC = INC+IDO - DO 115 J=3,IPPH + DO 115 J = 3,IPPH JC = IPP2-J IDLJ = IDLJ+INC if (IDLJ > IDP) IDLJ = IDLJ-IDP WAR = WA(IDLJ-1) WAI = WA(IDLJ) - DO 114 IK=1,IDL1 + DO 114 IK = 1,IDL1 C2(IK,L) = C2(IK,L)+WAR*CH2(IK,J) C2(IK,LC) = C2(IK,LC)+WAI*CH2(IK,JC) 114 continue 115 continue 116 continue - DO 118 J=2,IPPH - DO 117 IK=1,IDL1 + DO 118 J = 2,IPPH + DO 117 IK = 1,IDL1 CH2(IK,1) = CH2(IK,1)+CH2(IK,J) 117 continue 118 continue - DO 120 J=2,IPPH + DO 120 J = 2,IPPH JC = IPP2-J - DO 119 IK=2,IDL1,2 + DO 119 IK = 2,IDL1,2 CH2(IK-1,J) = C2(IK-1,J)-C2(IK,JC) CH2(IK-1,JC) = C2(IK-1,J)+C2(IK,JC) CH2(IK,J) = C2(IK,J)+C2(IK-1,JC) @@ -704,22 +704,22 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) NAC = 1 if (IDO == 2) return NAC = 0 - DO 121 IK=1,IDL1 + DO 121 IK = 1,IDL1 C2(IK,1) = CH2(IK,1) 121 continue - DO 123 J=2,IP - DO 122 K=1,L1 + DO 123 J = 2,IP + DO 122 K = 1,L1 C1(1,K,J) = CH(1,K,J) C1(2,K,J) = CH(2,K,J) 122 continue 123 continue if (IDOT > L1) goto 127 IDIJ = 0 - DO 126 J=2,IP + DO 126 J = 2,IP IDIJ = IDIJ+2 - DO 125 I=4,IDO,2 + DO 125 I = 4,IDO,2 IDIJ = IDIJ+2 - DO 124 K=1,L1 + DO 124 K = 1,L1 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)-WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)+WA(IDIJ)*CH(I-1,K,J) 124 continue @@ -727,11 +727,11 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) 126 continue return 127 IDJ = 2-IDO - DO 130 J=2,IP + DO 130 J = 2,IP IDJ = IDJ+IDO - DO 129 K=1,L1 + DO 129 K = 1,L1 IDIJ = IDJ - DO 128 I=4,IDO,2 + DO 128 I = 4,IDO,2 IDIJ = IDIJ+2 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)-WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)+WA(IDIJ)*CH(I-1,K,J) @@ -744,15 +744,15 @@ subroutine PASSB2 (IDO,L1,CC,CH,WA1) DIMENSION CC(IDO,2,L1) ,CH(IDO,L1,2), & WA1(1) if (IDO > 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 CH(1,K,1) = CC(1,1,K)+CC(1,2,K) CH(1,K,2) = CC(1,1,K)-CC(1,2,K) CH(2,K,1) = CC(2,1,K)+CC(2,2,K) CH(2,K,2) = CC(2,1,K)-CC(2,2,K) 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 CH(I-1,K,1) = CC(I-1,1,K)+CC(I-1,2,K) TR2 = CC(I-1,1,K)-CC(I-1,2,K) CH(I,K,1) = CC(I,1,K)+CC(I,2,K) @@ -768,7 +768,7 @@ subroutine PASSB3 (IDO,L1,CC,CH,WA1,WA2) WA1(1) ,WA2(1) DATA TAUR,TAUI /-.5,.866025403784439/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TR2 = CC(1,2,K)+CC(1,3,K) CR2 = CC(1,1,K)+TAUR*TR2 CH(1,K,1) = CC(1,1,K)+TR2 @@ -783,8 +783,8 @@ subroutine PASSB3 (IDO,L1,CC,CH,WA1,WA2) CH(2,K,3) = CI2-CR3 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TR2 = CC(I-1,2,K)+CC(I-1,3,K) CR2 = CC(I-1,1,K)+TAUR*TR2 CH(I-1,K,1) = CC(I-1,1,K)+TR2 @@ -809,7 +809,7 @@ subroutine PASSB4 (IDO,L1,CC,CH,WA1,WA2,WA3) DIMENSION CC(IDO,4,L1) ,CH(IDO,L1,4), & WA1(1) ,WA2(1) ,WA3(1) if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI1 = CC(2,1,K)-CC(2,3,K) TI2 = CC(2,1,K)+CC(2,3,K) TR4 = CC(2,4,K)-CC(2,2,K) @@ -828,8 +828,8 @@ subroutine PASSB4 (IDO,L1,CC,CH,WA1,WA2,WA3) CH(2,K,4) = TI1-TI4 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI1 = CC(I,1,K)-CC(I,3,K) TI2 = CC(I,1,K)+CC(I,3,K) TI3 = CC(I,2,K)+CC(I,4,K) @@ -862,7 +862,7 @@ subroutine PASSB5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) DATA TR11,TI11,TR12,TI12 /.309016994374947,.951056516295154, & -.809016994374947,.587785252292473/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI5 = CC(2,2,K)-CC(2,5,K) TI2 = CC(2,2,K)+CC(2,5,K) TI4 = CC(2,3,K)-CC(2,4,K) @@ -891,8 +891,8 @@ subroutine PASSB5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) CH(2,K,5) = CI2-CR5 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI5 = CC(I,2,K)-CC(I,5,K) TI2 = CC(I,2,K)+CC(I,5,K) TI4 = CC(I,3,K)-CC(I,4,K) @@ -961,7 +961,7 @@ subroutine CFFTI1 (N,WA,IFAC) NL = NQ if (NTRY /= 2) goto 107 if (NF == 1) goto 107 - DO 106 I=2,NF + DO 106 I = 2,NF IB = NF-I+2 IFAC(IB+2) = IFAC(IB+1) 106 continue @@ -973,21 +973,21 @@ subroutine CFFTI1 (N,WA,IFAC) ARGH = TPI/FLOAT(N) I = 2 L1 = 1 - DO 110 K1=1,NF + DO 110 K1 = 1,NF IP = IFAC(K1+2) LD = 0 L2 = L1*IP IDO = N/L2 IDOT = IDO+IDO+2 IPM = IP-1 - DO 109 J=1,IPM + DO 109 J = 1,IPM I1 = I WA(I-1) = 1. WA(I) = 0. LD = LD+L1 FI = 0. ARGLD = FLOAT(LD)*ARGH - DO 108 II=4,IDOT,2 + DO 108 II = 4,IDOT,2 I = I+2 FI = FI+1. ARG = FI*ARGLD @@ -1021,7 +1021,7 @@ subroutine CFFTF1 (N,C,CH,WA,IFAC) NA = 0 L1 = 1 IW = 1 - DO 116 K1=1,NF + DO 116 K1 = 1,NF IP = IFAC(K1+2) L2 = IP*L1 IDO = N/L2 @@ -1071,7 +1071,7 @@ subroutine CFFTF1 (N,C,CH,WA,IFAC) 116 continue if (NA == 0) return N2 = N+N - DO 117 I=1,N2 + DO 117 I = 1,N2 C(I) = CH(I) 117 continue return @@ -1087,66 +1087,66 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) IDP = IP*IDO ! if (IDO < L1) goto 106 - DO 103 J=2,IPPH + DO 103 J = 2,IPPH JC = IPP2-J - DO 102 K=1,L1 - DO 101 I=1,IDO + DO 102 K = 1,L1 + DO 101 I = 1,IDO CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 101 continue 102 continue 103 continue - DO 105 K=1,L1 - DO 104 I=1,IDO + DO 105 K = 1,L1 + DO 104 I = 1,IDO CH(I,K,1) = CC(I,1,K) 104 continue 105 continue goto 112 - 106 DO 109 J=2,IPPH + 106 DO 109 J = 2,IPPH JC = IPP2-J - DO 108 I=1,IDO - DO 107 K=1,L1 + DO 108 I = 1,IDO + DO 107 K = 1,L1 CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 107 continue 108 continue 109 continue - DO 111 I=1,IDO - DO 110 K=1,L1 + DO 111 I = 1,IDO + DO 110 K = 1,L1 CH(I,K,1) = CC(I,1,K) 110 continue 111 continue 112 IDL = 2-IDO INC = 0 - DO 116 L=2,IPPH + DO 116 L = 2,IPPH LC = IPP2-L IDL = IDL+IDO - DO 113 IK=1,IDL1 + DO 113 IK = 1,IDL1 C2(IK,L) = CH2(IK,1)+WA(IDL-1)*CH2(IK,2) C2(IK,LC) = -WA(IDL)*CH2(IK,IP) 113 continue IDLJ = IDL INC = INC+IDO - DO 115 J=3,IPPH + DO 115 J = 3,IPPH JC = IPP2-J IDLJ = IDLJ+INC if (IDLJ > IDP) IDLJ = IDLJ-IDP WAR = WA(IDLJ-1) WAI = WA(IDLJ) - DO 114 IK=1,IDL1 + DO 114 IK = 1,IDL1 C2(IK,L) = C2(IK,L)+WAR*CH2(IK,J) C2(IK,LC) = C2(IK,LC)-WAI*CH2(IK,JC) 114 continue 115 continue 116 continue - DO 118 J=2,IPPH - DO 117 IK=1,IDL1 + DO 118 J = 2,IPPH + DO 117 IK = 1,IDL1 CH2(IK,1) = CH2(IK,1)+CH2(IK,J) 117 continue 118 continue - DO 120 J=2,IPPH + DO 120 J = 2,IPPH JC = IPP2-J - DO 119 IK=2,IDL1,2 + DO 119 IK = 2,IDL1,2 CH2(IK-1,J) = C2(IK-1,J)-C2(IK,JC) CH2(IK-1,JC) = C2(IK-1,J)+C2(IK,JC) CH2(IK,J) = C2(IK,J)+C2(IK-1,JC) @@ -1156,22 +1156,22 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) NAC = 1 if (IDO == 2) return NAC = 0 - DO 121 IK=1,IDL1 + DO 121 IK = 1,IDL1 C2(IK,1) = CH2(IK,1) 121 continue - DO 123 J=2,IP - DO 122 K=1,L1 + DO 123 J = 2,IP + DO 122 K = 1,L1 C1(1,K,J) = CH(1,K,J) C1(2,K,J) = CH(2,K,J) 122 continue 123 continue if (IDOT > L1) goto 127 IDIJ = 0 - DO 126 J=2,IP + DO 126 J = 2,IP IDIJ = IDIJ+2 - DO 125 I=4,IDO,2 + DO 125 I = 4,IDO,2 IDIJ = IDIJ+2 - DO 124 K=1,L1 + DO 124 K = 1,L1 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)+WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)-WA(IDIJ)*CH(I-1,K,J) 124 continue @@ -1179,11 +1179,11 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) 126 continue return 127 IDJ = 2-IDO - DO 130 J=2,IP + DO 130 J = 2,IP IDJ = IDJ+IDO - DO 129 K=1,L1 + DO 129 K = 1,L1 IDIJ = IDJ - DO 128 I=4,IDO,2 + DO 128 I = 4,IDO,2 IDIJ = IDIJ+2 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)+WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)-WA(IDIJ)*CH(I-1,K,J) @@ -1196,15 +1196,15 @@ subroutine PASSF2 (IDO,L1,CC,CH,WA1) DIMENSION CC(IDO,2,L1) ,CH(IDO,L1,2), & WA1(1) if (IDO > 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 CH(1,K,1) = CC(1,1,K)+CC(1,2,K) CH(1,K,2) = CC(1,1,K)-CC(1,2,K) CH(2,K,1) = CC(2,1,K)+CC(2,2,K) CH(2,K,2) = CC(2,1,K)-CC(2,2,K) 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 CH(I-1,K,1) = CC(I-1,1,K)+CC(I-1,2,K) TR2 = CC(I-1,1,K)-CC(I-1,2,K) CH(I,K,1) = CC(I,1,K)+CC(I,2,K) @@ -1220,7 +1220,7 @@ subroutine PASSF3 (IDO,L1,CC,CH,WA1,WA2) WA1(1) ,WA2(1) DATA TAUR,TAUI /-.5,-.866025403784439/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TR2 = CC(1,2,K)+CC(1,3,K) CR2 = CC(1,1,K)+TAUR*TR2 CH(1,K,1) = CC(1,1,K)+TR2 @@ -1235,8 +1235,8 @@ subroutine PASSF3 (IDO,L1,CC,CH,WA1,WA2) CH(2,K,3) = CI2-CR3 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TR2 = CC(I-1,2,K)+CC(I-1,3,K) CR2 = CC(I-1,1,K)+TAUR*TR2 CH(I-1,K,1) = CC(I-1,1,K)+TR2 @@ -1261,7 +1261,7 @@ subroutine PASSF4 (IDO,L1,CC,CH,WA1,WA2,WA3) DIMENSION CC(IDO,4,L1) ,CH(IDO,L1,4), & WA1(1) ,WA2(1) ,WA3(1) if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI1 = CC(2,1,K)-CC(2,3,K) TI2 = CC(2,1,K)+CC(2,3,K) TR4 = CC(2,2,K)-CC(2,4,K) @@ -1280,8 +1280,8 @@ subroutine PASSF4 (IDO,L1,CC,CH,WA1,WA2,WA3) CH(2,K,4) = TI1-TI4 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI1 = CC(I,1,K)-CC(I,3,K) TI2 = CC(I,1,K)+CC(I,3,K) TI3 = CC(I,2,K)+CC(I,4,K) @@ -1314,7 +1314,7 @@ subroutine PASSF5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) DATA TR11,TI11,TR12,TI12 /.309016994374947,-.951056516295154, & -.809016994374947,-.587785252292473/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI5 = CC(2,2,K)-CC(2,5,K) TI2 = CC(2,2,K)+CC(2,5,K) TI4 = CC(2,3,K)-CC(2,4,K) @@ -1343,8 +1343,8 @@ subroutine PASSF5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) CH(2,K,5) = CI2-CR5 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI5 = CC(I,2,K)-CC(I,5,K) TI2 = CC(I,2,K)+CC(I,5,K) TI4 = CC(I,3,K)-CC(I,4,K) @@ -7787,7 +7787,7 @@ subroutine X04BAE(NOUT,REC) if (REC(I:I) /= ' ') goto 40 20 continue ! Write record to external file - 40 WRITE (NOUT,FMT=99999) REC(1:I) + 40 WRITE (NOUT,FMT = 99999) REC(1:I) endif return ! diff --git a/EXAMPLES/check_absolute_amplitude_of_pressure_source_seismograms_acoustic/analytical_solution_viscoacoustic_Carcione_version1.f90 b/EXAMPLES/check_absolute_amplitude_of_pressure_source_seismograms_acoustic/analytical_solution_viscoacoustic_Carcione_version1.f90 index af6e7363b..e4ece5fa4 100644 --- a/EXAMPLES/check_absolute_amplitude_of_pressure_source_seismograms_acoustic/analytical_solution_viscoacoustic_Carcione_version1.f90 +++ b/EXAMPLES/check_absolute_amplitude_of_pressure_source_seismograms_acoustic/analytical_solution_viscoacoustic_Carcione_version1.f90 @@ -152,7 +152,7 @@ program analytical_solution print *,'deltat = ',deltat ! define the spectrum of the source - do ifreq=0,nfreq + do ifreq = 0,nfreq freq = deltafreq * dble(ifreq) omega = 2.d0 * pi * freq @@ -192,7 +192,7 @@ program analytical_solution ! ************** calcul solution analytique **************** ! d'apres Carcione GJI vol 95 p 611 (1988) - do ifreq=0,nfreq + do ifreq = 0,nfreq freq = deltafreq * dble(ifreq) omega = 2.d0 * pi * freq @@ -264,7 +264,7 @@ program analytical_solution ! use the Fourier values for pressure c(1) = cmplx(phi1(0)) - do ifreq=1,nfreq-2 + do ifreq = 1,nfreq-2 c(ifreq+1) = cmplx(phi1(ifreq)) c(nt+1-ifreq) = conjg(cmplx(phi1(ifreq))) enddo @@ -320,7 +320,7 @@ program analytical_solution endif endif - do it=1,nt + do it = 1,nt ! DK DK Dec 2011: subtract t0 to be consistent with the SPECFEM2D code time = dble(it-1)*deltat - t0 ! the seismograms are very long due to the very large number of FFT points used, @@ -420,7 +420,7 @@ subroutine CFFTB1 (N,C,CH,WA,IFAC) NA = 0 L1 = 1 IW = 1 - DO 116 K1=1,NF + DO 116 K1 = 1,NF IP = IFAC(K1+2) L2 = IP*L1 IDO = N/L2 @@ -470,7 +470,7 @@ subroutine CFFTB1 (N,C,CH,WA,IFAC) 116 continue if (NA == 0) return N2 = N+N - DO 117 I=1,N2 + DO 117 I = 1,N2 C(I) = CH(I) 117 continue END @@ -486,66 +486,66 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) IDP = IP*IDO if (IDO < L1) goto 106 - DO 103 J=2,IPPH + DO 103 J = 2,IPPH JC = IPP2-J - DO 102 K=1,L1 - DO 101 I=1,IDO + DO 102 K = 1,L1 + DO 101 I = 1,IDO CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 101 continue 102 continue 103 continue - DO 105 K=1,L1 - DO 104 I=1,IDO + DO 105 K = 1,L1 + DO 104 I = 1,IDO CH(I,K,1) = CC(I,1,K) 104 continue 105 continue goto 112 - 106 DO 109 J=2,IPPH + 106 DO 109 J = 2,IPPH JC = IPP2-J - DO 108 I=1,IDO - DO 107 K=1,L1 + DO 108 I = 1,IDO + DO 107 K = 1,L1 CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 107 continue 108 continue 109 continue - DO 111 I=1,IDO - DO 110 K=1,L1 + DO 111 I = 1,IDO + DO 110 K = 1,L1 CH(I,K,1) = CC(I,1,K) 110 continue 111 continue 112 IDL = 2-IDO INC = 0 - DO 116 L=2,IPPH + DO 116 L = 2,IPPH LC = IPP2-L IDL = IDL+IDO - DO 113 IK=1,IDL1 + DO 113 IK = 1,IDL1 C2(IK,L) = CH2(IK,1)+WA(IDL-1)*CH2(IK,2) C2(IK,LC) = WA(IDL)*CH2(IK,IP) 113 continue IDLJ = IDL INC = INC+IDO - DO 115 J=3,IPPH + DO 115 J = 3,IPPH JC = IPP2-J IDLJ = IDLJ+INC if (IDLJ > IDP) IDLJ = IDLJ-IDP WAR = WA(IDLJ-1) WAI = WA(IDLJ) - DO 114 IK=1,IDL1 + DO 114 IK = 1,IDL1 C2(IK,L) = C2(IK,L)+WAR*CH2(IK,J) C2(IK,LC) = C2(IK,LC)+WAI*CH2(IK,JC) 114 continue 115 continue 116 continue - DO 118 J=2,IPPH - DO 117 IK=1,IDL1 + DO 118 J = 2,IPPH + DO 117 IK = 1,IDL1 CH2(IK,1) = CH2(IK,1)+CH2(IK,J) 117 continue 118 continue - DO 120 J=2,IPPH + DO 120 J = 2,IPPH JC = IPP2-J - DO 119 IK=2,IDL1,2 + DO 119 IK = 2,IDL1,2 CH2(IK-1,J) = C2(IK-1,J)-C2(IK,JC) CH2(IK-1,JC) = C2(IK-1,J)+C2(IK,JC) CH2(IK,J) = C2(IK,J)+C2(IK-1,JC) @@ -555,22 +555,22 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) NAC = 1 if (IDO == 2) return NAC = 0 - DO 121 IK=1,IDL1 + DO 121 IK = 1,IDL1 C2(IK,1) = CH2(IK,1) 121 continue - DO 123 J=2,IP - DO 122 K=1,L1 + DO 123 J = 2,IP + DO 122 K = 1,L1 C1(1,K,J) = CH(1,K,J) C1(2,K,J) = CH(2,K,J) 122 continue 123 continue if (IDOT > L1) goto 127 IDIJ = 0 - DO 126 J=2,IP + DO 126 J = 2,IP IDIJ = IDIJ+2 - DO 125 I=4,IDO,2 + DO 125 I = 4,IDO,2 IDIJ = IDIJ+2 - DO 124 K=1,L1 + DO 124 K = 1,L1 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)-WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)+WA(IDIJ)*CH(I-1,K,J) 124 continue @@ -578,11 +578,11 @@ subroutine PASSB (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) 126 continue return 127 IDJ = 2-IDO - DO 130 J=2,IP + DO 130 J = 2,IP IDJ = IDJ+IDO - DO 129 K=1,L1 + DO 129 K = 1,L1 IDIJ = IDJ - DO 128 I=4,IDO,2 + DO 128 I = 4,IDO,2 IDIJ = IDIJ+2 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)-WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)+WA(IDIJ)*CH(I-1,K,J) @@ -595,15 +595,15 @@ subroutine PASSB2 (IDO,L1,CC,CH,WA1) DIMENSION CC(IDO,2,L1) ,CH(IDO,L1,2), & WA1(1) if (IDO > 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 CH(1,K,1) = CC(1,1,K)+CC(1,2,K) CH(1,K,2) = CC(1,1,K)-CC(1,2,K) CH(2,K,1) = CC(2,1,K)+CC(2,2,K) CH(2,K,2) = CC(2,1,K)-CC(2,2,K) 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 CH(I-1,K,1) = CC(I-1,1,K)+CC(I-1,2,K) TR2 = CC(I-1,1,K)-CC(I-1,2,K) CH(I,K,1) = CC(I,1,K)+CC(I,2,K) @@ -619,7 +619,7 @@ subroutine PASSB3 (IDO,L1,CC,CH,WA1,WA2) WA1(1) ,WA2(1) DATA TAUR,TAUI /-.5,.866025403784439/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TR2 = CC(1,2,K)+CC(1,3,K) CR2 = CC(1,1,K)+TAUR*TR2 CH(1,K,1) = CC(1,1,K)+TR2 @@ -634,8 +634,8 @@ subroutine PASSB3 (IDO,L1,CC,CH,WA1,WA2) CH(2,K,3) = CI2-CR3 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TR2 = CC(I-1,2,K)+CC(I-1,3,K) CR2 = CC(I-1,1,K)+TAUR*TR2 CH(I-1,K,1) = CC(I-1,1,K)+TR2 @@ -660,7 +660,7 @@ subroutine PASSB4 (IDO,L1,CC,CH,WA1,WA2,WA3) DIMENSION CC(IDO,4,L1) ,CH(IDO,L1,4), & WA1(1) ,WA2(1) ,WA3(1) if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI1 = CC(2,1,K)-CC(2,3,K) TI2 = CC(2,1,K)+CC(2,3,K) TR4 = CC(2,4,K)-CC(2,2,K) @@ -679,8 +679,8 @@ subroutine PASSB4 (IDO,L1,CC,CH,WA1,WA2,WA3) CH(2,K,4) = TI1-TI4 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI1 = CC(I,1,K)-CC(I,3,K) TI2 = CC(I,1,K)+CC(I,3,K) TI3 = CC(I,2,K)+CC(I,4,K) @@ -713,7 +713,7 @@ subroutine PASSB5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) DATA TR11,TI11,TR12,TI12 /.309016994374947,.951056516295154, & -.809016994374947,.587785252292473/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI5 = CC(2,2,K)-CC(2,5,K) TI2 = CC(2,2,K)+CC(2,5,K) TI4 = CC(2,3,K)-CC(2,4,K) @@ -742,8 +742,8 @@ subroutine PASSB5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) CH(2,K,5) = CI2-CR5 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI5 = CC(I,2,K)-CC(I,5,K) TI2 = CC(I,2,K)+CC(I,5,K) TI4 = CC(I,3,K)-CC(I,4,K) @@ -809,7 +809,7 @@ subroutine CFFTI1 (N,WA,IFAC) NL = NQ if (NTRY /= 2) goto 107 if (NF == 1) goto 107 - DO 106 I=2,NF + DO 106 I = 2,NF IB = NF-I+2 IFAC(IB+2) = IFAC(IB+1) 106 continue @@ -821,21 +821,21 @@ subroutine CFFTI1 (N,WA,IFAC) ARGH = TPI/FLOAT(N) I = 2 L1 = 1 - DO 110 K1=1,NF + DO 110 K1 = 1,NF IP = IFAC(K1+2) LD = 0 L2 = L1*IP IDO = N/L2 IDOT = IDO+IDO+2 IPM = IP-1 - DO 109 J=1,IPM + DO 109 J = 1,IPM I1 = I WA(I-1) = 1. WA(I) = 0. LD = LD+L1 FI = 0. ARGLD = FLOAT(LD)*ARGH - DO 108 II=4,IDOT,2 + DO 108 II = 4,IDOT,2 I = I+2 FI = FI+1. ARG = FI*ARGLD @@ -864,7 +864,7 @@ subroutine CFFTF1 (N,C,CH,WA,IFAC) NA = 0 L1 = 1 IW = 1 - DO 116 K1=1,NF + DO 116 K1 = 1,NF IP = IFAC(K1+2) L2 = IP*L1 IDO = N/L2 @@ -914,7 +914,7 @@ subroutine CFFTF1 (N,C,CH,WA,IFAC) 116 continue if (NA == 0) return N2 = N+N - DO 117 I=1,N2 + DO 117 I = 1,N2 C(I) = CH(I) 117 continue END @@ -930,66 +930,66 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) IDP = IP*IDO if (IDO < L1) goto 106 - DO 103 J=2,IPPH + DO 103 J = 2,IPPH JC = IPP2-J - DO 102 K=1,L1 - DO 101 I=1,IDO + DO 102 K = 1,L1 + DO 101 I = 1,IDO CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 101 continue 102 continue 103 continue - DO 105 K=1,L1 - DO 104 I=1,IDO + DO 105 K = 1,L1 + DO 104 I = 1,IDO CH(I,K,1) = CC(I,1,K) 104 continue 105 continue goto 112 - 106 DO 109 J=2,IPPH + 106 DO 109 J = 2,IPPH JC = IPP2-J - DO 108 I=1,IDO - DO 107 K=1,L1 + DO 108 I = 1,IDO + DO 107 K = 1,L1 CH(I,K,J) = CC(I,J,K)+CC(I,JC,K) CH(I,K,JC) = CC(I,J,K)-CC(I,JC,K) 107 continue 108 continue 109 continue - DO 111 I=1,IDO - DO 110 K=1,L1 + DO 111 I = 1,IDO + DO 110 K = 1,L1 CH(I,K,1) = CC(I,1,K) 110 continue 111 continue 112 IDL = 2-IDO INC = 0 - DO 116 L=2,IPPH + DO 116 L = 2,IPPH LC = IPP2-L IDL = IDL+IDO - DO 113 IK=1,IDL1 + DO 113 IK = 1,IDL1 C2(IK,L) = CH2(IK,1)+WA(IDL-1)*CH2(IK,2) C2(IK,LC) = -WA(IDL)*CH2(IK,IP) 113 continue IDLJ = IDL INC = INC+IDO - DO 115 J=3,IPPH + DO 115 J = 3,IPPH JC = IPP2-J IDLJ = IDLJ+INC if (IDLJ > IDP) IDLJ = IDLJ-IDP WAR = WA(IDLJ-1) WAI = WA(IDLJ) - DO 114 IK=1,IDL1 + DO 114 IK = 1,IDL1 C2(IK,L) = C2(IK,L)+WAR*CH2(IK,J) C2(IK,LC) = C2(IK,LC)-WAI*CH2(IK,JC) 114 continue 115 continue 116 continue - DO 118 J=2,IPPH - DO 117 IK=1,IDL1 + DO 118 J = 2,IPPH + DO 117 IK = 1,IDL1 CH2(IK,1) = CH2(IK,1)+CH2(IK,J) 117 continue 118 continue - DO 120 J=2,IPPH + DO 120 J = 2,IPPH JC = IPP2-J - DO 119 IK=2,IDL1,2 + DO 119 IK = 2,IDL1,2 CH2(IK-1,J) = C2(IK-1,J)-C2(IK,JC) CH2(IK-1,JC) = C2(IK-1,J)+C2(IK,JC) CH2(IK,J) = C2(IK,J)+C2(IK-1,JC) @@ -999,22 +999,22 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) NAC = 1 if (IDO == 2) return NAC = 0 - DO 121 IK=1,IDL1 + DO 121 IK = 1,IDL1 C2(IK,1) = CH2(IK,1) 121 continue - DO 123 J=2,IP - DO 122 K=1,L1 + DO 123 J = 2,IP + DO 122 K = 1,L1 C1(1,K,J) = CH(1,K,J) C1(2,K,J) = CH(2,K,J) 122 continue 123 continue if (IDOT > L1) goto 127 IDIJ = 0 - DO 126 J=2,IP + DO 126 J = 2,IP IDIJ = IDIJ+2 - DO 125 I=4,IDO,2 + DO 125 I = 4,IDO,2 IDIJ = IDIJ+2 - DO 124 K=1,L1 + DO 124 K = 1,L1 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)+WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)-WA(IDIJ)*CH(I-1,K,J) 124 continue @@ -1022,11 +1022,11 @@ subroutine PASSF (NAC,IDO,IP,L1,IDL1,CC,C1,C2,CH,CH2,WA) 126 continue return 127 IDJ = 2-IDO - DO 130 J=2,IP + DO 130 J = 2,IP IDJ = IDJ+IDO - DO 129 K=1,L1 + DO 129 K = 1,L1 IDIJ = IDJ - DO 128 I=4,IDO,2 + DO 128 I = 4,IDO,2 IDIJ = IDIJ+2 C1(I-1,K,J) = WA(IDIJ-1)*CH(I-1,K,J)+WA(IDIJ)*CH(I,K,J) C1(I,K,J) = WA(IDIJ-1)*CH(I,K,J)-WA(IDIJ)*CH(I-1,K,J) @@ -1039,15 +1039,15 @@ subroutine PASSF2 (IDO,L1,CC,CH,WA1) DIMENSION CC(IDO,2,L1) ,CH(IDO,L1,2), & WA1(1) if (IDO > 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 CH(1,K,1) = CC(1,1,K)+CC(1,2,K) CH(1,K,2) = CC(1,1,K)-CC(1,2,K) CH(2,K,1) = CC(2,1,K)+CC(2,2,K) CH(2,K,2) = CC(2,1,K)-CC(2,2,K) 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 CH(I-1,K,1) = CC(I-1,1,K)+CC(I-1,2,K) TR2 = CC(I-1,1,K)-CC(I-1,2,K) CH(I,K,1) = CC(I,1,K)+CC(I,2,K) @@ -1063,7 +1063,7 @@ subroutine PASSF3 (IDO,L1,CC,CH,WA1,WA2) WA1(1) ,WA2(1) DATA TAUR,TAUI /-.5,-.866025403784439/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TR2 = CC(1,2,K)+CC(1,3,K) CR2 = CC(1,1,K)+TAUR*TR2 CH(1,K,1) = CC(1,1,K)+TR2 @@ -1078,8 +1078,8 @@ subroutine PASSF3 (IDO,L1,CC,CH,WA1,WA2) CH(2,K,3) = CI2-CR3 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TR2 = CC(I-1,2,K)+CC(I-1,3,K) CR2 = CC(I-1,1,K)+TAUR*TR2 CH(I-1,K,1) = CC(I-1,1,K)+TR2 @@ -1104,7 +1104,7 @@ subroutine PASSF4 (IDO,L1,CC,CH,WA1,WA2,WA3) DIMENSION CC(IDO,4,L1) ,CH(IDO,L1,4), & WA1(1) ,WA2(1) ,WA3(1) if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI1 = CC(2,1,K)-CC(2,3,K) TI2 = CC(2,1,K)+CC(2,3,K) TR4 = CC(2,2,K)-CC(2,4,K) @@ -1123,8 +1123,8 @@ subroutine PASSF4 (IDO,L1,CC,CH,WA1,WA2,WA3) CH(2,K,4) = TI1-TI4 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI1 = CC(I,1,K)-CC(I,3,K) TI2 = CC(I,1,K)+CC(I,3,K) TI3 = CC(I,2,K)+CC(I,4,K) @@ -1157,7 +1157,7 @@ subroutine PASSF5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) DATA TR11,TI11,TR12,TI12 /.309016994374947,-.951056516295154, & -.809016994374947,-.587785252292473/ if (IDO /= 2) goto 102 - DO 101 K=1,L1 + DO 101 K = 1,L1 TI5 = CC(2,2,K)-CC(2,5,K) TI2 = CC(2,2,K)+CC(2,5,K) TI4 = CC(2,3,K)-CC(2,4,K) @@ -1186,8 +1186,8 @@ subroutine PASSF5 (IDO,L1,CC,CH,WA1,WA2,WA3,WA4) CH(2,K,5) = CI2-CR5 101 continue return - 102 DO 104 K=1,L1 - DO 103 I=2,IDO,2 + 102 DO 104 K = 1,L1 + DO 103 I = 2,IDO,2 TI5 = CC(I,2,K)-CC(I,5,K) TI2 = CC(I,2,K)+CC(I,5,K) TI4 = CC(I,3,K)-CC(I,4,K) @@ -7627,7 +7627,7 @@ subroutine X04BAE(NOUT,REC) if (REC(I:I) /= ' ') goto 40 20 continue ! Write record to external file - 40 WRITE (NOUT,FMT=99999) REC(1:I) + 40 WRITE (NOUT,FMT = 99999) REC(1:I) endif return ! diff --git a/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/generate_topo_sinusoide.f90 b/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/generate_topo_sinusoide.f90 index dfd7012c5..6db1c2ce8 100644 --- a/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/generate_topo_sinusoide.f90 +++ b/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/generate_topo_sinusoide.f90 @@ -26,7 +26,7 @@ program generate ! print *,ntopo - do i=1,ntopo + do i = 1,ntopo xpoint = dble(i-1)*xmax/dble(ntopo - 1) diff --git a/EXAMPLES/global_Earth_ak135f/create_mesh_AK135F_2D_with_central_cube_no_PML.F90 b/EXAMPLES/global_Earth_ak135f/create_mesh_AK135F_2D_with_central_cube_no_PML.F90 index 70093e496..56382f1d4 100644 --- a/EXAMPLES/global_Earth_ak135f/create_mesh_AK135F_2D_with_central_cube_no_PML.F90 +++ b/EXAMPLES/global_Earth_ak135f/create_mesh_AK135F_2D_with_central_cube_no_PML.F90 @@ -267,7 +267,7 @@ program generate_mesh ! generation maillage de la surface - do ix=0,nspec_surf_whole_circle + do ix = 0,nspec_surf_whole_circle xicoord = dble(ix)/dble(nspec_surf_whole_circle) @@ -292,7 +292,7 @@ program generate_mesh !---- volume - do irad=0,nspec_rad_670_surf + do irad = 0,nspec_rad_670_surf radcoord = dble(irad)/dble(nspec_rad_670_surf) x1vol(ix,irad) = x1surf(ix) * radcoord + x1bot(ix) * (one - radcoord) y1vol(ix,irad) = y1surf(ix) * radcoord + y1bot(ix) * (one - radcoord) @@ -304,8 +304,8 @@ program generate_mesh ispec = 0 ! %%% bloc d670 -> surface - do irad=0,nspec_rad_670_surf-2,2 - do ix=0,nspec_surf_whole_circle/factor_divide_mesh-2,2 + do irad = 0,nspec_rad_670_surf-2,2 + do ix = 0,nspec_surf_whole_circle/factor_divide_mesh-2,2 ispec = ispec + 1 @@ -337,7 +337,7 @@ program generate_mesh ! generation maillage de la surface - do ix=0,nspec_surf_whole_circle + do ix = 0,nspec_surf_whole_circle xicoord = dble(ix)/dble(nspec_surf_whole_circle) @@ -362,7 +362,7 @@ program generate_mesh !---- volume - do irad=0,nspec_rad_CMB_670 + do irad = 0,nspec_rad_CMB_670 radcoord = dble(irad)/dble(nspec_rad_CMB_670) x2vol(ix,irad) = x2surf(ix) * radcoord + x2bot(ix) * (one - radcoord) y2vol(ix,irad) = y2surf(ix) * radcoord + y2bot(ix) * (one - radcoord) @@ -371,8 +371,8 @@ program generate_mesh enddo ! --- bloc principal - do irad=0,nspec_rad_CMB_670-8,4 - do ix=0,nspec_surf_whole_circle/factor_divide_mesh-4,4 + do irad = 0,nspec_rad_CMB_670-8,4 + do ix = 0,nspec_surf_whole_circle/factor_divide_mesh-4,4 ispec = ispec + 1 @@ -401,8 +401,8 @@ program generate_mesh enddo ! --- zone de raccord geometrique conforme - irad=nspec_rad_CMB_670-4 - do ix=0,nspec_surf_whole_circle/factor_divide_mesh-8,8 + irad = nspec_rad_CMB_670-4 + do ix = 0,nspec_surf_whole_circle/factor_divide_mesh-8,8 ispec = ispec + 1 @@ -479,8 +479,8 @@ program generate_mesh enddo ! --- zone de raccord geometrique conforme inverse - irad=nspec_rad_CMB_670-4 - do ix=4,nspec_surf_whole_circle/factor_divide_mesh-4,8 + irad = nspec_rad_CMB_670-4 + do ix = 4,nspec_surf_whole_circle/factor_divide_mesh-4,8 ispec = ispec + 1 @@ -560,7 +560,7 @@ program generate_mesh ! generation maillage de la surface - do ix=0,nspec_surf_whole_circle + do ix = 0,nspec_surf_whole_circle xicoord = dble(ix)/dble(nspec_surf_whole_circle) @@ -585,7 +585,7 @@ program generate_mesh !---- volume - do irad=0,nspec_rad_doubling_OC_to_CMB + do irad = 0,nspec_rad_doubling_OC_to_CMB radcoord = dble(irad)/dble(nspec_rad_doubling_OC_to_CMB) x3vol(ix,irad) = x3surf(ix) * radcoord + x3bot(ix) * (one - radcoord) y3vol(ix,irad) = y3surf(ix) * radcoord + y3bot(ix) * (one - radcoord) @@ -594,8 +594,8 @@ program generate_mesh enddo ! --- bloc principal - do irad=0,nspec_rad_doubling_OC_to_CMB-4,4 - do ix=0,nspec_surf_whole_circle/factor_divide_mesh-4,4 + do irad = 0,nspec_rad_doubling_OC_to_CMB-4,4 + do ix = 0,nspec_surf_whole_circle/factor_divide_mesh-4,4 ispec = ispec + 1 @@ -627,7 +627,7 @@ program generate_mesh ! generation maillage de la surface - do ix=0,nspec_surf_whole_circle + do ix = 0,nspec_surf_whole_circle xicoord = dble(ix)/dble(nspec_surf_whole_circle) @@ -652,7 +652,7 @@ program generate_mesh !---- volume - do irad=0,nspec_rad_ICB_to_doubling_OC + do irad = 0,nspec_rad_ICB_to_doubling_OC radcoord = dble(irad)/dble(nspec_rad_ICB_to_doubling_OC) x3vol(ix,irad) = x3surf(ix) * radcoord + x3bot(ix) * (one - radcoord) y3vol(ix,irad) = y3surf(ix) * radcoord + y3bot(ix) * (one - radcoord) @@ -661,8 +661,8 @@ program generate_mesh enddo ! --- bloc principal - do irad=0,nspec_rad_ICB_to_doubling_OC-8,4 - do ix=0,nspec_surf_whole_circle/factor_divide_mesh-8,8 + do irad = 0,nspec_rad_ICB_to_doubling_OC-8,4 + do ix = 0,nspec_surf_whole_circle/factor_divide_mesh-8,8 ispec = ispec + 1 @@ -691,8 +691,8 @@ program generate_mesh enddo ! --- zone de raccord geometrique conforme - irad=nspec_rad_ICB_to_doubling_OC-4 - do ix=0,nspec_surf_whole_circle/factor_divide_mesh-16,16 + irad = nspec_rad_ICB_to_doubling_OC-4 + do ix = 0,nspec_surf_whole_circle/factor_divide_mesh-16,16 ispec = ispec + 1 @@ -769,8 +769,8 @@ program generate_mesh enddo ! --- zone de raccord geometrique conforme inverse - irad=nspec_rad_ICB_to_doubling_OC-4 - do ix=8,nspec_surf_whole_circle/factor_divide_mesh-8,16 + irad = nspec_rad_ICB_to_doubling_OC-4 + do ix = 8,nspec_surf_whole_circle/factor_divide_mesh-8,16 ispec = ispec + 1 @@ -850,7 +850,7 @@ program generate_mesh ! generation maillage de la surface - do ix=0,nspec_surf_whole_circle + do ix = 0,nspec_surf_whole_circle xicoord = dble(ix)/dble(nspec_surf_whole_circle) @@ -909,7 +909,7 @@ program generate_mesh !---- volume - do irad=0,nspec_rad_Cube_ICB + do irad = 0,nspec_rad_Cube_ICB radcoord = dble(irad)/dble(nspec_rad_Cube_ICB) x4vol(ix,irad) = x4surf(ix) * radcoord + x4bot(ix) * (one - radcoord) y4vol(ix,irad) = y4surf(ix) * radcoord + y4bot(ix) * (one - radcoord) @@ -917,8 +917,8 @@ program generate_mesh enddo - do irad=0,nspec_rad_Cube_ICB-4,4 - do ix=0,nspec_surf_whole_circle/factor_divide_mesh-8,8 + do irad = 0,nspec_rad_Cube_ICB-4,4 + do ix = 0,nspec_surf_whole_circle/factor_divide_mesh-8,8 ispec = ispec + 1 @@ -951,13 +951,13 @@ program generate_mesh !---- generer l'interieur du cube !---- - do ix=0,nspec_surf_whole_circle/16 + do ix = 0,nspec_surf_whole_circle/16 xlincoord = dble(ix)/dble(nspec_surf_whole_circle/16) !---- volume - do irad=0,nspec_surf_whole_circle/16 + do irad = 0,nspec_surf_whole_circle/16 radcoord = dble(irad)/dble(nspec_surf_whole_circle/16) ! use a "flat" cubed sphere to create the central cube @@ -987,8 +987,8 @@ program generate_mesh icentral_cube2 = nspec_surf_whole_circle/16-2 endif - do irad=0,nspec_surf_whole_circle/16-2,2 - do ix=icentral_cube1,icentral_cube2,2 + do irad = 0,nspec_surf_whole_circle/16-2,2 + do ix = icentral_cube1,icentral_cube2,2 ispec = ispec + 1 @@ -1035,7 +1035,7 @@ program generate_mesh ! get coordinates of the grid points xp(:) = 0.d0 yp(:) = 0.d0 - do ispec=1,nspec + do ispec = 1,nspec ieoff = ngnod*(ispec - 1) ilocnum = 0 @@ -1050,9 +1050,9 @@ program generate_mesh ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! Establish initial pointers - do ie=1,nspec + do ie = 1,nspec ieoff = ngnod*(ie -1) - do ix=1,ngnod + do ix = 1,ngnod loc (ix+ieoff) = ix+ieoff enddo enddo @@ -1061,18 +1061,18 @@ program generate_mesh xtypdist=+HUGEVAL - do ispec=1,nspec + do ispec = 1,nspec xminval=+HUGEVAL yminval=+HUGEVAL xmaxval=-HUGEVAL ymaxval=-HUGEVAL ieoff=ngnod*(ispec-1) - do ilocnum=1,ngnod - xmaxval=max(xp(ieoff+ilocnum),xmaxval) - xminval=min(xp(ieoff+ilocnum),xminval) - ymaxval=max(yp(ieoff+ilocnum),ymaxval) - yminval=min(yp(ieoff+ilocnum),yminval) + do ilocnum = 1,ngnod + xmaxval = max(xp(ieoff+ilocnum),xmaxval) + xminval = min(xp(ieoff+ilocnum),xminval) + ymaxval = max(yp(ieoff+ilocnum),ymaxval) + yminval = min(yp(ieoff+ilocnum),yminval) enddo ! compute the minimum typical "size" of an element in the mesh @@ -1089,10 +1089,10 @@ program generate_mesh ifseg(1) = .true. ninseg(1) = npoin_max - do j=1,NDIM + do j = 1,NDIM ! Sort within each segment - ioff=1 - do iseg=1,nseg + ioff = 1 + do iseg = 1,nseg if (j == 1) then call rank(xp(ioff),ind,ninseg(iseg)) else @@ -1105,17 +1105,17 @@ program generate_mesh enddo ! Check for jumps in current coordinate if (j == 1) then - do i=2,npoin_max - if (abs(xp(i)-xp(i-1)) > xtol) ifseg(i)=.true. + do i = 2,npoin_max + if (abs(xp(i)-xp(i-1)) > xtol) ifseg(i) = .true. enddo else - do i=2,npoin_max - if (abs(yp(i)-yp(i-1)) > xtol) ifseg(i)=.true. + do i = 2,npoin_max + if (abs(yp(i)-yp(i-1)) > xtol) ifseg(i) = .true. enddo endif ! Count up number of different segments nseg = 0 - do i=1,npoin_max + do i = 1,npoin_max if (ifseg(i)) then nseg = nseg+1 ninseg(nseg) = 1 @@ -1128,8 +1128,8 @@ program generate_mesh ! Assign global node numbers (now sorted lexicographically!) ! ig = 0 - do i=1,npoin_max - if (ifseg(i)) ig=ig+1 + do i = 1,npoin_max + if (ifseg(i)) ig = ig+1 iglob(loc(i)) = ig enddo @@ -1150,7 +1150,7 @@ program generate_mesh ! generer les coordonnees des points du maillage global ! in global numbering print *,'Generating the coordinates of the points of the global mesh...' - do ispec=1,nspec + do ispec = 1,nspec do ia = 1,ngnod xp(ibool(ia,ispec)) = xcoord(ia,ispec) yp(ibool(ia,ispec)) = ycoord(ia,ispec) @@ -1251,7 +1251,7 @@ program generate_mesh ispec_count = 0 ! count the number of elements that are in contact with the symmetry axis - do ispec=1,nspec + do ispec = 1,nspec i = 0 if (xcoord(1,ispec) < 0.001d0) i = i + 1 @@ -1278,7 +1278,7 @@ program generate_mesh write(22,*) ispec_count #endif - do ispec=1,nspec + do ispec = 1,nspec #ifdef USE_BINARY_FOR_EXTERNAL_MESH_DATABASE if (xcoord(1,ispec) < 0.001d0 .and. xcoord(2,ispec) < 0.001d0) write(22) ispec,' 2 ',ibool(1,ispec),ibool(2,ispec),IBOTTOM if (xcoord(2,ispec) < 0.001d0 .and. xcoord(3,ispec) < 0.001d0) write(22) ispec,' 2 ',ibool(2,ispec),ibool(3,ispec),IRIGHT @@ -1307,7 +1307,7 @@ program generate_mesh open(unit=20,file='gridfile.gnu',status='unknown') - do ispec=1,nspec + do ispec = 1,nspec ! draw the four edges of each element (using straight lines to simplify) ia1 = 1 @@ -1377,41 +1377,41 @@ subroutine rank(A,IND,N) integer i,j,l,ir,indx double precision q - do J=1,N + do J = 1,N IND(j)=j enddo if (n == 1) return - L=n/2+1 - ir=n + L = n/2+1 + ir = n 100 continue if (l > 1) then - l=l-1 + l = l-1 indx=ind(l) q=a(indx) ELSE indx=ind(ir) q=a(indx) ind(ir)=ind(1) - ir=ir-1 + ir = ir-1 if (ir == 1) then ind(1)=indx return endif endif - i=l - j=l+l + i = l + j = l+l 200 continue if (J <= IR) then if (J < IR) then - if (A(IND(j)) < A(IND(j+1))) j=j+1 + if (A(IND(j)) < A(IND(j+1))) j = j+1 endif if (q < A(IND(j))) then IND(I)=IND(J) - I=J - J=J+J + I = J + J = J+J ELSE - J=IR+1 + J = IR+1 endif goto 200 endif @@ -1436,7 +1436,7 @@ subroutine swap(a,w,ind,n) W(:) = A(:) - do J=1,N + do J = 1,N A(j) = W(ind(j)) enddo @@ -1457,7 +1457,7 @@ subroutine iswap(a,w,ind,n) W(:) = A(:) - do J=1,N + do J = 1,N A(j) = W(ind(j)) enddo diff --git a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/compute_adjoint_source.f90 b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/compute_adjoint_source.f90 index 939eddc11..aad8003bc 100644 --- a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/compute_adjoint_source.f90 +++ b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/compute_adjoint_source.f90 @@ -31,7 +31,7 @@ program adjoit_source open(12,file=trim(file_synth)) open(13,file=trim(file_adj)) !count number of lines - nt=0 + nt = 0 do read(11,*,end=97) t,z nt = nt + 1 @@ -40,7 +40,7 @@ program adjoit_source allocate(time(nt), pressure_synth(nt), pressure_data(nt), adjoint_source(nt)) open(11,file=trim(file_data)) - do ii=1,nt + do ii = 1,nt read(11,*) t,z read(12,*) t,x time(i)=t @@ -57,7 +57,7 @@ program adjoit_source adjoint_source(:)= pressure_synth(:)-pressure_data(:) dt_square = (time(2) - time(1))**2 write(13,*) time(1),0. - do it=2,nt-1 + do it = 2,nt-1 write(13,*) time(it), adjoint_source(it-1) + adjoint_source(it+1) - 2.*adjoint_source(it) / dt_square enddo write(13,*) time(nt),0. diff --git a/EXAMPLES/thermocline/extract_thermocline.f90 b/EXAMPLES/thermocline/extract_thermocline.f90 index 9f1b1d085..0d71ae54f 100644 --- a/EXAMPLES/thermocline/extract_thermocline.f90 +++ b/EXAMPLES/thermocline/extract_thermocline.f90 @@ -20,9 +20,9 @@ program extract_thermocline read(*,*) ! in the PNM format, the image starts in the upper-left corner - do iy=NY,1,-1 + do iy = NY,1,-1 first_red_pixel_in_this_line = .true. - do ix=1,NX + do ix = 1,NX read(*,*) R read(*,*) G read(*,*) B diff --git a/setup/config.fh.in b/setup/config.fh.in index 8ca428ce8..a3b648938 100644 --- a/setup/config.fh.in +++ b/setup/config.fh.in @@ -22,9 +22,9 @@ ! switches do-loops between: do j=1,NGLLZ; do i=1,NGLLX <-> do ij=1,NGLLSQUARE #ifdef FORCE_VECTORIZATION -# define DO_LOOP_IJ do ij=1,NGLLSQUARE +# define DO_LOOP_IJ do ij = 1,NGLLSQUARE #else -# define DO_LOOP_IJ do j=1,NGLLZ; do i=1,NGLLX +# define DO_LOOP_IJ do j = 1,NGLLZ; do i = 1,NGLLX #endif ! switches enddo-loops between: enddo; enddo ! NGLLZ,NGLLX <-> enddo ! NGLLSQUARE diff --git a/src/meshfem2D/decompose_mesh.F90 b/src/meshfem2D/decompose_mesh.F90 index 81aeefbe7..ade64bac0 100644 --- a/src/meshfem2D/decompose_mesh.F90 +++ b/src/meshfem2D/decompose_mesh.F90 @@ -266,7 +266,7 @@ subroutine decompose_mesh() allocate(my_nb_interfaces(0:ninterfaces-1)) else ! dummy allocation - ninterfaces=0 + ninterfaces = 0 allocate(my_interfaces(0:ninterfaces-1)) allocate(my_nb_interfaces(0:ninterfaces-1)) endif diff --git a/src/meshfem2D/rotate_mesh.f90 b/src/meshfem2D/rotate_mesh.f90 index 56af4b968..6d8c54bc3 100644 --- a/src/meshfem2D/rotate_mesh.f90 +++ b/src/meshfem2D/rotate_mesh.f90 @@ -92,16 +92,16 @@ subroutine rotate_mesh_for_plane_wave(NGNOD) do j = 1, 4 if (j == 1) then - index_edge=3 + index_edge = 3 ibool_rotated(:,:) = ibool(:,:) else if (j == 2) then - index_edge=1 + index_edge = 1 ibool(:,:) = ibool_rotated(:,:) else if (j == 3) then - index_edge=4 + index_edge = 4 ibool(:,:) = ibool_rotated(:,:) else if (j == 4) then - index_edge=2 + index_edge = 2 ibool(:,:) = ibool_rotated(:,:) else call stop_the_code('j should be >= 1 and <= 4') @@ -556,16 +556,16 @@ subroutine rotate_mesh_for_acoustic_forcing(NGNOD) do j = 1, 4 if (j == 1) then - index_edge=3 + index_edge = 3 ibool_rotated(:,:) = ibool(:,:) else if (j == 2) then - index_edge=1 + index_edge = 1 ibool(:,:) = ibool_rotated(:,:) else if (j == 3) then - index_edge=4 + index_edge = 4 ibool(:,:) = ibool_rotated(:,:) else if (j == 4) then - index_edge=2 + index_edge = 2 ibool(:,:) = ibool_rotated(:,:) else call stop_the_code('j should be >= 1 and <= 4') diff --git a/src/meshfem2D/save_gnuplot_file.f90 b/src/meshfem2D/save_gnuplot_file.f90 index 45f0a5db8..c2b9f6e8f 100644 --- a/src/meshfem2D/save_gnuplot_file.f90 +++ b/src/meshfem2D/save_gnuplot_file.f90 @@ -68,8 +68,8 @@ subroutine save_gnuplot_file(NGNOD,nx,nz,x,z) else istepz = 2 endif - do ili=0,nz,istepz - do icol=0,nx-istepx,istepx + do ili = 0,nz,istepz + do icol = 0,nx-istepx,istepx write(IOUT_VIS,*) sngl(x(icol,ili)),sngl(z(icol,ili)) write(IOUT_VIS,*) sngl(x(icol+istepx,ili)),sngl(z(icol+istepx,ili)) write(IOUT_VIS,10) @@ -84,8 +84,8 @@ subroutine save_gnuplot_file(NGNOD,nx,nz,x,z) istepx = 2 endif istepz = 1 - do icol=0,nx,istepx - do ili=0,nz-istepz,istepz + do icol = 0,nx,istepx + do ili = 0,nz-istepz,istepz write(IOUT_VIS,*) sngl(x(icol,ili)),sngl(z(icol,ili)) write(IOUT_VIS,*) sngl(x(icol,ili+istepz)),sngl(z(icol,ili+istepz)) write(IOUT_VIS,10) diff --git a/src/shared/gll_library.f90 b/src/shared/gll_library.f90 index ea8a69a64..7893fc074 100644 --- a/src/shared/gll_library.f90 +++ b/src/shared/gll_library.f90 @@ -48,7 +48,7 @@ double precision function endw1(n,alpha,beta) integer n double precision alpha,beta - double precision, parameter :: zero=0.d0,one=1.d0,two=2.d0,three=3.d0,four=4.d0 + double precision, parameter :: zero = 0.d0,one = 1.d0,two = 2.d0,three = 3.d0,four = 4.d0 double precision apb,f1,fint1,fint2,f2,di,abn,abnn,a1,a2,a3,f3 double precision, external :: gammaf integer i @@ -74,7 +74,7 @@ double precision function endw1(n,alpha,beta) endw1 = f2 return endif - do i=3,n + do i = 3,n di = dble(i-1) abn = alpha+beta+di abnn = abn+di @@ -100,7 +100,7 @@ double precision function endw2(n,alpha,beta) integer n double precision alpha,beta - double precision, parameter :: zero=0.d0,one=1.d0,two=2.d0,three=3.d0,four=4.d0 + double precision, parameter :: zero = 0.d0,one = 1.d0,two = 2.d0,three = 3.d0,four = 4.d0 double precision apb,f1,fint1,fint2,f2,di,abn,abnn,a1,a2,a3,f3 double precision, external :: gammaf integer i @@ -126,7 +126,7 @@ double precision function endw2(n,alpha,beta) endw2 = f2 return endif - do i=3,n + do i = 3,n di = dble(i-1) abn = alpha+beta+di abnn = abn+di @@ -153,7 +153,7 @@ double precision function gammaf (x) double precision x - double precision, parameter :: half=0.5d0,one=1.d0,two=2.d0 + double precision, parameter :: half = 0.5d0,one = 1.d0,two = 2.d0 gammaf = one @@ -212,7 +212,7 @@ subroutine jacg (xjac,np,alpha,beta) p = 0.d0 pd = 0.d0 - do j=1,np + do j = 1,np if (j == 1) then x = dcos((2.d0*(dble(j)-1.d0)+1.d0)*dth) else @@ -221,11 +221,11 @@ subroutine jacg (xjac,np,alpha,beta) x = (x1+x2)/2.d0 endif - do k=1,K_MAX_ITER + do k = 1,K_MAX_ITER call jacobf (p,pd,pm1,pdm1,pm2,pdm2,np,alpha,beta,x) recsum = 0.d0 jm = j-1 - do i=1,jm + do i = 1,jm recsum = recsum+1.d0/(x-xjac(np-i+1)) enddo delx = -p/(pd-recsum*p) @@ -246,12 +246,12 @@ subroutine jacg (xjac,np,alpha,beta) jmin = 0 ! orders xjac array in increasing values - do i=1,np + do i = 1,np xmin = 2.d0 jmin = i ! looks for index with minimum value - do j=i,np + do j = i,np ! note: some compilers (cray) might be too aggressive in optimizing this loop, ! thus we need this temporary array value x to store and compare values x = xjac(j) @@ -309,7 +309,7 @@ subroutine jacobf (poly,pder,polym1,pderm1,polym2,pderm2,n,alp,bet,x) pder = (apb+2.d0)/2.d0 if (n == 1) return - do k=2,n + do k = 2,n dk = dble(k) a1 = 2.d0*dk*(dk+apb)*(2.d0*dk+apb-2.d0) a2 = (2.d0*dk+apb-1.d0)*(alp**2-bet**2) @@ -440,7 +440,7 @@ double precision function pnormj (n,alpha,beta) prod = prod*(one+alpha)*(two+alpha) prod = prod*(one+beta)*(two+beta) - do i=3,n + do i = 3,n dindx = dble(i) frac = (dindx+alpha)*(dindx+beta)/(dindx*(dindx+alpha+beta)) prod = prod*frac @@ -467,7 +467,7 @@ subroutine zwgjd(z,w,np,alpha,beta) implicit none - double precision, parameter :: zero=0.d0,one=1.d0,two=2.d0 + double precision, parameter :: zero = 0.d0,one = 1.d0,two = 2.d0 integer np double precision z(np),w(np) @@ -511,7 +511,7 @@ subroutine zwgjd(z,w,np,alpha,beta) fac3 = fac2+one fnorm = pnormj(np1,alpha,beta) rcoef = (fnorm*fac2*fac3)/(two*fac1*dnp2) - do i=1,np + do i = 1,np call jacobf(p,pd,pm1,pdm1,pm2,pdm2,np2,alpha,beta,z(i)) w(i) = -rcoef/(p*pdm1) enddo @@ -538,7 +538,7 @@ subroutine zwgljd(z,w,np,alpha,beta) implicit none - double precision, parameter :: zero=0.d0,one=1.d0,two=2.d0,tol_zero=1.d-30 + double precision, parameter :: zero = 0.d0,one = 1.d0,two = 2.d0,tol_zero = 1.d-30 integer np double precision alpha,beta @@ -584,7 +584,7 @@ subroutine zwgljd(z,w,np,alpha,beta) endif ! weights - do i=2,np-1 + do i = 2,np-1 w(i) = w(i)/(one-z(i)**2) enddo diff --git a/src/specfem2D/attenuation_model.f90 b/src/specfem2D/attenuation_model.f90 index e7ba549a9..f0432b437 100644 --- a/src/specfem2D/attenuation_model.f90 +++ b/src/specfem2D/attenuation_model.f90 @@ -710,7 +710,7 @@ subroutine lfit_zener(x,y,sig,ndat,poids,ia,covar,chisq,ma,Qref,point) chisq = 0. do i = 1,ndat call func_zener(x(i),afunc,ma,Qref,point) - chisq=chisq+((y(i)-dot_product(poids(1:ma),afunc(1:ma)))/sig(i))**2 + chisq = chisq+((y(i)-dot_product(poids(1:ma),afunc(1:ma)))/sig(i))**2 enddo end subroutine lfit_zener @@ -1030,17 +1030,17 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the ! store flags: app= .not. flg - constr=flfc + constr = flfc appconstr= .not. flgc ! Default values for options: call soptions(doptions) - do i =1,8 + do i = 1,8 if (options(i) == zero) then options(i)=doptions(i) else if (i == 2 .or. i == 3 .or. i == 6) then options(i)=dmax1(options(i),powerm12) options(i)=dmin1(options(i),one) - if (i == 2)options(i)=dmax1(options(i),options(8)*hundr) + if (i == 2) options(i)=dmax1(options(i),options(8)*hundr) else if (i == 7) then options(7)=dmax1(options(i),1.5d0) endif @@ -1052,76 +1052,76 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the options(11)=zero !! counter for gradient calculations options(12)=zero !! counter for constraint function calculations options(13)=zero !! counter for constraint gradient calculations - iterlimit=idint(options(4)) + iterlimit = idint(options(4)) if (constr) then h1=-one !! NLP: restricted to minimization cnteps=options(6) else - h1=dsign(one,options(1)) !! Minimize resp. maximize a function + h1 = dsign(one,options(1)) !! Minimize resp. maximize a function endif - k=0 !! Iteration counter + k = 0 !! Iteration counter wdef=one/options(7)-one !! Default space transf. coeff. ! Gamma control ---{ - ajb=one+1.d-1/n_float**2 !! Base I - ajp=20 - ajpp=ajp !! Start value for the power - ajs=1.15d0 !! Base II - knorms=0 - do i =1,10 + ajb = one+1.d-1/n_float**2 !! Base I + ajp = 20 + ajpp = ajp !! Start value for the power + ajs = 1.15d0 !! Base II + knorms = 0 + do i = 1,10 gnorms(i)=zero enddo !---} ! Display control ---{ if (options(5) <= zero) then - dispdata=0 + dispdata = 0 if (options(5) == -one) then - dispwarn=.false. + dispwarn = .false. else - dispwarn=.true. + dispwarn = .true. endif else - dispdata=idnint(options(5)) - dispwarn=.true. + dispdata = idnint(options(5)) + dispwarn = .true. endif - ld=dispdata + ld = dispdata !---} ! Stepsize control ---{ dq=5.1d0 !! Step divider (at f_{i+1} > gamma*f_{i}) - du20=two - du10=1.5d0 + du20 = two + du10 = 1.5d0 du03=1.05d0 !! Step multipliers (at certain steps made) - kstore=3 + kstore = 3 do i = 1,kstore nsteps(i)=zero !! Steps made at the last 'kstore' iterations enddo if (app) then - des=6.3d0 !! Desired number of steps per 1-D search + des = 6.3d0 !! Desired number of steps per 1-D search else - des=3.3d0 + des = 3.3d0 endif mxtc=3 !! Number of trial cycles (steep wall detect) !---} - termx=0 - limxterm=50 !! Counter and limit for x-criterion + termx = 0 + limxterm = 50 !! Counter and limit for x-criterion ! stepsize for gradient approximation - ddx=dmax1(1.d-11,options(8)) + ddx = dmax1(1.d-11,options(8)) low_bound=-one+1.d-4 !! Lower bound cosine used to detect a ravine - ZeroGrad=n_float*1.d-16 !! Lower bound for a gradient norm - nzero=0 !! Zero-gradient events counter + ZeroGrad = n_float*1.d-16 !! Lower bound for a gradient norm + nzero = 0 !! Zero-gradient events counter ! Low bound for the values of variables to take into account - lowxbound=dmax1(options(2),1.d-3) + lowxbound = dmax1(options(2),1.d-3) ! Lower bound for function values to be considered as making difference lowfbound=options(3)**2 - krerun=0 !! Re-run events counter + krerun = 0 !! Re-run events counter detfr=options(3)*hundr !! Relative error for f/f_{record} - detxr=options(2)*ten !! Relative error for norm(x)/norm(x_{record}) - warnno=0 !! the number of warn.mess. to end with - kflat=0 !! counter for points of flatness - stepvanish=0 !! counter for vanished steps - stopf=.false. + detxr = options(2)*ten !! Relative error for norm(x)/norm(x_{record}) + warnno = 0 !! the number of warn.mess. to end with + kflat = 0 !! counter for points of flatness + stepvanish = 0 !! counter for vanished steps + stopf = .false. ! ----} End of setting constants ! ----} End of the preamble !-------------------------------------------------------------------- @@ -1139,11 +1139,11 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the do i = 1,n xrec(i)=x(i) enddo - frec=f !! record point and function value + frec = f !! record point and function value ! Constrained problem if (constr) then - kless=0 - fp=f + kless = 0 + fp = f call func(x,fc,n/2,n,theta_min,theta_max) options(12)=options(12)+one if (dabs(fc) >= infty) then @@ -1154,14 +1154,14 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the options(9)=-five goto 999 endif - PenCoef=one !! first rough approximation + PenCoef = one !! first rough approximation if (fc <= cnteps) then - FsbPnt=.true. !! feasible point - fc=zero + FsbPnt = .true. !! feasible point + fc = zero else - FsbPnt=.false. + FsbPnt = .false. endif - f=f+PenCoef*fc + f = f+PenCoef*fc endif ! ----} ! COMPUTE THE GRADIENT ( FIRST TIME ) ----{ @@ -1169,7 +1169,7 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the do i = 1,n deltax(i)=h1*ddx enddo - obj=.true. + obj = .true. !if (constr) then !call apprgrdn() !else @@ -1180,9 +1180,9 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the call grad(x,g,Qref,n/2,n,Kopt,f_min,f_max) options(11)=options(11)+one endif - ng=zero + ng = zero do i = 1,n - ng=ng+g(i)*g(i) + ng = ng+g(i)*g(i) enddo ng=dsqrt(ng) if (ng >= infty) then @@ -1217,9 +1217,9 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the if (.not. appconstr) then call gradc(x,gc,n/2,n,theta_min,theta_max) endif - ngc=zero + ngc = zero do i = 1,n - ngc=ngc+gc(i)*gc(i) + ngc = ngc+gc(i)*gc(i) enddo ngc=dsqrt(ngc) if (ng >= infty) then @@ -1239,9 +1239,9 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the do i = 1,n g(i)=g(i)+PenCoef*gc(i) enddo - ng=zero + ng = zero do i = 1,n - ng=ng+g(i)*g(i) + ng = ng+g(i)*g(i) grec(i)=g(i) enddo ng=dsqrt(ng) @@ -1250,25 +1250,25 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the do i = 1,n grec(i)=g(i) enddo - nng=ng + nng = ng ! ----} ! INITIAL STEP SIZE - d=zero + d = zero do i = 1,n - if (d < dabs(x(i))) d=dabs(x(i)) + if (d < dabs(x(i))) d = dabs(x(i)) enddo - h=h1*dsqrt(options(2))*d !! smallest possible stepsize + h = h1*dsqrt(options(2))*d !! smallest possible stepsize if (dabs(options(1)) /= one) then - h=h1*dmax1(dabs(options(1)),dabs(h)) !! user-supplied stepsize + h = h1*dmax1(dabs(options(1)),dabs(h)) !! user-supplied stepsize else - h=h1*dmax1(one/dlog(ng+1.1d0),dabs(h)) !! calculated stepsize + h = h1*dmax1(one/dlog(ng+1.1d0),dabs(h)) !! calculated stepsize endif ! RESETTING LOOP ----{ do while (.true.) - kcheck=0 !! Set checkpoint counter. - kg=0 !! stepsizes stored - kj=0 !! ravine jump counter + kcheck = 0 !! Set checkpoint counter. + kg = 0 !! stepsizes stored + kj = 0 !! ravine jump counter do i = 1,n do j = 1,n B(i,j)=zero @@ -1276,38 +1276,38 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the B(i,i)=one !! re-set transf. matrix to identity g1(i)=g(i) enddo - fst=f - dx=0 + fst = f + dx = 0 ! ----} ! MAIN ITERATIONS ----{ do while (.true.) - k=k+1 - kcheck=kcheck+1 - laststep=dx + k = k+1 + kcheck = kcheck+1 + laststep = dx ! ADJUST GAMMA --{ - gamma=one+dmax1(ajb**((ajp-kcheck)*n),two*options(3)) - gamma=dmin1 ( gamma,ajs**dmax1(one,dlog10(nng+one)) ) + gamma = one+dmax1(ajb**((ajp-kcheck)*n),two*options(3)) + gamma = dmin1 ( gamma,ajs**dmax1(one,dlog10(nng+one)) ) ! --} - ngt=zero - ng1=zero - dd=zero + ngt = zero + ng1 = zero + dd = zero do i = 1,n - d=zero + d = zero do j = 1,n - d=d+B(j,i)*g(j) + d = d+B(j,i)*g(j) enddo gt(i)=d dd=dd+d*g1(i) - ngt=ngt+d*d - ng1=ng1+g1(i)*g1(i) + ngt = ngt+d*d + ng1 = ng1+g1(i)*g1(i) enddo ngt=dsqrt(ngt) ng1=dsqrt(ng1) - dd=dd/ngt/ng1 + dd = dd/ngt/ng1 - w=wdef + w = wdef ! JUMPING OVER A RAVINE ----{ if (dd < low_bound) then if (kj == 2) then @@ -1316,12 +1316,12 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the enddo endif if (kj == 0) kd=4 - kj=kj+1 + kj = kj+1 w=-.9d0 !! use large coef. of space dilation - h=h*two + h = h*two if (kj > 2*kd) then - kd=kd+1 - warnno=1 + kd = kd+1 + warnno = 1 endwarn='Premature stopping is possible. Try to re-run the routine from the obtained point.' do i = 1,n if (dabs(x(i)-xx(i)) < epsnorm*dabs(x(i))) then @@ -1333,14 +1333,14 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the enddo endif else - kj=0 + kj = 0 endif ! ----} ! DILATION ----{ - nrmz=zero + nrmz = zero do i = 1,n z(i)=gt(i)-g1(i) - nrmz=nrmz+z(i)*z(i) + nrmz = nrmz+z(i)*z(i) enddo nrmz=dsqrt(nrmz) if (nrmz > epsnorm*ngt) then @@ -1351,18 +1351,18 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the ! new inverse matrix: B = B ( I + (1/alpha -1)zz' ) d = zero do i = 1,n - d=d+z(i)*gt(i) + d = d+z(i)*gt(i) enddo - ng1=zero + ng1 = zero d = d*w do i = 1,n - dd=zero + dd = zero g1(i)=gt(i)+d*z(i) - ng1=ng1+g1(i)*g1(i) + ng1 = ng1+g1(i)*g1(i) do j = 1,n - dd=dd+B(i,j)*z(j) + dd = dd+B(i,j)*z(j) enddo - dd=w*dd + dd = w*dd do j = 1,n B(i,j)=B(i,j)+dd*z(j) enddo @@ -1373,31 +1373,31 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the z(i)=zero g1(i)=gt(i) enddo - nrmz=zero + nrmz = zero endif do i = 1,n gt(i)=g1(i)/ng1 enddo do i = 1,n - d=zero + d = zero do j = 1,n - d=d+B(i,j)*gt(j) + d = d+B(i,j)*gt(j) enddo g0(i)=d enddo ! ----} ! RESETTING ----{ if (kcheck > 1) then - numelem=0 + numelem = 0 do i = 1,n if (dabs(g(i)) > ZeroGrad) then - numelem=numelem+1 + numelem = numelem+1 idx(numelem)=i endif enddo if (numelem > 0) then grbnd=epsnorm*dble(numelem**2) - ii=0 + ii = 0 do i = 1,numelem j=idx(i) if (dabs(g1(j)) <= dabs(g(j))*grbnd) ii=ii+1 @@ -1407,12 +1407,12 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the print *,'SolvOpt warning: Normal re-setting of a transformation matrix' endif if (dabs(fst-f) < dabs(f)*1.d-2) then - ajp=ajp-10*n + ajp = ajp-10*n else - ajp=ajpp + ajp = ajpp endif - h=h1*dx/three - k=k-1 + h = h1*dx/three + k = k-1 exit endif endif @@ -1422,31 +1422,31 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the do i = 1,n xopt(i)=x(i) enddo - fopt=f - k1=0 - k2=0 - ksm=.false. - kc=0 - knan=.false. - hp=h - if (constr) Reset=.false. + fopt = f + k1 = 0 + k2 = 0 + ksm = .false. + kc = 0 + knan = .false. + hp = h + if (constr) Reset = .false. ! 1-D SEARCH ----{ do while (.true.) do i = 1,n x1(i)=x(i) enddo - f1=f + f1 = f if (constr) then - FsbPnt1=FsbPnt - fp1=fp + FsbPnt1 = FsbPnt + fp1 = fp endif ! NEW POINT do i = 1,n x(i)=x(i)+hp*g0(i) enddo - ii=0 + ii = 0 do i = 1,n - if (dabs(x(i)-x1(i)) < dabs(x(i))*epsnorm) ii=ii+1 + if (dabs(x(i)-x1(i)) < dabs(x(i))*epsnorm) ii = ii+1 enddo ! function value call fun(x,f,Qref,n/2,n,Kopt,f_min,f_max) @@ -1459,7 +1459,7 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the goto 999 endif if (constr) then - fp=f + fp = f call func(x,fc,n/2,n,theta_min,theta_max) options(12)=options(12)+one if (dabs(fc) >= infty) then @@ -1471,30 +1471,30 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the goto 999 endif if (fc <= cnteps) then - FsbPnt=.true. - fc=zero + FsbPnt = .true. + fc = zero else - FsbPnt=.false. - fp_rate=fp-fp1 + FsbPnt = .false. + fp_rate = fp-fp1 if (fp_rate < -epsnorm) then if (.not. FsbPnt1) then - d=zero + d = zero do i = 1,n - d=d+(x(i)-x1(i))**2 + d = d+(x(i)-x1(i))**2 enddo d=dsqrt(d) PenCoefNew=-1.5d1*fp_rate/d if (PenCoefNew > 1.2d0*PenCoef) then - PenCoef=PenCoefNew - Reset=.true. - kless=0 - f=f+PenCoef*fc + PenCoef = PenCoefNew + Reset = .true. + kless = 0 + f = f+PenCoef*fc exit endif endif endif endif - f=f+PenCoef*fc + f = f+PenCoef*fc endif if (dabs(f) >= infty) then if (dispwarn) then @@ -1504,22 +1504,22 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the options(9)=-three goto 999 else - k2=k2+1 - k1=0 - hp=hp/dq + k2 = k2+1 + k1 = 0 + hp = hp/dq do i = 1,n x(i)=x1(i) enddo - f=f1 - knan=.true. + f = f1 + knan = .true. if (constr) then - FsbPnt=FsbPnt1 - fp=fp1 + FsbPnt = FsbPnt1 + fp = fp1 endif endif ! STEP SIZE IS ZERO TO THE EXTENT OF EPSNORM else if (ii == n) then - stepvanish=stepvanish+1 + stepvanish = stepvanish+1 if (stepvanish >= 5) then options(9)=-ten-four if (dispwarn) then @@ -1531,72 +1531,72 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the do i = 1,n x(i)=x1(i) enddo - f=f1 - hp=hp*ten - ksm=.true. + f = f1 + hp = hp*ten + ksm = .true. if (constr) then - FsbPnt=FsbPnt1 - fp=fp1 + FsbPnt = FsbPnt1 + fp = fp1 endif endif ! USE SMALLER STEP else if (h1*f < h1*gamma**idint(dsign(one,f1))*f1) then if (ksm) exit - k2=k2+1 - k1=0 - hp=hp/dq + k2 = k2+1 + k1 = 0 + hp = hp/dq do i = 1,n x(i)=x1(i) enddo - f=f1 + f = f1 if (constr) then - FsbPnt=FsbPnt1 - fp=fp1 + FsbPnt = FsbPnt1 + fp = fp1 endif if (kc >= mxtc) exit ! 1-D OPTIMIZER IS LEFT BEHIND else if (h1*f <= h1*f1) exit ! USE LARGER STEP - k1=k1+1 + k1 = k1+1 if (k2 > 0) kc=kc+1 - k2=0 + k2 = 0 if (k1 >= 20) then - hp=du20*hp + hp = du20*hp else if (k1 >= 10) then - hp=du10*hp + hp = du10*hp else if (k1 >= 3) then - hp=du03*hp + hp = du03*hp endif endif enddo ! ----} End of 1-D search ! ADJUST THE TRIAL STEP SIZE ----{ - dx=zero + dx = zero do i = 1,n - dx=dx+(xopt(i)-x(i))**2 + dx = dx+(xopt(i)-x(i))**2 enddo dx=dsqrt(dx) if (kg < kstore) kg=kg+1 if (kg >= 2) then - do i =kg,2,-1 + do i = kg,2,-1 nsteps(i)=nsteps(i-1) enddo endif - d=zero + d = zero do i = 1,n - d=d+g0(i)*g0(i) + d = d+g0(i)*g0(i) enddo d=dsqrt(d) nsteps(1)=dx/(dabs(h)*d) - kk=zero - d=zero + kk = zero + d = zero do i = 1,kg dd=dble(kg-i+1) - d=d+dd + d = d+dd kk=kk+nsteps(i)*dd enddo - kk=kk/d + kk = kk/d if (kk > des) then if (kg == 1) then h=h*(kk-des+one) @@ -1618,7 +1618,7 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the deltax(j)=-h1*ddx endif enddo - obj=.true. + obj = .true. !if (constr) then !call apprgrdn() !else @@ -1629,9 +1629,9 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the call grad(x,g,Qref,n/2,n,Kopt,f_min,f_max) options(11)=options(11)+one endif - ng=zero + ng = zero do i = 1,n - ng=ng+g(i)*g(i) + ng = ng+g(i)*g(i) enddo ng=dsqrt(ng) if (ng >= infty) then @@ -1646,20 +1646,20 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the print *,'SolvOpt warning:' print *,'Gradient is zero, but stopping criteria are not fulfilled.' endif - ng=ZeroGrad + ng = ZeroGrad endif ! Constraints: if (constr) then if (.not. FsbPnt) then if (ng < 1.d-2*PenCoef) then - kless=kless+1 + kless = kless+1 if (kless >= 20) then - PenCoef=PenCoef/ten - Reset=.true. - kless=0 + PenCoef = PenCoef/ten + Reset = .true. + kless = 0 endif else - kless=0 + kless = 0 endif !if (appconstr) then !do j = 1,n @@ -1676,9 +1676,9 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the call gradc(x,gc,n/2,n,theta_min,theta_max) options(13)=options(13)+one endif - ngc=zero + ngc = zero do i = 1,n - ngc=ngc+gc(i)*gc(i) + ngc = ngc+gc(i)*gc(i) enddo ngc=dsqrt(ngc) if (ngc >= infty) then @@ -1697,9 +1697,9 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the do i = 1,n g(i)=g(i)+PenCoef*gc(i) enddo - ng=zero + ng = zero do i = 1,n - ng=ng+g(i)*g(i) + ng = ng+g(i)*g(i) enddo ng=dsqrt(ng) if (Reset) then @@ -1707,15 +1707,15 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the print *,'SolvOpt warning:' print *,'Re-setting due to the use of a new penalty coefficient.' endif - h=h1*dx/three - k=k-1 - nng=ng + h = h1*dx/three + k = k-1 + nng = ng exit endif endif endif if (h1*f > h1*frec) then - frec=f + frec = f do i = 1,n xrec(i)=x(i) grec(i)=g(i) @@ -1725,21 +1725,21 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the if (ng > ZeroGrad) then if (knorms < 10) knorms=knorms+1 if (knorms >= 2) then - do i =knorms,2,-1 + do i = knorms,2,-1 gnorms(i)=gnorms(i-1) enddo endif gnorms(1)=ng - nng=one + nng = one do i = 1,knorms nng=nng*gnorms(i) enddo - nng=nng**(one/dble(knorms)) + nng = nng**(one/dble(knorms)) endif ! Norm X: - nx=zero + nx = zero do i = 1,n - nx=nx+x(i)*x(i) + nx = nx+x(i)*x(i) enddo nx=dsqrt(nx) @@ -1749,47 +1749,47 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the 'Iteration # ..... function value ..... ', & 'Step Value ..... Gradient Norm' print '(5x,i5,7x,g13.5,6x,g13.5,7x,g13.5)', k,f,dx,ng - ld=k+dispdata + ld = k+dispdata endif !----} ! CHECK THE STOPPING CRITERIA ----{ - termflag=.true. + termflag = .true. if (constr) then - if (.not. FsbPnt) termflag=.false. + if (.not. FsbPnt) termflag = .false. endif - if (kcheck <= 5 .or. kcheck <= 12 .and. ng > one)termflag=.false. - if (kc >= mxtc .or. knan)termflag=.false. + if (kcheck <= 5 .or. kcheck <= 12 .and. ng > one)termflag = .false. + if (kc >= mxtc .or. knan)termflag = .false. ! ARGUMENT if (termflag) then - ii=0 - stopping=.true. + ii = 0 + stopping = .true. do i = 1,n if (dabs(x(i)) >= lowxbound) then - ii=ii+1 + ii = ii+1 idx(ii)=i if (dabs(xopt(i)-x(i)) > options(2)*dabs(x(i))) then - stopping=.false. + stopping = .false. endif endif enddo if (ii == 0 .or. stopping) then - stopping=.true. - termx=termx+1 - d=zero + stopping = .true. + termx = termx+1 + d = zero do i = 1,n - d=d+(x(i)-xrec(i))**2 + d = d+(x(i)-xrec(i))**2 enddo d=dsqrt(d) ! function if (dabs(f-frec) > detfr*dabs(f) .and. & dabs(f-fopt) <= options(3)*dabs(f) .and. & krerun <= 3 .and. .not. constr) then - stopping=.false. + stopping = .false. if (ii > 0) then do i = 1,ii j=idx(i) if (dabs(xrec(j)-x(j)) > detxr*dabs(x(j))) then - stopping=.true. + stopping = .true. exit endif enddo @@ -1799,21 +1799,21 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the print *,'SolvOpt warning:' print *,'Re-run from recorded point.' endif - ng=zero + ng = zero do i = 1,n x(i)=xrec(i) g(i)=grec(i) - ng=ng+g(i)*g(i) + ng = ng+g(i)*g(i) enddo ng=dsqrt(ng) - f=frec - krerun=krerun+1 - h=h1*dmax1(dx,detxr*nx)/dble(krerun) - warnno=2 + f = frec + krerun = krerun+1 + h = h1*dmax1(dx,detxr*nx)/dble(krerun) + warnno = 2 endwarn='Result may not provide the optimum. The function apparently has many extremum points.' exit else - h=h*ten + h = h*ten endif else if (dabs(f-frec) > options(3)*dabs(f) .and. & d < options(2)*nx .and. constr) then @@ -1825,12 +1825,12 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the if (stopf) then if (dx <= laststep) then if (warnno == 1 .and. ng < dsqrt(options(3))) then - warnno=0 + warnno = 0 endif if (.not. app) then do i = 1,n if (dabs(g(i)) <= epsnorm2) then - warnno=3 + warnno = 3 endwarn='Result may be inaccurate in the coordinates. The function is flat at the solution.' exit endif @@ -1850,7 +1850,7 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the goto 999 endif else - stopf=.true. + stopf = .true. endif else if (dx < powerm12*dmax1(nx,one) .and. & termx >= limxterm) then @@ -1859,7 +1859,7 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the print *,'SolvOpt: Termination warning:' print *,'Stopping criteria are not fulfilled. The function is very steep at the solution.' if (app) print *,'The above warning may be reasoned by inaccurate gradient approximation' - f=frec + f = frec do i = 1,n x(i)=xrec(i) enddo @@ -1890,7 +1890,7 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the endif else if (ng <= ZeroGrad) then - nzero=nzero+1 + nzero = nzero+1 if (dispwarn) then print *,'SolvOpt warning:' print *,'Gradient is zero, but stopping criteria are not fulfilled.' @@ -1902,7 +1902,7 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the do i = 1,n g0(i)=-h*g0(i)/two enddo - do i =1,10 + do i = 1,10 do j = 1,n x(j)=x(j)+g0(j) enddo @@ -1930,9 +1930,9 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the call grad(x,g,Qref,n/2,n,Kopt,f_min,f_max) options(11)=options(11)+one endif - ng=zero + ng = zero do j = 1,n - ng=ng+g(j)*g(j) + ng = ng+g(j)*g(j) enddo ng=dsqrt(ng) if (ng >= infty) then @@ -1953,7 +1953,7 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the options(9)=-eight goto 999 endif - h=h1*dx + h = h1*dx exit endif endif @@ -1962,28 +1962,28 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the if (.not. constr .and. & dabs(f-fopt) < dabs(fopt)*options(3) .and. kcheck > 5 .and. ng < one) then - ni=0 + ni = 0 do i = 1,n if (dabs(g(i)) <= epsnorm2) then - ni=ni+1 + ni = ni+1 idx(ni)=i endif enddo if (ni >= 1 .and. ni <= n/2 .and. kflat <= 3) then - kflat=kflat+1 + kflat = kflat+1 if (dispwarn) then print *,'SolvOpt warning:' print *,'The function is flat in certain directions.' endif - warnno=1 + warnno = 1 endwarn='Premature stopping is possible. Try to re-run the routine from the obtained point.' do i = 1,n x1(i)=x(i) enddo - fm=f + fm = f do i = 1,ni j=idx(i) - f2=fm + f2 = fm y=x(j) if (y == zero) then x1(j)=one @@ -1992,20 +1992,20 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the else x1(j)=y endif - do ip=1,20 + do ip = 1,20 x1(j)=x1(j)/1.15d0 call fun(x1,f1,Qref,n/2,n,Kopt,f_min,f_max) options(10)=options(10)+one if (dabs(f1) < infty) then if (h1*f1 > h1*fm) then y=x1(j) - fm=f1 + fm = f1 else if (h1*f2 > h1*f1) then exit else if (f2 == f1) then x1(j)=x1(j)/1.5d0 endif - f2=f1 + f2 = f1 endif enddo x1(j)=y @@ -2022,9 +2022,9 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the call grad(x1,gt,Qref,n/2,n,Kopt,f_min,f_max) options(11)=options(11)+one endif - ngt=zero + ngt = zero do i = 1,n - ngt=ngt+gt(i)*gt(i) + ngt = ngt+gt(i)*gt(i) enddo if (ngt > epsnorm2 .and. ngt < infty) then if (dispwarn) print *,'Trying to recover by shifting insensitive variables.' @@ -2032,9 +2032,9 @@ subroutine solvopt(n,x,f,fun,flg,grad,options,flfc,func,flgc,gradc,Qref,Kopt,the x(i)=x1(i) g(i)=gt(i) enddo - ng=ngt - f=fm - h=h1*dx/three + ng = ngt + f = fm + h = h1*dx/three options(3)=options(3)/five exit endif !! regular gradient diff --git a/src/specfem2D/calendar.f90 b/src/specfem2D/calendar.f90 index fcc237c4d..7fc4877c3 100644 --- a/src/specfem2D/calendar.f90 +++ b/src/specfem2D/calendar.f90 @@ -56,11 +56,11 @@ integer function lpyr(yr) ! !---- returns 1 if leap year ! - lpyr=0 + lpyr = 0 if (mod(yr,400) == 0) then - lpyr=1 + lpyr = 1 else if (mod(yr,4) == 0) then - lpyr=1 + lpyr = 1 if (mod(yr,100) == 0) lpyr=0 endif @@ -496,7 +496,7 @@ subroutine calndr(iday,month,iyear,idayct) ! ! Look for out-of-range option values. if ((ioptn == 0) .or. (abs(ioptn) >= 6)) then - write(*,*)'For calndr(), you specified ioptn = ', ioptn + write(*,*) 'For calndr(), you specified ioptn = ', ioptn write(*,*) 'Allowable values are 1 to 5 for the Gregorian calendar' write(*,*) 'and -1 to -5 for the Julian calendar.' call stop_the_code('error: stopping the code') diff --git a/src/specfem2D/check_grid.F90 b/src/specfem2D/check_grid.F90 index f6101cbdf..927f88ef8 100644 --- a/src/specfem2D/check_grid.F90 +++ b/src/specfem2D/check_grid.F90 @@ -1043,7 +1043,7 @@ subroutine check_grid_create_postscript(courant_stability_number_max,lambdaPImin ! draw straight lines if elements have 4 nodes - ir=pointsdisp + ir = pointsdisp x2 = (xinterp(ir,is)-xmin)*ratio_page + ORIG_X z2 = (zinterp(ir,is)-zmin)*ratio_page + ORIG_Z x2 = x2 * CENTIM @@ -1055,8 +1055,8 @@ subroutine check_grid_create_postscript(courant_stability_number_max,lambdaPImin coorg_send(2,(ispec-1)*5+2) = z2 endif - ir=pointsdisp - is=pointsdisp + ir = pointsdisp + is = pointsdisp x2 = (xinterp(ir,is)-xmin)*ratio_page + ORIG_X z2 = (zinterp(ir,is)-zmin)*ratio_page + ORIG_Z x2 = x2 * CENTIM @@ -1068,8 +1068,8 @@ subroutine check_grid_create_postscript(courant_stability_number_max,lambdaPImin coorg_send(2,(ispec-1)*5+3) = z2 endif - is=pointsdisp - ir=1 + is = pointsdisp + ir = 1 x2 = (xinterp(ir,is)-xmin)*ratio_page + ORIG_X z2 = (zinterp(ir,is)-zmin)*ratio_page + ORIG_Z x2 = x2 * CENTIM @@ -1081,8 +1081,8 @@ subroutine check_grid_create_postscript(courant_stability_number_max,lambdaPImin coorg_send(2,(ispec-1)*5+4) = z2 endif - ir=1 - is=2 + ir = 1 + is = 2 x2 = (xinterp(ir,is)-xmin)*ratio_page + ORIG_X z2 = (zinterp(ir,is)-zmin)*ratio_page + ORIG_Z x2 = x2 * CENTIM @@ -1356,7 +1356,7 @@ subroutine check_grid_create_postscript(courant_stability_number_max,lambdaPImin ! draw straight lines if elements have 4 nodes - ir=pointsdisp + ir = pointsdisp x2 = (xinterp(ir,is)-xmin)*ratio_page + ORIG_X z2 = (zinterp(ir,is)-zmin)*ratio_page + ORIG_Z x2 = x2 * CENTIM @@ -1368,8 +1368,8 @@ subroutine check_grid_create_postscript(courant_stability_number_max,lambdaPImin coorg_send(2,(ispec-1)*5+2) = z2 endif - ir=pointsdisp - is=pointsdisp + ir = pointsdisp + is = pointsdisp x2 = (xinterp(ir,is)-xmin)*ratio_page + ORIG_X z2 = (zinterp(ir,is)-zmin)*ratio_page + ORIG_Z x2 = x2 * CENTIM @@ -1381,8 +1381,8 @@ subroutine check_grid_create_postscript(courant_stability_number_max,lambdaPImin coorg_send(2,(ispec-1)*5+3) = z2 endif - is=pointsdisp - ir=1 + is = pointsdisp + ir = 1 x2 = (xinterp(ir,is)-xmin)*ratio_page + ORIG_X z2 = (zinterp(ir,is)-zmin)*ratio_page + ORIG_Z x2 = x2 * CENTIM @@ -1394,8 +1394,8 @@ subroutine check_grid_create_postscript(courant_stability_number_max,lambdaPImin coorg_send(2,(ispec-1)*5+4) = z2 endif - ir=1 - is=2 + ir = 1 + is = 2 x2 = (xinterp(ir,is)-xmin)*ratio_page + ORIG_X z2 = (zinterp(ir,is)-zmin)*ratio_page + ORIG_Z x2 = x2 * CENTIM @@ -1714,7 +1714,7 @@ subroutine check_grid_create_postscript(courant_stability_number_max,lambdaPImin ! draw straight lines if elements have 4 nodes - ir=pointsdisp + ir = pointsdisp x2 = (xinterp(ir,is)-xmin)*ratio_page + ORIG_X z2 = (zinterp(ir,is)-zmin)*ratio_page + ORIG_Z x2 = x2 * CENTIM @@ -1726,8 +1726,8 @@ subroutine check_grid_create_postscript(courant_stability_number_max,lambdaPImin coorg_send(2,(ispec-1)*5+2) = z2 endif - ir=pointsdisp - is=pointsdisp + ir = pointsdisp + is = pointsdisp x2 = (xinterp(ir,is)-xmin)*ratio_page + ORIG_X z2 = (zinterp(ir,is)-zmin)*ratio_page + ORIG_Z x2 = x2 * CENTIM @@ -1739,8 +1739,8 @@ subroutine check_grid_create_postscript(courant_stability_number_max,lambdaPImin coorg_send(2,(ispec-1)*5+3) = z2 endif - is=pointsdisp - ir=1 + is = pointsdisp + ir = 1 x2 = (xinterp(ir,is)-xmin)*ratio_page + ORIG_X z2 = (zinterp(ir,is)-zmin)*ratio_page + ORIG_Z x2 = x2 * CENTIM @@ -1752,8 +1752,8 @@ subroutine check_grid_create_postscript(courant_stability_number_max,lambdaPImin coorg_send(2,(ispec-1)*5+4) = z2 endif - ir=1 - is=2 + ir = 1 + is = 2 x2 = (xinterp(ir,is)-xmin)*ratio_page + ORIG_X z2 = (zinterp(ir,is)-zmin)*ratio_page + ORIG_Z x2 = x2 * CENTIM @@ -1983,7 +1983,7 @@ subroutine check_grid_create_postscript(courant_stability_number_max,lambdaPImin ! draw straight lines if elements have 4 nodes - ir=pointsdisp + ir = pointsdisp x2 = (xinterp(ir,is)-xmin)*ratio_page + ORIG_X z2 = (zinterp(ir,is)-zmin)*ratio_page + ORIG_Z x2 = x2 * CENTIM @@ -1995,8 +1995,8 @@ subroutine check_grid_create_postscript(courant_stability_number_max,lambdaPImin coorg_send(2,(ispec-1)*5+2) = z2 endif - ir=pointsdisp - is=pointsdisp + ir = pointsdisp + is = pointsdisp x2 = (xinterp(ir,is)-xmin)*ratio_page + ORIG_X z2 = (zinterp(ir,is)-zmin)*ratio_page + ORIG_Z x2 = x2 * CENTIM @@ -2008,8 +2008,8 @@ subroutine check_grid_create_postscript(courant_stability_number_max,lambdaPImin coorg_send(2,(ispec-1)*5+3) = z2 endif - is=pointsdisp - ir=1 + is = pointsdisp + ir = 1 x2 = (xinterp(ir,is)-xmin)*ratio_page + ORIG_X z2 = (zinterp(ir,is)-zmin)*ratio_page + ORIG_Z x2 = x2 * CENTIM @@ -2021,8 +2021,8 @@ subroutine check_grid_create_postscript(courant_stability_number_max,lambdaPImin coorg_send(2,(ispec-1)*5+4) = z2 endif - ir=1 - is=2 + ir = 1 + is = 2 x2 = (xinterp(ir,is)-xmin)*ratio_page + ORIG_X z2 = (zinterp(ir,is)-zmin)*ratio_page + ORIG_Z x2 = x2 * CENTIM diff --git a/src/specfem2D/compute_arrays_source.f90 b/src/specfem2D/compute_arrays_source.f90 index fff1e7753..2a8f171b8 100644 --- a/src/specfem2D/compute_arrays_source.f90 +++ b/src/specfem2D/compute_arrays_source.f90 @@ -535,7 +535,7 @@ subroutine rekurs(x,y,ndat,a,b1,b2,npoles,iflag) do i = 2, npoles z(i) = a(i)*(z(i-1)-z2(i-1))-b1(i)*z1(i)-b2(i)*z2(i) enddo - x2=x1 + x2 = x1 x1=x(n) do i = 1, npoles z2(i) =z1(i) @@ -560,10 +560,10 @@ subroutine rekurs(x,y,ndat,a,b1,b2,npoles,iflag) do n = ndat, 1, -1 z(1) = a(1)*(y(n)-x2)-b1(1)*z1(1)-b2(1)*z2(1) - do i =2, npoles + do i = 2, npoles z(i) = a(i)*(z(i-1)-z2(i-1))-b1(i)*z1(i)-b2(i)*z2(i) enddo - x2=x1 + x2 = x1 x1=y(n) do i = 1,npoles z2(i)=z1(i) @@ -598,23 +598,23 @@ subroutine bpcoeff(f1,f2,npoles,dt,a,b1,b2) w2=d2*tan(2.d0*pi*f2/d2) w0=0.5*(w2-w1) - i=1 - npol2=npoles/2+1 - do n =1,npoles + i = 1 + npol2 = npoles/2+1 + do n = 1,npoles p = cexp(cmplx(0.d0,dble(2*n-1+npoles)*pi/dble(2*npoles))) t1 = p*cmplx(w0,0.d0) t2 = sqrt(t1*t1-cmplx(w1*w2,0.d0)) s(i)=t1+t2 s(i+1)=t1-t2 - i=i+2 + i = i+2 enddo - do n=1,npoles - ssum=2*real(s(n)) - sprod=dble(s(n)*conjg(s(n))) - fact1=d2*d2-d2*ssum+sprod + do n = 1,npoles + ssum = 2*real(s(n)) + sprod = dble(s(n)*conjg(s(n))) + fact1 = d2*d2-d2*ssum+sprod fact2=2.d0*(sprod-d2*d2) - fact3=d2*d2+d2*ssum+sprod + fact3 = d2*d2+d2*ssum+sprod a(n)=2.d0*d2*w0/fact1 b1(n)=fact2/fact1 b2(n)=fact3/fact1 diff --git a/src/specfem2D/compute_coupling_poro_viscoelastic.f90 b/src/specfem2D/compute_coupling_poro_viscoelastic.f90 index 05a08c857..dfb0650fc 100644 --- a/src/specfem2D/compute_coupling_poro_viscoelastic.f90 +++ b/src/specfem2D/compute_coupling_poro_viscoelastic.f90 @@ -463,9 +463,9 @@ subroutine compute_coupling_poro_viscoelastic_for_stabilization(veloc_elastic,ac ! recovering original velocities and accelerations on boundaries (elastic side) ! if (i_stage==1 .or. i_stage==2 .or. i_stage==3) then -! if (i_stage == 1)weight_rk = 0.5d0 -! if (i_stage == 2)weight_rk = 0.5d0 -! if (i_stage == 3)weight_rk = 1.0d0 +! if (i_stage == 1) weight_rk = 0.5d0 +! if (i_stage == 2) weight_rk = 0.5d0 +! if (i_stage == 3) weight_rk = 1.0d0 ! veloc_elastic(1,iglob) = veloc_elastic_initial_rk(1,iglob) - weight_rk * accel_elastic_rk(1,iglob,i_stage) ! veloc_elastic(2,iglob) = veloc_elastic_initial_rk(2,iglob) - weight_rk * accel_elastic_rk(2,iglob,i_stage) @@ -505,9 +505,9 @@ subroutine compute_coupling_poro_viscoelastic_for_stabilization(veloc_elastic,ac ! recovering original velocities and accelerations on boundaries (poro side) ! if (i_stage==1 .or. i_stage==2 .or. i_stage==3) then -! if (i_stage == 1)weight_rk = 0.5d0 -! if (i_stage == 2)weight_rk = 0.5d0 -! if (i_stage == 3)weight_rk = 1.0d0 +! if (i_stage == 1) weight_rk = 0.5d0 +! if (i_stage == 2) weight_rk = 0.5d0 +! if (i_stage == 3) weight_rk = 1.0d0 ! velocs_poroelastic(1,iglob) = velocs_poroelastic_initial_rk(1,iglob) - weight_rk * accels_poroelastic_rk(1,iglob,i_stage) ! velocs_poroelastic(2,iglob) = velocs_poroelastic_initial_rk(2,iglob) - weight_rk * accels_poroelastic_rk(2,iglob,i_stage) @@ -560,9 +560,9 @@ subroutine compute_coupling_poro_viscoelastic_for_stabilization(veloc_elastic,ac ! if (i_stage==1 .or. i_stage==2 .or. i_stage==3) then - ! if (i_stage == 1)weight_rk = 0.5d0 - ! if (i_stage == 2)weight_rk = 0.5d0 - ! if (i_stage == 3)weight_rk = 1.0d0 + ! if (i_stage == 1) weight_rk = 0.5d0 + ! if (i_stage == 2) weight_rk = 0.5d0 + ! if (i_stage == 3) weight_rk = 1.0d0 ! veloc_elastic(1,iglob) = veloc_elastic_initial_rk(1,iglob) + weight_rk * accel_elastic_rk(1,iglob,i_stage) ! veloc_elastic(2,iglob) = veloc_elastic_initial_rk(2,iglob) + weight_rk * accel_elastic_rk(2,iglob,i_stage) @@ -599,9 +599,9 @@ subroutine compute_coupling_poro_viscoelastic_for_stabilization(veloc_elastic,ac ! if (i_stage==1 .or. i_stage==2 .or. i_stage==3) then - ! if (i_stage == 1)weight_rk = 0.5d0 - ! if (i_stage == 2)weight_rk = 0.5d0 - ! if (i_stage == 3)weight_rk = 1.0d0 + ! if (i_stage == 1) weight_rk = 0.5d0 + ! if (i_stage == 2) weight_rk = 0.5d0 + ! if (i_stage == 3) weight_rk = 1.0d0 ! velocs_poroelastic(1,iglob) = velocs_poroelastic_initial_rk(1,iglob) + weight_rk * accels_poroelastic_rk(1,iglob,i_stage) ! velocs_poroelastic(2,iglob) = velocs_poroelastic_initial_rk(2,iglob) + weight_rk * accels_poroelastic_rk(2,iglob,i_stage) diff --git a/src/specfem2D/compute_energy.f90 b/src/specfem2D/compute_energy.f90 index e84a79e25..79ff59977 100644 --- a/src/specfem2D/compute_energy.f90 +++ b/src/specfem2D/compute_energy.f90 @@ -663,8 +663,8 @@ subroutine compute_energy_fields() endif ! We save the value at the GLL point: - i=2 - j=2 + i = 2 + j = 2 ! loop over spectral elements do ispec = 1,nspec diff --git a/src/specfem2D/convert_time.f90 b/src/specfem2D/convert_time.f90 index 5ec2e3015..df4d663b1 100644 --- a/src/specfem2D/convert_time.f90 +++ b/src/specfem2D/convert_time.f90 @@ -168,47 +168,47 @@ subroutine invtime(timestamp,yr,mon,day,hr,minvalue) ! iyr then gives the year that the time (in minutes) occurs if (timestamp >= year(MAX_YEAR)) call stop_the_code('year too high in invtime') - iyr=1979 - itime=timestamp + iyr = 1979 + itime = timestamp - 10 iyr=iyr+1 + 10 iyr = iyr+1 ttime=itime-year(iyr) if (ttime <= 0) then if (iyr == 1980) iyr=iyr+1 - iyr=iyr-1 + iyr = iyr-1 itime=itime-year(iyr) else goto 10 endif ! assign the return variable - yr=iyr + yr = iyr ! OK, the remaining time is less than one full year, so convert ! by the same method as above into months - imon=0 + imon = 0 ! if not leap year if (.not. is_leap_year(iyr)) then ! increment the month, and subtract off the minutes from the ! remaining time for a non-leap year - 20 imon=imon+1 + 20 imon = imon+1 tmon=itime-month(imon) if (tmon > 0) then goto 20 else if (tmon < 0) then - imon=imon-1 + imon = imon-1 itime=itime-month(imon) else if (imon > 12) then - imon=imon-12 - yr=yr+1 + imon = imon-12 + yr = yr+1 endif - mon=imon - day=1 - hr=0 - minvalue=0 + mon = imon + day = 1 + hr = 0 + minvalue = 0 return endif @@ -216,60 +216,60 @@ subroutine invtime(timestamp,yr,mon,day,hr,minvalue) else ! same thing, same code, but for a leap year - 30 imon=imon+1 + 30 imon = imon+1 tmon=itime-leap_mon(imon) if (tmon > 0) then goto 30 else if (tmon < 0) then - imon=imon-1 + imon = imon-1 itime=itime-month(imon) else if (imon > 12) then - imon=imon-12 - yr=yr+1 + imon = imon-12 + yr = yr+1 endif - mon=imon - day=1 - hr=0 - minvalue=0 + mon = imon + day = 1 + hr = 0 + minvalue = 0 return endif endif ! assign the return variable - mon=imon + mon = imon ! any remaining minutes will belong to day/hour/minutes ! OK, let us get the days - iday=0 - 40 iday=iday+1 - ttime=itime-min_day + iday = 0 + 40 iday = iday+1 + ttime = itime-min_day if (ttime >= 0) then - itime=ttime + itime = ttime goto 40 endif ! assign the return variable if (is_leap_year(iyr) .and. mon > 2) then - day=iday-1 + day = iday-1 else - day=iday + day = iday endif ! pick off the hours of the days...remember, hours can be 0, so we start at -1 ihour=-1 - 50 ihour=ihour+1 - thour=itime-min_hr + 50 ihour = ihour+1 + thour = itime-min_hr if (thour >= 0) then - itime=thour + itime = thour goto 50 endif ! assign the return variables - hr=ihour + hr = ihour ! the remainder at this point is the minutes, so return them directly - minvalue=itime + minvalue = itime end subroutine invtime diff --git a/src/specfem2D/createnum_fast.f90 b/src/specfem2D/createnum_fast.f90 index 1ed47de51..b57e0167e 100644 --- a/src/specfem2D/createnum_fast.f90 +++ b/src/specfem2D/createnum_fast.f90 @@ -238,36 +238,36 @@ subroutine rank(A,IND,N) enddo if (n == 1) return - L=n/2+1 - ir=n + L = n/2+1 + ir = n 100 continue if (l > 1) then - l=l-1 + l = l-1 indx=ind(l) q=a(indx) ELSE indx=ind(ir) q=a(indx) ind(ir)=ind(1) - ir=ir-1 + ir = ir-1 if (ir == 1) then ind(1)=indx return endif endif - i=l - j=l+l + i = l + j = l+l 200 continue if (J <= IR) then if (J < IR) then - if (A(IND(j)) < A(IND(j+1))) j=j+1 + if (A(IND(j)) < A(IND(j+1))) j = j+1 endif if (q < A(IND(j))) then IND(I)=IND(J) - I=J - J=J+J + I = J + J = J+J ELSE - J=IR+1 + J = IR+1 endif goto 200 endif diff --git a/src/specfem2D/createnum_slow.f90 b/src/specfem2D/createnum_slow.f90 index ea700bb8c..1bee96af1 100644 --- a/src/specfem2D/createnum_slow.f90 +++ b/src/specfem2D/createnum_slow.f90 @@ -124,7 +124,7 @@ subroutine createnum_slow() do num2 = 1,numelem-1 ! ne rechercher que sur les 4 premiers points de controle et non sur ngnod - do ngnodother=1,4 + do ngnodother = 1,4 ! voir si ce coin a deja ete genere if (knods(ngnodother,num2) == knods(ngnodloc,numelem)) then diff --git a/src/specfem2D/enforce_fields.f90 b/src/specfem2D/enforce_fields.f90 index 0374840b2..468451de3 100644 --- a/src/specfem2D/enforce_fields.f90 +++ b/src/specfem2D/enforce_fields.f90 @@ -256,7 +256,7 @@ subroutine enforce_fields_Lamb(iglob,it) ! safety check if (.not. USE_ENFORCE_FIELDS) return - f0 = 0.125d6 ! frequency ! (fd=200,f=50KHz) (fd=500,f=125KHz) (fd=800,f=200KHz) + f0 = 0.125d6 ! frequency ! (fd = 200,f = 50KHz) (fd = 500,f = 125KHz) (fd = 800,f = 200KHz) d = 4.0d-3 ! half width of the plate cp = 5960.0d0 ! Compressional waves velocity cs = 3260.d0 ! Shear waves velocity @@ -405,7 +405,7 @@ subroutine weighted_sum_Lamb_disp(sum_ux,sum_uz,z,f0,d,cp,cs,antisym,Nc,Nweight) ux=(0.0,0.0) uz=(0.0,0.0) - omegaj=TWO*PI*f0 + omegaj = TWO*PI*f0 !DSP = weight = 0 at fmin and fmax ! this frequency range corresponds to the principal lobe of the DSP @@ -420,17 +420,17 @@ subroutine weighted_sum_Lamb_disp(sum_ux,sum_uz,z,f0,d,cp,cs,antisym,Nc,Nweight) sum_uz = (0.0,0.0) sum_Weight = 0 - do iweight=indexFdIn-Nweight,indexFdIn+Nweight + do iweight = indexFdIn-Nweight,indexFdIn+Nweight !fdin=fdmin+(iweight-1)*stepfd !freq=fdin/d cphase = cphaseVec(iweight) freq=fdVec(iweight)/d - omegaj=TWO*PI*freq + omegaj = TWO*PI*freq call Calculate_Weigth_Burst(Weigth_Burst,fc,freq,Nc) call calculateUxUz(ux,uz,z,cp,cs,d,omegaj,cphase,antisym) - sum_ux=sum_ux+Weigth_Burst*ux - sum_uz=sum_uz+Weigth_Burst*uz - sum_Weight=sum_Weight+Weigth_Burst + sum_ux = sum_ux+Weigth_Burst*ux + sum_uz = sum_uz+Weigth_Burst*uz + sum_Weight = sum_Weight+Weigth_Burst ! print * ! print *,'***************************************************' @@ -442,8 +442,8 @@ subroutine weighted_sum_Lamb_disp(sum_ux,sum_uz,z,f0,d,cp,cs,antisym,Nc,Nweight) ! print *,'***************************************************' ! print * enddo - sum_ux=sum_ux/sum_Weight; ! division by the sum of weights - sum_uz=sum_uz/sum_Weight; ! of course ! it is a weighted Sum ! + sum_ux = sum_ux/sum_Weight; ! division by the sum of weights + sum_uz = sum_uz/sum_Weight; ! of course ! it is a weighted Sum ! !! but in fact, it does no matter because it must be OK up to a constant end subroutine weighted_sum_Lamb_disp @@ -569,7 +569,7 @@ subroutine readCphaseAndFdInFile(antisym,order,fdin) do while(error == 0) ! determine the number of line in the file read(7,*,iostat=error) - number_of_lines_in_file=number_of_lines_in_file+1 + number_of_lines_in_file = number_of_lines_in_file+1 enddo rewind 7 ! to restart at the begining of the file @@ -654,20 +654,20 @@ subroutine Calculate_Weigth_Burst(Weigth_Burst,f0,freq,Nc) real(kind=CUSTOM_REAL) :: cste,den,M,f04,f,fbw1,fbw2 ! SMALLVAL not TINYVAL because it does not work if val in too tiny ! - fbw1=f0-f0/Nc - fbw2=f0+f0/Nc + fbw1 = f0-f0/Nc + fbw2 = f0+f0/Nc - f=freq-f0 + f = freq-f0 if (abs(f) < SMALLVAL) then - Weigth_Burst=1 + Weigth_Burst = 1 else if (abs(freq-fbw1) < SMALLVAL .or. abs(freq-fbw2) < SMALLVAL ) then - Weigth_Burst=0.5 + Weigth_Burst = 0.5 else M=sqrt(Nc**2/f0**2) !max @ f0 cste=sqrt(TWO)/TWO/PI/M den=(Nc**2*f**2-f0**2)**2*f**2 - f04=f0**4 - Weigth_Burst=cste*sqrt(-1.0*f04*(cos(2*Nc*PI*f/f0)-1)/den) + f04 = f0**4 + Weigth_Burst = cste*sqrt(-1.0*f04*(cos(2*Nc*PI*f/f0)-1)/den) endif !~ print * @@ -942,7 +942,7 @@ subroutine enforce_fields_acoustic(iglob,it) call exit_MPI(myrank,"Error reading real mode file") endif ! format: #depth #mode value - do i=1,nLines + do i = 1,nLines read(num_file,*) zmode(i),realMode(i) enddo ! closes external file @@ -952,14 +952,14 @@ subroutine enforce_fields_acoustic(iglob,it) call exit_MPI(myrank,"Error reading imag mode file") endif ! format: #depth #mode value - do i=1,nLines + do i = 1,nLines read(num_file,*) zmode(i),imagMode(i) enddo ! closes external file close(num_file) neverRead = .false. endif - idx=searchInf(nLines,zmode,dble(z)) ! Look for index idx in sorted array zmode such as : zmode(idx) < z < zmode(idx+1) + idx = searchInf(nLines,zmode,dble(z)) ! Look for index idx in sorted array zmode such as : zmode(idx) < z < zmode(idx+1) ! Linear interpolation. Near to z: realMode = A*zmode+B A = (realMode(idx + 1) - realMode(idx))/(zmode(idx+1) - zmode(idx)) B = (zmode(idx+1)*realMode(idx) - zmode(idx)*realMode(idx+1)) / (zmode(idx+1) - zmode(idx)) diff --git a/src/specfem2D/moving_sources_par.F90 b/src/specfem2D/moving_sources_par.F90 index 9d0236d37..54c42b23f 100644 --- a/src/specfem2D/moving_sources_par.F90 +++ b/src/specfem2D/moving_sources_par.F90 @@ -449,9 +449,9 @@ subroutine init_moving_sources_GPU() ispec_selected_source_local,islice_selected_source(i_source), & NPROC,myrank,xi_source(i_source),gamma_source(i_source),is_force_source, & source_belonged_to_this_rank=source_belonged_to_this_rank_all(i_source), & - ispec_first_guess=ispec_source_first_guess, & + ispec_first_guess = ispec_source_first_guess, & pt_first_guess=pt_first_guess(i_source), & - reset=any_reset_source(i_source)) + reset = any_reset_source(i_source)) ispec_first_guess_vec(i_source) = ispec_selected_source_local diff --git a/src/specfem2D/noise_tomography.f90 b/src/specfem2D/noise_tomography.f90 index 80174c58d..1e649e040 100644 --- a/src/specfem2D/noise_tomography.f90 +++ b/src/specfem2D/noise_tomography.f90 @@ -306,11 +306,11 @@ subroutine read_parameters_noise() else if (NOISE_TOMOGRAPHY == 2) then if (SIMULATION_TYPE /= 1) call exit_MPI(myrank,'NOISE_TOMOGRAPHY=2 requires SIMULATION_TYPE=1, check DATA/Par_file') - if (.not. SAVE_FORWARD) call exit_MPI(myrank,'NOISE_TOMOGRAPHY=2 requires SAVE_FORWARD=.true., check DATA/Par_file') + if (.not. SAVE_FORWARD) call exit_MPI(myrank,'NOISE_TOMOGRAPHY=2 requires SAVE_FORWARD = .true., check DATA/Par_file') else if (NOISE_TOMOGRAPHY == 3) then if (SIMULATION_TYPE /= 3) call exit_MPI(myrank,'NOISE_TOMOGRAPHY=3 requires SIMULATION_TYPE=3, check DATA/Par_file') - if (SAVE_FORWARD) call exit_MPI(myrank,'NOISE_TOMOGRAPHY=3 requires SAVE_FORWARD=.false., check DATA/Par_file') + if (SAVE_FORWARD) call exit_MPI(myrank,'NOISE_TOMOGRAPHY=3 requires SAVE_FORWARD = .false., check DATA/Par_file') endif ! check model parameters diff --git a/src/specfem2D/plot_post.F90 b/src/specfem2D/plot_post.F90 index 89b362bbd..4c5a11df3 100644 --- a/src/specfem2D/plot_post.F90 +++ b/src/specfem2D/plot_post.F90 @@ -619,7 +619,7 @@ subroutine plot_post() ! draw straight lines if elements have 4 nodes - ir=pointsdisp + ir = pointsdisp x2 = (xinterp(ir,is)-xmin)*ratio_page + orig_x z2 = (zinterp(ir,is)-zmin)*ratio_page + orig_z x2 = x2 * centim @@ -632,8 +632,8 @@ subroutine plot_post() coorg_send_ps_element_mesh(2,buffer_offset) = z2 endif - ir=pointsdisp - is=pointsdisp + ir = pointsdisp + is = pointsdisp x2 = (xinterp(ir,is)-xmin)*ratio_page + orig_x z2 = (zinterp(ir,is)-zmin)*ratio_page + orig_z x2 = x2 * centim @@ -646,8 +646,8 @@ subroutine plot_post() coorg_send_ps_element_mesh(2,buffer_offset) = z2 endif - is=pointsdisp - ir=1 + is = pointsdisp + ir = 1 x2 = (xinterp(ir,is)-xmin)*ratio_page + orig_x z2 = (zinterp(ir,is)-zmin)*ratio_page + orig_z x2 = x2 * centim @@ -660,8 +660,8 @@ subroutine plot_post() coorg_send_ps_element_mesh(2,buffer_offset) = z2 endif - ir=1 - is=2 + ir = 1 + is = 2 x2 = (xinterp(ir,is)-xmin)*ratio_page + orig_x z2 = (zinterp(ir,is)-zmin)*ratio_page + orig_z x2 = x2 * centim @@ -691,7 +691,7 @@ subroutine plot_post() endif enddo - ir=pointsdisp + ir = pointsdisp do is= 2,pointsdisp x2 = (xinterp(ir,is)-xmin)*ratio_page + orig_x z2 = (zinterp(ir,is)-zmin)*ratio_page + orig_z @@ -706,7 +706,7 @@ subroutine plot_post() endif enddo - is=pointsdisp + is = pointsdisp do ir =pointsdisp-1,1,-1 x2 = (xinterp(ir,is)-xmin)*ratio_page + orig_x z2 = (zinterp(ir,is)-zmin)*ratio_page + orig_z @@ -721,8 +721,8 @@ subroutine plot_post() endif enddo - ir=1 - do is=pointsdisp-1,2,-1 + ir = 1 + do is = pointsdisp-1,2,-1 x2 = (xinterp(ir,is)-xmin)*ratio_page + orig_x z2 = (zinterp(ir,is)-zmin)*ratio_page + orig_z x2 = x2 * centim @@ -873,7 +873,7 @@ subroutine plot_post() buffer_offset = buffer_offset + 1 write(24,681) coorg_recv_ps_element_mesh(1,buffer_offset), coorg_recv_ps_element_mesh(2,buffer_offset) enddo - do is=pointsdisp-1,2,-1 + do is = pointsdisp-1,2,-1 buffer_offset = buffer_offset + 1 write(24,681) coorg_recv_ps_element_mesh(1,buffer_offset), coorg_recv_ps_element_mesh(2,buffer_offset) enddo diff --git a/src/specfem2D/pml_compute.f90 b/src/specfem2D/pml_compute.f90 index 38a996389..0ba184aff 100644 --- a/src/specfem2D/pml_compute.f90 +++ b/src/specfem2D/pml_compute.f90 @@ -589,7 +589,7 @@ subroutine decompose_rational_fraction_PML(N_PMLSF,beta,alpha) double precision, dimension(N_PMLSF) ::gamma_de if (N_PMLSF < 0) then - write(*,*)'the number of PML Stretching function should be greater than 0' + write(*,*) 'the number of PML Stretching function should be greater than 0' call stop_the_code('error: stopping the code') endif diff --git a/src/specfem2D/pml_init.F90 b/src/specfem2D/pml_init.F90 index b91479abb..be0e7373e 100644 --- a/src/specfem2D/pml_init.F90 +++ b/src/specfem2D/pml_init.F90 @@ -1237,8 +1237,8 @@ subroutine define_PML_coefficients() if (ispec_is_PML(ispec)) then ! loops over all GLL points ! (combines directions to speed up calculations) - do j=1,NGLLZ-1 - do i=1,NGLLX-1 + do j = 1,NGLLZ-1 + do i = 1,NGLLX-1 ! reference point iglob1 = ibool(i,j,ispec) x1 = coord(1,iglob1) diff --git a/src/specfem2D/prepare_timerun.F90 b/src/specfem2D/prepare_timerun.F90 index 0cf5c5758..f740a3054 100644 --- a/src/specfem2D/prepare_timerun.F90 +++ b/src/specfem2D/prepare_timerun.F90 @@ -523,39 +523,39 @@ subroutine prepare_timerun_postscripts() d2_RGB_recv_ps_velocity_model = d2_RGB_recv_ps_velocity_model*((NGLLX-subsamp_postscript)/subsamp_postscript)* & ((NGLLX-subsamp_postscript)/subsamp_postscript)*4 else - d1_coorg_recv_ps_velocity_model=1 - d2_coorg_recv_ps_velocity_model=1 - d1_RGB_recv_ps_velocity_model=1 - d2_RGB_recv_ps_velocity_model=1 + d1_coorg_recv_ps_velocity_model = 1 + d2_coorg_recv_ps_velocity_model = 1 + d1_RGB_recv_ps_velocity_model = 1 + d2_RGB_recv_ps_velocity_model = 1 endif - d1_coorg_send_ps_element_mesh=2 + d1_coorg_send_ps_element_mesh = 2 if (NGNOD == 4) then if (DISPLAY_ELEMENT_NUMBERS_POSTSCRIPT == 1) then - d2_coorg_send_ps_element_mesh=nspec*5 + d2_coorg_send_ps_element_mesh = nspec*5 if (DISPLAY_COLORS == 1) then - d1_color_send_ps_element_mesh=2*nspec + d1_color_send_ps_element_mesh = 2*nspec else - d1_color_send_ps_element_mesh=1*nspec + d1_color_send_ps_element_mesh = 1*nspec endif else - d2_coorg_send_ps_element_mesh=nspec*6 + d2_coorg_send_ps_element_mesh = nspec*6 if (DISPLAY_COLORS == 1) then - d1_color_send_ps_element_mesh=1*nspec + d1_color_send_ps_element_mesh = 1*nspec endif endif else if (DISPLAY_ELEMENT_NUMBERS_POSTSCRIPT == 1) then - d2_coorg_send_ps_element_mesh=nspec*((pointsdisp-1)*3+max(0,pointsdisp-2)+1+1) + d2_coorg_send_ps_element_mesh = nspec*((pointsdisp-1)*3+max(0,pointsdisp-2)+1+1) if (DISPLAY_COLORS == 1) then - d1_color_send_ps_element_mesh=2*nspec + d1_color_send_ps_element_mesh = 2*nspec else - d1_color_send_ps_element_mesh=1*nspec + d1_color_send_ps_element_mesh = 1*nspec endif else - d2_coorg_send_ps_element_mesh=nspec*((pointsdisp-1)*3+max(0,pointsdisp-2)+1) + d2_coorg_send_ps_element_mesh = nspec*((pointsdisp-1)*3+max(0,pointsdisp-2)+1) if (DISPLAY_COLORS == 1) then - d1_color_send_ps_element_mesh=1*nspec + d1_color_send_ps_element_mesh = 1*nspec endif endif endif @@ -564,63 +564,63 @@ subroutine prepare_timerun_postscripts() call max_all_all_i(d2_coorg_send_ps_element_mesh,d2_coorg_recv_ps_element_mesh) call max_all_all_i(d1_color_send_ps_element_mesh,d1_color_recv_ps_element_mesh) - d1_coorg_send_ps_abs=5 - d2_coorg_send_ps_abs=4*num_abs_boundary_faces + d1_coorg_send_ps_abs = 5 + d2_coorg_send_ps_abs = 4*num_abs_boundary_faces call max_all_all_i(d1_coorg_send_ps_abs,d1_coorg_recv_ps_abs) call max_all_all_i(d2_coorg_send_ps_abs,d2_coorg_recv_ps_abs) - d1_coorg_send_ps_free_surface=4 - d2_coorg_send_ps_free_surface=4*nelem_acoustic_surface + d1_coorg_send_ps_free_surface = 4 + d2_coorg_send_ps_free_surface = 4*nelem_acoustic_surface call max_all_all_i(d1_coorg_send_ps_free_surface,d1_coorg_recv_ps_free_surface) call max_all_all_i(d2_coorg_send_ps_free_surface,d2_coorg_recv_ps_free_surface) - d1_coorg_send_ps_vector_field=8 + d1_coorg_send_ps_vector_field = 8 if (interpol) then if (plot_lowerleft_corner_only) then - d2_coorg_send_ps_vector_field=nspec*1*1 + d2_coorg_send_ps_vector_field = nspec*1*1 else - d2_coorg_send_ps_vector_field=nspec*pointsdisp*pointsdisp + d2_coorg_send_ps_vector_field = nspec*pointsdisp*pointsdisp endif else - d2_coorg_send_ps_vector_field=nglob + d2_coorg_send_ps_vector_field = nglob endif call max_all_all_i(d1_coorg_send_ps_vector_field,d1_coorg_recv_ps_vector_field) call max_all_all_i(d2_coorg_send_ps_vector_field,d2_coorg_recv_ps_vector_field) #else ! dummy values - d1_coorg_recv_ps_velocity_model=1 - d2_coorg_recv_ps_velocity_model=1 - d1_RGB_recv_ps_velocity_model=1 - d2_RGB_recv_ps_velocity_model=1 - - d1_coorg_send_ps_element_mesh=1 - d2_coorg_send_ps_element_mesh=1 - d1_coorg_recv_ps_element_mesh=1 - d2_coorg_recv_ps_element_mesh=1 - d1_color_send_ps_element_mesh=1 - d1_color_recv_ps_element_mesh=1 - - d1_coorg_send_ps_abs=1 - d2_coorg_send_ps_abs=1 - d1_coorg_recv_ps_abs=1 - d2_coorg_recv_ps_abs=1 - d1_coorg_send_ps_free_surface=1 - d2_coorg_send_ps_free_surface=1 - d1_coorg_recv_ps_free_surface=1 - d2_coorg_recv_ps_free_surface=1 - - d1_coorg_send_ps_vector_field=1 - d2_coorg_send_ps_vector_field=1 - d1_coorg_recv_ps_vector_field=1 - d2_coorg_recv_ps_vector_field=1 + d1_coorg_recv_ps_velocity_model = 1 + d2_coorg_recv_ps_velocity_model = 1 + d1_RGB_recv_ps_velocity_model = 1 + d2_RGB_recv_ps_velocity_model = 1 + + d1_coorg_send_ps_element_mesh = 1 + d2_coorg_send_ps_element_mesh = 1 + d1_coorg_recv_ps_element_mesh = 1 + d2_coorg_recv_ps_element_mesh = 1 + d1_color_send_ps_element_mesh = 1 + d1_color_recv_ps_element_mesh = 1 + + d1_coorg_send_ps_abs = 1 + d2_coorg_send_ps_abs = 1 + d1_coorg_recv_ps_abs = 1 + d2_coorg_recv_ps_abs = 1 + d1_coorg_send_ps_free_surface = 1 + d2_coorg_send_ps_free_surface = 1 + d1_coorg_recv_ps_free_surface = 1 + d2_coorg_recv_ps_free_surface = 1 + + d1_coorg_send_ps_vector_field = 1 + d2_coorg_send_ps_vector_field = 1 + d1_coorg_recv_ps_vector_field = 1 + d2_coorg_recv_ps_vector_field = 1 #endif - d1_coorg_send_ps_velocity_model=2 - d2_coorg_send_ps_velocity_model=nspec*((NGLLX-subsamp_postscript)/subsamp_postscript)* & + d1_coorg_send_ps_velocity_model = 2 + d2_coorg_send_ps_velocity_model = nspec*((NGLLX-subsamp_postscript)/subsamp_postscript)* & ((NGLLX-subsamp_postscript)/subsamp_postscript)*4 - d1_RGB_send_ps_velocity_model=1 - d2_RGB_send_ps_velocity_model=nspec*((NGLLX-subsamp_postscript)/subsamp_postscript)* & + d1_RGB_send_ps_velocity_model = 1 + d2_RGB_send_ps_velocity_model = nspec*((NGLLX-subsamp_postscript)/subsamp_postscript)* & ((NGLLX-subsamp_postscript)/subsamp_postscript) allocate(coorg_send_ps_velocity_model(d1_coorg_send_ps_velocity_model,d2_coorg_send_ps_velocity_model)) diff --git a/src/specfem2D/read_forward_arrays.f90 b/src/specfem2D/read_forward_arrays.f90 index f65a00cbb..d5900d9ef 100644 --- a/src/specfem2D/read_forward_arrays.f90 +++ b/src/specfem2D/read_forward_arrays.f90 @@ -270,7 +270,7 @@ subroutine read_forward_arrays_no_backward() ! launches the transfer of the next wavefield call transfer_async_pot_ac_to_device(no_backward_acoustic_buffer(nglob*buffer_num_GPU_transfer+1),Mesh_pointer) else - ! we get the wavefield from the previous iteration, because this RAM = => + ! we get the wavefield from the previous iteration, because this RAM ==> ! RAM copy is blocking b_potential_acoustic(:) = no_backward_acoustic_buffer(nglob*mod(no_backward_iframe,3)+1: & nglob*(mod(no_backward_iframe,3)+1)) diff --git a/src/specfem2D/read_mesh_databases.F90 b/src/specfem2D/read_mesh_databases.F90 index 4e537dd16..8918f73ae 100644 --- a/src/specfem2D/read_mesh_databases.F90 +++ b/src/specfem2D/read_mesh_databases.F90 @@ -1740,9 +1740,9 @@ subroutine StripChar(string,char) stop 'This function can not be used to strip spaces, use StripSpaces instead' endif - do while (index(string,char,back=.true.) > 0) - stringCopy1 = string(:index(string,char,back=.true.)-1) - stringCopy2 = string(index(string,char,back=.true.)+1:) + do while (index(string,char,back = .true.) > 0) + stringCopy1 = string(:index(string,char,back = .true.)-1) + stringCopy2 = string(index(string,char,back = .true.)+1:) string = trim(stringCopy1)//trim(stringCopy2) enddo @@ -1799,7 +1799,7 @@ subroutine AddToList(list, element) if (allocated(list)) then isize = size(list) allocate(clist(isize+1)) - do i=1,isize + do i = 1,isize clist(i) = list(i) enddo clist(isize+1) = element diff --git a/src/specfem2D/sort_array_coordinates.F90 b/src/specfem2D/sort_array_coordinates.F90 index 2e65c742c..566c9fa5e 100644 --- a/src/specfem2D/sort_array_coordinates.F90 +++ b/src/specfem2D/sort_array_coordinates.F90 @@ -160,36 +160,36 @@ subroutine rank_buffers(A,IND,N) if (n == 1) return - L=n/2+1 - ir=n + L = n/2+1 + ir = n 100 continue if (l > 1) then - l=l-1 + l = l-1 indx=IND(l) q=A(indx) ELSE indx=IND(ir) q=A(indx) IND(ir)=IND(1) - ir=ir-1 + ir = ir-1 if (ir == 1) then IND(1)=indx return endif endif - i=l - j=l+l + i = l + j = l+l 200 continue if (j <= ir) then if (j < ir) then - if (A(IND(j)) < A(IND(j+1))) j=j+1 + if (A(IND(j)) < A(IND(j+1))) j = j+1 endif if (q < A(IND(j))) then IND(i)=IND(j) - i=j - j=j+j + i = j + j = j+j ELSE - j=ir+1 + j = ir+1 endif goto 200 endif diff --git a/src/specfem2D/write_wavefield_dumps.F90 b/src/specfem2D/write_wavefield_dumps.F90 index 4582010af..04bd49b94 100644 --- a/src/specfem2D/write_wavefield_dumps.F90 +++ b/src/specfem2D/write_wavefield_dumps.F90 @@ -372,7 +372,7 @@ subroutine write_file_dump() endif ! Write file content - do ii=1, size(dump_write, 2) + do ii = 1, size(dump_write, 2) if (use_binary_for_wavefield_dumps) then if (P_SV) then @@ -441,7 +441,7 @@ subroutine mask_duplicates() allocate(duplicate_index_mask(count(dump_duplicate_gather))) ! Might be inefficient to reform the entire index array every time, but avoids storage. - duplicate_index = pack([(jj, jj=1, size(dump_gather, 2))], dump_duplicate_gather) + duplicate_index = pack([(jj, jj = 1, size(dump_gather, 2))], dump_duplicate_gather) ! Search for duplicates of first entry still marked as duplicates. duplicate_index_mask = dump_gather(1,duplicate_index(1)) == dump_gather(1,duplicate_index) .and. & dump_gather(2,duplicate_index(1)) == dump_gather(2,duplicate_index) diff --git a/src/tomography/postprocess_sensitivity_kernels/combine_sem.F90 b/src/tomography/postprocess_sensitivity_kernels/combine_sem.F90 index 1caec10d4..f0b63bcde 100644 --- a/src/tomography/postprocess_sensitivity_kernels/combine_sem.F90 +++ b/src/tomography/postprocess_sensitivity_kernels/combine_sem.F90 @@ -110,7 +110,7 @@ program combine_sem call parse_kernel_names(kernel_names_comma_delimited,kernel_names,nker) ! parse paths from INPUT_FILE - npath=0 + npath = 0 open(unit = IIN, file = trim(input_file), status = 'old',iostat = ier) if (ier /= 0) then print *,'Error opening ',trim(input_file) diff --git a/src/tomography/postprocess_sensitivity_kernels/sum_kernels_ascii.f90 b/src/tomography/postprocess_sensitivity_kernels/sum_kernels_ascii.f90 index 7b3febbfa..a510075e4 100644 --- a/src/tomography/postprocess_sensitivity_kernels/sum_kernels_ascii.f90 +++ b/src/tomography/postprocess_sensitivity_kernels/sum_kernels_ascii.f90 @@ -100,7 +100,7 @@ program sum_kernels_ascii read(arg(2),'(a)') output_dir ! parse paths from INPUT_FILE - npath=0 + npath = 0 open(unit = IIN, file = trim(input_file), status = 'old',iostat = ier) if (ier /= 0) then print *,'Error opening ',trim(input_file) @@ -200,7 +200,7 @@ subroutine get_number_gll_points(kernel_path, nlines) do j = 1,MAX_LINES read(3,*,iostat=ios) dummy1, dummy2, dummy3, dummy4, dummy5 if (ios /= 0) exit - nlines=nlines+1 + nlines = nlines+1 enddo close(3) diff --git a/src/tomography/sum_kernels.f90 b/src/tomography/sum_kernels.f90 index 54cca6098..134f878f9 100644 --- a/src/tomography/sum_kernels.f90 +++ b/src/tomography/sum_kernels.f90 @@ -90,7 +90,7 @@ program sum_kernels kernel_list(:) = '' ! reads in event list - nker=0 + nker = 0 open(unit = IIN, file = trim(KERNEL_FILE_LIST), status = 'old',iostat = ier) if (ier /= 0) then print *,'Error opening ',trim(KERNEL_FILE_LIST),myrank diff --git a/utils/CPML/add_CPML_layers_to_an_existing_mesh.f90 b/utils/CPML/add_CPML_layers_to_an_existing_mesh.f90 index 5cab29407..711f4e90d 100644 --- a/utils/CPML/add_CPML_layers_to_an_existing_mesh.f90 +++ b/utils/CPML/add_CPML_layers_to_an_existing_mesh.f90 @@ -830,7 +830,7 @@ subroutine calc_jacobian(xelm,zelm,dershape2D,found_a_negative_jacobian,NDIM,NGN xgamma = ZERO zgamma = ZERO - do ia=1,NGNOD + do ia = 1,NGNOD xxi = xxi + dershape2D(1,ia,i,k)*xelm(ia) zxi = zxi + dershape2D(1,ia,i,k)*zelm(ia) xgamma = xgamma + dershape2D(2,ia,i,k)*xelm(ia) diff --git a/utils/CPML/convert_external_layers_of_a_given_mesh_to_CPML_layers.f90 b/utils/CPML/convert_external_layers_of_a_given_mesh_to_CPML_layers.f90 index af9b49d37..f6499d78a 100644 --- a/utils/CPML/convert_external_layers_of_a_given_mesh_to_CPML_layers.f90 +++ b/utils/CPML/convert_external_layers_of_a_given_mesh_to_CPML_layers.f90 @@ -332,7 +332,7 @@ program convert_mesh_to_CPML write(24,*) number_of_CPML_elements ! write the CPML flag for each CPML element - do ispec=1,nspec + do ispec = 1,nspec if (is_X_CPML(ispec) .and. is_Z_CPML(ispec)) then write(24,*) ispec,CPML_XZ diff --git a/utils/Visualization/GMT/permute_color_palette.f90 b/utils/Visualization/GMT/permute_color_palette.f90 index c2156b227..b482e50af 100644 --- a/utils/Visualization/GMT/permute_color_palette.f90 +++ b/utils/Visualization/GMT/permute_color_palette.f90 @@ -17,7 +17,7 @@ program permute_color_palette done(:) = -1 -do i=1,N +do i = 1,N 777 continue call random_number(random_val) @@ -36,14 +36,14 @@ program permute_color_palette !write(*,*) perm(i) !enddo -do i=1,N +do i = 1,N read(*,*) nom(perm(i)) read(*,*) r(perm(i)) read(*,*) g(perm(i)) read(*,*) b(perm(i)) enddo -do i=1,N +do i = 1,N write(*,*) '!#',nom(i) write(*,*) '##red(',i,')#=#',r(i) write(*,*) '##green(',i,')#=#',g(i) diff --git a/utils/infos/older_or_specific_versions_of_mesher/meshfem2D_circular_canyon.f90 b/utils/infos/older_or_specific_versions_of_mesher/meshfem2D_circular_canyon.f90 index d6ebefc0a..91fdb83f6 100644 --- a/utils/infos/older_or_specific_versions_of_mesher/meshfem2D_circular_canyon.f90 +++ b/utils/infos/older_or_specific_versions_of_mesher/meshfem2D_circular_canyon.f90 @@ -25,12 +25,12 @@ program circular_canyon implicit none ! max size of the model in elements - integer, parameter :: mnx=7,mnz=7 + integer, parameter :: mnx = 7,mnz = 7 - double precision, parameter :: pi=3.141592653589793d0 + double precision, parameter :: pi = 3.141592653589793d0 ! seuil pour considerer deux points comme confondus - double precision, parameter :: rseuil=1.d-2 + double precision, parameter :: rseuil = 1.d-2 ! declare variables integer imaxabs,n2ana,itimetype,isource_type,nump1,nump2,nump3,nump4 @@ -63,7 +63,7 @@ program circular_canyon double precision x1b(0:2*mnx,0:mnz) double precision z1b(0:2*mnx,0:mnz) - integer, parameter :: npoinz2b=(mnx+1)*(2*mnz+1), nelemz2b=mnx*(2*mnz) + integer, parameter :: npoinz2b=(mnx+1)*(2*mnz+1), nelemz2b = mnx*(2*mnz) double precision x2b(0:mnx,0:2*mnz) double precision z2b(0:mnx,0:2*mnz) @@ -124,7 +124,7 @@ program circular_canyon ! generer les points de base de l'interpolation lineaire (zone 1) theta_init = 3 * pi / 2. delta_theta = pi / 2. - do i=0,4*nx + do i = 0,4*nx ! --- point de depart if (i < 2*nx) then @@ -141,7 +141,7 @@ program circular_canyon z1(i,nz) = sin(theta_i) ! --- points intermediaires par interpolation lineaire - do j=1,nz-1 + do j = 1,nz-1 eta_j = dble(j) / dble(nz) x1(i,j) = (1.-eta_j)*x1(i,0) + eta_j*x1(i,nz) z1(i,j) = (1.-eta_j)*z1(i,0) + eta_j*z1(i,nz) @@ -149,8 +149,8 @@ program circular_canyon enddo ! generer zone de gauche (zone 3) - do i=0,2*nx - do j=0,4*nz + do i = 0,2*nx + do j = 0,4*nz x3(i,j) = 5. * dble(i) / dble(2*nx) + 2. if (j <= 2*nz) then z3(i,j) = 7. * dble(j) / dble(2*nz) - 9. @@ -161,8 +161,8 @@ program circular_canyon enddo ! generer zone du bas (zone 4) - do i=0,2*nx - do j=0,2*nz + do i = 0,2*nx + do j = 0,2*nz x4(i,j) = 2. * dble(i) / dble(2*nx) z4(i,j) = 7. * dble(j) / dble(2*nz) - 9. enddo @@ -176,7 +176,7 @@ program circular_canyon theta_init = pi / 4. delta_theta = pi / 4. - do i=0,2*nx + do i = 0,2*nx ! --- point de depart x1b(i,0) = 2.*R * (dble(i) / dble(2*nx) - 1.) z1b(i,0) = - 2.*R @@ -187,7 +187,7 @@ program circular_canyon z1b(i,nz) = - sin(theta_i) ! --- points intermediaires par interpolation lineaire - do j=1,nz-1 + do j = 1,nz-1 eta_j = dble(j) / dble(nz) x1b(i,j) = (1.-eta_j)*x1b(i,0) + eta_j*x1b(i,nz) z1b(i,j) = (1.-eta_j)*z1b(i,0) + eta_j*z1b(i,nz) @@ -197,7 +197,7 @@ program circular_canyon ! generer les points de base de l'interpolation lineaire (zone 2) theta_init = pi / 4. - do j=0,2*nz + do j = 0,2*nz ! --- point de depart x2b(0,j) = - 2.*R z2b(0,j) = 2.*R * (dble(j) / dble(2*nz) - 1.) @@ -208,7 +208,7 @@ program circular_canyon z2b(nx,j) = - sin(theta_i) ! --- points intermediaires par interpolation lineaire - do i=1,nx-1 + do i = 1,nx-1 eta_j = dble(i) / dble(nx) x2b(i,j) = (1.-eta_j)*x2b(0,j) + eta_j*x2b(nx,j) z2b(i,j) = (1.-eta_j)*z2b(0,j) + eta_j*z2b(nx,j) @@ -217,8 +217,8 @@ program circular_canyon enddo ! generer zone de gauche (zone 3) - do i=0,4*nx - do j=0,4*nz + do i = 0,4*nx + do j = 0,4*nz x3b(i,j) = 10. * dble(i) / dble(4*nx) - 12. if (j <= 2*nz) then z3b(i,j) = 7. * dble(j) / dble(2*nz) - 9. @@ -229,8 +229,8 @@ program circular_canyon enddo ! generer zone du bas (zone 4) - do i=0,2*nx - do j=0,2*nz + do i = 0,2*nx + do j = 0,2*nz x4b(i,j) = 2. * dble(i) / dble(2*nx) - 2. z4b(i,j) = 7. * dble(j) / dble(2*nz) - 9. enddo @@ -246,16 +246,16 @@ program circular_canyon open(unit=20,file='grid.gnu',status='unknown') ! *** dessiner la zone 1 - do j=0,nz - do i=0,4*nx-1 + do j = 0,nz + do i = 0,4*nx-1 write(20,*) sngl(x1(i,j)),sngl(z1(i,j)) write(20,*) sngl(x1(i+1,j)),sngl(z1(i+1,j)) write(20,100) enddo enddo - do i=0,4*nx - do j=0,nz-1 + do i = 0,4*nx + do j = 0,nz-1 write(20,*) sngl(x1(i,j)),sngl(z1(i,j)) write(20,*) sngl(x1(i,j+1)),sngl(z1(i,j+1)) write(20,100) @@ -263,16 +263,16 @@ program circular_canyon enddo ! *** dessiner la zone 3 - do j=0,4*nz - do i=0,2*nx-1 + do j = 0,4*nz + do i = 0,2*nx-1 write(20,*) sngl(x3(i,j)),sngl(z3(i,j)) write(20,*) sngl(x3(i+1,j)),sngl(z3(i+1,j)) write(20,100) enddo enddo - do i=0,2*nx - do j=0,4*nz-1 + do i = 0,2*nx + do j = 0,4*nz-1 write(20,*) sngl(x3(i,j)),sngl(z3(i,j)) write(20,*) sngl(x3(i,j+1)),sngl(z3(i,j+1)) write(20,100) @@ -280,16 +280,16 @@ program circular_canyon enddo ! *** dessiner la zone 4 - do j=0,2*nz - do i=0,2*nx-1 + do j = 0,2*nz + do i = 0,2*nx-1 write(20,*) sngl(x4(i,j)),sngl(z4(i,j)) write(20,*) sngl(x4(i+1,j)),sngl(z4(i+1,j)) write(20,100) enddo enddo - do i=0,2*nx - do j=0,2*nz-1 + do i = 0,2*nx + do j = 0,2*nz-1 write(20,*) sngl(x4(i,j)),sngl(z4(i,j)) write(20,*) sngl(x4(i,j+1)),sngl(z4(i,j+1)) write(20,100) @@ -297,16 +297,16 @@ program circular_canyon enddo ! *** dessiner la zone 1 - do j=0,nz - do i=0,2*nx-1 + do j = 0,nz + do i = 0,2*nx-1 write(20,*) sngl(x1b(i,j)),sngl(z1b(i,j)) write(20,*) sngl(x1b(i+1,j)),sngl(z1b(i+1,j)) write(20,100) enddo enddo - do i=0,2*nx - do j=0,nz-1 + do i = 0,2*nx + do j = 0,nz-1 write(20,*) sngl(x1b(i,j)),sngl(z1b(i,j)) write(20,*) sngl(x1b(i,j+1)),sngl(z1b(i,j+1)) write(20,100) @@ -314,16 +314,16 @@ program circular_canyon enddo ! *** dessiner la zone 2 - do j=0,2*nz - do i=0,nx-1 + do j = 0,2*nz + do i = 0,nx-1 write(20,*) sngl(x2b(i,j)),sngl(z2b(i,j)) write(20,*) sngl(x2b(i+1,j)),sngl(z2b(i+1,j)) write(20,100) enddo enddo - do i=0,nx - do j=0,2*nz-1 + do i = 0,nx + do j = 0,2*nz-1 write(20,*) sngl(x2b(i,j)),sngl(z2b(i,j)) write(20,*) sngl(x2b(i,j+1)),sngl(z2b(i,j+1)) write(20,100) @@ -331,16 +331,16 @@ program circular_canyon enddo ! *** dessiner la zone 3 - do j=0,4*nz - do i=0,4*nx-1 + do j = 0,4*nz + do i = 0,4*nx-1 write(20,*) sngl(x3b(i,j)),sngl(z3b(i,j)) write(20,*) sngl(x3b(i+1,j)),sngl(z3b(i+1,j)) write(20,100) enddo enddo - do i=0,4*nx - do j=0,4*nz-1 + do i = 0,4*nx + do j = 0,4*nz-1 write(20,*) sngl(x3b(i,j)),sngl(z3b(i,j)) write(20,*) sngl(x3b(i,j+1)),sngl(z3b(i,j+1)) write(20,100) @@ -348,16 +348,16 @@ program circular_canyon enddo ! *** dessiner la zone 4 - do j=0,2*nz - do i=0,2*nx-1 + do j = 0,2*nz + do i = 0,2*nx-1 write(20,*) sngl(x4b(i,j)),sngl(z4b(i,j)) write(20,*) sngl(x4b(i+1,j)),sngl(z4b(i+1,j)) write(20,100) enddo enddo - do i=0,2*nx - do j=0,2*nz-1 + do i = 0,2*nx + do j = 0,2*nz-1 write(20,*) sngl(x4b(i,j)),sngl(z4b(i,j)) write(20,*) sngl(x4b(i,j+1)),sngl(z4b(i,j+1)) write(20,100) @@ -378,8 +378,8 @@ program circular_canyon numerocourant = 1 ! *** zone 1 - do j=0,nz - do i=0,4*nx + do j = 0,nz + do i = 0,4*nx xpoint(numerocourant) = x1(i,j) zpoint(numerocourant) = z1(i,j) numerocourant = numerocourant + 1 @@ -387,8 +387,8 @@ program circular_canyon enddo ! *** zone 3 - do j=0,4*nz - do i=0,2*nx + do j = 0,4*nz + do i = 0,2*nx xpoint(numerocourant) = x3(i,j) zpoint(numerocourant) = z3(i,j) numerocourant = numerocourant + 1 @@ -396,8 +396,8 @@ program circular_canyon enddo ! *** zone 4 - do j=0,2*nz - do i=0,2*nx + do j = 0,2*nz + do i = 0,2*nx xpoint(numerocourant) = x4(i,j) zpoint(numerocourant) = z4(i,j) numerocourant = numerocourant + 1 @@ -405,8 +405,8 @@ program circular_canyon enddo ! *** zone 1 - do j=0,nz - do i=0,2*nx + do j = 0,nz + do i = 0,2*nx xpoint(numerocourant) = x1b(i,j) zpoint(numerocourant) = z1b(i,j) numerocourant = numerocourant + 1 @@ -414,8 +414,8 @@ program circular_canyon enddo ! *** zone 2 - do j=0,2*nz - do i=0,nx + do j = 0,2*nz + do i = 0,nx xpoint(numerocourant) = x2b(i,j) zpoint(numerocourant) = z2b(i,j) numerocourant = numerocourant + 1 @@ -423,8 +423,8 @@ program circular_canyon enddo ! *** zone 3 - do j=0,4*nz - do i=0,4*nx + do j = 0,4*nz + do i = 0,4*nx xpoint(numerocourant) = x3b(i,j) zpoint(numerocourant) = z3b(i,j) numerocourant = numerocourant + 1 @@ -432,8 +432,8 @@ program circular_canyon enddo ! *** zone 4 - do j=0,2*nz - do i=0,2*nx + do j = 0,2*nz + do i = 0,2*nx xpoint(numerocourant) = x4b(i,j) zpoint(numerocourant) = z4b(i,j) numerocourant = numerocourant + 1 @@ -450,8 +450,8 @@ program circular_canyon imaxabs = 0 ! *** zone 1 - do j=0,nz-1 - do i=0,4*nx-1 + do j = 0,nz-1 + do i = 0,4*nx-1 x1e(numerocourant) = x1(i,j) z1e(numerocourant) = z1(i,j) x2e(numerocourant) = x1(i+1,j) @@ -465,8 +465,8 @@ program circular_canyon enddo ! *** zone 3 - do j=0,4*nz-1 - do i=0,2*nx-1 + do j = 0,4*nz-1 + do i = 0,2*nx-1 x1e(numerocourant) = x3(i,j) z1e(numerocourant) = z3(i,j) x2e(numerocourant) = x3(i+1,j) @@ -480,8 +480,8 @@ program circular_canyon enddo ! *** zone 4 - do j=0,2*nz-1 - do i=0,2*nx-1 + do j = 0,2*nz-1 + do i = 0,2*nx-1 x1e(numerocourant) = x4(i,j) z1e(numerocourant) = z4(i,j) x2e(numerocourant) = x4(i+1,j) @@ -495,8 +495,8 @@ program circular_canyon enddo ! *** zone 1 - do j=0,nz-1 - do i=0,2*nx-1 + do j = 0,nz-1 + do i = 0,2*nx-1 x1e(numerocourant) = x1b(i,j) z1e(numerocourant) = z1b(i,j) x2e(numerocourant) = x1b(i+1,j) @@ -510,8 +510,8 @@ program circular_canyon enddo ! *** zone 2 - do j=0,2*nz-1 - do i=0,nx-1 + do j = 0,2*nz-1 + do i = 0,nx-1 x1e(numerocourant) = x2b(i,j) z1e(numerocourant) = z2b(i,j) x2e(numerocourant) = x2b(i+1,j) @@ -525,8 +525,8 @@ program circular_canyon enddo ! *** zone 3 - do j=0,4*nz-1 - do i=0,4*nx-1 + do j = 0,4*nz-1 + do i = 0,4*nx-1 x1e(numerocourant) = x3b(i,j) z1e(numerocourant) = z3b(i,j) x2e(numerocourant) = x3b(i+1,j) @@ -540,8 +540,8 @@ program circular_canyon enddo ! *** zone 4 - do j=0,2*nz-1 - do i=0,2*nx-1 + do j = 0,2*nz-1 + do i = 0,2*nx-1 x1e(numerocourant) = x4b(i,j) z1e(numerocourant) = z4b(i,j) x2e(numerocourant) = x4b(i+1,j) @@ -563,10 +563,10 @@ program circular_canyon write(*,*) write(*,*) 'Creation de la topologie des elements...' - do i=1,nelem + do i = 1,nelem ! recherche point 1 - do j=1,npoin + do j = 1,npoin dist = sqrt((x1e(i)-xpoint(j))**2 + (z1e(i)-zpoint(j))**2) if (dist <= rseuil) then nump1 = j @@ -577,7 +577,7 @@ program circular_canyon 401 continue ! recherche point 2 - do j=1,npoin + do j = 1,npoin dist = sqrt((x2e(i)-xpoint(j))**2 + (z2e(i)-zpoint(j))**2) if (dist <= rseuil) then nump2 = j @@ -588,7 +588,7 @@ program circular_canyon 402 continue ! recherche point 3 - do j=1,npoin + do j = 1,npoin dist = sqrt((x3e(i)-xpoint(j))**2 + (z3e(i)-zpoint(j))**2) if (dist <= rseuil) then nump3 = j @@ -599,7 +599,7 @@ program circular_canyon 403 continue ! recherche point 4 - do j=1,npoin + do j = 1,npoin dist = sqrt((x4e(i)-xpoint(j))**2 + (z4e(i)-zpoint(j))**2) if (dist <= rseuil) then nump4 = j @@ -776,7 +776,7 @@ program circular_canyon write(15,*) itimetype,isource_type,xs+xoffs,zs+zoffs,f0,t0,factor,angle,0 write(15,*) 'Receivers (number, angle, position in meters)' - do irec=1,nrec + do irec = 1,nrec if (irec <= nrecsur3) then xrec = 2.*dble(irec-1)/dble(nrecsur3-1) + 9. zrec = 9. @@ -792,7 +792,7 @@ program circular_canyon enddo write(15,*) 'Coordinates of spectral control points' - do i=1,npoin + do i = 1,npoin write(15,*) i,xpoint(i)+xoffs,zpoint(i)+zoffs enddo @@ -814,7 +814,7 @@ program circular_canyon imatnum = 1 - do i=1,nspel + do i = 1,nspel write(15,*) i,imatnum,numpoin1(i),numpoin2(i),numpoin3(i),numpoin4(i) enddo diff --git a/utils/infos/older_or_specific_versions_of_mesher/meshfem2D_non_struct_2.f90 b/utils/infos/older_or_specific_versions_of_mesher/meshfem2D_non_struct_2.f90 index ca7c83993..32e9ffa95 100644 --- a/utils/infos/older_or_specific_versions_of_mesher/meshfem2D_non_struct_2.f90 +++ b/utils/infos/older_or_specific_versions_of_mesher/meshfem2D_non_struct_2.f90 @@ -113,7 +113,7 @@ program maille_non_struct_2 4 format(a,l8) ! read the header - do i=1,10 + do i = 1,10 read(10,*) enddo @@ -215,7 +215,7 @@ program maille_non_struct_2 allocate(angle(nbsources)) allocate(factor(nbsources)) - do i=1,nbsources + do i = 1,nbsources read(10,*) read(10,1)junk,xs(i) read(10,1)junk,zs(i) @@ -289,7 +289,7 @@ program maille_non_struct_2 print *,'There are ',nrec,' receivers on a single line' xspacerec=(xfin-xdeb)/dble(nrec-1) zspacerec=(zfin-zdeb)/dble(nrec-1) - do i=1,nrec + do i = 1,nrec xrec(i) = xdeb + dble(i-1)*xspacerec zrec(i) = zdeb + dble(i-1)*zspacerec enddo @@ -300,13 +300,13 @@ program maille_non_struct_2 print *,'Second line contains ',nrec2,' receivers' xspacerec=(xfin-xdeb)/dble(nrec1-1) zspacerec=(zfin-zdeb)/dble(nrec1-1) - do i=1,nrec1 + do i = 1,nrec1 xrec(i) = xdeb + dble(i-1)*xspacerec zrec(i) = zdeb + dble(i-1)*zspacerec enddo xspacerec=(xfin2-xdeb2)/dble(nrec2-1) zspacerec=(zfin2-zdeb2)/dble(nrec2-1) - do i=1,nrec2 + do i = 1,nrec2 xrec(i+nrec1) = xdeb2 + dble(i-1)*xspacerec zrec(i+nrec1) = zdeb2 + dble(i-1)*zspacerec enddo @@ -367,7 +367,7 @@ program maille_non_struct_2 cp(:) = 0.d0 cs(:) = 0.d0 - do imodele=1,nbmodeles + do imodele = 1,nbmodeles read(10,*) i,icodematread,rhoread,cpread,csread,aniso3read,aniso4read if (i < 1 .or. i > nbmodeles) stop 'Wrong material set number' rho(i) = rhoread @@ -380,7 +380,7 @@ program maille_non_struct_2 print * print *, 'Nb de modeles de roche = ',nbmodeles print * - do i=1,nbmodeles + do i = 1,nbmodeles print *,'Modele #',i,' isotrope' print *,'rho,cp,cs = ',rho(i),cp(i),cs(i) enddo @@ -403,10 +403,10 @@ program maille_non_struct_2 allocate(top0(0:nx)) ! calcul des points regulierement espaces - do i=0,nx + do i = 0,nx psi(i) = i/dble(nx) enddo - do j=0,nz + do j = 0,nz eta(j) = j/dble(nz) enddo @@ -456,7 +456,7 @@ program maille_non_struct_2 allocate(ztopo(ntopo)) allocate(coefs_topo(ntopo)) - do i=1,ntopo + do i = 1,ntopo read(15,*) xtopo(i),ztopo(i) enddo close(15) @@ -487,7 +487,7 @@ program maille_non_struct_2 print * print *, 'Position (x,z) des ',nbsources,' sources' print * - do i=1,nbsources + do i = 1,nbsources ! DK DK DK Elf : position source donnee en profondeur par rapport a la topo zs(i) = spl(xs(i),xtopo,ztopo,coefs_topo,ntopo) - zs(i) @@ -500,7 +500,7 @@ program maille_non_struct_2 print * print *, 'Position (x,z) des ',nrec,' receivers' print * - do irec=1,nrec + do irec = 1,nrec ! DK DK DK Elf : distinguer les deux lignes de recepteurs if (irec <= nrec1) then @@ -513,13 +513,13 @@ program maille_non_struct_2 enddo !--- definition du maillage suivant X - do ix=0,nx + do ix = 0,nx absx(ix) = dens(ix,psi,xmin,xmax,nx) enddo ! *** une seule zone - do iz=0,nz + do iz = 0,nz ! DK DK DK densification sinusoidale ici en vertical valeta(iz) = eta(iz) + ratio * sin(3.14159265 * eta(iz)) @@ -531,14 +531,14 @@ program maille_non_struct_2 a01(iz) = valeta(iz) enddo - do ix=0,nx + do ix = 0,nx bot0(ix) = bottom(absx(ix)) top0(ix) = spl(absx(ix),xtopo,ztopo,coefs_topo,ntopo) enddo ! valeurs de x et y pour display domaine physique - do ix=0,nx - do iz=0,nz + do ix = 0,nx + do iz = 0,nz x(ix,iz) = absx(ix) z(ix,iz) = a00(iz)*bot0(ix) + a01(iz)*top0(ix) enddo @@ -624,20 +624,20 @@ program maille_non_struct_2 write(15,*) nbsources write(15,*) 'Collocated forces and/or pressure sources:' - do i=1,nbsources + do i = 1,nbsources write(15,*) itimetype(i),isource_type(i), & xs(i)-xmin ,zs(i), & f0(i),tshift_src(i),factor(i),angle(i),0 enddo write(15,*) 'Receivers positions:' - do irec=1,nrec + do irec = 1,nrec write(15,*) irec,xrec(irec)-xmin ,zrec(irec) enddo write(15,*) 'Coordinates of macroblocs mesh (coorg):' - do j=0,nz - do i=0,nx + do j = 0,nz + do i = 0,nx write(15,*) num(i,j,nx),x(i,j)-xmin,z(i,j) enddo enddo @@ -650,7 +650,7 @@ program maille_non_struct_2 nelemabs,nelemperio write(15,*) 'Material sets (num 0 rho vp vs 0 0)' - do i=1,nbmodeles + do i = 1,nbmodeles write(15,*) i,0,rho(i),cp(i),cs(i),0,0 enddo @@ -658,11 +658,11 @@ program maille_non_struct_2 write(15,*) 'Arrays kmato and knods for each bloc:' imatnum = 1 - k=0 + k = 0 ! zone structuree dans le volume - do j=0,nz-8,4 - do i=0,nx-4,4 + do j = 0,nz-8,4 + do i = 0,nx-4,4 k = k + 1 write(15,*) k,imatnum,num(i,j,nx),num(i+4,j,nx),num(i+4,j+4,nx), & num(i,j+4,nx),num(i+2,j,nx),num(i+4,j+2,nx), & @@ -673,8 +673,8 @@ program maille_non_struct_2 if (k /= nspecvolume) stop 'number of elements is inconsistent in the volume' ! zone non structuree dans la couche Wz - j=nz-4 - do i=0,nx-8,8 + j = nz-4 + do i = 0,nx-8,8 ! element 1 du raccord k = k + 1 @@ -909,17 +909,17 @@ subroutine spline(x,y,n,yp1,ypn,y2) y2(1)=-0.5 u(1)=(3./(x(2)-x(1)))*((y(2)-y(1))/(x(2)-x(1))-yp1) - do i=2,n-1 + do i = 2,n-1 sig=(x(i)-x(i-1))/(x(i+1)-x(i-1)) p=sig*y2(i-1)+2. y2(i)=(sig-1.)/p u(i)=(6.*((y(i+1)-y(i))/(x(i+1)-x(i))-(y(i)-y(i-1)) & /(x(i)-x(i-1)))/(x(i+1)-x(i-1))-sig*u(i-1))/p enddo - qn=0.5 + qn = 0.5 un=(3./(x(n)-x(n-1)))*(ypn-(y(n)-y(n-1))/(x(n)-x(n-1))) y2(n)=(un-qn*u(n-1))/(qn*y2(n-1)+1.) - do k=n-1,1,-1 + do k = n-1,1,-1 y2(k)=y2(k)*y2(k+1)+u(k) enddo @@ -940,22 +940,22 @@ subroutine SPLINT(XA,YA,Y2A,N,X,Y) integer k,klo,khi double precision h,a,b - KLO=1 - KHI=N + KLO = 1 + KHI = N do while (KHI-KLO > 1) K=(KHI+KLO)/2 if (XA(K) > X) then - KHI=K + KHI = K ELSE - KLO=K + KLO = K endif enddo - H=XA(KHI)-XA(KLO) + H = XA(KHI)-XA(KLO) if (H == 0.d0) stop 'Bad input in spline evaluation' A=(XA(KHI)-X)/H B=(X-XA(KLO))/H - Y=A*YA(KLO)+B*YA(KHI)+((A**3-A)*Y2A(KLO)+ & + Y = A*YA(KLO)+B*YA(KHI)+((A**3-A)*Y2A(KLO)+ & (B**3-B)*Y2A(KHI))*(H**2)/6.d0 end subroutine SPLINT diff --git a/utils/infos/older_or_specific_versions_of_mesher/meshfem2D_non_struct_3.f90 b/utils/infos/older_or_specific_versions_of_mesher/meshfem2D_non_struct_3.f90 index ec91a1cad..890bac8ca 100644 --- a/utils/infos/older_or_specific_versions_of_mesher/meshfem2D_non_struct_3.f90 +++ b/utils/infos/older_or_specific_versions_of_mesher/meshfem2D_non_struct_3.f90 @@ -113,7 +113,7 @@ program maille_non_struct_3 4 format(a,l8) ! read the header - do i=1,10 + do i = 1,10 read(10,*) enddo @@ -215,7 +215,7 @@ program maille_non_struct_3 allocate(angle(nbsources)) allocate(factor(nbsources)) - do i=1,nbsources + do i = 1,nbsources read(10,*) read(10,1)junk,xs(i) read(10,1)junk,zs(i) @@ -289,7 +289,7 @@ program maille_non_struct_3 print *,'There are ',nrec,' receivers on a single line' xspacerec=(xfin-xdeb)/dble(nrec-1) zspacerec=(zfin-zdeb)/dble(nrec-1) - do i=1,nrec + do i = 1,nrec xrec(i) = xdeb + dble(i-1)*xspacerec zrec(i) = zdeb + dble(i-1)*zspacerec enddo @@ -300,13 +300,13 @@ program maille_non_struct_3 print *,'Second line contains ',nrec2,' receivers' xspacerec=(xfin-xdeb)/dble(nrec1-1) zspacerec=(zfin-zdeb)/dble(nrec1-1) - do i=1,nrec1 + do i = 1,nrec1 xrec(i) = xdeb + dble(i-1)*xspacerec zrec(i) = zdeb + dble(i-1)*zspacerec enddo xspacerec=(xfin2-xdeb2)/dble(nrec2-1) zspacerec=(zfin2-zdeb2)/dble(nrec2-1) - do i=1,nrec2 + do i = 1,nrec2 xrec(i+nrec1) = xdeb2 + dble(i-1)*xspacerec zrec(i+nrec1) = zdeb2 + dble(i-1)*zspacerec enddo @@ -367,7 +367,7 @@ program maille_non_struct_3 cp(:) = 0.d0 cs(:) = 0.d0 - do imodele=1,nbmodeles + do imodele = 1,nbmodeles read(10,*) i,icodematread,rhoread,cpread,csread,aniso3read,aniso4read if (i < 1 .or. i > nbmodeles) stop 'Wrong material set number' rho(i) = rhoread @@ -380,7 +380,7 @@ program maille_non_struct_3 print * print *, 'Nb de modeles de roche = ',nbmodeles print * - do i=1,nbmodeles + do i = 1,nbmodeles print *,'Modele #',i,' isotrope' print *,'rho,cp,cs = ',rho(i),cp(i),cs(i) enddo @@ -403,10 +403,10 @@ program maille_non_struct_3 allocate(top0(0:nx)) ! calcul des points regulierement espaces - do i=0,nx + do i = 0,nx psi(i) = i/dble(nx) enddo - do j=0,nz + do j = 0,nz eta(j) = j/dble(nz) enddo @@ -456,7 +456,7 @@ program maille_non_struct_3 allocate(ztopo(ntopo)) allocate(coefs_topo(ntopo)) - do i=1,ntopo + do i = 1,ntopo read(15,*) xtopo(i),ztopo(i) enddo close(15) @@ -487,7 +487,7 @@ program maille_non_struct_3 print * print *, 'Position (x,z) des ',nbsources,' sources' print * - do i=1,nbsources + do i = 1,nbsources ! DK DK DK Elf : position source donnee en profondeur par rapport a la topo zs(i) = spl(xs(i),xtopo,ztopo,coefs_topo,ntopo) - zs(i) @@ -500,7 +500,7 @@ program maille_non_struct_3 print * print *, 'Position (x,z) des ',nrec,' receivers' print * - do irec=1,nrec + do irec = 1,nrec ! DK DK DK Elf : distinguer les deux lignes de recepteurs if (irec <= nrec1) then @@ -513,13 +513,13 @@ program maille_non_struct_3 enddo !--- definition du maillage suivant X - do ix=0,nx + do ix = 0,nx absx(ix) = dens(ix,psi,xmin,xmax,nx) enddo ! *** une seule zone - do iz=0,nz + do iz = 0,nz ! DK DK DK densification sinusoidale ici en vertical valeta(iz) = eta(iz) + ratio * sin(3.14159265 * eta(iz)) @@ -531,14 +531,14 @@ program maille_non_struct_3 a01(iz) = valeta(iz) enddo - do ix=0,nx + do ix = 0,nx bot0(ix) = bottom(absx(ix)) top0(ix) = spl(absx(ix),xtopo,ztopo,coefs_topo,ntopo) enddo ! valeurs de x et y pour display domaine physique - do ix=0,nx - do iz=0,nz + do ix = 0,nx + do iz = 0,nz x(ix,iz) = absx(ix) z(ix,iz) = a00(iz)*bot0(ix) + a01(iz)*top0(ix) enddo @@ -624,20 +624,20 @@ program maille_non_struct_3 write(15,*) nbsources write(15,*) 'Collocated forces and/or pressure sources:' - do i=1,nbsources + do i = 1,nbsources write(15,*) itimetype(i),isource_type(i), & xs(i)-xmin ,zs(i), & f0(i),tshift_src(i),factor(i),angle(i),0 enddo write(15,*) 'Receivers positions:' - do irec=1,nrec + do irec = 1,nrec write(15,*) irec,xrec(irec)-xmin ,zrec(irec) enddo write(15,*) 'Coordinates of macroblocs mesh (coorg):' - do j=0,nz - do i=0,nx + do j = 0,nz + do i = 0,nx write(15,*) num(i,j,nx),x(i,j)-xmin,z(i,j) enddo enddo @@ -650,7 +650,7 @@ program maille_non_struct_3 nelemabs,nelemperio write(15,*) 'Material sets (num 0 rho vp vs 0 0)' - do i=1,nbmodeles + do i = 1,nbmodeles write(15,*) i,0,rho(i),cp(i),cs(i),0,0 enddo @@ -658,11 +658,11 @@ program maille_non_struct_3 write(15,*) 'Arrays kmato and knods for each bloc:' imatnum = 1 - k=0 + k = 0 ! zone structuree dans le volume - do j=0,nz-12,6 - do i=0,nx-6,6 + do j = 0,nz-12,6 + do i = 0,nx-6,6 k = k + 1 write(15,*) k,imatnum,num(i,j,nx),num(i+6,j,nx),num(i+6,j+6,nx), & num(i,j+6,nx),num(i+3,j,nx),num(i+6,j+3,nx), & @@ -673,8 +673,8 @@ program maille_non_struct_3 if (k /= nspecvolume) stop 'number of elements is inconsistent in the volume' ! zone non structuree dans la couche Wz - j=nz-6 - do i=0,nx-12,12 + j = nz-6 + do i = 0,nx-12,12 ! element 1 du raccord k = k + 1 @@ -933,17 +933,17 @@ subroutine spline(x,y,n,yp1,ypn,y2) y2(1)=-0.5 u(1)=(3./(x(2)-x(1)))*((y(2)-y(1))/(x(2)-x(1))-yp1) - do i=2,n-1 + do i = 2,n-1 sig=(x(i)-x(i-1))/(x(i+1)-x(i-1)) p=sig*y2(i-1)+2. y2(i)=(sig-1.)/p u(i)=(6.*((y(i+1)-y(i))/(x(i+1)-x(i))-(y(i)-y(i-1)) & /(x(i)-x(i-1)))/(x(i+1)-x(i-1))-sig*u(i-1))/p enddo - qn=0.5 + qn = 0.5 un=(3./(x(n)-x(n-1)))*(ypn-(y(n)-y(n-1))/(x(n)-x(n-1))) y2(n)=(un-qn*u(n-1))/(qn*y2(n-1)+1.) - do k=n-1,1,-1 + do k = n-1,1,-1 y2(k)=y2(k)*y2(k+1)+u(k) enddo @@ -964,22 +964,22 @@ subroutine SPLINT(XA,YA,Y2A,N,X,Y) integer k,klo,khi double precision h,a,b - KLO=1 - KHI=N + KLO = 1 + KHI = N do while (KHI-KLO > 1) K=(KHI+KLO)/2 if (XA(K) > X) then - KHI=K + KHI = K ELSE - KLO=K + KLO = K endif enddo - H=XA(KHI)-XA(KLO) + H = XA(KHI)-XA(KLO) if (H == 0.d0) stop 'Bad input in spline evaluation' A=(XA(KHI)-X)/H B=(X-XA(KLO))/H - Y=A*YA(KLO)+B*YA(KHI)+((A**3-A)*Y2A(KLO)+ (B**3-B)*Y2A(KHI))*(H**2)/6.d0 + Y = A*YA(KLO)+B*YA(KHI)+((A**3-A)*Y2A(KLO)+ (B**3-B)*Y2A(KHI))*(H**2)/6.d0 end subroutine SPLINT diff --git a/utils/small_utilities/Ra_Cleave_record_pressure_in_addition_to_displacement/save_databases_Ra_Cleave.f90 b/utils/small_utilities/Ra_Cleave_record_pressure_in_addition_to_displacement/save_databases_Ra_Cleave.f90 index ccf237d7d..5cdac6b6a 100644 --- a/utils/small_utilities/Ra_Cleave_record_pressure_in_addition_to_displacement/save_databases_Ra_Cleave.f90 +++ b/utils/small_utilities/Ra_Cleave_record_pressure_in_addition_to_displacement/save_databases_Ra_Cleave.f90 @@ -204,7 +204,7 @@ subroutine save_databases(nspec,num_material,region_pml_external_mesh, & write(15,*) 'NSOURCES' write(15,*) NSOURCES - do i_source=1,NSOURCES + do i_source = 1,NSOURCES write(15,*) 'source', i_source write(15,*) source_type(i_source),time_function_type(i_source), & xs(i_source),zs(i_source),f0_source(i_source),tshift_src(i_source), & @@ -251,7 +251,7 @@ subroutine save_databases(nspec,num_material,region_pml_external_mesh, & write(15,*) 'Material sets (num 1 rho vp vs 0 0 QKappa Qmu 0 0 0 0 0 0) or ' write(15,*) '(num 2 rho c11 c13 c33 c44 QKappa Qmu 0 0 0 0 0 0) or ' write(15,*) '(num 3 rhos rhof phi c k_xx k_xz k_zz Ks Kf Kfr etaf mufr Qmu)' - do i=1,nb_materials + do i = 1,nb_materials if (icodemat(i) == ISOTROPIC_MATERIAL) then write(15,*) i,icodemat(i),rho_s(i),cp(i),cs(i),0,0,QKappa(i),Qmu(i),0,0,0,0,0,0 else if (icodemat(i) == POROELASTIC_MATERIAL) then diff --git a/utils/small_utilities/decimate_mesh.f90 b/utils/small_utilities/decimate_mesh.f90 index dc115f32b..58ba555d1 100644 --- a/utils/small_utilities/decimate_mesh.f90 +++ b/utils/small_utilities/decimate_mesh.f90 @@ -7,12 +7,12 @@ program subdivide_mesh ! Number of nodes per elements. integer, parameter :: ESIZE = 4 ! Max number of neighbors per elements. - integer,parameter :: max_neighbor=30 + integer,parameter :: max_neighbor = 30 ! Max number of elements that can contain the same node. - integer, parameter :: nsize=20 + integer, parameter :: nsize = 20 - integer, parameter :: NSUB=2 + integer, parameter :: NSUB = 2 integer :: nspec integer, dimension(:,:), allocatable :: elmnts @@ -72,7 +72,7 @@ program subdivide_mesh ! set up local geometric tolerances xtypdist=+HUGEVAL - do ispec=1,nspec + do ispec = 1,nspec xminval=+HUGEVAL yminval=+HUGEVAL @@ -80,10 +80,10 @@ program subdivide_mesh ymaxval=-HUGEVAL do inode = 1, 4 - xmaxval=max(nodes_coords(1,elmnts(inode,ispec)),xmaxval) - xminval=min(nodes_coords(1,elmnts(inode,ispec)),xminval) - ymaxval=max(nodes_coords(2,elmnts(inode,ispec)),ymaxval) - yminval=min(nodes_coords(2,elmnts(inode,ispec)),yminval) + xmaxval = max(nodes_coords(1,elmnts(inode,ispec)),xmaxval) + xminval = min(nodes_coords(1,elmnts(inode,ispec)),xminval) + ymaxval = max(nodes_coords(2,elmnts(inode,ispec)),ymaxval) + yminval = min(nodes_coords(2,elmnts(inode,ispec)),yminval) enddo ! compute the minimum typical "size" of an element in the mesh @@ -93,7 +93,7 @@ program subdivide_mesh enddo ! define a tolerance, small with respect to the minimum size - xtol=smallvaltol*xtypdist + xtol = smallvaltol*xtypdist print *, 'facteur de tolerance XTOL = ', xtol @@ -260,9 +260,9 @@ subroutine mesh2dual_ncommonnodes(nelmnts, nnodes, elmnts, xadj, adjncy, nnodes_ ! Number of nodes per elements. integer, parameter :: ESIZE = 4 ! Max number of neighbors per elements. - integer,parameter :: max_neighbor=30 + integer,parameter :: max_neighbor = 30 ! Max number of elements that can contain the same node. - integer, parameter :: nsize=20 + integer, parameter :: nsize = 20 integer, intent(in) :: nelmnts diff --git a/utils/small_utilities/filter_input_trace.f90 b/utils/small_utilities/filter_input_trace.f90 index 826f07f72..42ae3fa31 100644 --- a/utils/small_utilities/filter_input_trace.f90 +++ b/utils/small_utilities/filter_input_trace.f90 @@ -149,7 +149,7 @@ program filter_input_trace filesToFilter(i) = adjustl(trim(name)) ! assign a value to filesToFilter(i) inquire(file=filesToFilter(i),exist=fileExist) ! check if the file exists if (.not. fileExist) then - write(*,*)'File ',adjustl(trim(filesToFilter(i))),' not found.' + write(*,*) 'File ',adjustl(trim(filesToFilter(i))),' not found.' write(*,*) "Nothing has been done!" stop endif @@ -329,7 +329,7 @@ subroutine rekurs(x,y,ndat,a,b1,b2,npoles,iflag) do i = 2, npoles z(i) = a(i)*(z(i-1)-z2(i-1))-b1(i)*z1(i)-b2(i)*z2(i) enddo - x2=x1 + x2 = x1 x1=x(n) do i = 1, npoles z2(i) =z1(i) @@ -354,10 +354,10 @@ subroutine rekurs(x,y,ndat,a,b1,b2,npoles,iflag) do n = ndat, 1, -1 z(1) = a(1)*(y(n)-x2)-b1(1)*z1(1)-b2(1)*z2(1) - do i =2, npoles + do i = 2, npoles z(i) = a(i)*(z(i-1)-z2(i-1))-b1(i)*z1(i)-b2(i)*z2(i) enddo - x2=x1 + x2 = x1 x1=y(n) do i = 1,npoles z2(i)=z1(i) @@ -393,23 +393,23 @@ subroutine bpcoeff(f1,f2,npoles,dt,a,b1,b2) w2=d2*tan(2.d0*pi*f2/d2) w0=0.5*(w2-w1) - i=1 - npol2=npoles/2+1 - do n =1,npoles + i = 1 + npol2 = npoles/2+1 + do n = 1,npoles p = cexp(cmplx(0.d0,dble(2*n-1+npoles)*pi/dble(2*npoles))) t1 = p*cmplx(w0,0.d0) t2 = sqrt(t1*t1-cmplx(w1*w2,0.d0)) s(i)=t1+t2 s(i+1)=t1-t2 - i=i+2 + i = i+2 enddo - do n=1,npoles - ssum=2*real(s(n)) - sprod=dble(s(n)*conjg(s(n))) - fact1=d2*d2-d2*ssum+sprod + do n = 1,npoles + ssum = 2*real(s(n)) + sprod = dble(s(n)*conjg(s(n))) + fact1 = d2*d2-d2*ssum+sprod fact2=2.d0*(sprod-d2*d2) - fact3=d2*d2+d2*ssum+sprod + fact3 = d2*d2+d2*ssum+sprod a(n)=2.d0*d2*w0/fact1 b1(n)=fact2/fact1 b2(n)=fact3/fact1 diff --git a/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/compute_gradient_of_a_field_with_the_SEM_Earth.f90 b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/compute_gradient_of_a_field_with_the_SEM_Earth.f90 index dbdad380d..9a49b8338 100644 --- a/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/compute_gradient_of_a_field_with_the_SEM_Earth.f90 +++ b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/compute_gradient_of_a_field_with_the_SEM_Earth.f90 @@ -292,9 +292,9 @@ program compute_gradient ! for the simple geometry that we use area = ZERO do ispec = 1,nspec - do i=1,NGLLX - do j=1,NGLLZ - weight=wxgll(i)*wzgll(j) + do i = 1,NGLLX + do j = 1,NGLLZ + weight = wxgll(i)*wzgll(j) area = area + jacobian(i,j,ispec)*weight enddo enddo diff --git a/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/compute_gradient_of_a_field_with_the_SEM_rectangle.f90 b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/compute_gradient_of_a_field_with_the_SEM_rectangle.f90 index 50e184d5a..29ac483ee 100644 --- a/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/compute_gradient_of_a_field_with_the_SEM_rectangle.f90 +++ b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/compute_gradient_of_a_field_with_the_SEM_rectangle.f90 @@ -272,9 +272,9 @@ program compute_gradient ! for the simple geometry that we use area = ZERO do ispec = 1,nspec - do i=1,NGLLX - do j=1,NGLLZ - weight=wxgll(i)*wzgll(j) + do i = 1,NGLLX + do j = 1,NGLLZ + weight = wxgll(i)*wzgll(j) area = area + jacobian(i,j,ispec)*weight enddo enddo diff --git a/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/define_derivation_matrices.f90 b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/define_derivation_matrices.f90 index 3fa6a3180..e1618ac3d 100644 --- a/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/define_derivation_matrices.f90 +++ b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/define_derivation_matrices.f90 @@ -67,14 +67,14 @@ subroutine define_derivation_matrices(xigll,zigll,wxgll,wzgll,hprime_xx,hprime_z ! calculate derivatives of the Lagrange polynomials ! and precalculate some products in double precision ! hprime(i,j) = h'_j(xigll_i) by definition of the derivation matrix - do i1=1,NGLLX - do i2=1,NGLLX + do i1 = 1,NGLLX + do i2 = 1,NGLLX hprime_xx(i2,i1) = lagrange_deriv_GLL(i1-1,i2-1,xigll,NGLLX) enddo enddo - do k1=1,NGLLZ - do k2=1,NGLLZ + do k1 = 1,NGLLZ + do k2 = 1,NGLLZ hprime_zz(k2,k1) = lagrange_deriv_GLL(k1-1,k2-1,zigll,NGLLZ) enddo enddo diff --git a/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/gll_library.f90 b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/gll_library.f90 index 45c90cfc7..b57dcf90f 100644 --- a/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/gll_library.f90 +++ b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/gll_library.f90 @@ -14,7 +14,7 @@ double precision function endw1(n,alpha,beta) integer n double precision alpha,beta - double precision, parameter :: zero=0.d0,one=1.d0,two=2.d0,three=3.d0,four=4.d0 + double precision, parameter :: zero = 0.d0,one = 1.d0,two = 2.d0,three = 3.d0,four = 4.d0 double precision apb,f1,fint1,fint2,f2,di,abn,abnn,a1,a2,a3,f3 double precision, external :: gammaf integer i @@ -40,7 +40,7 @@ double precision function endw1(n,alpha,beta) endw1 = f2 return endif - do i=3,n + do i = 3,n di = dble(i-1) abn = alpha+beta+di abnn = abn+di @@ -66,7 +66,7 @@ double precision function endw2(n,alpha,beta) integer n double precision alpha,beta - double precision, parameter :: zero=0.d0,one=1.d0,two=2.d0,three=3.d0,four=4.d0 + double precision, parameter :: zero = 0.d0,one = 1.d0,two = 2.d0,three = 3.d0,four = 4.d0 double precision apb,f1,fint1,fint2,f2,di,abn,abnn,a1,a2,a3,f3 double precision, external :: gammaf integer i @@ -92,7 +92,7 @@ double precision function endw2(n,alpha,beta) endw2 = f2 return endif - do i=3,n + do i = 3,n di = dble(i-1) abn = alpha+beta+di abnn = abn+di @@ -119,7 +119,7 @@ double precision function gammaf (x) double precision x - double precision, parameter :: half=0.5d0,one=1.d0,two=2.d0 + double precision, parameter :: half = 0.5d0,one = 1.d0,two = 2.d0 gammaf = one @@ -177,7 +177,7 @@ subroutine jacg (xjac,np,alpha,beta) p = 0.d0 pd = 0.d0 jmin = 0 - do j=1,np + do j = 1,np if (j == 1) then x = cos((2.d0*(dble(j)-1.d0)+1.d0)*dth) else @@ -185,11 +185,11 @@ subroutine jacg (xjac,np,alpha,beta) x2 = xlast x = (x1+x2)/2.d0 endif - do k=1,K_MAX_ITER + do k = 1,K_MAX_ITER call jacobf (p,pd,pm1,pdm1,pm2,pdm2,np,alpha,beta,x) recsum = 0.d0 jm = j-1 - do i=1,jm + do i = 1,jm recsum = recsum+1.d0/(x-xjac(np-i+1)) enddo delx = -p/(pd-recsum*p) @@ -200,9 +200,9 @@ subroutine jacg (xjac,np,alpha,beta) xjac(np-j+1) = x xlast = x enddo - do i=1,np + do i = 1,np xmin = 2.d0 - do j=i,np + do j = i,np if (xjac(j) < xmin) then xmin = xjac(j) jmin = j @@ -251,7 +251,7 @@ subroutine jacobf (poly,pder,polym1,pderm1,polym2,pderm2,n,alp,bet,x) pder = (apb+2.d0)/2.d0 if (n == 1) return - do k=2,n + do k = 2,n dk = dble(k) a1 = 2.d0*dk*(dk+apb)*(2.d0*dk+apb-2.d0) a2 = (2.d0*dk+apb-1.d0)*(alp**2-bet**2) @@ -410,7 +410,7 @@ double precision function pnormj (n,alpha,beta) prod = prod*(one+alpha)*(two+alpha) prod = prod*(one+beta)*(two+beta) - do i=3,n + do i = 3,n dindx = dble(i) frac = (dindx+alpha)*(dindx+beta)/(dindx*(dindx+alpha+beta)) prod = prod*frac @@ -482,7 +482,7 @@ subroutine zwgjd_cr(z,w,np,alpha,beta) fac3 = fac2+one fnorm = pnormj(np1,alpha,beta) rcoef = (fnorm*fac2*fac3)/(two*fac1*dnp2) - do i=1,np + do i = 1,np call jacobf(p,pd,pm1,pdm1,pm2,pdm2,np2,alpha,beta,z(i)) w(i) = -rcoef/(p*pdm1) enddo @@ -549,7 +549,7 @@ subroutine zwgljd_cr(z,w,np,alpha,beta) z(1) = - one z(np) = one - do i=2,np-1 + do i = 2,np-1 w(i) = w(i)/(one-z(i)**2) enddo diff --git a/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/lagrange_poly.f90 b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/lagrange_poly.f90 index bf364189d..7e86e58f1 100644 --- a/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/lagrange_poly.f90 +++ b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/lagrange_poly.f90 @@ -79,11 +79,11 @@ subroutine lagrange_any(xi,NGLL,xigll,h,hprime) integer dgr,i,j double precision prod1,prod2 - do dgr=1,NGLL + do dgr = 1,NGLL prod1 = 1.0d0 prod2 = 1.0d0 - do i=1,NGLL + do i = 1,NGLL if (i /= dgr) then prod1 = prod1*(xi-xigll(i)) prod2 = prod2*(xigll(dgr)-xigll(i)) @@ -92,10 +92,10 @@ subroutine lagrange_any(xi,NGLL,xigll,h,hprime) h(dgr)=prod1/prod2 hprime(dgr)=0.0d0 - do i=1,NGLL + do i = 1,NGLL if (i /= dgr) then - prod1=1.0d0 - do j=1,NGLL + prod1 = 1.0d0 + do j = 1,NGLL if (j /= dgr .and. j /= i) prod1 = prod1*(xi-xigll(j)) enddo hprime(dgr) = hprime(dgr)+prod1 diff --git a/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/recompute_jacobian.f90 b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/recompute_jacobian.f90 index 252b8d49d..39ca01aac 100644 --- a/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/recompute_jacobian.f90 +++ b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/recompute_jacobian.f90 @@ -68,7 +68,7 @@ subroutine recompute_jacobian(xi,gamma,x,z,xix,xiz,gammax,gammaz,jacobian,coord_ xgamma = ZERO zgamma = ZERO - do ia=1,ngnod + do ia = 1,ngnod xelm = coord_of_anchor_points(1,ia,ispec) zelm = coord_of_anchor_points(2,ia,ispec) diff --git a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/create_color_image.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/create_color_image.f90 index 146750927..4e7cfcd1b 100644 --- a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/create_color_image.f90 +++ b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/create_color_image.f90 @@ -121,7 +121,7 @@ subroutine create_color_image(it,NSOURCES,nrec,NX_IMAGE_color,NZ_IMAGE_color,isn enddo ! in the image format, the image starts in the upper-left corner - do iy=NZ_IMAGE_color,1,-1 + do iy = NZ_IMAGE_color,1,-1 do ix= 1,NX_IMAGE_color ! check if pixel is defined or not (can be above topography for instance) diff --git a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/createnum_slow.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/createnum_slow.f90 index 7b4d326e0..9ca9f60c3 100644 --- a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/createnum_slow.f90 +++ b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/createnum_slow.f90 @@ -83,8 +83,8 @@ subroutine createnum_slow(knods,ibool,nglob,nspec,NGLLX,NGLLZ,ngnod) ibool(:,:,:) = 0 do numelem = 1,nspec - do i=1,NGLLX - do j=1,NGLLZ + do i = 1,NGLLX + do j = 1,NGLLZ ! verifier que le point n'a pas deja ete genere @@ -121,10 +121,10 @@ subroutine createnum_slow(knods,ibool,nglob,nspec,NGLLX,NGLLZ,ngnod) if (numelem > 1) then - do num2=1,numelem-1 + do num2 = 1,numelem-1 ! ne rechercher que sur les 4 premiers points de controle et non sur ngnod - do ngnodother=1,4 + do ngnodother = 1,4 ! voir si ce coin a deja ete genere if (knods(ngnodother,num2) == knods(ngnodloc,numelem)) then @@ -190,10 +190,10 @@ subroutine createnum_slow(knods,ibool,nglob,nspec,NGLLX,NGLLZ,ngnod) if (numelem > 1) then - do num2=1,numelem-1 + do num2 = 1,numelem-1 ! rechercher sur les 4 aretes - do nedgeother=1,4 + do nedgeother = 1,4 !--- detecter un eventuel defaut dans la structure topologique du maillage diff --git a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/define_derivation_matrices.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/define_derivation_matrices.f90 index 5eff11143..d16de2ab2 100644 --- a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/define_derivation_matrices.f90 +++ b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/define_derivation_matrices.f90 @@ -88,7 +88,7 @@ subroutine define_GLJ_derivation_matrix(xiglj,wxglj,hprimeBar_xx,hprimeBarwglj_x implicit none - double precision, parameter :: alphaGLJ=0.d0,betaGLJ=1.d0 + double precision, parameter :: alphaGLJ = 0.d0,betaGLJ = 1.d0 integer :: NGLJ @@ -107,8 +107,8 @@ subroutine define_GLJ_derivation_matrix(xiglj,wxglj,hprimeBar_xx,hprimeBarwglj_x ! calculate derivatives of the GLJ quadrature polynomials ! and precalculate some products in double precision ! hprimeBar(i,j) = hBar'_j(xiglj_i) by definition of the derivation matrix - do i1=1,NGLJ - do i2=1,NGLJ + do i1 = 1,NGLJ + do i2 = 1,NGLJ hprimeBar_xx(i2,i1) = poly_deriv_GLJ(i1-1,i2-1,xiglj,NGLJ) hprimeBarwglj_xx(i2,i1) = wxglj(i2) * hprimeBar_xx(i2,i1) enddo diff --git a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/gll_library.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/gll_library.f90 index 842a9890f..02204f058 100644 --- a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/gll_library.f90 +++ b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/gll_library.f90 @@ -14,7 +14,7 @@ double precision function endw1(n,alpha,beta) integer n double precision alpha,beta - double precision, parameter :: zero=0.d0,one=1.d0,two=2.d0,three=3.d0,four=4.d0 + double precision, parameter :: zero = 0.d0,one = 1.d0,two = 2.d0,three = 3.d0,four = 4.d0 double precision apb,f1,fint1,fint2,f2,di,abn,abnn,a1,a2,a3,f3 double precision, external :: gammaf integer i @@ -40,7 +40,7 @@ double precision function endw1(n,alpha,beta) endw1 = f2 return endif - do i=3,n + do i = 3,n di = dble(i-1) abn = alpha+beta+di abnn = abn+di @@ -66,7 +66,7 @@ double precision function endw2(n,alpha,beta) integer n double precision alpha,beta - double precision, parameter :: zero=0.d0,one=1.d0,two=2.d0,three=3.d0,four=4.d0 + double precision, parameter :: zero = 0.d0,one = 1.d0,two = 2.d0,three = 3.d0,four = 4.d0 double precision apb,f1,fint1,fint2,f2,di,abn,abnn,a1,a2,a3,f3 double precision, external :: gammaf integer i @@ -92,7 +92,7 @@ double precision function endw2(n,alpha,beta) endw2 = f2 return endif - do i=3,n + do i = 3,n di = dble(i-1) abn = alpha+beta+di abnn = abn+di @@ -119,7 +119,7 @@ double precision function gammaf (x) double precision x - double precision, parameter :: half=0.5d0,one=1.d0,two=2.d0 + double precision, parameter :: half = 0.5d0,one = 1.d0,two = 2.d0 gammaf = one @@ -177,7 +177,7 @@ subroutine jacg (xjac,np,alpha,beta) p = 0.d0 pd = 0.d0 jmin = 0 - do j=1,np + do j = 1,np if (j == 1) then x = cos((2.d0*(dble(j)-1.d0)+1.d0)*dth) else @@ -185,11 +185,11 @@ subroutine jacg (xjac,np,alpha,beta) x2 = xlast x = (x1+x2)/2.d0 endif - do k=1,K_MAX_ITER + do k = 1,K_MAX_ITER call jacobf (p,pd,pm1,pdm1,pm2,pdm2,np,alpha,beta,x) recsum = 0.d0 jm = j-1 - do i=1,jm + do i = 1,jm recsum = recsum+1.d0/(x-xjac(np-i+1)) enddo delx = -p/(pd-recsum*p) @@ -200,9 +200,9 @@ subroutine jacg (xjac,np,alpha,beta) xjac(np-j+1) = x xlast = x enddo - do i=1,np + do i = 1,np xmin = 2.d0 - do j=i,np + do j = i,np if (xjac(j) < xmin) then xmin = xjac(j) jmin = j @@ -251,7 +251,7 @@ subroutine jacobf (poly,pder,polym1,pderm1,polym2,pderm2,n,alp,bet,x) pder = (apb+2.d0)/2.d0 if (n == 1) return - do k=2,n + do k = 2,n dk = dble(k) a1 = 2.d0*dk*(dk+apb)*(2.d0*dk+apb-2.d0) a2 = (2.d0*dk+apb-1.d0)*(alp**2-bet**2) @@ -450,7 +450,7 @@ double precision function pnormj (n,alpha,beta) prod = prod*(one+alpha)*(two+alpha) prod = prod*(one+beta)*(two+beta) - do i=3,n + do i = 3,n dindx = dble(i) frac = (dindx+alpha)*(dindx+beta)/(dindx*(dindx+alpha+beta)) prod = prod*frac @@ -523,7 +523,7 @@ subroutine zwgjd(z,w,np,alpha,beta) fac3 = fac2+one fnorm = pnormj(np1,alpha,beta) rcoef = (fnorm*fac2*fac3)/(two*fac1*dnp2) - do i=1,np + do i = 1,np call jacobf(p,pd,pm1,pdm1,pm2,pdm2,np2,alpha,beta,z(i)) w(i) = -rcoef/(p*pdm1) enddo @@ -590,7 +590,7 @@ subroutine zwgljd(z,w,np,alpha,beta) z(1) = - one z(np) = one - do i=2,np-1 + do i = 2,np-1 w(i) = w(i)/(one-z(i)**2) enddo diff --git a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/lagrange_poly.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/lagrange_poly.f90 index bfd796a7a..ddd48d93a 100644 --- a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/lagrange_poly.f90 +++ b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/lagrange_poly.f90 @@ -114,11 +114,11 @@ subroutine lagrange_any(xi,NGLL,xigll,h,hprime) integer dgr,i,j double precision prod1,prod2 - do dgr=1,NGLL + do dgr = 1,NGLL prod1 = 1.0d0 prod2 = 1.0d0 - do i=1,NGLL + do i = 1,NGLL if (i /= dgr) then prod1 = prod1*(xi-xigll(i)) prod2 = prod2*(xigll(dgr)-xigll(i)) @@ -127,10 +127,10 @@ subroutine lagrange_any(xi,NGLL,xigll,h,hprime) h(dgr)=prod1/prod2 hprime(dgr)=0.0d0 - do i=1,NGLL + do i = 1,NGLL if (i /= dgr) then - prod1=1.0d0 - do j=1,NGLL + prod1 = 1.0d0 + do j = 1,NGLL if (j /= dgr .and. j /= i) prod1 = prod1*(xi-xigll(j)) enddo hprime(dgr) = hprime(dgr)+prod1 diff --git a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post.f90 index f2c897872..b72160afc 100644 --- a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post.f90 +++ b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post.f90 @@ -274,7 +274,7 @@ subroutine plot_post(displ,coord,ibool,NGLOB,NSPEC,x_source,z_source,x_receiver, write(24,*) '% spectral element mesh' write(24,*) '%' - do ispec=1,NSPEC + do ispec = 1,NSPEC write(24,*) '% elem ',ispec @@ -289,31 +289,31 @@ subroutine plot_post(displ,coord,ibool,NGLOB,NSPEC,x_source,z_source,x_receiver, ! draw straight lines for the element edges (if drawing curved elements with 9 nodes, they will thus appear with no curvature) - ir=NGLLX + ir = NGLLX x2 = (coord(1,ibool(ir,is,ispec))-xmin)*ratio_page + orig_x z2 = (coord(2,ibool(ir,is,ispec))-zmin)*ratio_page + orig_z x2 = x2 * centim z2 = z2 * centim write(24,681) x2,z2 - ir=NGLLX - is=NGLLZ + ir = NGLLX + is = NGLLZ x2 = (coord(1,ibool(ir,is,ispec))-xmin)*ratio_page + orig_x z2 = (coord(2,ibool(ir,is,ispec))-zmin)*ratio_page + orig_z x2 = x2 * centim z2 = z2 * centim write(24,681) x2,z2 - is=NGLLZ - ir=1 + is = NGLLZ + ir = 1 x2 = (coord(1,ibool(ir,is,ispec))-xmin)*ratio_page + orig_x z2 = (coord(2,ibool(ir,is,ispec))-zmin)*ratio_page + orig_z x2 = x2 * centim z2 = z2 * centim write(24,681) x2,z2 - ir=1 - is=2 + ir = 1 + is = 2 x2 = (coord(1,ibool(ir,is,ispec))-xmin)*ratio_page + orig_x z2 = (coord(2,ibool(ir,is,ispec))-zmin)*ratio_page + orig_z x2 = x2 * centim @@ -342,7 +342,7 @@ subroutine plot_post(displ,coord,ibool,NGLOB,NSPEC,x_source,z_source,x_receiver, write(24,*) '0 setgray' ! draw the vectors at all the GLL nodes of the mesh - do ipoin=1,NGLOB + do ipoin = 1,NGLOB x1 =(coord(1,ipoin)-xmin)*ratio_page z1 =(coord(2,ipoin)-zmin)*ratio_page diff --git a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post_with_ITZ_for_Ting.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post_with_ITZ_for_Ting.f90 index 9dcda8e70..20d545778 100644 --- a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post_with_ITZ_for_Ting.f90 +++ b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post_with_ITZ_for_Ting.f90 @@ -278,7 +278,7 @@ subroutine plot_post(displ,coord,ibool,NGLOB,NSPEC,x_source,z_source,x_receiver, write(24,*) '% spectral element mesh' write(24,*) '%' - do ispec=1,NSPEC + do ispec = 1,NSPEC write(24,*) '% elem ',ispec @@ -293,31 +293,31 @@ subroutine plot_post(displ,coord,ibool,NGLOB,NSPEC,x_source,z_source,x_receiver, ! draw straight lines for the element edges (if drawing curved elements with 9 nodes, they will thus appear with no curvature) - ir=NGLLX + ir = NGLLX x2 = (coord(1,ibool(ir,is,ispec))-xmin)*ratio_page + orig_x z2 = (coord(2,ibool(ir,is,ispec))-zmin)*ratio_page + orig_z x2 = x2 * centim z2 = z2 * centim write(24,681) x2,z2 - ir=NGLLX - is=NGLLZ + ir = NGLLX + is = NGLLZ x2 = (coord(1,ibool(ir,is,ispec))-xmin)*ratio_page + orig_x z2 = (coord(2,ibool(ir,is,ispec))-zmin)*ratio_page + orig_z x2 = x2 * centim z2 = z2 * centim write(24,681) x2,z2 - is=NGLLZ - ir=1 + is = NGLLZ + ir = 1 x2 = (coord(1,ibool(ir,is,ispec))-xmin)*ratio_page + orig_x z2 = (coord(2,ibool(ir,is,ispec))-zmin)*ratio_page + orig_z x2 = x2 * centim z2 = z2 * centim write(24,681) x2,z2 - ir=1 - is=2 + ir = 1 + is = 2 x2 = (coord(1,ibool(ir,is,ispec))-xmin)*ratio_page + orig_x z2 = (coord(2,ibool(ir,is,ispec))-zmin)*ratio_page + orig_z x2 = x2 * centim @@ -354,7 +354,7 @@ subroutine plot_post(displ,coord,ibool,NGLOB,NSPEC,x_source,z_source,x_receiver, write(24,*) '0 setgray' ! draw the vectors at all the GLL nodes of the mesh - do ipoin=1,NGLOB + do ipoin = 1,NGLOB x1 =(coord(1,ipoin)-xmin)*ratio_page z1 =(coord(2,ipoin)-zmin)*ratio_page diff --git a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post_with_modif_KH.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post_with_modif_KH.f90 index c3b2f3d14..95f31220b 100644 --- a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post_with_modif_KH.f90 +++ b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post_with_modif_KH.f90 @@ -281,7 +281,7 @@ subroutine plot_post(displ,coord,ibool,NGLOB,NSPEC,x_source,z_source,x_receiver, write(24,*) '% spectral element mesh' write(24,*) '%' - do ispec=1,NSPEC + do ispec = 1,NSPEC write(24,*) '% elem ',ispec @@ -296,31 +296,31 @@ subroutine plot_post(displ,coord,ibool,NGLOB,NSPEC,x_source,z_source,x_receiver, ! draw straight lines for the element edges (if drawing curved elements with 9 nodes, they will thus appear with no curvature) - ir=NGLLX + ir = NGLLX x2 = (coord(1,ibool(ir,is,ispec))-xmin)*ratio_page + orig_x z2 = (coord(2,ibool(ir,is,ispec))-zmin)*ratio_page + orig_z x2 = x2 * centim z2 = z2 * centim write(24,681) x2,z2 - ir=NGLLX - is=NGLLZ + ir = NGLLX + is = NGLLZ x2 = (coord(1,ibool(ir,is,ispec))-xmin)*ratio_page + orig_x z2 = (coord(2,ibool(ir,is,ispec))-zmin)*ratio_page + orig_z x2 = x2 * centim z2 = z2 * centim write(24,681) x2,z2 - is=NGLLZ - ir=1 + is = NGLLZ + ir = 1 x2 = (coord(1,ibool(ir,is,ispec))-xmin)*ratio_page + orig_x z2 = (coord(2,ibool(ir,is,ispec))-zmin)*ratio_page + orig_z x2 = x2 * centim z2 = z2 * centim write(24,681) x2,z2 - ir=1 - is=2 + ir = 1 + is = 2 x2 = (coord(1,ibool(ir,is,ispec))-xmin)*ratio_page + orig_x z2 = (coord(2,ibool(ir,is,ispec))-zmin)*ratio_page + orig_z x2 = x2 * centim @@ -344,7 +344,7 @@ subroutine plot_post(displ,coord,ibool,NGLOB,NSPEC,x_source,z_source,x_receiver, write(24,*) '0.05 CM setlinewidth' - do ispec=1,NSPEC + do ispec = 1,NSPEC write(24,*) '% elem ',ispec @@ -450,7 +450,7 @@ subroutine plot_post(displ,coord,ibool,NGLOB,NSPEC,x_source,z_source,x_receiver, write(24,*) '0 setgray' ! draw the vectors at all the GLL nodes of the mesh - do ipoin=1,NGLOB + do ipoin = 1,NGLOB x1 =(coord(1,ipoin)-xmin)*ratio_page z1 =(coord(2,ipoin)-zmin)*ratio_page diff --git a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/recompute_jacobian.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/recompute_jacobian.f90 index 74fb348b3..ce3f82eb2 100644 --- a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/recompute_jacobian.f90 +++ b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/recompute_jacobian.f90 @@ -67,7 +67,7 @@ subroutine recompute_jacobian(xi,gamma,x,z,xix,xiz,gammax,gammaz,jacobian,coorg, xgamma = 0.d0 zgamma = 0.d0 - do ia=1,ngnod + do ia = 1,ngnod nnum = knods(ia,ispec) @@ -92,7 +92,7 @@ subroutine recompute_jacobian(xi,gamma,x,z,xix,xiz,gammax,gammaz,jacobian,coorg, ! print the coordinates of the mesh points of this element print *, 'ispec = ', ispec print *, 'ngnod = ', ngnod - do ia=1,ngnod + do ia = 1,ngnod nnum = knods(ia,ispec) xelm = coorg(1,nnum) zelm = coorg(2,nnum) diff --git a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_axisymmetric.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_axisymmetric.f90 index 1b729f971..fd707d73c 100644 --- a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_axisymmetric.f90 +++ b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_axisymmetric.f90 @@ -223,8 +223,8 @@ program serial_specfem2D ! create the knods array k = 0 - do j=0,nz-1 - do i=0,nx-1 + do j = 0,nz-1 + do i = 0,nx-1 k = k + 1 knods(1,k) = num(i,j,nx) knods(2,k) = num(i+1,j,nx) diff --git a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain.f90 index 748a7e8ad..46d21c80f 100644 --- a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain.f90 +++ b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain.f90 @@ -223,8 +223,8 @@ program serial_specfem2D ! create the knods array ispec = 0 - do j=0,nelem_z-1 - do i=0,nelem_x-1 + do j = 0,nelem_z-1 + do i = 0,nelem_x-1 ispec = ispec + 1 knods(1,ispec) = num(i,j,nelem_x) knods(2,ispec) = num(i+1,j,nelem_x) diff --git a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain_with_ITZ_for_Ting.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain_with_ITZ_for_Ting.f90 index 13449bf68..a69d50119 100644 --- a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain_with_ITZ_for_Ting.f90 +++ b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain_with_ITZ_for_Ting.f90 @@ -250,8 +250,8 @@ program serial_specfem2D ! create the knods array ispec = 0 - do j=0,nelem_z/2-1 - do i=0,nelem_x-1 + do j = 0,nelem_z/2-1 + do i = 0,nelem_x-1 ispec = ispec + 1 knods(1,ispec) = num(i,j,nelem_x) knods(2,ispec) = num(i+1,j,nelem_x) @@ -294,8 +294,8 @@ program serial_specfem2D enddo ! create the knods array - do j=0,nelem_z/2-1 - do i=0,nelem_x-1 + do j = 0,nelem_z/2-1 + do i = 0,nelem_x-1 ispec = ispec + 1 knods(1,ispec) = num(i,j,nelem_x) + value_to_add_to_knods knods(2,ispec) = num(i+1,j,nelem_x) + value_to_add_to_knods diff --git a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain_with_modif_KH.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain_with_modif_KH.f90 index 019c2f282..d06dc2b2b 100644 --- a/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain_with_modif_KH.f90 +++ b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain_with_modif_KH.f90 @@ -235,8 +235,8 @@ program serial_specfem2D ! create the knods array ispec = 0 - do j=0,nelem_z-1 - do i=0,nelem_x-1 + do j = 0,nelem_z-1 + do i = 0,nelem_x-1 ispec = ispec + 1 knods(1,ispec) = num(i,j,nelem_x) knods(2,ispec) = num(i+1,j,nelem_x) From 105b6bdf5294b35a4da341438adabdecaf71d359 Mon Sep 17 00:00:00 2001 From: Daniel Peter Date: Thu, 21 Mar 2024 17:37:41 +0100 Subject: [PATCH 4/6] adds cleaning script --- utils/scripts/clean_listings_specfem.py | 486 ++++++++++++++++++++++++ 1 file changed, 486 insertions(+) create mode 100755 utils/scripts/clean_listings_specfem.py diff --git a/utils/scripts/clean_listings_specfem.py b/utils/scripts/clean_listings_specfem.py new file mode 100755 index 000000000..8f2680b76 --- /dev/null +++ b/utils/scripts/clean_listings_specfem.py @@ -0,0 +1,486 @@ +#!/usr/bin/env python +# +# fortran source code cleaning script +# +from __future__ import print_function + +import sys +import os +import filecmp +import shutil +import re +import subprocess +import glob +import fnmatch + +############################################################################################ + +# shows a diff between original and new content (if any) +show_diff = True + +# replaces original with new content (if anything changed) +replace_file_content = False + +############################################################################################ + +# Define the list of file extensions to be processed for Fortran formatting +fortran_file_extensions = ['.fh', '.f90', '.F90', '.fh.in'] + +# Define the list of file extensions to be processed as general formatting +general_file_extensions = ['.bash', '.c', '.cpp','.csh','.cu','.h','.h.in','.pl','.tex','.txt','.sh','.rb', '.md'] + +# Define the list of directories to be excluded (these are mostly submodules included in the source repositories) +exclude_dirs = ['.git', 'm4', './utils/ADJOINT_TOMOGRAPHY_TOOLS/flexwin', './src/inverse_problem_for_source/pyCMT3D'] + +# Define the list of files to be excluded +exclude_files = ['*Par_file*'] + +# list of regex patterns to be replaced +patterns = [ + # suppress trailing white spaces and carriage return + (r'\s*$', ''), + # use new syntax of comparison operators, ignoring case in starting pattern (useful in case of mixed case) + (r'\.le\.', '<='), + (r'\.ge\.', '>='), + (r'\.lt\.', '<'), + (r'\.gt\.', '>'), + (r'\.ne\.', '/='), + (r'\.eq\.', '=='), + # switch to lowercase for comparison operators + (r'\.and\.', '.and.'), + (r'\.or\.', '.or.'), + (r'\.not\.', '.not.'), + (r'\.eqv\.', '.eqv.'), + (r'\.neqv\.', '.neqv.'), + (r'\.true\.', '.true.'), + (r'\.false\.', '.false.'), + # switch to Fortran2008 standard + (r'call\s*getarg\(', 'call get_command_argument('), + # constant strings + (r'endsubroutine', 'end subroutine'), + (r'if\s*\(', 'if ('), + (r'\)\s*then', ') then'), + (r'end\s*if', 'endif'), + (r'end\s*do', 'enddo'), + (r'else\s*if', 'else if'), + # force lowercase keywords + (r'subroutine', 'subroutine'), + (r'end\s*subroutine', 'end subroutine'), + (r'function', 'function'), + (r'end\s*function', 'end function'), + (r'continue', 'continue'), + (r'implicit none', 'implicit none'), + (r'implicit', 'implicit'), + (r'return', 'return'), + (r' go\s*to ', ' goto '), + (r'use\s*::\s*mpi', 'use mpi'), + (r',\s*only\s*:\s*', ', only: '), + (r'NOISE_SOURCE_TIME_FUNCTION_TYPE', 'noise_source_time_function_type'), + # do not move this before the above line in which we change the keyword "function" + (r'use_ricker_time_function', 'USE_RICKER_TIME_FUNCTION'), + (r'print_source_time_function', 'PRINT_SOURCE_TIME_FUNCTION'), + (r'external_source_time_function', 'EXTERNAL_SOURCE_TIME_FUNCTION'), + (r'sourceTimeFunction', 'sourceTimeFunction'), + (r'external_stf', 'EXTERNAL_SOURCE_TIME_FUNCTION'), + (r'EXTERNAL_SOURCE_TIME_FUNCTION_filename', 'external_source_time_function_filename'), + (r'read_EXTERNAL_SOURCE_TIME_FUNCTION', 'read_external_source_time_function'), + (r'USE_MAP_function', 'USE_MAP_FUNCTION'), + (r'enddo_LOOP_IJK', 'ENDDO_LOOP_IJK'), + (r'enddo_LOOP_IJ', 'ENDDO_LOOP_IJ'), + (r'OMP do', 'OMP DO'), + (r'OMP enddo', 'OMP ENDDO'), + (r'print\*', 'print *'), + (r'print\s*\*', 'print *'), + (r'spectral-elements', 'spectral elements'), + (r'gaussian', 'Gaussian'), + (r'hessian', 'Hessian'), + (r'cartesian', 'Cartesian'), + # suppress space between parenthesis and .not. (this can happen when testing logical operators) + (r'\( \.not\. ', '(.not. '), + (r'\)call', ') call'), + # enforce upper case + (r'CUSTOM_REAL', 'CUSTOM_REAL'), + # do not use null strings, which are not part of the Fortran standard (and the IBM xlf compiler rejects them for instance) + (r'print\s*\*\s*,\s*\'\'', 'print *'), + (r'write\s*\(\s*\*\s*,\s*\*\s*\)\s*\'\'', 'print *'), + (r'write\s*\(\s*IMAIN\s*,\s*\*\s*\)\s*\'\'', 'write(IMAIN,*)'), + (r'write\s*\(\s*IOUT\s*,\s*\*\s*\)\s*\'\'', 'write(IOUT,*)'), + (r'print\s*\*\s*,\s*""', 'print *'), + (r'write\s*\(\s*\*\s*,\s*\*\s*\)\s*""', 'print *'), + (r'write\s*\(\s*IMAIN\s*,\s*\*\s*\)\s*""', 'write(IMAIN,*)'), + (r'write\s*\(\s*IOUT\s*,\s*\*\s*\)\s*""', 'write(IOUT,*)'), + # unit 6 means standard output, replace it with standard output symbol + (r'write\s*\(\s*6\s*,\s*\*\s*\)', 'write(*,*)'), + (r'write\s*\(\s*6\s*,', 'write(*,'), + # force space in , & at end of line + (r'\s*\,\s*&\s*$', ', &'), + # always use upper case for GLL when used as a word + (r' gll ', ' GLL '), + (r' mpi ', ' MPI '), + (r' pml ', ' PML '), + # fix some typos I have found in the different codes, or non-US spelling. + # also switch to US spelling in order to have the same standard in all files. + (r'regularisation', 'regularization'), + (r'optimisation', 'optimization'), + (r'analitical', 'analytical'), + # (r'communIcation', 'communication'), + (r' in orfer ', ' in order '), + (r' stepest ', ' steepest '), + (r' stepest$', ' steepest'), + (r'aloow', 'allow'), + (r'neighbour', 'neighbor'), + (r'vecotr', 'vector'), + (r'computse', 'compute'), + (r'indicies', 'indices'), + (r'accordig', 'according'), + (r'paralell', 'parallel'), + (r'debbug', 'debug'), + # do not suppress the white space here because it would then change "debugging" for instance + (r'debugg ', 'debug '), + (r'debugg$', 'debug'), + (r'familly', 'family'), + (r'warnning', 'warning'), + (r'elemement', 'element'), + (r'cartesion', 'Cartesian'), + (r'partiton', 'partition'), + (r'drection', 'direction'), + (r'seperation', 'separation'), + (r'inverision', 'inversion'), + (r'restauration', 'restoration'), + (r'restaure', 'restore'), + (r'memmory', 'memory'), + (r'convolution formation', 'convolution formulation'), + (r'fortran', 'Fortran'), + (r'adress', 'address'), + (r'gFortran', 'gfortran'), + (r' usefull ', ' useful '), + (r' usefull$', ' useful'), + # enforce upper case + (r'MAX_neighborS', 'MAX_NEIGHBORS'), +] + +# list of regex patterns to be replaced only for selected files w/out excluded files +special_patterns = [ + # operators + (r'\s*<\s*=\s*', ' <= '), + (r'\s*>\s*=\s*', ' >= '), + (r'\s*<\s*', ' < '), + (r'\s*/=\s*', ' /= '), + # restore operators that may have been split by the above introduction of white spaces + (r'<\s*=', '<='), + (r'>\s*=', '>='), + (r'=\s*=', '=='), + (r'/\s*=', '/='), + # also restore bash file pipes that may appear in some print statements that save bash scripts to disk for future processing + (r'>\s*&', '>&'), + (r'<\s*&', '<&'), + # also restore xml-formatting strings '< and >' + (r'\'\s*<\s*', '\'<'), + (r'\s*>\s*\'', '>\''), + # for pointers + (r'\s*=\s*>\s*(?!$)', ' => '), +] + +# patterns for comment/non-comment lines +comment = [ '!' ] +comment_patterns = [ + (r'-\s*>', '->'), + (r'<\s*-', '<-'), +] +non_comment_patterns = [ + (r'(?(?!=)(?!\')(?!&)\s*', ' > '), + (r'\s*==(?!=)\s*', ' == '), + (r'(? 0: + first_letter = line_nospace[0] + else: + first_letter = '' + #print(f"line {i}: first_letter={first_letter} line: {line}") + + ## general patterns + for pattern, replacement in patterns: + #print(f"pattern: {pattern}") + line = re.sub(pattern, replacement, line, flags=re.IGNORECASE) + + ## special patterns formatting (operators,..) + # check if line has xml format (contains ' patterns) + xml_patterns = [ r'\'' ] + has_xml_pattern = False + for pattern in xml_patterns: + if re.search(pattern, line): + has_xml_pattern = True + break + if not has_xml_pattern: + ## Replace special patterns + for pattern, replacement in special_patterns: + line = re.sub(pattern, replacement, line, flags=re.IGNORECASE) + + ## Replace patterns on non-comment lines + if first_letter in comment: + # comment line + for pattern, replacement in comment_patterns: + #print(f"comment pattern: {pattern}") + line = re.sub(pattern, replacement, line, flags=re.IGNORECASE) + else: + # non-comment line + for pattern, replacement in non_comment_patterns: + #print(f"non-comment pattern: {pattern}") + line = re.sub(pattern, replacement, line, flags=re.IGNORECASE) + + ## special formatting + # "write(IMAIN,*)'my-comment'" -> "write(IMAIN,*) 'my-comment'" + if re.search(r'\bwrite\s*\(IMAIN,\*\)\'[^\']*\'', line): + line = re.sub(r'\)(?=\'[^\']*\')', ') ', line, flags=re.IGNORECASE) + + # "write(IMAIN,*)my-parameter" -> "write(*,*) my-parameter" + if re.search(r'\bwrite\s*\(IMAIN,\*\)\w+', line): + line = re.sub(r'\)(?=\w)', ') ', line, flags=re.IGNORECASE) + + # "write(*,*)'my-comment'" -> "write(*,*)'my-comment'" + if re.search(r'\bwrite\s*\(\*,\*\)\'[^\']*\'', line): + line = re.sub(r'\)(?=\'[^\']*\')', ') ', line, flags=re.IGNORECASE) + + # "write(*,*)my-parameter" -> "write(*,*) my-parameter" + if re.search(r'\bwrite\s*\(\*,\*\)\w+', line): + line = re.sub(r'\)(?=\w)', ') ', line, flags=re.IGNORECASE) + + # "if (a==b)something" -> "if (a==b) something" + if re.search(r'\bif\s*\(\s*(\w+)\s*==\s*(\w+)\s*\)\w+', line): + line = re.sub(r'\)(?=\w)', ') ', line, flags=re.IGNORECASE) + + # on non-comment lines + if not first_letter in comment: + # do i=1,.. -> do i = 1,.. + if re.search(r'\bdo\s+(\w+)\s*=(\d+)\s*\,', line): + line = re.sub(r'\bdo\s+(\w+)\s*=(\d+)\s*\,', r'do \1 = \2,', line, flags=re.IGNORECASE) + + # do i=ilat,.. -> do i = ilat,.. + if re.search(r'\bdo\s+(\w+)\s*=(\w+)\s*\,', line): + line = re.sub(r'\bdo\s+(\w+)\s*=(\w+)\s*\,', r'do \1 = \2,', line, flags=re.IGNORECASE) + + # "myvar==0" -> "myvar == 0" + if re.search(r'(\w+)==(\d+)', line): + newline = re.sub(r'(\w+)==(\d+)', r'\1 == \2', line, flags=re.IGNORECASE) + print(" A newline: ",newline) + + # "myvar==something" -> "myvar == something" + if re.search(r'\b(\w+)==(\w+)', line): + newline = re.sub(r'\b(\w+)==(\w+)', r'\1 == \2', line, flags=re.IGNORECASE) + print(" B newline: ",newline) + + # "a=b" -> "a = b" + exclude_equal_patterns = [ + r'==', + r'>=', + r'<=', + r'\bopen\s*\(', + r'\bclose\s*\(', + r'\binquire\s*\(', + r'\bread\s*\(', + r'\bwrite\s*\(', + r'\brandom_seed\s*\(', + r'\bminloc\s*\(', + r'\bminval\s*\(', + r'\bmaxval\s*\(', + r'\bcheck_status\s*\(', + r'\bget_command_argument\s*\(', + r'\bdate_and_time\s*\(', + r'\bexit_mpi\s*\(', + r'\bexit_MPI\s*\(', + r'\blibxsmm', + r'\bprint\s*\*', + r'\brecl=', + r'\bstat=', + r'\bexitstat=', + r'\biostat=', + r'\blen=', + r'\bkind=', + r'\bh5', + r'^[^)]*\)[^)]*$', + r'^\s*&', + ] + has_equal_pattern = False + for pattern in exclude_equal_patterns: + if re.search(pattern, line): + has_equal_pattern = True + break + if not has_equal_pattern: + # "myvar=something" -> "myvar = something" but not "a==b" or lines with "open(unit=.." etc. + if re.search(r'(\w+)=(\w+)', line): + line = re.sub(r'(\w+)=(\w+)', r'\1 = \2', line, flags=re.IGNORECASE) + + # Replace the original line with the modified line + lines[i] = line + + # Join the modified lines back together + content_new = '\n'.join(lines) + return content_new + + +def format_content_general(content): + """ + applies cleaning to general (text) files, for example output_solver.txt files in REF_SEIS/ folders + """ + # line-by-line + lines = content.split('\n') # Split the content into lines + + for i, line in enumerate(lines): + ## general formatting + # suppress trailing white spaces and carriage return + line = re.sub(r'\s*$', '', line) + # Replace the original line with the modified line + lines[i] = line + + # Join the modified lines back together + content_new = '\n'.join(lines) + return content_new + + +def clean_code_format(file): + """ + cleans code format + """ + # Exclude specified files + if any(fnmatch.fnmatch(file, filename) for filename in exclude_files): + return + + # Process files only with specified extensions + # Fortran files + is_Fortran_file = False + is_general_file = False + if any(file.endswith(ext) for ext in fortran_file_extensions): + is_Fortran_file = True + elif any(file.endswith(ext) for ext in general_file_extensions): + is_general_file = True + + # checks if anything to do + if not is_Fortran_file and not is_general_file: + return + + print(f'Processing {file}...') + + # Read the file + with open(file, 'r') as f: + content = f.read() + + # content + if is_Fortran_file: + # fortran code formatting + content_new = format_content_fortran(content) + else: + # general file cleaning + content_new = format_content_general(content) + + # output + if show_diff: + # show all content + #print("content:") + #print(content_new) + + # show differences only line-by-line + # line-by-line + lines_org = content.split('\n') # Split the content into lines + lines_new = content_new.split('\n') # Split the content into lines + + len_org = len(lines_org) + len_new = len(lines_new) + if len(lines_org) != len(lines_new): + print("Warning: content number of lines differ: original = {} new = {}".format(len_org,len_new)) + + length = min(len_org,len_new) + for i in range(length): + line_org = lines_org[i] + line_new = lines_new[i] + # show if lines are different + if line_new != line_org: + print(f" line {i}: - {line_org}") + print(f" line {i}: + {line_new}") + + if replace_file_content: + # Write the modified content back to the file if anything changed + if content_new != content: + # new content is different + with open(file, 'w') as f: + f.write(content_new) + +def clean_listings(folder_filename): + """ + loops over (Fortran) code files and updates code formatting + """ + # determines whether a folder or a specific file was provided as input + if os.path.isdir(folder_filename): + # folder + # Define the path to the source code + src_path = folder_filename + + # Iterate over all files in the source directory and its subdirectories + for root, dirs, files in os.walk(src_path): + # Exclude specified directories + dirs[:] = [d for d in dirs if d not in exclude_dirs and os.path.join(root,d) not in exclude_dirs] + + for file in files: + file_path = os.path.join(root, file) + # clean code formatting + clean_code_format(file_path) + + elif os.path.isfile(folder_filename): + # file + file_path = folder_filename + # clean code formatting + clean_code_format(file_path) + + print("") + print("all done") + print("") + +# reads in arguments +def usage(): + print("Usage: ./clean_listings_specfem.py filename/folder [--diff/--no-diff] [--replace]") + print("") + print(" filename/folder - required input file or folder containing Fortran source code files, e.g., src/") + print(" --diff/--no-diff - show or don't show formatting differences (default is to show differences)") + print(" --replace - replace file content with new formatting (default off)") + sys.exit(1) + + +if __name__ == '__main__': + + # gets arguments + if len(sys.argv) < 2: + usage() + + folder_filename = sys.argv[1] # file or folder with source code files + + # reads arguments + i = 0 + for arg in sys.argv: + i += 1 + #print("arg: ",arg) + # get arguments + if "--diff" in arg: + show_diff = True + elif "--no-diff" in arg: + show_diff = False + elif "--replace" in arg: + replace_file_content = True + elif i > 2: + print("argument not recognized: ",arg) + print("") + usage() + + # main routine + clean_listings(folder_filename) From a4600a8f016736cd65464075e99bffb6bb587bef Mon Sep 17 00:00:00 2001 From: Daniel Peter Date: Sat, 6 Apr 2024 22:40:38 +0200 Subject: [PATCH 5/6] fixes OpenMP statements --- src/specfem2D/compute_forces_viscoelastic.F90 | 2 +- src/specfem2D/prepare_optimized_arrays.F90 | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/specfem2D/compute_forces_viscoelastic.F90 b/src/specfem2D/compute_forces_viscoelastic.F90 index 80b7db9ff..bec041e30 100644 --- a/src/specfem2D/compute_forces_viscoelastic.F90 +++ b/src/specfem2D/compute_forces_viscoelastic.F90 @@ -161,7 +161,7 @@ subroutine compute_forces_viscoelastic(accel_elastic,veloc_elastic,displ_elastic !$OMP num_elements,ibool,ispec_is_elastic,ispec_is_anisotropic, & !$OMP phase_ispec_inner_elastic,iphase, & !$OMP displ_elastic,veloc_elastic,accel_elastic, & -!$OMP xix,xiz,gammax,gammaz,jacobian, & +!$OMP deriv_mapping,gammaz,jacobian, & !$OMP rho_vpstore,mustore,rhostore,qkappa_attenuation_store,qmu_attenuation_store, & !$OMP c11store,c12store,c13store,c15store,c22store,c23store,c25store,c33store,c35store,c55store, & !$OMP AXISYM,is_on_the_axis,coord,iglob_is_forced, & diff --git a/src/specfem2D/prepare_optimized_arrays.F90 b/src/specfem2D/prepare_optimized_arrays.F90 index 0c90da03e..b793841e5 100644 --- a/src/specfem2D/prepare_optimized_arrays.F90 +++ b/src/specfem2D/prepare_optimized_arrays.F90 @@ -78,7 +78,6 @@ subroutine prepare_timerun_OpenMP() implicit none ! local parameters - integer :: ier integer :: max_threads integer,external :: OMP_GET_MAX_THREADS From 6d05104e0b33b2b4143385624a293bd1c7a23236 Mon Sep 17 00:00:00 2001 From: Daniel Peter Date: Sat, 6 Apr 2024 22:41:10 +0200 Subject: [PATCH 6/6] adds compilation tests --- .../compilations/1.configure.parallel_make.sh | 2 +- tests/compilations/2.configure.openmp_make.sh | 64 +++++++++++++++++++ .../3.configure.vectorization_make.sh | 64 +++++++++++++++++++ 3 files changed, 129 insertions(+), 1 deletion(-) create mode 100755 tests/compilations/2.configure.openmp_make.sh create mode 100755 tests/compilations/3.configure.vectorization_make.sh diff --git a/tests/compilations/1.configure.parallel_make.sh b/tests/compilations/1.configure.parallel_make.sh index 329baffc1..77bc4bfcf 100755 --- a/tests/compilations/1.configure.parallel_make.sh +++ b/tests/compilations/1.configure.parallel_make.sh @@ -2,7 +2,7 @@ ################################################### # test name -NAME="configure.0.parallel_make" +NAME="configure.1.parallel_make" # configuration parameters CONF_PARAM="--with-mpi" diff --git a/tests/compilations/2.configure.openmp_make.sh b/tests/compilations/2.configure.openmp_make.sh new file mode 100755 index 000000000..790aa8da2 --- /dev/null +++ b/tests/compilations/2.configure.openmp_make.sh @@ -0,0 +1,64 @@ +#!/bin/bash +################################################### + +# test name +NAME="configure.2.openmp_make" + +# configuration parameters +CONF_PARAM="--with-mpi --enable-openmp --enable-debug" + +################################################### + + +testdir=`pwd` + +# sets source directory +cd $ROOT/ +srcdir=`pwd` + +cd $testdir/ + +# title +echo >> $testdir/results.log +echo "$NAME in: $testdir" >> $testdir/results.log +echo >> $testdir/results.log + +#cleanup +rm -rf config.log config.status +rm -rf ./bin ./obj ./setup ./OUTPUT_FILES ./DATA + +# default configuration for serial version (without MPI) +# (out-of-source compilation) +echo "configuration: $srcdir/configure ${CONF_PARAM}" >> $testdir/results.log +$srcdir/configure ${CONF_PARAM} >> $testdir/results.log 2>&1 + +# checks exit code +if [[ $? -ne 0 ]]; then + echo >> $testdir/results.log + echo "configuration failed, please check..." >> $testdir/results.log + exit 1 +fi + +# default all compilation +make clean >> $testdir/results.log 2>&1 + +# checks exit code +if [[ $? -ne 0 ]]; then + echo >> $testdir/results.log + echo "compilation failed, please check..." >> $testdir/results.log + exit 1 +fi + +# parallel make +make -j 4 all >> $testdir/results.log 2>&1 + +# checks exit code +if [[ $? -ne 0 ]]; then + echo >> $testdir/results.log + echo "compilation failed, please check..." >> $testdir/results.log + exit 1 +fi + +echo "" >> $testdir/results.log +echo "successful compilation" >> $testdir/results.log + diff --git a/tests/compilations/3.configure.vectorization_make.sh b/tests/compilations/3.configure.vectorization_make.sh new file mode 100755 index 000000000..8deef570f --- /dev/null +++ b/tests/compilations/3.configure.vectorization_make.sh @@ -0,0 +1,64 @@ +#!/bin/bash +################################################### + +# test name +NAME="configure.3.vectorization_make" + +# configuration parameters +CONF_PARAM="--enable-openmp --enable-vectorization" + +################################################### + + +testdir=`pwd` + +# sets source directory +cd $ROOT/ +srcdir=`pwd` + +cd $testdir/ + +# title +echo >> $testdir/results.log +echo "$NAME in: $testdir" >> $testdir/results.log +echo >> $testdir/results.log + +#cleanup +rm -rf config.log config.status +rm -rf ./bin ./obj ./setup ./OUTPUT_FILES ./DATA + +# default configuration for serial version (without MPI) +# (out-of-source compilation) +echo "configuration: $srcdir/configure ${CONF_PARAM}" >> $testdir/results.log +$srcdir/configure ${CONF_PARAM} >> $testdir/results.log 2>&1 + +# checks exit code +if [[ $? -ne 0 ]]; then + echo >> $testdir/results.log + echo "configuration failed, please check..." >> $testdir/results.log + exit 1 +fi + +# default all compilation +make clean >> $testdir/results.log 2>&1 + +# checks exit code +if [[ $? -ne 0 ]]; then + echo >> $testdir/results.log + echo "compilation failed, please check..." >> $testdir/results.log + exit 1 +fi + +# parallel make +make -j 4 all >> $testdir/results.log 2>&1 + +# checks exit code +if [[ $? -ne 0 ]]; then + echo >> $testdir/results.log + echo "compilation failed, please check..." >> $testdir/results.log + exit 1 +fi + +echo "" >> $testdir/results.log +echo "successful compilation" >> $testdir/results.log +