Changes in / [f203036:941db73] in flexpart.git
- Files:
-
- 6 deleted
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
options/COMMAND
r0a94e13 r6d73c4b 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 3]time averaged21 IPOUT= 0, ! Particle position output: 0]no 1]every output 2]only at end 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
r2eefa58 r50958b8 68 68 integer :: detectformat 69 69 70 71 72 ! Initialize arrays in com_mod 73 !***************************** 74 call com_mod_allocate_part(maxpart) 70 75 76 71 77 ! Generate a large number of random numbers 72 78 !****************************************** … … 137 143 write(*,*) 'call readpaths' 138 144 endif 139 call readpaths 145 call readpaths(pathfile) 140 146 141 147 if (verbosity.gt.1) then !show clock info … … 165 171 endif 166 172 endif 167 168 ! Initialize arrays in com_mod169 !*****************************170 call com_mod_allocate_part(maxpart)171 172 173 173 174 ! Read the age classes to be used … … 452 453 endif 453 454 454 if (verbosity.gt.0) write (*,*) 'timemanager> call wetdepo'455 455 call timemanager(metdata_format) 456 457 456 458 457 if (verbosity.gt.0) then … … 469 468 endif 470 469 end do 470 write (*,*) 'timemanager> call wetdepo' 471 471 endif 472 472 -
src/FLEXPART_MPI.f90
r2eefa58 r20963b1 77 77 if (mp_measure_time) call mpif_mtime('flexpart',0) 78 78 79 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 80 85 ! Generate a large number of random numbers 81 86 !****************************************** … … 146 151 write(*,*) 'call readpaths' 147 152 endif 148 call readpaths 153 call readpaths(pathfile) 149 154 150 155 if (verbosity.gt.1) then !show clock info … … 174 179 endif 175 180 endif 176 177 ! Initialize arrays in com_mod178 !*****************************179 180 if(.not.(lmpreader.and.lmp_use_reader)) call com_mod_allocate_part(maxpart_mpi)181 181 182 182 … … 413 413 end if ! (mpif_pid == 0) 414 414 415 if (mp_measure_time) call mpif_mtime('iotime', 1)415 if (mp_measure_time) call mpif_mtime('iotime',0) 416 416 417 417 if (verbosity.gt.0 .and. lroot) then -
src/com_mod.f90
r2eefa58 re9e0f06 18 18 19 19 implicit none 20 21 22 20 23 21 !**************************************************************** … … 71 69 72 70 real :: ctl,fine 73 integer :: ifine,iout,ipout,ipin,iflux,mdomainfill ,ipoutfac71 integer :: ifine,iout,ipout,ipin,iflux,mdomainfill 74 72 integer :: mquasilag,nested_output,ind_source,ind_receptor 75 73 integer :: ind_rel,ind_samp,ioutputforeachrelease,linit_cond,surf_only … … 84 82 ! iout output options: 1 conc. output (ng/m3), 2 mixing ratio (pptv), 3 both 85 83 ! ipout particle dump options: 0 no, 1 every output interval, 2 only at end 86 ! ipoutfac increase particle dump interval by factor (default 1)87 84 ! ipin read in particle positions from dumped file from a previous run 88 85 ! fine real(ifine) … … 124 121 ! lnetcdfout 1 for netcdf grid output, 0 if not. Set in COMMAND (namelist input) 125 122 126 integer :: linversionout127 ! linversionout 1 for one grid_time output file for each release containing all timesteps128 129 123 integer :: nageclass,lage(maxageclass) 130 124 … … 134 128 135 129 logical :: gdomainfill 130 136 131 ! gdomainfill .T., if domain-filling is global, .F. if not 137 132 … … 179 174 real :: ri(5,numclass),rac(5,numclass),rcl(maxspec,5,numclass) 180 175 real :: rgs(maxspec,5,numclass),rlu(maxspec,5,numclass) 181 real :: rm(maxspec),dryvel(maxspec) ,kao(maxspec)176 real :: rm(maxspec),dryvel(maxspec) 182 177 real :: ohcconst(maxspec),ohdconst(maxspec),ohnconst(maxspec) 183 178 … … 364 359 real :: ciwc(0:nxmax-1,0:nymax-1,nzmax,numwfmem)=0.0 !ice [kg/kg] 365 360 real :: clw(0:nxmax-1,0:nymax-1,nzmax,numwfmem)=0.0 !combined [m3/m3] 366 ! RLT add pressure and dry air density 367 real :: prs(0:nxmax-1,0:nymax-1,nzmax,numwfmem) 368 real :: rho_dry(0:nxmax-1,0:nymax-1,nzmax,numwfmem) 361 369 362 real :: pv(0:nxmax-1,0:nymax-1,nzmax,numwfmem) 370 363 real :: rho(0:nxmax-1,0:nymax-1,nzmax,numwfmem) … … 388 381 ! uupol,vvpol [m/s] wind components in polar stereographic projection 389 382 ! tt [K] temperature data 390 ! prs air pressure391 383 ! qv specific humidity data 392 384 ! pv (pvu) potential vorticity … … 659 651 real :: receptorarea(maxreceptor) 660 652 real :: creceptor(maxreceptor,maxspec) 661 real, allocatable, dimension(:,:) :: creceptor0662 653 character(len=16) :: receptorname(maxreceptor) 663 654 integer :: numreceptor … … 682 673 real, allocatable, dimension(:,:) :: xmass1 683 674 real, allocatable, dimension(:,:) :: xscav_frac1 684 685 ! Variables used for writing out interval averages for partoutput686 !****************************************************************687 688 integer, allocatable, dimension(:) :: npart_av689 real, allocatable, dimension(:) :: part_av_cartx,part_av_carty,part_av_cartz,part_av_z,part_av_topo690 real, allocatable, dimension(:) :: part_av_pv,part_av_qv,part_av_tt,part_av_rho,part_av_tro,part_av_hmix691 real, allocatable, dimension(:) :: part_av_uu,part_av_vv,part_av_energy692 675 693 676 ! eso: Moved from timemanager … … 797 780 & idt(nmpart),itramem(nmpart),itrasplit(nmpart),& 798 781 & xtra1(nmpart),ytra1(nmpart),ztra1(nmpart),& 799 & xmass1(nmpart, maxspec)) ! ,& 800 ! & checklifetime(nmpart,maxspec), species_lifetime(maxspec,2))!CGZ-lifetime 801 802 if (ipout.eq.3) then 803 allocate(npart_av(nmpart),part_av_cartx(nmpart),part_av_carty(nmpart),& 804 & part_av_cartz(nmpart),part_av_z(nmpart),part_av_topo(nmpart)) 805 allocate(part_av_pv(nmpart),part_av_qv(nmpart),part_av_tt(nmpart),& 806 & part_av_rho(nmpart),part_av_tro(nmpart),part_av_hmix(nmpart)) 807 allocate(part_av_uu(nmpart),part_av_vv(nmpart),part_av_energy(nmpart)) 808 end if 782 & xmass1(nmpart, maxspec),& 783 & checklifetime(nmpart,maxspec), species_lifetime(maxspec,2))!CGZ-lifetime 809 784 810 785 811 786 allocate(uap(nmpart),ucp(nmpart),uzp(nmpart),us(nmpart),& 812 787 & vs(nmpart),ws(nmpart),cbt(nmpart)) 813 788 814 789 end subroutine com_mod_allocate_part 815 790 -
src/concoutput.f90
r2eefa58 r20963b1 72 72 real :: sp_fact 73 73 real :: outnum,densityoutrecept(maxreceptor),xl,yl 74 ! RLT75 real :: densitydryrecept(maxreceptor)76 real :: factor_dryrecept(maxreceptor)77 74 78 75 !real densityoutgrid(0:numxgrid-1,0:numygrid-1,numzgrid), … … 109 106 character(LEN=8),save :: file_stat='REPLACE' 110 107 logical :: ldates_file 111 logical :: lexist112 108 integer :: ierr 113 109 character(LEN=100) :: dates_char … … 207 203 densityoutgrid(ix,jy,kz)=(rho(iix,jjy,kzz,mind)*dz1+ & 208 204 rho(iix,jjy,kzz-1,mind)*dz2)/dz 209 ! RLT210 densitydrygrid(ix,jy,kz)=(rho_dry(iix,jjy,kzz,mind)*dz1+ &211 rho_dry(iix,jjy,kzz-1,mind)*dz2)/dz212 205 end do 213 206 end do … … 221 214 !densityoutrecept(i)=rho(iix,jjy,1,2) 222 215 densityoutrecept(i)=rho(iix,jjy,1,mind) 223 ! RLT224 densitydryrecept(i)=rho_dry(iix,jjy,1,mind)225 216 end do 226 217 227 ! RLT228 ! conversion factor for output relative to dry air229 factor_drygrid=densityoutgrid/densitydrygrid230 factor_dryrecept=densityoutrecept/densitydryrecept231 218 232 219 ! Output is different for forward and backward simulations … … 366 353 ! Concentration output 367 354 !********************* 368 if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5) ) then355 if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5).or.(iout.eq.6)) then 369 356 370 357 ! Wet deposition … … 627 614 end do 628 615 629 ! RLT Aug 2017630 ! Write out conversion factor for dry air631 inquire(file=path(2)(1:length(2))//'factor_drygrid',exist=lexist)632 if (lexist) then633 ! open and append634 open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid',form='unformatted',&635 status='old',action='write',access='append')636 else637 ! create new638 open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid',form='unformatted',&639 status='new',action='write')640 endif641 sp_count_i=0642 sp_count_r=0643 sp_fact=-1.644 sp_zer=.true.645 do kz=1,numzgrid646 do jy=0,numygrid-1647 do ix=0,numxgrid-1648 if (factor_drygrid(ix,jy,kz).gt.(1.+smallnum).or.factor_drygrid(ix,jy,kz).lt.(1.-smallnum)) then649 if (sp_zer.eqv..true.) then ! first value not equal to one650 sp_count_i=sp_count_i+1651 sparse_dump_i(sp_count_i)= &652 ix+jy*numxgrid+kz*numxgrid*numygrid653 sp_zer=.false.654 sp_fact=sp_fact*(-1.)655 endif656 sp_count_r=sp_count_r+1657 sparse_dump_r(sp_count_r)= &658 sp_fact*factor_drygrid(ix,jy,kz)659 else ! factor is one660 sp_zer=.true.661 endif662 end do663 end do664 end do665 write(unitoutfactor) sp_count_i666 write(unitoutfactor) (sparse_dump_i(i),i=1,sp_count_i)667 write(unitoutfactor) sp_count_r668 write(unitoutfactor) (sparse_dump_r(i),i=1,sp_count_r)669 close(unitoutfactor)670 671 672 616 if (gridtotal.gt.0.) gridtotalunc=gridsigmatotal/gridtotal 673 617 if (wetgridtotal.gt.0.) wetgridtotalunc=wetgridsigmatotal/ & … … 696 640 endif 697 641 698 ! RLT Aug 2017 699 ! Write out conversion factor for dry air 700 if (numreceptor.gt.0) then 701 inquire(file=path(2)(1:length(2))//'factor_dryreceptor',exist=lexist) 702 if (lexist) then 703 ! open and append 704 open(unitoutfactor,file=path(2)(1:length(2))//'factor_dryreceptor',form='unformatted',& 705 status='old',action='write',access='append') 706 else 707 ! create new 708 open(unitoutfactor,file=path(2)(1:length(2))//'factor_dryreceptor',form='unformatted',& 709 status='new',action='write') 710 endif 711 write(unitoutfactor) itime 712 write(unitoutfactor) (factor_dryrecept(i),i=1,numreceptor) 713 close(unitoutfactor) 714 endif 642 715 643 716 644 ! Reinitialization of grid -
src/concoutput_mpi.f90
r6741557 r20963b1 364 364 ! Concentration output 365 365 !********************* 366 if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5) ) then366 if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5).or.(iout.eq.6)) then 367 367 368 368 ! Wet deposition -
src/concoutput_nest.f90
r2eefa58 r7d02c2f 70 70 real :: sp_fact 71 71 real :: outnum,densityoutrecept(maxreceptor),xl,yl 72 ! RLT73 real :: densitydryrecept(maxreceptor)74 real :: factor_dryrecept(maxreceptor)75 72 76 73 !real densityoutgrid(0:numxgrid-1,0:numygrid-1,numzgrid), … … 99 96 character :: adate*8,atime*6 100 97 character(len=3) :: anspec 101 logical :: lexist102 98 integer :: mind 103 99 ! mind eso:added to ensure identical results between 2&3-fields versions … … 168 164 densityoutgrid(ix,jy,kz)=(rho(iix,jjy,kzz,mind)*dz1+ & 169 165 rho(iix,jjy,kzz-1,mind)*dz2)/dz 170 ! RLT171 densitydrygrid(ix,jy,kz)=(rho_dry(iix,jjy,kzz,mind)*dz1+ &172 rho_dry(iix,jjy,kzz-1,mind)*dz2)/dz173 166 end do 174 167 end do … … 182 175 !densityoutrecept(i)=rho(iix,jjy,1,2) 183 176 densityoutrecept(i)=rho(iix,jjy,1,mind) 184 ! RLT185 densitydryrecept(i)=rho_dry(iix,jjy,1,mind)186 177 end do 187 178 188 ! RLT189 ! conversion factor for output relative to dry air190 factor_drygrid=densityoutgrid/densitydrygrid191 factor_dryrecept=densityoutrecept/densitydryrecept192 179 193 180 ! Output is different for forward and backward simulations … … 564 551 end do 565 552 566 ! RLT Aug 2017567 ! Write out conversion factor for dry air568 inquire(file=path(2)(1:length(2))//'factor_drygrid_nest',exist=lexist)569 if (lexist) then570 ! open and append571 open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid_nest',form='unformatted',&572 status='old',action='write',access='append')573 else574 ! create new575 open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid_nest',form='unformatted',&576 status='new',action='write')577 endif578 sp_count_i=0579 sp_count_r=0580 sp_fact=-1.581 sp_zer=.true.582 do kz=1,numzgrid583 do jy=0,numygridn-1584 do ix=0,numxgridn-1585 if (factor_drygrid(ix,jy,kz).gt.(1.+smallnum).or.factor_drygrid(ix,jy,kz).lt.(1.-smallnum)) then586 if (sp_zer.eqv..true.) then ! first value not equal to one587 sp_count_i=sp_count_i+1588 sparse_dump_i(sp_count_i)= &589 ix+jy*numxgridn+kz*numxgridn*numygridn590 sp_zer=.false.591 sp_fact=sp_fact*(-1.)592 endif593 sp_count_r=sp_count_r+1594 sparse_dump_r(sp_count_r)= &595 sp_fact*factor_drygrid(ix,jy,kz)596 else ! factor is one597 sp_zer=.true.598 endif599 end do600 end do601 end do602 write(unitoutfactor) sp_count_i603 write(unitoutfactor) (sparse_dump_i(i),i=1,sp_count_i)604 write(unitoutfactor) sp_count_r605 write(unitoutfactor) (sparse_dump_r(i),i=1,sp_count_r)606 close(unitoutfactor)607 553 608 554 -
src/concoutput_surf.f90
r2eefa58 r16b61a5 72 72 real :: sp_fact 73 73 real :: outnum,densityoutrecept(maxreceptor),xl,yl 74 ! RLT75 real :: densitydryrecept(maxreceptor)76 real :: factor_dryrecept(maxreceptor)77 74 78 75 !real densityoutgrid(0:numxgrid-1,0:numygrid-1,numzgrid), … … 104 101 character :: adate*8,atime*6 105 102 character(len=3) :: anspec 106 logical :: lexist107 103 108 104 … … 184 180 densityoutgrid(ix,jy,kz)=(rho(iix,jjy,kzz,2)*dz1+ & 185 181 rho(iix,jjy,kzz-1,2)*dz2)/dz 186 ! RLT187 densitydrygrid(ix,jy,kz)=(rho_dry(iix,jjy,kzz,2)*dz1+ &188 rho_dry(iix,jjy,kzz-1,2)*dz2)/dz189 182 end do 190 183 end do … … 197 190 jjy=max(min(nint(yl),nymin1),0) 198 191 densityoutrecept(i)=rho(iix,jjy,1,2) 199 ! RLT200 densitydryrecept(i)=rho_dry(iix,jjy,1,2)201 192 end do 202 193 203 ! RLT204 ! conversion factor for output relative to dry air205 factor_drygrid=densityoutgrid/densitydrygrid206 factor_dryrecept=densityoutrecept/densitydryrecept207 194 208 195 ! Output is different for forward and backward simulations … … 609 596 end do 610 597 611 ! RLT Aug 2017612 ! Write out conversion factor for dry air613 inquire(file=path(2)(1:length(2))//'factor_drygrid',exist=lexist)614 if (lexist) then615 ! open and append616 open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid',form='unformatted',&617 status='old',action='write',access='append')618 else619 ! create new620 open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid',form='unformatted',&621 status='new',action='write')622 endif623 sp_count_i=0624 sp_count_r=0625 sp_fact=-1.626 sp_zer=.true.627 do kz=1,1628 do jy=0,numygrid-1629 do ix=0,numxgrid-1630 if (factor_drygrid(ix,jy,kz).gt.(1.+smallnum).or.factor_drygrid(ix,jy,kz).lt.(1.-smallnum)) then631 if (sp_zer.eqv..true.) then ! first value not equal to one632 sp_count_i=sp_count_i+1633 sparse_dump_i(sp_count_i)= &634 ix+jy*numxgrid+kz*numxgrid*numygrid635 sp_zer=.false.636 sp_fact=sp_fact*(-1.)637 endif638 sp_count_r=sp_count_r+1639 sparse_dump_r(sp_count_r)= &640 sp_fact*factor_drygrid(ix,jy,kz)641 else ! factor is one642 sp_zer=.true.643 endif644 end do645 end do646 end do647 write(unitoutfactor) sp_count_i648 write(unitoutfactor) (sparse_dump_i(i),i=1,sp_count_i)649 write(unitoutfactor) sp_count_r650 write(unitoutfactor) (sparse_dump_r(i),i=1,sp_count_r)651 close(unitoutfactor)652 653 654 598 if (gridtotal.gt.0.) gridtotalunc=gridsigmatotal/gridtotal 655 599 if (wetgridtotal.gt.0.) wetgridtotalunc=wetgridsigmatotal/ & … … 678 622 endif 679 623 680 ! RLT Aug 2017 681 ! Write out conversion factor for dry air 682 if (numreceptor.gt.0) then 683 inquire(file=path(2)(1:length(2))//'factor_dryreceptor',exist=lexist) 684 if (lexist) then 685 ! open and append 686 open(unitoutfactor,file=path(2)(1:length(2))//'factor_dryreceptor',form='unformatted',& 687 status='old',action='write',access='append') 688 else 689 ! create new 690 open(unitoutfactor,file=path(2)(1:length(2))//'factor_dryreceptor',form='unformatted',& 691 status='new',action='write') 692 endif 693 write(unitoutfactor) itime 694 write(unitoutfactor) (factor_dryrecept(i),i=1,numreceptor) 695 close(unitoutfactor) 696 endif 624 697 625 698 626 ! Reinitialization of grid -
src/concoutput_surf_nest.f90
r2eefa58 r6a678e3 70 70 real :: sp_fact 71 71 real :: outnum,densityoutrecept(maxreceptor),xl,yl 72 ! RLT73 real :: densitydryrecept(maxreceptor)74 real :: factor_dryrecept(maxreceptor)75 72 76 73 !real densityoutgrid(0:numxgrid-1,0:numygrid-1,numzgrid), … … 99 96 character :: adate*8,atime*6 100 97 character(len=3) :: anspec 101 logical :: lexist 98 102 99 103 100 ! Determine current calendar date, needed for the file name … … 162 159 densityoutgrid(ix,jy,kz)=(rho(iix,jjy,kzz,2)*dz1+ & 163 160 rho(iix,jjy,kzz-1,2)*dz2)/dz 164 ! RLT165 densitydrygrid(ix,jy,kz)=(rho_dry(iix,jjy,kzz,2)*dz1+ &166 rho_dry(iix,jjy,kzz-1,2)*dz2)/dz167 161 end do 168 162 end do … … 175 169 jjy=max(min(nint(yl),nymin1),0) 176 170 densityoutrecept(i)=rho(iix,jjy,1,2) 177 ! RLT178 densitydryrecept(i)=rho_dry(iix,jjy,1,2)179 171 end do 180 172 181 ! RLT182 ! conversion factor for output relative to dry air183 factor_drygrid=densityoutgrid/densitydrygrid184 factor_dryrecept=densityoutrecept/densitydryrecept185 173 186 174 ! Output is different for forward and backward simulations … … 329 317 write(unitoutgrid) sp_count_r 330 318 write(unitoutgrid) (sparse_dump_r(i),i=1,sp_count_r) 331 !write(unitoutgrid) sp_count_r332 !write(unitoutgrid) (sparse_dump_u(i),i=1,sp_count_r)319 write(unitoutgrid) sp_count_r 320 write(unitoutgrid) (sparse_dump_u(i),i=1,sp_count_r) 333 321 334 322 ! Dry deposition … … 366 354 write(unitoutgrid) sp_count_r 367 355 write(unitoutgrid) (sparse_dump_r(i),i=1,sp_count_r) 368 !write(unitoutgrid) sp_count_r369 !write(unitoutgrid) (sparse_dump_u(i),i=1,sp_count_r)356 write(unitoutgrid) sp_count_r 357 write(unitoutgrid) (sparse_dump_u(i),i=1,sp_count_r) 370 358 371 359 … … 411 399 write(unitoutgrid) sp_count_r 412 400 write(unitoutgrid) (sparse_dump_r(i),i=1,sp_count_r) 413 !write(unitoutgrid) sp_count_r414 !write(unitoutgrid) (sparse_dump_u(i),i=1,sp_count_r)401 write(unitoutgrid) sp_count_r 402 write(unitoutgrid) (sparse_dump_u(i),i=1,sp_count_r) 415 403 else 416 404 … … 452 440 write(unitoutgrid) sp_count_r 453 441 write(unitoutgrid) (sparse_dump_r(i),i=1,sp_count_r) 454 !write(unitoutgrid) sp_count_r455 !write(unitoutgrid) (sparse_dump_u(i),i=1,sp_count_r)442 write(unitoutgrid) sp_count_r 443 write(unitoutgrid) (sparse_dump_u(i),i=1,sp_count_r) 456 444 endif ! surf_only 457 445 … … 499 487 write(unitoutgridppt) sp_count_r 500 488 write(unitoutgridppt) (sparse_dump_r(i),i=1,sp_count_r) 501 !write(unitoutgridppt) sp_count_r502 !write(unitoutgridppt) (sparse_dump_u(i),i=1,sp_count_r)489 write(unitoutgridppt) sp_count_r 490 write(unitoutgridppt) (sparse_dump_u(i),i=1,sp_count_r) 503 491 504 492 … … 538 526 write(unitoutgridppt) sp_count_r 539 527 write(unitoutgridppt) (sparse_dump_r(i),i=1,sp_count_r) 540 !write(unitoutgridppt) sp_count_r541 !write(unitoutgridppt) (sparse_dump_u(i),i=1,sp_count_r)528 write(unitoutgridppt) sp_count_r 529 write(unitoutgridppt) (sparse_dump_u(i),i=1,sp_count_r) 542 530 543 531 … … 582 570 write(unitoutgridppt) sp_count_r 583 571 write(unitoutgridppt) (sparse_dump_r(i),i=1,sp_count_r) 584 !write(unitoutgridppt) sp_count_r585 !write(unitoutgridppt) (sparse_dump_u(i),i=1,sp_count_r)572 write(unitoutgridppt) sp_count_r 573 write(unitoutgridppt) (sparse_dump_u(i),i=1,sp_count_r) 586 574 else 587 575 … … 623 611 write(unitoutgridppt) sp_count_r 624 612 write(unitoutgridppt) (sparse_dump_r(i),i=1,sp_count_r) 625 !write(unitoutgridppt) sp_count_r626 !write(unitoutgridppt) (sparse_dump_u(i),i=1,sp_count_r)613 write(unitoutgridppt) sp_count_r 614 write(unitoutgridppt) (sparse_dump_u(i),i=1,sp_count_r) 627 615 endif ! surf_only 628 616 … … 636 624 637 625 end do 638 639 ! RLT Aug 2017640 ! Write out conversion factor for dry air641 inquire(file=path(2)(1:length(2))//'factor_drygrid_nest',exist=lexist)642 if (lexist) then643 ! open and append644 open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid_nest',form='unformatted',&645 status='old',action='write',access='append')646 else647 ! create new648 open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid_nest',form='unformatted',&649 status='new',action='write')650 endif651 sp_count_i=0652 sp_count_r=0653 sp_fact=-1.654 sp_zer=.true.655 do kz=1,1656 do jy=0,numygridn-1657 do ix=0,numxgridn-1658 if (factor_drygrid(ix,jy,kz).gt.(1.+smallnum).or.factor_drygrid(ix,jy,kz).lt.(1.-smallnum)) then659 if (sp_zer.eqv..true.) then ! first value not equal to one660 sp_count_i=sp_count_i+1661 sparse_dump_i(sp_count_i)= &662 ix+jy*numxgridn+kz*numxgridn*numygridn663 sp_zer=.false.664 sp_fact=sp_fact*(-1.)665 endif666 sp_count_r=sp_count_r+1667 sparse_dump_r(sp_count_r)= &668 sp_fact*factor_drygrid(ix,jy,kz)669 else ! factor is one670 sp_zer=.true.671 endif672 end do673 end do674 end do675 write(unitoutfactor) sp_count_i676 write(unitoutfactor) (sparse_dump_i(i),i=1,sp_count_i)677 write(unitoutfactor) sp_count_r678 write(unitoutfactor) (sparse_dump_r(i),i=1,sp_count_r)679 close(unitoutfactor)680 626 681 627 -
src/getfields.f90
r2eefa58 r6ecb30a 87 87 real :: pvhn(0:nxmaxn-1,0:nymaxn-1,nuvzmax,maxnests) 88 88 real :: wwhn(0:nxmaxn-1,0:nymaxn-1,nwzmax,maxnests) 89 ! RLT added partial pressure water vapor90 real :: pwater(0:nxmax-1,0:nymax-1,nzmax,numwfmem)91 integer :: kz, ix92 character(len=100) :: rowfmt93 89 94 90 integer :: indmin = 1 … … 157 153 40 indmin=indj 158 154 159 160 call writeprecip(itime,memind(1))161 155 if (WETBKDEP) then 156 call writeprecip(itime,memind(1)) 157 endif 162 158 163 159 else … … 208 204 60 indmin=indj 209 205 210 if (WETBKDEP) then 211 call writeprecip(itime,memind(1)) 212 endif 213 214 end if 215 216 ! RLT calculate dry air density 217 pwater=qv*prs/((r_air/r_water)*(1.-qv)+qv) 218 rho_dry=(prs-pwater)/(r_air*tt) 219 220 ! test density 221 ! write(rowfmt,'(A,I6,A)') '(',nymax,'(E11.4,1X))' 222 ! if(itime.eq.0) then 223 ! open(500,file=path(2)(1:length(2))//'rho_dry.txt',status='replace',action='write') 224 ! do kz=1,nzmax 225 ! do ix=1,nxmax 226 ! write(500,fmt=rowfmt) rho_dry(ix,:,kz,1) 227 ! end do 228 ! end do 229 ! close(500) 230 ! open(500,file=path(2)(1:length(2))//'rho.txt',status='replace',action='write') 231 ! do kz=1,nzmax 232 ! do ix=1,nxmax 233 ! write(500,fmt=rowfmt) rho(ix,:,kz,1) 234 ! end do 235 ! end do 236 ! close(500) 237 ! endif 206 if (WETBKDEP) then 207 call writeprecip(itime,memind(1)) 208 endif 209 210 endif 238 211 239 212 lwindinterv=abs(memtime(2)-memtime(1)) -
src/init_domainfill.f90
r0a94e13 rb5127f9 86 86 endif 87 87 endif 88 89 ! Exit here if resuming a run from particle dump90 !***********************************************91 if (gdomainfill.and.ipin.ne.0) return92 88 93 89 ! Do not release particles twice (i.e., not at both in the leftmost and rightmost … … 418 414 !*************************************************************************** 419 415 420 if ( (ipin.eq.1).and.(.not.gdomainfill)) then416 if (ipin.eq.1) then 421 417 open(unitboundcond,file=path(2)(1:length(2))//'boundcond.bin', & 422 418 form='unformatted') -
src/init_domainfill_mpi.f90
r328fdf9 rb5127f9 110 110 endif 111 111 112 ! Exit here if resuming a run from particle dump113 !***********************************************114 if (gdomainfill.and.ipin.ne.0) return115 116 112 ! Do not release particles twice (i.e., not at both in the leftmost and rightmost 117 113 ! grid cell) for a global domain … … 217 213 colmass(ix,jy)=(pp(1)-pp(nz))/ga*gridarea(jy) 218 214 colmasstotal=colmasstotal+colmass(ix,jy) 215 219 216 end do 220 217 end do … … 469 466 470 467 ! eso TODO: only needed for root process 471 if ( (ipin.eq.1).and.(.not.gdomainfill)) then468 if (ipin.eq.1) then 472 469 open(unitboundcond,file=path(2)(1:length(2))//'boundcond.bin', & 473 470 form='unformatted') … … 477 474 endif 478 475 479 if (ipin.eq.0) then 480 numpart = numpart/mp_partgroup_np 481 if (mod(numpart,mp_partgroup_np).ne.0) numpart=numpart+1 482 end if 483 484 else ! Allocate dummy arrays for receiving processes 485 if (ipin.eq.0) then 486 allocate(itra1_tmp(nullsize),npoint_tmp(nullsize),nclass_tmp(nullsize),& 487 & idt_tmp(nullsize),itramem_tmp(nullsize),itrasplit_tmp(nullsize),& 488 & xtra1_tmp(nullsize),ytra1_tmp(nullsize),ztra1_tmp(nullsize),& 489 & xmass1_tmp(nullsize, nullsize)) 490 end if 476 numpart = numpart/mp_partgroup_np 477 if (mod(numpart,mp_partgroup_np).ne.0) numpart=numpart+1 478 479 else ! Allocate dummy arrays for receiving processes 480 allocate(itra1_tmp(nullsize),npoint_tmp(nullsize),nclass_tmp(nullsize),& 481 & idt_tmp(nullsize),itramem_tmp(nullsize),itrasplit_tmp(nullsize),& 482 & xtra1_tmp(nullsize),ytra1_tmp(nullsize),ztra1_tmp(nullsize),& 483 & xmass1_tmp(nullsize, nullsize)) 491 484 492 end if ! end if(lroot) 493 485 end if ! end if(lroot) 494 486 495 487 496 488 ! Distribute particles to other processes (numpart is 'per-process', not total) 497 ! Only if not restarting from previous run 498 if (ipin.eq.0) then 499 call MPI_Bcast(numpart, 1, MPI_INTEGER, id_root, mp_comm_used, mp_ierr)500 call mpif_send_part_properties(npart(1)/mp_partgroup_np)489 call MPI_Bcast(numpart, 1, MPI_INTEGER, id_root, mp_comm_used, mp_ierr) 490 ! eso TODO: xmassperparticle: not necessary to send 491 call MPI_Bcast(xmassperparticle, 1, mp_sp, id_root, mp_comm_used, mp_ierr) 492 call mpif_send_part_properties(numpart) 501 493 502 494 ! Deallocate the temporary arrays used for all particles 503 495 deallocate(itra1_tmp,npoint_tmp,nclass_tmp,idt_tmp,itramem_tmp,& 504 496 & itrasplit_tmp,xtra1_tmp,ytra1_tmp,ztra1_tmp,xmass1_tmp) 505 end if506 497 507 498 -
src/makefile
r2eefa58 r7123c70 118 118 OBJECTS_SERIAL = \ 119 119 releaseparticles.o partoutput.o \ 120 partoutput_average.o \121 120 conccalc.o \ 122 121 init_domainfill.o concoutput.o \ … … 128 127 redist.o \ 129 128 concoutput_surf.o concoutput_surf_nest.o \ 130 concoutput_inversion_nest.o \131 concoutput_inversion.o \132 129 getfields.o \ 133 130 readwind_ecmwf.o … … 135 132 ## For MPI version 136 133 OBJECTS_MPI = releaseparticles_mpi.o partoutput_mpi.o \ 137 partoutput_average_mpi.oconccalc_mpi.o \134 conccalc_mpi.o \ 138 135 init_domainfill_mpi.o concoutput_mpi.o \ 139 136 timemanager_mpi.o FLEXPART_MPI.o \ … … 152 149 advance.o initialize.o \ 153 150 writeheader.o writeheader_txt.o \ 154 partpos_average.owriteprecip.o \151 writeprecip.o \ 155 152 writeheader_surf.o assignland.o\ 156 153 part0.o gethourlyOH.o\ … … 202 199 drydepokernel_nest.o zenithangle.o \ 203 200 ohreaction.o getvdep_nests.o \ 204 initial_cond_calc.o initial_cond_output.o initial_cond_output_inversion.o\201 initial_cond_calc.o initial_cond_output.o \ 205 202 dynamic_viscosity.o get_settling.o \ 206 203 initialize_cbl_vel.o re_initialize_particle.o \ … … 274 271 conccalc_mpi.o: com_mod.o mpi_mod.o outg_mod.o par_mod.o unc_mod.o 275 272 concoutput.o: com_mod.o outg_mod.o par_mod.o point_mod.o unc_mod.o mean_mod.o 276 concoutput_inversion.o: com_mod.o outg_mod.o par_mod.o point_mod.o unc_mod.o mean_mod.o277 273 concoutput_mpi.o: com_mod.o mpi_mod.o outg_mod.o par_mod.o point_mod.o \ 278 274 unc_mod.o mean_mod.o 279 275 concoutput_nest.o: com_mod.o outg_mod.o par_mod.o point_mod.o unc_mod.o mean_mod.o 280 concoutput_inversion_nest.o: com_mod.o outg_mod.o par_mod.o point_mod.o unc_mod.o mean_mod.o281 276 concoutput_nest_mpi.o: com_mod.o mpi_mod.o outg_mod.o par_mod.o point_mod.o \ 282 277 unc_mod.o mean_mod.o … … 325 320 initial_cond_calc.o: com_mod.o outg_mod.o par_mod.o unc_mod.o 326 321 initial_cond_output.o: com_mod.o outg_mod.o par_mod.o point_mod.o unc_mod.o 327 initial_cond_output_inversion.o: com_mod.o outg_mod.o par_mod.o point_mod.o unc_mod.o328 322 initialize.o: com_mod.o hanna_mod.o interpol_mod.o par_mod.o random_mod.o 329 323 initialize_cbl_vel.o: com_mod.o par_mod.o random_mod.o … … 354 348 part0.o: par_mod.o 355 349 partdep.o: par_mod.o 356 partpos_average.o: com_mod.o par_mod.o357 350 partoutput.o: com_mod.o par_mod.o 358 partoutput_average.o: com_mod.o par_mod.o359 partoutput_average_mpi.o: com_mod.o par_mod.o mpi_mod.o360 351 partoutput_mpi.o: com_mod.o mpi_mod.o par_mod.o 361 352 partoutput_short.o: com_mod.o par_mod.o -
src/mpi_mod.f90
r0c8c7f2 r0ecc1fe 88 88 ! Variables for MPI processes in the 'particle' group 89 89 integer, allocatable, dimension(:) :: mp_partgroup_rank 90 integer, allocatable, dimension(:) :: npart_per_process91 90 integer :: mp_partgroup_comm, mp_partgroup_pid, mp_partgroup_np 92 91 … … 126 125 ! mp_time_barrier Measure MPI barrier time 127 126 ! mp_exact_numpart Use an extra MPI communication to give the exact number of particles 128 ! to standard output (this does not otherwise affect the simulation)127 ! to standard output (this does *not* otherwise affect the simulation) 129 128 logical, parameter :: mp_dbg_mode = .false. 130 129 logical, parameter :: mp_dev_mode = .false. … … 191 190 ! mp_np number of running processes, decided at run-time 192 191 !*********************************************************************** 193 use par_mod, only: maxpart, numwfmem, dep_prec , maxreceptor, maxspec194 use com_mod, only: mpi_mode, verbosity , creceptor0192 use par_mod, only: maxpart, numwfmem, dep_prec 193 use com_mod, only: mpi_mode, verbosity 195 194 196 195 implicit none … … 338 337 339 338 ! Set maxpart per process 340 ! ESO08/2016: Increase maxpart per process, in case of unbalanced distribution339 ! eso 08/2016: Increase maxpart per process, in case of unbalanced distribution 341 340 maxpart_mpi=int(mp_maxpart_factor*real(maxpart)/real(mp_partgroup_np)) 342 341 if (mp_np == 1) maxpart_mpi = maxpart … … 366 365 end if 367 366 368 ! Allocate array for number of particles per process369 allocate(npart_per_process(0:mp_partgroup_np-1))370 371 ! Write whether MPI_IN_PLACE is used or not372 #ifdef USE_MPIINPLACE373 if (lroot) write(*,*) 'Using MPI_IN_PLACE operations'374 #else375 if (lroot) allocate(creceptor0(maxreceptor,maxspec))376 if (lroot) write(*,*) 'Not using MPI_IN_PLACE operations'377 #endif378 367 goto 101 379 368 … … 570 559 ! invalid particles at the end of the arrays 571 560 572 601 do i=num part, 1, -1561 601 do i=num_part, 1, -1 573 562 if (itra1(i).eq.-999999999) then 574 563 numpart=numpart-1 … … 609 598 integer :: i,jj,nn, num_part=1,m,imin, num_trans 610 599 logical :: first_iter 611 integer,allocatable,dimension(:) :: idx_arr600 integer,allocatable,dimension(:) :: numparticles_mpi, idx_arr 612 601 real,allocatable,dimension(:) :: sorted ! TODO: we don't really need this 613 602 … … 618 607 ! All processes exchange information on number of particles 619 608 !**************************************************************************** 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, & 609 allocate(numparticles_mpi(0:mp_partgroup_np-1), & 610 &idx_arr(0:mp_partgroup_np-1), sorted(0:mp_partgroup_np-1)) 611 612 call MPI_Allgather(numpart, 1, MPI_INTEGER, numparticles_mpi, & 623 613 & 1, MPI_INTEGER, mp_comm_used, mp_ierr) 624 614 … … 626 616 ! Sort from lowest to highest 627 617 ! Initial guess: correct order 628 sorted(:) = n part_per_process(:)618 sorted(:) = numparticles_mpi(:) 629 619 do i=0, mp_partgroup_np-1 630 620 idx_arr(i) = i 631 621 end do 632 633 ! Do not rebalance particles for ipout=3634 if (ipout.eq.3) return635 622 636 623 ! For each successive element in index array, see if a lower value exists … … 658 645 m=mp_partgroup_np-1 ! index for last sorted process (most particles) 659 646 do i=0,mp_partgroup_np/2-1 660 num_trans = n part_per_process(idx_arr(m)) - npart_per_process(idx_arr(i))647 num_trans = numparticles_mpi(idx_arr(m)) - numparticles_mpi(idx_arr(i)) 661 648 if (mp_partid.eq.idx_arr(m).or.mp_partid.eq.idx_arr(i)) then 662 if ( n part_per_process(idx_arr(m)).gt.mp_min_redist.and.&663 & real(num_trans)/real(n part_per_process(idx_arr(m))).gt.mp_redist_fract) then649 if ( numparticles_mpi(idx_arr(m)).gt.mp_min_redist.and.& 650 & real(num_trans)/real(numparticles_mpi(idx_arr(m))).gt.mp_redist_fract) then 664 651 ! DBG 665 ! write(*,*) 'mp_partid, idx_arr(m), idx_arr(i), mp_min_redist, num_trans, n part_per_process', &666 ! &mp_partid, idx_arr(m), idx_arr(i), mp_min_redist, num_trans, n part_per_process652 ! write(*,*) 'mp_partid, idx_arr(m), idx_arr(i), mp_min_redist, num_trans, numparticles_mpi', & 653 ! &mp_partid, idx_arr(m), idx_arr(i), mp_min_redist, num_trans, numparticles_mpi 667 654 ! DBG 668 655 call mpif_redist_part(itime, idx_arr(m), idx_arr(i), num_trans/2) … … 672 659 end do 673 660 674 deallocate( idx_arr, sorted)661 deallocate(numparticles_mpi, idx_arr, sorted) 675 662 676 663 end subroutine mpif_calculate_part_redist … … 1974 1961 if (readclouds) then 1975 1962 j=j+1 1976 call MPI_Irecv(ctwc(:,:,mind),d2s1 *5,mp_sp,id_read,MPI_ANY_TAG,&1963 call MPI_Irecv(ctwc(:,:,mind),d2s1,mp_sp,id_read,MPI_ANY_TAG,& 1977 1964 &MPI_COMM_WORLD,reqs(j),mp_ierr) 1978 1965 if (mp_ierr /= 0) goto 600 … … 2339 2326 if (readclouds) then 2340 2327 j=j+1 2341 call MPI_Irecv(ctwcn(:,:,mind,k),d2s1 *5,mp_sp,id_read,MPI_ANY_TAG,&2328 call MPI_Irecv(ctwcn(:,:,mind,k),d2s1,mp_sp,id_read,MPI_ANY_TAG,& 2342 2329 &MPI_COMM_WORLD,reqs(j),mp_ierr) 2343 2330 if (mp_ierr /= 0) goto 600 … … 2475 2462 end if 2476 2463 2477 ! Receptor concentrations 2464 #else 2465 2466 call MPI_Reduce(gridunc, gridunc0, grid_size3d, mp_sp, MPI_SUM, id_root, & 2467 & mp_comm_used, mp_ierr) 2468 if (lroot) gridunc = gridunc0 2469 2470 #endif 2471 2472 if ((WETDEP).and.(ldirect.gt.0)) then 2473 call MPI_Reduce(wetgridunc, wetgridunc0, grid_size2d, mp_cp, MPI_SUM, id_root, & 2474 & mp_comm_used, mp_ierr) 2475 if (mp_ierr /= 0) goto 600 2476 end if 2477 2478 if ((DRYDEP).and.(ldirect.gt.0)) then 2479 call MPI_Reduce(drygridunc, drygridunc0, grid_size2d, mp_cp, MPI_SUM, id_root, & 2480 & mp_comm_used, mp_ierr) 2481 if (mp_ierr /= 0) goto 600 2482 end if 2483 2484 ! Receptor concentrations 2478 2485 if (lroot) then 2479 2486 call MPI_Reduce(MPI_IN_PLACE,creceptor,rcpt_size,mp_sp,MPI_SUM,id_root, & … … 2484 2491 & mp_comm_used,mp_ierr) 2485 2492 end if 2486 2487 #else2488 2489 call MPI_Reduce(gridunc, gridunc0, grid_size3d, mp_sp, MPI_SUM, id_root, &2490 & mp_comm_used, mp_ierr)2491 if (mp_ierr /= 0) goto 6002492 if (lroot) gridunc = gridunc02493 2494 call MPI_Reduce(creceptor, creceptor0,rcpt_size,mp_sp,MPI_SUM,id_root, &2495 & mp_comm_used,mp_ierr)2496 if (mp_ierr /= 0) goto 6002497 if (lroot) creceptor = creceptor02498 2499 #endif2500 2501 if ((WETDEP).and.(ldirect.gt.0)) then2502 call MPI_Reduce(wetgridunc, wetgridunc0, grid_size2d, mp_cp, MPI_SUM, id_root, &2503 & mp_comm_used, mp_ierr)2504 if (mp_ierr /= 0) goto 6002505 end if2506 2507 if ((DRYDEP).and.(ldirect.gt.0)) then2508 call MPI_Reduce(drygridunc, drygridunc0, grid_size2d, mp_cp, MPI_SUM, id_root, &2509 & mp_comm_used, mp_ierr)2510 if (mp_ierr /= 0) goto 6002511 end if2512 2513 2493 2514 2494 if (mp_measure_time) call mpif_mtime('commtime',1) … … 2720 2700 end if 2721 2701 2722 case ('readwind')2723 if (imode.eq.0) then2724 call cpu_time(mp_readwind_time_beg)2725 mp_readwind_wtime_beg = mpi_wtime()2726 else2727 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 if2702 case ('readwind') 2703 if (imode.eq.0) then 2704 call cpu_time(mp_readwind_time_beg) 2705 mp_readwind_wtime_beg = mpi_wtime() 2706 else 2707 call cpu_time(mp_readwind_time_end) 2708 mp_readwind_wtime_end = mpi_wtime() 2709 2710 mp_readwind_time_total = mp_readwind_time_total + & 2711 &(mp_readwind_time_end - mp_readwind_time_beg) 2712 mp_readwind_wtime_total = mp_readwind_wtime_total + & 2713 &(mp_readwind_wtime_end - mp_readwind_wtime_beg) 2714 end if 2735 2715 2736 2716 case ('commtime') … … 2808 2788 write(*,FMT='(A60,TR1,F9.2)') 'TOTAL CPU TIME FOR GETFIELDS:',& 2809 2789 & mp_getfields_time_total 2810 !write(*,FMT='(A60,TR1,F9.2)') 'TOTAL WALL TIME FOR READWIND:',&2811 !& mp_readwind_wtime_total2812 !write(*,FMT='(A60,TR1,F9.2)') 'TOTAL CPU TIME FOR READWIND:',&2813 !& mp_readwind_time_total2790 write(*,FMT='(A60,TR1,F9.2)') 'TOTAL WALL TIME FOR READWIND:',& 2791 & mp_readwind_wtime_total 2792 write(*,FMT='(A60,TR1,F9.2)') 'TOTAL CPU TIME FOR READWIND:',& 2793 & mp_readwind_time_total 2814 2794 write(*,FMT='(A60,TR1,F9.2)') 'TOTAL WALL TIME FOR FILE IO:',& 2815 2795 & mp_io_wtime_total -
src/netcdf_output_mod.f90
r0a94e13 r4ad96c5 93 93 character(len=255), parameter :: institution = 'NILU' 94 94 95 integer :: tpointer =095 integer :: tpointer 96 96 character(len=255) :: ncfname, ncfnamen 97 97 -
src/outg_mod.f90
r2eefa58 r4c64400 37 37 real,allocatable, dimension (:,:,:) :: areanorth 38 38 real,allocatable, dimension (:,:,:) :: densityoutgrid 39 real,allocatable, dimension (:,:,:) :: densitydrygrid ! added RLT40 real,allocatable, dimension (:,:,:) :: factor_drygrid ! added RLT41 39 real,allocatable, dimension (:,:,:) :: factor3d 42 40 real,allocatable, dimension (:,:,:) :: grid -
src/outgrid_init.f90
r2eefa58 rd2a5a83 268 268 if (stat.ne.0) write(*,*)'ERROR: could not allocate gridunc' 269 269 allocate(densityoutgrid(0:max(numxgrid,numxgridn)-1, & 270 0:max(numygrid,numygridn)-1,numzgrid),stat=stat)271 if (stat.ne.0) write(*,*)'ERROR: could not allocate gridunc'272 ! RLT273 allocate(densitydrygrid(0:max(numxgrid,numxgridn)-1, &274 0:max(numygrid,numygridn)-1,numzgrid),stat=stat)275 if (stat.ne.0) write(*,*)'ERROR: could not allocate gridunc'276 allocate(factor_drygrid(0:max(numxgrid,numxgridn)-1, &277 270 0:max(numygrid,numygridn)-1,numzgrid),stat=stat) 278 271 if (stat.ne.0) write(*,*)'ERROR: could not allocate gridunc' -
src/par_mod.f90
r2eefa58 r79e0349 30 30 ! Update 15 August 2013 IP * 31 31 ! * 32 ! ESO 2016: * 33 ! GFS specific parameters moved to gfs_mod.f90 * 34 ! ECMWF specific parameters moved to ecmwf_mod.f90 * 32 35 ! * 33 36 !******************************************************************************* … … 77 80 real,parameter :: pi=3.14159265, r_earth=6.371e6, r_air=287.05, ga=9.81 78 81 real,parameter :: cpa=1004.6, kappa=0.286, pi180=pi/180., vonkarman=0.4 79 ! additional constants RLT Aug-201780 real,parameter :: rgas=8.3144781 real,parameter :: r_water=461.49582 82 83 83 ! pi number "pi" … … 89 89 ! kappa exponent of formula for potential temperature 90 90 ! vonkarman von Karman constant 91 ! rgas universal gas constant [J/mol/K]92 ! r_water specific gas constant for water vapor [J/kg/K]93 91 94 92 real,parameter :: karman=0.40, href=15., convke=2.0 … … 282 280 283 281 integer,parameter :: unitpath=1, unitcommand=1, unitageclasses=1, unitgrid=1 284 integer,parameter :: unitavailab=1, unitreleases=88, unitpartout=93 , unitpartout_average=105282 integer,parameter :: unitavailab=1, unitreleases=88, unitpartout=93 285 283 integer,parameter :: unitpartin=93, unitflux=98, unitouttraj=96 286 284 integer,parameter :: unitvert=1, unitoro=1, unitpoin=1, unitreceptor=1 … … 292 290 integer,parameter :: unitboundcond=89 293 291 integer,parameter :: unittmp=101 294 ! RLT295 integer,parameter :: unitoutfactor=102296 292 297 293 !****************************************************** -
src/partoutput.f90
r0a94e13 rd2a5a83 71 71 !************************************** 72 72 73 if (ipout.eq.1 .or.ipout.eq.3) then73 if (ipout.eq.1) then 74 74 open(unitpartout,file=path(2)(1:length(2))//'partposit_'//adate// & 75 75 atime,form='unformatted') -
src/partoutput_mpi.f90
r0a94e13 rd2a5a83 78 78 !************************************** 79 79 80 if (ipout.eq.1 .or.ipout.eq.3) then80 if (ipout.eq.1) 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
r2eefa58 r20963b1 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) *53 52 ! itsplit [s] time constant for particle splitting * 54 53 ! loutaver [s] concentration output is an average over loutaver * … … 98 97 iout, & 99 98 ipout, & 100 ipoutfac, &101 99 lsubgrid, & 102 100 lconvection, & … … 114 112 surf_only, & 115 113 cblflag, & 116 linversionout, &117 114 ohfields_path 118 115 … … 132 129 iout=3 133 130 ipout=0 134 ipoutfac=1135 131 lsubgrid=1 136 132 lconvection=1 … … 148 144 surf_only=0 149 145 cblflag=0 ! if using old-style COMMAND file, set to 1 here to use mc cbl routine 150 linversionout=0151 146 ohfields_path="../../flexin/" 152 147 … … 416 411 !********************************************************************** 417 412 418 if ((iout.lt.1).or.(iout.gt. 5)) then413 if ((iout.lt.1).or.(iout.gt.6)) then 419 414 write(*,*) ' #### FLEXPART MODEL ERROR! FILE COMMAND: #### ' 420 415 write(*,*) ' #### IOUT MUST BE 1, 2, 3, 4 OR 5 FOR #### ' … … 476 471 write(*,*) '#### FOR DOMAIN FILLING RUNS OUTPUT FOR ####' 477 472 write(*,*) '#### EACH RELEASE IS FORBIDDEN ! ####' 478 stop479 endif480 481 ! Inversion output format only for backward runs482 !*****************************************************************************483 484 if ((linversionout.eq.1).and.(ldirect.eq.1)) then485 write(*,*) '#### FLEXPART MODEL ERROR! FILE COMMAND: ####'486 write(*,*) '#### INVERSION OUTPUT FORMAT ONLY FOR ####'487 write(*,*) '#### BACKWARD RUNS ####'488 473 stop 489 474 endif … … 522 507 !**************************************************************** 523 508 524 if ((ipout.ne.0).and.(ipout.ne.1).and.(ipout.ne.2) .and.(ipout.ne.3)) then509 if ((ipout.ne.0).and.(ipout.ne.1).and.(ipout.ne.2)) then 525 510 write(*,*) ' #### FLEXPART MODEL ERROR! FILE COMMAND: #### ' 526 write(*,*) ' #### IPOUT MUST BE 0, 1, 2 OR 3!#### '511 write(*,*) ' #### IPOUT MUST BE 1, 2 OR 3! #### ' 527 512 stop 528 513 endif -
src/readpaths.f90
r2eefa58 r62e65c7 20 20 !********************************************************************** 21 21 22 subroutine readpaths 22 subroutine readpaths !(pathfile) 23 23 24 24 !***************************************************************************** -
src/readwind_gfs.f90
r5d74ed9 rdb91eb7 83 83 84 84 ! NCEP 85 integer :: numpt,numpu,numpv,numpw,numprh ,numpclwch85 integer :: numpt,numpu,numpv,numpw,numprh 86 86 real :: help, temp, ew 87 87 real :: elev … … 134 134 numpw=0 135 135 numprh=0 136 numpclwch=0137 136 ifield=0 138 137 10 ifield=ifield+1 … … 558 557 endif 559 558 ! SEC & IP 12/2018 read GFS clouds 560 if((isec1(6).eq.153).and.(isec1(7).eq.100)) then !! CLWCR Cloud liquid water content [kg/kg] 561 if((i.eq.0).and.(j.eq.0)) then 562 do ii=1,nuvz 563 if ((isec1(8)*100.0).eq.akz(ii)) numpclwch=ii 564 end do 565 endif 566 help=zsec4(nxfield*(ny-j-1)+i+1) 567 if(i.le.i180) then 568 clwch(i179+i,j,numpclwch,n)=help 569 else 570 clwch(i-i181,j,numpclwch,n)=help 571 endif 559 if(isec1(6).eq.153) then !! CLWCR Cloud liquid water content [kg/kg] 560 clwch(i,j,nlev_ec-k+2,n)=zsec4(nxfield*(ny-j-1)+i+1) 572 561 readclouds=.true. 573 562 sumclouds=.true. 574 ! readclouds=.false.575 ! sumclouds=.false.576 563 endif 577 564 -
src/releaseparticles.f90
r7873bf7 r75a4ded 114 114 average_timecorrect=0. 115 115 do k=1,nspec 116 if(abs(xpoint2(i)-xpoint1(i)).lt.1.E-4.and.abs(ypoint2(i)-ypoint1(i)).lt.1.E-4) then 117 ! if (zpoint1(i).gt.0.5) then ! point source 116 if (zpoint1(i).gt.0.5) then ! point source 118 117 timecorrect(k)=point_hour(k,nhour)*point_dow(k,ndayofweek) 119 118 else ! area source -
src/timemanager.f90
r2eefa58 rc7d1052 408 408 #endif 409 409 else 410 if (linversionout.eq.1) then411 call concoutput_inversion(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc)412 if (verbosity.eq.1) then413 print*,'called concoutput_inversion'414 call system_clock(count_clock)415 write(*,*) 'system clock',count_clock - count_clock0416 endif417 else418 410 call concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc) 419 endif420 411 if (verbosity.eq.1) then 421 412 print*,'called concoutput_surf ' … … 431 422 call concoutput_nest(itime,outnum) 432 423 else 433 if(linversionout.eq.1) then434 call concoutput_inversion_nest(itime,outnum)435 else436 424 call concoutput_surf_nest(itime,outnum) 437 endif438 425 endif 439 426 else … … 464 451 45 format(i13,' Seconds simulated: ',i13, ' Particles: Uncertainty: ',3f7.3) 465 452 46 format(' Simulated ',f7.1,' hours (',i13,' s), ',i13, ' particles') 466 if (ipout.ge.1) then 467 if (mod(itime,ipoutfac*loutstep).eq.0) call partoutput(itime) ! dump particle positions 468 if (ipout.eq.3) call partoutput_average(itime) ! dump particle positions 469 endif 453 if (ipout.ge.1) call partoutput(itime) ! dump particle positions 470 454 loutnext=loutnext+loutstep 471 455 loutstart=loutnext-loutaver/2 … … 625 609 ! write (*,*) 'advance: ',prob(1),xmass1(j,1),ztra1(j) 626 610 627 ! Calculate average position for particle dump output628 !****************************************************629 630 if (ipout.eq.3) call partpos_average(itime,j)631 632 633 611 ! Calculate the gross fluxes across layer interfaces 634 612 !*************************************************** … … 752 730 if (ipout.eq.2) call partoutput(itime) ! dump particle positions 753 731 754 if (linit_cond.ge.1) then 755 if(linversionout.eq.1) then 756 call initial_cond_output_inversion(itime) ! dump initial cond. field 757 else 758 call initial_cond_output(itime) ! dump initial cond. fielf 759 endif 760 endif 732 if (linit_cond.ge.1) call initial_cond_output(itime) ! dump initial cond. field 761 733 762 734 !close(104) -
src/timemanager_mpi.f90
r0c8c7f2 r20963b1 113 113 integer :: j,ks,kp,l,n,itime=0,nstop,nstop1,memstat=0 114 114 ! integer :: ksp 115 integer :: ip ,irec115 integer :: ip 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 132 131 133 132 ! First output for time 0 … … 533 532 end if 534 533 535 else 534 else ! :TODO: check for zeroing in the netcdf module 536 535 call concoutput_surf_nest(itime,outnum) 537 536 end if … … 594 593 46 format(' Simulated ',f7.1,' hours (',i13,' s), ',i13, ' particles') 595 594 if (ipout.ge.1) then 596 if (mp_measure_time) call mpif_mtime('iotime',0)597 irec=0598 595 do ip=0, mp_partgroup_np-1 599 if (ip.eq.mp_partid) then 600 if (mod(itime,ipoutfac*loutstep).eq.0) call partoutput(itime) ! dump particle positions 601 if (ipout.eq.3) call partoutput_average(itime,irec) ! dump particle positions 602 endif 603 if (ipout.eq.3) irec=irec+npart_per_process(ip) 596 if (ip.eq.mp_partid) call partoutput(itime) ! dump particle positions 604 597 call mpif_mpi_barrier 605 598 end do 606 if (mp_measure_time) call mpif_mtime('iotime',1)607 599 end if 608 600 … … 765 757 if (mp_measure_time) call mpif_mtime('advance',1) 766 758 767 ! Calculate average position for particle dump output768 !****************************************************769 770 if (ipout.eq.3) call partpos_average(itime,j)771 772 759 773 760 ! Calculate the gross fluxes across layer interfaces … … 908 895 do ip=0, mp_partgroup_np-1 909 896 if (ip.eq.mp_partid) then 910 if (mp_dbg_mode) write(*,*) 'call partoutput(itime), proc, mp_partid',ip,mp_partid897 !if (mp_dbg_mode) write(*,*) 'call partoutput(itime), proc, mp_partid',ip,mp_partid 911 898 call partoutput(itime) ! dump particle positions 912 899 end if -
src/verttransform_ecmwf.f90
r2eefa58 r79e0349 73 73 use com_mod 74 74 use cmapf_mod, only: cc2gll 75 ! use mpi_mod 75 76 76 77 implicit none … … 81 82 real,dimension(0:nxmax-1,0:nymax-1,nuvzmax) :: rhoh,uvzlev,wzlev 82 83 real,dimension(0:nxmax-1,0:nymax-1,nzmax) :: pinmconv 83 ! RLT added pressure84 real,dimension(0:nxmax-1,0:nymax-1,nuvzmax) :: prsh85 84 real,dimension(0:nxmax-1,0:nymax-1) :: tvold,pold,pint,tv 86 85 real,dimension(0:nymax-1) :: cosf … … 220 219 !************************* 221 220 221 222 222 do jy=0,nymin1 223 223 do ix=0,nxmin1 … … 230 230 wzlev(:,:,1)=0. 231 231 rhoh(:,:,1)=pold/(r_air*tvold) 232 ! RLT add pressure233 prsh(:,:,1)=ps(:,:,1,n)234 232 235 233 … … 239 237 do kz=2,nuvz 240 238 pint=akz(kz)+bkz(kz)*ps(:,:,1,n) 241 ! RLT add pressure242 prsh(:,:,kz)=pint243 239 tv=tth(:,:,kz,n)*(1.+0.608*qvh(:,:,kz,n)) 244 240 rhoh(:,:,kz)=pint(:,:)/(r_air*tv) … … 292 288 pv(:,:,1,n)=pvh(:,:,1) 293 289 rho(:,:,1,n)=rhoh(:,:,1) 294 ! RLT add pressure295 prs(:,:,1,n)=prsh(:,:,1)296 290 297 291 uu(:,:,nz,n)=uuh(:,:,nuvz) … … 307 301 pv(:,:,nz,n)=pvh(:,:,nuvz) 308 302 rho(:,:,nz,n)=rhoh(:,:,nuvz) 309 ! RLT 310 prs(:,:,nz,n)=prsh(:,:,nuvz) 303 311 304 312 305 kmin=2 … … 328 321 pv(ix,jy,iz,n)=pv(ix,jy,nz,n) 329 322 rho(ix,jy,iz,n)=rho(ix,jy,nz,n) 330 ! RLT331 prs(ix,jy,iz,n)=prs(ix,jy,nz,n)332 323 else 333 324 innuvz: do kz=idx(ix,jy),nuvz … … 363 354 pv(ix,jy,iz,n)=(pvh(ix,jy,kz-1)*dz2+pvh(ix,jy,kz)*dz1)/dz 364 355 rho(ix,jy,iz,n)=(rhoh(ix,jy,kz-1)*dz2+rhoh(ix,jy,kz)*dz1)/dz 365 ! RLT add pressure366 prs(ix,jy,iz,n)=(prsh(ix,jy,kz-1)*dz2+prsh(ix,jy,kz)*dz1)/dz367 356 endif 368 357 enddo … … 665 654 if ((lsp.gt.0.01).or.(convp.gt.0.01)) then ! cloud and precipitation 666 655 667 do kz=nz, 2,-1 !go Bottom up!656 do kz=nz,1,-1 !go Bottom up! 668 657 if (clw(ix,jy,kz,n).gt. 0) then ! is in cloud 669 658 cloudsh(ix,jy,n)=cloudsh(ix,jy,n)+height(kz)-height(kz-1) -
src/verttransform_gfs.f90
r437c545 rdb91eb7 548 548 if ((lsp.gt.0.01).or.(convp.gt.0.01)) then ! cloud and precipitation 549 549 550 do kz=nz, 2,-1 !go Bottom up!550 do kz=nz,1,-1 !go Bottom up! 551 551 if (clw(ix,jy,kz,n).gt. 0) then ! is in cloud 552 552 cloudsh(ix,jy,n)=cloudsh(ix,jy,n)+height(kz)-height(kz-1) 553 553 clouds(ix,jy,kz,n)=1 ! is a cloud 554 554 if (lsp.ge.convp) then 555 clouds(ix,jy,kz,n)=3 555 clouds(ix,jy,kz,n)=3 ! lsp in-cloud 556 556 else 557 557 clouds(ix,jy,kz,n)=2 ! convp in-cloud
Note: See TracChangeset
for help on using the changeset viewer.