Skip to content
Snippets Groups Projects
Commit 9aad0858 authored by Dave Whipp's avatar Dave Whipp
Browse files

Updated isostasy code to update Moho position at the end of each time step

parent 87e87ff4
No related branches found
No related tags found
No related merge requests found
...@@ -1211,6 +1211,14 @@ do while (istep.le.params%nstep) ...@@ -1211,6 +1211,14 @@ do while (istep.le.params%nstep)
call interpolate_velocity_on_surface(params,surface,ov) call interpolate_velocity_on_surface(params,surface,ov)
!--------------------------------------------------------------------------------------
!--------------------------------------------------------------------------------------
! update Moho displacement
!--------------------------------------------------------------------------------------
!--------------------------------------------------------------------------------------
call show_time (total,step,inc,1,'Update Moho displacement$')
zi%zisodisp=zi%zisodisp-zi%zisoinc
!-------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------
!-------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------
! update strain, pressure, temperature on 3D cloud ! update strain, pressure, temperature on 3D cloud
...@@ -1227,12 +1235,8 @@ do while (istep.le.params%nstep) ...@@ -1227,12 +1235,8 @@ do while (istep.le.params%nstep)
call show_time (total,step,inc,1,'Advect the cloud$') call show_time (total,step,inc,1,'Advect the cloud$')
! call move_cloud (params,cl,ov%octree,ov%noctree,ov%unode,ov%vnode,ov%wnode,ov%nnode,ov%icon,ov%nleaves) ! call move_cloud (params,cl,ov%octree,ov%noctree,ov%unode,ov%vnode,ov%wnode,ov%nnode,ov%icon,ov%nleaves)
print *,'Cloud will be advected'
call move_cloud (params,cl,ov) call move_cloud (params,cl,ov)
print *,'Cloud has been moved'
call heap (threadinfo,'olsf%x','main',size(olsf%x),'dp',-1) ; deallocate (olsf%x) call heap (threadinfo,'olsf%x','main',size(olsf%x),'dp',-1) ; deallocate (olsf%x)
call heap (threadinfo,'olsf%y','main',size(olsf%y),'dp',-1) ; deallocate (olsf%y) call heap (threadinfo,'olsf%y','main',size(olsf%y),'dp',-1) ; deallocate (olsf%y)
call heap (threadinfo,'olsf%z','main',size(olsf%z),'dp',-1) ; deallocate (olsf%z) call heap (threadinfo,'olsf%z','main',size(olsf%z),'dp',-1) ; deallocate (olsf%z)
...@@ -1240,25 +1244,19 @@ do while (istep.le.params%nstep) ...@@ -1240,25 +1244,19 @@ do while (istep.le.params%nstep)
call heap (threadinfo,'olsf%icon','main',size(olsf%icon),'int',-1) ; deallocate (olsf%icon) call heap (threadinfo,'olsf%icon','main',size(olsf%icon),'int',-1) ; deallocate (olsf%icon)
call heap (threadinfo,'olsf%octree','main',size(olsf%octree),'int',-1) ; deallocate (olsf%octree) call heap (threadinfo,'olsf%octree','main',size(olsf%octree),'int',-1) ; deallocate (olsf%octree)
print *,'olsf stuff deallocated'
osolve%u=ov%unode osolve%u=ov%unode
osolve%v=ov%vnode osolve%v=ov%vnode
osolve%w=ov%wnode osolve%w=ov%wnode
osolve%wpreiso=ov%wnodepreiso osolve%wpreiso=ov%wnodepreiso
osolve%temp=ov%temp osolve%temp=ov%temp
print *,'osolve values transferred ov'
!-------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------
!-------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------
! write global output before deallocating arrays ! write global output before deallocating arrays
!-------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------
!-------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------
call show_time (total,step,inc,1,'Write output$') call show_time (total,step,inc,1,'Write output$')
print *,'Output will be generated now'
call write_global_output (params,istep,iter-1,current_time,osolve,ov,vo,surface,cl,zi,'final') call write_global_output (params,istep,iter-1,current_time,osolve,ov,vo,surface,cl,zi,'final')
print *,'Output written'
call mpi_barrier (mpi_comm_world,ierr) call mpi_barrier (mpi_comm_world,ierr)
!-------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------
...@@ -1364,7 +1362,10 @@ deallocate (surface) ...@@ -1364,7 +1362,10 @@ deallocate (surface)
deallocate (surface0) deallocate (surface0)
deallocate (mat) deallocate (mat)
!if (params%isobc) deallocate (zisodisp) !if (params%isobc) deallocate (zisodisp)
if (params%isobc) deallocate (zi%zisodisp) if (params%isobc) then
deallocate (zi%zisodisp)
deallocate (zi%zisoinc)
endif
deallocate (params%materialn) deallocate (params%materialn)
call heap_final (threadinfo) call heap_final (threadinfo)
......
...@@ -73,7 +73,9 @@ if (params%irestart.eq.0) then ...@@ -73,7 +73,9 @@ if (params%irestart.eq.0) then
allocate (cl%tag(1), stat=err) ; if (err.ne.0) call stop_run ('Error alloc cl%tag in define_cloud$') allocate (cl%tag(1), stat=err) ; if (err.ne.0) call stop_run ('Error alloc cl%tag in define_cloud$')
if (params%isobc) then if (params%isobc) then
allocate (zi%zisodisp(2**params%levelmax_oct+1,2**params%levelmax_oct+1), stat=err); if (err.ne.0) call stop_run ('Error alloc zi%zisodisp in define_cloud$') allocate (zi%zisodisp(2**params%levelmax_oct+1,2**params%levelmax_oct+1), stat=err); if (err.ne.0) call stop_run ('Error alloc zi%zisodisp in define_cloud$')
allocate (zi%zisoinc(2**params%levelmax_oct+1,2**params%levelmax_oct+1), stat=err); if (err.ne.0) call stop_run ('Error alloc zi%zisoinc in define_cloud$')
zi%zisodisp=0.d0 zi%zisodisp=0.d0
zi%zisoinc=0.d0
endif endif
else else
...@@ -97,7 +99,10 @@ else ...@@ -97,7 +99,10 @@ else
allocate (cl%temp(cl%np),stat=err) ; if (err.ne.0) call stop_run ('Error alloc cl%temp in define_cloud$') allocate (cl%temp(cl%np),stat=err) ; if (err.ne.0) call stop_run ('Error alloc cl%temp in define_cloud$')
allocate (cl%press(cl%np),stat=err) ; if (err.ne.0) call stop_run ('Error alloc cl%press in define_cloud$') allocate (cl%press(cl%np),stat=err) ; if (err.ne.0) call stop_run ('Error alloc cl%press in define_cloud$')
allocate (cl%tag(cl%np),stat=err) ; if (err.ne.0) call stop_run ('Error alloc cl%tag in define_cloud$') allocate (cl%tag(cl%np),stat=err) ; if (err.ne.0) call stop_run ('Error alloc cl%tag in define_cloud$')
if (params%isobc) allocate (zi%zisodisp(2**params%levelmax_oct+1,2**params%levelmax_oct+1), stat=err); if (err.ne.0) call stop_run ('Error alloc zi%zisodisp in define_cloud$') if (params%isobc) then
allocate (zi%zisodisp(2**params%levelmax_oct+1,2**params%levelmax_oct+1), stat=err); if (err.ne.0) call stop_run ('Error alloc zi%zisodisp in define_cloud$')
allocate (zi%zisoinc(2**params%levelmax_oct+1,2**params%levelmax_oct+1), stat=err); if (err.ne.0) call stop_run ('Error alloc zi%zisoinc in define_cloud$')
endif
read (19) (x, & read (19) (x, &
y, & y, &
...@@ -155,6 +160,7 @@ else ...@@ -155,6 +160,7 @@ else
read (19) dumpi read (19) dumpi
read (19) ((zi%zisodisp(i,j),j=1,2**params%levelmax_oct+1),& read (19) ((zi%zisodisp(i,j),j=1,2**params%levelmax_oct+1),&
i=1,2**params%levelmax_oct+1) i=1,2**params%levelmax_oct+1)
zi%zisoinc=0.d0
endif endif
! correct for vertical exaggeration ! correct for vertical exaggeration
......
...@@ -263,7 +263,8 @@ enddo ...@@ -263,7 +263,8 @@ enddo
endif endif
! Store the total displacement of the basal node plane ! Store the total displacement of the basal node plane
if (params%isobc .and. iter.eq.1) zi%zisodisp=zi%zisodisp-work !if (params%isobc .and. iter.eq.1) zi%zisodisp=zi%zisodisp-work
if (params%isobc .and. iter.eq.1) zi%zisoinc=work
! transforms the displacements into velocities and add this contribution to the velocity ! transforms the displacements into velocities and add this contribution to the velocity
! solution of the Stokes equation before interpolation onto the surfaces and their advection ! solution of the Stokes equation before interpolation onto the surfaces and their advection
......
...@@ -330,7 +330,7 @@ module definitions ...@@ -330,7 +330,7 @@ module definitions
! due to isostasy ! due to isostasy
type ziso type ziso
double precision,dimension(:,:),pointer::zisodisp double precision,dimension(:,:),pointer::zisodisp,zisoinc
end type ziso end type ziso
end module definitions end module definitions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment