Changeset 78e62dc in flexpart.git
- Timestamp:
- May 12, 2015, 12:28:19 PM (9 years ago)
- Branches:
- master, 10.4.1_pesei, GFS_025, bugfixes+enhancements, dev, release-10, release-10.4.1, scaling-bug, univie
- Children:
- 0f20c31
- Parents:
- 2f8635b
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
options/SPECIES/SPECIES_108
r60403cd r78e62dc 3 3 * Input file for the Lagrangian particle dispersion model FLEXPART * 4 4 * Definition file of chemical species/radionuclides * 5 * ESO: edited to work with Rona's changes+Henrik*5 * This file is on the format required by version 10 (05/2015) * 6 6 **************************************************************************** 7 7 SO2 Tracer name … … 14 14 Dry deposition (gases) - Henrys const. 15 15 Dry deposition (gases) - f0 (reactivity) 16 1.9E 03 Dry deposition (particles) - rho16 1.9E+03 Dry deposition (particles) - rho 17 17 4.0E-07 Dry deposition (particles) - dquer 18 18 3.0E-01 Dry deposition (particles) - dsig 19 19 -9.99 Alternative: dry deposition velocity 20 20 64.00 molweight 21 -1.35E-12 OH Reaction rate - C 22 1.0 OH Reaction rate - D 21 1.35E-14 OH Reaction rate - C [cm^3/molecule/sec] 22 120.0 OH Reaction rate - D [K] 23 2.0 OH Reaction rate - N (no unit) 23 24 -9 number of associated specias (neg. none) 24 25 -99.99 KOA - organic matter air partitioning -
src/FLEXPART.f90
r8a65cb0 r78e62dc 69 69 70 70 ! FLEXPART version string 71 flexversion='Version 10.0 pre (2015-03-01)'71 flexversion='Version 10.0beta (2015-05-01)' 72 72 verbosity=0 73 73 -
src/FLEXPART_MPI.f90
r2f8635b r78e62dc 77 77 78 78 ! FLEXPART version string 79 flexversion='Ver. 10 .0pre MPI (2015-03-01)'79 flexversion='Ver. 10 Beta MPI (2015-05-01)' 80 80 verbosity=0 81 81 … … 336 336 !****************************************************************** 337 337 338 if (mp_measure_time) call mpif_mtime('iotime',0) 339 if (lroot) then ! MPI: this part root process only 340 338 341 if (lnetcdfout.eq.1) then 339 342 call writeheader_netcdf(lnest=.false.) … … 350 353 endif 351 354 352 if (lroot) then ! MPI: this part root process only 355 ! 353 356 if (verbosity.gt.0) then 354 357 print*,'call writeheader' … … 364 367 end if ! (mpif_pid == 0) 365 368 369 if (mp_measure_time) call mpif_mtime('iotime',0) 370 366 371 !open(unitdates,file=path(2)(1:length(2))//'dates') 367 368 !open(unitdates,file=path(2)(1:length(2))//'dates')369 372 370 373 if (verbosity.gt.0 .and. lroot) then -
src/com_mod.f90
r5f9d14a r78e62dc 26 26 integer :: length(numpath+2*maxnests) 27 27 character(len=256) :: pathfile, flexversion, arg1, arg2 28 character(len=256) :: ohfields_path 28 29 29 30 ! path path names needed for trajectory model … … 32 33 ! flexversion version of flexpart 33 34 ! arg input arguments from launch at command line 35 ! ohfields_path path to binary files for OH fields 34 36 35 37 !******************************************************** … … 163 165 real :: rgs(maxspec,5,numclass),rlu(maxspec,5,numclass) 164 166 real :: rm(maxspec),dryvel(maxspec),kao(maxspec) 165 real :: ohcconst(maxspec),ohdconst(maxspec) 167 real :: ohcconst(maxspec),ohdconst(maxspec),ohnconst(maxspec) 166 168 ! se it is possible to associate a species with a second one to make transfer from gas to aerosol 167 169 integer :: spec_ass(maxspec) -
src/getfields_mpi.f90
r5f9d14a r78e62dc 43 43 ! 44 44 ! eso 2014: 45 ! MPI version. 3 fields instead of 2, to allow reading the newest in 46 ! the background. 47 ! Only one process (lmpreader=.true.) does the actual reading, while the 48 ! rest call this routine only to update memind, memstat etc. 45 ! MPI version. 46 ! If running with number of processes >= mpi_mod::read_grp_min, 47 ! only one process (mpi_mod::lmpreader=.true.) does the actual reading, while 48 ! the rest call this routine only to update memind, memstat etc. 49 ! 50 ! If mpi_mod::lmp_sync=.true., uses 3 fields instead of 2, to allow reading 51 ! the newest in the background. 49 52 ! 50 53 ! Return memstat, which is the sum of … … 61 64 ! indj indicates the number of the wind field to be read in * 62 65 ! indmin remembers the number of wind fields already treated * 63 ! memind(2 )pointer, on which place the wind fields are stored *64 ! memtime(2 ) [s]times of the wind fields, which are kept in memory *66 ! memind(2[3]) pointer, on which place the wind fields are stored * 67 ! memtime(2[3]) [s] times of the wind fields, which are kept in memory * 65 68 ! itime [s] current time since start date of trajectory calcu- * 66 69 ! lation * -
src/gethourlyOH.f90
r5f9d14a r78e62dc 120 120 memOHtime(1)=0. 121 121 122 jul2=bdate+ real(1./24.,kind=dp) ! date for next hour122 jul2=bdate+ldirect*real(1./24.,kind=dp) ! date for next hour 123 123 call caldate(jul2,jjjjmmdd,hhmmss) 124 124 m2=(jjjjmmdd-(jjjjmmdd/10000)*10000)/100 -
src/mpi_mod.f90
r5f9d14a r78e62dc 90 90 integer :: tm1 91 91 integer, parameter :: nvar_async=27 !29 :DBG: 92 92 !integer, dimension(:), allocatable :: tags 93 93 integer, dimension(:), allocatable :: reqs 94 94 … … 117 117 logical, parameter :: mp_dbg_out = .false. 118 118 logical, parameter :: mp_time_barrier=.true. 119 logical, parameter :: mp_measure_time=. true.119 logical, parameter :: mp_measure_time=.false. 120 120 121 121 ! for measuring CPU/Wall time … … 139 139 real(dp) :: mp_conccalc_time_beg, mp_conccalc_time_end, mp_conccalc_time_total=0. 140 140 real(dp) :: mp_total_wtime_beg, mp_total_wtime_end, mp_total_wtime_total=0. 141 real(dp) :: mp_vt_wtime_beg, mp_vt_wtime_end, mp_vt_wtime_total 142 real(sp) :: mp_vt_time_beg, mp_vt_time_end, mp_vt_time_total 141 143 142 144 ! dat_lun logical unit number for i/o … … 418 420 419 421 420 421 422 ! redefine numpart as 'numpart per process' throughout the code 422 423 !************************************************************** … … 438 439 439 440 integer :: i 440 441 442 !***********************************************************************443 444 441 445 442 ! Time for MPI communications … … 1243 1240 1244 1241 do dest=0,mp_np-1 ! mp_np-2 will also work if last proc reserved for reading 1245 1242 ! TODO: use mp_partgroup_np here 1246 1243 if (dest.eq.id_read) cycle 1247 1244 i=dest*nvar_async … … 1339 1336 &MPI_COMM_WORLD,reqs(i),mp_ierr) 1340 1337 if (mp_ierr /= 0) goto 600 1341 1342 1338 ! else 1339 ! i=i+2 1343 1340 end if 1344 1341 … … 1389 1386 1390 1387 ! :TODO: don't need these 1391 1392 1393 1394 1388 ! d3s1=d3_size1 1389 ! d3s2=d3_size2 1390 ! d2s1=d2_size1 1391 ! d2s2=d2_size2 1395 1392 1396 1393 ! At the time this immediate receive is posted, memstat is the state of … … 1593 1590 call MPI_Waitall(n_req,reqs,MPI_STATUSES_IGNORE,mp_ierr) 1594 1591 ! endif 1595 1596 1597 1598 1599 1600 1601 1602 1603 1592 ! else 1593 ! do i = 0, nvar_async*mp_np-1 1594 ! if (mod(i,27).eq.0 .or. mod(i,28).eq.0) then 1595 ! call MPI_Cancel(reqs(i),mp_ierr) 1596 ! cycle 1597 ! end if 1598 ! call MPI_Wait(reqs(i),MPI_STATUS_IGNORE,mp_ierr) 1599 ! end do 1600 ! end if 1604 1601 1605 1602 if (mp_ierr /= 0) goto 600 … … 1733 1730 & mp_comm_used, mp_ierr) 1734 1731 end if 1735 1736 1732 1737 1733 if ((WETDEP).and.(ldirect.gt.0)) then … … 1854 1850 end if 1855 1851 1852 case ('verttransform') 1853 if (imode.eq.0) then 1854 mp_vt_wtime_beg = mpi_wtime() 1855 call cpu_time(mp_vt_time_beg) 1856 else 1857 mp_vt_wtime_end = mpi_wtime() 1858 call cpu_time(mp_vt_time_end) 1859 1860 mp_vt_wtime_total = mp_vt_wtime_total + (mp_vt_wtime_end - & 1861 & mp_vt_wtime_beg) 1862 mp_vt_time_total = mp_vt_time_total + (mp_vt_time_end - & 1863 & mp_vt_time_beg) 1864 end if 1865 1856 1866 case ('readwind') 1857 1867 if (imode.eq.0) then … … 1909 1919 !*********************************************************************** 1910 1920 1911 if (mp_measure_time) then1921 IF (mp_measure_time) THEN 1912 1922 do ip=0, mp_np-1 1913 1923 call MPI_BARRIER(MPI_COMM_WORLD, mp_ierr) … … 1956 1966 write(*,FMT='(A60,TR1,F9.2)') 'TOTAL WALL TIME FOR CONCCALC:',& 1957 1967 & mp_conccalc_time_total 1968 ! write(*,FMT='(A60,TR1,F9.2)') 'TOTAL WALL TIME FOR VERTTRANSFORM:',& 1969 ! & mp_vt_wtime_total 1970 ! write(*,FMT='(A60,TR1,F9.2)') 'TOTAL CPU TIME FOR VERTTRANSFORM:',& 1971 ! & mp_vt_time_total 1958 1972 ! NB: the 'flush' function is possibly a gfortran-specific extension 1959 1973 call flush() … … 1962 1976 end if 1963 1977 1978 ! This call to barrier is for correctly formatting output 1979 call MPI_BARRIER(MPI_COMM_WORLD, mp_ierr) 1980 1981 if (lroot) then 1982 write(*,FMT='(72("#"))') 1983 WRITE(*,*) "To turn off output of time measurements, set " 1984 WRITE(*,*) " mp_measure_time=.false." 1985 WRITE(*,*) "in file mpi_mod.f90" 1986 write(*,FMT='(72("#"))') 1987 end if 1988 1964 1989 ! j=mp_pid*nvar_async 1965 1990 ! In the implementation with 3 fields, the processes may have posted 1966 1991 ! MPI_Irecv requests that should be cancelled here 1967 1992 !! TODO: 1968 1969 1970 1971 1972 1973 1974 1993 ! if (.not.lmp_sync) then 1994 ! r=mp_pid*nvar_async 1995 ! do j=r,r+nvar_async-1 1996 ! call MPI_Cancel(j,mp_ierr) 1997 ! if (mp_ierr /= 0) write(*,*) '#### mpif_finalize::MPI_Cancel> ERROR ####' 1998 ! end do 1999 ! end if 1975 2000 1976 2001 call MPI_FINALIZE(mp_ierr) … … 1981 2006 1982 2007 1983 end subroutine mpif_finalize1984 1985 1986 subroutine get_lun(my_lun)2008 end subroutine mpif_finalize 2009 2010 2011 subroutine get_lun(my_lun) 1987 2012 !*********************************************************************** 1988 2013 ! get_lun: … … 1990 2015 !*********************************************************************** 1991 2016 1992 implicit none1993 1994 integer, intent(inout) :: my_lun1995 integer, save :: free_lun=1001996 logical :: exists, iopen1997 1998 !*********************************************************************** 1999 2000 loop1: do2001 inquire(UNIT=free_lun, EXIST=exists, OPENED=iopen)2002 if (exists .and. .not.iopen) exit loop12003 free_lun = free_lun+12004 end do loop12005 my_lun = free_lun2006 2007 end subroutine get_lun2008 2009 2010 subroutine write_data_dbg(array_in, array_name, tstep, ident)2011 !*********************************************************************** 2012 ! Write one-dimensional arrays to disk(for debugging purposes)2013 !*********************************************************************** 2014 implicit none2015 2016 real, intent(in), dimension(:) :: array_in2017 integer, intent(in) :: tstep2018 integer :: lios2019 character(LEN=*), intent(in) :: ident, array_name2020 2021 character(LEN=8) :: c_ts2022 character(LEN=40) :: fn_1, fn_22023 2024 !*********************************************************************** 2025 2026 write(c_ts, FMT='(I8.8,BZ)') tstep2027 fn_1='-'//trim(adjustl(c_ts))//'-'//trim(ident)2028 write(c_ts, FMT='(I2.2,BZ)') mp_np2029 fn_2= trim(adjustl(array_name))//trim(adjustl(fn_1))//'-np'//trim(adjustl(c_ts))//'.dat'2030 2031 call get_lun(dat_lun)2032 open(UNIT=dat_lun, FILE=fn_2, IOSTAT=lios, ACTION='WRITE', &2033 FORM='UNFORMATTED', STATUS='REPLACE')2034 write(UNIT=dat_lun, IOSTAT=lios) array_in2035 close(UNIT=dat_lun)2036 2037 end subroutine write_data_dbg2017 implicit none 2018 2019 integer, intent(inout) :: my_lun 2020 integer, save :: free_lun=100 2021 logical :: exists, iopen 2022 2023 !*********************************************************************** 2024 2025 loop1: do 2026 inquire(UNIT=free_lun, EXIST=exists, OPENED=iopen) 2027 if (exists .and. .not.iopen) exit loop1 2028 free_lun = free_lun+1 2029 end do loop1 2030 my_lun = free_lun 2031 2032 end subroutine get_lun 2033 2034 2035 subroutine write_data_dbg(array_in, array_name, tstep, ident) 2036 !*********************************************************************** 2037 ! Write one-dimensional arrays to file (for debugging purposes) 2038 !*********************************************************************** 2039 implicit none 2040 2041 real, intent(in), dimension(:) :: array_in 2042 integer, intent(in) :: tstep 2043 integer :: lios 2044 character(LEN=*), intent(in) :: ident, array_name 2045 2046 character(LEN=8) :: c_ts 2047 character(LEN=40) :: fn_1, fn_2 2048 2049 !*********************************************************************** 2050 2051 write(c_ts, FMT='(I8.8,BZ)') tstep 2052 fn_1='-'//trim(adjustl(c_ts))//'-'//trim(ident) 2053 write(c_ts, FMT='(I2.2,BZ)') mp_np 2054 fn_2= trim(adjustl(array_name))//trim(adjustl(fn_1))//'-np'//trim(adjustl(c_ts))//'.dat' 2055 2056 call get_lun(dat_lun) 2057 open(UNIT=dat_lun, FILE=fn_2, IOSTAT=lios, ACTION='WRITE', & 2058 FORM='UNFORMATTED', STATUS='REPLACE') 2059 write(UNIT=dat_lun, IOSTAT=lios) array_in 2060 close(UNIT=dat_lun) 2061 2062 end subroutine write_data_dbg 2038 2063 2039 2064 -
src/ohreaction.f90
r8a65cb0 r78e62dc 153 153 do k=1,nspec 154 154 if (ohcconst(k).gt.0.) then 155 ohrate=ohcconst(k)*temp** 2*exp(-ohdconst(k)/temp)*oh_average155 ohrate=ohcconst(k)*temp**ohnconst(k)*exp(-ohdconst(k)/temp)*oh_average 156 156 ! new particle mass 157 157 restmass = xmass1(jpart,k)*exp(-1*ohrate*abs(ltsample)) -
src/readOHfield.f90
r8a65cb0 r78e62dc 46 46 use com_mod 47 47 48 49 48 implicit none 50 49 … … 69 68 ! open netcdf file 70 69 write(mm,fmt='(i2.2)') m 71 thefile=trim(path(1))//'OH_FIELDS/'//'geos-chem.OH.2005'//mm//'01.nc' 70 ! thefile=trim(path(1))//'OH_FIELDS/'//'geos-chem.OH.2005'//mm//'01.nc' 71 thefile=trim(ohfields_path)//'OH_FIELDS/'//'geos-chem.OH.2005'//mm//'01.nc' 72 72 ierr=nf_open(trim(thefile),NF_NOWRITE,nid) 73 73 if(ierr.ne.0) then … … 163 163 164 164 ! open netcdf file 165 thefile=trim(path(1))//'OH_FIELDS/jrate_average.nc' 165 ! thefile=trim(path(1))//'OH_FIELDS/jrate_average.nc' 166 thefile=trim(ohfields_path)//'OH_FIELDS/jrate_average.nc' 166 167 ierr=nf_open(trim(thefile),NF_NOWRITE,nid) 167 168 if(ierr.ne.0) then -
src/readcommand.f90
r8a65cb0 r78e62dc 111 111 lnetcdfout, & 112 112 surf_only, & 113 cblflag 113 cblflag, & 114 ohfields_path 114 115 115 116 ! Presetting namelist command … … 143 144 surf_only=0 144 145 cblflag=0 146 ohfields_path="../../flexin/" 145 147 146 148 ! Open the command file and read user options … … 232 234 if (old) call skplin(3,unitcommand) !added by mc 233 235 read(unitcommand,*) cblflag !added by mc 236 234 237 close(unitcommand) 235 238 -
src/readreleases.f90
r5f9d14a r78e62dc 385 385 if (ohcconst(i).gt.0.) then 386 386 OHREA=.true. 387 write (*,*) 'OHreaction switched on: ',ohcconst(i),i387 if (lroot) write (*,*) 'OHreaction switched on: ',ohcconst(i),i 388 388 endif 389 389 -
src/readspecies.f90
r5f9d14a r78e62dc 47 47 ! ohcconst OH reaction rate constant C * 48 48 ! ohdconst OH reaction rate constant D * 49 ! ohnconst OH reaction rate constant n * 49 50 ! id_spec SPECIES number as referenced in RELEASE file * 50 51 ! id_pos position where SPECIES data shall be stored * … … 66 67 character(len=16) :: pspecies 67 68 real :: pdecay, pweta, pwetb, preldiff, phenry, pf0, pdensity, pdquer 68 real :: pdsigma, pdryvel, pweightmolar, pohcconst, pohdconst, p spec_ass, pkao69 real :: pdsigma, pdryvel, pweightmolar, pohcconst, pohdconst, pohnconst, pspec_ass, pkao 69 70 real :: pweta_in, pwetb_in, pwetc_in, pwetd_in 70 71 integer :: readerror … … 75 76 pweta_in, pwetb_in, pwetc_in, pwetd_in, & 76 77 preldiff, phenry, pf0, pdensity, pdquer, & 77 pdsigma, pdryvel, pweightmolar, pohcconst, pohdconst, p spec_ass, pkao78 pdsigma, pdryvel, pweightmolar, pohcconst, pohdconst, pohnconst, pspec_ass, pkao 78 79 79 80 pspecies=" " … … 94 95 pohcconst=-9.99 95 96 pohdconst=-9.9E-09 97 pohnconst=2.0 96 98 pspec_ass=-9 97 99 pkao=-99.99 … … 160 162 read(unitspecies,'(f8.2)',end=22) ohdconst(pos_spec) 161 163 ! write(*,*) ohdconst(pos_spec) 164 read(unitspecies,'(f8.2)',end=22) ohnconst(pos_spec) 165 ! write(*,*) ohnconst(pos_spec) 162 166 read(unitspecies,'(i18)',end=22) spec_ass(pos_spec) 163 167 ! write(*,*) spec_ass(pos_spec) … … 183 187 pohcconst=ohcconst(pos_spec) 184 188 pohdconst=ohdconst(pos_spec) 189 pohnconst=ohnconst(pos_spec) 185 190 pspec_ass=spec_ass(pos_spec) 186 191 pkao=kao(pos_spec) … … 206 211 ohcconst(pos_spec)=pohcconst 207 212 ohdconst(pos_spec)=pohdconst 213 ohnconst(pos_spec)=pohnconst 208 214 spec_ass(pos_spec)=pspec_ass 209 215 kao(pos_spec)=pkao -
src/timemanager.f90
r8a65cb0 r78e62dc 657 657 if (linit_cond.ge.1) call initial_cond_output(itime) ! dump initial cond. field 658 658 659 close(104)659 !close(104) 660 660 661 661 ! De-allocate memory and end -
src/timemanager_mpi.f90
r5f9d14a r78e62dc 208 208 endif 209 209 210 ! This time measure includes reading/MPI communication (for the reader process), 211 ! or MPI communication time only (for other processes) 210 212 if (mp_measure_time) call mpif_mtime('getfields',0) 211 213 … … 213 215 214 216 if (mp_measure_time) call mpif_mtime('getfields',1) 217 218 215 219 216 220 ! Broadcast fields to all MPI processes 217 221 ! Skip if all processes have called getfields or if no new fields 218 222 !***************************************************************** 223 224 if (mp_measure_time.and..not.(lmpreader.and.lmp_use_reader)) call mpif_mtime('getfields',0) 219 225 220 226 ! Version 1 (lmp_sync=.true.) uses a read-ahead process where send/recv is done … … 258 264 259 265 end if 266 267 if (mp_measure_time.and..not.(lmpreader.and.lmp_use_reader)) call mpif_mtime('getfields',1) 268 260 269 261 270 !******************************************************************************* … … 446 455 call mpif_tm_reduce_grid 447 456 457 if (mp_measure_time) call mpif_mtime('iotime',0) 448 458 if (surf_only.ne.1) then 449 459 if (lroot) then … … 470 480 endif 471 481 endif 482 if (mp_measure_time) call mpif_mtime('iotime',1) 472 483 473 484 ! :TODO: Correct calling of conc_surf above? … … 481 492 !********************************************* 482 493 call mpif_tm_reduce_grid_nest 494 495 if (mp_measure_time) call mpif_mtime('iotime',0) 483 496 484 497 if (lnetcdfout.eq.0) then … … 515 528 end if 516 529 end if 530 517 531 518 532 outnum=0. … … 520 534 if ((iout.eq.4).or.(iout.eq.5)) call plumetraj(itime) 521 535 if (iflux.eq.1) call fluxoutput(itime) 536 if (mp_measure_time) call mpif_mtime('iotime',1) 537 522 538 if (lroot) write(*,45) itime,numpart*mp_partgroup_np,gridtotalunc,& 523 539 &wetgridtotalunc,drygridtotalunc
Note: See TracChangeset
for help on using the changeset viewer.