Changeset f55fdce in flexpart.git


Ignore:
Timestamp:
Sep 13, 2015, 7:22:55 PM (9 years ago)
Author:
Espen Sollum ATMOS <eso@…>
Branches:
master, 10.4.1_pesei, GFS_025, bugfixes+enhancements, dev, release-10, release-10.4.1, scaling-bug, univie
Children:
57c5b2e
Parents:
478e9e6
Message:

Added a modification so thah number of particles in simulation reported to standard output (MPI version) is exact instead of estimated

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/mpi_mod.f90

    r78e62dc rf55fdce  
    113113! mp_measure_time   Measure cpu/wall time, write out at end of run
    114114! mp_time_barrier   Measure MPI barrier time
     115! mp_exact_numpart  Use an extra MPI communication to give the exact number of particles
     116!                   to standard output (this does *not* otherwise affect the simulation)
    115117  logical, parameter :: mp_dbg_mode = .false.
    116118  logical, parameter :: mp_dev_mode = .false.
    117119  logical, parameter :: mp_dbg_out = .false.
    118120  logical, parameter :: mp_time_barrier=.true.
    119   logical, parameter :: mp_measure_time=.false.
     121  logical, parameter :: mp_measure_time=.false.
     122  logical, parameter :: mp_exact_numpart=.true.
    120123
    121124! for measuring CPU/Wall time
     
    19791982    call MPI_BARRIER(MPI_COMM_WORLD, mp_ierr)
    19801983
    1981     if (lroot) then
     1984    if (lroot.and.mp_measure_time) then
    19821985      write(*,FMT='(72("#"))')
    19831986      WRITE(*,*) "To turn off output of time measurements, set "
  • src/timemanager_mpi.f90

    r78e62dc rf55fdce  
    111111  integer :: ix,jy,ldeltat,itage,nage
    112112  integer :: i_nan=0,ii_nan,total_nan_intl=0  !added by mc to check instability in CBL scheme
     113  integer :: numpart_tot_mpi ! for summing particles on all processes
    113114  real :: outnum,weight,prob(maxspec)
    114115  real :: decfact
     
    137138! Loop over the whole modelling period in time steps of mintime seconds
    138139!**********************************************************************
    139 
    140 
    141 !  itime=0
    142   if (lroot) then
    143   !  write(*,45) itime,numpart*mp_partgroup_np,gridtotalunc,wetgridtotalunc,drygridtotalunc
    144     write(*,46) float(itime)/3600,itime,numpart*mp_partgroup_np
    145 
    146     if (verbosity.gt.0) then
    147       write (*,*) 'timemanager> starting simulation'
    148     end if
    149   end if ! (lroot)
    150140
    151141  do itime=0,ideltas,lsynctime
     
    215205
    216206    if (mp_measure_time) call mpif_mtime('getfields',1)
    217 
    218207
    219208
     
    536525        if (mp_measure_time) call mpif_mtime('iotime',1)
    537526
    538         if (lroot) write(*,45) itime,numpart*mp_partgroup_np,gridtotalunc,&
    539              &wetgridtotalunc,drygridtotalunc
    540 !      if (lroot) write(*,46) float(itime)/3600,itime,numpart*mp_partgroup_np
     527
     528! Decide whether to write an estimate of the number of particles released,
     529! or exact number (require MPI reduce operation)
     530        numpart_tot_mpi = numpart*mp_partgroup_np
     531
     532        if (mp_exact_numpart.and..not.(lmpreader.and.lmp_use_reader)) then
     533          call MPI_Reduce(numpart, numpart_tot_mpi, 1, MPI_INTEGER, MPI_SUM, id_root, &
     534               & mp_comm_used, mp_ierr)
     535        endif
     536       
     537        if (lroot) then
     538          write(*,45) itime,numpart_tot_mpi,gridtotalunc,&
     539               &wetgridtotalunc,drygridtotalunc
     540          if (verbosity.gt.0) then
     541            write (*,*) 'timemanager> starting simulation'
     542          end if
     543        end if
     544
    54154545      format(i13,' SECONDS SIMULATED: ',i13, ' PARTICLES:    Uncertainty: ',3f7.3)
    54254646      format(' Simulated ',f7.1,' hours (',i13,' s), ',i13, ' particles')
     
    556560          call conccalc(itime,weight)
    557561        endif
    558 
    559562
    560563
     
    771774    if (cblflag.eq.1) print *,j,itime,'nan_synctime',nan_count,'nan_tl',total_nan_intl 
    772775
    773 ! TODO: delete for release version?
    774 !!-------------------------------------------------------------------------------
    775 ! These lines below to test the well-mixed condition, modified by  mc, not to
    776 ! be included in final release:
    777 !
    778 ! if (itime.eq.0) then
    779 ! open(551,file='/home/mc/test_cbl/out/WELLMIXEDTEST_CBL_lonlat_9_33_100_3hours_3htp_cd.DAT')
    780 ! open(552,file='/home/mc/test_cbl/out/avg_ol_h_wst_lonlat_9_33_100_3hours_3htp_cd.DAT')
    781 ! end if
    782 ! write(552,'(5F16.7)')itime*1./3600.,avg_wst/well_mixed_norm,avg_ol/well_mixed_norm,avg_h/well_mixed_norm
    783 ! do j=1,25
    784 !      !write(551,*))itime*1.,h_well/50.*j,well_mixed_vector(j)/well_mixed_norm*50.
    785 !     avg_air_dens(j)=avg_air_dens(j)/well_mixed_vector(j)
    786 !     write(551,'(5F16.7)')itime*1.,h_well/25.*j,well_mixed_vector(j)/well_mixed_norm*25.,avg_air_dens(j),0.04*j
    787 ! end do
    788 !!------------------------------------------------------------------------------
    789776
    790777  end do ! itime=0,ideltas,lsynctime
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG