Commit 7e9777f5 authored by ronesy's avatar ronesy
Browse files

modified output format for inversion and included output of ratio of air_density to dry_air_density

parent 4c64400c
&COMMAND &COMMAND
LDIRECT= 1, LDIRECT= -1,
IBDATE= 20140907, IBDATE= 20101222,
IBTIME= 060000, IBTIME= 000000,
IEDATE= 20140907, IEDATE= 20110103,
IETIME= 120000, IETIME= 000000,
LOUTSTEP= 3600, LOUTSTEP= 86400,
LOUTAVER= 3600, LOUTAVER= 86400,
LOUTSAMPLE= 900, LOUTSAMPLE= 1800,
ITSPLIT= 99999999, ITSPLIT= 999999999,
LSYNCTIME= 900, LSYNCTIME= 600,
CTL= -5.0000000 , CTL= -5.00,
IFINE= 4, IFINE= 4,
IOUT= 9, IOUT= 1,
IPOUT= 0, IPOUT= 2,
LSUBGRID= 1, LSUBGRID= 1,
LCONVECTION= 1, LCONVECTION= 1,
LAGESPECTRA= 0, LAGESPECTRA= 1,
IPIN= 0, IPIN= 0,
IOUTPUTFOREACHRELEASE= 0, IOUTPUTFOREACHRELEASE= 1,
IFLUX= 0, IFLUX= 0,
MDOMAINFILL= 0, MDOMAINFILL= 0,
IND_SOURCE= 1, IND_SOURCE= 1,
IND_RECEPTOR= 1, IND_RECEPTOR= 2,
MQUASILAG= 0, MQUASILAG= 0,
NESTED_OUTPUT= 1, NESTED_OUTPUT= 0,
LINIT_COND= 0, LINIT_COND= 2,
SURF_ONLY= 0, SURF_ONLY= 1,
CBLFLAG= 0, LINVERSIONOUT= 1,
OHFIELDS_PATH= "../../flexin/", OHFIELDS_PATH= "/xnilu_wrk/rlt/NILU/FLEXDATA/",
/ /
&SPECIES_PARAMS
PSPECIES="C-CO2 ",
PWEIGHTMOLAR= 12.0000000 ,
/
grep Tra SPEC* SPECIES_001: PSPECIES=TRACER
SPECIES_002: PSPECIES=O3
SPECIES_003: PSPECIES=NO
SPECIES_004: PSPECIES=NO2
SPECIES_005: PSPECIES=HNO3
SPECIES_006: PSPECIES=HNO2
SPECIES_007: PSPECIES=H2O2
SPECIES_009: PSPECIES=HCHO
SPECIES_010: PSPECIES=PAN
SPECIES_011: PSPECIES=NH3
SPECIES_012: PSPECIES=SO4-aero
SPECIES_013: PSPECIES=NO3-aero
SPECIES_014: PSPECIES=I2-131
SPECIES_015: PSPECIES=I-131
SPECIES_016: PSPECIES=Cs-137
SPECIES_017: PSPECIES=Y-91
SPECIES_018: PSPECIES=Ru-106
SPECIES_019: PSPECIES=Kr-85
SPECIES_020: PSPECIES=Sr-90
SPECIES_021: PSPECIES=Xe-133
SPECIES_022: PSPECIES=CO
SPECIES_023: PSPECIES=SO2dryOH
SPECIES_024: PSPECIES=AIRTRACER
SPECIES_025: PSPECIES=AERO-TRACE
SPECIES_026: PSPECIES=CH4
SPECIES_027: PSPECIES=C2H6
SPECIES_028: PSPECIES=C3H8
SPECIES_029: PSPECIES=C-CO2
SPECIES_031: PSPECIES=PCB28
SPECIES_034: PSPECIES=G-HCH
...@@ -220,6 +220,11 @@ subroutine advance(itime,nrelpoint,ldt,up,vp,wp, & ...@@ -220,6 +220,11 @@ subroutine advance(itime,nrelpoint,ldt,up,vp,wp, &
endif endif
ixp=ix+1 ixp=ix+1
jyp=jy+1 jyp=jy+1
! fix (Espen 02.05.2017)
if(jyp>=nymax) then
write(*,*) 'WARNING: advance.f90 jyp>nymax'
jyp=jyp-1
endif
! Compute maximum mixing height around particle position ! Compute maximum mixing height around particle position
......
...@@ -120,6 +120,9 @@ module com_mod ...@@ -120,6 +120,9 @@ module com_mod
integer :: lnetcdfout integer :: lnetcdfout
! lnetcdfout 1 for netcdf grid output, 0 if not. Set in COMMAND (namelist input) ! lnetcdfout 1 for netcdf grid output, 0 if not. Set in COMMAND (namelist input)
integer :: linversionout
! linversionout 1 for one grid_time output file for each release containing all timesteps
integer :: nageclass,lage(maxageclass) integer :: nageclass,lage(maxageclass)
! nageclass number of ageclasses for the age spectra calculation ! nageclass number of ageclasses for the age spectra calculation
...@@ -356,7 +359,9 @@ module com_mod ...@@ -356,7 +359,9 @@ module com_mod
real :: clwc(0:nxmax-1,0:nymax-1,nzmax,numwfmem)=0.0 !liquid [kg/kg] real :: clwc(0:nxmax-1,0:nymax-1,nzmax,numwfmem)=0.0 !liquid [kg/kg]
real :: ciwc(0:nxmax-1,0:nymax-1,nzmax,numwfmem)=0.0 !ice [kg/kg] real :: ciwc(0:nxmax-1,0:nymax-1,nzmax,numwfmem)=0.0 !ice [kg/kg]
real :: clw(0:nxmax-1,0:nymax-1,nzmax,numwfmem)=0.0 !combined [m3/m3] real :: clw(0:nxmax-1,0:nymax-1,nzmax,numwfmem)=0.0 !combined [m3/m3]
! RLT add pressure and dry air density
real :: prs(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
real :: rho_dry(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
real :: pv(0:nxmax-1,0:nymax-1,nzmax,numwfmem) real :: pv(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
real :: rho(0:nxmax-1,0:nymax-1,nzmax,numwfmem) real :: rho(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
real :: drhodz(0:nxmax-1,0:nymax-1,nzmax,numwfmem) real :: drhodz(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
...@@ -378,6 +383,7 @@ module com_mod ...@@ -378,6 +383,7 @@ module com_mod
! uu,vv,ww [m/2] wind components in x,y and z direction ! uu,vv,ww [m/2] wind components in x,y and z direction
! uupol,vvpol [m/s] wind components in polar stereographic projection ! uupol,vvpol [m/s] wind components in polar stereographic projection
! tt [K] temperature data ! tt [K] temperature data
! prs air pressure
! qv specific humidity data ! qv specific humidity data
! pv (pvu) potential vorticity ! pv (pvu) potential vorticity
! rho [kg/m3] air density ! rho [kg/m3] air density
......
...@@ -100,6 +100,11 @@ subroutine conccalc(itime,weight) ...@@ -100,6 +100,11 @@ subroutine conccalc(itime,weight)
jy=int(ytra1(i)) jy=int(ytra1(i))
ixp=ix+1 ixp=ix+1
jyp=jy+1 jyp=jy+1
! fix (Espen 02.05.2017)
if(jyp>=nymax) then
write(*,*) 'WARNING: conccalc.f90 jyp>nymax'
jyp=jyp-1
endif
ddx=xtra1(i)-real(ix) ddx=xtra1(i)-real(ix)
ddy=ytra1(i)-real(jy) ddy=ytra1(i)-real(jy)
rddx=1.-ddx rddx=1.-ddx
......
...@@ -71,6 +71,9 @@ subroutine concoutput(itime,outnum,gridtotalunc,wetgridtotalunc, & ...@@ -71,6 +71,9 @@ subroutine concoutput(itime,outnum,gridtotalunc,wetgridtotalunc, &
integer :: sp_count_i,sp_count_r integer :: sp_count_i,sp_count_r
real :: sp_fact real :: sp_fact
real :: outnum,densityoutrecept(maxreceptor),xl,yl real :: outnum,densityoutrecept(maxreceptor),xl,yl
! RLT
real :: densitydryrecept(maxreceptor)
real :: factor_dryrecept(maxreceptor)
!real densityoutgrid(0:numxgrid-1,0:numygrid-1,numzgrid), !real densityoutgrid(0:numxgrid-1,0:numygrid-1,numzgrid),
! +grid(0:numxgrid-1,0:numygrid-1,numzgrid,maxspec,maxpointspec_act, ! +grid(0:numxgrid-1,0:numygrid-1,numzgrid,maxspec,maxpointspec_act,
...@@ -105,6 +108,7 @@ subroutine concoutput(itime,outnum,gridtotalunc,wetgridtotalunc, & ...@@ -105,6 +108,7 @@ subroutine concoutput(itime,outnum,gridtotalunc,wetgridtotalunc, &
! mind eso:added to ensure identical results between 2&3-fields versions ! mind eso:added to ensure identical results between 2&3-fields versions
character(LEN=8),save :: file_stat='REPLACE' character(LEN=8),save :: file_stat='REPLACE'
logical :: ldates_file logical :: ldates_file
logical :: lexist
integer :: ierr integer :: ierr
character(LEN=100) :: dates_char character(LEN=100) :: dates_char
...@@ -200,6 +204,9 @@ subroutine concoutput(itime,outnum,gridtotalunc,wetgridtotalunc, & ...@@ -200,6 +204,9 @@ subroutine concoutput(itime,outnum,gridtotalunc,wetgridtotalunc, &
! rho(iix,jjy,kzz-1,2)*dz2)/dz ! rho(iix,jjy,kzz-1,2)*dz2)/dz
densityoutgrid(ix,jy,kz)=(rho(iix,jjy,kzz,mind)*dz1+ & densityoutgrid(ix,jy,kz)=(rho(iix,jjy,kzz,mind)*dz1+ &
rho(iix,jjy,kzz-1,mind)*dz2)/dz rho(iix,jjy,kzz-1,mind)*dz2)/dz
! RLT
densitydrygrid(ix,jy,kz)=(rho_dry(iix,jjy,kzz,mind)*dz1+ &
rho_dry(iix,jjy,kzz-1,mind)*dz2)/dz
end do end do
end do end do
end do end do
...@@ -211,8 +218,14 @@ subroutine concoutput(itime,outnum,gridtotalunc,wetgridtotalunc, & ...@@ -211,8 +218,14 @@ subroutine concoutput(itime,outnum,gridtotalunc,wetgridtotalunc, &
jjy=max(min(nint(yl),nymin1),0) jjy=max(min(nint(yl),nymin1),0)
!densityoutrecept(i)=rho(iix,jjy,1,2) !densityoutrecept(i)=rho(iix,jjy,1,2)
densityoutrecept(i)=rho(iix,jjy,1,mind) densityoutrecept(i)=rho(iix,jjy,1,mind)
! RLT
densitydryrecept(i)=rho_dry(iix,jjy,1,mind)
end do end do
! RLT
! conversion factor for output relative to dry air
factor_drygrid=densityoutgrid/densitydrygrid
factor_dryrecept=densityoutrecept/densitydryrecept
! Output is different for forward and backward simulations ! Output is different for forward and backward simulations
do kz=1,numzgrid do kz=1,numzgrid
...@@ -351,7 +364,7 @@ subroutine concoutput(itime,outnum,gridtotalunc,wetgridtotalunc, & ...@@ -351,7 +364,7 @@ subroutine concoutput(itime,outnum,gridtotalunc,wetgridtotalunc, &
if ((ldirect.eq.1).and.(WETDEP)) then if ((ldirect.eq.1).and.(WETDEP)) then
do jy=0,numygrid-1 do jy=0,numygrid-1
do ix=0,numxgrid-1 do ix=0,numxgrid-1
!oncentraion greater zero !concentraion greater zero
if (wetgrid(ix,jy).gt.smallnum) then if (wetgrid(ix,jy).gt.smallnum) then
if (sp_zer.eqv..true.) then ! first non zero value if (sp_zer.eqv..true.) then ! first non zero value
sp_count_i=sp_count_i+1 sp_count_i=sp_count_i+1
...@@ -594,6 +607,49 @@ subroutine concoutput(itime,outnum,gridtotalunc,wetgridtotalunc, & ...@@ -594,6 +607,49 @@ subroutine concoutput(itime,outnum,gridtotalunc,wetgridtotalunc, &
end do end do
! RLT Aug 2017
! Write out conversion factor for dry air
inquire(file=path(2)(1:length(2))//'factor_drygrid',exist=lexist)
if (lexist) then
! open and append
open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid',form='unformatted',&
status='old',action='write',access='append')
else
! create new
open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid',form='unformatted',&
status='new',action='write')
endif
sp_count_i=0
sp_count_r=0
sp_fact=-1.
sp_zer=.true.
do kz=1,numzgrid
do jy=0,numygrid-1
do ix=0,numxgrid-1
if (factor_drygrid(ix,jy,kz).gt.(1.+smallnum).or.factor_drygrid(ix,jy,kz).lt.(1.-smallnum)) then
if (sp_zer.eqv..true.) then ! first value not equal to one
sp_count_i=sp_count_i+1
sparse_dump_i(sp_count_i)= &
ix+jy*numxgrid+kz*numxgrid*numygrid
sp_zer=.false.
sp_fact=sp_fact*(-1.)
endif
sp_count_r=sp_count_r+1
sparse_dump_r(sp_count_r)= &
sp_fact*factor_drygrid(ix,jy,kz)
else ! factor is one
sp_zer=.true.
endif
end do
end do
end do
write(unitoutfactor) sp_count_i
write(unitoutfactor) (sparse_dump_i(i),i=1,sp_count_i)
write(unitoutfactor) sp_count_r
write(unitoutfactor) (sparse_dump_r(i),i=1,sp_count_r)
close(unitoutfactor)
if (gridtotal.gt.0.) gridtotalunc=gridsigmatotal/gridtotal if (gridtotal.gt.0.) gridtotalunc=gridsigmatotal/gridtotal
if (wetgridtotal.gt.0.) wetgridtotalunc=wetgridsigmatotal/ & if (wetgridtotal.gt.0.) wetgridtotalunc=wetgridsigmatotal/ &
wetgridtotal wetgridtotal
...@@ -620,7 +676,23 @@ subroutine concoutput(itime,outnum,gridtotalunc,wetgridtotalunc, & ...@@ -620,7 +676,23 @@ subroutine concoutput(itime,outnum,gridtotalunc,wetgridtotalunc, &
end do end do
endif endif
! RLT Aug 2017
! Write out conversion factor for dry air
if (numreceptor.gt.0) then
inquire(file=path(2)(1:length(2))//'factor_dryreceptor',exist=lexist)
if (lexist) then
! open and append
open(unitoutfactor,file=path(2)(1:length(2))//'factor_dryreceptor',form='unformatted',&
status='old',action='write',access='append')
else
! create new
open(unitoutfactor,file=path(2)(1:length(2))//'factor_dryreceptor',form='unformatted',&
status='new',action='write')
endif
write(unitoutfactor) itime
write(unitoutfactor) (factor_dryrecept(i),i=1,numreceptor)
close(unitoutfactor)
endif
! Reinitialization of grid ! Reinitialization of grid
!************************* !*************************
......
This diff is collapsed.
This diff is collapsed.
...@@ -69,6 +69,9 @@ subroutine concoutput_nest(itime,outnum) ...@@ -69,6 +69,9 @@ subroutine concoutput_nest(itime,outnum)
integer :: sp_count_i,sp_count_r integer :: sp_count_i,sp_count_r
real :: sp_fact real :: sp_fact
real :: outnum,densityoutrecept(maxreceptor),xl,yl real :: outnum,densityoutrecept(maxreceptor),xl,yl
! RLT
real :: densitydryrecept(maxreceptor)
real :: factor_dryrecept(maxreceptor)
!real densityoutgrid(0:numxgrid-1,0:numygrid-1,numzgrid), !real densityoutgrid(0:numxgrid-1,0:numygrid-1,numzgrid),
! +grid(0:numxgrid-1,0:numygrid-1,numzgrid,maxspec,maxpointspec_act, ! +grid(0:numxgrid-1,0:numygrid-1,numzgrid,maxspec,maxpointspec_act,
...@@ -95,6 +98,7 @@ subroutine concoutput_nest(itime,outnum) ...@@ -95,6 +98,7 @@ subroutine concoutput_nest(itime,outnum)
logical :: sp_zer logical :: sp_zer
character :: adate*8,atime*6 character :: adate*8,atime*6
character(len=3) :: anspec character(len=3) :: anspec
logical :: lexist
integer :: mind integer :: mind
! mind eso:added to ensure identical results between 2&3-fields versions ! mind eso:added to ensure identical results between 2&3-fields versions
...@@ -163,6 +167,9 @@ subroutine concoutput_nest(itime,outnum) ...@@ -163,6 +167,9 @@ subroutine concoutput_nest(itime,outnum)
! rho(iix,jjy,kzz-1,2)*dz2)/dz ! rho(iix,jjy,kzz-1,2)*dz2)/dz
densityoutgrid(ix,jy,kz)=(rho(iix,jjy,kzz,mind)*dz1+ & densityoutgrid(ix,jy,kz)=(rho(iix,jjy,kzz,mind)*dz1+ &
rho(iix,jjy,kzz-1,mind)*dz2)/dz rho(iix,jjy,kzz-1,mind)*dz2)/dz
! RLT
densitydrygrid(ix,jy,kz)=(rho_dry(iix,jjy,kzz,mind)*dz1+ &
rho_dry(iix,jjy,kzz-1,mind)*dz2)/dz
end do end do
end do end do
end do end do
...@@ -174,8 +181,14 @@ subroutine concoutput_nest(itime,outnum) ...@@ -174,8 +181,14 @@ subroutine concoutput_nest(itime,outnum)
jjy=max(min(nint(yl),nymin1),0) jjy=max(min(nint(yl),nymin1),0)
!densityoutrecept(i)=rho(iix,jjy,1,2) !densityoutrecept(i)=rho(iix,jjy,1,2)
densityoutrecept(i)=rho(iix,jjy,1,mind) densityoutrecept(i)=rho(iix,jjy,1,mind)
! RLT
densitydryrecept(i)=rho_dry(iix,jjy,1,mind)
end do end do
! RLT
! conversion factor for output relative to dry air
factor_drygrid=densityoutgrid/densitydrygrid
factor_dryrecept=densityoutrecept/densitydryrecept
! Output is different for forward and backward simulations ! Output is different for forward and backward simulations
do kz=1,numzgrid do kz=1,numzgrid
...@@ -539,6 +552,47 @@ subroutine concoutput_nest(itime,outnum) ...@@ -539,6 +552,47 @@ subroutine concoutput_nest(itime,outnum)
end do end do
! RLT Aug 2017
! Write out conversion factor for dry air
inquire(file=path(2)(1:length(2))//'factor_drygrid_nest',exist=lexist)
if (lexist) then
! open and append
open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid_nest',form='unformatted',&
status='old',action='write',access='append')
else
! create new
open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid_nest',form='unformatted',&
status='new',action='write')
endif
sp_count_i=0
sp_count_r=0
sp_fact=-1.
sp_zer=.true.
do kz=1,numzgrid
do jy=0,numygridn-1
do ix=0,numxgridn-1
if (factor_drygrid(ix,jy,kz).gt.(1.+smallnum).or.factor_drygrid(ix,jy,kz).lt.(1.-smallnum)) then
if (sp_zer.eqv..true.) then ! first value not equal to one
sp_count_i=sp_count_i+1
sparse_dump_i(sp_count_i)= &
ix+jy*numxgridn+kz*numxgridn*numygridn
sp_zer=.false.
sp_fact=sp_fact*(-1.)
endif
sp_count_r=sp_count_r+1
sparse_dump_r(sp_count_r)= &
sp_fact*factor_drygrid(ix,jy,kz)
else ! factor is one
sp_zer=.true.
endif
end do
end do
end do
write(unitoutfactor) sp_count_i
write(unitoutfactor) (sparse_dump_i(i),i=1,sp_count_i)
write(unitoutfactor) sp_count_r
write(unitoutfactor) (sparse_dump_r(i),i=1,sp_count_r)
close(unitoutfactor)
! Reinitialization of grid ! Reinitialization of grid
......
...@@ -71,6 +71,9 @@ subroutine concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc, & ...@@ -71,6 +71,9 @@ subroutine concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc, &
integer :: sp_count_i,sp_count_r integer :: sp_count_i,sp_count_r
real :: sp_fact real :: sp_fact
real :: outnum,densityoutrecept(maxreceptor),xl,yl real :: outnum,densityoutrecept(maxreceptor),xl,yl
! RLT
real :: densitydryrecept(maxreceptor)
real :: factor_dryrecept(maxreceptor)
!real densityoutgrid(0:numxgrid-1,0:numygrid-1,numzgrid), !real densityoutgrid(0:numxgrid-1,0:numygrid-1,numzgrid),
! +grid(0:numxgrid-1,0:numygrid-1,numzgrid,maxspec,maxpointspec_act, ! +grid(0:numxgrid-1,0:numygrid-1,numzgrid,maxspec,maxpointspec_act,
...@@ -100,6 +103,7 @@ subroutine concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc, & ...@@ -100,6 +103,7 @@ subroutine concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc, &
logical :: sp_zer logical :: sp_zer
character :: adate*8,atime*6 character :: adate*8,atime*6
character(len=3) :: anspec character(len=3) :: anspec
logical :: lexist
if (verbosity.eq.1) then if (verbosity.eq.1) then
...@@ -179,6 +183,9 @@ subroutine concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc, & ...@@ -179,6 +183,9 @@ subroutine concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc, &
jjy=max(min(nint(yl),nymin1),0) jjy=max(min(nint(yl),nymin1),0)
densityoutgrid(ix,jy,kz)=(rho(iix,jjy,kzz,2)*dz1+ & densityoutgrid(ix,jy,kz)=(rho(iix,jjy,kzz,2)*dz1+ &
rho(iix,jjy,kzz-1,2)*dz2)/dz rho(iix,jjy,kzz-1,2)*dz2)/dz
! RLT
densitydrygrid(ix,jy,kz)=(rho_dry(iix,jjy,kzz,2)*dz1+ &
rho_dry(iix,jjy,kzz-1,2)*dz2)/dz
end do end do
end do end do
end do end do
...@@ -189,8 +196,14 @@ subroutine concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc, & ...@@ -189,8 +196,14 @@ subroutine concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc, &
iix=max(min(nint(xl),nxmin1),0) iix=max(min(nint(xl),nxmin1),0)
jjy=max(min(nint(yl),nymin1),0) jjy=max(min(nint(yl),nymin1),0)
densityoutrecept(i)=rho(iix,jjy,1,2) densityoutrecept(i)=rho(iix,jjy,1,2)
! RLT
densitydryrecept(i)=rho_dry(iix,jjy,1,2)
end do end do
! RLT
! conversion factor for output relative to dry air
factor_drygrid=densityoutgrid/densitydrygrid
factor_dryrecept=densityoutrecept/densitydryrecept
! Output is different for forward and backward simulations ! Output is different for forward and backward simulations
do kz=1,numzgrid do kz=1,numzgrid
...@@ -459,6 +472,7 @@ subroutine concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc, & ...@@ -459,6 +472,7 @@ subroutine concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc, &
write(unitoutgrid) (sparse_dump_i(i),i=1,sp_count_i) write(unitoutgrid) (sparse_dump_i(i),i=1,sp_count_i)
write(unitoutgrid) sp_count_r write(unitoutgrid) sp_count_r
write(unitoutgrid) (sparse_dump_r(i),i=1,sp_count_r) write(unitoutgrid) (sparse_dump_r(i),i=1,sp_count_r)
! write(unitoutgrid) sp_count_r
! write(unitoutgrid) (sparse_dump_u(i),i=1,sp_count_r) ! write(unitoutgrid) (sparse_dump_u(i),i=1,sp_count_r)
endif ! concentration output endif ! concentration output
...@@ -503,6 +517,7 @@ subroutine concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc, & ...@@ -503,6 +517,7 @@ subroutine concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc, &
write(unitoutgridppt) (sparse_dump_i(i),i=1,sp_count_i) write(unitoutgridppt) (sparse_dump_i(i),i=1,sp_count_i)
write(unitoutgridppt) sp_count_r write(unitoutgridppt) sp_count_r
write(unitoutgridppt) (sparse_dump_r(i),i=1,sp_count_r) write(unitoutgridppt) (sparse_dump_r(i),i=1,sp_count_r)
! write(unitoutgridppt) sp_count_r
! write(unitoutgridppt) (sparse_dump_u(i),i=1,sp_count_r) ! write(unitoutgridppt) (sparse_dump_u(i),i=1,sp_count_r)
...@@ -595,6 +610,49 @@ subroutine concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc, & ...@@ -595,6 +610,49 @@ subroutine concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc, &
end do end do
! RLT Aug 2017
! Write out conversion factor for dry air
inquire(file=path(2)(1:length(2))//'factor_drygrid',exist=lexist)
if (lexist) then
! open and append
open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid',form='unformatted',&
status='old',action='write',access='append')
else
! create new
open(unitoutfactor,file=path(2)(1:length(2))//'factor_drygrid',form='unformatted',&
status='new',action='write')
endif
sp_count_i=0
sp_count_r=0
sp_fact=-1.
sp_zer=.true.
do kz=1,1
do jy=0,numygrid-1
do ix=0,numxgrid-1
if (factor_drygrid(ix,jy,kz).gt.(1.+smallnum).or.factor_drygrid(ix,jy,kz).lt.(1.-smallnum)) then
if (sp_zer.eqv..true.) then ! first value not equal to one
sp_count_i=sp_count_i+1
sparse_dump_i(sp_count_i)= &
ix+jy*numxgrid+kz*numxgrid*numygrid
sp_zer=.false.
sp_fact=sp_fact*(-1.)
endif
sp_count_r=sp_count_r+1
sparse_dump_r(sp_count_r)= &
sp_fact*factor_drygrid(ix,jy,kz)
else ! factor is one
sp_zer=.true.
endif
end do
end do
end do
write(unitoutfactor) sp_count_i
write(unitoutfactor) (sparse_dump_i(i),i=1,sp_count_i)
write(unitoutfactor) sp_count_r
write(unitoutfactor) (sparse_dump_r(i),i=1,sp_count_r)
close(unitoutfactor)
if (gridtotal.gt.0.) gridtotalunc=gridsigmatotal/gridtotal if (gridtotal.gt.0.) gridtotalunc=gridsigmatotal/gridtotal
if (wetgridtotal.gt.0.) wetgridtotalunc=wetgridsigmatotal/ & if (wetgridtotal.gt.0.) wetgridtotalunc=wetgridsigmatotal/ &
wetgridtotal wetgridtotal
...@@ -621,7 +679,23 @@ subroutine concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc, & ...@@ -621,7 +679,23 @@ subroutine concoutput_surf(itime,outnum,gridtotalunc,wetgridtotalunc, &
end do end do
endif endif
! RLT Aug 2017
! Write out conversion factor for dry air
if (numreceptor.gt.0) then