Changeset 0a94e13 in flexpart.git
- Timestamp:
- May 6, 2019, 11:43:21 AM (5 years ago)
- Branches:
- master, 10.4.1_pesei, GFS_025, bugfixes+enhancements, dev, release-10, release-10.4.1, scaling-bug
- Children:
- 0c8c7f2
- Parents:
- 328fdf9
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
options/COMMAND
r2753a5c r0a94e13 19 19 IFINE= 4, ! Reduction for time step in vertical transport, used only if CTL>1 20 20 IOUT= 1, ! Output type: [1]mass 2]pptv 3]1&2 4]plume 5]1&4, +8 for NetCDF output 21 IPOUT= 0, ! Particle position output: 0]no 1]every output 2]only at end 21 IPOUT= 0, ! Particle position output: 0]no 1]every output 2]only at end 3]time averaged 22 22 LSUBGRID= 0, ! Increase of ABL heights due to sub-grid scale orographic variations;[0]off 1]on 23 23 LCONVECTION= 1, ! Switch for convection parameterization;0]off [1]on -
src/FLEXPART.f90
r2753a5c r0a94e13 68 68 integer :: detectformat 69 69 70 71 72 ! Initialize arrays in com_mod73 !*****************************74 call com_mod_allocate_part(maxpart)75 70 76 77 71 ! Generate a large number of random numbers 78 72 !****************************************** … … 172 166 endif 173 167 168 ! Initialize arrays in com_mod 169 !***************************** 170 call com_mod_allocate_part(maxpart) 171 172 174 173 ! Read the age classes to be used 175 174 !******************************** -
src/FLEXPART_MPI.f90
r20963b1 r0a94e13 77 77 if (mp_measure_time) call mpif_mtime('flexpart',0) 78 78 79 ! Initialize arrays in com_mod 80 !***************************** 81 82 if(.not.(lmpreader.and.lmp_use_reader)) call com_mod_allocate_part(maxpart_mpi) 83 84 79 85 80 ! Generate a large number of random numbers 86 81 !****************************************** … … 180 175 endif 181 176 177 ! Initialize arrays in com_mod 178 !***************************** 179 180 if(.not.(lmpreader.and.lmp_use_reader)) call com_mod_allocate_part(maxpart_mpi) 181 182 182 183 183 ! Read the age classes to be used -
src/com_mod.f90
r328fdf9 r0a94e13 18 18 19 19 implicit none 20 21 20 22 21 23 !**************************************************************** … … 69 71 70 72 real :: ctl,fine 71 integer :: ifine,iout,ipout,ipin,iflux,mdomainfill 73 integer :: ifine,iout,ipout,ipin,iflux,mdomainfill,ipoutfac 72 74 integer :: mquasilag,nested_output,ind_source,ind_receptor 73 75 integer :: ind_rel,ind_samp,ioutputforeachrelease,linit_cond,surf_only … … 82 84 ! iout output options: 1 conc. output (ng/m3), 2 mixing ratio (pptv), 3 both 83 85 ! ipout particle dump options: 0 no, 1 every output interval, 2 only at end 86 ! ipoutfac increase particle dump interval by factor (default 1) 84 87 ! ipin read in particle positions from dumped file from a previous run 85 88 ! fine real(ifine) … … 128 131 129 132 logical :: gdomainfill 130 131 133 ! gdomainfill .T., if domain-filling is global, .F. if not 132 134 … … 675 677 real, allocatable, dimension(:,:) :: xscav_frac1 676 678 679 ! Variables used for writing out interval averages for partoutput 680 !**************************************************************** 681 682 integer, allocatable, dimension(:) :: npart_av 683 real, allocatable, dimension(:) :: part_av_cartx,part_av_carty,part_av_cartz,part_av_z,part_av_topo 684 real, allocatable, dimension(:) :: part_av_pv,part_av_qv,part_av_tt,part_av_rho,part_av_tro,part_av_hmix 685 real, allocatable, dimension(:) :: part_av_uu,part_av_vv,part_av_energy 686 677 687 ! eso: Moved from timemanager 678 688 real, allocatable, dimension(:) :: uap,ucp,uzp,us,vs,ws … … 781 791 & idt(nmpart),itramem(nmpart),itrasplit(nmpart),& 782 792 & xtra1(nmpart),ytra1(nmpart),ztra1(nmpart),& 783 & xmass1(nmpart, maxspec),& 784 & checklifetime(nmpart,maxspec), species_lifetime(maxspec,2))!CGZ-lifetime 793 & xmass1(nmpart, maxspec)) ! ,& 794 ! & checklifetime(nmpart,maxspec), species_lifetime(maxspec,2))!CGZ-lifetime 795 796 if (ipout.eq.3) then 797 allocate(npart_av(nmpart),part_av_cartx(nmpart),part_av_carty(nmpart),& 798 & part_av_cartz(nmpart),part_av_z(nmpart),part_av_topo(nmpart)) 799 allocate(part_av_pv(nmpart),part_av_qv(nmpart),part_av_tt(nmpart),& 800 & part_av_rho(nmpart),part_av_tro(nmpart),part_av_hmix(nmpart)) 801 allocate(part_av_uu(nmpart),part_av_vv(nmpart),part_av_energy(nmpart)) 802 end if 785 803 786 804 787 805 allocate(uap(nmpart),ucp(nmpart),uzp(nmpart),us(nmpart),& 788 806 & vs(nmpart),ws(nmpart),cbt(nmpart)) 789 807 790 808 end subroutine com_mod_allocate_part 791 809 -
src/init_domainfill.f90
r328fdf9 r0a94e13 86 86 endif 87 87 endif 88 89 ! Exit here if resuming a run from particle dump 90 !*********************************************** 91 if (gdomainfill.and.ipin.ne.0) return 88 92 89 93 ! Do not release particles twice (i.e., not at both in the leftmost and rightmost -
src/makefile
r7123c70 r0a94e13 118 118 OBJECTS_SERIAL = \ 119 119 releaseparticles.o partoutput.o \ 120 partoutput_average.o \ 120 121 conccalc.o \ 121 122 init_domainfill.o concoutput.o \ … … 132 133 ## For MPI version 133 134 OBJECTS_MPI = releaseparticles_mpi.o partoutput_mpi.o \ 134 conccalc_mpi.o \135 partoutput_average_mpi.o conccalc_mpi.o \ 135 136 init_domainfill_mpi.o concoutput_mpi.o \ 136 137 timemanager_mpi.o FLEXPART_MPI.o \ … … 149 150 advance.o initialize.o \ 150 151 writeheader.o writeheader_txt.o \ 151 writeprecip.o \152 partpos_average.o writeprecip.o \ 152 153 writeheader_surf.o assignland.o\ 153 154 part0.o gethourlyOH.o\ … … 348 349 part0.o: par_mod.o 349 350 partdep.o: par_mod.o 351 partpos_average.o: com_mod.o par_mod.o 350 352 partoutput.o: com_mod.o par_mod.o 353 partoutput_average.o: com_mod.o par_mod.o 354 partoutput_average_mpi.o: com_mod.o par_mod.o mpi_mod.o 351 355 partoutput_mpi.o: com_mod.o mpi_mod.o par_mod.o 352 356 partoutput_short.o: com_mod.o par_mod.o -
src/mpi_mod.f90
- Property mode changed from 100644 to 100755
r328fdf9 r0a94e13 88 88 ! Variables for MPI processes in the 'particle' group 89 89 integer, allocatable, dimension(:) :: mp_partgroup_rank 90 integer, allocatable, dimension(:) :: npart_per_process 90 91 integer :: mp_partgroup_comm, mp_partgroup_pid, mp_partgroup_np 91 92 … … 125 126 ! mp_time_barrier Measure MPI barrier time 126 127 ! mp_exact_numpart Use an extra MPI communication to give the exact number of particles 127 ! to standard output (this does *not* otherwise affect the simulation) 128 ! mp_rebalance Attempt to rebalance particle between processes 128 ! to standard output (this does not otherwise affect the simulation) 129 129 logical, parameter :: mp_dbg_mode = .false. 130 130 logical, parameter :: mp_dev_mode = .false. … … 133 133 logical, parameter :: mp_measure_time=.false. 134 134 logical, parameter :: mp_exact_numpart=.true. 135 logical, parameter :: mp_rebalance=.true.136 135 137 136 ! for measuring CPU/Wall time … … 146 145 real(dp),private :: mp_getfields_wtime_beg, mp_getfields_wtime_end, mp_getfields_wtime_total=0. 147 146 real(sp),private :: mp_getfields_time_beg, mp_getfields_time_end, mp_getfields_time_total=0. 148 !real(dp),private :: mp_readwind_wtime_beg, mp_readwind_wtime_end, mp_readwind_wtime_total=0.149 !real(sp),private :: mp_readwind_time_beg, mp_readwind_time_end, mp_readwind_time_total=0.147 real(dp),private :: mp_readwind_wtime_beg, mp_readwind_wtime_end, mp_readwind_wtime_total=0. 148 real(sp),private :: mp_readwind_time_beg, mp_readwind_time_end, mp_readwind_time_total=0. 150 149 real(dp),private :: mp_io_wtime_beg, mp_io_wtime_end, mp_io_wtime_total=0. 151 150 real(sp),private :: mp_io_time_beg, mp_io_time_end, mp_io_time_total=0. … … 367 366 end if 368 367 368 ! Allocate array for number of particles per process 369 allocate(npart_per_process(0:mp_partgroup_np-1)) 370 369 371 ! Write whether MPI_IN_PLACE is used or not 370 372 #ifdef USE_MPIINPLACE … … 607 609 integer :: i,jj,nn, num_part=1,m,imin, num_trans 608 610 logical :: first_iter 609 integer,allocatable,dimension(:) :: numparticles_mpi,idx_arr611 integer,allocatable,dimension(:) :: idx_arr 610 612 real,allocatable,dimension(:) :: sorted ! TODO: we don't really need this 611 613 … … 616 618 ! All processes exchange information on number of particles 617 619 !**************************************************************************** 618 allocate(numparticles_mpi(0:mp_partgroup_np-1), & 619 &idx_arr(0:mp_partgroup_np-1), sorted(0:mp_partgroup_np-1)) 620 621 call MPI_Allgather(numpart, 1, MPI_INTEGER, numparticles_mpi, & 620 allocate( idx_arr(0:mp_partgroup_np-1), sorted(0:mp_partgroup_np-1)) 621 622 call MPI_Allgather(numpart, 1, MPI_INTEGER, npart_per_process, & 622 623 & 1, MPI_INTEGER, mp_comm_used, mp_ierr) 623 624 … … 625 626 ! Sort from lowest to highest 626 627 ! Initial guess: correct order 627 sorted(:) = n umparticles_mpi(:)628 sorted(:) = npart_per_process(:) 628 629 do i=0, mp_partgroup_np-1 629 630 idx_arr(i) = i 630 631 end do 632 633 ! Do not rebalance particles for ipout=3 634 if (ipout.eq.3) return 631 635 632 636 ! For each successive element in index array, see if a lower value exists … … 654 658 m=mp_partgroup_np-1 ! index for last sorted process (most particles) 655 659 do i=0,mp_partgroup_np/2-1 656 num_trans = n umparticles_mpi(idx_arr(m)) - numparticles_mpi(idx_arr(i))660 num_trans = npart_per_process(idx_arr(m)) - npart_per_process(idx_arr(i)) 657 661 if (mp_partid.eq.idx_arr(m).or.mp_partid.eq.idx_arr(i)) then 658 if ( n umparticles_mpi(idx_arr(m)).gt.mp_min_redist.and.&659 & real(num_trans)/real(n umparticles_mpi(idx_arr(m))).gt.mp_redist_fract) then662 if ( npart_per_process(idx_arr(m)).gt.mp_min_redist.and.& 663 & real(num_trans)/real(npart_per_process(idx_arr(m))).gt.mp_redist_fract) then 660 664 ! DBG 661 ! write(*,*) 'mp_partid, idx_arr(m), idx_arr(i), mp_min_redist, num_trans, n umparticles_mpi', &662 ! &mp_partid, idx_arr(m), idx_arr(i), mp_min_redist, num_trans, n umparticles_mpi665 ! write(*,*) 'mp_partid, idx_arr(m), idx_arr(i), mp_min_redist, num_trans, npart_per_process', & 666 ! &mp_partid, idx_arr(m), idx_arr(i), mp_min_redist, num_trans, npart_per_process 663 667 ! DBG 664 668 call mpif_redist_part(itime, idx_arr(m), idx_arr(i), num_trans/2) … … 668 672 end do 669 673 670 deallocate( numparticles_mpi,idx_arr, sorted)674 deallocate(idx_arr, sorted) 671 675 672 676 end subroutine mpif_calculate_part_redist … … 2716 2720 end if 2717 2721 2718 !case ('readwind')2719 !if (imode.eq.0) then2720 !call cpu_time(mp_readwind_time_beg)2721 !mp_readwind_wtime_beg = mpi_wtime()2722 !else2723 !call cpu_time(mp_readwind_time_end)2724 !mp_readwind_wtime_end = mpi_wtime()2725 ! 2726 !mp_readwind_time_total = mp_readwind_time_total + &2727 !&(mp_readwind_time_end - mp_readwind_time_beg)2728 !mp_readwind_wtime_total = mp_readwind_wtime_total + &2729 !&(mp_readwind_wtime_end - mp_readwind_wtime_beg)2730 !end if2722 case ('readwind') 2723 if (imode.eq.0) then 2724 call cpu_time(mp_readwind_time_beg) 2725 mp_readwind_wtime_beg = mpi_wtime() 2726 else 2727 call cpu_time(mp_readwind_time_end) 2728 mp_readwind_wtime_end = mpi_wtime() 2729 2730 mp_readwind_time_total = mp_readwind_time_total + & 2731 &(mp_readwind_time_end - mp_readwind_time_beg) 2732 mp_readwind_wtime_total = mp_readwind_wtime_total + & 2733 &(mp_readwind_wtime_end - mp_readwind_wtime_beg) 2734 end if 2731 2735 2732 2736 case ('commtime') -
src/netcdf_output_mod.f90
r4ad96c5 r0a94e13 93 93 character(len=255), parameter :: institution = 'NILU' 94 94 95 integer :: tpointer 95 integer :: tpointer=0 96 96 character(len=255) :: ncfname, ncfnamen 97 97 -
src/par_mod.f90
rdf96ea65 r0a94e13 280 280 281 281 integer,parameter :: unitpath=1, unitcommand=1, unitageclasses=1, unitgrid=1 282 integer,parameter :: unitavailab=1, unitreleases=88, unitpartout=93 282 integer,parameter :: unitavailab=1, unitreleases=88, unitpartout=93, unitpartout_average=105 283 283 integer,parameter :: unitpartin=93, unitflux=98, unitouttraj=96 284 284 integer,parameter :: unitvert=1, unitoro=1, unitpoin=1, unitreceptor=1 -
src/partoutput.f90
rd2a5a83 r0a94e13 71 71 !************************************** 72 72 73 if (ipout.eq.1 ) then73 if (ipout.eq.1.or.ipout.eq.3) then 74 74 open(unitpartout,file=path(2)(1:length(2))//'partposit_'//adate// & 75 75 atime,form='unformatted') -
src/partoutput_mpi.f90
rd2a5a83 r0a94e13 78 78 !************************************** 79 79 80 if (ipout.eq.1 ) then80 if (ipout.eq.1.or.ipout.eq.3) then 81 81 open(unitpartout,file=path(2)(1:length(2))//'partposit_'//adate// & 82 82 atime,form='unformatted',status=file_stat,position='append') -
src/readcommand.f90
r20963b1 r0a94e13 50 50 ! ipin 1 continue simulation with dumped particle data, 0 no * 51 51 ! ipout 0 no particle dump, 1 every output time, 3 only at end* 52 ! ipoutfac increase particle dump interval by factor (default 1) * 52 53 ! itsplit [s] time constant for particle splitting * 53 54 ! loutaver [s] concentration output is an average over loutaver * … … 97 98 iout, & 98 99 ipout, & 100 ipoutfac, & 99 101 lsubgrid, & 100 102 lconvection, & … … 129 131 iout=3 130 132 ipout=0 133 ipoutfac=1 131 134 lsubgrid=1 132 135 lconvection=1 … … 507 510 !**************************************************************** 508 511 509 if ((ipout.ne.0).and.(ipout.ne.1).and.(ipout.ne.2) ) then512 if ((ipout.ne.0).and.(ipout.ne.1).and.(ipout.ne.2).and.(ipout.ne.3)) then 510 513 write(*,*) ' #### FLEXPART MODEL ERROR! FILE COMMAND: #### ' 511 write(*,*) ' #### IPOUT MUST BE 1, 2 OR 3!#### '514 write(*,*) ' #### IPOUT MUST BE 0, 1, 2 OR 3! #### ' 512 515 stop 513 516 endif -
src/timemanager.f90
rc7d1052 r0a94e13 451 451 45 format(i13,' Seconds simulated: ',i13, ' Particles: Uncertainty: ',3f7.3) 452 452 46 format(' Simulated ',f7.1,' hours (',i13,' s), ',i13, ' particles') 453 if (ipout.ge.1) call partoutput(itime) ! dump particle positions 453 if (ipout.ge.1) then 454 if (mod(itime,ipoutfac*loutstep).eq.0) call partoutput(itime) ! dump particle positions 455 if (ipout.eq.3) call partoutput_average(itime) ! dump particle positions 456 endif 454 457 loutnext=loutnext+loutstep 455 458 loutstart=loutnext-loutaver/2 … … 609 612 ! write (*,*) 'advance: ',prob(1),xmass1(j,1),ztra1(j) 610 613 614 ! Calculate average position for particle dump output 615 !**************************************************** 616 617 if (ipout.eq.3) call partpos_average(itime,j) 618 619 611 620 ! Calculate the gross fluxes across layer interfaces 612 621 !*************************************************** -
src/timemanager_mpi.f90
r328fdf9 r0a94e13 113 113 integer :: j,ks,kp,l,n,itime=0,nstop,nstop1,memstat=0 114 114 ! integer :: ksp 115 integer :: ip 115 integer :: ip,irec 116 116 integer :: loutnext,loutstart,loutend 117 117 integer :: ix,jy,ldeltat,itage,nage,idummy … … 129 129 ! Measure time spent in timemanager 130 130 if (mp_measure_time) call mpif_mtime('timemanager',0) 131 131 132 132 133 ! First output for time 0 … … 344 345 ! Check if particles should be redistributed among processes 345 346 !*********************************************************** 346 if (mp_rebalance)call mpif_calculate_part_redist(itime)347 call mpif_calculate_part_redist(itime) 347 348 348 349 … … 593 594 46 format(' Simulated ',f7.1,' hours (',i13,' s), ',i13, ' particles') 594 595 if (ipout.ge.1) then 596 irec=0 595 597 do ip=0, mp_partgroup_np-1 596 if (ip.eq.mp_partid) call partoutput(itime) ! dump particle positions 598 if (ip.eq.mp_partid) then 599 if (mod(itime,ipoutfac*loutstep).eq.0) call partoutput(itime) ! dump particle positions 600 if (ipout.eq.3) call partoutput_average(itime,irec) ! dump particle positions 601 endif 602 if (ipout.eq.3) irec=irec+npart_per_process(ip) 597 603 call mpif_mpi_barrier 598 604 end do … … 757 763 if (mp_measure_time) call mpif_mtime('advance',1) 758 764 765 ! Calculate average position for particle dump output 766 !**************************************************** 767 768 if (ipout.eq.3) call partpos_average(itime,j) 769 759 770 760 771 ! Calculate the gross fluxes across layer interfaces … … 895 906 do ip=0, mp_partgroup_np-1 896 907 if (ip.eq.mp_partid) then 897 !if (mp_dbg_mode) write(*,*) 'call partoutput(itime), proc, mp_partid',ip,mp_partid908 if (mp_dbg_mode) write(*,*) 'call partoutput(itime), proc, mp_partid',ip,mp_partid 898 909 call partoutput(itime) ! dump particle positions 899 910 end if -
src/verttransform_ecmwf.f90
r79e0349 r0a94e13 73 73 use com_mod 74 74 use cmapf_mod, only: cc2gll 75 ! use mpi_mod76 75 77 76 implicit none
Note: See TracChangeset
for help on using the changeset viewer.