1 MODULE da_verif_obs_init
2 !----------------------------------------------------------------------------
7 ! initializing various arrays
9 ! Author: Syed RH Rizvi NCAR/MMM 05/30/2006
10 !----------------------------------------------------------------------------
11 USE da_verif_obs_control
15 subroutine da_advance_cymdh( start_date
, dh
, end_date
)
19 character (len
=10), intent(in
) :: start_date
! In date (ccyymmddhh).
20 integer, intent(in
) :: dh
! Period to advance (-ve for past).
21 character (len
=10), intent(out
) :: end_date
! Out date (ccyymmddhh).
23 integer :: ccyy
, mm
, dd
, hh
25 read(start_date(1:10), fmt
='(i4, 3i2)') ccyy
, mm
, dd
, hh
31 call da_change_date ( ccyy
, mm
, dd
, -1 )
36 call da_change_date ( ccyy
, mm
, dd
, 1 )
39 write(UNIT
=end_date(1:10), fmt
='(i4, 3i2.2)') ccyy
, mm
, dd
, hh
41 end subroutine da_advance_cymdh
42 subroutine da_change_date( ccyy
, mm
, dd
, delta
)
46 integer, intent(inout
) :: ccyy
, mm
, dd
47 integer, intent(in
) :: delta
49 integer, dimension(12) :: mmday
51 mmday
= (/31,28,31,30,31,30,31,31,30,31,30,31/)
54 if (mod(ccyy
,4) == 0) then
57 if ( mod(ccyy
,100) == 0) then
61 if(mod(ccyy
,400) == 0) then
77 elseif ( dd
.gt
. mmday(mm
) ) then
85 end subroutine da_change_date
86 subroutine initialize_surface_type(surface
)
87 type(surface_type
), intent(inout
) :: surface
89 call initialize_stats_type(surface
%uomb
,surface
%uoma
)
90 call initialize_stats_type(surface
%vomb
,surface
%voma
)
91 call initialize_stats_type(surface
%tomb
,surface
%toma
)
92 call initialize_stats_type(surface
%pomb
,surface
%poma
)
93 call initialize_stats_type(surface
%qomb
,surface
%qoma
)
95 end subroutine initialize_surface_type
97 subroutine initialize_upr_type(upr
)
98 type(upr_type
), intent(inout
) :: upr
103 call initialize_stats_type(upr
%uomb(k
),upr
%uoma(k
))
104 call initialize_stats_type(upr
%vomb(k
),upr
%voma(k
))
105 call initialize_stats_type(upr
%tomb(k
),upr
%toma(k
))
106 call initialize_stats_type(upr
%qomb(k
),upr
%qoma(k
))
109 end subroutine initialize_upr_type
111 subroutine initialize_gpspw_type(gpspw
)
112 type(gpspw_type
), intent(inout
) :: gpspw
114 call initialize_stats_type(gpspw
%tpwomb
,gpspw
%tpwoma
)
115 end subroutine initialize_gpspw_type
117 subroutine initialize_gpsref_type(gpsref
)
118 type(gpsref_type
), intent(inout
) :: gpsref
123 call initialize_stats_type(gpsref
%refomb(k
),gpsref
%refoma(k
))
125 end subroutine initialize_gpsref_type
127 subroutine initialize_stats_type(omb
, oma
)
128 type(stats_value
), intent(inout
) :: omb
, oma
129 omb
%num
= 0 ; oma
%num
= 0
130 omb
%bias
= 0 ; oma
%bias
= 0
131 omb
%abias
= 0 ; oma
%abias
= 0
132 omb
%rmse
= 0 ; oma
%rmse
= 0
133 end subroutine initialize_stats_type
135 subroutine initialize_t_tab
140 ! Initalize Student t table for alpha=0.025
188 end subroutine initialize_t_tab
190 !-------------------------------------------------
191 end MODULE da_verif_obs_init