Commit 3859d163 authored by dingwell's avatar dingwell
Browse files

Bugfix: volume was used even when volumen was supposed to.

Mainly a fix in netcdf_output_mod.F90 but it required updated calls in
the concoutput* subroutines.
parent d3b112c3
......@@ -377,7 +377,7 @@
if (option_verbose.ge.1) then
write(*,*) 'concoutput_irreg: Calling write_ncconc for main outgrid'
endif
call nc_write_output(itime,outnum,ks,kp,nage,tot_mu(ks,kp),densityoutrecept,0) ! 0= nest level
call nc_write_output(itime,outnum,ks,kp,nage,tot_mu(ks,kp),densityoutrecept,volume,0) ! 0= nest level
else ! binary or ascii output
! Concentration output
......
......@@ -314,7 +314,7 @@ subroutine concoutput_nest_irreg(itime,outnum)
if (option_verbose.ge.1) then
write(*,*) 'concoutput_nest_irreg: Calling write_ncconc for main outgrid'
endif
call nc_write_output(itime,outnum,ks,kp,nage,tot_mu(ks,kp),densityoutrecept,1) ! 1= nest level
call nc_write_output(itime,outnum,ks,kp,nage,tot_mu(ks,kp),densityoutrecept,volumen,1) ! 1= nest level
else ! binary or ascii output
! Concentration output
......
......@@ -310,7 +310,7 @@ subroutine concoutput_nest_reg(itime,outnum)
if (option_verbose.ge.1) then
write(*,*) 'concoutput_nest_reg: Calling write_ncconc for main outgrid'
endif
call nc_write_output(itime,outnum,ks,kp,nage,tot_mu(ks,kp),densityoutrecept,1) ! 1= nest level
call nc_write_output(itime,outnum,ks,kp,nage,tot_mu(ks,kp),densityoutrecept,volumen,1) ! 1= nest level
else ! binary or ascii output
! Concentration output
......
......@@ -393,7 +393,7 @@
if (option_verbose.ge.1) then
write(*,*) 'concoutput_reg: Calling write_ncconc for main outgrid'
endif
call nc_write_output(itime,outnum,ks,kp,nage,tot_mu(ks,kp),densityoutrecept,0) ! 0= nest level
call nc_write_output(itime,outnum,ks,kp,nage,tot_mu(ks,kp),densityoutrecept,volume,0) ! 0= nest level
else ! binary or ascii output
! Concentration output
......
......@@ -1453,7 +1453,7 @@ module netcdf_output_mod
deallocate(ncgrid_oro,ncgrid_area)
end subroutine nc_create_header_outfile
subroutine nc_write_output(itime,outnum,ks,kp,nage,tot_mu_scalar,rho_recept,nesting_level)
subroutine nc_write_output(itime,outnum,ks,kp,nage,tot_mu_scalar,rho_recept,grid_vol,nesting_level)
!*****************************************************************************
! *
! This routine writes concentration, mixing ratio and deposition fields *
......@@ -1477,6 +1477,9 @@ end subroutine nc_create_header_outfile
! 2015-05-04: A. Dingwell: Added receptor points to netcdf output *
! 2015-06-04: A. Dingwell: Updated subroutine to use NetCDF F90 module. *
! 2015-06-05: A. Dingwell: moved to module *
! 2015-07-02: A. Dingwell: Added grid_vol to list of input variables. Could *
! have been avoided with a pointer, but it's tricky (and not *
! very safe) to target an allocatable variable... *
!*****************************************************************************
real,intent(in) :: outnum ! Number of samples for each concentration calculation
integer,intent(in) :: itime ! Current simulation time [s]
......@@ -1485,6 +1488,7 @@ end subroutine nc_create_header_outfile
! or unity (forward). Should probably be sent as
! tot_mu(ks,kp) from concoutput*.f90
real,intent(in) :: rho_recept(maxreceptor) ! Air density at each receptor point (array)
real,intent(in) :: grid_vol(:,:,:) ! Volume of each grid cell (for current nest).
integer,intent(in) :: nesting_level ! 0 for main (parent) grid, 1 for nest (child)
real(kind=dp) :: jul ! Julian date
......@@ -1607,15 +1611,18 @@ end subroutine nc_create_header_outfile
endif ! concentraion
if ((iout.eq.2).or.(iout.eq.3)) then ! mixing ratio
if (option_verbose.ge.1)write(*,*)'write_ncconc: mixing ratio output'
if (option_verbose.ge.1) &
write(*,*)'write_ncconc: mixing ratio output',kp,nage,ncirec,ncravid,ncid
do kz=1,numzgrid
do jy=0,grid_ny-1
do ix=0,grid_nx-1
grid3(ix,jy,kz,kp,nage)= 1.e12*grid(ix,jy,kz)/volume(ix,jy,kz)/outnum* &
grid3(ix,jy,kz,kp,nage)= 1.e12*grid(ix,jy,kz)/grid_vol(ix,jy,kz)/outnum* &
weightair/weightmolar(ks)/densityoutgrid(ix,jy,kz)
enddo ! ix=1,grid_nx-1
enddo ! jy=1,grid_ny-1
enddo ! kz=1,numzgrid
if (option_verbose.ge.10) &
write(*,*)'write_ncconc: ldirect,ks,kp = ',ldirect,ks,kp
if (kp.eq.maxpointspec_act .and. nage.eq.nageclass) then
if (ldirect.eq.-1) then
ncret = NF90_PUT_VAR(ncid,ncravid, &
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment