CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
cires_ugwp_post.F90
1
3
6
7contains
8
16 subroutine cires_ugwp_post_run (ldiag_ugwp, dtf, im, levs, &
17 gw_dtdt, gw_dudt, gw_dvdt, tau_tofd, tau_mtb, tau_ogw, &
18 tau_ngw, zmtb, zlwb, zogw, dudt_mtb, dudt_ogw, dudt_tms, &
19 tot_zmtb, tot_zlwb, tot_zogw, &
20 tot_tofd, tot_mtb, tot_ogw, tot_ngw, &
21 du3dt_mtb,du3dt_ogw, du3dt_tms, du3dt_ngw, dv3dt_ngw, &
22 dtdt, dudt, dvdt, errmsg, errflg)
23
24 use machine, only: kind_phys
25
26 implicit none
27
28 ! Interface variables
29 integer, intent(in) :: im, levs
30 real(kind=kind_phys), intent(in) :: dtf
31 logical, intent(in) :: ldiag_ugwp ! flag for CIRES UGWP Diagnostics
32
33 real(kind=kind_phys), intent(in), dimension(:) :: zmtb, zlwb, zogw
34 real(kind=kind_phys), intent(in), dimension(:) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw
35 real(kind=kind_phys), intent(inout), dimension(:) :: tot_mtb, tot_ogw, tot_tofd, tot_ngw
36 real(kind=kind_phys), intent(inout), dimension(:) :: tot_zmtb, tot_zlwb, tot_zogw
37 real(kind=kind_phys), intent(in), dimension(:,:) :: gw_dtdt, gw_dudt, gw_dvdt, dudt_mtb, dudt_tms
38 real(kind=kind_phys), intent(in), dimension(:,:), optional :: dudt_ogw
39 real(kind=kind_phys), intent(inout), dimension(:,:), optional :: du3dt_mtb, du3dt_ogw, du3dt_tms, du3dt_ngw, dv3dt_ngw
40 real(kind=kind_phys), intent(inout), dimension(:,:) :: dtdt, dudt, dvdt
41
42 character(len=*), intent(out) :: errmsg
43 integer, intent(out) :: errflg
44
45 ! Initialize CCPP error handling variables
46 errmsg = ''
47 errflg = 0
48
49 if (ldiag_ugwp) then
50 tot_zmtb = tot_zmtb + dtf *zmtb
51 tot_zlwb = tot_zlwb + dtf *zlwb
52 tot_zogw = tot_zogw + dtf *zogw
53
54 tot_tofd = tot_tofd + dtf *tau_tofd
55 tot_mtb = tot_mtb + dtf *tau_mtb
56 tot_ogw = tot_ogw + dtf *tau_ogw
57 tot_ngw = tot_ngw + dtf *tau_ngw
58
59 du3dt_mtb = du3dt_mtb + dtf *dudt_mtb
60 du3dt_tms = du3dt_tms + dtf *dudt_tms
61 du3dt_ogw = du3dt_ogw + dtf *dudt_ogw
62 du3dt_ngw = du3dt_ngw + dtf *gw_dudt
63 dv3dt_ngw = dv3dt_ngw + dtf *gw_dvdt
64 endif
65
66 dtdt = dtdt + gw_dtdt
67 dudt = dudt + gw_dudt
68 dvdt = dvdt + gw_dvdt
69
70 end subroutine cires_ugwp_post_run
71
73
74end module cires_ugwp_post
subroutine cires_ugwp_post_run(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, 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, dtdt, dudt, dvdt, errmsg, errflg)
This module contains the calculation of the UGWP v0 diagnostics (ldiag_ugwp)