Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates workflow script (for macOS), Makefiles and SIEM mesh routines; adds explicit type conversions #837

Merged
merged 11 commits into from
May 17, 2024
Merged
13 changes: 12 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,27 @@ jobs:
echo ""
## avoids sed -i '' issue on MacOS, using gnu sed to have the same sed command lines as in linux
brew install gnu-sed
echo "PATH=/usr/local/opt/gnu-sed/libexec/gnubin:$PATH" >> $GITHUB_ENV
echo "PATH=/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH" >> $GITHUB_ENV
## OpenMP
echo "OMP_NUM_THREADS=2" >> $GITHUB_ENV
## MPI
echo
echo "MPI environment:"
echo "mpif90 on path: $(which mpif90)"
echo
# add OpenMPI path to have ./configure detect mpi.h
echo "MPI_INC=/opt/homebrew/include" >> $GITHUB_ENV
## avoids MPI issue with number of slots
echo "OMPI_MCA_rmaps_base_oversubscribe=1" >> $GITHUB_ENV
echo "OMPI_MCA_rmaps_base_inherit=1" >> $GITHUB_ENV
## avoids MPI issue when running in MacOS
echo "OMPI_MCA_btl=self,tcp" >> $GITHUB_ENV
# newer OpenMPI version (5.x)
echo "PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe" >> $GITHUB_ENV
# exports for xterm output (for make tests)
echo "TERM=xterm" >> $GITHUB_ENV
# warning: (arm64) could not find object file symbol for symbol ___mulsc3
echo "LDFLAGS=-lgcc" >> $GITHUB_ENV
echo ""
echo "exports:"
export
Expand Down
4 changes: 4 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ CXXFLAGS = -I${SETUP} @CXXFLAGS@

FCLINK = $(MPIFCCOMPILE_CHECK)

# all linker flags
LDFLAGS = @LDFLAGS@
MPILIBS += $(LDFLAGS) @LIBS@

#######################################
####
#### MPI
Expand Down
8 changes: 4 additions & 4 deletions src/auxiliaries/create_movie_AVS_DX.f90
Original file line number Diff line number Diff line change
Expand Up @@ -894,11 +894,11 @@
ipoin = ipoin + 1
ireorder(ibool_number) = ipoin
! point value
total_dat(ipoin) = field_display(ilocnum+ieoff)
total_dat(ipoin) = real(field_display(ilocnum+ieoff),kind=CUSTOM_REAL)

Check warning on line 897 in src/auxiliaries/create_movie_AVS_DX.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_AVS_DX.f90#L897

Added line #L897 was not covered by tests
! point location
total_dat_xyz(1,ipoin) = xp_save(ilocnum+ieoff)
total_dat_xyz(2,ipoin) = yp_save(ilocnum+ieoff)
total_dat_xyz(3,ipoin) = zp_save(ilocnum+ieoff)
total_dat_xyz(1,ipoin) = real(xp_save(ilocnum+ieoff),kind=CUSTOM_REAL)
total_dat_xyz(2,ipoin) = real(yp_save(ilocnum+ieoff),kind=CUSTOM_REAL)
total_dat_xyz(3,ipoin) = real(zp_save(ilocnum+ieoff),kind=CUSTOM_REAL)

Check warning on line 901 in src/auxiliaries/create_movie_AVS_DX.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_AVS_DX.f90#L899-L901

Added lines #L899 - L901 were not covered by tests
endif
mask_point(ibool_number) = .true.
enddo
Expand Down
46 changes: 23 additions & 23 deletions src/auxiliaries/create_movie_GMT_global.f90
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@
close(IIN)
endif
! effective half duration in movie runs
hdur = sqrt( cmt_hdur**2 + HDUR_MOVIE**2)
hdur = real(sqrt( cmt_hdur**2 + HDUR_MOVIE**2),kind=CUSTOM_REAL)

Check warning on line 361 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L361

Added line #L361 was not covered by tests
! start time of simulation
t0 = - 1.5d0*( cmt_t_shift - hdur )
t0 = real(-1.5d0*( cmt_t_shift - hdur ),kind=CUSTOM_REAL)

