Changes in src/concoutput_nest_mpi.f90 [92fab65:f3054ea] in flexpart.git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/concoutput_nest_mpi.f90
r92fab65 rf3054ea 1 ! SPDX-FileCopyrightText: FLEXPART 1998-2019, see flexpart_license.txt 2 ! SPDX-License-Identifier: GPL-3.0-or-later 1 !********************************************************************** 2 ! Copyright 1998,1999,2000,2001,2002,2005,2007,2008,2009,2010 * 3 ! Andreas Stohl, Petra Seibert, A. Frank, Gerhard Wotawa, * 4 ! Caroline Forster, Sabine Eckhardt, John Burkhart, Harald Sodemann * 5 ! * 6 ! This file is part of FLEXPART. * 7 ! * 8 ! FLEXPART is free software: you can redistribute it and/or modify * 9 ! it under the terms of the GNU General Public License as published by* 10 ! the Free Software Foundation, either version 3 of the License, or * 11 ! (at your option) any later version. * 12 ! * 13 ! FLEXPART is distributed in the hope that it will be useful, * 14 ! but WITHOUT ANY WARRANTY; without even the implied warranty of * 15 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 16 ! GNU General Public License for more details. * 17 ! * 18 ! You should have received a copy of the GNU General Public License * 19 ! along with FLEXPART. If not, see <http://www.gnu.org/licenses/>. * 20 !********************************************************************** 3 21 4 22 subroutine concoutput_nest(itime,outnum) … … 39 57 ! * 40 58 !***************************************************************************** 41 42 59 43 60 use unc_mod … … 56 73 real :: sp_fact 57 74 real :: outnum,densityoutrecept(maxreceptor),xl,yl 75 ! RLT 76 real :: densitydryrecept(maxreceptor) 77 real :: factor_dryrecept(maxreceptor) 58 78 59 79 !real densityoutgrid(0:numxgrid-1,0:numygrid-1,numzgrid), … … 82 102 character :: adate*8,atime*6 83 103 character(len=3) :: anspec 104 logical :: lexist 84 105 integer :: mind 85 106 ! mind eso:added to ensure identical results between 2&3-fields versions … … 158 179 densityoutgrid(ix,jy,kz)=(rho(iix,jjy,kzz,mind)*dz1+ & 159 180 rho(iix,jjy,kzz-1,mind)*dz2)/dz 181 ! RLT 182 densitydrygrid(ix,jy,kz)=(rho_dry(iix,jjy,kzz,mind)*dz1+ & 183 rho_dry(iix,jjy,kzz-1,mind)*dz2)/dz 160 184 end do 161 185 end do … … 169 193 !densityoutrecept(i)=rho(iix,jjy,1,2) 170 194 densityoutrecept(i)=rho(iix,jjy,1,mind) 195 ! RLT 196 densitydryrecept(i)=rho_dry(iix,jjy,1,mind) 171 197 end do 172 198 199 ! RLT 200 ! conversion factor for output relative to dry air 201 factor_drygrid=densityoutgrid/densitydrygrid 202 factor_dryrecept=densityoutrecept/densitydryrecept 173 203 174 204 ! Output is different for forward and backward simulations … … 193 223 194 224 write(anspec,'(i3.3)') ks 225 226 if (DRYBKDEP.or.WETBKDEP) then !scavdep output 227 if (DRYBKDEP) & 228 open(unitoutgrid,file=path(2)(1:length(2))//'grid_drydep_nest_'//adate// & 229 atime//'_'//anspec,form='unformatted') 230 if (WETBKDEP) & 231 open(unitoutgrid,file=path(2)(1:length(2))//'grid_wetdep_nest_'//adate// & 232 atime//'_'//anspec,form='unformatted') 233 write(unitoutgrid) itime 234 else 195 235 if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5)) then 196 236 if (ldirect.eq.1) then … … 205 245 write(unitoutgrid) itime 206 246 endif 247 endif 207 248 208 249 if ((iout.eq.2).or.(iout.eq.3)) then ! mixing ratio … … 535 576 end do 536 577 537 538 539 ! Reinitialization of grid 540 !************************* 541 542 do ks=1,nspec 543 do kp=1,maxpointspec_act 544 do i=1,numreceptor 545 creceptor(i,ks)=0. 546 end do 547 do jy=0,numygridn-1 548 do ix=0,numxgridn-1 549 do l=1,nclassunc 550 do nage=1,nageclass 551 do kz=1,numzgrid 552 griduncn(ix,jy,kz,ks,kp,l,nage)=0. 553 end do 554 end do 555 end do 556 end do 578 ! RLT Aug 2017 579 ! Write out conversion factor for dry air 580 inquire(file=path(2)(1:length(2))//'factor_drygrid_nest',exist=lexist) 581 if (lexist) then 582 ! open and append 583 open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid_nest',form='unformatted',& 584 status='old',action='write',access='append') 585 else 586 ! create new 587 open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid_nest',form='unformatted',& 588 status='new',action='write') 589 endif 590 sp_count_i=0 591 sp_count_r=0 592 sp_fact=-1. 593 sp_zer=.true. 594 do kz=1,numzgrid 595 do jy=0,numygridn-1 596 do ix=0,numxgridn-1 597 if (factor_drygrid(ix,jy,kz).gt.(1.+smallnum).or.factor_drygrid(ix,jy,kz).lt.(1.-smallnum)) then 598 if (sp_zer.eqv..true.) then ! first value not equal to one 599 sp_count_i=sp_count_i+1 600 sparse_dump_i(sp_count_i)= & 601 ix+jy*numxgridn+kz*numxgridn*numygridn 602 sp_zer=.false. 603 sp_fact=sp_fact*(-1.) 604 endif 605 sp_count_r=sp_count_r+1 606 sparse_dump_r(sp_count_r)= & 607 sp_fact*factor_drygrid(ix,jy,kz) 608 else ! factor is one 609 sp_zer=.true. 610 endif 557 611 end do 558 612 end do 559 613 end do 560 614 write(unitoutfactor) sp_count_i 615 write(unitoutfactor) (sparse_dump_i(i),i=1,sp_count_i) 616 write(unitoutfactor) sp_count_r 617 write(unitoutfactor) (sparse_dump_r(i),i=1,sp_count_r) 618 close(unitoutfactor) 619 620 ! Reinitialization of grid 621 !************************* 622 623 ! do ks=1,nspec 624 ! do kp=1,maxpointspec_act 625 ! do i=1,numreceptor 626 ! creceptor(i,ks)=0. 627 ! end do 628 ! do jy=0,numygridn-1 629 ! do ix=0,numxgridn-1 630 ! do l=1,nclassunc 631 ! do nage=1,nageclass 632 ! do kz=1,numzgrid 633 ! griduncn(ix,jy,kz,ks,kp,l,nage)=0. 634 ! end do 635 ! end do 636 ! end do 637 ! end do 638 ! end do 639 ! end do 640 ! end do 641 creceptor(:,:)=0. 642 griduncn(:,:,:,:,:,:,:)=0. 643 561 644 if (mp_measure_time) call mpif_mtime('iotime',1) 562 645 ! if (mp_measure_time) then
Note: See TracChangeset
for help on using the changeset viewer.