[cig-commits] commit: Fix zero initialization and output of afterslip.
Mercurial
hg at geodynamics.org
Thu Dec 27 17:28:17 PST 2012
changeset: 170:b0e62b2f8d65
tag: tip
user: Walter Landry <wlandry at caltech.edu>
date: Thu Dec 27 17:27:30 2012 -0800
files: src/export.f90 src/friction3d.f90 src/input.f90 src/relax.f90 wscript
description:
Fix zero initialization and output of afterslip.
diff -r 5548f49d4c65 -r b0e62b2f8d65 src/export.f90
--- a/src/export.f90 Sun Dec 23 21:52:06 2012 -0800
+++ b/src/export.f90 Thu Dec 27 17:27:30 2012 -0800
@@ -920,7 +920,8 @@ END SUBROUTINE exporteigenstrain
WRITE (15,'("# x1 x2 x3 yr yz", &
& " slip strike-slip dip-slip velocity ss vel", &
& " ds vel taus sig11 sig12 sig13 sig22 sig23 sig33")')
- WRITE (15,'(18ES11.3E2)') ((n(k)%patch(i1,i2)%x1,n(k)%patch(i1,i2)%x3,n(k)%patch(i1,i2)%x3, &
+
+ WRITE (15,'(18ES11.3E2)') ((n(k)%patch(i1,i2)%x1,n(k)%patch(i1,i2)%x2,n(k)%patch(i1,i2)%x3, &
n(k)%patch(i1,i2)%lx,n(k)%patch(i1,i2)%lz, &
n(k)%patch(i1,i2)%slip, &
n(k)%patch(i1,i2)%ss, &
diff -r 5548f49d4c65 -r b0e62b2f8d65 src/friction3d.f90
--- a/src/friction3d.f90 Sun Dec 23 21:52:06 2012 -0800
+++ b/src/friction3d.f90 Thu Dec 27 17:27:30 2012 -0800
@@ -312,7 +312,6 @@ CONTAINS
patch(j2,j3)%x3=x3
patch(j2,j3)%lx=yr
patch(j2,j3)%lz=zr
- patch(j2,j3)%sig=s
! discard out-of-bound locations
IF ( (x1 .GT. DBLE(sx1/2-1)*dx1) .OR. (x1 .LT. -DBLE(sx1/2)*dx1) &
@@ -330,6 +329,7 @@ CONTAINS
! traction = sigma . n
s=sig(i1,i2,i3)
+ patch(j2,j3)%sig=s
t=s .tdot. n
! signed normal component
@@ -426,14 +426,14 @@ CONTAINS
DO j3=1,px3
! loop in the strike direction
DO j2=1,px2
- ! cumulative creep
- n(k)%patch(j2,j3)%slip=n(k)%patch(j2,j3)%slip+dt*n(k)%patch(j2,j3)%v
-
! cumulative strike-direction creep
n(k)%patch(j2,j3)%ss=n(k)%patch(j2,j3)%ss+dt*n(k)%patch(j2,j3)%vss
! cumulative dip-direction creep
n(k)%patch(j2,j3)%ds=n(k)%patch(j2,j3)%ds+dt*n(k)%patch(j2,j3)%vds
+
+ ! cumulative creep
+ n(k)%patch(j2,j3)%slip=(n(k)%patch(j2,j3)%ds**2+n(k)%patch(j2,j3)%ss**2)**0.5
END DO
END DO
diff -r 5548f49d4c65 -r b0e62b2f8d65 src/input.f90
--- a/src/input.f90 Sun Dec 23 21:52:06 2012 -0800
+++ b/src/input.f90 Thu Dec 27 17:27:30 2012 -0800
@@ -818,6 +818,7 @@ CONTAINS
ALLOCATE(in%n(k)%patch(in%n(k)%px2,in%n(k)%px3),STAT=iostatus)
IF (iostatus>0) STOP "could not allocate the fault patches"
+ in%n(k)%patch(:,:)=SLIPPATCH_STRUCT(0,0,0,0,0,0,0,0,0,0,0,0,TENSOR(0,0,0,0,0,0))
#ifdef VTK
! export the afterslip segment in VTK format
@@ -859,6 +860,7 @@ CONTAINS
in%inter%s(k)%x,in%inter%s(k)%y,in%inter%s(k)%z, &
in%inter%s(k)%length,in%inter%s(k)%width, &
in%inter%s(k)%strike,in%inter%s(k)%dip,in%inter%s(k)%rake
+ in%inter%s(k)%opening=0
! copy the input format for display
in%inter%sc(k)=in%inter%s(k)
@@ -1023,6 +1025,7 @@ CONTAINS
in%events(e)%s(k)%length,in%events(e)%s(k)%width, &
in%events(e)%s(k)%strike,in%events(e)%s(k)%dip,in%events(e)%s(k)%rake, &
in%events(e)%s(k)%beta
+ in%events(e)%s(k)%opening=0
SELECT CASE(iostatus)
CASE (1:)
diff -r 5548f49d4c65 -r b0e62b2f8d65 src/relax.f90
--- a/src/relax.f90 Sun Dec 23 21:52:06 2012 -0800
+++ b/src/relax.f90 Thu Dec 27 17:27:30 2012 -0800
@@ -270,6 +270,7 @@ PROGRAM relax
IF (in%isoutputrelax) THEN
ALLOCATE(inter1(in%sx1+2,in%sx2,2),inter2(in%sx1+2,in%sx2,2),inter3(in%sx1+2,in%sx2,2),STAT=iostatus)
IF (iostatus>0) STOP "could not allocate memory for postseismic displacement"
+ inter1=0;inter2=0;inter3=0;
END IF
v1=0;v2=0;v3=0;u1=0;u2=0;u3=0;gamma=0;t1=0;t2=0;t3=0
@@ -332,7 +333,7 @@ PROGRAM relax
in%dx1,in%dx2,in%dx3,in%sx1,in%sx2,in%sx3/2,in%wdir,0)
! export equivalent body forces
- IF (isoutput(in%skip,t,i,in%odt,oi,in%events(e)%time)) THEN
+ IF (isoutput(in%skip,t,0,in%odt,oi,in%events(e)%time)) THEN
#ifdef GRD_EQBF
IF (in%isoutputgrd) THEN
CALL exportgrd(v1,v2,v3,in%sx1,in%sx2,in%sx3/2, &
diff -r 5548f49d4c65 -r b0e62b2f8d65 wscript
--- a/wscript Sun Dec 23 21:52:06 2012 -0800
+++ b/wscript Thu Dec 27 17:27:30 2012 -0800
@@ -53,24 +53,24 @@ def configure(cnf):
def configure(cnf):
cnf.load('compiler_c compiler_fc')
- # Check for -zero or -finit-local-zero. We check it first, before
- # setting CFLAGS, because optimization can ruin this test.
- frag="program main\n INTEGER :: foo\n call exit(foo)\n" + "end program main\n"
- zero_flags=['-zero','-finit-local-zero']
- if cnf.options.zero_flag:
- zero_flags=[cnf.options.zero_flag]
- found_zero=False
- for flag in zero_flags:
- try:
- cnf.check_fc(fragment=frag,msg="Checking zero option " + flag,
- fcflags=flag,uselib_store='zero',execute=True)
- except:
- continue
- else:
- found_zero=True
- break
- if not found_zero:
- cnf.fatal("Could not find an option for zero'ing initial values")
+ # # Check for -zero or -finit-local-zero. We check it first, before
+ # # setting CFLAGS, because optimization can ruin this test.
+ # frag="program main\n INTEGER :: foo\n call exit(foo)\n" + "end program main\n"
+ # zero_flags=['-zero','-finit-local-zero']
+ # if cnf.options.zero_flag:
+ # zero_flags=[cnf.options.zero_flag]
+ # found_zero=False
+ # for flag in zero_flags:
+ # try:
+ # cnf.check_fc(fragment=frag,msg="Checking zero option " + flag,
+ # fcflags=flag,uselib_store='zero',execute=True)
+ # except:
+ # continue
+ # else:
+ # found_zero=True
+ # break
+ # if not found_zero:
+ # cnf.fatal("Could not find an option for zero'ing initial values")
# We set the flags here
if not cnf.env.CFLAGS:
@@ -234,6 +234,6 @@ def build(bld):
'src/input.f90',
'src/mkl_dfti.f90'],
includes=['build'],
- use=['gmt','proj','openmp','fftw','imkl','zero','cpp','length'],
+ use=['gmt','proj','openmp','fftw','imkl','cpp','length'],
target='relax'
)
More information about the CIG-COMMITS
mailing list