Check warning on line 363 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L363

Added line #L363 was not covered by tests

! becomes time (s) from hypocenter to reach surface (using average 8 km/s s-wave speed)
! note: especially for deep sources, this helps determine a better starttime to mute
Expand All @@ -383,15 +383,15 @@

! converts values into radians
! colatitude [0, PI]
LAT_SOURCE = (90.0 - LAT_SOURCE)*DEGREES_TO_RADIANS
LAT_SOURCE = real((90.d0 - LAT_SOURCE)*DEGREES_TO_RADIANS,kind=CUSTOM_REAL)

Check warning on line 386 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L386

Added line #L386 was not covered by tests

! longitude [-PI, PI]
if (LON_SOURCE < -180.0 ) LON_SOURCE = LON_SOURCE + 360.0
if (LON_SOURCE > 180.0 ) LON_SOURCE = LON_SOURCE - 360.0
LON_SOURCE = LON_SOURCE * DEGREES_TO_RADIANS
LON_SOURCE = real(LON_SOURCE * DEGREES_TO_RADIANS,kind=CUSTOM_REAL)

Check warning on line 391 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L391

Added line #L391 was not covered by tests

! mute radius in rad
RADIUS_TO_MUTE = RADIUS_TO_MUTE * DEGREES_TO_RADIANS
RADIUS_TO_MUTE = real(RADIUS_TO_MUTE * DEGREES_TO_RADIANS,kind=CUSTOM_REAL)

Check warning on line 394 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L394

Added line #L394 was not covered by tests
endif

print *,'--------'
Expand Down Expand Up @@ -468,7 +468,7 @@

! approximate wavefront travel distance in degrees
! (~3.5 km/s wave speed for surface waves)
distance = SURFACE_WAVE_VELOCITY * ((it-1)*DT-t0) / (R_PLANET/1000.d0) * RADIANS_TO_DEGREES
distance = real(SURFACE_WAVE_VELOCITY * ((it-1)*DT-t0) / (R_PLANET/1000.d0) * RADIANS_TO_DEGREES,kind=CUSTOM_REAL)

Check warning on line 471 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L471

Added line #L471 was not covered by tests

print *,'distance approximate: ',distance,'(degrees)'

Expand Down Expand Up @@ -498,7 +498,7 @@
print *,'muting radius: ',0.7 * distance,'(degrees)'

! new radius of mute area (in rad)
RADIUS_TO_MUTE = 0.7 * distance * DEGREES_TO_RADIANS
RADIUS_TO_MUTE = real(0.7d0 * distance * DEGREES_TO_RADIANS,kind=CUSTOM_REAL)

Check warning on line 501 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L501

Added line #L501 was not covered by tests
else
! mute_factor used at the beginning for scaling displacement values
if (STARTTIME_TO_MUTE > TINYVAL) then
Expand All @@ -507,9 +507,9 @@
! linear scaling between [0,1]:
! from 0 (simulation time equal to zero )
! to 1 (simulation time equals starttime_to_mute)
mute_factor = 1.0 - ( STARTTIME_TO_MUTE - ((it-1)*DT-t0) ) / (STARTTIME_TO_MUTE+t0)
mute_factor = real(1.d0 - ( STARTTIME_TO_MUTE - ((it-1)*DT-t0) ) / (STARTTIME_TO_MUTE+t0),kind=CUSTOM_REAL)

Check warning on line 510 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L510

Added line #L510 was not covered by tests
! threshold value for mute_factor
if (mute_factor < TINYVAL ) mute_factor = TINYVAL
if (mute_factor < TINYVAL ) mute_factor = real(TINYVAL,kind=CUSTOM_REAL)

Check warning on line 512 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L512

Added line #L512 was not covered by tests
if (mute_factor > 1.0 ) mute_factor = 1.0
endif
endif
Expand Down Expand Up @@ -611,17 +611,17 @@
! checks source longitude range
if (LON_SOURCE - RADIUS_TO_MUTE < -PI .or. LON_SOURCE + RADIUS_TO_MUTE > PI) then
! source close to 180. longitudes, shifts range to [0, 2PI]
if (phival < 0.0 ) phival = phival + TWO_PI
if (phival < 0.0 ) phival = phival + real(TWO_PI,kind=CUSTOM_REAL)

