Changes in / [4c52d0b:aa939a9] in flexpart.git
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r969c1fe rf976c5d 1 log*2 noh*3 diff*4 1 FP_ecmwf_gfortran* 5 2 *.o … … 10 7 FLEXPART 11 8 FLEXPART_MPI 12 FLEX* -
src/calcfluxes.f90
ra7167e4 r92fab65 64 64 (jyave.le.numygrid-1)) then 65 65 do kz=1,numzgrid ! determine height of cell 66 ! if (outheighthalf(kz).gt.zold) goto 11 67 if (outheight(kz).gt.zold) goto 11 !sec, use upper layer instead of mid layer 66 if (outheighthalf(kz).gt.zold) goto 11 68 67 end do 69 68 11 k1=min(numzgrid,kz) 70 69 do kz=1,numzgrid ! determine height of cell 71 ! if (outheighthalf(kz).gt.ztra1(jpart)) goto 21 72 if (outheight(kz).gt.ztra1(jpart)) goto 21 70 if (outheighthalf(kz).gt.ztra1(jpart)) goto 21 73 71 end do 74 72 21 k2=min(numzgrid,kz) … … 98 96 99 97 if (abs(xold-xtra1(jpart)).lt.real(nx)/2.) then 100 ix1=int((xold*dx+xoutshift)/dxout) ! flux throught the western boundary (sec) 101 ix2=int((xtra1(jpart)*dx+xoutshift)/dxout) ! flux throught the western boundary (sec) 102 ! ix1=int((xold*dx+xoutshift)/dxout+0.5) 103 ! ix2=int((xtra1(jpart)*dx+xoutshift)/dxout+0.5) 98 ix1=int((xold*dx+xoutshift)/dxout+0.5) 99 ix2=int((xtra1(jpart)*dx+xoutshift)/dxout+0.5) 104 100 do k=1,nspec 105 101 do ix=ix1,ix2-1 … … 149 145 if ((kzave.le.numzgrid).and.(ixave.ge.0).and. & 150 146 (ixave.le.numxgrid-1)) then 151 jy1=int((yold*dy+youtshift)/dyout) ! flux throught the southern boundary (sec) 152 jy2=int((ytra1(jpart)*dy+youtshift)/dyout) ! flux throught the southern boundary (sec) 153 ! jy1=int((yold*dy+youtshift)/dyout+0.5) 154 ! jy2=int((ytra1(jpart)*dy+youtshift)/dyout+0.5) 147 jy1=int((yold*dy+youtshift)/dyout+0.5) 148 jy2=int((ytra1(jpart)*dy+youtshift)/dyout+0.5) 155 149 156 150 do k=1,nspec -
src/init_domainfill.f90
rffbe224 r92fab65 209 209 ztra1(numpart+jj)=height(nz)-0.5 210 210 211 211 212 ! Interpolate PV to the particle position 212 213 !**************************************** … … 215 216 ixp=ixm+1 216 217 jyp=jym+1 217 if (jyp.gt.180) then218 write (*,*) 'init_domainfill, over: ',jyp,jym,ytra1(numpart+jj),jy,ran1(idummy),ny219 jyp=jym220 endif221 218 ddx=xtra1(numpart+jj)-real(ixm) 222 219 ddy=ytra1(numpart+jj)-real(jym) -
src/netcdf_output_mod.f90
- Property mode changed from 100755 to 100644
r759df5f r759df5f 36 36 use outg_mod, only: outheight,oroout,densityoutgrid,factor3d,volume,& 37 37 wetgrid,wetgridsigma,drygrid,drygridsigma,grid,gridsigma,& 38 area,arean,volumen, orooutn, areaeast, areanorth,p0out, t0out38 area,arean,volumen, orooutn, p0out, t0out 39 39 use par_mod, only: dep_prec, sp, dp, maxspec, maxreceptor, nclassunc,& 40 40 unitoutrecept,unitoutreceptppt, nxmax,unittmp, & 41 41 write_p0t0 42 use com_mod, only: path,length,ldirect, bdate,ibdate,ibtime,iedate,ietime, &42 use com_mod, only: path,length,ldirect,ibdate,ibtime,iedate,ietime, & 43 43 loutstep,loutaver,loutsample,outlon0,outlat0,& 44 44 numxgrid,numygrid,dxout,dyout,numzgrid, height, & … … 67 67 68 68 public :: writeheader_netcdf,concoutput_surf_nest_netcdf,concoutput_netcdf,& 69 &concoutput_nest_netcdf,concoutput_surf_netcdf ,fluxoutput_netcdf69 &concoutput_nest_netcdf,concoutput_surf_netcdf 70 70 71 71 ! include 'netcdf.inc' … … 1520 1520 end subroutine concoutput_surf_nest_netcdf 1521 1521 1522 subroutine fluxoutput_netcdf(itime)1523 1524 ! i1525 !*****************************************************************************1526 ! *1527 ! Output of the gridded fluxes. *1528 ! Eastward, westward, northward, southward, upward and downward gross *1529 ! fluxes are written to output file in either sparse matrix or grid dump *1530 ! format, whichever is more efficient. *1531 ! *1532 ! Author: A. Stohl *1533 ! *1534 ! 04 April 2000 *1535 ! netcdfoutput S. Eckhardt, 2020 *1536 ! *1537 !*****************************************************************************1538 1539 use flux_mod1540 1541 implicit none1542 1543 real(kind=dp) :: jul1544 integer :: itime,ix,jy,kz,ks,nage,jjjjmmdd,ihmmss,kp,i1545 1546 character(len=255) :: ncfname1547 character :: adate*8,atime*6,timeunit*32,anspec*31548 1549 integer :: ncid1550 integer :: timeDimID, latDimID, lonDimID, levDimID1551 integer :: nspecDimID, npointDimID, nageclassDimID, ncharDimID, pointspecDimID1552 integer :: tID, lonID, latID, levID, lageID, fluxID1553 integer, dimension(6) :: dIDs1554 integer :: cache_size1555 real, allocatable, dimension(:) :: coord1556 1557 1558 ! Determine current calendar date, needed for the file name1559 !**********************************************************1560 1561 jul=bdate+real(itime,kind=dp)/86400._dp1562 call caldate(jul,jjjjmmdd,ihmmss)1563 write(adate,'(i8.8)') jjjjmmdd1564 write(atime,'(i6.6)') ihmmss1565 1566 ncfname=path(2)(1:length(2))//'grid_flux_'//adate// &1567 atime//'.nc'1568 1569 ! setting cache size in bytes. It is set to 4 times the largest data block that is written1570 ! size_type x nx x ny x nz1571 ! create file1572 1573 cache_size = 16 * numxgrid * numygrid * numzgrid1574 call nf90_err(nf90_create(trim(ncfname), cmode = nf90_hdf5, ncid = ncid, &1575 cache_size = cache_size))1576 1577 ! create dimensions:1578 !*************************1579 ! time1580 call nf90_err(nf90_def_dim(ncid, 'time', nf90_unlimited, timeDimID))1581 timeunit = 'seconds since '//adate(1:4)//'-'//adate(5:6)// &1582 '-'//adate(7:8)//' '//atime(1:2)//':'//atime(3:4)1583 1584 call nf90_err(nf90_def_dim(ncid, 'longitude', numxgrid, lonDimID))1585 call nf90_err(nf90_def_dim(ncid, 'latitude', numygrid, latDimID))1586 call nf90_err(nf90_def_dim(ncid, 'height', numzgrid, levDimID))1587 call nf90_err(nf90_def_dim(ncid, 'numspec', nspec, nspecDimID))1588 call nf90_err(nf90_def_dim(ncid, 'pointspec', maxpointspec_act, pointspecDimID))1589 call nf90_err(nf90_def_dim(ncid, 'nageclass', nageclass, nageclassDimID))1590 call nf90_err(nf90_def_dim(ncid, 'nchar', 45, ncharDimID))1591 call nf90_err(nf90_def_dim(ncid, 'numpoint', numpoint, npointDimID))1592 1593 1594 ! create variables1595 !*************************1596 1597 ! time1598 call nf90_err(nf90_def_var(ncid, 'time', nf90_int, (/ timeDimID /), tID))1599 call nf90_err(nf90_put_att(ncid, tID, 'units', timeunit))1600 call nf90_err(nf90_put_att(ncid, tID, 'calendar', 'proleptic_gregorian'))1601 timeID = tID1602 1603 ! lon1604 call nf90_err(nf90_def_var(ncid, 'longitude', nf90_float, (/ lonDimID /), lonID))1605 call nf90_err(nf90_put_att(ncid, lonID, 'long_name', 'longitude in degree east'))1606 call nf90_err(nf90_put_att(ncid, lonID, 'axis', 'Lon'))1607 call nf90_err(nf90_put_att(ncid, lonID, 'units', 'degrees_east'))1608 call nf90_err(nf90_put_att(ncid, lonID, 'standard_name', 'grid_longitude'))1609 call nf90_err(nf90_put_att(ncid, lonID, 'description', 'grid cell centers'))1610 1611 ! lat1612 call nf90_err(nf90_def_var(ncid, 'latitude', nf90_float, (/ latDimID /), latID))1613 call nf90_err(nf90_put_att(ncid, latID, 'long_name', 'latitude in degree north'))1614 call nf90_err(nf90_put_att(ncid, latID, 'axis', 'Lat'))1615 call nf90_err(nf90_put_att(ncid, latID, 'units', 'degrees_north'))1616 call nf90_err(nf90_put_att(ncid, latID, 'standard_name', 'grid_latitude'))1617 call nf90_err(nf90_put_att(ncid, latID, 'description', 'grid cell centers'))1618 1619 ! height1620 call nf90_err(nf90_def_var(ncid, 'height', nf90_float, (/ levDimID /), levID))1621 call nf90_err(nf90_put_att(ncid, levID, 'units', 'meters'))1622 call nf90_err(nf90_put_att(ncid, levID, 'positive', 'up'))1623 call nf90_err(nf90_put_att(ncid, levID, 'standard_name', 'height'))1624 1625 if (.not.allocated(coord)) allocate(coord(numxgrid))1626 do i = 1,numxgrid1627 coord(i) = outlon0 + (i-0.5)*dxout1628 enddo1629 call nf90_err(nf90_put_var(ncid, lonID, coord(1:numxgrid)))1630 deallocate(coord)1631 if (.not.allocated(coord)) allocate(coord(numygrid))1632 do i = 1,numygrid1633 coord(i) = outlat0 + (i-0.5)*dyout1634 enddo1635 call nf90_err(nf90_put_var(ncid, latID, coord(1:numygrid)))1636 deallocate(coord)1637 call nf90_err(nf90_put_var(ncid, levID, outheight(1:numzgrid)))1638 1639 ! write time, one field per time - different to the others!1640 call nf90_err(nf90_put_var( ncid, timeID, itime, (/ 1 /)))1641 1642 dIDs = (/ londimid, latdimid, levdimid, timedimid, pointspecdimid, nageclassdimid /)1643 1644 do ks=1,nspec1645 do kp=1,maxpointspec_act1646 do nage=1,nageclass1647 1648 write(anspec,'(i3.3)') ks1649 1650 ! East Flux1651 call nf90_err(nf90_def_var(ncid,'flux_east_'//anspec, nf90_float, dIDs, &1652 fluxID))1653 1654 do jy=0,numygrid-11655 do ix=0,numxgrid-11656 do kz=1, numzgrid1657 grid(ix,jy,kz)=flux(1,ix,jy,kz,ks,kp,nage)1658 end do1659 end do1660 end do1661 1662 call nf90_err(nf90_put_var(ncid,fluxid,1.e12*grid(0:numxgrid-1,0:numygrid-1,1:numzgrid)&1663 /areaeast(0:numxgrid-1,0:numygrid-1,1:numzgrid)/loutstep,&1664 (/ 1,1,1,1,kp,nage /), (/ numxgrid,numygrid,numzgrid,1,1,1 /) ))1665 1666 ! West Flux1667 call nf90_err(nf90_def_var(ncid,'flux_west_'//anspec, nf90_float, dIDs, &1668 fluxID))1669 1670 do jy=0,numygrid-11671 do ix=0,numxgrid-11672 do kz=1, numzgrid1673 grid(ix,jy,kz)=flux(2,ix,jy,kz,ks,kp,nage)1674 end do1675 end do1676 end do1677 1678 call nf90_err(nf90_put_var(ncid,fluxid,1.e12*grid(0:numxgrid-1,0:numygrid-1,1:numzgrid)&1679 /areaeast(0:numxgrid-1,0:numygrid-1,1:numzgrid)/loutstep,&1680 (/ 1,1,1,1,kp,nage /), (/ numxgrid,numygrid,numzgrid,1,1,1 /) ))1681 1682 ! North Flux1683 call nf90_err(nf90_def_var(ncid,'flux_north_'//anspec, nf90_float, dIDs, &1684 fluxID))1685 1686 do jy=0,numygrid-11687 do ix=0,numxgrid-11688 do kz=1, numzgrid1689 grid(ix,jy,kz)=flux(4,ix,jy,kz,ks,kp,nage)1690 end do1691 end do1692 end do1693 1694 call nf90_err(nf90_put_var(ncid,fluxid,1.e12*grid(0:numxgrid-1,0:numygrid-1,1:numzgrid)&1695 /areanorth(0:numxgrid-1,0:numygrid-1,1:numzgrid)/loutstep,&1696 (/ 1,1,1,1,kp,nage /), (/ numxgrid,numygrid,numzgrid,1,1,1 /) ))1697 1698 ! South Flux1699 call nf90_err(nf90_def_var(ncid,'flux_south_'//anspec, nf90_float, dIDs, &1700 fluxID))1701 1702 do jy=0,numygrid-11703 do ix=0,numxgrid-11704 do kz=1, numzgrid1705 grid(ix,jy,kz)=flux(3,ix,jy,kz,ks,kp,nage)1706 end do1707 end do1708 end do1709 1710 call nf90_err(nf90_put_var(ncid,fluxid,1.e12*grid(0:numxgrid-1,0:numygrid-1,1:numzgrid)&1711 /areanorth(0:numxgrid-1,0:numygrid-1,1:numzgrid)/loutstep,&1712 (/ 1,1,1,1,kp,nage /), (/ numxgrid,numygrid,numzgrid,1,1,1 /) ))1713 1714 ! Up Flux1715 call nf90_err(nf90_def_var(ncid,'flux_up_'//anspec, nf90_float, dIDs, &1716 fluxID))1717 1718 do jy=0,numygrid-11719 do ix=0,numxgrid-11720 do kz=1, numzgrid1721 grid(ix,jy,kz)=flux(5,ix,jy,kz,ks,kp,nage)/area(ix,jy)1722 end do1723 end do1724 end do1725 1726 call nf90_err(nf90_put_var(ncid,fluxid,1.e12*grid(0:numxgrid-1,0:numygrid-1,1:numzgrid)&1727 /loutstep,&1728 (/ 1,1,1,1,kp,nage /), (/ numxgrid,numygrid,numzgrid,1,1,1 /) ))1729 1730 ! Down Flux1731 call nf90_err(nf90_def_var(ncid,'flux_down_'//anspec, nf90_float, dIDs, &1732 fluxID))1733 1734 do jy=0,numygrid-11735 do ix=0,numxgrid-11736 do kz=1, numzgrid1737 grid(ix,jy,kz)=flux(6,ix,jy,kz,ks,kp,nage)/area(ix,jy)1738 end do1739 end do1740 end do1741 1742 call nf90_err(nf90_put_var(ncid,fluxid,1.e12*grid(0:numxgrid-1,0:numygrid-1,1:numzgrid)&1743 /loutstep,&1744 (/ 1,1,1,1,kp,nage /), (/ numxgrid,numygrid,numzgrid,1,1,1 /) ))1745 1746 end do1747 end do1748 end do1749 1750 ! Close netCDF file1751 call nf90_err(nf90_close(ncid))1752 1753 ! Reinitialization of grid1754 !*************************1755 1756 do ks=1,nspec1757 do kp=1,maxpointspec_act1758 do jy=0,numygrid-11759 do ix=0,numxgrid-11760 do kz=1,numzgrid1761 do nage=1,nageclass1762 do i=1,61763 flux(i,ix,jy,kz,ks,kp,nage)=0.1764 end do1765 end do1766 end do1767 end do1768 end do1769 end do1770 end do1771 1772 1773 end subroutine fluxoutput_netcdf1774 1775 1522 end module netcdf_output_mod 1776 1523 -
src/readspecies.f90
r03adec6 r92fab65 42 42 implicit none 43 43 44 integer :: i, pos_spec,j ,icheck_dow_hour44 integer :: i, pos_spec,j 45 45 integer :: idow,ihour,id_spec 46 46 character(len=3) :: aspecnumb … … 229 229 ohnconst(pos_spec)=pohnconst 230 230 231 232 icheck_dow_hour=0233 231 do j=1,24 ! 24 hours, starting with 0-1 local time 234 232 area_hour(pos_spec,j)=parea_hour(j) 235 233 point_hour(pos_spec,j)=ppoint_hour(j) 236 if (parea_hour(j).ne.1 .or. ppoint_hour(j).ne.1) icheck_dow_hour=1237 234 end do 238 235 do j=1,7 ! 7 days of the week, starting with Monday 239 236 area_dow(pos_spec,j)=parea_dow(j) 240 237 point_dow(pos_spec,j)=ppoint_dow(j) 241 if (parea_dow(j).ne.1 .or. ppoint_dow(j).ne.1) icheck_dow_hour=1242 238 end do 243 239 … … 361 357 20 continue 362 358 363 if ((icheck_dow_hour.eq.1).and.(ldirect.lt.0)) then364 write(*,*) '#### FLEXPART MODEL WARNING ####'365 write(*,*) '#### The variation for an emission release ####'366 write(*,*) '#### will have no effect in backward mode ####'367 endif368 359 369 360 22 close(unitspecies) -
src/timemanager.f90
rf3054ea rf3054ea 85 85 #ifdef USE_NCF 86 86 use netcdf_output_mod, only: concoutput_netcdf,concoutput_nest_netcdf,& 87 &concoutput_surf_netcdf,concoutput_surf_nest_netcdf ,fluxoutput_netcdf87 &concoutput_surf_netcdf,concoutput_surf_nest_netcdf 88 88 #endif 89 89 … … 433 433 endif 434 434 if ((iout.eq.4).or.(iout.eq.5)) call plumetraj(itime) 435 if ((iflux.eq.1).and.(lnetcdfout.eq.0)) call fluxoutput(itime) 436 #ifdef USE_NCF 437 if ((iflux.eq.1).and.(lnetcdfout.eq.1)) call fluxoutput_netcdf(itime) 438 #endif 435 if (iflux.eq.1) call fluxoutput(itime) 439 436 write(*,45) itime,numpart,gridtotalunc,wetgridtotalunc,drygridtotalunc 440 437 -
src/timemanager_mpi.f90
rf06b72a rf06b72a 556 556 endif 557 557 if ((iout.eq.4).or.(iout.eq.5)) call plumetraj(itime) 558 if ((iflux.eq.1).and.(lnetcdfout.eq.0)) call fluxoutput(itime) 559 if ((iflux.eq.1).and.(lnetcdfout.eq.1)) call fluxoutput_netcdf(itime) 558 if (iflux.eq.1) call fluxoutput(itime) 560 559 if (mp_measure_time) call mpif_mtime('iotime',1) 561 560
Note: See TracChangeset
for help on using the changeset viewer.