Commit 5b63ee2e authored by dingwell's avatar dingwell
Browse files

Updated call to netcdf output subroutines

parent 7fd6c332
......@@ -376,7 +376,7 @@
if (option_verbose.ge.1) then
write(*,*) 'concoutput_irreg: Calling write_ncconc for main outgrid'
endif
call write_ncconc(itime,outnum,ks,kp,nage,tot_mu(ks,kp),densityoutrecept,0) ! 0= nest level
call nc_write_oputput(itime,outnum,ks,kp,nage,tot_mu(ks,kp),densityoutrecept,0) ! 0= nest level
else ! binary or ascii output
! Concentration output
......
......@@ -313,7 +313,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 write_ncconc(itime,outnum,ks,kp,nage,tot_mu(ks,kp),densityoutrecept,1) ! 1= nest level
call nc_write_oputput(itime,outnum,ks,kp,nage,tot_mu(ks,kp),densityoutrecept,1) ! 1= nest level
else ! binary or ascii output
! Concentration output
......
......@@ -309,7 +309,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 write_ncconc(itime,outnum,ks,kp,nage,tot_mu(ks,kp),densityoutrecept,1) ! 1= nest level
call nc_write_oputput(itime,outnum,ks,kp,nage,tot_mu(ks,kp),densityoutrecept,1) ! 1= nest level
else ! binary or ascii output
! Concentration output
......
......@@ -392,7 +392,7 @@
if (option_verbose.ge.1) then
write(*,*) 'concoutput_reg: Calling write_ncconc for main outgrid'
endif
call write_ncconc(itime,outnum,ks,kp,nage,tot_mu(ks,kp),densityoutrecept,0) ! 0= nest level
call nc_write_oputput(itime,outnum,ks,kp,nage,tot_mu(ks,kp),densityoutrecept,0) ! 0= nest level
else ! binary or ascii output
! Concentration output
......
......@@ -53,6 +53,8 @@
! land-use data from WRF *
! 2015-05-27 A. Dingwell: Now reads roughness length when landuse is read *
! from WRF. *
! 2015-06-05 A. Dingwell: Added module netcdf_output_mod, updated calls *
! new/renamed subroutines. *
! *
!*******************************************************************************
! *
......@@ -67,6 +69,7 @@
use par_mod
use com_mod
use conv_mod
use netcdf_output_mod ! Contains subroutines for netcdf output format
use luxury
use mt_stream
......@@ -240,8 +243,8 @@
call writeheader
if (nested_output.eq.1) call writeheader_nest() !need to be fixed
else ! netcdf output
call write_ncheader(0,0)
if (nested_output.eq.1) call write_ncheader(0,1)
call nc_create_header_outfile(0,0)
if (nested_output.eq.1) call nc_create_header_outfile(0,1)
endif !iouttype
! open(unitdates,file=path(2)(1:length(2))//'dates')
open(unitdates,file=path(1)(1:length(1))//'dates')
......
......@@ -54,6 +54,8 @@
! land-use data from WRF *
! 2015-05-27 A. Dingwell: Now reads roughness length when landuse is read *
! from WRF. *
! 2015-06-05 A. Dingwell: Added module netcdf_output_mod, updated calls *
! new/renamed subroutines. *
! *
!*******************************************************************************
! *
......@@ -68,6 +70,7 @@
use par_mod
use com_mod
use conv_mod
use netcdf_output_mod ! Contains subroutines for netcdf output format
!-- modules below added by mc for parallel random generaiton using teh RANLUX
!and Mersenne-Twister generator
......@@ -261,12 +264,8 @@
call writeheader
if (nested_output.eq.1) call writeheader_nest() !need to be fixed
else ! netcdf output
call write_ncheader(0,0)
if (nested_output.eq.1) call write_ncheader(0,1)
! if (nested_output.eq.1) then
! write(*,*) 'netcdf nested output not finished yet! aborting'
! stop
! endif
call nc_create_header_outfile(0,0)
if (nested_output.eq.1) call nc_create_header_outfile(0,1)
endif !iouttype
! open(unitdates,file=path(2)(1:length(2))//'dates')
open(unitdates,file=path(1)(1:length(1))//'dates')
......
......@@ -204,7 +204,7 @@ module netcdf_output_mod
ncret = NF90_PUT_ATT(ncid,NF90_GLOBAL,'DY',ncgrid_dy)
call check_ncerror(ncret)
end subroutine write_nc_global_attributes
end subroutine nc_write_global_attributes
subroutine nc_create_main_outfile(itime,nesting_level)
!*****************************************************************************
......@@ -1569,18 +1569,12 @@ end subroutine nc_create_header_outfile
!***********************************************
if (ncirec.eq.1) then ! First output in current file?
! write(*,*) 'itime=',itime
if ((ks.eq.1).and.(kp.eq.1).and.(nage.eq.1)) then
! if (itime.ne.loutstep) then ! Not the first output file?
! ncret=nf_close(ncid) ! close the old file
! call check_ncerror(ncret)
! print*,'file is closed'
! endif
! call write_ncheader(itime,nesting_level) ! Create new file
if (option_verbose.ge.1) &
write(*,*)'write_ncconc: calling write_ncinfo'
call write_ncinfo(itime,nesting_level) ! Create new file
if ((ks.eq.1).and.(kp.eq.1).and.(nage.eq.1)) then
if (option_verbose.ge.1) &
write(*,*)'write_ncconc: calling write_ncinfo'
call nc_create_main_outfile(itime,nesting_level) ! Create new file
endif
! Reassign file handle to the newly created file:
endif
if (nesting_level.eq.0) ncid=ncout
if (nesting_level.eq.1) ncid=ncoutn
endif
......
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