da_print_be_stats_v.inc
References to this file elsewhere.
1 subroutine da_print_be_stats_v(outunit, variable, nk, num_bins2d, &
2 e_vec, e_val, e_vec_loc, e_val_loc)
3
4 !----------------------------------------------------------------------------
5 ! Purpose: To print out the first global and local eigenvector and
6 ! eigenvalues for 'variable'.
7 !
8 ! Input : outunit --- output unit
9 ! variable --- variable name: psi, chi_u, t_u, rh
10 ! nk --- the number of vertical modes or levels
11 ! num_bins2d --- the number of the 2d bins
12 ! e_vec, e_val --- global eigenvector and eigenvalues
13 ! e_vec_loc, e_val_loc --- local eigenvectors and eigenvalues
14 !
15 ! Output : fort.174,178,182,186,(190) --- The first 5 global eigenvectors
16 ! fort.175,179,183,187,(191) --- The global eigenvalues
17 ! fort.176,180,184,188,(192) --- The first 5 local eigenvectors
18 ! fort.177,181,185,189,(193) --- The first 5 local eigenvalues
19 !
20 ! * in parenthisis, the units for 2d fields ps_u (ps).
21 !----------------------------------------------------------------------------
22
23 implicit none
24
25 integer, intent(inout) :: outunit ! Output file unit.
26 character*10, intent(in) :: variable ! Variable name
27 integer, intent(in) :: nk ! Vertical dimension.
28 integer, intent(in) :: num_bins2d ! # bins for 2D fields.
29 real, intent(in) :: e_vec(1:nk,1:nk) ! Domain-averaged eigenvectors.
30 real, intent(in) :: e_val(1:nk) ! Domain-averaged eigenvalues.
31 real, intent(in) :: e_vec_loc(1:nk,1:nk,1:num_bins2d) ! Latitudinally varying eigenvectors.
32 real, intent(in) :: e_val_loc(1:nk,1:num_bins2d) ! Latitudinally varying eigenvalues.
33
34 integer :: k, m, b, mn ! Loop counters.
35
36 if (nk > 5) then
37 mn = 5
38 else
39 mn = nk
40 end if
41
42 ! 1, Global vectors:
43 write(unit=stdout,fmt='(3a,i5)')' First 5 Global eigenvectors for variable ', trim(variable), &
44 ' in unit ', outunit
45
46 open(unit=outunit)
47 do k = 1, nk
48 write(unit=outunit,fmt='(i4,5f15.8)') k, (e_vec(k,m), m = 1, mn)
49 end do
50 close(unit=outunit)
51
52 ! 2, Global values:
53 outunit = outunit + 1
54
55 write(unit=stdout,fmt='(3a,i5)')' Global eigenvalues for variable ', trim(variable), &
56 ' in unit ', outunit
57
58 open(unit=outunit)
59 do k = 1, nk
60 write(unit=outunit,fmt='(i4,1pe18.5)') k, e_val(k)
61 end do
62 close(unit=outunit)
63
64 ! 3, Local vectors:
65
66 outunit = outunit + 1
67
68 write(unit=stdout,fmt='(3a,i5)')' First 5 local eigenvectors for variable ', trim(variable), &
69 ' in unit ', outunit
70
71 open(unit=outunit)
72 do b = 1, num_bins2d
73 write(unit=outunit,fmt='(/"bin =",i6)') b
74 do k = 1, nk
75 write(unit=outunit,fmt='(i4,5f15.8)') k, (e_vec_loc(k,m,b), m = 1, mn)
76 end do
77 end do
78 close(unit=outunit)
79
80 ! 4. Local values:
81
82 outunit = outunit + 1
83
84 write(unit=stdout,fmt='(3a,i5)')' First 5 local eigenvalues for variable ', trim(variable), &
85 ' in unit ', outunit
86
87 open(unit=outunit)
88 do b = 1, num_bins2d
89 write(unit=outunit,fmt='(i4,5(1pe18.5))') b, (e_val_loc(m,b), m = 1, mn)
90 end do
91 close(unit=outunit)
92
93 outunit = outunit + 1
94 write(unit=stdout,fmt=*) ' '
95
96 end subroutine da_print_be_stats_v
97
98