diff --git a/fv3/atmos_model.F90 b/fv3/atmos_model.F90 index 1d7a27498..24750db9d 100644 --- a/fv3/atmos_model.F90 +++ b/fv3/atmos_model.F90 @@ -978,6 +978,7 @@ subroutine update_atmos_model_state (Atmos, rc) !--- local variables integer :: i, localrc, sec_lastfhzerofh integer :: isec, seconds, isec_fhzero + integer :: dtatm_temp logical :: tmpflag_fhzero real(kind=GFS_kind_phys) :: time_int, time_intfull ! @@ -1012,9 +1013,10 @@ subroutine update_atmos_model_state (Atmos, rc) if (mpp_pe() == mpp_root_pe()) write(6,*) 'gfs diags time since last bucket empty: ',time_int,' time_intfull=', & time_intfull,' kdt=',GFS_control%kdt call atmosphere_nggps_diag(Atmos%Time) + call get_time ( Atmos%Time_step, dtatm_temp) call fv3atm_diag_output(Atmos%Time, GFS_Diag, Atm_block, GFS_control%nx, GFS_control%ny, & GFS_control%levs, 1, 1, 1.0_GFS_kind_phys, time_int, time_intfull, & - GFS_control%fhswr, GFS_control%fhlwr, GFS_control) + GFS_control%fhswr, GFS_control%fhlwr, GFS_control, dtatm_temp) endif !--- find current fhzero diff --git a/io/fv3atm_history_io.F90 b/io/fv3atm_history_io.F90 index a0f2fac4d..1ff4c14d3 100644 --- a/io/fv3atm_history_io.F90 +++ b/io/fv3atm_history_io.F90 @@ -115,13 +115,13 @@ end subroutine fv3atm_diag_register !! This routine transfers diagnostic data to the FMS diagnostic !! manager for eventual output to the history files. subroutine fv3atm_diag_output(time, diag, atm_block, nx, ny, levs, ntcw, ntoz, & - dt, time_int, time_intfull, time_radsw, time_radlw, Model) + dt, time_int, time_intfull, time_radsw, time_radlw, Model, dt_atmos) !--- subroutine interface variable definitions type(time_type), intent(in) :: time type(GFS_externaldiag_type), intent(in) :: diag(:) type (block_control_type), intent(in) :: atm_block type(GFS_control_type), intent(in) :: Model - integer, intent(in) :: nx, ny, levs, ntcw, ntoz + integer, intent(in) :: nx, ny, levs, ntcw, ntoz, dt_atmos real(kind=kind_phys), intent(in) :: dt real(kind=kind_phys), intent(in) :: time_int real(kind=kind_phys), intent(in) :: time_intfull @@ -129,7 +129,7 @@ subroutine fv3atm_diag_output(time, diag, atm_block, nx, ny, levs, ntcw, ntoz, & real(kind=kind_phys), intent(in) :: time_radlw call shared_history_data%output(time, diag, atm_block, nx, ny, levs, ntcw, ntoz, & - dt, time_int, time_intfull, time_radsw, time_radlw, Model) + dt, time_int, time_intfull, time_radsw, time_radlw, Model, dt_atmos) end subroutine fv3atm_diag_output @@ -282,14 +282,14 @@ end subroutine history_type_register !! implementation of the public fv3atm_diag_output routine. Never !! call this directly. subroutine history_type_output(hist, time, diag, atm_block, nx, ny, levs, ntcw, ntoz, & - dt, time_int, time_intfull, time_radsw, time_radlw, Model) + dt, time_int, time_intfull, time_radsw, time_radlw, Model, dt_atmos) !--- subroutine interface variable definitions class(history_type) :: hist type(time_type), intent(in) :: time type(GFS_externaldiag_type), intent(in) :: diag(:) type (block_control_type), intent(in) :: atm_block type(GFS_control_type), intent(in) :: Model - integer, intent(in) :: nx, ny, levs, ntcw, ntoz + integer, intent(in) :: nx, ny, levs, ntcw, ntoz, dt_atmos real(kind=kind_phys), intent(in) :: dt real(kind=kind_phys), intent(in) :: time_int real(kind=kind_phys), intent(in) :: time_intfull @@ -310,8 +310,8 @@ subroutine history_type_output(hist, time, diag, atm_block, nx, ny, levs, ntcw, rtime_int = one/time_int rtime_intfull = one/time_intfull - rtime_radsw = one/time_radsw - rtime_radlw = one/time_radlw + rtime_radsw = one/(time_radsw * (int((time_int-dt_atmos)/time_radsw)+1)) + rtime_radlw = one/(time_radlw * (int((time_int-dt_atmos)/time_radlw)+1)) ! if(mpp_pe()==mpp_root_pe())print *,'in,fv3atm_io. time avg, time_int=',time_int history_loop: do idx = 1,hist%tot_diag_idx @@ -322,13 +322,13 @@ subroutine history_type_output(hist, time, diag, atm_block, nx, ny, levs, ntcw, lcnvfac = lcnvfac*rtime_intfull ! if(mpp_pe()==mpp_root_pe())print *,'in,fv3atm_io. full time avg, field=',trim(Diag(idx)%name),' time=',time_intfull else if ( trim(diag(idx)%time_avg_kind) == 'rad_lw' ) then - lcnvfac = lcnvfac*min(rtime_radlw,rtime_int) + lcnvfac = lcnvfac*rtime_radlw ! if(mpp_pe()==mpp_root_pe())print *,'in,fv3atm_io. rad longwave avg, field=',trim(Diag(idx)%name),' time=',time_radlw else if ( trim(diag(idx)%time_avg_kind) == 'rad_sw' ) then - lcnvfac = lcnvfac*min(rtime_radsw,rtime_int) + lcnvfac = lcnvfac*rtime_radsw ! if(mpp_pe()==mpp_root_pe())print *,'in,fv3atm_io. rad shortwave avg, field=',trim(Diag(idx)%name),' time=',time_radsw else if ( trim(diag(idx)%time_avg_kind) == 'rad_swlw_min' ) then - lcnvfac = lcnvfac*min(max(rtime_radsw,rtime_radlw),rtime_int) + lcnvfac = lcnvfac*max(rtime_radsw,rtime_radlw) ! if(mpp_pe()==mpp_root_pe())print *,'in,fv3atm_io. rad swlw min avg, field=',trim(Diag(idx)%name),' time=',time_radlw,time_radsw,time_int else lcnvfac = lcnvfac*rtime_int