Check warning on line 614 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L614

Added line #L614 was not covered by tests
if (LON_SOURCE < 0.0) then
dist_lon = phival - (LON_SOURCE + TWO_PI)
dist_lon = phival - real((LON_SOURCE + TWO_PI),kind=CUSTOM_REAL)

Check warning on line 616 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L616

Added line #L616 was not covered by tests
else
dist_lon = phival - LON_SOURCE
endif
else
! source well between range to [-PI, PI]
! shifts phival to be like LON_SOURCE between [-PI,PI]
if (phival > PI ) phival = phival - TWO_PI
if (phival < -PI ) phival = phival + TWO_PI
if (phival > PI ) phival = phival - real(TWO_PI,kind=CUSTOM_REAL)
if (phival < -PI ) phival = phival + real(TWO_PI,kind=CUSTOM_REAL)

Check warning on line 624 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L623-L624

Added lines #L623 - L624 were not covered by tests

dist_lon = phival - LON_SOURCE
endif
Expand All @@ -634,7 +634,7 @@
if ((it-1)*DT-t0 > STARTTIME_TO_MUTE) then
! wavefield will be tapered to mask out noise in source area
! factor from 0 to 1
mute_factor = ( 0.5*(1.0 - cos(distance/RADIUS_TO_MUTE*PI)) )**6
mute_factor = real( ( 0.d5*(1.d0 - cos(distance/RADIUS_TO_MUTE*PI)) )**6,kind=CUSTOM_REAL)

Check warning on line 637 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L637

Added line #L637 was not covered by tests
! factor from 0.01 to 1
mute_factor = mute_factor * 0.99 + 0.01
displn(i,j) = displn(i,j) * mute_factor
Expand Down Expand Up @@ -721,11 +721,11 @@

! determines North / South pole index for stamping maximum values
if (USE_AVERAGED_MAXIMUM .and. AVERAGE_NORMALIZE_VALUES) then
xmesh = xp(ieoff)
ymesh = yp(ieoff)
zmesh = zp(ieoff)
if (zmesh > -SMALL_VAL_ANGLE .and. zmesh <= ZERO) zmesh = -SMALL_VAL_ANGLE
if (zmesh < SMALL_VAL_ANGLE .and. zmesh >= ZERO) zmesh = SMALL_VAL_ANGLE
xmesh = real(xp(ieoff),kind=CUSTOM_REAL)
ymesh = real(yp(ieoff),kind=CUSTOM_REAL)
zmesh = real(zp(ieoff),kind=CUSTOM_REAL)
if (zmesh > -SMALL_VAL_ANGLE .and. zmesh <= ZERO) zmesh = - real(SMALL_VAL_ANGLE,kind=CUSTOM_REAL)
if (zmesh < SMALL_VAL_ANGLE .and. zmesh >= ZERO) zmesh = real(SMALL_VAL_ANGLE,kind=CUSTOM_REAL)

Check warning on line 728 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L724-L728

Added lines #L724 - L728 were not covered by tests
thetaval = atan2(sqrt(xmesh*xmesh+ymesh*ymesh),zmesh)
! thetaval between 0 and PI / 2
!print *,'thetaval:',thetaval * 180. / PI
Expand Down Expand Up @@ -812,7 +812,7 @@

if (max_absol < max_average) then
! distance (in degree) of surface waves travelled
distance = SURFACE_WAVE_VELOCITY * ((it-1)*DT-t0) / (R_PLANET/1000.d0) * RADIANS_TO_DEGREES
distance = real(SURFACE_WAVE_VELOCITY * ((it-1)*DT-t0) / (R_PLANET/1000.d0) * RADIANS_TO_DEGREES,kind=CUSTOM_REAL)

Check warning on line 815 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L815

