Skip to content

Commit

Permalink
customize velocity profile for groningen
Browse files Browse the repository at this point in the history
add a new constant in setup to read Vs, Vp, and density files
  • Loading branch information
elifo committed Jul 29, 2023
1 parent 9f0bce4 commit 99c5505
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
3 changes: 2 additions & 1 deletion setup/constants.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@
! after the SCEC dynamic rupture group benchmark 2021

logical, parameter :: IS_SCEC_STRATIFIEDMODEL_2021 = .false.
logical, parameter :: IS_RIDGECREST_VELOCMODEL = .true.
logical, parameter :: IS_RIDGECREST_VELOCMODEL = .false.
logical, parameter :: IS_GRONINGEN_VELOCMODEL = .true.



Expand Down
4 changes: 4 additions & 0 deletions setup/version.fh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
! This file is generated by Make. Do not edit this file!
character(len=*), parameter :: git_package_version = "v2.0.2-3297-g770bb14"
character(len=*), parameter :: git_commit_version = "commit 770bb14d5dab47f701c847a519d2b548be283671"
character(len=*), parameter :: git_date_version = "From Date: Mon Jul 5 06:07:42 2021 -0400"
31 changes: 29 additions & 2 deletions src/generate_databases/get_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ subroutine get_model()

! injection technique
use constants, only: INJECTION_TECHNIQUE_IS_FK,INJECTION_TECHNIQUE_IS_DSM,INJECTION_TECHNIQUE_IS_AXISEM,&
IS_RIDGECREST_VELOCMODEL,IS_SCEC_STRATIFIEDMODEL_2021
IS_RIDGECREST_VELOCMODEL,IS_SCEC_STRATIFIEDMODEL_2021,IS_GRONINGEN_VELOCMODEL
use shared_parameters, only: COUPLE_WITH_INJECTION_TECHNIQUE,MESH_A_CHUNK_OF_THE_EARTH,INJECTION_TECHNIQUE_TYPE


Expand Down Expand Up @@ -79,7 +79,7 @@ subroutine get_model()
integer,parameter :: IIN_STR = 122 ! could also use e.g. standard IIN from constants.h
character(len=570) :: filename
integer :: nglob_check
double precision :: Vs_user(nglob,1), Vp_user(nglob,1)
double precision :: Vs_user(nglob,1), Vp_user(nglob,1), rho_user(nglob,1)


! initializes element domain flags
Expand Down Expand Up @@ -166,6 +166,23 @@ subroutine get_model()
close(61)
endif

! Elif -- Groningen model (2023, July)
if ( IS_GRONINGEN_VELOCMODEL ) then
write(*,*) 'USING GRONINGEN VELOCITY MODEL WITH USER INPUT!'
write(filename,'(a,i6.6,a)') &
'./groningen_velocprofile/proc',myrank,'_user_velocity_profile3.bin'
write(*,*) 'ELIF: filename: ', filename
open(unit=61,file=trim(filename),form='unformatted')
read(61) nglob_check
write(*,*) 'ELIF: nglob_check, nglob: ', nglob_check, nglob
read(61) Vs_user
read(61) Vp_user
read(61) rho_user
close(61)
endif



! Elif: just a checkpoint before getting into loop
if (IS_SCEC_STRATIFIEDMODEL_2021) &
write(*,*) "ELIF: USING SCEC VELOCITY MODEL ..."
Expand Down Expand Up @@ -285,6 +302,16 @@ subroutine get_model()
write(*,*) 'iglob, nglob, vs, vp, rho', iglob, nglob, vs, vp, rho
endif

! Elif: overwrite Vs, Vp, and rho data
if ( IS_GRONINGEN_VELOCMODEL ) then
vs = real(Vs_user(iglob, 1))
vp = real(Vp_user(iglob, 1))
rho = real(rho_user(iglob, 1))
! print info for calm mind
if (iglob == 1 .or. iglob==nglob) &
write(*,*) 'iglob, nglob, vs, vp, rho', iglob, nglob, vs, vp, rho
endif


! stores velocity model

Expand Down

0 comments on commit 99c5505

Please sign in to comment.