PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
modd_budget.F90
Go to the documentation of this file.
1! ######spl
3! ##################
4!
5!!**** *MODD_BUDGET* - declaration of budget variables
6!!
7!! PURPOSE
8!! -------
9! The purpose of this declarative module is to specify the budget
10! variables.
11!
12!!
13!!** IMPLICIT ARGUMENTS
14!! ------------------
15!! MODD_PARAMETERS: JPBUMAX, JPBUPROCMAX
16!!
17!! REFERENCE
18!! ---------
19!! Book2 of documentation of Meso-NH (module MODD_BUDGET)
20!!
21!! AUTHOR
22!! ------
23!! P. Hereil *Meteo France*
24!!
25!! MODIFICATIONS
26!! -------------
27!! Original 23/02/95
28!! J.-P. Lafore 10/02/98 adding of rhodj declaration for budget
29!! V. Ducrocq 4/06/99 //
30!! J.-P. Pinty 25/09/00 additional budget terms for C2R2 scheme
31!! D. Gazen 22/01/01 add NCHEMSV
32!! V. Masson 06/11/02 new flags for budget calls and time counters
33!! V. Masson 27/11/02 add 2way nesting effect
34!! P. Jabouille 07/07/04 add budget terms for microphysics
35!! C. Barthe 19/11/09 add budget terms for electricity
36!! S. Riette July 2022 simplification for PHYEX
37!-------------------------------------------------------------------------------
38!
39!* 0. DECLARATIONS
40! ------------
41IMPLICIT NONE
42
43SAVE
44!
45INTEGER, PARAMETER:: nbudget_rho = 0 ! Reference number for budget of RhoJ
46INTEGER, PARAMETER:: nbudget_u = 1 ! Reference number for budget of RhoJu and/or LES budgets with u
47INTEGER, PARAMETER:: nbudget_v = 2 ! Reference number for budget of RhoJv and/or LES budgets with u
48INTEGER, PARAMETER:: nbudget_w = 3 ! Reference number for budget of RhoJw and/or LES budgets with u
49INTEGER, PARAMETER:: nbudget_th = 4 ! Reference number for budget of RhoJTh and/or LES budgets with th
50INTEGER, PARAMETER:: nbudget_tke = 5 ! Reference number for budget of RhoJTke and/or LES budgets with Tke
51INTEGER, PARAMETER:: nbudget_rv = 6 ! Reference number for budget of RhoJrv and/or LES budgets with rv
52INTEGER, PARAMETER:: nbudget_rc = 7 ! Reference number for budget of RhoJrc and/or LES budgets with rc
53INTEGER, PARAMETER:: nbudget_rr = 8 ! Reference number for budget of RhoJrr and/or LES budgets with rr
54INTEGER, PARAMETER:: nbudget_ri = 9 ! Reference number for budget of RhoJri and/or LES budgets with ri
55INTEGER, PARAMETER:: nbudget_rs = 10 ! Reference number for budget of RhoJrs and/or LES budgets with rs
56INTEGER, PARAMETER:: nbudget_rg = 11 ! Reference number for budget of RhoJrg and/or LES budgets with rg
57INTEGER, PARAMETER:: nbudget_rh = 12 ! Reference number for budget of RhoJrh and/or LES budgets with rh
58INTEGER, PARAMETER:: nbudget_sv1 = 13 ! Reference number for 1st budget of RhoJsv and/or LES budgets with sv
59!
60TYPE, ABSTRACT :: tbudgetdata
61 INTEGER :: nbudget
62 CONTAINS
63 procedure(tbudgetdata_store_init_phy), DEFERRED :: init_phy
64 procedure(tbudgetdata_store_end_phy), DEFERRED :: end_phy
65 procedure(tbudgetdata_store_add_phy), DEFERRED :: add_phy
66ENDTYPE tbudgetdata
67
68abstract INTERFACE
69!
70SUBROUTINE tbudgetdata_store_init_phy(SELF, D, HSOURCE, PVARS)
71 USE modd_dimphyex, ONLY: dimphyex_t
72 IMPORT tbudgetdata
73 IMPLICIT NONE
74 CLASS(tbudgetdata), INTENT(INOUT) :: SELF ! Budget datastructure
75 TYPE(dimphyex_t), INTENT(IN) :: D
76 CHARACTER(LEN=*), INTENT(IN) :: HSOURCE ! Name of the source term
77 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PVARS ! Current value to be stored
78END SUBROUTINE tbudgetdata_store_init_phy
79!
80SUBROUTINE tbudgetdata_store_end_phy(SELF, D, HSOURCE, PVARS)
81 USE modd_dimphyex, ONLY: dimphyex_t
82 IMPORT tbudgetdata
83 IMPLICIT NONE
84 CLASS(tbudgetdata), INTENT(INOUT) :: SELF ! Budget datastructure
85 TYPE(dimphyex_t), INTENT(IN) :: D
86 CHARACTER(LEN=*), INTENT(IN) :: HSOURCE ! Name of the source term
87 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PVARS ! Current value to be stored
88END SUBROUTINE tbudgetdata_store_end_phy
89!
90SUBROUTINE tbudgetdata_store_add_phy(SELF, D, HSOURCE, PVARS)
91 USE modd_dimphyex, ONLY: dimphyex_t
92 IMPORT tbudgetdata
93 IMPLICIT NONE
94 CLASS(tbudgetdata), INTENT(INOUT) :: SELF ! Budget datastructure
95 TYPE(dimphyex_t), INTENT(IN) :: D
96 CHARACTER(LEN=*), INTENT(IN) :: HSOURCE ! Name of the source term
97 REAL, DIMENSION(D%NIJT,D%NKT), INTENT(IN) :: PVARS ! Current value to be stored
98END SUBROUTINE tbudgetdata_store_add_phy
99
100END INTERFACE
101
103 class(tbudgetdata), POINTER :: ptr => null()
104END TYPE tbudgetdata_ptr
105!
107 LOGICAL :: lbu_enable=.false.
108 LOGICAL :: lbudget_u=.false. ! flag to compute budget of RhoJu and/or LES budgets with u
109 LOGICAL :: lbudget_v=.false. ! flag to compute budget of RhoJv and/or LES budgets with u
110 LOGICAL :: lbudget_w=.false. ! flag to compute budget of RhoJw and/or LES budgets with u
111 LOGICAL :: lbudget_th=.false. ! flag to compute budget of RhoJTh and/or LES budgets with th
112 LOGICAL :: lbudget_tke=.false.! flag to compute budget of RhoJTke and/or LES budgets with Tke
113 LOGICAL :: lbudget_rv=.false. ! flag to compute budget of RhoJrv and/or LES budgets with rv
114 LOGICAL :: lbudget_rc=.false. ! flag to compute budget of RhoJrc and/or LES budgets with rc
115 LOGICAL :: lbudget_rr=.false. ! flag to compute budget of RhoJrr and/or LES budgets with rr
116 LOGICAL :: lbudget_ri=.false. ! flag to compute budget of RhoJri and/or LES budgets with ri
117 LOGICAL :: lbudget_rs=.false. ! flag to compute budget of RhoJrs and/or LES budgets with rs
118 LOGICAL :: lbudget_rg=.false. ! flag to compute budget of RhoJrg and/or LES budgets with rg
119 LOGICAL :: lbudget_rh=.false. ! flag to compute budget of RhoJrh and/or LES budgets with rh
120 LOGICAL :: lbudget_sv=.false. ! flag to compute budget of RhoJsv and/or LES budgets with sv
121END TYPE tbudgetconf_t
122!
123TYPE(tbudgetconf_t), TARGET :: tbuconf
124!
125! General variables
126LOGICAL, POINTER :: lbu_enable=>null()
127!
128INTEGER :: nbumod=0 ! model in which budget is calculated
129!
130LOGICAL, POINTER :: lbudget_u=>null() ! flag to compute budget of RhoJu and/or LES budgets with u
131LOGICAL, POINTER :: lbudget_v=>null() ! flag to compute budget of RhoJv and/or LES budgets with u
132LOGICAL, POINTER :: lbudget_w=>null() ! flag to compute budget of RhoJw and/or LES budgets with u
133LOGICAL, POINTER :: lbudget_th=>null() ! flag to compute budget of RhoJTh and/or LES budgets with th
134LOGICAL, POINTER :: lbudget_tke=>null() ! flag to compute budget of RhoJTke and/or LES budgets with Tke
135LOGICAL, POINTER :: lbudget_rv=>null() ! flag to compute budget of RhoJrv and/or LES budgets with rv
136LOGICAL, POINTER :: lbudget_rc=>null() ! flag to compute budget of RhoJrc and/or LES budgets with rc
137LOGICAL, POINTER :: lbudget_rr=>null() ! flag to compute budget of RhoJrr and/or LES budgets with rr
138LOGICAL, POINTER :: lbudget_ri=>null() ! flag to compute budget of RhoJri and/or LES budgets with ri
139LOGICAL, POINTER :: lbudget_rs=>null() ! flag to compute budget of RhoJrs and/or LES budgets with rs
140LOGICAL, POINTER :: lbudget_rg=>null() ! flag to compute budget of RhoJrg and/or LES budgets with rg
141LOGICAL, POINTER :: lbudget_rh=>null() ! flag to compute budget of RhoJrh and/or LES budgets with rh
142LOGICAL, POINTER :: lbudget_sv=>null() ! flag to compute budget of RhoJsv and/or LES budgets with sv
143
144CONTAINS
145
147 IMPLICIT NONE
148 lbu_enable=>tbuconf%LBU_ENABLE
149
150 lbudget_u=>tbuconf%LBUDGET_U
151 lbudget_v=>tbuconf%LBUDGET_V
152 lbudget_w=>tbuconf%LBUDGET_W
153 lbudget_th=>tbuconf%LBUDGET_TH
154 lbudget_tke=>tbuconf%LBUDGET_TKE
155 lbudget_rv=>tbuconf%LBUDGET_RV
156 lbudget_rc=>tbuconf%LBUDGET_RC
157 lbudget_rr=>tbuconf%LBUDGET_RR
158 lbudget_ri=>tbuconf%LBUDGET_RI
159 lbudget_rs=>tbuconf%LBUDGET_RS
160 lbudget_rg=>tbuconf%LBUDGET_RG
161 lbudget_rh=>tbuconf%LBUDGET_RH
162 lbudget_sv=>tbuconf%LBUDGET_SV
163END SUBROUTINE tbuconf_associate
164!
165END MODULE modd_budget
integer, parameter nbudget_rv
integer, parameter nbudget_rh
integer, parameter nbudget_th
logical, pointer lbudget_rh
logical, pointer lbudget_sv
integer, parameter nbudget_rs
integer, parameter nbudget_ri
integer, parameter nbudget_rc
logical, pointer lbudget_ri
logical, pointer lbudget_th
logical, pointer lbudget_v
logical, pointer lbudget_rc
integer, parameter nbudget_v
integer, parameter nbudget_sv1
logical, pointer lbudget_tke
integer, parameter nbudget_tke
integer, parameter nbudget_rr
type(tbudgetconf_t), target tbuconf
logical, pointer lbudget_w
logical, pointer lbudget_rv
logical, pointer lbudget_rr
integer, parameter nbudget_w
logical, pointer lbudget_u
logical, pointer lbudget_rg
integer, parameter nbudget_rho
logical, pointer lbudget_rs
logical, pointer lbu_enable
integer, parameter nbudget_rg
subroutine tbuconf_associate()
integer, parameter nbudget_u