Added line #L815 was not covered by tests
if (distance > 10.0 .and. distance <= 20.0) then
! smooth transition between 10 and 20 degrees
! sets positive and negative maximum
Expand Down Expand Up @@ -866,15 +866,15 @@
! linear scaling between [0,1]:
! from 0 (simulation time equal to -t0 )
! to 1 (simulation time equals starttime_to_mute)
mute_factor = 1.0 - ( STARTTIME_TO_MUTE - ((it-1)*DT-t0) ) / (STARTTIME_TO_MUTE+t0)
mute_factor = real(1.d0 - ( STARTTIME_TO_MUTE - ((it-1)*DT-t0) ) / (STARTTIME_TO_MUTE+t0),kind=CUSTOM_REAL)

Check warning on line 869 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L869

Added line #L869 was not covered by tests
! takes complement and shifts scale to (1,100)
! thus, mute factor is 100 at simulation start and 1.0 at starttime_to_mute
mute_factor = abs(1.0 - mute_factor) * 99.0 + 1.0
! positive and negative maximum reach average when wavefield appears
val = mute_factor * max_average
val = real(mute_factor * max_average,kind=CUSTOM_REAL)

Check warning on line 874 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L874

Added line #L874 was not covered by tests
else
! uses a constant factor
val = 100.0 * max_average
val = real(100.d0 * max_average,kind=CUSTOM_REAL)

Check warning on line 877 in src/auxiliaries/create_movie_GMT_global.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/create_movie_GMT_global.f90#L877

Added line #L877 was not covered by tests
endif
! positive and negative maximum
field_display(istamp1) = + val
Expand Down
24 changes: 12 additions & 12 deletions src/auxiliaries/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ xcombine_paraview_strain_data_SHARED_OBJECTS = \
$(EMPTY_MACRO)

