Skip to content

Commit

Permalink
Merge pull request #850 from danielpeter/devel
Browse files Browse the repository at this point in the history
adds additional topo and STF feature for Berkeley model SEMUCB
  • Loading branch information
danielpeter authored Oct 10, 2024
2 parents 9607835 + f2569f1 commit 1f586de
Show file tree
Hide file tree
Showing 12 changed files with 3,207 additions and 31 deletions.
10 changes: 6 additions & 4 deletions setup/constants.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
character (len=*), parameter :: PATHNAME_TOPO_FILE_1 = &
'DATA/topo_bathy/topo_bathy_etopo1_ice_c_smoothed_window_3.bin'

!--- Default
!!--- Default
! Topography defaults to ETOPO4
integer, parameter :: EARTH_NX_BATHY = NX_BATHY_4
integer, parameter :: EARTH_NY_BATHY = NY_BATHY_4
Expand Down Expand Up @@ -258,9 +258,11 @@
! topography model
!!--- ETOPO1 5 - Berkeley filtered
! size of topography and bathymetry file
integer, parameter :: NX_BATHY_BERKELEY = 360,NY_BATHY_BERKELEY = 180
! resolution of topography file in minutes
integer, parameter :: RESOLUTION_TOPO_FILE_BERKELEY = 2
! note: NX = 360 to match longitude range [0,360[ , i.e., 0,1,2,..,359
! NY = 180 + 1 to match colatitude range [0,180], i.e., 0,1,2,..,180
integer, parameter :: NX_BATHY_BERKELEY = 360,NY_BATHY_BERKELEY = 181
! resolution of topography file in minutes (1 degree == 60 minutes)
integer, parameter :: RESOLUTION_TOPO_FILE_BERKELEY = 60
! pathname of the topography file (un-smoothed)
character (len=*), parameter :: PATHNAME_TOPO_FILE_BERKELEY = trim(A3d_folder)//"ETOPO5_1x1_filtre.dat"

Expand Down
22 changes: 8 additions & 14 deletions src/meshfem3D/compute_element_properties.f90
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,6 @@ subroutine compute_element_tiso_flag(elem_is_tiso,elem_in_mantle,iregion_code,is
IFLAG_CRUST,IFLAG_220_80,IFLAG_80_MOHO,IFLAG_670_220,IFLAG_MANTLE_NORMAL,IREGION_CRUST_MANTLE, &
REFERENCE_MODEL_1DREF,REFERENCE_MODEL_1DREF,REFERENCE_MODEL_SEMUCB, &
THREE_D_MODEL_S362WMANI,THREE_D_MODEL_SGLOBE, &
THREE_D_MODEL_BERKELEY, &
USE_OLD_VERSION_FORMAT

use meshfem_models_par, only: &
Expand Down Expand Up @@ -572,17 +571,16 @@ subroutine compute_element_tiso_flag(elem_is_tiso,elem_in_mantle,iregion_code,is
endif
endif

! TODO: daniel - check if full tiso mantle should be used
!case (REFERENCE_MODEL_SEMUCB)
case (REFERENCE_MODEL_SEMUCB)
! SEMUCB - allows tiso for full mantle & crust
! (same as USE_FULL_TISO_MANTLE option)
!if (idoubling(ispec) == IFLAG_MANTLE_NORMAL &
! .or. idoubling(ispec) == IFLAG_670_220 &
! .or. idoubling(ispec) == IFLAG_220_80 &
! .or. idoubling(ispec) == IFLAG_80_MOHO &
! .or. idoubling(ispec) == IFLAG_CRUST) then
! elem_is_tiso = .true.
!endif
if (idoubling(ispec) == IFLAG_MANTLE_NORMAL &
.or. idoubling(ispec) == IFLAG_670_220 &
.or. idoubling(ispec) == IFLAG_220_80 &
.or. idoubling(ispec) == IFLAG_80_MOHO &
.or. idoubling(ispec) == IFLAG_CRUST) then
elem_is_tiso = .true.
endif

case default
! default reference models
Expand Down Expand Up @@ -641,10 +639,6 @@ subroutine compute_element_tiso_flag(elem_is_tiso,elem_in_mantle,iregion_code,is
! note: THREE_D_MODEL_SGLOBE_ISO
! sgloberani_iso model based on PREM, it will have tiso already set from crust down to 220

case (THREE_D_MODEL_BERKELEY)
! additionally enables tiso for crust
if (idoubling(ispec) == IFLAG_CRUST) elem_is_tiso = .true.

case default
! nothing special to add
continue
Expand Down
11 changes: 10 additions & 1 deletion src/shared/broadcast_computed_parameters.f90
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

subroutine broadcast_computed_parameters()

use constants, only: myrank
use constants, only: myrank,STF_IS_UCB_HEAVISIDE
use shared_parameters

implicit none
Expand Down Expand Up @@ -205,6 +205,15 @@ subroutine broadcast_computed_parameters()
call bcast_all_singlei(NZ_DOUBLING_4)
call bcast_all_singlei(NZ_DOUBLING_5)

! (optional) Berkeley UCB stf
if (STF_IS_UCB_HEAVISIDE) then
call bcast_all_singledp(UCB_SOURCE_T1)
call bcast_all_singledp(UCB_SOURCE_T2)
call bcast_all_singledp(UCB_SOURCE_T3)
call bcast_all_singledp(UCB_SOURCE_T4)
call bcast_all_singledp(UCB_TAU)
endif

! (optional) scattering perturbations
call bcast_all_singlel(ADD_SCATTERING_PERTURBATIONS)
call bcast_all_singledp(SCATTERING_STRENGTH)
Expand Down
Loading

0 comments on commit 1f586de

Please sign in to comment.