Changes in / [37d6222:9f59af6] in flexpart.git
- Location:
- src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
src/FLEXPART.f90
ra9cf4b1 r0c00f1f 52 52 use com_mod 53 53 use conv_mod 54 54 use netcdf_output_mod, only: writeheader_netcdf 55 55 use random_mod, only: gasdev1 56 56 use class_gribfile 57 58 #ifdef USE_NCF59 use netcdf_output_mod, only: writeheader_netcdf60 #endif61 57 62 58 implicit none … … 356 352 !****************************************************************** 357 353 358 #ifdef USE_NCF359 354 if (lnetcdfout.eq.1) then 360 355 call writeheader_netcdf(lnest=.false.) … … 370 365 endif 371 366 endif 372 #endif373 367 374 368 if (verbosity.gt.0) then -
src/FLEXPART_MPI.f90
r20963b1 r0c00f1f 53 53 use conv_mod 54 54 use mpi_mod 55 use netcdf_output_mod, only: writeheader_netcdf 55 56 use random_mod, only: gasdev1 56 57 use class_gribfile 57 58 #ifdef USE_NCF59 use netcdf_output_mod, only: writeheader_netcdf60 #endif61 58 62 59 implicit none … … 67 64 integer :: metdata_format = GRIBFILE_CENTRE_UNKNOWN 68 65 integer :: detectformat 69 integer(selected_int_kind(16)), dimension(maxspec) :: tot_b=0, & 70 & tot_i=0 66 71 67 72 68 … … 207 203 208 204 if (metdata_format.eq.GRIBFILE_CENTRE_ECMWF) then 209 if (lroot)print *,'ECMWF metdata detected'205 print *,'ECMWF metdata detected' 210 206 elseif (metdata_format.eq.GRIBFILE_CENTRE_NCEP) then 211 if (lroot)print *,'NCEP metdata detected'207 print *,'NCEP metdata detected' 212 208 else 213 if (lroot)print *,'Unknown metdata format'209 print *,'Unknown metdata format' 214 210 stop 215 211 endif … … 382 378 383 379 if (mp_measure_time) call mpif_mtime('iotime',0) 384 385 380 if (lroot) then ! MPI: this part root process only 386 #ifdef USE_NCF 387 388 389 390 391 392 393 394 395 396 397 398 399 400 #endif 401 381 382 if (lnetcdfout.eq.1) then 383 call writeheader_netcdf(lnest=.false.) 384 else 385 call writeheader 386 end if 387 388 if (nested_output.eq.1) then 389 if (lnetcdfout.eq.1) then 390 call writeheader_netcdf(lnest=.true.) 391 else 392 call writeheader_nest 393 endif 394 endif 395 396 ! 402 397 if (verbosity.gt.0) then 403 398 print*,'call writeheader' … … 407 402 ! FLEXPART 9.2 ticket ?? write header in ASCII format 408 403 call writeheader_txt 409 404 !if (nested_output.eq.1) call writeheader_nest 410 405 if (nested_output.eq.1.and.surf_only.ne.1) call writeheader_nest 411 406 if (nested_output.eq.1.and.surf_only.eq.1) call writeheader_nest_surf … … 414 409 415 410 if (mp_measure_time) call mpif_mtime('iotime',0) 411 412 !open(unitdates,file=path(2)(1:length(2))//'dates') 416 413 417 414 if (verbosity.gt.0 .and. lroot) then … … 484 481 485 482 ! NIK 16.02.2005 486 if ( mp_partgroup_pid.ge.0) then ! Skip for readwind process487 call MPI_Reduce( tot_blc_count, tot_b, nspec, MPI_INTEGER8, MPI_SUM, id_root, &483 if (lroot) then 484 call MPI_Reduce(MPI_IN_PLACE, tot_blc_count, nspec, MPI_INTEGER8, MPI_SUM, id_root, & 488 485 & mp_comm_used, mp_ierr) 489 call MPI_Reduce( tot_inc_count, tot_i, nspec, MPI_INTEGER8, MPI_SUM, id_root, &486 call MPI_Reduce(MPI_IN_PLACE, tot_inc_count, nspec, MPI_INTEGER8, MPI_SUM, id_root, & 490 487 & mp_comm_used, mp_ierr) 488 else 489 if (mp_partgroup_pid.ge.0) then ! Skip for readwind process 490 call MPI_Reduce(tot_blc_count, 0, nspec, MPI_INTEGER8, MPI_SUM, id_root, & 491 & mp_comm_used, mp_ierr) 492 call MPI_Reduce(tot_inc_count, 0, nspec, MPI_INTEGER8, MPI_SUM, id_root, & 493 & mp_comm_used, mp_ierr) 494 end if 491 495 end if 492 493 496 494 497 if (lroot) then … … 497 500 write(*,*) 'Scavenging statistics for species ', species(i), ':' 498 501 write(*,*) 'Total number of occurences of below-cloud scavenging', & 499 & tot_b(i) 500 ! & tot_blc_count(i) 502 & tot_blc_count(i) 501 503 write(*,*) 'Total number of occurences of in-cloud scavenging', & 502 & tot_i(i) 503 ! & tot_inc_count(i) 504 & tot_inc_count(i) 504 505 write(*,*) '**********************************************' 505 506 end do -
src/concoutput.f90
r20963b1 r08a38b5 140 140 close(unitdates) 141 141 142 ! Overwrite existing dates file on first call, later append to it143 ! This fixes a bug where the dates file kept growing across multiple runs144 142 IF (init) THEN 145 143 file_stat='OLD' … … 315 313 drygridsigma(ix,jy)* & 316 314 sqrt(real(nclassunc)) 317 315 125 drygridsigmatotal=drygridsigmatotal+ & 318 316 drygridsigma(ix,jy) 319 317 endif -
src/concoutput_mpi.f90
r20963b1 r6a678e3 104 104 real,parameter :: weightair=28.97 105 105 logical :: sp_zer 106 logical,save :: init=.true.106 LOGICAL,save :: init=.true. 107 107 character :: adate*8,atime*6 108 108 character(len=3) :: anspec … … 113 113 integer :: ierr 114 114 character(LEN=100) :: dates_char 115 ! character :: dates_char 115 116 116 117 ! Measure execution time … … 128 129 ! This fixes a bug where the dates file kept growing across multiple runs 129 130 130 ! If 'dates' file exists in output directory, make a backup131 ! If 'dates' file exists, make a backup 131 132 inquire(file=path(2)(1:length(2))//'dates', exist=ldates_file) 132 133 if (ldates_file.and.init) then … … 257 258 258 259 write(anspec,'(i3.3)') ks 259 260 if (DRYBKDEP.or.WETBKDEP) then !scavdep output 261 if (DRYBKDEP) & 262 open(unitoutgrid,file=path(2)(1:length(2))//'grid_drydep_'//adate// & 260 if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5)) then 261 if (ldirect.eq.1) then 262 open(unitoutgrid,file=path(2)(1:length(2))//'grid_conc_'//adate// & 263 atime//'_'//anspec,form='unformatted') 264 else 265 open(unitoutgrid,file=path(2)(1:length(2))//'grid_time_'//adate// & 266 atime//'_'//anspec,form='unformatted') 267 endif 268 write(unitoutgrid) itime 269 endif 270 271 if ((iout.eq.2).or.(iout.eq.3)) then ! mixing ratio 272 open(unitoutgridppt,file=path(2)(1:length(2))//'grid_pptv_'//adate// & 263 273 atime//'_'//anspec,form='unformatted') 264 if (WETBKDEP) & 265 open(unitoutgrid,file=path(2)(1:length(2))//'grid_wetdep_'//adate// & 266 atime//'_'//anspec,form='unformatted') 267 write(unitoutgrid) itime 268 else 269 if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5)) then 270 if (ldirect.eq.1) then 271 open(unitoutgrid,file=path(2)(1:length(2))//'grid_conc_'//adate// & 272 atime//'_'//anspec,form='unformatted') 273 else 274 open(unitoutgrid,file=path(2)(1:length(2))//'grid_time_'//adate// & 275 atime//'_'//anspec,form='unformatted') 276 endif 277 write(unitoutgrid) itime 278 endif 279 280 if ((iout.eq.2).or.(iout.eq.3)) then ! mixing ratio 281 open(unitoutgridppt,file=path(2)(1:length(2))//'grid_pptv_'//adate// & 282 atime//'_'//anspec,form='unformatted') 283 284 write(unitoutgridppt) itime 285 endif 286 endif ! if deposition output 274 275 write(unitoutgridppt) itime 276 endif 287 277 288 278 do kp=1,maxpointspec_act … … 364 354 ! Concentration output 365 355 !********************* 366 if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5) .or.(iout.eq.6)) then356 if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5)) then 367 357 368 358 ! Wet deposition … … 459 449 endif 460 450 sp_count_r=sp_count_r+1 461 if (lparticlecountoutput) then462 sparse_dump_r(sp_count_r)= &463 sp_fact* &464 grid(ix,jy,kz)465 else466 451 sparse_dump_r(sp_count_r)= & 467 452 sp_fact* & 468 453 grid(ix,jy,kz)* & 469 454 factor3d(ix,jy,kz)/tot_mu(ks,kp) 470 end if471 472 473 455 ! if ((factor(ix,jy,kz)/tot_mu(ks,kp)).eq.0) 474 456 ! + write (*,*) factor(ix,jy,kz),tot_mu(ks,kp),ks,kp … … 656 638 !************************* 657 639 658 creceptor(:,:)=0. 659 gridunc(:,:,:,:,:,:,:)=0. 640 do ks=1,nspec 641 do kp=1,maxpointspec_act 642 do i=1,numreceptor 643 creceptor(i,ks)=0. 644 end do 645 do jy=0,numygrid-1 646 do ix=0,numxgrid-1 647 do l=1,nclassunc 648 do nage=1,nageclass 649 do kz=1,numzgrid 650 gridunc(ix,jy,kz,ks,kp,l,nage)=0. 651 end do 652 end do 653 end do 654 end do 655 end do 656 end do 657 end do 660 658 661 659 if (mp_measure_time) call mpif_mtime('rootonly',1) -
src/getfields_mpi.f90
r20963b1 r6ecb30a 233 233 40 indmin=indj 234 234 235 if (WETBKDEP.and.(lmpreader.or.(.not.lmp_use_reader.and.lroot))) then236 call writeprecip(itime,memind(1))237 endif238 239 235 else 240 236 … … 291 287 60 indmin=indj 292 288 293 ! if (WETBKDEP.and.lroot) then 294 if (WETBKDEP.and.(lmpreader.or.(.not.lmp_use_reader.and.lroot))) then 295 call writeprecip(itime,memind(1)) 296 endif 289 mind3=memstat 297 290 298 291 endif -
src/makefile
ra9cf4b1 rccc9ec2 31 31 # make [-j] mpi-dbg 32 32 # 33 # NETCDF OUTPUT34 # To add support for output in netCDF format, append `ncf=yes` to the35 # `make` command36 #37 33 ################################################################################ 38 34 … … 61 57 INCPATH2 = ${ROOT_DIR}/include 62 58 LIBPATH1 = ${ROOT_DIR}/lib 63 else 59 60 else #ifeq ($(gcc), 5.4) 64 61 # Compiled libraries under user ~flexpart, gfortran v5.4 65 62 ROOT_DIR = /homevip/flexpart/ … … 71 68 INCPATH2 = /usr/include 72 69 LIBPATH1 = ${ROOT_DIR}/gcc-5.4.0/lib 70 71 #else 72 # Default: System libraries at NILU, gfortran v4.6 73 # F90 = /usr/bin/gfortran 74 # MPIF90 = /usr/bin/mpif90.openmpi 75 76 # INCPATH1 = /xnilu_wrk/projects/FLEXPART/flex_wrk/bin64/grib_api/include 77 # INCPATH2 = /usr/include 78 # LIBPATH1 = /xnilu_wrk/projects/FLEXPART/flex_wrk/bin64/grib_api/lib 73 79 endif 74 75 76 ### Enable netCDF output?77 ifeq ($(ncf), yes)78 NCOPT = -DUSE_NCF -lnetcdff79 else80 NCOPT = -UUSE_NCF81 endif82 83 80 84 81 … … 92 89 93 90 ## LIBRARIES 94 #LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper -lnetcdff 95 LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper $(NCOPT) 96 97 FFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV) -g -cpp -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV) $(NCOPT) $(FUSER) #-Warray-bounds -fcheck=all # -march=native 98 99 DBGFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV_DBG) -g3 -ggdb3 -cpp -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV_DBG) $(NCOPT) -fbacktrace -Wall -fdump-core $(FUSER) # -ffpe-trap=invalid,overflow,denormal,underflow,zero -Warray-bounds -fcheck=all 91 LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper -lnetcdff # -fopenmp 92 93 FFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV) -g -cpp -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV) $(FUSER) #-Warray-bounds -fcheck=all # -march=native 94 95 DBGFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV_DBG) -g3 -ggdb3 -cpp -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV_DBG) -fbacktrace -Wall -fdump-core $(FUSER) # -ffpe-trap=invalid,overflow,denormal,underflow,zero -Warray-bounds -fcheck=all 100 96 101 97 LDFLAGS = $(FFLAGS) -L$(LIBPATH1) -Wl,-rpath,$(LIBPATH1) $(LIBS) #-L$(LIBPATH2) … … 143 139 getfields_mpi.o \ 144 140 readwind_ecmwf_mpi.o 145 146 OBJECTS_NCF = netcdf_output_mod.o147 141 148 142 OBJECTS = \ … … 202 196 dynamic_viscosity.o get_settling.o \ 203 197 initialize_cbl_vel.o re_initialize_particle.o \ 204 cbl.o 205 206 ifeq ($(ncf), yes) 207 OBJECTS := $(OBJECTS) $(OBJECTS_NCF) 208 endif 198 cbl.o netcdf_output_mod.o 209 199 210 200 %.o: %.mod -
src/readOHfield.f90
r3f149cc rd7aab4b 22 22 subroutine readOHfield 23 23 24 !***************************************************************************** 25 ! * 26 ! Reads the OH field into memory * 27 ! * 28 ! AUTHOR: R.L. Thompson, Nov 2014 * 29 ! * 30 ! UPDATES: * 31 ! 03/2018 SEC: Converted original netCDF files to binary format * 32 !***************************************************************************** 33 ! * 34 ! Variables: * 35 ! * 36 ! path(numpath) contains the path names * 37 ! lonOH(nxOH) longitude of OH fields * 38 ! latOH(nyOH) latitude of OH fields * 39 ! altOH(nzOH) altitude of OH fields * 40 ! etaOH(nzOH) eta-levels of OH fields * 41 ! OH_field(nxOH,nyOH,nzOH,m) OH concentration (molecules/cm3) * 42 ! * 43 ! * 44 !***************************************************************************** 24 !***************************************************************************** 25 ! * 26 ! Reads the OH field into memory * 27 ! * 28 ! AUTHOR: R.L. Thompson, Nov 2014 * 29 ! * 30 !***************************************************************************** 31 ! * 32 ! Variables: * 33 ! * 34 ! path(numpath) contains the path names * 35 ! lonOH(nxOH) longitude of OH fields * 36 ! latOH(nyOH) latitude of OH fields * 37 ! altOH(nzOH) altitude of OH fields * 38 ! etaOH(nzOH) eta-levels of OH fields * 39 ! OH_field(nxOH,nyOH,nzOH,m) OH concentration (molecules/cm3) * 40 ! * 41 ! * 42 !***************************************************************************** 45 43 46 44 use oh_mod … … 50 48 implicit none 51 49 52 integer :: i,j,k,l,ierr 50 include 'netcdf.inc' 51 52 character(len=150) :: thefile 53 character(len=2) :: mm 54 integer :: nid,ierr,xid,yid,zid,vid,m 53 55 real, dimension(:), allocatable :: etaOH 54 56 … … 59 61 real, parameter :: scalehgt=7000. ! scale height in metres 60 62 61 62 open(unitOH,file=trim(ohfields_path) & 63 //'OH_FIELDS/OH_variables.bin',status='old', & 64 form='UNFORMATTED', iostat=ierr, convert='little_endian') 65 66 if(ierr.ne.0) then 67 write(*,*) 'Cannot read binary OH fields in ',trim(ohfields_path)//'OH_FIELDS/OH_variables.bin' 68 stop 69 endif 70 71 read(unitOH) nxOH 72 read(unitOH) nyOH 73 read(unitOH) nzOH 74 write(*,*) nxOH,nyOH,nzOH 75 76 ! allocate variables 77 allocate(lonOH(nxOH)) 78 allocate(latOH(nyOH)) 79 allocate(etaOH(nzOH)) 80 allocate(altOH(nzOH)) 81 allocate(OH_field(nxOH,nyOH,nzOH,12)) 82 allocate(OH_hourly(nxOH,nyOH,nzOH,2)) 83 84 read(unitOH) (lonjr(i),i=1,360) 85 read(unitOH) (latjr(i),i=1,180) 86 read(unitOH) (((jrate_average(i,j,k),i=1,360),j=1,180),k=1,12) 87 read(unitOH) (lonOH(i),i=1,nxOH) 88 read(unitOH) (latOH(i),i=1,nyOH) 89 read(unitOH) (lonOH(i),i=1,nxOH) 90 91 read(unitOH) (altOH(i),i=1,nzOH) 92 read(unitOH) ((((OH_field(i,j,k,l),i=1,nxOH),j=1,nyOH),k=1,nzOH),l=1,12) 93 read(unitOH) ((((OH_hourly(i,j,k,l),i=1,nxOH),j=1,nyOH),k=1,nzOH),l=1,2) 63 ! Read OH fields and level heights 64 !******************************** 65 66 do m=1,12 67 68 ! open netcdf file 69 write(mm,fmt='(i2.2)') m 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 ierr=nf_open(trim(thefile),NF_NOWRITE,nid) 73 if(ierr.ne.0) then 74 write (*,*) 'The OH field at: '//thefile// ' could not be opened' 75 write (*,*) 'please copy the OH fields there, or change the path in the' 76 write (*,*) 'COMMAND namelist!' 77 write(*,*) nf_strerror(ierr) 78 stop 79 endif 80 81 ! inquire about variables 82 ierr=nf_inq_dimid(nid,'Lon-000',xid) 83 if(ierr.ne.0) then 84 write(*,*) nf_strerror(ierr) 85 stop 86 endif 87 ierr=nf_inq_dimid(nid,'Lat-000',yid) 88 if(ierr.ne.0) then 89 write(*,*) nf_strerror(ierr) 90 stop 91 endif 92 ierr=nf_inq_dimid(nid,'Alt-000',zid) 93 if(ierr.ne.0) then 94 write(*,*) nf_strerror(ierr) 95 stop 96 endif 97 98 if(m.eq.1) then 99 100 ! read dimension sizes 101 ierr=nf_inq_dimlen(nid,xid,nxOH) 102 if(ierr.ne.0) then 103 write(*,*) nf_strerror(ierr) 104 stop 105 endif 106 ierr=nf_inq_dimlen(nid,yid,nyOH) 107 if(ierr.ne.0) then 108 write(*,*) nf_strerror(ierr) 109 stop 110 endif 111 ierr=nf_inq_dimlen(nid,zid,nzOH) 112 if(ierr.ne.0) then 113 write(*,*) nf_strerror(ierr) 114 stop 115 endif 116 117 ! allocate variables 118 allocate(lonOH(nxOH)) 119 allocate(latOH(nyOH)) 120 allocate(etaOH(nzOH)) 121 allocate(altOH(nzOH)) 122 allocate(OH_field(nxOH,nyOH,nzOH,12)) 123 allocate(OH_hourly(nxOH,nyOH,nzOH,2)) 124 125 ! read dimension variables 126 ierr=nf_inq_varid(nid,'LON',xid) 127 ierr=nf_get_var_real(nid,xid,lonOH) 128 if(ierr.ne.0) then 129 write(*,*) nf_strerror(ierr) 130 stop 131 endif 132 ierr=nf_inq_varid(nid,'LAT',yid) 133 ierr=nf_get_var_real(nid,yid,latOH) 134 if(ierr.ne.0) then 135 write(*,*) nf_strerror(ierr) 136 stop 137 endif 138 ierr=nf_inq_varid(nid,'ETAC',zid) 139 ierr=nf_get_var_real(nid,zid,etaOH) 140 if(ierr.ne.0) then 141 write(*,*) nf_strerror(ierr) 142 stop 143 endif 144 145 ! convert eta-level to altitude (assume surface pressure of 1010 hPa) 146 altOH=log(1010./(etaOH*1010.))*scalehgt 147 148 endif ! m.eq.1 149 150 ! read OH_field 151 ierr=nf_inq_varid(nid,'CHEM-L_S__OH',vid) 152 ierr=nf_get_var_real(nid,vid,OH_field(:,:,:,m)) 153 if(ierr.ne.0) then 154 write(*,*) nf_strerror(ierr) 155 stop 156 endif 157 158 ierr=nf_close(nid) 159 160 end do 161 162 deallocate(etaOH) 163 164 ! Read J(O1D) photolysis rates 165 !******************************** 166 167 ! open netcdf file 168 ! thefile=trim(path(1))//'OH_FIELDS/jrate_average.nc' 169 thefile=trim(ohfields_path)//'OH_FIELDS/jrate_average.nc' 170 ierr=nf_open(trim(thefile),NF_NOWRITE,nid) 171 if(ierr.ne.0) then 172 write(*,*) nf_strerror(ierr) 173 stop 174 endif 175 176 ! read dimension variables 177 ierr=nf_inq_varid(nid,'longitude',xid) 178 ierr=nf_get_var_real(nid,xid,lonjr) 179 if(ierr.ne.0) then 180 write(*,*) nf_strerror(ierr) 181 stop 182 endif 183 ierr=nf_inq_varid(nid,'latitude',yid) 184 ierr=nf_get_var_real(nid,yid,latjr) 185 if(ierr.ne.0) then 186 write(*,*) nf_strerror(ierr) 187 stop 188 endif 189 190 ! read jrate_average 191 ierr=nf_inq_varid(nid,'jrate',vid) 192 ierr=nf_get_var_real(nid,vid,jrate_average) 193 if(ierr.ne.0) then 194 write(*,*) nf_strerror(ierr) 195 stop 196 endif 197 198 ierr=nf_close(nid) 199 200 return 94 201 95 202 end subroutine readOHfield -
src/readcommand.f90
r20963b1 r01e6052 332 332 case (3) ! 3 .. wet deposition in outputfield 333 333 ind_rel = 3 334 if (lroot) then 335 write(*,*) ' #### FLEXPART WET DEPOSITION BACKWARD MODE #### ' 336 write(*,*) ' #### Releaseheight is forced to 0 - 20km #### ' 337 write(*,*) ' #### Release is performed above ground lev #### ' 338 end if 334 write(*,*) ' #### FLEXPART WET DEPOSITION BACKWARD MODE #### ' 335 write(*,*) ' #### Releaseheight is forced to 0 - 20km #### ' 336 write(*,*) ' #### Release is performed above ground lev #### ' 339 337 WETBKDEP=.true. 340 338 allocate(xscav_frac1(maxpart,maxspec)) 341 339 case (4) ! 4 .. dry deposition in outputfield 342 340 ind_rel = 4 343 if (lroot) then 344 write(*,*) ' #### FLEXPART DRY DEPOSITION BACKWARD MODE #### ' 345 write(*,*) ' #### Releaseheight is forced to 0 - 2*href #### ' 346 write(*,*) ' #### Release is performed above ground lev #### ' 347 end if 341 write(*,*) ' #### FLEXPART DRY DEPOSITION BACKWARD MODE #### ' 342 write(*,*) ' #### Releaseheight is forced to 0 - 2*href #### ' 343 write(*,*) ' #### Release is performed above ground lev #### ' 348 344 DRYBKDEP=.true. 349 345 allocate(xscav_frac1(maxpart,maxspec)) … … 396 392 endif 397 393 398 ! Check for netcdf output switch 399 !******************************* 394 ! check for netcdf output switch (use for non-namelist input only!) 400 395 if (iout.ge.8) then 401 396 lnetcdfout = 1 402 397 iout = iout - 8 403 #ifndef USE_NCF 404 write(*,*)'ERROR: netcdf output not activated during compile time but used in COMMAND file!'405 write(*,*) 'Please recompile with netcdf library (`make [...] ncf=yes`)or use standard output format.'406 stop407 #endif398 ! #ifndef NETCDF_OUTPUT 399 ! print*,'ERROR: netcdf output not activated during compile time but used in COMMAND file!' 400 ! print*,'Please recompile with netcdf library or use standard output format.' 401 ! stop 402 ! #endif 408 403 endif 409 404 -
src/readwind_ecmwf_mpi.f90
r20963b1 r61e07ba 103 103 104 104 integer :: isec1(56),isec2(22+nxmax+nymax) 105 real( sp) :: zsec4(jpunp)106 real( sp) :: xaux,yaux107 real( dp) :: xauxin,yauxin108 real (sp),parameter :: eps=1.e-4109 real( sp) :: nsss(0:nxmax-1,0:nymax-1),ewss(0:nxmax-1,0:nymax-1)110 real (sp):: plev1,pmean,tv,fu,hlev1,ff10m,fflev1,conversion_factor105 real(kind=4) :: zsec4(jpunp) 106 real(kind=4) :: xaux,yaux 107 real(kind=8) :: xauxin,yauxin 108 real,parameter :: eps=1.e-4 109 real(kind=4) :: nsss(0:nxmax-1,0:nymax-1),ewss(0:nxmax-1,0:nymax-1) 110 real :: plev1,pmean,tv,fu,hlev1,ff10m,fflev1,conversion_factor 111 111 112 112 logical :: hflswitch,strswitch !,readcloud … … 123 123 !ZHG test the grib fields that have lcwc without using them 124 124 ! readcloud=.false. 125 125 !hg end 126 126 levdiff2=nlev_ec-nwz+1 127 127 iumax=0 -
src/releaseparticles_mpi.f90
r20963b1 r16b61a5 216 216 xmass1(ipart,k)=xmass(i,k)/real(npart(i)) & 217 217 *timecorrect(k)/average_timecorrect 218 if (DRYBKDEP.or.WETBKDEP) then ! if there is no scavenging in wetdepo it will be set to 0 219 ! if ( henry(k).gt.0 .or. & 220 ! crain_aero(k).gt.0. .or. csnow_aero(k).gt.0. .or. & 221 ! ccn_aero(k).gt.0. .or. in_aero(k).gt.0. ) then 222 xscav_frac1(ipart,k)=-1. 223 endif 218 ! write (*,*) 'xmass1: ',xmass1(ipart,k),ipart,k 224 219 ! Assign certain properties to particle 225 220 !************************************** … … 371 366 !Af ind_rel is defined in readcommand.f 372 367 373 if ( (ind_rel .eq. 1).or.(ind_rel .eq. 3).or.(ind_rel .eq. 4)) then368 if (ind_rel .eq. 1) then 374 369 375 370 ! Interpolate the air density -
src/timemanager.f90
ra9cf4b1 rfe32dca 101 101 use par_mod 102 102 use com_mod 103 #ifdef USE_NCF104 103 use netcdf_output_mod, only: concoutput_netcdf,concoutput_nest_netcdf,& 105 104 &concoutput_surf_netcdf,concoutput_surf_nest_netcdf 106 #endif107 105 108 106 implicit none … … 391 389 if (surf_only.ne.1) then 392 390 if (lnetcdfout.eq.1) then 393 #ifdef USE_NCF394 391 call concoutput_netcdf(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc) 395 #endif396 392 else 397 393 call concoutput(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc) … … 403 399 write(*,*) 'system clock',count_clock - count_clock0 404 400 endif 405 if (lnetcdfout.eq.1) then 406 #ifdef USE_NCF 401 if (lnetcdfout.eq.1) then 407 402 call concoutput_surf_netcdf(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc) 408 #endif409 403 else 410 404 call concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc) … … 425 419 endif 426 420 else 427 #ifdef USE_NCF428 421 if (surf_only.ne.1) then 429 422 call concoutput_nest_netcdf(itime,outnum) … … 431 424 call concoutput_surf_nest_netcdf(itime,outnum) 432 425 endif 433 #endif434 426 endif 435 427 endif -
src/timemanager_mpi.f90
r20963b1 rd8eed02 102 102 use com_mod 103 103 use mpi_mod 104 #ifdef USE_NCF105 104 use netcdf_output_mod, only: concoutput_netcdf,concoutput_nest_netcdf,& 106 105 &concoutput_surf_netcdf,concoutput_surf_nest_netcdf 107 #endif108 106 109 107 implicit none … … 115 113 integer :: ip 116 114 integer :: loutnext,loutstart,loutend 117 integer :: ix,jy,ldeltat,itage,nage ,idummy115 integer :: ix,jy,ldeltat,itage,nage 118 116 integer :: i_nan=0,ii_nan,total_nan_intl=0 !added by mc to check instability in CBL scheme 119 117 integer :: numpart_tot_mpi ! for summing particles on all processes 120 real :: outnum,weight,prob(maxspec), prob_rec(maxspec), decfact,wetscav 118 real :: outnum,weight,prob(maxspec) 119 real :: decfact 121 120 122 121 real(sp) :: gridtotalunc … … 124 123 & drydeposit(maxspec)=0_dep_prec 125 124 real :: xold,yold,zold,xmassfract 126 real :: grfraction(3)127 125 real, parameter :: e_inv = 1.0/exp(1.0) 128 126 … … 159 157 !CGZ-lifetime: set lifetime to 0 160 158 161 if (.not.lusekerneloutput) write(*,*) 'Not using the kernel'162 if (turboff) write(*,*) 'Turbulence switched off'163 159 164 160 … … 485 481 if (lroot) then 486 482 if (lnetcdfout.eq.1) then 487 #ifdef USE_NCF488 483 call concoutput_netcdf(itime,outnum,gridtotalunc,wetgridtotalunc,& 489 484 &drygridtotalunc) 490 #endif491 485 else 492 486 call concoutput(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc) … … 500 494 if (lroot) then 501 495 if (lnetcdfout.eq.1) then 502 #ifdef USE_NCF503 496 call concoutput_surf_netcdf(itime,outnum,gridtotalunc,wetgridtotalunc,& 504 497 &drygridtotalunc) 505 #endif506 498 else 507 499 call concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc,drygridtotalunc) … … 521 513 call mpif_tm_reduce_grid_nest 522 514 523 515 if (mp_measure_time) call mpif_mtime('iotime',0) 524 516 525 517 if (lnetcdfout.eq.0) then … … 534 526 else ! :TODO: check for zeroing in the netcdf module 535 527 call concoutput_surf_nest(itime,outnum) 528 536 529 end if 530 537 531 else 538 #ifdef USE_NCF 532 539 533 if (surf_only.ne.1) then 540 534 if (lroot) then … … 550 544 end if 551 545 endif 552 #endif 546 547 553 548 end if 554 549 end if 550 551 555 552 outnum=0. 556 553 endif … … 710 707 zold=ztra1(j) 711 708 712 713 ! RECEPTOR: dry/wet depovel714 !****************************715 ! Before the particle is moved716 ! the calculation of the scavenged mass shall only be done once after release717 ! xscav_frac1 was initialised with a negative value718 719 if (DRYBKDEP) then720 do ks=1,nspec721 if ((xscav_frac1(j,ks).lt.0)) then722 call get_vdep_prob(itime,xtra1(j),ytra1(j),ztra1(j),prob_rec)723 if (DRYDEPSPEC(ks)) then ! dry deposition724 xscav_frac1(j,ks)=prob_rec(ks)725 else726 xmass1(j,ks)=0.727 xscav_frac1(j,ks)=0.728 endif729 endif730 enddo731 endif732 733 if (WETBKDEP) then734 do ks=1,nspec735 if ((xscav_frac1(j,ks).lt.0)) then736 call get_wetscav(itime,lsynctime,loutnext,j,ks,grfraction,idummy,idummy,wetscav)737 if (wetscav.gt.0) then738 xscav_frac1(j,ks)=wetscav* &739 (zpoint2(npoint(j))-zpoint1(npoint(j)))*grfraction(1)740 else741 xmass1(j,ks)=0.742 xscav_frac1(j,ks)=0.743 endif744 endif745 enddo746 endif747 748 709 ! Integrate Lagevin equation for lsynctime seconds 749 710 !************************************************* … … 847 808 call initial_cond_calc(itime+lsynctime,j) 848 809 itra1(j)=-999999999 849 if (verbosity.gt.0) then 850 print*, 'terminated particle ',j,'for age' 851 endif 810 !print*, 'terminated particle ',j,'for age' 852 811 endif 853 812 endif … … 860 819 861 820 862 ! Counter of "unstable" particle velocity during a time scale863 ! of maximumtl=20 minutes (defined in com_mod)864 !************************************************************ 821 ! Added by mc: counter of "unstable" particle velocity during a time scale 822 ! of maximumtl=20 minutes (defined in com_mod) 823 865 824 total_nan_intl=0 866 825 i_nan=i_nan+1 ! added by mc to count nan during a time of maxtl (i.e. maximum tl fixed here to 20 minutes, see com_mod)
Note: See TracChangeset
for help on using the changeset viewer.