Changeset 32b49c3 in flexpart.git
- Timestamp:
- Apr 13, 2016, 11:57:08 AM (8 years ago)
- Branches:
- master, 10.4.1_pesei, GFS_025, bugfixes+enhancements, dev, release-10, release-10.4.1, scaling-bug, univie
- Children:
- 341f4b7
- Parents:
- e31b3b5
- Location:
- src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/FLEXPART_MPI.f90
rdb712a8 r32b49c3 317 317 print*,'call readpartpositions' 318 318 endif 319 call readpartpositions 319 ! readwind process skips this step 320 if (lmp_use_reader.and..not.lmpreader) call readpartpositions 320 321 else 321 322 if (verbosity.gt.0 .and. lroot) then -
src/makefile
r1c3c778 r32b49c3 14 14 # 15 15 # USAGE 16 # Compile serial FLEXPART (ECMWF) a16 # Compile serial FLEXPART (ECMWF) 17 17 # make [-j] ecmwf 18 18 # -
src/mpi_mod.f90
re31b3b5 r32b49c3 165 165 !*********************************************************************** 166 166 use par_mod, only: maxpart, numwfmem, dep_prec 167 use com_mod, only: mpi_mode 167 use com_mod, only: mpi_mode, verbosity 168 168 169 169 implicit none … … 386 386 ! Dynamic allocation of arrays (in serial code these have size maxpart) 387 387 ! 388 ! Not in use anymore, moved to com_mod for interoperability with serial version 389 ! 390 ! TODO: remove 388 391 !******************************************************************************* 389 392 use com_mod … … 1043 1046 !*********************************************************************** 1044 1047 use com_mod 1045 use par_mod, 1048 use par_mod,only: numwfmem 1046 1049 1047 1050 implicit none … … 1226 1229 integer :: d2s1 = nxmax*nymax 1227 1230 integer :: d2s2 = nxmax*nymax*maxspec 1228 integer :: d1s1 = maxwf1231 ! integer :: d1s1 = maxwf 1229 1232 1230 1233 !******************************************************************************* … … 1430 1433 ! last read was asynchronous to index 2, 3 is free 1431 1434 mind=3 1435 else 1436 ! illegal state 1437 write(*,*) 'mpi_mod> FLEXPART ERROR: Illegal memstat value. Exiting.' 1438 stop 1432 1439 end if 1433 1440 … … 1602 1609 ! 1603 1610 !******************************************************************************* 1604 use com_mod,only: readclouds1611 ! use com_mod,only: readclouds 1605 1612 1606 1613 implicit none 1607 1614 1608 1615 1609 integer :: n_req 1610 integer :: i 1616 integer :: n_req !,i 1611 1617 1612 1618 !*********************************************************************** … … 1958 1964 implicit none 1959 1965 1960 integer :: ip ,j,r1966 integer :: ip !,j,r 1961 1967 1962 1968 !*********************************************************************** -
src/par_mod.f90
r8ed5f11 r32b49c3 186 186 !************************************************** 187 187 188 integer,parameter :: maxpart= 10000188 integer,parameter :: maxpart=4000000 189 189 integer,parameter :: maxspec=1 190 190 real,parameter :: minmass=0.0001 … … 229 229 !********************************* 230 230 231 ! integer,parameter :: maxrand=120000000232 231 integer,parameter :: maxrand=200000000 233 ! 232 234 233 ! maxrand number of random numbers used 235 234 -
src/readpartpositions_mpi.f90
r5f9d14a r32b49c3 45 45 use com_mod 46 46 use random_mod, only: ran1 47 use mpi_mod , only: mp_seed47 use mpi_mod !, only: mp_seed 48 48 49 49 implicit none 50 50 51 integer :: ibdatein,ibtimein,nspecin,itimein,numpointin,i,j,ix 51 integer :: ibdatein,ibtimein,nspecin,itimein,numpointin,i,j,ix,ip 52 52 integer :: id1,id2,it1,it2 53 integer :: addone,numparticlecount_all,numpart_all,lbnd,ubnd 53 54 real :: xlonin,ylatin,topo,hmixi,pvi,qvi,rhoi,tri,tti 54 55 character :: specin*7 … … 57 58 integer :: idummy = -8 58 59 60 ! These variables are allocated at the root process for all particles in file. 61 real,dimension(maxpart) :: xtra1_all,ytra1_all,ztra1_all 62 real,dimension(maxpart,maxspec) :: xmass1_all 63 integer,dimension(maxpart) :: npoint_all,itramem_all 64 59 65 ! Different seed for each process 60 66 idummy=idummy+mp_seed 61 67 62 68 numparticlecount=0 69 numparticlecount_all=0 70 numpart_all=0 63 71 64 72 ! Open header file of dumped particle data 65 !***************************************** 66 67 open(unitpartin,file=path(2)(1:length(2))//'header', & 68 form='unformatted',err=998) 69 70 read(unitpartin) ibdatein,ibtimein 71 read(unitpartin) 72 read(unitpartin) 73 74 read(unitpartin) 75 read(unitpartin) 76 read(unitpartin) nspecin 77 nspecin=nspecin/3 78 if ((ldirect.eq.1).and.(nspec.ne.nspecin)) goto 997 79 80 do i=1,nspecin 81 read(unitpartin) 82 read(unitpartin) 83 read(unitpartin) j,specin 84 if ((ldirect.eq.1).and.(species(i)(1:7).ne.specin)) goto 996 73 ! Each MPI process sequentially access file (just in case) 74 !********************************************************* 75 76 do ip=0, mp_partgroup_np-1 77 call mpif_mpi_barrier 78 open(unitpartin,file=path(2)(1:length(2))//'header', & 79 form='unformatted',err=998) 80 81 read(unitpartin) ibdatein,ibtimein 82 read(unitpartin) 83 read(unitpartin) 84 85 read(unitpartin) 86 read(unitpartin) 87 read(unitpartin) nspecin 88 nspecin=nspecin/3 89 if ((ldirect.eq.1).and.(nspec.ne.nspecin)) goto 997 90 91 do i=1,nspecin 92 read(unitpartin) 93 read(unitpartin) 94 read(unitpartin) j,specin 95 if ((ldirect.eq.1).and.(species(i)(1:7).ne.specin)) goto 996 96 end do 97 98 read(unitpartin) numpointin 99 if (numpointin.ne.numpoint) then ! goto 995 100 101 ! eso 2016: moved this warning here to avoid out-of-block goto 102 !995 write(*,*) ' #### FLEXPART MODEL WARNING IN READPARTPOSITIONS#### ' 103 write(*,*) ' #### FLEXPART MODEL WARNING IN READPARTPOSITIONS#### ' 104 write(*,*) ' #### NUMBER OF RELEASE LOCATIONS DOES NOT #### ' 105 write(*,*) ' #### AGREE WITH CURRENT SETTINGS! #### ' 106 ! stop 107 goto 999 108 end if 109 110 999 continue 111 do i=1,numpointin 112 read(unitpartin) 113 read(unitpartin) 114 read(unitpartin) 115 read(unitpartin) 116 do j=1,nspec 117 read(unitpartin) 118 read(unitpartin) 119 read(unitpartin) 120 end do 121 end do 122 read(unitpartin) 123 read(unitpartin) 124 125 do ix=0,numxgrid-1 126 read(unitpartin) 127 end do 128 close(unitpartin) 129 130 131 ! Open data file of dumped particle data 132 ! All processes read the whole file 133 !*************************************** 134 135 open(unitpartin,file=path(2)(1:length(2))//'partposit_end', & 136 form='unformatted',err=998) 137 138 100 read(unitpartin,end=99) itimein 139 i=0 140 200 i=i+1 141 read(unitpartin) npoint_all(i),xlonin,ylatin,ztra1_all(i),itramem_all(i), & 142 topo,pvi,qvi,rhoi,hmixi,tri,tti,(xmass1_all(i,j),j=1,nspec) 143 144 if (xlonin.eq.-9999.9) goto 100 145 xtra1_all(i)=(xlonin-xlon0)/dx 146 ytra1_all(i)=(ylatin-ylat0)/dy 147 numparticlecount_all=max(numparticlecount_all,npoint(i)) 148 goto 200 149 150 99 numpart_all=i-1 151 152 close(unitpartin) 153 85 154 end do 86 155 87 read(unitpartin) numpointin 88 if (numpointin.ne.numpoint) goto 995 89 999 continue 90 do i=1,numpointin 91 read(unitpartin) 92 read(unitpartin) 93 read(unitpartin) 94 read(unitpartin) 95 do j=1,nspec 96 read(unitpartin) 97 read(unitpartin) 98 read(unitpartin) 99 end do 156 157 ! Distribute particles among processes 158 !************************************** 159 lbnd=1 160 ubnd=0 161 162 do ip=0, mp_partgroup_np-1 163 164 ! Extra particle distributed in case remainder in the division 165 if (ip.lt.mod(numpart_all,mp_partgroup_np)) then 166 addone=1 167 else 168 addone=0 169 end if 170 171 if (ip==0) then 172 ubnd=ubnd + numpart_all/mp_partgroup_np + addone 173 else 174 ubnd=lbnd + numpart_all/mp_partgroup_np + addone - 1 175 end if 176 177 if (ip==mp_pid) then 178 179 numparticlecount=numparticlecount_all/mp_partgroup_np+addone 180 numpart=numpart_all/mp_partgroup_np+addone 181 182 xtra1(1:numpart) = xtra1_all(lbnd:ubnd) 183 ytra1(1:numpart) = ytra1_all(lbnd:ubnd) 184 ztra1(1:numpart) = ztra1_all(lbnd:ubnd) 185 xmass1(1:numpart,:) = xmass1_all(lbnd:ubnd,:) 186 npoint(1:numpart) = npoint_all(lbnd:ubnd) 187 itramem(1:numpart) = itramem_all(lbnd:ubnd) 188 189 end if 190 191 lbnd=ubnd+1 192 100 193 end do 101 read(unitpartin)102 read(unitpartin)103 104 do ix=0,numxgrid-1105 read(unitpartin)106 end do107 108 109 ! Open data file of dumped particle data110 !***************************************111 112 close(unitpartin)113 open(unitpartin,file=path(2)(1:length(2))//'partposit_end', &114 form='unformatted',err=998)115 116 117 100 read(unitpartin,end=99) itimein118 i=0119 200 i=i+1120 read(unitpartin) npoint(i),xlonin,ylatin,ztra1(i),itramem(i), &121 topo,pvi,qvi,rhoi,hmixi,tri,tti,(xmass1(i,j),j=1,nspec)122 123 if (xlonin.eq.-9999.9) goto 100124 xtra1(i)=(xlonin-xlon0)/dx125 ytra1(i)=(ylatin-ylat0)/dy126 numparticlecount=max(numparticlecount,npoint(i))127 goto 200128 129 99 numpart=i-1130 131 close(unitpartin)132 194 133 195 julin=juldate(ibdatein,ibtimein)+real(itimein,kind=dp)/86400._dp … … 156 218 stop 157 219 158 !995 write(*,*) ' #### FLEXPART MODEL ERROR IN READPARTPOSITIONS#### '159 995 write(*,*) ' #### FLEXPART MODEL WARNING IN READPARTPOSITIONS#### '160 write(*,*) ' #### NUMBER OF RELEASE LOCATIONS DOES NOT #### '161 write(*,*) ' #### AGREE WITH CURRENT SETTINGS! #### '162 ! stop163 goto 999164 165 220 996 write(*,*) ' #### FLEXPART MODEL ERROR IN READPARTPOSITIONS#### ' 166 221 write(*,*) ' #### SPECIES NAMES TO BE READ IN DO NOT #### ' -
src/readspecies.f90
rec7fc72 r32b49c3 151 151 ! write(*,*) density(pos_spec) 152 152 read(unitspecies,'(e18.1)',end=22) dquer(pos_spec) 153 write(*,*) 'dquer(pos_spec):', dquer(pos_spec)153 ! write(*,*) 'dquer(pos_spec):', dquer(pos_spec) 154 154 read(unitspecies,'(e18.1)',end=22) dsigma(pos_spec) 155 155 ! write(*,*) dsigma(pos_spec) -
src/timemanager_mpi.f90
re31b3b5 r32b49c3 104 104 105 105 logical :: reqv_state=.false. ! .true. if waiting for a MPI_Irecv to complete 106 integer :: j,ks,kp,l,n,itime=0,nstop,nstop1,memstat=0 ,mind106 integer :: j,ks,kp,l,n,itime=0,nstop,nstop1,memstat=0 !,mind 107 107 ! integer :: ksp 108 108 integer :: ip … … 115 115 116 116 real(sp) :: gridtotalunc 117 real(dep_prec) :: drygridtotalunc,wetgridtotalunc,drydeposit(maxspec) 117 real(dep_prec) :: drygridtotalunc=0_dep_prec,wetgridtotalunc=0_dep_prec,& 118 & drydeposit(maxspec)=0_dep_prec 118 119 real :: xold,yold,zold,xmassfract 119 120 real, parameter :: e_inv = 1.0/exp(1.0) … … 137 138 138 139 ! itime=0 139 if (lroot ) then140 !write(*,45) itime,numpart*mp_partgroup_np,gridtotalunc,wetgridtotalunc,drygridtotalunc141 write(*,46) float(itime)/3600,itime,numpart*mp_partgroup_np140 if (lroot.or.mp_dev_mode) then 141 write(*,45) itime,numpart*mp_partgroup_np,gridtotalunc,wetgridtotalunc,drygridtotalunc 142 ! write(*,46) float(itime)/3600,itime,numpart*mp_partgroup_np 142 143 143 144 if (verbosity.gt.0) then … … 275 276 ! For validation and tests: call the function below to set all fields to simple 276 277 ! homogeneous values 277 if (mp_dev_mode) call set_fields_synthetic278 ! if (mp_dev_mode) call set_fields_synthetic 278 279 279 280 !******************************************************************************* … … 554 555 555 556 !CGZ-lifetime: output species lifetime 556 if (lroot ) then557 if (lroot.or.mp_dev_mode) then 557 558 ! write(*,*) 'Overview species lifetime in days', & 558 559 ! real((species_lifetime(:,1)/species_lifetime(:,2))/real(3600.0*24.0))
Note: See TracChangeset
for help on using the changeset viewer.