${E}/xcombine_paraview_strain_data: $(xcombine_paraview_strain_data_OBJECTS) $(xcombine_paraview_strain_data_SHARED_OBJECTS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(LDFLAGS) $(MPILIBS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(MPILIBS)

### additional dependencies
$O/combine_paraview_strain_data.auxsolver.o: $O/specfem3D_par.solverstatic_module.o
Expand All @@ -240,7 +240,7 @@ xcombine_surf_data_SHARED_OBJECTS = \
$(EMPTY_MACRO)

${E}/xcombine_surf_data: $(xcombine_surf_data_OBJECTS) $(xcombine_surf_data_SHARED_OBJECTS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(LDFLAGS) $(MPILIBS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(MPILIBS)

### additional dependencies
$O/combine_surf_data.auxsolver.o: $O/specfem3D_par.solverstatic_module.o
Expand All @@ -267,7 +267,7 @@ xcombine_surf_data_vtk_SHARED_OBJECTS = \
$(EMPTY_MACRO)

${E}/xcombine_surf_data_vtk: $(xcombine_surf_data_vtk_OBJECTS) $(xcombine_surf_data_vtk_SHARED_OBJECTS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(LDFLAGS) $(MPILIBS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(MPILIBS)

### additional dependencies
$O/combine_surf_data.auxsolver_vtk.o: $O/specfem3D_par.solverstatic_module.o
Expand All @@ -282,7 +282,7 @@ xcombine_surf_data_vtu_OBJECTS = \
xcombine_surf_data_vtu_SHARED_OBJECTS = $(xcombine_surf_data_vtk_SHARED_OBJECTS)

${E}/xcombine_surf_data_vtu: $(xcombine_surf_data_vtu_OBJECTS) $(xcombine_surf_data_vtu_SHARED_OBJECTS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(LDFLAGS) $(MPILIBS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(MPILIBS)

### additional dependencies
$O/combine_surf_data.auxsolver_vtu.o: $O/specfem3D_par.solverstatic_module.o
Expand Down Expand Up @@ -317,7 +317,7 @@ xcombine_vol_data_SHARED_OBJECTS = \
$(EMPTY_MACRO)

${E}/xcombine_vol_data: $(xcombine_vol_data_OBJECTS) $(xcombine_vol_data_SHARED_OBJECTS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(LDFLAGS) $(MPILIBS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(MPILIBS)

### additional dependencies
$O/combine_vol_data.auxsolver.o: $O/specfem3D_par.solverstatic_module.o
Expand Down Expand Up @@ -360,7 +360,7 @@ xcombine_vol_data_adios_SHARED_OBJECTS = \
$O/combine_vol_data.auxadios.o: $O/combine_vol_data_adios_impl.auxadios.o

${E}/xcombine_vol_data_adios: $(xcombine_vol_data_adios_OBJECTS) $(xcombine_vol_data_adios_SHARED_OBJECTS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(LDFLAGS) $(MPILIBS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(MPILIBS)

### additional dependencies
$O/combine_vol_data.auxadios.o: $O/specfem3D_par.solverstatic_module.o
Expand Down Expand Up @@ -396,7 +396,7 @@ xcombine_vol_data_vtk_SHARED_OBJECTS = \
$(EMPTY_MACRO)

${E}/xcombine_vol_data_vtk: $(xcombine_vol_data_vtk_OBJECTS) $(xcombine_vol_data_vtk_SHARED_OBJECTS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(LDFLAGS) $(MPILIBS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(MPILIBS)

### additional dependencies
$O/combine_vol_data.auxsolver_vtk.o: $O/specfem3D_par.solverstatic_module.o
Expand Down Expand Up @@ -438,7 +438,7 @@ xcombine_vol_data_vtk_adios_SHARED_OBJECTS = \
$(EMPTY_MACRO)

${E}/xcombine_vol_data_vtk_adios: $(xcombine_vol_data_vtk_adios_OBJECTS) $(xcombine_vol_data_vtk_adios_SHARED_OBJECTS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(LDFLAGS) $(MPILIBS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(MPILIBS)

### additional dependencies
$O/combine_vol_data.auxadios_vtk.o: $O/combine_vol_data_adios_impl.auxadios.o
Expand All @@ -454,7 +454,7 @@ xcombine_vol_data_vtu_OBJECTS = \
xcombine_vol_data_vtu_SHARED_OBJECTS = $(xcombine_vol_data_vtk_SHARED_OBJECTS)

${E}/xcombine_vol_data_vtu: $(xcombine_vol_data_vtu_OBJECTS) $(xcombine_vol_data_vtu_SHARED_OBJECTS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(LDFLAGS) $(MPILIBS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(MPILIBS)

### additional dependencies
$O/combine_vol_data.auxsolver_vtu.o: $O/specfem3D_par.solverstatic_module.o
Expand All @@ -469,7 +469,7 @@ xcombine_vol_data_vtu_adios_OBJECTS = \
xcombine_vol_data_vtu_adios_SHARED_OBJECTS = $(xcombine_vol_data_vtk_adios_SHARED_OBJECTS)

${E}/xcombine_vol_data_vtu_adios: $(xcombine_vol_data_vtu_adios_OBJECTS) $(xcombine_vol_data_vtu_adios_SHARED_OBJECTS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(LDFLAGS) $(MPILIBS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(MPILIBS)

### additional dependencies
$O/combine_vol_data.auxadios_vtu.o: $O/combine_vol_data_adios_impl.auxadios.o
Expand Down Expand Up @@ -561,7 +561,7 @@ xextract_database_SHARED_OBJECTS = \
$(EMPTY_MACRO)

${E}/xextract_database: $(xextract_database_OBJECTS) $(xextract_database_SHARED_OBJECTS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(LDFLAGS) $(MPILIBS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(MPILIBS)

### additional dependencies
$O/extract_database.aux.o: $O/specfem3D_par.solverstatic_module.o
Expand Down Expand Up @@ -704,7 +704,7 @@ endif


${E}/xwrite_profile: $(xwrite_profile_OBJECTS) $(xwrite_profile_SHARED_OBJECTS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(LDFLAGS) $(MPILIBS) $(LIBS)
${MPIFCCOMPILE_CHECK} -o $@ $+ $(MPILIBS)

## additional module dependencies
$O/write_profile.aux.o: $O/meshfem3D_models.check.o
Expand Down
22 changes: 11 additions & 11 deletions src/auxiliaries/write_profile.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1211,8 +1211,8 @@
integer,save :: slice_proc_old = 0

! converts to lat/lon
lat = 90.0 - theta_degrees
lon = phi_degrees
lat = real(90.d0 - theta_degrees,kind=CUSTOM_REAL)
lon = real(phi_degrees,kind=CUSTOM_REAL)

Check warning on line 1215 in src/auxiliaries/write_profile.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/write_profile.f90#L1214-L1215

Added lines #L1214 - L1215 were not covered by tests
! limits value range
if (lat < -90.0) lat = -90.0
if (lat > 90.0) lat = 90.0
Expand All @@ -1226,8 +1226,8 @@
xi_width = 90.0
eta_width = 90.0
else
xi_width = ANGULAR_WIDTH_XI_IN_DEGREES
eta_width = ANGULAR_WIDTH_ETA_IN_DEGREES
xi_width = real(ANGULAR_WIDTH_XI_IN_DEGREES,kind=CUSTOM_REAL)
eta_width = real(ANGULAR_WIDTH_ETA_IN_DEGREES,kind=CUSTOM_REAL)

Check warning on line 1230 in src/auxiliaries/write_profile.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/write_profile.f90#L1229-L1230

Added lines #L1229 - L1230 were not covered by tests
endif

! converts chunk width to radians
Expand Down Expand Up @@ -1306,8 +1306,8 @@
integer :: k

! converts lat/lon from degrees to radians (colatitute/longitude)
theta = (90.0 - lat)/180.0 * PI
phi = lon/180.0 * PI
theta = real((90.d0 - lat)/180.d0 * PI,kind=CUSTOM_REAL)
phi = real(lon/180.d0 * PI,kind=CUSTOM_REAL)

Check warning on line 1310 in src/auxiliaries/write_profile.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/write_profile.f90#L1309-L1310

Added lines #L1309 - L1310 were not covered by tests

! converts (r,theta,phi) to (x,y,z) on unit sphere
r = 1.0_CUSTOM_REAL
Expand All @@ -1317,9 +1317,9 @@
! compute rotation matrix from Euler angles
call euler_angles(rotation_matrix,CENTER_LONGITUDE_IN_DEGREES,CENTER_LATITUDE_IN_DEGREES,GAMMA_ROTATION_AZIMUTH)

xn = x * rotation_matrix(1,1) + y * rotation_matrix(2,1) + z * rotation_matrix(3,1)
yn = x * rotation_matrix(1,2) + y * rotation_matrix(2,2) + z * rotation_matrix(3,2)
zn = x * rotation_matrix(1,3) + y * rotation_matrix(2,3) + z * rotation_matrix(3,3)
xn = real(x * rotation_matrix(1,1) + y * rotation_matrix(2,1) + z * rotation_matrix(3,1),kind=CUSTOM_REAL)
yn = real(x * rotation_matrix(1,2) + y * rotation_matrix(2,2) + z * rotation_matrix(3,2),kind=CUSTOM_REAL)
zn = real(x * rotation_matrix(1,3) + y * rotation_matrix(2,3) + z * rotation_matrix(3,3),kind=CUSTOM_REAL)

Check warning on line 1322 in src/auxiliaries/write_profile.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/write_profile.f90#L1320-L1322

Added lines #L1320 - L1322 were not covered by tests

x = xn; y = yn; z = zn
endif
Expand Down Expand Up @@ -1513,8 +1513,8 @@
integer :: proc_xi,proc_eta

! converts chunk width to radians
xi_width_rad = xi_width/180.0 * PI
eta_width_rad = eta_width/180.0 * PI
xi_width_rad = real(xi_width/180.d0 * PI,kind=CUSTOM_REAL)
eta_width_rad = real(eta_width/180.d0 * PI,kind=CUSTOM_REAL)

Check warning on line 1517 in src/auxiliaries/write_profile.f90

View check run for this annotation

Codecov / codecov/patch

src/auxiliaries/write_profile.f90#L1516-L1517

Added lines #L1516 - L1517 were not covered by tests

! gets process/slice number
xi1 = xi / xi_width_rad * 2.0
Expand Down
Loading
Loading