Skip to content

Commit

Permalink
adds myrank to constants module; comments out unused routines; adds i…
Browse files Browse the repository at this point in the history
…nitial openmp statements
  • Loading branch information
danielpeter committed Jul 2, 2019
1 parent d089ceb commit f3c26a3
Show file tree
Hide file tree
Showing 78 changed files with 1,614 additions and 1,580 deletions.
5 changes: 1 addition & 4 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,7 @@ GENCODE_70 = -gencode=arch=compute_70,code=\"sm_70,compute_70\"
@COND_OMP_TRUE@OPENMP = yes
@COND_OMP_FALSE@OPENMP = no

@COND_OMP_TRUE@OMP_FLAGS = @OMP_FCFLAGS@ $(FC_DEFINE)USE_OPENMP
@COND_OMP_FALSE@OMP_FLAGS =

FCFLAGS += $(OMP_FLAGS)
@COND_OMP_TRUE@FCFLAGS += $(FC_DEFINE)USE_OPENMP @OMP_FCFLAGS@

@COND_OMP_TRUE@OMP_LIBS = $(OMP_LIB)
@COND_OMP_FALSE@OMP_LIBS =
Expand Down
4 changes: 2 additions & 2 deletions src/auxiliaries/combine_vol_data.F90
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ program combine_vol_data
character(len=MAX_STRING_LEN*2) :: mesh_file,local_data_file
character(len=MAX_STRING_LEN) :: data_array_name
logical :: HIGH_RESOLUTION_MESH,BROADCAST_AFTER_READ
integer :: ires,myrank
integer :: ires

! Variables to read ADIOS files
integer :: sizeprocs
Expand All @@ -96,7 +96,7 @@ program combine_vol_data
! needs local_path for mesh files
myrank = 0
BROADCAST_AFTER_READ = .false.
call read_parameter_file(myrank,BROADCAST_AFTER_READ)
call read_parameter_file(BROADCAST_AFTER_READ)

! reads in arguments
do i = 1, command_argument_count()
Expand Down
2 changes: 1 addition & 1 deletion src/auxiliaries/combine_vol_data_vtk_binary.F90
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ program combine_vol_data
! needs local_path for mesh files
myrank = 0
BROADCAST_AFTER_READ = .false.
call read_parameter_file(myrank,BROADCAST_AFTER_READ)
call read_parameter_file(BROADCAST_AFTER_READ)

! reads in arguments
do i = 1, command_argument_count()
Expand Down
4 changes: 2 additions & 2 deletions src/auxiliaries/create_movie_shakemap_AVS_DX_GMT.f90
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ program create_movie_shakemap
! order of points representing the 2D square element
integer,dimension(NGNOD2D_FOUR_CORNERS_AVS_DX),parameter :: iorder = (/1,3,2,4/)

integer :: NSPEC_SURFACE_EXT_MESH,myrank
integer :: NSPEC_SURFACE_EXT_MESH
logical :: BROADCAST_AFTER_READ

! ************** PROGRAM STARTS HERE **************
Expand All @@ -123,7 +123,7 @@ program create_movie_shakemap
BROADCAST_AFTER_READ = .false.

! read the parameter file
call read_parameter_file(myrank,BROADCAST_AFTER_READ)
call read_parameter_file(BROADCAST_AFTER_READ)

! only one global array for movie data, but stored for all surfaces defined
! in file 'surface_from_mesher.h'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ program project_and_combine_vol_data_on_regular_grid

! needs local_path for mesh files
BROADCAST_AFTER_READ = .true.
call read_parameter_file(myrank,BROADCAST_AFTER_READ)
call read_parameter_file(BROADCAST_AFTER_READ)

! parse command line arguments
if (command_argument_count() /= NARGS) then
Expand Down
2 changes: 1 addition & 1 deletion src/decompose_mesh/program_decompose_mesh.f90
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ program xdecompose_mesh
! needs local_path for mesh files
myrank = 0
BROADCAST_AFTER_READ = .false.
call read_parameter_file(myrank,BROADCAST_AFTER_READ)
call read_parameter_file(BROADCAST_AFTER_READ)

! checks adios parameters
if (ADIOS_FOR_DATABASES) then
Expand Down
2 changes: 1 addition & 1 deletion src/decompose_mesh/program_decompose_mesh_mpi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ program xdecompose_mesh_mpi
call world_rank(myrank)

! 1/ read Par_file
call read_parameter_file(myrank, BROADCAST_AFTER_READ)
call read_parameter_file(BROADCAST_AFTER_READ)

