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