source: LMDZ5/trunk/libf/phylmd/phys_output_var_mod.F90 @ 2989

Last change on this file since 2989 was 2989, checked in by musat, 7 years ago

The 4co2 output fields are now managed by the XIOS server via
file*lmdz*xml files and the ok_4xCO2atm logical flag.
ok_4xCO2atm is initialized to TRUE if

  • one of the 4co2 variables (rsut4cO2, rlut4co2, etc) are asked for

by XIOS sefrver or

  • if one of the perturbed GES concentration (RCO2_per, RCH4_per, etc)

is different from the actual (RCO2, RCH4, etc) GES concentration.

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
File size: 10.6 KB
Line 
1!
2! phys_local_var_mod.F90 1327 2010-03-17 15:33:56Z idelkadi $
3
4MODULE phys_output_var_mod
5
6  USE dimphy
7  ! Variables outputs pour les ecritures des sorties
8  !======================================================================
9  !
10  !
11  !======================================================================
12  ! Declaration des variables
13
14  REAL, SAVE, ALLOCATABLE :: snow_o(:), zfra_o(:)
15  !$OMP THREADPRIVATE(snow_o, zfra_o)
16  INTEGER, SAVE, ALLOCATABLE ::  itau_con(:)       ! Nombre de pas ou rflag <= 1
17  !$OMP THREADPRIVATE(itau_con)
18  REAL, SAVE, ALLOCATABLE :: bils_ec(:) ! Contribution of energy conservation
19  REAL, SAVE, ALLOCATABLE :: bils_ech(:) ! Contribution of energy conservation
20  REAL, SAVE, ALLOCATABLE :: bils_tke(:) ! Contribution of energy conservation
21  REAL, SAVE, ALLOCATABLE :: bils_diss(:) ! Contribution of energy conservation
22  REAL, SAVE, ALLOCATABLE :: bils_kinetic(:) ! bilan de chaleur au sol, kinetic
23  REAL, SAVE, ALLOCATABLE :: bils_enthalp(:) ! bilan de chaleur au sol
24  REAL, SAVE, ALLOCATABLE :: bils_latent(:) ! bilan de chaleur au sol
25  !$OMP THREADPRIVATE(bils_ec,bils_ech,bils_tke,bils_diss,bils_kinetic,bils_enthalp,bils_latent)
26  ! output variables for energy conservation tests, computed in add_phys_tend
27  REAL, SAVE, ALLOCATABLE :: d_qw_col(:)      ! watter vapour mass budget for each column (kg/m2/s)
28  REAL, SAVE, ALLOCATABLE :: d_ql_col(:)      ! liquid watter mass budget for each column (kg/m2/s)
29  REAL, SAVE, ALLOCATABLE :: d_qs_col(:)      ! solid watter mass budget for each column (kg/m2/s)
30  REAL, SAVE, ALLOCATABLE :: d_qt_col(:)      ! total watter mass budget for each column (kg/m2/s)
31  REAL, SAVE, ALLOCATABLE :: d_ek_col(:)      ! kinetic energy budget for each column (W/m2)
32  REAL, SAVE, ALLOCATABLE :: d_h_dair_col(:)  ! enthalpy budget of dry air for each column (W/m2)
33  REAL, SAVE, ALLOCATABLE :: d_h_qw_col(:)    ! enthalpy budget of watter vapour for each column (W/m2)
34  REAL, SAVE, ALLOCATABLE :: d_h_ql_col(:)    ! enthalpy budget of liquid watter for each column (W/m2)
35  REAL, SAVE, ALLOCATABLE :: d_h_qs_col(:)    ! enthalpy budget of solid watter  for each column (W/m2)
36  REAL, SAVE, ALLOCATABLE :: d_h_col(:)       ! total enthalpy budget for each column (W/m2)
37  !$OMP THREADPRIVATE(d_qw_col, d_ql_col, d_qs_col, d_qt_col, d_ek_col, d_h_dair_col)
38  !$OMP THREADPRIVATE(d_h_qw_col, d_h_ql_col, d_h_qs_col, d_h_col)
39
40  ! Outputs used in cloudth_vert to extract the moments of the horizontal and
41  ! vertical PDFs
42  REAL, SAVE, ALLOCATABLE :: cloudth_sth(:,:),cloudth_senv(:,:)
43  !$OMP THREADPRIVATE(cloudth_sth,cloudth_senv)
44  REAL, SAVE, ALLOCATABLE :: cloudth_sigmath(:,:),cloudth_sigmaenv(:,:)
45  !$OMP THREADPRIVATE(cloudth_sigmath,cloudth_sigmaenv)
46
47! Marine
48! Variables de sortie du simulateur AIRS
49
50  REAL, SAVE, ALLOCATABLE :: map_prop_hc(:),map_prop_hist(:),alt_tropo(:)
51  !$OMP THREADPRIVATE(map_prop_hc,map_prop_hist,alt_tropo)
52  REAL, SAVE, ALLOCATABLE :: map_emis_hc(:),map_iwp_hc(:),map_deltaz_hc(:), &
53                       map_pcld_hc(:),map_tcld_hc(:)
54  !$OMP THREADPRIVATE(map_emis_hc,map_iwp_hc,map_deltaz_hc,map_pcld_hc,map_tcld_hc)
55  REAL, SAVE, ALLOCATABLE :: map_emis_hist(:),map_iwp_hist(:),map_deltaz_hist(:),map_rad_hist(:)         
56  !$OMP THREADPRIVATE(map_emis_hist,map_iwp_hist,map_deltaz_hist,map_rad_hist)
57  REAL, SAVE, ALLOCATABLE :: map_ntot(:),map_hc(:),map_hist(:)
58  REAL, SAVE, ALLOCATABLE :: map_Cb(:),map_ThCi(:),map_Anv(:)
59  !$OMP THREADPRIVATE(map_ntot,map_hc,map_hist,map_Cb,map_ThCi,map_Anv)
60  REAL, SAVE, ALLOCATABLE :: map_emis_Cb(:),map_pcld_Cb(:),map_tcld_Cb(:)
61  REAL, SAVE, ALLOCATABLE :: map_emis_ThCi(:),map_pcld_ThCi(:),map_tcld_ThCi(:)
62  !$OMP THREADPRIVATE(map_emis_Cb,map_pcld_Cb,map_tcld_Cb,map_emis_ThCi)
63  REAL, SAVE, ALLOCATABLE :: map_emis_Anv(:),map_pcld_Anv(:),map_tcld_Anv(:)
64  !$OMP THREADPRIVATE(map_pcld_ThCi,map_tcld_ThCi,map_emis_Anv,map_pcld_Anv,map_tcld_Anv)             
65   
66
67  ! ug Plein de variables venues de phys_output_mod
68  INTEGER, PARAMETER                           :: nfiles = 10
69  LOGICAL, DIMENSION(nfiles), SAVE             :: clef_files
70  LOGICAL, DIMENSION(nfiles), SAVE             :: clef_stations
71  INTEGER, DIMENSION(nfiles), SAVE             :: lev_files
72  INTEGER, DIMENSION(nfiles), SAVE             :: nid_files
73  INTEGER, DIMENSION(nfiles), SAVE  :: nnid_files
74  !$OMP THREADPRIVATE(clef_files, clef_stations, lev_files,nid_files,nnid_files)
75  INTEGER, DIMENSION(nfiles), SAVE :: nnhorim
76
77  INTEGER, DIMENSION(nfiles), SAVE :: nhorim, nvertm
78  INTEGER, DIMENSION(nfiles), SAVE :: nvertap, nvertbp, nvertAlt
79  REAL, DIMENSION(nfiles), SAVE                :: zoutm
80  CHARACTER(LEN=20), DIMENSION(nfiles), SAVE   :: type_ecri
81  !$OMP THREADPRIVATE(nnhorim, nhorim, nvertm, zoutm,type_ecri)
82  CHARACTER(LEN=20), DIMENSION(nfiles), SAVE  :: type_ecri_files, phys_out_filetypes
83  !$OMP THREADPRIVATE(type_ecri_files, phys_out_filetypes)
84  CHARACTER(LEN=20), DIMENSION(nfiles), SAVE  :: phys_out_filenames
85  !$OMP THREADPRIVATE(phys_out_filenames)
86
87  ! swaero_diag : flag indicates if it is necessary to do calculation for some aerosol diagnostics
88  ! dryaod_diag : flag indicates if it is necessary to do calculation for some aerosol diagnostics
89  !--OB: this needs to be set to TRUE by default and changed back to FALSE after first radiation call
90  !--    and corrected back to TRUE based on output requests
91  LOGICAL, SAVE                                :: swaero_diag=.TRUE.
92  LOGICAL, SAVE                                :: dryaod_diag=.TRUE.
93  !$OMP THREADPRIVATE(swaero_diag, dryaod_diag)
94  ! ok_4xCO2atm : flag indicates if it is necessary to do a second call of
95  ! radiation code with a 4xCO2 or another different GES to assess SW/LW
96  ! in this case
97  !--IM: as for swaero_diag or dryaod_diag this needs to be set to TRUE by default and
98  !--    changed back to FALSE after first radiation call and corrected back to TRUE
99  !--    based on output requests
100  LOGICAL, SAVE                                :: ok_4xCO2atm=.FALSE.
101  !$OMP THREADPRIVATE(ok_4xCO2atm)
102
103  INTEGER, SAVE:: levmin(nfiles) = 1
104  INTEGER, SAVE:: levmax(nfiles)
105  !$OMP THREADPRIVATE(levmin, levmax)
106
107  REAL, SAVE                :: zdtime_moy
108  !$OMP THREADPRIVATE(zdtime_moy)
109
110  LOGICAL, SAVE :: vars_defined = .FALSE. ! ug PAS THREADPRIVATE ET C'EST NORMAL
111
112  REAL, allocatable:: zustr_gwd_hines(:), zvstr_gwd_hines(:) ! (klon)
113  REAL, allocatable:: zustr_gwd_front(:), zvstr_gwd_front(:) ! (klon)
114  REAL, allocatable:: zustr_gwd_rando(:), zvstr_gwd_rando(:) ! (klon)
115  !$OMP THREADPRIVATE(zustr_gwd_hines, zvstr_gwd_hines)
116  !$OMP THREADPRIVATE(zustr_gwd_front, zvstr_gwd_front)
117  !$OMP THREADPRIVATE(zustr_gwd_rando, zvstr_gwd_rando)
118
119  TYPE ctrl_out
120     INTEGER,DIMENSION(nfiles)            :: flag
121     CHARACTER(len=20)                    :: name
122     CHARACTER(len=150)                   :: description
123     CHARACTER(len=20)                    :: unit
124     CHARACTER(len=20),DIMENSION(nfiles)  :: type_ecrit
125  END TYPE ctrl_out
126
127  REAL, SAVE, ALLOCATABLE :: sens_prec_liq_o(:,:), sens_prec_sol_o(:,:)
128  REAL, SAVE, ALLOCATABLE :: lat_prec_liq_o(:,:), lat_prec_sol_o(:,:)
129 !$OMP THREADPRIVATE(sens_prec_liq_o, sens_prec_sol_o,lat_prec_liq_o,lat_prec_sol_o)
130
131CONTAINS
132
133  !======================================================================
134  SUBROUTINE phys_output_var_init
135    use dimphy
136
137    IMPLICIT NONE
138
139    include "clesphys.h"
140
141    !------------------------------------------------
142
143    allocate(snow_o(klon), zfra_o(klon))
144    allocate(itau_con(klon))
145    allocate(sens_prec_liq_o(klon,2))
146    allocate(sens_prec_sol_o(klon,2))
147    allocate(lat_prec_liq_o(klon,2))
148    allocate(lat_prec_sol_o(klon,2))
149    sens_prec_liq_o = 0.0 ; sens_prec_sol_o = 0.0
150    lat_prec_liq_o = 0.0 ; lat_prec_sol_o = 0.0
151
152    allocate (bils_ec(klon),bils_ech(klon),bils_tke(klon),bils_diss(klon),bils_kinetic(klon),bils_enthalp(klon),bils_latent(klon))
153    allocate (d_qw_col(klon), d_ql_col(klon), d_qs_col(klon), d_qt_col(klon), d_ek_col(klon), d_h_dair_col(klon) &
154  &         , d_h_qw_col(klon), d_h_ql_col(klon), d_h_qs_col(klon), d_h_col(klon))
155    d_qw_col=0. ; d_ql_col=0. ; d_qs_col=0. ; d_qt_col=0. ; d_ek_col=0. ; d_h_dair_col =0.
156    d_h_qw_col=0. ; d_h_ql_col=0. ; d_h_qs_col=0. ; d_h_col=0.
157
158    ! Outputs used in cloudth_vert
159    allocate(cloudth_sth(klon,klev))
160    allocate(cloudth_senv(klon,klev))
161    cloudth_sth = 0. ; cloudth_senv = 0.
162    allocate(cloudth_sigmath(klon,klev))
163    allocate(cloudth_sigmaenv(klon,klev))
164    cloudth_sigmath = 0. ; cloudth_sigmaenv = 0.
165
166! Marine
167! Variables de sortie simulateur AIRS
168
169!     if (ok_airs) then
170      allocate (map_prop_hc(klon),map_prop_hist(klon))
171      allocate (alt_tropo(klon))
172      allocate (map_emis_hc(klon),map_iwp_hc(klon),map_deltaz_hc(klon))
173      allocate (map_pcld_hc(klon),map_tcld_hc(klon))
174      allocate (map_emis_hist(klon),map_iwp_hist(klon),map_deltaz_hist(klon))
175      allocate (map_rad_hist(klon))
176      allocate (map_ntot(klon),map_hc(klon),map_hist(klon))
177      allocate (map_Cb(klon),map_ThCi(klon),map_Anv(klon))
178      allocate (map_emis_Cb(klon),map_pcld_Cb(klon),map_tcld_Cb(klon))
179      allocate (map_emis_ThCi(klon),map_pcld_ThCi(klon),map_tcld_ThCi(klon))
180      allocate (map_emis_Anv(klon),map_pcld_Anv(klon),map_tcld_Anv(klon))
181!     endif
182
183    IF (ok_hines) allocate(zustr_gwd_hines(klon), zvstr_gwd_hines(klon))
184    IF (.not.ok_hines.and.ok_gwd_rando) &
185                  allocate(zustr_gwd_front(klon), zvstr_gwd_front(klon))
186    IF (ok_gwd_rando) allocate(zustr_gwd_rando(klon), zvstr_gwd_rando(klon))
187
188  END SUBROUTINE phys_output_var_init
189
190  !======================================================================
191  SUBROUTINE phys_output_var_end
192    USE dimphy
193    IMPLICIT NONE
194
195    include "clesphys.h"
196
197    deallocate(snow_o,zfra_o,itau_con)
198    deallocate (bils_ec,bils_ech,bils_tke,bils_diss,bils_kinetic,bils_enthalp,bils_latent)
199    deallocate (d_qw_col, d_ql_col, d_qs_col, d_qt_col, d_ek_col, d_h_dair_col &
200  &           , d_h_qw_col, d_h_ql_col, d_h_qs_col, d_h_col)
201
202    ! Outputs used in cloudth_vert
203    deallocate(cloudth_sth)
204    deallocate(cloudth_senv)
205    deallocate(cloudth_sigmath)
206    deallocate(cloudth_sigmaenv)
207
208! Marine
209! Variables de sortie simulateur AIRS
210
211 !    if (ok_airs) then
212      deallocate (map_prop_hc,map_prop_hist)
213      deallocate (alt_tropo)
214      deallocate (map_emis_hc,map_iwp_hc,map_deltaz_hc)
215      deallocate (map_pcld_hc,map_tcld_hc)
216      deallocate (map_emis_hist,map_iwp_hist,map_deltaz_hist)
217      deallocate (map_rad_hist)
218      deallocate (map_ntot,map_hc,map_hist)
219      deallocate (map_Cb,map_ThCi,map_Anv)
220      deallocate (map_emis_Cb,map_pcld_Cb,map_tcld_Cb)
221      deallocate (map_emis_ThCi,map_pcld_ThCi,map_tcld_ThCi)
222      deallocate (map_emis_Anv,map_pcld_Anv,map_tcld_Anv)
223  !   endif
224
225  END SUBROUTINE phys_output_var_end
226
227END MODULE phys_output_var_mod
Note: See TracBrowser for help on using the repository browser.