CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
ugwpv1_gsldrag_post.F90
1
4
5contains
6
11 subroutine ugwpv1_gsldrag_post_run ( im, levs, ldiag_ugwp, &
12 dtf, dudt_gw, dvdt_gw, dtdt_gw, &
13 tau_ogw, tau_ngw, zobl, zlwb, zogw, dudt_obl, dvdt_obl, &
14 dudt_ofd, dvdt_ofd, dudt_ogw, dvdt_ogw, &
15 dudt_oss, dvdt_oss, tot_zmtb, tot_zlwb, tot_zogw, &
16 tot_tofd, tot_mtb, tot_ogw, tot_ngw, &
17 du3dt_mtb,du3dt_ogw, du3dt_tms, du3dt_ngw, dv3dt_ngw, &
18 dudt_ngw, dvdt_ngw, dtdt_ngw, &
19 ldu3dt_ngw, ldv3dt_ngw, ldt3dt_ngw, &
20 dws3dt_ogw, dws3dt_obl, dws3dt_oss, dws3dt_ofd, &
21 ldu3dt_ogw, ldu3dt_obl, ldu3dt_oss, ldu3dt_ofd, &
22 du_ogwcol, dv_ogwcol, du_oblcol, dv_oblcol, du_osscol, &
23 dv_osscol, du_ofdcol, dv_ofdcol, du3_ogwcol, dv3_ogwcol, &
24 du3_oblcol, dv3_oblcol, du3_osscol, dv3_osscol, du3_ofdcol, &
25 dv3_ofdcol, dtdt, dudt, dvdt, errmsg, errflg)
26
27 use machine, only: kind_phys
28
29 implicit none
30
31 ! Interface variables
32 integer, intent(in) :: im, levs
33 real(kind=kind_phys), intent(in) :: dtf
34 logical, intent(in) :: ldiag_ugwp
35
36 real(kind=kind_phys), intent(in), dimension(:) :: zobl, zlwb, zogw
37 real(kind=kind_phys), intent(in), dimension(:) :: tau_ogw, tau_ngw
38 real(kind=kind_phys), intent(in), dimension(:),optional :: du_ofdcol, du_oblcol
39 real(kind=kind_phys), intent(inout), dimension(:) :: tot_mtb, tot_ogw, tot_tofd, tot_ngw
40 real(kind=kind_phys), intent(inout), dimension(:) :: tot_zmtb, tot_zlwb, tot_zogw
41
42 real(kind=kind_phys), intent(in), dimension(:,:) :: dtdt_gw, dudt_gw, dvdt_gw
43 real(kind=kind_phys), intent(in), dimension(:,:), optional :: dudt_obl, dvdt_obl, dudt_ogw
44 real(kind=kind_phys), intent(in), dimension(:,:), optional :: dvdt_ogw, dudt_ofd, dvdt_ofd
45 real(kind=kind_phys), intent(in), dimension(:,:), optional :: dudt_oss, dvdt_oss
46 real(kind=kind_phys), intent(inout), dimension(:,:), optional :: du3dt_mtb, du3dt_ogw, du3dt_tms
47 real(kind=kind_phys), intent(inout), dimension(:,:), optional :: du3dt_ngw, dv3dt_ngw
48 real(kind=kind_phys), intent(in), dimension(:,:), optional :: dudt_ngw, dvdt_ngw, dtdt_ngw
49 real(kind=kind_phys), intent(inout), dimension(:,:), optional :: ldu3dt_ngw, ldv3dt_ngw, ldt3dt_ngw
50 real(kind=kind_phys), intent(inout), dimension(:,:), optional :: dws3dt_ogw, dws3dt_obl
51 real(kind=kind_phys), intent(inout), dimension(:,:), optional :: dws3dt_oss, dws3dt_ofd
52 real(kind=kind_phys), intent(inout), dimension(:,:), optional :: ldu3dt_ogw, ldu3dt_obl
53 real(kind=kind_phys), intent(inout), dimension(:,:), optional :: ldu3dt_oss, ldu3dt_ofd
54 real(kind=kind_phys), intent(in), dimension(:), optional :: du_ogwcol, dv_ogwcol
55 real(kind=kind_phys), intent(in), dimension(:), optional :: dv_oblcol
56 real(kind=kind_phys), intent(in), dimension(:), optional :: du_osscol, dv_osscol
57 real(kind=kind_phys), intent(in), dimension(:), optional :: dv_ofdcol
58 real(kind=kind_phys), intent(inout), dimension(:), optional :: du3_ogwcol, dv3_ogwcol
59 real(kind=kind_phys), intent(inout), dimension(:), optional :: du3_oblcol, dv3_oblcol
60 real(kind=kind_phys), intent(inout), dimension(:), optional :: du3_osscol, dv3_osscol
61 real(kind=kind_phys), intent(inout), dimension(:), optional :: du3_ofdcol, dv3_ofdcol
62
63 real(kind=kind_phys), intent(inout), dimension(:,:) :: dtdt, dudt, dvdt
64
65 character(len=*), intent(out) :: errmsg
66 integer, intent(out) :: errflg
67
68 ! Initialize CCPP error handling variables
69 errmsg = ''
70 errflg = 0
71!
72! post creates the "time-averaged" diagnostics"
73!
74
75 if (ldiag_ugwp) then
76 tot_zmtb = tot_zmtb + dtf *zobl
77 tot_zlwb = tot_zlwb + dtf *zlwb
78 tot_zogw = tot_zogw + dtf *zogw
79
80 tot_tofd = tot_tofd + dtf *du_ofdcol
81 tot_mtb = tot_mtb + dtf *du_oblcol
82 tot_ogw = tot_ogw + dtf *tau_ogw
83 tot_ngw = tot_ngw + dtf *tau_ngw
84
85 du3dt_mtb = du3dt_mtb + dtf *dudt_obl
86 du3dt_tms = du3dt_tms + dtf *dudt_ofd
87 du3dt_ogw = du3dt_ogw + dtf *dudt_ogw
88 du3dt_ngw = du3dt_ngw + dtf *dudt_gw
89 dv3dt_ngw = dv3dt_ngw + dtf *dvdt_gw
90
91 dws3dt_ogw = dws3dt_ogw + dtf *sqrt(dudt_ogw**2+dvdt_ogw**2)
92 dws3dt_obl = dws3dt_obl + dtf *sqrt(dudt_obl**2+dvdt_obl**2)
93
94 du3_ogwcol = du3_ogwcol + dtf *du_ogwcol
95 dv3_ogwcol = dv3_ogwcol + dtf *dv_ogwcol
96 du3_oblcol = du3_oblcol + dtf *du_oblcol
97 dv3_oblcol = dv3_oblcol + dtf *dv_oblcol
98
99 dws3dt_oss = dws3dt_oss + dtf *sqrt(dudt_oss**2+dvdt_oss**2)
100 dws3dt_ofd = dws3dt_ofd + dtf *sqrt(dudt_ofd**2+dvdt_ofd**2)
101
102 ldu3dt_ogw = ldu3dt_ogw + dtf *dudt_ogw
103 ldu3dt_obl = ldu3dt_obl + dtf *dudt_obl
104 ldu3dt_oss = ldu3dt_oss + dtf *dudt_oss
105 ldu3dt_ofd = ldu3dt_ofd + dtf *dudt_ofd
106
107 du3_osscol = du3_osscol + dtf*du_osscol
108 dv3_osscol = dv3_osscol + dtf*dv_osscol
109 du3_ofdcol = du3_ofdcol + dtf*du_ofdcol
110 dv3_ofdcol = dv3_ofdcol + dtf*dv_ofdcol
111
112 ! Special treatment for non-stationary GWD diagnostics
113 ldu3dt_ngw = ldu3dt_ngw + dtf *dudt_ngw
114 ldv3dt_ngw = ldv3dt_ngw + dtf *dvdt_ngw
115 ldt3dt_ngw = ldt3dt_ngw + dtf *dtdt_ngw
116 endif
117
118!=====================================================================
119! Updates inside the ugwpv1_gsldrag.F90
120!
121! dtdt = dtdt + dtdt_gw
122! dudt = dudt + dudt_gw
123! dvdt = dvdt + dvdt_gw
124!
125! "post" may also create the "time-averaged" diagnostics"
126!
127! if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then
128! do k=1,levs
129! do i=1,im
130! ldu3dt_ngw(i,k) = ldu3dt_ngw(i,k) + dudt_ngw(i,k)*dtf
131! ldv3dt_ngw(i,k) = ldv3dt_ngw(i,k) + dvdt_ngw(i,k)*dtf
132! ldt3dt_ngw(i,k) = ldt3dt_ngw(i,k) + dtdt_ngw(i,k)*dtf
133!
134! ldu3dt_ogw(i,k) = ldu3dt_ogw(i,k) + dudt_ogw(i,k)*dtf
135! ldv3dt_ogw(i,k) = ldv3dt_ogw(i,k) + dvdt_ogw(i,k)*dtf
136! ldt3dt_ogw(i,k) = ldt3dt_ogw(i,k) + dtdt_ogw(i,k)*dtf
137! enddo
138! enddo
139! endif
140!
141!=====================================================================
142 end subroutine ugwpv1_gsldrag_post_run
143
144end module ugwpv1_gsldrag_post