Changes in / [f203036:941db73] in flexpart.git


Ignore:
Files:
6 deleted
28 edited

Legend:

Unmodified
Added
Removed
  • options/COMMAND

    r0a94e13 r6d73c4b  
    1919 IFINE=                 4, ! Reduction for time step in vertical transport, used only if CTL>1
    2020 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 averaged
     21 IPOUT=                 0, ! Particle position output: 0]no 1]every output 2]only at end  
    2222 LSUBGRID=              0, ! Increase of ABL heights due to sub-grid scale orographic variations;[0]off 1]on
    2323 LCONVECTION=           1, ! Switch for convection parameterization;0]off [1]on   
  • src/FLEXPART.f90

    r2eefa58 r50958b8  
    6868  integer :: detectformat
    6969
     70
     71
     72  ! Initialize arrays in com_mod
     73  !*****************************
     74  call com_mod_allocate_part(maxpart)
    7075 
     76
    7177  ! Generate a large number of random numbers
    7278  !******************************************
     
    137143    write(*,*) 'call readpaths'
    138144  endif
    139   call readpaths
     145  call readpaths(pathfile)
    140146 
    141147  if (verbosity.gt.1) then !show clock info
     
    165171    endif     
    166172  endif
    167 
    168   ! Initialize arrays in com_mod
    169   !*****************************
    170   call com_mod_allocate_part(maxpart)
    171 
    172173
    173174  ! Read the age classes to be used
     
    452453  endif
    453454
    454   if (verbosity.gt.0) write (*,*) 'timemanager> call wetdepo'
    455455  call timemanager(metdata_format)
    456  
    457456
    458457  if (verbosity.gt.0) then
     
    469468      endif
    470469    end do
     470    write (*,*) 'timemanager> call wetdepo'
    471471  endif
    472472 
  • src/FLEXPART_MPI.f90

    r2eefa58 r20963b1  
    7777  if (mp_measure_time) call mpif_mtime('flexpart',0)
    7878
    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
    8085  ! Generate a large number of random numbers
    8186  !******************************************
     
    146151    write(*,*) 'call readpaths'
    147152  endif
    148   call readpaths
     153  call readpaths(pathfile)
    149154 
    150155  if (verbosity.gt.1) then !show clock info
     
    174179    endif
    175180  endif
    176 
    177   ! Initialize arrays in com_mod
    178   !*****************************
    179 
    180   if(.not.(lmpreader.and.lmp_use_reader)) call com_mod_allocate_part(maxpart_mpi)
    181181
    182182
     
    413413  end if ! (mpif_pid == 0)
    414414
    415   if (mp_measure_time) call mpif_mtime('iotime',1)
     415  if (mp_measure_time) call mpif_mtime('iotime',0)
    416416
    417417  if (verbosity.gt.0 .and. lroot) then
  • src/com_mod.f90

    r2eefa58 re9e0f06  
    1818
    1919  implicit none
    20 
    21 
    2220
    2321  !****************************************************************
     
    7169
    7270  real :: ctl,fine
    73   integer :: ifine,iout,ipout,ipin,iflux,mdomainfill,ipoutfac
     71  integer :: ifine,iout,ipout,ipin,iflux,mdomainfill
    7472  integer :: mquasilag,nested_output,ind_source,ind_receptor
    7573  integer :: ind_rel,ind_samp,ioutputforeachrelease,linit_cond,surf_only
     
    8482  ! iout     output options: 1 conc. output (ng/m3), 2 mixing ratio (pptv), 3 both
    8583  ! ipout    particle dump options: 0 no, 1 every output interval, 2 only at end
    86   ! ipoutfac increase particle dump interval by factor (default 1)
    8784  ! ipin     read in particle positions from dumped file from a previous run
    8885  ! fine     real(ifine)
     
    124121  ! lnetcdfout   1 for netcdf grid output, 0 if not. Set in COMMAND (namelist input)
    125122
    126   integer :: linversionout
    127   ! linversionout 1 for one grid_time output file for each release containing all timesteps
    128 
    129123  integer :: nageclass,lage(maxageclass)
    130124
     
    134128
    135129  logical :: gdomainfill
     130
    136131  ! gdomainfill             .T., if domain-filling is global, .F. if not
    137132
     
    179174  real :: ri(5,numclass),rac(5,numclass),rcl(maxspec,5,numclass)
    180175  real :: rgs(maxspec,5,numclass),rlu(maxspec,5,numclass)
    181   real :: rm(maxspec),dryvel(maxspec),kao(maxspec)
     176  real :: rm(maxspec),dryvel(maxspec)
    182177  real :: ohcconst(maxspec),ohdconst(maxspec),ohnconst(maxspec)
    183178
     
    364359  real :: ciwc(0:nxmax-1,0:nymax-1,nzmax,numwfmem)=0.0 !ice      [kg/kg]
    365360  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
    369362  real :: pv(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
    370363  real :: rho(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
     
    388381  ! uupol,vvpol [m/s]    wind components in polar stereographic projection
    389382  ! tt [K]               temperature data
    390   ! prs                  air pressure
    391383  ! qv                   specific humidity data
    392384  ! pv (pvu)             potential vorticity
     
    659651  real :: receptorarea(maxreceptor)
    660652  real :: creceptor(maxreceptor,maxspec)
    661   real, allocatable, dimension(:,:) :: creceptor0
    662653  character(len=16) :: receptorname(maxreceptor)
    663654  integer :: numreceptor
     
    682673  real, allocatable, dimension(:,:) :: xmass1
    683674  real, allocatable, dimension(:,:) :: xscav_frac1
    684 
    685 ! Variables used for writing out interval averages for partoutput
    686 !****************************************************************
    687 
    688   integer, allocatable, dimension(:) :: npart_av
    689   real, allocatable, dimension(:) :: part_av_cartx,part_av_carty,part_av_cartz,part_av_z,part_av_topo
    690   real, allocatable, dimension(:) :: part_av_pv,part_av_qv,part_av_tt,part_av_rho,part_av_tro,part_av_hmix
    691   real, allocatable, dimension(:) :: part_av_uu,part_av_vv,part_av_energy
    692675
    693676  ! eso: Moved from timemanager
     
    797780         & idt(nmpart),itramem(nmpart),itrasplit(nmpart),&
    798781         & 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
    809784
    810785
    811786    allocate(uap(nmpart),ucp(nmpart),uzp(nmpart),us(nmpart),&
    812787         & vs(nmpart),ws(nmpart),cbt(nmpart))
    813 
     788   
    814789  end subroutine com_mod_allocate_part
    815790
  • src/concoutput.f90

    r2eefa58 r20963b1  
    7272  real :: sp_fact
    7373  real :: outnum,densityoutrecept(maxreceptor),xl,yl
    74 ! RLT
    75   real :: densitydryrecept(maxreceptor)
    76   real :: factor_dryrecept(maxreceptor)
    7774
    7875!real densityoutgrid(0:numxgrid-1,0:numygrid-1,numzgrid),
     
    109106  character(LEN=8),save :: file_stat='REPLACE'
    110107  logical :: ldates_file
    111   logical :: lexist
    112108  integer :: ierr
    113109  character(LEN=100) :: dates_char
     
    207203        densityoutgrid(ix,jy,kz)=(rho(iix,jjy,kzz,mind)*dz1+ &
    208204             rho(iix,jjy,kzz-1,mind)*dz2)/dz
    209 ! RLT
    210         densitydrygrid(ix,jy,kz)=(rho_dry(iix,jjy,kzz,mind)*dz1+ &
    211              rho_dry(iix,jjy,kzz-1,mind)*dz2)/dz 
    212205      end do
    213206    end do
     
    221214!densityoutrecept(i)=rho(iix,jjy,1,2)
    222215    densityoutrecept(i)=rho(iix,jjy,1,mind)
    223 ! RLT
    224     densitydryrecept(i)=rho_dry(iix,jjy,1,mind)
    225216  end do
    226217
    227 ! RLT
    228 ! conversion factor for output relative to dry air
    229   factor_drygrid=densityoutgrid/densitydrygrid
    230   factor_dryrecept=densityoutrecept/densitydryrecept
    231218
    232219! Output is different for forward and backward simulations
     
    366353! Concentration output
    367354!*********************
    368         if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5)) then
     355        if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5).or.(iout.eq.6)) then
    369356
    370357! Wet deposition
     
    627614  end do
    628615
    629 ! RLT Aug 2017
    630 ! Write out conversion factor for dry air
    631   inquire(file=path(2)(1:length(2))//'factor_drygrid',exist=lexist)
    632   if (lexist) then
    633     ! open and append
    634     open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid',form='unformatted',&
    635             status='old',action='write',access='append')
    636   else
    637     ! create new
    638     open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid',form='unformatted',&
    639             status='new',action='write')
    640   endif
    641   sp_count_i=0
    642   sp_count_r=0
    643   sp_fact=-1.
    644   sp_zer=.true.
    645   do kz=1,numzgrid
    646     do jy=0,numygrid-1
    647       do ix=0,numxgrid-1
    648         if (factor_drygrid(ix,jy,kz).gt.(1.+smallnum).or.factor_drygrid(ix,jy,kz).lt.(1.-smallnum)) then
    649           if (sp_zer.eqv..true.) then ! first value not equal to one
    650             sp_count_i=sp_count_i+1
    651             sparse_dump_i(sp_count_i)= &
    652                   ix+jy*numxgrid+kz*numxgrid*numygrid
    653             sp_zer=.false.
    654             sp_fact=sp_fact*(-1.)
    655           endif
    656           sp_count_r=sp_count_r+1
    657           sparse_dump_r(sp_count_r)= &
    658                sp_fact*factor_drygrid(ix,jy,kz)
    659         else ! factor is one
    660           sp_zer=.true.
    661         endif
    662       end do
    663     end do
    664   end do
    665   write(unitoutfactor) sp_count_i
    666   write(unitoutfactor) (sparse_dump_i(i),i=1,sp_count_i)
    667   write(unitoutfactor) sp_count_r
    668   write(unitoutfactor) (sparse_dump_r(i),i=1,sp_count_r)
    669   close(unitoutfactor)
    670 
    671 
    672616  if (gridtotal.gt.0.) gridtotalunc=gridsigmatotal/gridtotal
    673617  if (wetgridtotal.gt.0.) wetgridtotalunc=wetgridsigmatotal/ &
     
    696640  endif
    697641
    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
    715643
    716644! Reinitialization of grid
  • src/concoutput_mpi.f90

    r6741557 r20963b1  
    364364! Concentration output
    365365!*********************
    366         if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5)) then
     366        if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5).or.(iout.eq.6)) then
    367367
    368368! Wet deposition
  • src/concoutput_nest.f90

    r2eefa58 r7d02c2f  
    7070  real :: sp_fact
    7171  real :: outnum,densityoutrecept(maxreceptor),xl,yl
    72 ! RLT
    73   real :: densitydryrecept(maxreceptor)
    74   real :: factor_dryrecept(maxreceptor)
    7572
    7673  !real densityoutgrid(0:numxgrid-1,0:numygrid-1,numzgrid),
     
    9996  character :: adate*8,atime*6
    10097  character(len=3) :: anspec
    101   logical :: lexist
    10298  integer :: mind
    10399! mind        eso:added to ensure identical results between 2&3-fields versions
     
    168164        densityoutgrid(ix,jy,kz)=(rho(iix,jjy,kzz,mind)*dz1+ &
    169165             rho(iix,jjy,kzz-1,mind)*dz2)/dz
    170 ! RLT
    171         densitydrygrid(ix,jy,kz)=(rho_dry(iix,jjy,kzz,mind)*dz1+ &
    172              rho_dry(iix,jjy,kzz-1,mind)*dz2)/dz
    173166      end do
    174167    end do
     
    182175    !densityoutrecept(i)=rho(iix,jjy,1,2)
    183176    densityoutrecept(i)=rho(iix,jjy,1,mind)
    184 ! RLT
    185     densitydryrecept(i)=rho_dry(iix,jjy,1,mind)
    186177  end do
    187178
    188 ! RLT
    189 ! conversion factor for output relative to dry air
    190   factor_drygrid=densityoutgrid/densitydrygrid
    191   factor_dryrecept=densityoutrecept/densitydryrecept
    192179
    193180  ! Output is different for forward and backward simulations
     
    564551  end do
    565552
    566 ! RLT Aug 2017
    567 ! Write out conversion factor for dry air
    568   inquire(file=path(2)(1:length(2))//'factor_drygrid_nest',exist=lexist)
    569   if (lexist) then
    570     ! open and append
    571     open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid_nest',form='unformatted',&
    572             status='old',action='write',access='append')
    573   else
    574     ! create new
    575     open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid_nest',form='unformatted',&
    576             status='new',action='write')
    577   endif
    578   sp_count_i=0
    579   sp_count_r=0
    580   sp_fact=-1.
    581   sp_zer=.true.
    582   do kz=1,numzgrid
    583     do jy=0,numygridn-1
    584       do ix=0,numxgridn-1
    585         if (factor_drygrid(ix,jy,kz).gt.(1.+smallnum).or.factor_drygrid(ix,jy,kz).lt.(1.-smallnum)) then
    586           if (sp_zer.eqv..true.) then ! first value not equal to one
    587             sp_count_i=sp_count_i+1
    588             sparse_dump_i(sp_count_i)= &
    589                   ix+jy*numxgridn+kz*numxgridn*numygridn
    590             sp_zer=.false.
    591             sp_fact=sp_fact*(-1.)
    592           endif
    593           sp_count_r=sp_count_r+1
    594           sparse_dump_r(sp_count_r)= &
    595                sp_fact*factor_drygrid(ix,jy,kz)
    596         else ! factor is one
    597           sp_zer=.true.
    598         endif
    599       end do
    600     end do
    601   end do
    602   write(unitoutfactor) sp_count_i
    603   write(unitoutfactor) (sparse_dump_i(i),i=1,sp_count_i)
    604   write(unitoutfactor) sp_count_r
    605   write(unitoutfactor) (sparse_dump_r(i),i=1,sp_count_r)
    606   close(unitoutfactor)
    607553
    608554
  • src/concoutput_surf.f90

    r2eefa58 r16b61a5  
    7272  real :: sp_fact
    7373  real :: outnum,densityoutrecept(maxreceptor),xl,yl
    74 ! RLT
    75   real :: densitydryrecept(maxreceptor)
    76   real :: factor_dryrecept(maxreceptor)
    7774
    7875!real densityoutgrid(0:numxgrid-1,0:numygrid-1,numzgrid),
     
    104101  character :: adate*8,atime*6
    105102  character(len=3) :: anspec
    106   logical :: lexist
    107103
    108104
     
    184180        densityoutgrid(ix,jy,kz)=(rho(iix,jjy,kzz,2)*dz1+ &
    185181             rho(iix,jjy,kzz-1,2)*dz2)/dz
    186 ! RLT
    187         densitydrygrid(ix,jy,kz)=(rho_dry(iix,jjy,kzz,2)*dz1+ &
    188              rho_dry(iix,jjy,kzz-1,2)*dz2)/dz
    189182      end do
    190183    end do
     
    197190    jjy=max(min(nint(yl),nymin1),0)
    198191    densityoutrecept(i)=rho(iix,jjy,1,2)
    199 ! RLT
    200     densitydryrecept(i)=rho_dry(iix,jjy,1,2)
    201192  end do
    202193
    203 ! RLT
    204 ! conversion factor for output relative to dry air
    205   factor_drygrid=densityoutgrid/densitydrygrid
    206   factor_dryrecept=densityoutrecept/densitydryrecept
    207194
    208195! Output is different for forward and backward simulations
     
    609596  end do
    610597
    611 ! RLT Aug 2017
    612 ! Write out conversion factor for dry air
    613   inquire(file=path(2)(1:length(2))//'factor_drygrid',exist=lexist)
    614   if (lexist) then
    615     ! open and append
    616     open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid',form='unformatted',&
    617             status='old',action='write',access='append')
    618   else
    619     ! create new
    620     open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid',form='unformatted',&
    621             status='new',action='write')
    622   endif
    623   sp_count_i=0
    624   sp_count_r=0
    625   sp_fact=-1.
    626   sp_zer=.true.
    627   do kz=1,1
    628     do jy=0,numygrid-1
    629       do ix=0,numxgrid-1
    630         if (factor_drygrid(ix,jy,kz).gt.(1.+smallnum).or.factor_drygrid(ix,jy,kz).lt.(1.-smallnum)) then
    631           if (sp_zer.eqv..true.) then ! first value not equal to one
    632             sp_count_i=sp_count_i+1
    633             sparse_dump_i(sp_count_i)= &
    634                   ix+jy*numxgrid+kz*numxgrid*numygrid
    635             sp_zer=.false.
    636             sp_fact=sp_fact*(-1.)
    637           endif
    638           sp_count_r=sp_count_r+1
    639           sparse_dump_r(sp_count_r)= &
    640                sp_fact*factor_drygrid(ix,jy,kz)
    641         else ! factor is one
    642           sp_zer=.true.
    643         endif
    644       end do
    645     end do
    646   end do
    647   write(unitoutfactor) sp_count_i
    648   write(unitoutfactor) (sparse_dump_i(i),i=1,sp_count_i)
    649   write(unitoutfactor) sp_count_r
    650   write(unitoutfactor) (sparse_dump_r(i),i=1,sp_count_r)
    651   close(unitoutfactor)
    652 
    653 
    654598  if (gridtotal.gt.0.) gridtotalunc=gridsigmatotal/gridtotal
    655599  if (wetgridtotal.gt.0.) wetgridtotalunc=wetgridsigmatotal/ &
     
    678622  endif
    679623
    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
    697625
    698626! Reinitialization of grid
  • src/concoutput_surf_nest.f90

    r2eefa58 r6a678e3  
    7070  real :: sp_fact
    7171  real :: outnum,densityoutrecept(maxreceptor),xl,yl
    72 ! RLT
    73   real :: densitydryrecept(maxreceptor)
    74   real :: factor_dryrecept(maxreceptor)
    7572
    7673  !real densityoutgrid(0:numxgrid-1,0:numygrid-1,numzgrid),
     
    9996  character :: adate*8,atime*6
    10097  character(len=3) :: anspec
    101   logical :: lexist
     98
    10299
    103100  ! Determine current calendar date, needed for the file name
     
    162159        densityoutgrid(ix,jy,kz)=(rho(iix,jjy,kzz,2)*dz1+ &
    163160             rho(iix,jjy,kzz-1,2)*dz2)/dz
    164 ! RLT
    165         densitydrygrid(ix,jy,kz)=(rho_dry(iix,jjy,kzz,2)*dz1+ &
    166              rho_dry(iix,jjy,kzz-1,2)*dz2)/dz
    167161      end do
    168162    end do
     
    175169      jjy=max(min(nint(yl),nymin1),0)
    176170      densityoutrecept(i)=rho(iix,jjy,1,2)
    177 ! RLT
    178     densitydryrecept(i)=rho_dry(iix,jjy,1,2)
    179171    end do
    180172
    181 ! RLT
    182 ! conversion factor for output relative to dry air
    183   factor_drygrid=densityoutgrid/densitydrygrid
    184   factor_dryrecept=densityoutrecept/densitydryrecept
    185173
    186174  ! Output is different for forward and backward simulations
     
    329317         write(unitoutgrid) sp_count_r
    330318         write(unitoutgrid) (sparse_dump_r(i),i=1,sp_count_r)
    331 !         write(unitoutgrid) sp_count_r
    332 !         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)
    333321
    334322  ! Dry deposition
     
    366354         write(unitoutgrid) sp_count_r
    367355         write(unitoutgrid) (sparse_dump_r(i),i=1,sp_count_r)
    368 !         write(unitoutgrid) sp_count_r
    369 !         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)
    370358
    371359
     
    411399         write(unitoutgrid) sp_count_r
    412400         write(unitoutgrid) (sparse_dump_r(i),i=1,sp_count_r)
    413 !         write(unitoutgrid) sp_count_r
    414 !         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)
    415403         else
    416404
     
    452440         write(unitoutgrid) sp_count_r
    453441         write(unitoutgrid) (sparse_dump_r(i),i=1,sp_count_r)
    454 !         write(unitoutgrid) sp_count_r
    455 !         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)
    456444         endif ! surf_only
    457445
     
    499487         write(unitoutgridppt) sp_count_r
    500488         write(unitoutgridppt) (sparse_dump_r(i),i=1,sp_count_r)
    501 !         write(unitoutgridppt) sp_count_r
    502 !         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)
    503491
    504492
     
    538526         write(unitoutgridppt) sp_count_r
    539527         write(unitoutgridppt) (sparse_dump_r(i),i=1,sp_count_r)
    540 !         write(unitoutgridppt) sp_count_r
    541 !         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)
    542530
    543531
     
    582570         write(unitoutgridppt) sp_count_r
    583571         write(unitoutgridppt) (sparse_dump_r(i),i=1,sp_count_r)
    584 !         write(unitoutgridppt) sp_count_r
    585 !         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)
    586574         else
    587575
     
    623611         write(unitoutgridppt) sp_count_r
    624612         write(unitoutgridppt) (sparse_dump_r(i),i=1,sp_count_r)
    625 !         write(unitoutgridppt) sp_count_r
    626 !         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)
    627615         endif ! surf_only
    628616
     
    636624
    637625  end do
    638 
    639 ! RLT Aug 2017
    640 ! Write out conversion factor for dry air
    641   inquire(file=path(2)(1:length(2))//'factor_drygrid_nest',exist=lexist)
    642   if (lexist) then
    643     ! open and append
    644     open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid_nest',form='unformatted',&
    645             status='old',action='write',access='append')
    646   else
    647     ! create new
    648     open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid_nest',form='unformatted',&
    649             status='new',action='write')
    650   endif
    651   sp_count_i=0
    652   sp_count_r=0
    653   sp_fact=-1.
    654   sp_zer=.true.
    655   do kz=1,1
    656     do jy=0,numygridn-1
    657       do ix=0,numxgridn-1
    658         if (factor_drygrid(ix,jy,kz).gt.(1.+smallnum).or.factor_drygrid(ix,jy,kz).lt.(1.-smallnum)) then
    659           if (sp_zer.eqv..true.) then ! first value not equal to one
    660             sp_count_i=sp_count_i+1
    661             sparse_dump_i(sp_count_i)= &
    662                   ix+jy*numxgridn+kz*numxgridn*numygridn
    663             sp_zer=.false.
    664             sp_fact=sp_fact*(-1.)
    665           endif
    666           sp_count_r=sp_count_r+1
    667           sparse_dump_r(sp_count_r)= &
    668                sp_fact*factor_drygrid(ix,jy,kz)
    669         else ! factor is one
    670           sp_zer=.true.
    671         endif
    672       end do
    673     end do
    674   end do
    675   write(unitoutfactor) sp_count_i
    676   write(unitoutfactor) (sparse_dump_i(i),i=1,sp_count_i)
    677   write(unitoutfactor) sp_count_r
    678   write(unitoutfactor) (sparse_dump_r(i),i=1,sp_count_r)
    679   close(unitoutfactor)
    680626
    681627
  • src/getfields.f90

    r2eefa58 r6ecb30a  
    8787  real :: pvhn(0:nxmaxn-1,0:nymaxn-1,nuvzmax,maxnests)
    8888  real :: wwhn(0:nxmaxn-1,0:nymaxn-1,nwzmax,maxnests)
    89 ! RLT added partial pressure water vapor
    90   real :: pwater(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
    91   integer :: kz, ix
    92   character(len=100) :: rowfmt
    9389
    9490  integer :: indmin = 1
     
    15715340  indmin=indj
    158154
    159     if (WETBKDEP) then
    160       call writeprecip(itime,memind(1))
    161     endif
     155   if (WETBKDEP) then
     156        call writeprecip(itime,memind(1))
     157   endif
    162158
    163159  else
     
    20820460  indmin=indj
    209205
    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
    238211
    239212  lwindinterv=abs(memtime(2)-memtime(1))
  • src/init_domainfill.f90

    r0a94e13 rb5127f9  
    8686    endif
    8787  endif
    88 
    89 ! Exit here if resuming a run from particle dump
    90 !***********************************************
    91   if (gdomainfill.and.ipin.ne.0) return
    9288
    9389! Do not release particles twice (i.e., not at both in the leftmost and rightmost
     
    418414!***************************************************************************
    419415
    420   if ((ipin.eq.1).and.(.not.gdomainfill)) then
     416  if (ipin.eq.1) then
    421417    open(unitboundcond,file=path(2)(1:length(2))//'boundcond.bin', &
    422418         form='unformatted')
  • src/init_domainfill_mpi.f90

    r328fdf9 rb5127f9  
    110110  endif
    111111
    112 ! Exit here if resuming a run from particle dump
    113 !***********************************************
    114   if (gdomainfill.and.ipin.ne.0) return
    115 
    116112! Do not release particles twice (i.e., not at both in the leftmost and rightmost
    117113! grid cell) for a global domain
     
    217213        colmass(ix,jy)=(pp(1)-pp(nz))/ga*gridarea(jy)
    218214        colmasstotal=colmasstotal+colmass(ix,jy)
     215
    219216      end do
    220217    end do
     
    469466
    470467! eso TODO: only needed for root process
    471     if ((ipin.eq.1).and.(.not.gdomainfill)) then
     468    if (ipin.eq.1) then
    472469      open(unitboundcond,file=path(2)(1:length(2))//'boundcond.bin', &
    473470           form='unformatted')
     
    477474    endif
    478475
    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))
    491484   
    492   end if ! end if(lroot)
    493 
     485  end if ! end if(lroot) 
    494486
    495487
    496488! 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)
    501493
    502494! Deallocate the temporary arrays used for all particles
    503     deallocate(itra1_tmp,npoint_tmp,nclass_tmp,idt_tmp,itramem_tmp,&
     495  deallocate(itra1_tmp,npoint_tmp,nclass_tmp,idt_tmp,itramem_tmp,&
    504496         & itrasplit_tmp,xtra1_tmp,ytra1_tmp,ztra1_tmp,xmass1_tmp)
    505   end if
    506497
    507498
  • src/makefile

    r2eefa58 r7123c70  
    118118OBJECTS_SERIAL = \
    119119        releaseparticles.o      partoutput.o \
    120         partoutput_average.o \
    121120        conccalc.o \
    122121        init_domainfill.o       concoutput.o  \
     
    128127        redist.o                \
    129128        concoutput_surf.o       concoutput_surf_nest.o  \
    130         concoutput_inversion_nest.o     \
    131         concoutput_inversion.o \
    132129        getfields.o \
    133130        readwind_ecmwf.o
     
    135132## For MPI version
    136133OBJECTS_MPI = releaseparticles_mpi.o partoutput_mpi.o \
    137         partoutput_average_mpi.o conccalc_mpi.o \
     134        conccalc_mpi.o \
    138135        init_domainfill_mpi.o concoutput_mpi.o  \
    139136        timemanager_mpi.o FLEXPART_MPI.o        \
     
    152149advance.o               initialize.o            \
    153150writeheader.o           writeheader_txt.o       \
    154 partpos_average.o       writeprecip.o \
     151writeprecip.o \
    155152writeheader_surf.o      assignland.o\
    156153part0.o                 gethourlyOH.o\
     
    202199drydepokernel_nest.o    zenithangle.o \
    203200ohreaction.o            getvdep_nests.o \
    204 initial_cond_calc.o     initial_cond_output.o initial_cond_output_inversion.o \
     201initial_cond_calc.o     initial_cond_output.o \
    205202dynamic_viscosity.o     get_settling.o  \
    206203initialize_cbl_vel.o    re_initialize_particle.o \
     
    274271conccalc_mpi.o: com_mod.o mpi_mod.o outg_mod.o par_mod.o unc_mod.o
    275272concoutput.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.o
    277273concoutput_mpi.o: com_mod.o mpi_mod.o outg_mod.o par_mod.o point_mod.o \
    278274        unc_mod.o mean_mod.o
    279275concoutput_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.o
    281276concoutput_nest_mpi.o: com_mod.o mpi_mod.o outg_mod.o par_mod.o point_mod.o \
    282277        unc_mod.o mean_mod.o
     
    325320initial_cond_calc.o: com_mod.o outg_mod.o par_mod.o unc_mod.o
    326321initial_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.o
    328322initialize.o: com_mod.o hanna_mod.o interpol_mod.o par_mod.o random_mod.o
    329323initialize_cbl_vel.o: com_mod.o par_mod.o random_mod.o
     
    354348part0.o: par_mod.o
    355349partdep.o: par_mod.o
    356 partpos_average.o: com_mod.o par_mod.o
    357350partoutput.o: com_mod.o par_mod.o
    358 partoutput_average.o: com_mod.o par_mod.o
    359 partoutput_average_mpi.o: com_mod.o par_mod.o mpi_mod.o
    360351partoutput_mpi.o: com_mod.o mpi_mod.o par_mod.o
    361352partoutput_short.o: com_mod.o par_mod.o
  • src/mpi_mod.f90

    r0c8c7f2 r0ecc1fe  
    8888! Variables for MPI processes in the 'particle' group
    8989  integer, allocatable, dimension(:) :: mp_partgroup_rank
    90   integer, allocatable, dimension(:) :: npart_per_process
    9190  integer :: mp_partgroup_comm, mp_partgroup_pid, mp_partgroup_np
    9291
     
    126125! mp_time_barrier   Measure MPI barrier time
    127126! 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)
    129128  logical, parameter :: mp_dbg_mode = .false.
    130129  logical, parameter :: mp_dev_mode = .false.
     
    191190!   mp_np       number of running processes, decided at run-time
    192191!***********************************************************************
    193     use par_mod, only: maxpart, numwfmem, dep_prec, maxreceptor, maxspec
    194     use com_mod, only: mpi_mode, verbosity, creceptor0
     192    use par_mod, only: maxpart, numwfmem, dep_prec
     193    use com_mod, only: mpi_mode, verbosity
    195194
    196195    implicit none
     
    338337
    339338! Set maxpart per process
    340 ! ESO 08/2016: Increase maxpart per process, in case of unbalanced distribution
     339! eso 08/2016: Increase maxpart per process, in case of unbalanced distribution
    341340    maxpart_mpi=int(mp_maxpart_factor*real(maxpart)/real(mp_partgroup_np))
    342341    if (mp_np == 1) maxpart_mpi = maxpart
     
    366365    end if
    367366
    368 ! Allocate array for number of particles per process   
    369     allocate(npart_per_process(0:mp_partgroup_np-1))
    370 
    371 ! Write whether MPI_IN_PLACE is used or not
    372 #ifdef USE_MPIINPLACE
    373     if (lroot) write(*,*) 'Using MPI_IN_PLACE operations'
    374 #else
    375     if (lroot) allocate(creceptor0(maxreceptor,maxspec))
    376     if (lroot) write(*,*) 'Not using MPI_IN_PLACE operations'
    377 #endif
    378367    goto 101
    379368
     
    570559! invalid particles at the end of the arrays
    571560
    572 601 do i=numpart, 1, -1
     561601 do i=num_part, 1, -1
    573562      if (itra1(i).eq.-999999999) then
    574563        numpart=numpart-1
     
    609598    integer :: i,jj,nn, num_part=1,m,imin, num_trans
    610599    logical :: first_iter
    611     integer,allocatable,dimension(:) :: idx_arr
     600    integer,allocatable,dimension(:) :: numparticles_mpi, idx_arr
    612601    real,allocatable,dimension(:) :: sorted ! TODO: we don't really need this
    613602
     
    618607! All processes exchange information on number of particles
    619608!****************************************************************************
    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, &
    623613         & 1, MPI_INTEGER, mp_comm_used, mp_ierr)
    624614
     
    626616! Sort from lowest to highest
    627617! Initial guess: correct order
    628     sorted(:) = npart_per_process(:)
     618    sorted(:) = numparticles_mpi(:)
    629619    do i=0, mp_partgroup_np-1
    630620      idx_arr(i) = i
    631621    end do
    632 
    633 ! Do not rebalance particles for ipout=3   
    634     if (ipout.eq.3) return
    635622
    636623! For each successive element in index array, see if a lower value exists
     
    658645    m=mp_partgroup_np-1 ! index for last sorted process (most particles)
    659646    do i=0,mp_partgroup_np/2-1
    660       num_trans = npart_per_process(idx_arr(m)) - npart_per_process(idx_arr(i))
     647      num_trans = numparticles_mpi(idx_arr(m)) - numparticles_mpi(idx_arr(i))
    661648      if (mp_partid.eq.idx_arr(m).or.mp_partid.eq.idx_arr(i)) then
    662         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
     649        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
    664651! DBG
    665           ! 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
     652          ! 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
    667654! DBG
    668655          call mpif_redist_part(itime, idx_arr(m), idx_arr(i), num_trans/2)
     
    672659    end do
    673660
    674     deallocate(idx_arr, sorted)
     661    deallocate(numparticles_mpi, idx_arr, sorted)
    675662
    676663  end subroutine mpif_calculate_part_redist
     
    19741961    if (readclouds) then
    19751962      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,&
    19771964           &MPI_COMM_WORLD,reqs(j),mp_ierr)
    19781965      if (mp_ierr /= 0) goto 600
     
    23392326      if (readclouds) then
    23402327        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,&
    23422329             &MPI_COMM_WORLD,reqs(j),mp_ierr)
    23432330        if (mp_ierr /= 0) goto 600
     
    24752462    end if
    24762463
    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   
    24782485    if (lroot) then
    24792486      call MPI_Reduce(MPI_IN_PLACE,creceptor,rcpt_size,mp_sp,MPI_SUM,id_root, &
     
    24842491           & mp_comm_used,mp_ierr)
    24852492    end if
    2486 
    2487 #else
    2488 
    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 600
    2492       if (lroot) gridunc = gridunc0
    2493 
    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 600
    2497       if (lroot) creceptor = creceptor0
    2498 
    2499 #endif
    2500 
    2501     if ((WETDEP).and.(ldirect.gt.0)) then
    2502       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 600
    2505     end if
    2506 
    2507     if ((DRYDEP).and.(ldirect.gt.0)) then
    2508       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 600
    2511     end if
    2512 
    25132493
    25142494    if (mp_measure_time) call mpif_mtime('commtime',1)
     
    27202700      end if
    27212701
    2722    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
     2702    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
    27352715
    27362716    case ('commtime')
     
    28082788          write(*,FMT='(A60,TR1,F9.2)') 'TOTAL CPU TIME FOR GETFIELDS:',&
    28092789               & mp_getfields_time_total
    2810 !          write(*,FMT='(A60,TR1,F9.2)') 'TOTAL WALL TIME FOR READWIND:',&
    2811 !               & mp_readwind_wtime_total
    2812 !          write(*,FMT='(A60,TR1,F9.2)') 'TOTAL CPU TIME FOR READWIND:',&
    2813 !               & mp_readwind_time_total
     2790          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
    28142794          write(*,FMT='(A60,TR1,F9.2)') 'TOTAL WALL TIME FOR FILE IO:',&
    28152795               & mp_io_wtime_total
  • src/netcdf_output_mod.f90

    r0a94e13 r4ad96c5  
    9393  character(len=255), parameter :: institution = 'NILU'
    9494
    95   integer            :: tpointer=0
     95  integer            :: tpointer
    9696  character(len=255) :: ncfname, ncfnamen
    9797
  • src/outg_mod.f90

    r2eefa58 r4c64400  
    3737  real,allocatable, dimension (:,:,:) :: areanorth
    3838  real,allocatable, dimension (:,:,:) :: densityoutgrid
    39   real,allocatable, dimension (:,:,:) :: densitydrygrid ! added RLT
    40   real,allocatable, dimension (:,:,:) :: factor_drygrid ! added RLT
    4139  real,allocatable, dimension (:,:,:) :: factor3d
    4240  real,allocatable, dimension (:,:,:) :: grid
  • src/outgrid_init.f90

    r2eefa58 rd2a5a83  
    268268    if (stat.ne.0) write(*,*)'ERROR: could not allocate gridunc'
    269269  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 ! RLT
    273   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, &
    277270       0:max(numygrid,numygridn)-1,numzgrid),stat=stat)
    278271    if (stat.ne.0) write(*,*)'ERROR: could not allocate gridunc'
  • src/par_mod.f90

    r2eefa58 r79e0349  
    3030!        Update 15 August 2013 IP                                              *
    3131!                                                                              *
     32!        ESO 2016:                                                             *
     33!          GFS specific parameters moved to gfs_mod.f90                        *
     34!          ECMWF specific parameters moved to ecmwf_mod.f90                    *
    3235!                                                                              *
    3336!*******************************************************************************
     
    7780  real,parameter :: pi=3.14159265, r_earth=6.371e6, r_air=287.05, ga=9.81
    7881  real,parameter :: cpa=1004.6, kappa=0.286, pi180=pi/180., vonkarman=0.4
    79   ! additional constants RLT Aug-2017
    80   real,parameter :: rgas=8.31447
    81   real,parameter :: r_water=461.495
    8282
    8383  ! pi                      number "pi"
     
    8989  ! kappa                   exponent of formula for potential temperature
    9090  ! vonkarman               von Karman constant
    91   ! rgas                    universal gas constant [J/mol/K]
    92   ! r_water                 specific gas constant for water vapor [J/kg/K]
    9391
    9492  real,parameter :: karman=0.40, href=15., convke=2.0
     
    282280
    283281  integer,parameter :: unitpath=1, unitcommand=1, unitageclasses=1, unitgrid=1
    284   integer,parameter :: unitavailab=1, unitreleases=88, unitpartout=93, unitpartout_average=105
     282  integer,parameter :: unitavailab=1, unitreleases=88, unitpartout=93
    285283  integer,parameter :: unitpartin=93, unitflux=98, unitouttraj=96
    286284  integer,parameter :: unitvert=1, unitoro=1, unitpoin=1, unitreceptor=1
     
    292290  integer,parameter :: unitboundcond=89
    293291  integer,parameter :: unittmp=101
    294 ! RLT
    295   integer,parameter :: unitoutfactor=102
    296292
    297293!******************************************************
  • src/partoutput.f90

    r0a94e13 rd2a5a83  
    7171  !**************************************
    7272
    73   if (ipout.eq.1.or.ipout.eq.3) then
     73  if (ipout.eq.1) then
    7474    open(unitpartout,file=path(2)(1:length(2))//'partposit_'//adate// &
    7575         atime,form='unformatted')
  • src/partoutput_mpi.f90

    r0a94e13 rd2a5a83  
    7878  !**************************************
    7979
    80   if (ipout.eq.1.or.ipout.eq.3) then
     80  if (ipout.eq.1) then
    8181    open(unitpartout,file=path(2)(1:length(2))//'partposit_'//adate// &
    8282         atime,form='unformatted',status=file_stat,position='append')
  • src/readcommand.f90

    r2eefa58 r20963b1  
    5050  ! ipin                 1 continue simulation with dumped particle data, 0 no *
    5151  ! ipout                0 no particle dump, 1 every output time, 3 only at end*
    52   ! ipoutfac             increase particle dump interval by factor (default 1) *
    5352  ! itsplit [s]          time constant for particle splitting                  *
    5453  ! loutaver [s]         concentration output is an average over loutaver      *
     
    9897  iout, &
    9998  ipout, &
    100   ipoutfac, &
    10199  lsubgrid, &
    102100  lconvection, &
     
    114112  surf_only, &
    115113  cblflag, &
    116   linversionout, &
    117114  ohfields_path
    118115
     
    132129  iout=3
    133130  ipout=0
    134   ipoutfac=1
    135131  lsubgrid=1
    136132  lconvection=1
     
    148144  surf_only=0
    149145  cblflag=0 ! if using old-style COMMAND file, set to 1 here to use mc cbl routine
    150   linversionout=0
    151146  ohfields_path="../../flexin/"
    152147
     
    416411  !**********************************************************************
    417412
    418   if ((iout.lt.1).or.(iout.gt.5)) then
     413  if ((iout.lt.1).or.(iout.gt.6)) then
    419414    write(*,*) ' #### FLEXPART MODEL ERROR! FILE COMMAND:     #### '
    420415    write(*,*) ' #### IOUT MUST BE 1, 2, 3, 4 OR 5 FOR        #### '
     
    476471      write(*,*) '#### FOR DOMAIN FILLING RUNS OUTPUT FOR      ####'
    477472      write(*,*) '#### EACH RELEASE IS FORBIDDEN !             ####'
    478       stop
    479   endif
    480 
    481   ! Inversion output format only for backward runs
    482   !*****************************************************************************
    483  
    484   if ((linversionout.eq.1).and.(ldirect.eq.1)) then
    485       write(*,*) '#### FLEXPART MODEL ERROR! FILE COMMAND:     ####'
    486       write(*,*) '#### INVERSION OUTPUT FORMAT ONLY FOR        ####'
    487       write(*,*) '#### BACKWARD RUNS                           ####'
    488473      stop
    489474  endif
     
    522507  !****************************************************************
    523508
    524   if ((ipout.ne.0).and.(ipout.ne.1).and.(ipout.ne.2).and.(ipout.ne.3)) then
     509  if ((ipout.ne.0).and.(ipout.ne.1).and.(ipout.ne.2)) then
    525510    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!                #### '
    527512    stop
    528513  endif
  • src/readpaths.f90

    r2eefa58 r62e65c7  
    2020!**********************************************************************
    2121
    22 subroutine readpaths
     22subroutine readpaths !(pathfile)
    2323
    2424  !*****************************************************************************
  • src/readwind_gfs.f90

    r5d74ed9 rdb91eb7  
    8383
    8484  ! NCEP
    85   integer :: numpt,numpu,numpv,numpw,numprh,numpclwch
     85  integer :: numpt,numpu,numpv,numpw,numprh
    8686  real :: help, temp, ew
    8787  real :: elev
     
    134134  numpw=0
    135135  numprh=0
    136   numpclwch=0
    137136  ifield=0
    13813710   ifield=ifield+1
     
    558557      endif
    559558! 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)
    572561        readclouds=.true.
    573562        sumclouds=.true.
    574 !        readclouds=.false.
    575 !       sumclouds=.false.
    576563      endif
    577564
  • src/releaseparticles.f90

    r7873bf7 r75a4ded  
    114114      average_timecorrect=0.
    115115      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
    118117          timecorrect(k)=point_hour(k,nhour)*point_dow(k,ndayofweek)
    119118        else                             ! area source
  • src/timemanager.f90

    r2eefa58 rc7d1052  
    408408#endif
    409409            else
    410               if (linversionout.eq.1) then
    411                 call concoutput_inversion(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc)
    412                 if (verbosity.eq.1) then
    413                   print*,'called concoutput_inversion'
    414                   call system_clock(count_clock)
    415                   write(*,*) 'system clock',count_clock - count_clock0
    416                 endif
    417               else
    418410              call concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc)
    419               endif
    420411              if (verbosity.eq.1) then
    421412                print*,'called concoutput_surf '
     
    431422                call concoutput_nest(itime,outnum)
    432423              else
    433                 if(linversionout.eq.1) then
    434                   call concoutput_inversion_nest(itime,outnum)
    435                 else
    436424                call concoutput_surf_nest(itime,outnum)
    437               endif
    438425              endif
    439426            else
     
    46445145      format(i13,' Seconds simulated: ',i13, ' Particles:    Uncertainty: ',3f7.3)
    46545246      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
    470454        loutnext=loutnext+loutstep
    471455        loutstart=loutnext-loutaver/2
     
    625609!        write (*,*) 'advance: ',prob(1),xmass1(j,1),ztra1(j)
    626610
    627   ! Calculate average position for particle dump output
    628   !****************************************************
    629 
    630         if (ipout.eq.3) call partpos_average(itime,j)
    631 
    632 
    633611  ! Calculate the gross fluxes across layer interfaces
    634612  !***************************************************
     
    752730  if (ipout.eq.2) call partoutput(itime)     ! dump particle positions
    753731
    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
    761733
    762734  !close(104)
  • src/timemanager_mpi.f90

    r0c8c7f2 r20963b1  
    113113  integer :: j,ks,kp,l,n,itime=0,nstop,nstop1,memstat=0
    114114! integer :: ksp
    115   integer :: ip,irec
     115  integer :: ip
    116116  integer :: loutnext,loutstart,loutend
    117117  integer :: ix,jy,ldeltat,itage,nage,idummy
     
    129129! Measure time spent in timemanager
    130130  if (mp_measure_time) call mpif_mtime('timemanager',0)
    131 
    132131
    133132! First output for time 0
     
    533532                end if
    534533
    535               else
     534              else  ! :TODO: check for zeroing in the netcdf module
    536535                call concoutput_surf_nest(itime,outnum)
    537536              end if
     
    59459346      format(' Simulated ',f7.1,' hours (',i13,' s), ',i13, ' particles')
    595594        if (ipout.ge.1) then
    596           if (mp_measure_time) call mpif_mtime('iotime',0)
    597           irec=0
    598595          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
    604597            call mpif_mpi_barrier
    605598          end do
    606           if (mp_measure_time) call mpif_mtime('iotime',1)
    607599        end if
    608600
     
    765757        if (mp_measure_time) call mpif_mtime('advance',1)
    766758
    767   ! Calculate average position for particle dump output
    768   !****************************************************
    769 
    770         if (ipout.eq.3) call partpos_average(itime,j)
    771 
    772759
    773760! Calculate the gross fluxes across layer interfaces
     
    908895    do ip=0, mp_partgroup_np-1
    909896      if (ip.eq.mp_partid) then
    910         if (mp_dbg_mode) write(*,*) 'call partoutput(itime), proc, mp_partid',ip,mp_partid
     897        !if (mp_dbg_mode) write(*,*) 'call partoutput(itime), proc, mp_partid',ip,mp_partid
    911898        call partoutput(itime)    ! dump particle positions
    912899      end if
  • src/verttransform_ecmwf.f90

    r2eefa58 r79e0349  
    7373  use com_mod
    7474  use cmapf_mod, only: cc2gll
     75!  use mpi_mod
    7576
    7677  implicit none
     
    8182  real,dimension(0:nxmax-1,0:nymax-1,nuvzmax) :: rhoh,uvzlev,wzlev
    8283  real,dimension(0:nxmax-1,0:nymax-1,nzmax) :: pinmconv
    83   ! RLT added pressure
    84   real,dimension(0:nxmax-1,0:nymax-1,nuvzmax) :: prsh
    8584  real,dimension(0:nxmax-1,0:nymax-1) ::  tvold,pold,pint,tv
    8685  real,dimension(0:nymax-1) :: cosf
     
    220219!*************************
    221220
     221
    222222  do jy=0,nymin1
    223223    do ix=0,nxmin1
     
    230230  wzlev(:,:,1)=0.
    231231  rhoh(:,:,1)=pold/(r_air*tvold)
    232   ! RLT add pressure
    233   prsh(:,:,1)=ps(:,:,1,n)
    234232
    235233
     
    239237  do kz=2,nuvz
    240238    pint=akz(kz)+bkz(kz)*ps(:,:,1,n)
    241     ! RLT add pressure
    242     prsh(:,:,kz)=pint
    243239    tv=tth(:,:,kz,n)*(1.+0.608*qvh(:,:,kz,n))
    244240    rhoh(:,:,kz)=pint(:,:)/(r_air*tv)
     
    292288  pv(:,:,1,n)=pvh(:,:,1)
    293289  rho(:,:,1,n)=rhoh(:,:,1)
    294 ! RLT add pressure
    295   prs(:,:,1,n)=prsh(:,:,1)
    296290
    297291  uu(:,:,nz,n)=uuh(:,:,nuvz)
     
    307301  pv(:,:,nz,n)=pvh(:,:,nuvz)
    308302  rho(:,:,nz,n)=rhoh(:,:,nuvz)
    309 ! RLT
    310   prs(:,:,nz,n)=prsh(:,:,nuvz)
     303
    311304
    312305  kmin=2
     
    328321          pv(ix,jy,iz,n)=pv(ix,jy,nz,n)
    329322          rho(ix,jy,iz,n)=rho(ix,jy,nz,n)
    330 ! RLT
    331           prs(ix,jy,iz,n)=prs(ix,jy,nz,n)
    332323        else
    333324          innuvz: do kz=idx(ix,jy),nuvz
     
    363354          pv(ix,jy,iz,n)=(pvh(ix,jy,kz-1)*dz2+pvh(ix,jy,kz)*dz1)/dz
    364355          rho(ix,jy,iz,n)=(rhoh(ix,jy,kz-1)*dz2+rhoh(ix,jy,kz)*dz1)/dz
    365 ! RLT add pressure
    366           prs(ix,jy,iz,n)=(prsh(ix,jy,kz-1)*dz2+prsh(ix,jy,kz)*dz1)/dz
    367356        endif
    368357      enddo
     
    665654        if ((lsp.gt.0.01).or.(convp.gt.0.01)) then ! cloud and precipitation
    666655
    667           do kz=nz,2,-1 !go Bottom up!
     656          do kz=nz,1,-1 !go Bottom up!
    668657            if (clw(ix,jy,kz,n).gt. 0) then ! is in cloud
    669658              cloudsh(ix,jy,n)=cloudsh(ix,jy,n)+height(kz)-height(kz-1)
  • src/verttransform_gfs.f90

    r437c545 rdb91eb7  
    548548        if ((lsp.gt.0.01).or.(convp.gt.0.01)) then ! cloud and precipitation
    549549
    550           do kz=nz,2,-1 !go Bottom up!
     550          do kz=nz,1,-1 !go Bottom up!
    551551            if (clw(ix,jy,kz,n).gt. 0) then ! is in cloud
    552552              cloudsh(ix,jy,n)=cloudsh(ix,jy,n)+height(kz)-height(kz-1)
    553553              clouds(ix,jy,kz,n)=1                               ! is a cloud
    554554              if (lsp.ge.convp) then
    555                 clouds(ix,jy,kz,n)=3                             ! lsp in-cloud
     555                clouds(ix,jy,kz,n)=3                            ! lsp in-cloud
    556556              else
    557557                clouds(ix,jy,kz,n)=2                             ! convp in-cloud
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG