- Timestamp:
- Mar 8, 2016, 9:54:38 AM (8 years ago)
- Branches:
- master, 10.4.1_pesei, GFS_025, bugfixes+enhancements, dev, release-10, release-10.4.1, scaling-bug, univie
- Children:
- 9b53903
- Parents:
- db712a8
- Location:
- src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/boundcond_domainfill_mpi.f90
r5f9d14a r38b7917 192 192 rhox=(rhohl(1)*dt2+rhohl(2)*dt1)*dtt 193 193 194 ! Calculate mass flux 195 !******************** 196 197 fluxofmass=windx*rhox*boundarea*real(lsynctime) 194 ! Calculate mass flux, divided by number of processes 195 !**************************************************** 196 197 fluxofmass=windx*rhox*boundarea*real(lsynctime)/mp_partgroup_np 198 198 199 199 … … 425 425 rhox=(rhohl(1)*dt2+rhohl(2)*dt1)*dtt 426 426 427 ! Calculate mass flux 428 !******************** 429 430 fluxofmass=windx*rhox*boundarea*real(lsynctime) 427 ! Calculate mass flux, divided by number of processes 428 !**************************************************** 429 430 fluxofmass=windx*rhox*boundarea*real(lsynctime)/mp_partgroup_np 431 431 432 432 ! If the mass flux is directed into the domain, add it to previous mass fluxes; … … 587 587 !***************************************************************************** 588 588 589 ! :TODO: eso parallelize 589 590 if ((ipout.gt.0).and.(itime.eq.loutend)) then 590 591 open(unitboundcond,file=path(2)(1:length(2))//'boundcond.bin', & -
src/concoutput_nest_mpi.f90
r6a678e3 r38b7917 104 104 105 105 ! Measure execution time 106 if (mp_measure_time) then107 call cpu_time(mp_root_time_beg)108 mp_root_wtime_beg = mpi_wtime()109 end if106 if (mp_measure_time) call mpif_mtime('iotime',0) 107 ! call cpu_time(mp_root_time_beg) 108 ! mp_root_wtime_beg = mpi_wtime() 109 ! end if 110 110 111 111 if (verbosity.eq.1) then … … 580 580 end do 581 581 582 if (mp_measure_time) then 583 call cpu_time(mp_root_time_end) 584 mp_root_wtime_end = mpi_wtime() 585 mp_root_time_total = mp_root_time_total + (mp_root_time_end - mp_root_time_beg) 586 mp_root_wtime_total = mp_root_wtime_total + (mp_root_wtime_end - mp_root_wtime_beg) 587 end if 582 if (mp_measure_time) call mpif_mtime('iotime',1) 583 ! if (mp_measure_time) then 584 ! call cpu_time(mp_root_time_end) 585 ! mp_root_wtime_end = mpi_wtime() 586 ! mp_root_time_total = mp_root_time_total + (mp_root_time_end - mp_root_time_beg) 587 ! mp_root_wtime_total = mp_root_wtime_total + (mp_root_wtime_end - mp_root_wtime_beg) 588 ! end if 588 589 589 590 end subroutine concoutput_nest -
src/concoutput_surf_nest_mpi.f90
r6a678e3 r38b7917 103 103 104 104 ! Measure execution time 105 if (mp_measure_time) then106 call cpu_time(mp_root_time_beg)107 mp_root_wtime_beg = mpi_wtime()108 end if105 if (mp_measure_time) call mpif_mtime('iotime',0) 106 ! call cpu_time(mp_root_time_beg) 107 ! mp_root_wtime_beg = mpi_wtime() 108 ! end if 109 109 110 110 if (verbosity.eq.1) then … … 669 669 end do 670 670 671 if (mp_measure_time) then 672 call cpu_time(mp_root_time_end) 673 mp_root_wtime_end = mpi_wtime() 674 mp_root_time_total = mp_root_time_total + (mp_root_time_end - mp_root_time_beg) 675 mp_root_wtime_total = mp_root_wtime_total + (mp_root_wtime_end - mp_root_wtime_beg) 676 end if 671 if (mp_measure_time) call mpif_mtime('iotime',1) 672 ! if (mp_measure_time) then 673 ! call cpu_time(mp_root_time_end) 674 ! mp_root_wtime_end = mpi_wtime() 675 ! mp_root_time_total = mp_root_time_total + (mp_root_time_end - mp_root_time_beg) 676 ! mp_root_wtime_total = mp_root_wtime_total + (mp_root_wtime_end - mp_root_wtime_beg) 677 ! end if 677 678 678 679 end subroutine concoutput_surf_nest -
src/init_domainfill.f90
r8a65cb0 r38b7917 21 21 22 22 subroutine init_domainfill 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 23 ! 24 !***************************************************************************** 25 ! * 26 ! Initializes particles equally distributed over the first release location * 27 ! specified in file RELEASES. This box is assumed to be the domain for doing * 28 ! domain-filling trajectory calculations. * 29 ! All particles carry the same amount of mass which alltogether comprises the* 30 ! mass of air within the box. * 31 ! * 32 ! Author: A. Stohl * 33 ! * 34 ! 15 October 2002 * 35 ! * 36 !***************************************************************************** 37 ! * 38 ! Variables: * 39 ! * 40 ! numparticlecount consecutively counts the number of particles released * 41 ! nx_we(2) grid indices for western and eastern boundary of domain- * 42 ! filling trajectory calculations * 43 ! ny_sn(2) grid indices for southern and northern boundary of domain- * 44 ! filling trajectory calculations * 45 ! * 46 !***************************************************************************** 47 47 48 48 use point_mod … … 65 65 66 66 67 68 69 70 67 ! Determine the release region (only full grid cells), over which particles 68 ! shall be initialized 69 ! Use 2 fields for west/east and south/north boundary 70 !************************************************************************** 71 71 72 72 nx_we(1)=max(int(xpoint1(1)),0) … … 75 75 ny_sn(2)=min((int(ypoint2(1))+1),nymin1) 76 76 77 78 79 77 ! For global simulations (both global wind data and global domain-filling), 78 ! set a switch, such that no boundary conditions are used 79 !************************************************************************** 80 80 if (xglobal.and.sglobal.and.nglobal) then 81 81 if ((nx_we(1).eq.0).and.(nx_we(2).eq.nxmin1).and. & … … 87 87 endif 88 88 89 90 91 89 ! Do not release particles twice (i.e., not at both in the leftmost and rightmost 90 ! grid cell) for a global domain 91 !***************************************************************************** 92 92 if (xglobal) nx_we(2)=min(nx_we(2),nx-2) 93 93 94 94 95 96 97 95 ! Calculate area of grid cell with formula M=2*pi*R*h*dx/360, 96 ! see Netz, Formeln der Mathematik, 5. Auflage (1983), p.90 97 !************************************************************ 98 98 99 99 do jy=ny_sn(1),ny_sn(2) ! loop about latitudes … … 117 117 end do 118 118 119 119 ! Do the same for the south pole 120 120 121 121 if (sglobal) then … … 130 130 endif 131 131 132 132 ! Do the same for the north pole 133 133 134 134 if (nglobal) then … … 144 144 145 145 146 147 146 ! Calculate total mass of each grid column and of the whole atmosphere 147 !********************************************************************* 148 148 149 149 colmasstotal=0. … … 157 157 end do 158 158 159 159 write(*,*) 'Atm. mass: ',colmasstotal 160 160 161 161 162 162 if (ipin.eq.0) numpart=0 163 163 164 165 164 ! Determine the particle positions 165 !********************************* 166 166 167 167 numparttot=0 … … 175 175 if (ncolumn.gt.numcolumn) numcolumn=ncolumn 176 176 177 178 179 177 ! Calculate pressure at the altitudes of model surfaces, using the air density 178 ! information, which is stored as a 3-d field 179 !***************************************************************************** 180 180 181 181 do kz=1,nz … … 191 191 192 192 193 194 195 196 193 ! For columns with many particles (i.e. around the equator), distribute 194 ! the particles equally, for columns with few particles (i.e. around the 195 ! poles), distribute the particles randomly 196 !*********************************************************************** 197 197 198 198 … … 209 209 dz=1./(dz1+dz2) 210 210 211 212 213 214 211 ! Assign particle position 212 !************************* 213 ! Do the following steps only if particles are not read in from previous model run 214 !***************************************************************************** 215 215 if (ipin.eq.0) then 216 216 xtra1(numpart+jj)=real(ix)-0.5+ran1(idummy) … … 224 224 225 225 226 227 226 ! Interpolate PV to the particle position 227 !**************************************** 228 228 ixm=int(xtra1(numpart+jj)) 229 229 jym=int(ytra1(numpart+jj)) … … 260 260 261 261 262 263 262 ! For domain-filling option 2 (stratospheric O3), do the rest only in the stratosphere 263 !***************************************************************************** 264 264 265 265 if (((ztra1(numpart+jj).gt.3000.).and. & 266 266 (pvpart.gt.pvcrit)).or.(mdomainfill.eq.1)) then 267 267 268 269 268 ! Assign certain properties to the particle 269 !****************************************** 270 270 nclass(numpart+jj)=min(int(ran1(idummy)* & 271 271 real(nclassunc))+1,nclassunc) … … 293 293 end do 294 294 295 296 ! Check whether numpart is really smaller than maxpart 297 !***************************************************** 298 295 write(*,*) 'init_domainfill> ncolumn: ', ncolumn 296 write(*,*) 'init_domainfill> numcolumn: ', numcolumn 297 write(*,*) 'init_domainfill> ny_sn(1),ny_sn(2): ', ny_sn(1),ny_sn(2) 298 write(*,*) 'init_domainfill> nx_we(1),nx_we(2): ', nx_we(1),nx_we(2) 299 300 301 ! Check whether numpart is really smaller than maxpart 302 !***************************************************** 303 304 ! ESO :TODO: this warning need to be moved further up, else out-of-bounds error earlier 299 305 if (numpart.gt.maxpart) then 300 306 write(*,*) 'numpart too large: change source in init_atm_mass.f' … … 306 312 307 313 308 309 314 ! Make sure that all particles are within domain 315 !*********************************************** 310 316 311 317 do j=1,numpart … … 319 325 320 326 321 322 323 324 325 326 327 328 329 327 ! For boundary conditions, we need fewer particle release heights per column, 328 ! because otherwise it takes too long until enough mass has accumulated to 329 ! release a particle at the boundary (would take dx/u seconds), leading to 330 ! relatively large position errors of the order of one grid distance. 331 ! It's better to release fewer particles per column, but to do so more often. 332 ! Thus, use on the order of nz starting heights per column. 333 ! We thus repeat the above to determine fewer starting heights, that are 334 ! used furtheron in subroutine boundcond_domainfill.f. 335 !**************************************************************************** 330 336 331 337 fractus=real(numcolumn)/real(nz) … … 343 349 344 350 345 346 347 348 351 ! Memorize how many particles per column shall be used for all boundaries 352 ! This is further used in subroutine boundcond_domainfill.f 353 ! Use 2 fields for west/east and south/north boundary 354 !************************************************************************ 349 355 350 356 if (ix.eq.nx_we(1)) numcolumn_we(1,jy)=ncolumn … … 353 359 if (jy.eq.ny_sn(2)) numcolumn_sn(2,ix)=ncolumn 354 360 355 356 357 361 ! Calculate pressure at the altitudes of model surfaces, using the air density 362 ! information, which is stored as a 3-d field 363 !***************************************************************************** 358 364 359 365 do kz=1,nz … … 361 367 end do 362 368 363 364 369 ! Determine the reference starting altitudes 370 !******************************************* 365 371 366 372 deltacol=(pp(1)-pp(nz))/real(ncolumn) … … 374 380 dz=1./(dz1+dz2) 375 381 zposition=(height(kz)*dz2+height(kz+1)*dz1)*dz 376 if (zposition.gt.height(nz)-0.5) zposition=height(nz)-0.5377 378 379 380 382 if (zposition.gt.height(nz)-0.5) zposition=height(nz)-0.5 383 384 ! Memorize vertical positions where particles are introduced 385 ! This is further used in subroutine boundcond_domainfill.f 386 !*********************************************************** 381 387 382 388 if (ix.eq.nx_we(1)) zcolumn_we(1,jy,j)=zposition … … 385 391 if (jy.eq.ny_sn(2)) zcolumn_sn(2,ix,j)=zposition 386 392 387 388 393 ! Initialize mass that has accumulated at boundary to zero 394 !********************************************************* 389 395 390 396 acc_mass_we(1,jy,j)=0. … … 399 405 end do 400 406 401 402 403 404 407 ! If particles shall be read in to continue an existing run, 408 ! then the accumulated masses at the domain boundaries must be read in, too. 409 ! This overrides any previous calculations. 410 !*************************************************************************** 405 411 406 412 if (ipin.eq.1) then -
src/init_domainfill_mpi.f90
r5f9d14a r38b7917 163 163 pp(1)=rho(ix,jy,1,1)*r_air*tt(ix,jy,1,1) 164 164 pp(nz)=rho(ix,jy,nz,1)*r_air*tt(ix,jy,nz,1) 165 colmass(ix,jy)=(pp(1)-pp(nz))/ga*gridarea(jy) 165 ! Each MPI process is assigned an equal share of particles 166 colmass(ix,jy)=(pp(1)-pp(nz))/ga*gridarea(jy)/mp_partgroup_np 166 167 colmasstotal=colmasstotal+colmass(ix,jy) 168 167 169 end do 168 170 end do 169 171 170 write(*,*) 'Atm. mass: ',colmasstotal172 if (lroot) write(*,*) 'Atm. mass: ',colmasstotal 171 173 172 174 … … 415 417 !*************************************************************************** 416 418 419 ! :TODO: eso: parallelize 417 420 if (ipin.eq.1) then 418 421 open(unitboundcond,file=path(2)(1:length(2))//'boundcond.bin', & -
src/mpi_mod.f90
rdb712a8 r38b7917 120 120 logical, parameter :: mp_dbg_out = .false. 121 121 logical, parameter :: mp_time_barrier=.true. 122 logical, parameter :: mp_measure_time=. false.122 logical, parameter :: mp_measure_time=.true. 123 123 logical, parameter :: mp_exact_numpart=.true. 124 124 125 125 ! for measuring CPU/Wall time 126 real(sp) :: mp_comm_time_beg, mp_comm_time_end, mp_comm_time_total=0.127 real(dp) :: mp_comm_wtime_beg, mp_comm_wtime_end, mp_comm_wtime_total=0.128 real(sp) :: mp_root_time_beg, mp_root_time_end, mp_root_time_total=0.129 real(dp) :: mp_root_wtime_beg, mp_root_wtime_end, mp_root_wtime_total=0.130 real(sp) :: mp_barrier_time_beg, mp_barrier_time_end, mp_barrier_time_total=0.131 real(dp) :: mp_barrier_wtime_beg, mp_barrier_wtime_end, mp_barrier_wtime_total=0.132 real(sp) :: tm_nploop_beg, tm_nploop_end, tm_nploop_total=0.133 real(sp) :: tm_tot_beg, tm_tot_end, tm_tot_total=0.134 real(dp) :: mp_getfields_wtime_beg, mp_getfields_wtime_end, mp_getfields_wtime_total=0.135 real(sp) :: mp_getfields_time_beg, mp_getfields_time_end, mp_getfields_time_total=0.136 real(dp) :: mp_readwind_wtime_beg, mp_readwind_wtime_end, mp_readwind_wtime_total=0.137 real(sp) :: mp_readwind_time_beg, mp_readwind_time_end, mp_readwind_time_total=0.138 real(dp) :: mp_io_wtime_beg, mp_io_wtime_end, mp_io_wtime_total=0.139 real(sp) :: mp_io_time_beg, mp_io_time_end, mp_io_time_total=0.140 real(dp) :: mp_wetdepo_wtime_beg, mp_wetdepo_wtime_end, mp_wetdepo_wtime_total=0.141 real(sp) :: mp_wetdepo_time_beg, mp_wetdepo_time_end, mp_wetdepo_time_total=0.142 real(dp) :: mp_advance_wtime_beg, mp_advance_wtime_end, mp_advance_wtime_total=0.143 real(dp) :: mp_conccalc_time_beg, mp_conccalc_time_end, mp_conccalc_time_total=0.144 real(dp) :: mp_total_wtime_beg, mp_total_wtime_end, mp_total_wtime_total=0.145 real(dp) :: mp_vt_wtime_beg, mp_vt_wtime_end, mp_vt_wtime_total146 real(sp) :: mp_vt_time_beg, mp_vt_time_end, mp_vt_time_total126 real(sp),private :: mp_comm_time_beg, mp_comm_time_end, mp_comm_time_total=0. 127 real(dp),private :: mp_comm_wtime_beg, mp_comm_wtime_end, mp_comm_wtime_total=0. 128 real(sp),private :: mp_root_time_beg, mp_root_time_end, mp_root_time_total=0. 129 real(dp),private :: mp_root_wtime_beg, mp_root_wtime_end, mp_root_wtime_total=0. 130 real(sp),private :: mp_barrier_time_beg, mp_barrier_time_end, mp_barrier_time_total=0. 131 real(dp),private :: mp_barrier_wtime_beg, mp_barrier_wtime_end, mp_barrier_wtime_total=0. 132 real(sp),private :: tm_nploop_beg, tm_nploop_end, tm_nploop_total=0. 133 real(sp),private :: tm_tot_beg, tm_tot_end, tm_tot_total=0. 134 real(dp),private :: mp_getfields_wtime_beg, mp_getfields_wtime_end, mp_getfields_wtime_total=0. 135 real(sp),private :: mp_getfields_time_beg, mp_getfields_time_end, mp_getfields_time_total=0. 136 real(dp),private :: mp_readwind_wtime_beg, mp_readwind_wtime_end, mp_readwind_wtime_total=0. 137 real(sp),private :: mp_readwind_time_beg, mp_readwind_time_end, mp_readwind_time_total=0. 138 real(dp),private :: mp_io_wtime_beg, mp_io_wtime_end, mp_io_wtime_total=0. 139 real(sp),private :: mp_io_time_beg, mp_io_time_end, mp_io_time_total=0. 140 real(dp),private :: mp_wetdepo_wtime_beg, mp_wetdepo_wtime_end, mp_wetdepo_wtime_total=0. 141 real(sp),private :: mp_wetdepo_time_beg, mp_wetdepo_time_end, mp_wetdepo_time_total=0. 142 real(dp),private :: mp_advance_wtime_beg, mp_advance_wtime_end, mp_advance_wtime_total=0. 143 real(dp),private :: mp_conccalc_time_beg, mp_conccalc_time_end, mp_conccalc_time_total=0. 144 real(dp),private :: mp_total_wtime_beg, mp_total_wtime_end, mp_total_wtime_total=0. 145 real(dp),private :: mp_vt_wtime_beg, mp_vt_wtime_end, mp_vt_wtime_total 146 real(sp),private :: mp_vt_time_beg, mp_vt_time_end, mp_vt_time_total 147 147 148 148 ! dat_lun logical unit number for i/o … … 1824 1824 end if 1825 1825 1826 case ('advance') 1827 if (imode.eq.0) then 1828 mp_advance_wtime_beg = mpi_wtime() 1829 else 1830 mp_advance_wtime_end = mpi_wtime() 1831 1832 mp_advance_wtime_total = mp_advance_wtime_total + & 1833 &(mp_advance_wtime_end - mp_advance_wtime_beg) 1834 end if 1835 1826 1836 case ('getfields') 1827 1837 if (imode.eq.0) then … … 1854 1864 &mp_conccalc_time_beg 1855 1865 end if 1866 1856 1867 case ('rootonly') 1857 1868 if (imode.eq.0) then -
src/par_mod.f90
rdb712a8 r38b7917 214 214 !************************************************** 215 215 216 integer,parameter :: maxpart=400000 217 integer,parameter :: maxspec= 6216 integer,parameter :: maxpart=40000000 217 integer,parameter :: maxspec=1 218 218 real,parameter :: minmass=0.0 !0.0001 219 219 -
src/timemanager_mpi.f90
rdb712a8 r38b7917 695 695 !************************************************* 696 696 697 mp_advance_wtime_beg = mpi_wtime() 697 if (mp_measure_time) call mpif_mtime('advance',0) 698 !mp_advance_wtime_beg = mpi_wtime() 698 699 699 700 call advance(itime,npoint(j),idt(j),uap(j),ucp(j),uzp(j), & … … 701 702 cbt(j)) 702 703 703 mp_advance_wtime_end = mpi_wtime() 704 mp_advance_wtime_total = mp_advance_wtime_total + (mp_advance_wtime_end - & 705 & mp_advance_wtime_beg) 704 if (mp_measure_time) call mpif_mtime('advance',1) 705 706 ! mp_advance_wtime_end = mpi_wtime() 707 ! mp_advance_wtime_total = mp_advance_wtime_total + (mp_advance_wtime_end - & 708 ! & mp_advance_wtime_beg) 706 709 707 710
Note: See TracChangeset
for help on using the changeset viewer.