Skip to content
Snippets Groups Projects
Commit 6235c929 authored by Matthias Schmiddunser's avatar Matthias Schmiddunser
Browse files

Fixing Age Calculation and Output

parent 7ac25704
No related branches found
No related tags found
No related merge requests found
......@@ -115,6 +115,7 @@ if (iproc==0) then
write (*,'(a)') '! 8888888P" "Y88888P" "Y88888P" d88P 888 888 T88b |'
write (*,'(a)') '! |'
write (*,'(a)') '! DOUAR-WSMP post-processor for the tracking cloud |'
write (*,'(a,i3,a)') '! Running on ', nproc,' nodes |'
write (*,'(a)') '!------------------------------------------------------------------------------|'
write (*,'(a)') '!------------------------------------------------------------------------------|'
write (*,*) ''
......@@ -200,6 +201,7 @@ if (iproc==0) then
end if
!Distribute output parameters to other processes
call mpi_bcast (outparam%mode,1,mpi_integer,0,mpi_comm_world,ierr)
call mpi_bcast (outparam%pad_age,1,mpi_integer,0,mpi_comm_world,ierr)
call mpi_bcast (outparam%Mad_AHe_std,1,mpi_integer,0,mpi_comm_world,ierr)
call mpi_bcast (outparam%Mad_AHe_small,1,mpi_integer,0,mpi_comm_world,ierr)
......@@ -261,6 +263,8 @@ outparam%nages = sum(Mad_He_inputs) + & !Mad_He inputs
outparam%Biotite + outparam%Rutile_U_Pb + outparam%Titanite_U_Pb + &
outparam%Zircon_U_Pb !age_algorithms inputs
write (* ,*) 'iproc',iproc , 'nages:', outparam%nages
allocate (allages(outparam%nages),stat=err); if (err.ne.0) call stop_run ('Error alloc allages')
!writing output parameters to screen
......@@ -490,14 +494,14 @@ ages: if ((outparam%mode==1 .or. outparam%mode==2) .AND. trcl%ntracks>0) then
if (outparam%Zircon_U_Pb==1) allocate (trcl%Zircon_U_Pb(trcl%ntracks))
tracksent = 0
!write (* ,*) 'iproc',iproc , 'ntracks:', trcl%ntracks, 'nproc: ',nproc, 'tracksent', tracksent
!write (* ,*) iproc, ': ntracks:', trcl%ntracks, 'nproc: ',nproc
!wait for answer, distribute new track
workdistr: do i=2-nproc,trcl%ntracks
!for f irst nproc-1 times, send to processes without receive
!distribute one track to each processor
if (i>0) then
!get resul t from other process
!get result from other process
call MPI_RECV (allages,outparam%nages,MPI_REAL,MPI_ANY_SOURCE, &
MPI_ANY_TAG,MPI_COMM_WORLD,mpistatus,ierr)
......@@ -505,7 +509,7 @@ ages: if ((outparam%mode==1 .or. outparam%mode==2) .AND. trcl%ntracks>0) then
sender = mpistatus(MPI_SOURCE)
itrack = mpistatus(MPI_TAG)
write (*,'(i3,a,i5,a,i3,i2)') iproc, ': received track',itrack,' from proc ',sender, 'length = ',outparam%nages
!write (*,'(i3,a,i5,a,i3,a,i2)') iproc, ': received track',itrack,' from proc ',sender, 'length = ',outparam%nages
!Write into result arrays
k = 1
......@@ -660,7 +664,7 @@ ages: if ((outparam%mode==1 .or. outparam%mode==2) .AND. trcl%ntracks>0) then
else workshare
!slaves doing actual calculation
!write (* ,*) 'iproc',iproc , 'ntracks:', trcl%ntracks, 'nproc: ',nproc
write (* ,*) 'iproc',iproc , 'ntracks:', trcl%ntracks, 'nproc: ',nproc
agecalc: do
call MPI_probe (0, MPI_ANY_TAG, MPI_COMM_WORLD, mpistatus, ierr)
itrack = mpistatus(MPI_TAG)
......@@ -689,6 +693,7 @@ ages: if ((outparam%mode==1 .or. outparam%mode==2) .AND. trcl%ntracks>0) then
k=1
!routines from Mad_He
if (sum(Mad_He_inputs)>0) then
!write (*,*) 'Proc', iproc, 'Calling Mad_He for track ', itrack
call Mad_He (dble(send_time), dble(send_temp), send_nstep, Mad_He_ages,Mad_He_inputs,21)
if (outparam%Mad_AHe_std==1) then
Mad_AHe_std = Mad_He_ages(1)
......
......@@ -11,7 +11,7 @@ type (input_parameters) :: inparam
type (output_parameters) :: outparam
integer :: write_nstep,write_points,write_tracks
integer :: i,k,l,ipoint
integer :: i,k,l,l2,ipoint
character(4) :: cistep
......@@ -46,7 +46,9 @@ writeages: do l=outparam%first,outparam%last,outparam%step
else
write(40,'(a)')'Time_DOUAR 1 1 double'
end if
write(40,'(ES12.5E2)') trcl%time(l)
!l2 is the index for step l in master array
l2 = (l-outparam%first)/outparam%step+1
write(40,'(ES12.5E2)') trcl%time(l2)
write(40,'(a)')'Step 1 1 int'
write(40,'(i6)') l
write(40, '(a)') ''
......@@ -378,7 +380,9 @@ if (outparam%mode==2 .and. trcl%ntracks>0) then
else
write(30,'(a)')'Time_DOUAR 1 1 double'
end if
write(30,'(ES12.5E2)') trcl%time(l)
!l2 is the index for step l in master array
l2 = (l-outparam%first)/outparam%step+1
write(30,'(ES12.5E2)') trcl%time(l2)
write(30,'(a)')'Step 1 1 int'
write(30,'(i6)') l
write(30, '(a)') ''
......
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