1 subroutine da_print_be_stats_h_global(outunit, variable, k, max_wavenumber, &
4 !-----------------------------------------------------------------------
6 !-----------------------------------------------------------------------
10 integer, intent(inout) :: outunit ! Output file unit.
11 character*10, intent(in) :: variable ! Variable name.
12 integer, intent(in) :: k ! Vertical index.
13 integer, intent(in) :: max_wavenumber ! Smallest scale required (ni/2-1)
15 ! Total Power spectrum (averaged over time/members)
16 real, intent(in) :: total_power(0:max_wavenumber)
18 integer :: n ! Loop counter.
19 real :: accum_power, variance ! Accumulated power, variance.
21 if (trace_use) call da_trace_entry("da_print_be_stats_h_global")
24 variance = sum(total_power(0:max_wavenumber))
26 write(unit=stdout,fmt='(3a,i5,a,i5)')' Power spectra for variable ', trim(variable), &
27 ' and level ', k, ' in unit ', outunit
29 do n = 0, max_wavenumber
30 accum_power = accum_power + total_power(n)
31 write(unit=outunit,fmt='(2i4,2f18.5,f8.3)')k, n, total_power(n), accum_power, &
32 accum_power / variance
36 write(unit=stdout,fmt=*) ''
38 if (trace_use) call da_trace_exit("da_print_be_stats_h_global")
40 end subroutine da_print_be_stats_h_global