! safety check, won't work yet with local-time stepping
if (LTS_MODE) stop 'LTS_MODE not supported yet with parallel mesh decomposer!'
Expand Down
46 changes: 23 additions & 23 deletions src/generate_databases/create_regions_mesh.f90
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ subroutine create_regions_mesh()
nodes_coords_ext_mesh,nnodes_ext_mesh,elmnts_ext_mesh,nelmnts_ext_mesh,ANY_FAULT_IN_THIS_PROC)

! if faults exist this reads nodes_coords_open
call fault_read_input(prname,myrank)
call fault_read_input(prname)

! fills location and weights for Gauss-Lobatto-Legendre points, shape and derivations,
! returns jacobianstore,xixstore,...gammazstore
Expand Down Expand Up @@ -129,8 +129,8 @@ subroutine create_regions_mesh()
endif
! at this point (xyz)store_dummy are still open
if (.not. PARALLEL_FAULT) then
call fault_setup (ibool,nnodes_ext_mesh,nodes_coords_ext_mesh, &
xstore,ystore,zstore,nspec,nglob,myrank)
call fault_setup(ibool,nnodes_ext_mesh,nodes_coords_ext_mesh, &
xstore,ystore,zstore,nspec,nglob)
endif
! this closes (xyz)store_dummy
endif
Expand All @@ -155,8 +155,8 @@ subroutine create_regions_mesh()
if (PARALLEL_FAULT .and. ANY_FAULT) then
call synchronize_all()
!at this point (xyz)store_dummy are still open
call fault_setup (ibool,nnodes_ext_mesh,nodes_coords_ext_mesh, &
xstore,ystore,zstore,nspec,nglob,myrank)
call fault_setup(ibool,nnodes_ext_mesh,nodes_coords_ext_mesh, &
xstore,ystore,zstore,nspec,nglob)
! this closes (xyz)store_dummy
endif

Expand Down Expand Up @@ -330,13 +330,13 @@ subroutine create_regions_mesh()

