CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
unified_ugwp_post.F90
1
4
5contains
6
13 subroutine unified_ugwp_post_run (ldiag3d, ldiag_ugwp, &
14 dtf, im, levs, &
15 gw_dtdt, gw_dudt, gw_dvdt, tau_tofd, tau_mtb, tau_ogw, &
16 tau_ngw, zmtb, zlwb, zogw, dudt_mtb, dudt_ogw, dvdt_ogw, &
17 dudt_tms, tot_zmtb, tot_zlwb, tot_zogw, &
18 tot_tofd, tot_mtb, tot_ogw, tot_ngw, &
19 du3dt_mtb,du3dt_ogw, du3dt_tms, du3dt_ngw, dv3dt_ngw, &
20 ldu3dt_ogw, ldu3dt_obl, ldu3dt_oss, ldu3dt_ofd, &
21 dudt_ngw, dvdt_ngw, dtdt_ngw, &
22 ldu3dt_ngw, ldv3dt_ngw, ldt3dt_ngw, dudt_obl, dvdt_obl, &
23 dudt_oss, dvdt_oss, dudt_ofd, dvdt_ofd, dws3dt_ogw, &
24 dws3dt_obl, dws3dt_oss, dws3dt_ofd, du_ogwcol, dv_ogwcol, &
25 du_oblcol, dv_oblcol, du_osscol, dv_osscol, du_ofdcol, &
26 dv_ofdcol, du3_ogwcol, dv3_ogwcol, du3_oblcol, dv3_oblcol, &
27 du3_osscol, dv3_osscol, du3_ofdcol, dv3_ofdcol, &
28 dtdt, dudt, dvdt, errmsg, errflg)
29
30 use machine, only: kind_phys
31
32 implicit none
33
34 ! Interface variables
35 integer, intent(in) :: im, levs
36 real(kind=kind_phys), intent(in) :: dtf
37 logical, intent(in) :: ldiag_ugwp
38 logical, intent(in) :: ldiag3d
39
40 real(kind=kind_phys), intent(in), dimension(:) :: zmtb, zlwb, zogw
41 real(kind=kind_phys), intent(in), dimension(:) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw
42 real(kind=kind_phys), intent(inout), dimension(:) :: tot_mtb, tot_ogw, tot_tofd, tot_ngw
43 real(kind=kind_phys), intent(inout), dimension(:) :: tot_zmtb, tot_zlwb, tot_zogw
44 real(kind=kind_phys), intent(in), dimension(:,:) :: gw_dtdt, gw_dudt, gw_dvdt, dudt_mtb
45 real(kind=kind_phys), intent(in), dimension(:,:), optional :: dudt_ogw, dvdt_ogw
46 real(kind=kind_phys), intent(in), dimension(:,:) :: dudt_tms
47 real(kind=kind_phys), intent(inout), dimension(:,:), optional :: du3dt_mtb, du3dt_ogw, du3dt_tms, du3dt_ngw, dv3dt_ngw
48 real(kind=kind_phys), intent(inout), dimension(:,:), optional :: ldu3dt_ogw, ldu3dt_obl, ldu3dt_oss, ldu3dt_ofd
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(in), dimension(:,:), optional :: dudt_obl, dvdt_obl
52 real(kind=kind_phys), intent(in), dimension(:,:), optional :: dudt_oss, dvdt_oss, dudt_ofd, dvdt_ofd
53 real(kind=kind_phys), intent(inout), dimension(:,:), optional :: dws3dt_obl, dws3dt_ogw
54 real(kind=kind_phys), intent(inout), dimension(:,:), optional :: dws3dt_oss, dws3dt_ofd
55 real(kind=kind_phys), intent(in), dimension(:), optional :: du_ogwcol, dv_ogwcol
56 real(kind=kind_phys), intent(in), dimension(:), optional :: du_oblcol, dv_oblcol
57 real(kind=kind_phys), intent(in), dimension(:), optional :: du_osscol, dv_osscol
58 real(kind=kind_phys), intent(in), dimension(:), optional :: du_ofdcol, 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 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 if (ldiag_ugwp) then
73 tot_zmtb = tot_zmtb + dtf *zmtb
74 tot_zlwb = tot_zlwb + dtf *zlwb
75 tot_zogw = tot_zogw + dtf *zogw
76
77 tot_tofd = tot_tofd + dtf *tau_tofd
78 tot_mtb = tot_mtb + dtf *tau_mtb
79 tot_ogw = tot_ogw + dtf *tau_ogw
80 tot_ngw = tot_ngw + dtf *tau_ngw
81
82 du3dt_mtb = du3dt_mtb + dtf *dudt_mtb
83 du3dt_tms = du3dt_tms + dtf *dudt_tms
84 du3dt_ogw = du3dt_ogw + dtf *dudt_ogw
85 du3dt_ngw = du3dt_ngw + dtf *gw_dudt
86 dv3dt_ngw = dv3dt_ngw + dtf *gw_dvdt
87
88 dws3dt_ogw = dws3dt_ogw + dtf *sqrt(dudt_ogw**2+dvdt_ogw**2)
89 dws3dt_obl = dws3dt_obl + dtf *sqrt(dudt_obl**2+dvdt_obl**2)
90 dws3dt_oss = dws3dt_oss + dtf *sqrt(dudt_oss**2+dvdt_oss**2)
91 dws3dt_ofd = dws3dt_ofd + dtf *sqrt(dudt_ofd**2+dvdt_ofd**2)
92 ldu3dt_ogw = ldu3dt_ogw + dtf *dudt_ogw
93 ldu3dt_obl = ldu3dt_obl + dtf *dudt_obl
94 ldu3dt_oss = ldu3dt_oss + dtf *dudt_oss
95 ldu3dt_ofd = ldu3dt_ofd + dtf *dudt_ofd
96 du3_ogwcol = du3_ogwcol + dtf *du_ogwcol
97 dv3_ogwcol = dv3_ogwcol + dtf *dv_ogwcol
98 du3_oblcol = du3_oblcol + dtf *du_oblcol
99 dv3_oblcol = dv3_oblcol + dtf *dv_oblcol
100 du3_osscol = du3_osscol + dtf *du_osscol
101 dv3_osscol = dv3_osscol + dtf *dv_osscol
102 du3_ofdcol = du3_ofdcol + dtf *du_ofdcol
103 dv3_ofdcol = dv3_ofdcol + dtf *dv_ofdcol
104 ! Special treatment for non-stationary GWD diagnostics
105 ldu3dt_ngw = ldu3dt_ngw + dtf *dudt_ngw
106 ldv3dt_ngw = ldv3dt_ngw + dtf *dvdt_ngw
107 ldt3dt_ngw = ldt3dt_ngw + dtf *dtdt_ngw
108 end if
109
110 dtdt = dtdt + gw_dtdt
111 dudt = dudt + gw_dudt
112 dvdt = dvdt + gw_dvdt
113
114 end subroutine unified_ugwp_post_run
115
117end module unified_ugwp_post
subroutine unified_ugwp_post_run(ldiag3d, ldiag_ugwp, dtf, im, levs, gw_dtdt, gw_dudt, gw_dvdt, tau_tofd, tau_mtb, tau_ogw, tau_ngw, zmtb, zlwb, zogw, dudt_mtb, dudt_ogw, dvdt_ogw, dudt_tms, tot_zmtb, tot_zlwb, tot_zogw, tot_tofd, tot_mtb, tot_ogw, tot_ngw, du3dt_mtb, du3dt_ogw, du3dt_tms, du3dt_ngw, dv3dt_ngw, ldu3dt_ogw, ldu3dt_obl, ldu3dt_oss, ldu3dt_ofd, dudt_ngw, dvdt_ngw, dtdt_ngw, ldu3dt_ngw, ldv3dt_ngw, ldt3dt_ngw, dudt_obl, dvdt_obl, dudt_oss, dvdt_oss, dudt_ofd, dvdt_ofd, dws3dt_ogw, dws3dt_obl, dws3dt_oss, dws3dt_ofd, du_ogwcol, dv_ogwcol, du_oblcol, dv_oblcol, du_osscol, dv_osscol, du_ofdcol, dv_ofdcol, du3_ogwcol, dv3_ogwcol, du3_oblcol, dv3_oblcol, du3_osscol, dv3_osscol, du3_ofdcol, dv3_ofdcol, dtdt, dudt, dvdt, errmsg, errflg)