if (POROELASTIC_SIMULATION) then
!chris: check for poro: At the moment cpI & cpII are for eta=0
call check_mesh_resolution_poro(myrank,nspec,nglob_dummy,ibool, &
call check_mesh_resolution_poro(nspec,nglob_dummy,ibool, &
xstore_dummy,ystore_dummy,zstore_dummy, &
-1.0d0, model_speed_max,min_resolved_period, &
phistore,tortstore,rhoarraystore,rho_vpI,rho_vpII,rho_vsI, &
LOCAL_PATH,SAVE_MESH_FILES )
else
call check_mesh_resolution(myrank,nspec,nglob_dummy, &
call check_mesh_resolution(nspec,nglob_dummy, &
ibool,xstore_dummy,ystore_dummy,zstore_dummy, &
kappastore,mustore,rho_vp,rho_vs, &
-1.0d0,model_speed_max,min_resolved_period, &
Expand All @@ -351,7 +351,7 @@ subroutine create_regions_mesh()
write(IMAIN,*) ' ...saving attenuation databases'
call flush_IMAIN()
endif
call get_attenuation_model(myrank,nspec,USE_OLSEN_ATTENUATION,OLSEN_ATTENUATION_RATIO, &
call get_attenuation_model(nspec,USE_OLSEN_ATTENUATION,OLSEN_ATTENUATION_RATIO, &
mustore,rho_vs,kappastore,rho_vp,qkappa_attenuation_store,qmu_attenuation_store, &
ispec_is_elastic,min_resolved_period,prname,ATTENUATION_f0_REFERENCE)
endif
Expand Down Expand Up @@ -821,13 +821,13 @@ subroutine crm_ext_setup_jacobian(myrank, &
call zwgljd(zigll,wzgll,NGLLZ,GAUSSALPHA,GAUSSBETA)

! get the 3-D shape functions
call get_shape3D(myrank,shape3D,dershape3D,xigll,yigll,zigll,NGNOD)
call get_shape3D(shape3D,dershape3D,xigll,yigll,zigll,NGNOD)

! get the 2-D shape functions
call get_shape2D(myrank,shape2D_x,dershape2D_x,yigll,zigll,NGLLY,NGLLZ,NGNOD,NGNOD2D)
call get_shape2D(myrank,shape2D_y,dershape2D_y,xigll,zigll,NGLLX,NGLLZ,NGNOD,NGNOD2D)
call get_shape2D(myrank,shape2D_bottom,dershape2D_bottom,xigll,yigll,NGLLX,NGLLY,NGNOD,NGNOD2D)
call get_shape2D(myrank,shape2D_top,dershape2D_top,xigll,yigll,NGLLX,NGLLY,NGNOD,NGNOD2D)
call get_shape2D(shape2D_x,dershape2D_x,yigll,zigll,NGLLY,NGLLZ,NGNOD,NGNOD2D)
call get_shape2D(shape2D_y,dershape2D_y,xigll,zigll,NGLLX,NGLLZ,NGNOD,NGNOD2D)
call get_shape2D(shape2D_bottom,dershape2D_bottom,xigll,yigll,NGLLX,NGLLY,NGNOD,NGNOD2D)
call get_shape2D(shape2D_top,dershape2D_top,xigll,yigll,NGLLX,NGLLY,NGNOD,NGNOD2D)

! 2D weights
do j=1,NGLLY
Expand Down Expand Up @@ -1111,11 +1111,11 @@ subroutine crm_setup_moho( myrank,nspec, &
call get_element_face_gll_indices(iface,ijk_face,NGLLX,NGLLZ)

! weighted jacobian and normal
call get_jacobian_boundary_face(myrank,nspec, &
xstore_dummy,ystore_dummy,zstore_dummy,ibool,nglob_dummy, &
dershape2D_x,dershape2D_y,dershape2D_bottom,dershape2D_top, &
wgllwgll_xy,wgllwgll_xz,wgllwgll_yz, &
ispec,iface,jacobian2Dw_face,normal_face,NGLLX,NGLLZ,NGNOD2D)
call get_jacobian_boundary_face(nspec, &
xstore_dummy,ystore_dummy,zstore_dummy,ibool,nglob_dummy, &
dershape2D_x,dershape2D_y,dershape2D_bottom,dershape2D_top, &
wgllwgll_xy,wgllwgll_xz,wgllwgll_yz, &
ispec,iface,jacobian2Dw_face,normal_face,NGLLX,NGLLZ,NGNOD2D)

! normal convention: points away from element
! switch normal direction if necessary
Expand Down Expand Up @@ -1204,11 +1204,11 @@ subroutine crm_setup_moho( myrank,nspec, &

! re-computes face infos
! weighted jacobian and normal
call get_jacobian_boundary_face(myrank,nspec, &
xstore_dummy,ystore_dummy,zstore_dummy,ibool,nglob_dummy, &
dershape2D_x,dershape2D_y,dershape2D_bottom,dershape2D_top, &
wgllwgll_xy,wgllwgll_xz,wgllwgll_yz, &
ispec,iface,jacobian2Dw_face,normal_face,NGLLX,NGLLZ,NGNOD2D)
call get_jacobian_boundary_face(nspec, &
xstore_dummy,ystore_dummy,zstore_dummy,ibool,nglob_dummy, &
dershape2D_x,dershape2D_y,dershape2D_bottom,dershape2D_top, &
wgllwgll_xy,wgllwgll_xz,wgllwgll_yz, &
ispec,iface,jacobian2Dw_face,normal_face,NGLLX,NGLLZ,NGNOD2D)

! normal convention: points away from element
! switch normal direction if necessary
Expand Down
27 changes: 13 additions & 14 deletions src/generate_databases/fault_generate_databases.f90
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ module fault_generate_databases
contains

!=================================================================================================================
subroutine fault_read_input(prname,myrank)
subroutine fault_read_input(prname)

use constants, only: MAX_STRING_LEN, IN_DATA_FILES
use constants, only: MAX_STRING_LEN, IN_DATA_FILES,myrank

implicit none
character(len=MAX_STRING_LEN), intent(in) :: prname
integer, intent(in) :: myrank

integer :: nb,i,iflt,ier,nspec,dummy_node
integer, parameter :: IIN_PAR = 100
Expand Down Expand Up @@ -188,12 +188,13 @@ end subroutine fault_read_input
!==================================================================================================================

subroutine fault_setup(ibool,nnodes_ext_mesh,nodes_coords_ext_mesh, &
xstore,ystore,zstore,nspec,nglob,myrank)
xstore,ystore,zstore,nspec,nglob)

implicit none

integer, intent(in) :: nspec
double precision, dimension(NGLLX,NGLLY,NGLLZ,nspec), intent(inout) :: xstore,ystore,zstore
integer, dimension(NGLLX,NGLLY,NGLLZ,nspec), intent(in) :: ibool
integer, intent(in) :: myrank
integer, intent(in) :: nglob
integer, intent(in) :: nnodes_ext_mesh
double precision, dimension(NDIM,nnodes_ext_mesh),intent(in) :: nodes_coords_ext_mesh
Expand Down Expand Up @@ -226,7 +227,7 @@ subroutine fault_setup(ibool,nnodes_ext_mesh,nodes_coords_ext_mesh, &

call save_fault_xyzcoord_ibulk(fault_db(iflt))

call setup_normal_jacobian(fault_db(iflt),ibool,nspec,nglob,myrank)
call setup_normal_jacobian(fault_db(iflt),ibool,nspec,nglob)

enddo

Expand Down Expand Up @@ -497,7 +498,7 @@ end subroutine save_fault_xyzcoord_ibulk

!=================================================================================

subroutine setup_normal_jacobian(fdb,ibool,nspec,nglob,myrank)
subroutine setup_normal_jacobian(fdb,ibool,nspec,nglob)

use create_regions_mesh_ext_par, only: xstore_dummy,ystore_dummy,zstore_dummy, &
dershape2D_x,dershape2D_y,dershape2D_bottom,dershape2D_top, &
Expand All @@ -509,8 +510,6 @@ subroutine setup_normal_jacobian(fdb,ibool,nspec,nglob,myrank)
type(fault_db_type), intent(inout) :: fdb
integer, intent(in) :: nspec,nglob, ibool(NGLLX,NGLLY,NGLLZ,nspec)

integer, intent(in) :: myrank

! (assumes NGLLX=NGLLY=NGLLZ)
real(kind=CUSTOM_REAL),dimension(NGNOD2D) :: xcoord,ycoord,zcoord
real(kind=CUSTOM_REAL) :: jacobian2Dw_face(NGLLX,NGLLY)
Expand Down Expand Up @@ -545,11 +544,11 @@ subroutine setup_normal_jacobian(fdb,ibool,nspec,nglob,myrank)
enddo

! gets face GLL 2Djacobian, weighted from element face
call get_jacobian_boundary_face(myrank,nspec, &
xstore_dummy,ystore_dummy,zstore_dummy,ibool,nglob, &
dershape2D_x,dershape2D_y,dershape2D_bottom,dershape2D_top, &
wgllwgll_xy,wgllwgll_xz,wgllwgll_yz, &
ispec,iface_ref,jacobian2Dw_face,normal_face,NGLLX,NGLLY,NGNOD2D)
call get_jacobian_boundary_face(nspec, &
xstore_dummy,ystore_dummy,zstore_dummy,ibool,nglob, &
dershape2D_x,dershape2D_y,dershape2D_bottom,dershape2D_top, &
wgllwgll_xy,wgllwgll_xz,wgllwgll_yz, &
ispec,iface_ref,jacobian2Dw_face,normal_face,NGLLX,NGLLY,NGNOD2D)

! normal convention: points away from domain1, reference element.
do j=1,NGLLY
Expand Down
21 changes: 2 additions & 19 deletions src/generate_databases/generate_databases_par.F90
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,7 @@

module generate_databases_par

use constants, only: NGLLX,NGLLY,NGLLZ,NGLLSQUARE,NDIM,NDIM2D,NGNOD2D_FOUR_CORNERS,N_SLS, &
CUSTOM_REAL,SIZE_REAL,SIZE_DOUBLE, &
IMAIN,IIN,IOUT,ISTANDARD_OUTPUT, &
ZERO,ONE,TWO,FOUR_THIRDS,PI,HUGEVAL,GAUSSALPHA,GAUSSBETA, &
SMALLVAL_TOL,TINYVAL,HUGEVAL,R_EARTH, &
MAX_STRING_LEN,ATTENUATION_COMP_MAXIMUM, &
MINIMUM_THICKNESS_3D_OCEANS,RHO_APPROXIMATE_OCEAN_LOAD, &
CPML_X_ONLY,CPML_Y_ONLY,CPML_Z_ONLY, &
CPML_XY_ONLY,CPML_XZ_ONLY,CPML_YZ_ONLY,CPML_XYZ, &
NPOWER,CPML_Rcoef, &
IMODEL_DEFAULT,IMODEL_GLL,IMODEL_1D_PREM,IMODEL_1D_CASCADIA,IMODEL_1D_SOCAL, &
IMODEL_SALTON_TROUGH,IMODEL_TOMO,IMODEL_USER_EXTERNAL,IMODEL_IPATI,IMODEL_IPATI_WATER, &
IMODEL_1D_PREM_PB,IMODEL_SEP,IMODEL_COUPLED, &
IDOMAIN_ACOUSTIC,IDOMAIN_ELASTIC,IDOMAIN_POROELASTIC, &
OUTPUT_FILES, &
NX_TOPO_FILE,NY_TOPO_FILE, &
USE_MESH_COLORING_GPU,MAX_NUMBER_OF_COLORS, &
ADIOS_TRANSPORT_METHOD
use constants

use shared_parameters

Expand All @@ -60,7 +43,7 @@ module generate_databases_par
double precision, dimension(:,:,:,:), allocatable :: xstore,ystore,zstore

! proc numbers for MPI
integer :: myrank,sizeprocs,ier
integer :: sizeprocs,ier

integer :: NX_TOPO,NY_TOPO
integer, dimension(:,:), allocatable :: itopo_bathy
Expand Down
Loading

0 comments on commit f3c26a3

Please sign in to comment.