source: LMDZ6/trunk/libf/phylmd/phys_output_var_mod.f90 @ 5353

Last change on this file since 5353 was 5282, checked in by abarral, 7 weeks ago

Turn iniprint.h clesphys.h into modules
Remove unused description.h

  • 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: 13.7 KB
RevLine 
[1335]1!
2! phys_local_var_mod.F90 1327 2010-03-17 15:33:56Z idelkadi $
3
[1938]4MODULE phys_output_var_mod
[1335]5
[2854]6  USE dimphy
[4046]7  USE strings_mod, ONLY: maxlen
[1938]8  ! Variables outputs pour les ecritures des sorties
9  !======================================================================
10  !
11  !
12  !======================================================================
13  ! Declaration des variables
[1335]14
[1938]15  REAL, SAVE, ALLOCATABLE :: snow_o(:), zfra_o(:)
16  !$OMP THREADPRIVATE(snow_o, zfra_o)
[3110]17  REAL, SAVE, ALLOCATABLE :: sza_o(:) ! solar zenithal angle
18  !$OMP THREADPRIVATE(sza_o)
[1938]19  INTEGER, SAVE, ALLOCATABLE ::  itau_con(:)       ! Nombre de pas ou rflag <= 1
20  !$OMP THREADPRIVATE(itau_con)
[2585]21  REAL, SAVE, ALLOCATABLE :: bils_ec(:) ! Contribution of energy conservation
22  REAL, SAVE, ALLOCATABLE :: bils_ech(:) ! Contribution of energy conservation
23  REAL, SAVE, ALLOCATABLE :: bils_tke(:) ! Contribution of energy conservation
24  REAL, SAVE, ALLOCATABLE :: bils_diss(:) ! Contribution of energy conservation
25  REAL, SAVE, ALLOCATABLE :: bils_kinetic(:) ! bilan de chaleur au sol, kinetic
26  REAL, SAVE, ALLOCATABLE :: bils_enthalp(:) ! bilan de chaleur au sol
27  REAL, SAVE, ALLOCATABLE :: bils_latent(:) ! bilan de chaleur au sol
[2042]28  !$OMP THREADPRIVATE(bils_ec,bils_ech,bils_tke,bils_diss,bils_kinetic,bils_enthalp,bils_latent)
[2799]29  ! output variables for energy conservation tests, computed in add_phys_tend
30  REAL, SAVE, ALLOCATABLE :: d_qw_col(:)      ! watter vapour mass budget for each column (kg/m2/s)
31  REAL, SAVE, ALLOCATABLE :: d_ql_col(:)      ! liquid watter mass budget for each column (kg/m2/s)
[4523]32  REAL, SAVE, ALLOCATABLE :: d_qs_col(:)      ! cloud ice mass budget for each column (kg/m2/s)
33  REAL, SAVE, ALLOCATABLE :: d_qbs_col(:)     ! blowing snow mass budget for each column (kg/m2/s)
[2799]34  REAL, SAVE, ALLOCATABLE :: d_qt_col(:)      ! total watter mass budget for each column (kg/m2/s)
35  REAL, SAVE, ALLOCATABLE :: d_ek_col(:)      ! kinetic energy budget for each column (W/m2)
36  REAL, SAVE, ALLOCATABLE :: d_h_dair_col(:)  ! enthalpy budget of dry air for each column (W/m2)
37  REAL, SAVE, ALLOCATABLE :: d_h_qw_col(:)    ! enthalpy budget of watter vapour for each column (W/m2)
38  REAL, SAVE, ALLOCATABLE :: d_h_ql_col(:)    ! enthalpy budget of liquid watter for each column (W/m2)
[4523]39  REAL, SAVE, ALLOCATABLE :: d_h_qs_col(:)    ! enthalpy budget of cloud ice  for each column (W/m2)
40  REAL, SAVE, ALLOCATABLE :: d_h_qbs_col(:)    ! enthalpy budget of blowing snow for each column (W/m2)
[2799]41  REAL, SAVE, ALLOCATABLE :: d_h_col(:)       ! total enthalpy budget for each column (W/m2)
[4523]42  !$OMP THREADPRIVATE(d_qw_col, d_ql_col, d_qs_col, d_qbs_col, d_qt_col, d_ek_col, d_h_dair_col)
43  !$OMP THREADPRIVATE(d_h_qw_col, d_h_ql_col, d_h_qs_col, d_h_qbs_col, d_h_col)
[1753]44
[2958]45  ! Outputs used in cloudth_vert to extract the moments of the horizontal and
46  ! vertical PDFs
47  REAL, SAVE, ALLOCATABLE :: cloudth_sth(:,:),cloudth_senv(:,:)
48  !$OMP THREADPRIVATE(cloudth_sth,cloudth_senv)
49  REAL, SAVE, ALLOCATABLE :: cloudth_sigmath(:,:),cloudth_sigmaenv(:,:)
50  !$OMP THREADPRIVATE(cloudth_sigmath,cloudth_sigmaenv)
51
[2580]52! Marine
53! Variables de sortie du simulateur AIRS
[1865]54
[2585]55  REAL, SAVE, ALLOCATABLE :: map_prop_hc(:),map_prop_hist(:),alt_tropo(:)
56  !$OMP THREADPRIVATE(map_prop_hc,map_prop_hist,alt_tropo)
57  REAL, SAVE, ALLOCATABLE :: map_emis_hc(:),map_iwp_hc(:),map_deltaz_hc(:), &
58                       map_pcld_hc(:),map_tcld_hc(:)
59  !$OMP THREADPRIVATE(map_emis_hc,map_iwp_hc,map_deltaz_hc,map_pcld_hc,map_tcld_hc)
60  REAL, SAVE, ALLOCATABLE :: map_emis_hist(:),map_iwp_hist(:),map_deltaz_hist(:),map_rad_hist(:)         
61  !$OMP THREADPRIVATE(map_emis_hist,map_iwp_hist,map_deltaz_hist,map_rad_hist)
62  REAL, SAVE, ALLOCATABLE :: map_ntot(:),map_hc(:),map_hist(:)
63  REAL, SAVE, ALLOCATABLE :: map_Cb(:),map_ThCi(:),map_Anv(:)
64  !$OMP THREADPRIVATE(map_ntot,map_hc,map_hist,map_Cb,map_ThCi,map_Anv)
65  REAL, SAVE, ALLOCATABLE :: map_emis_Cb(:),map_pcld_Cb(:),map_tcld_Cb(:)
66  REAL, SAVE, ALLOCATABLE :: map_emis_ThCi(:),map_pcld_ThCi(:),map_tcld_ThCi(:)
67  !$OMP THREADPRIVATE(map_emis_Cb,map_pcld_Cb,map_tcld_Cb,map_emis_ThCi)
68  REAL, SAVE, ALLOCATABLE :: map_emis_Anv(:),map_pcld_Anv(:),map_tcld_Anv(:)
[4703]69  !$OMP THREADPRIVATE(map_pcld_ThCi,map_tcld_ThCi,map_emis_Anv,map_pcld_Anv,map_tcld_Anv)
70
71  ! variables deplacees de phys_local_var_mod
72  REAL, SAVE, ALLOCATABLE :: scdnc(:,:)
73  !$OMP THREADPRIVATE(scdnc)
74  REAL, SAVE, ALLOCATABLE :: cldncl(:)
75  !$OMP THREADPRIVATE(cldncl)
76  REAL, SAVE, ALLOCATABLE :: reffclwtop(:)
77  !$OMP THREADPRIVATE(reffclwtop)
78  REAL, SAVE, ALLOCATABLE :: lcc(:)
79  !$OMP THREADPRIVATE(lcc)
80  REAL, SAVE, ALLOCATABLE :: reffclws(:,:)
81  !$OMP THREADPRIVATE(reffclws)
82  REAL, SAVE, ALLOCATABLE :: reffclwc(:,:)
83  !$OMP THREADPRIVATE(reffclwc)
84  REAL, SAVE, ALLOCATABLE :: cldnvi(:)
85  !$OMP THREADPRIVATE(cldnvi)
86  REAL, SAVE, ALLOCATABLE :: lcc3d(:,:)
87  !$OMP THREADPRIVATE(lcc3d)
88  REAL, SAVE, ALLOCATABLE :: lcc3dcon(:,:)
89  !$OMP THREADPRIVATE(lcc3dcon)
90  REAL, SAVE, ALLOCATABLE :: lcc3dstra(:,:)
91  !$OMP THREADPRIVATE(lcc3dstra)
92  REAL, SAVE, ALLOCATABLE :: icc3dcon(:,:)
93  !$OMP THREADPRIVATE(icc3dcon)
94  REAL, SAVE, ALLOCATABLE :: icc3dstra(:,:)
95  !$OMP THREADPRIVATE(icc3dstra) 
[2585]96   
[2580]97
[1938]98  ! ug Plein de variables venues de phys_output_mod
[2752]99  INTEGER, PARAMETER                           :: nfiles = 10
[1938]100  LOGICAL, DIMENSION(nfiles), SAVE             :: clef_files
101  LOGICAL, DIMENSION(nfiles), SAVE             :: clef_stations
102  INTEGER, DIMENSION(nfiles), SAVE             :: lev_files
103  INTEGER, DIMENSION(nfiles), SAVE             :: nid_files
104  INTEGER, DIMENSION(nfiles), SAVE  :: nnid_files
105  !$OMP THREADPRIVATE(clef_files, clef_stations, lev_files,nid_files,nnid_files)
106  INTEGER, DIMENSION(nfiles), SAVE :: nnhorim
[1761]107
[1938]108  INTEGER, DIMENSION(nfiles), SAVE :: nhorim, nvertm
109  INTEGER, DIMENSION(nfiles), SAVE :: nvertap, nvertbp, nvertAlt
110  REAL, DIMENSION(nfiles), SAVE                :: zoutm
111  CHARACTER(LEN=20), DIMENSION(nfiles), SAVE   :: type_ecri
112  !$OMP THREADPRIVATE(nnhorim, nhorim, nvertm, zoutm,type_ecri)
113  CHARACTER(LEN=20), DIMENSION(nfiles), SAVE  :: type_ecri_files, phys_out_filetypes
114  !$OMP THREADPRIVATE(type_ecri_files, phys_out_filetypes)
115  CHARACTER(LEN=20), DIMENSION(nfiles), SAVE  :: phys_out_filenames
116  !$OMP THREADPRIVATE(phys_out_filenames)
[1791]117
[1938]118  ! swaero_diag : flag indicates if it is necessary to do calculation for some aerosol diagnostics
[3082]119  ! swaerofree_diag : flag indicates if it is necessary to do calculation for some aerosol diagnostics
[2854]120  ! dryaod_diag : flag indicates if it is necessary to do calculation for some aerosol diagnostics
[3987]121  !--OB: this needs to be set to FALSE by default and changed back to TRUE based on output requests
122  LOGICAL, SAVE                                :: swaerofree_diag=.FALSE.
123  LOGICAL, SAVE                                :: swaero_diag=.FALSE.
124  LOGICAL, SAVE                                :: dryaod_diag=.FALSE.
[3082]125  !$OMP THREADPRIVATE(swaerofree_diag, swaero_diag, dryaod_diag)
[3987]126 
[2989]127  ! ok_4xCO2atm : flag indicates if it is necessary to do a second call of
128  ! radiation code with a 4xCO2 or another different GES to assess SW/LW
129  ! in this case
[3987]130  !--IM: as for swaero_diag this needs to be set to FALSE by default and
131  !      changed back to TRUE based on output requests
132  LOGICAL, SAVE                                :: ok_4xCO2atm=.FALSE.
[2989]133  !$OMP THREADPRIVATE(ok_4xCO2atm)
[1791]134
[1938]135  INTEGER, SAVE:: levmin(nfiles) = 1
136  INTEGER, SAVE:: levmax(nfiles)
137  !$OMP THREADPRIVATE(levmin, levmax)
[1791]138
[1938]139  REAL, SAVE                :: zdtime_moy
140  !$OMP THREADPRIVATE(zdtime_moy)
[1797]141
[1938]142  LOGICAL, SAVE :: vars_defined = .FALSE. ! ug PAS THREADPRIVATE ET C'EST NORMAL
[1807]143
[2333]144  REAL, allocatable:: zustr_gwd_hines(:), zvstr_gwd_hines(:) ! (klon)
145  REAL, allocatable:: zustr_gwd_front(:), zvstr_gwd_front(:) ! (klon)
[1938]146  REAL, allocatable:: zustr_gwd_rando(:), zvstr_gwd_rando(:) ! (klon)
[2341]147  !$OMP THREADPRIVATE(zustr_gwd_hines, zvstr_gwd_hines)
148  !$OMP THREADPRIVATE(zustr_gwd_front, zvstr_gwd_front)
[1938]149  !$OMP THREADPRIVATE(zustr_gwd_rando, zvstr_gwd_rando)
150
[1791]151  TYPE ctrl_out
[4046]152     INTEGER               :: flag(nfiles)
153     CHARACTER(len=maxlen) :: name
154     CHARACTER(len=maxlen) :: description
155     CHARACTER(len=maxlen) :: unit
156     CHARACTER(len=maxlen) :: type_ecrit(nfiles)
[1791]157  END TYPE ctrl_out
[1938]158
[2538]159  REAL, SAVE, ALLOCATABLE :: sens_prec_liq_o(:,:), sens_prec_sol_o(:,:)
160  REAL, SAVE, ALLOCATABLE :: lat_prec_liq_o(:,:), lat_prec_sol_o(:,:)
161 !$OMP THREADPRIVATE(sens_prec_liq_o, sens_prec_sol_o,lat_prec_liq_o,lat_prec_sol_o)
162
[3815]163  ! Ocean-atmosphere interface, subskin ocean and near-surface ocean:
164 
[4370]165  REAL, SAVE, ALLOCATABLE:: tkt(:) ! (klon)
[5282]166  ! �paisseur (m) de la couche de diffusion thermique (microlayer)
[3815]167  ! cool skin thickness
168
[4370]169  REAL, SAVE, ALLOCATABLE:: tks(:) ! (klon)
[5282]170  ! �paisseur (m) de la couche de diffusion de masse (microlayer)
[3815]171 
[4370]172  REAL, SAVE, ALLOCATABLE:: taur(:) ! (klon) momentum flux due to rain, in Pa
[3815]173
[4370]174  REAL, SAVE, ALLOCATABLE:: sss(:) ! (klon)
[3815]175  ! bulk salinity of the surface layer of the ocean, in ppt
176 
[4370]177  !$OMP THREADPRIVATE(tkt, tks, taur, sss)
[3815]178
[4773]179  !AI. cloud_cover_sw, cloud_cover_sw_s2 from Ecrad (1rt and 2 call)
180  REAL, SAVE, ALLOCATABLE:: cloud_cover_sw(:), cloud_cover_sw_s2(:)
181  !$OMP THREADPRIVATE(cloud_cover_sw, cloud_cover_sw_s2)
182
[1335]183CONTAINS
184
[1938]185  !======================================================================
186  SUBROUTINE phys_output_var_init
[5282]187    USE clesphys_mod_h
[1938]188    use dimphy
[3815]189    use config_ocean_skin_m, only: activate_ocean_skin
[5282]190    USE clesphys_mod_h
[1938]191    IMPLICIT NONE
[1335]192
[1938]193    allocate(snow_o(klon), zfra_o(klon))
[3110]194    allocate(sza_o(klon) )
[1938]195    allocate(itau_con(klon))
[2538]196    allocate(sens_prec_liq_o(klon,2))
197    allocate(sens_prec_sol_o(klon,2))
198    allocate(lat_prec_liq_o(klon,2))
199    allocate(lat_prec_sol_o(klon,2))
200    sens_prec_liq_o = 0.0 ; sens_prec_sol_o = 0.0
201    lat_prec_liq_o = 0.0 ; lat_prec_sol_o = 0.0
202
[2042]203    allocate (bils_ec(klon),bils_ech(klon),bils_tke(klon),bils_diss(klon),bils_kinetic(klon),bils_enthalp(klon),bils_latent(klon))
[4523]204    allocate (d_qw_col(klon), d_ql_col(klon), d_qs_col(klon), d_qbs_col(klon), d_qt_col(klon), d_ek_col(klon), d_h_dair_col(klon) &
205  &         , d_h_qw_col(klon), d_h_ql_col(klon), d_h_qs_col(klon), d_h_qbs_col(klon), d_h_col(klon))
206    d_qw_col=0. ; d_ql_col=0. ; d_qs_col=0. ; d_qbs_col=0. ; d_qt_col=0. ; d_ek_col=0. ; d_h_dair_col =0.
207    d_h_qw_col=0. ; d_h_ql_col=0. ; d_h_qs_col=0. ; d_h_qbs_col=0. ; d_h_col=0.
[1335]208
[2958]209    ! Outputs used in cloudth_vert
210    allocate(cloudth_sth(klon,klev))
211    allocate(cloudth_senv(klon,klev))
[5282]212    cloudth_sth = 0. ; cloudth_senv = 0.
[2958]213    allocate(cloudth_sigmath(klon,klev))
214    allocate(cloudth_sigmaenv(klon,klev))
215    cloudth_sigmath = 0. ; cloudth_sigmaenv = 0.
216
[2580]217! Marine
218! Variables de sortie simulateur AIRS
219
[2585]220!     if (ok_airs) then
[2580]221      allocate (map_prop_hc(klon),map_prop_hist(klon))
222      allocate (alt_tropo(klon))
[2582]223      allocate (map_emis_hc(klon),map_iwp_hc(klon),map_deltaz_hc(klon))
[2580]224      allocate (map_pcld_hc(klon),map_tcld_hc(klon))
225      allocate (map_emis_hist(klon),map_iwp_hist(klon),map_deltaz_hist(klon))
226      allocate (map_rad_hist(klon))
227      allocate (map_ntot(klon),map_hc(klon),map_hist(klon))
228      allocate (map_Cb(klon),map_ThCi(klon),map_Anv(klon))
229      allocate (map_emis_Cb(klon),map_pcld_Cb(klon),map_tcld_Cb(klon))
230      allocate (map_emis_ThCi(klon),map_pcld_ThCi(klon),map_tcld_ThCi(klon))
231      allocate (map_emis_Anv(klon),map_pcld_Anv(klon),map_tcld_Anv(klon))
[2585]232!     endif
[2580]233
[2333]234    IF (ok_hines) allocate(zustr_gwd_hines(klon), zvstr_gwd_hines(klon))
235    IF (.not.ok_hines.and.ok_gwd_rando) &
236                  allocate(zustr_gwd_front(klon), zvstr_gwd_front(klon))
[1938]237    IF (ok_gwd_rando) allocate(zustr_gwd_rando(klon), zvstr_gwd_rando(klon))
[1335]238
[4370]239    if (activate_ocean_skin >= 1) allocate(tkt(klon), tks(klon), taur(klon), &
240         sss(klon))
[3815]241
[4703]242! Sorties de lmdz_cloud_optics_pro
243    ALLOCATE(scdnc(klon, klev))
244    ALLOCATE(cldncl(klon))
245    ALLOCATE(reffclwtop(klon))
246    ALLOCATE(lcc(klon))
247    ALLOCATE(reffclws(klon, klev))
248    ALLOCATE(reffclwc(klon, klev))
249    ALLOCATE(cldnvi(klon))
250    ALLOCATE(lcc3d(klon, klev))
251    ALLOCATE(lcc3dcon(klon, klev))
252    ALLOCATE(lcc3dstra(klon, klev))
253    ALLOCATE(icc3dcon(klon, klev))
254    ALLOCATE(icc3dstra(klon, klev))
255
[4773]256    ! cloud_cover_sw, cloud_cover_sw_s2 from Ecrad
257    ALLOCATE(cloud_cover_sw(klon))
258    ALLOCATE(cloud_cover_sw_s2(klon))
259
[1938]260  END SUBROUTINE phys_output_var_init
[1335]261
[1938]262  !======================================================================
263  SUBROUTINE phys_output_var_end
[2854]264    USE dimphy
[1938]265    IMPLICIT NONE
266
[2582]267
[1938]268    deallocate(snow_o,zfra_o,itau_con)
[3110]269    deallocate(sza_o)
[2042]270    deallocate (bils_ec,bils_ech,bils_tke,bils_diss,bils_kinetic,bils_enthalp,bils_latent)
[4523]271    deallocate (d_qw_col, d_ql_col, d_qs_col, d_qbs_col, d_qt_col, d_ek_col, d_h_dair_col &
272  &           , d_h_qw_col, d_h_ql_col, d_h_qs_col, d_h_qbs_col, d_h_col)
[1938]273
[2958]274    ! Outputs used in cloudth_vert
275    deallocate(cloudth_sth)
276    deallocate(cloudth_senv)
277    deallocate(cloudth_sigmath)
278    deallocate(cloudth_sigmaenv)
279
[2580]280! Marine
281! Variables de sortie simulateur AIRS
282
[2585]283 !    if (ok_airs) then
[2580]284      deallocate (map_prop_hc,map_prop_hist)
285      deallocate (alt_tropo)
[2582]286      deallocate (map_emis_hc,map_iwp_hc,map_deltaz_hc)
[2580]287      deallocate (map_pcld_hc,map_tcld_hc)
288      deallocate (map_emis_hist,map_iwp_hist,map_deltaz_hist)
289      deallocate (map_rad_hist)
290      deallocate (map_ntot,map_hc,map_hist)
291      deallocate (map_Cb,map_ThCi,map_Anv)
292      deallocate (map_emis_Cb,map_pcld_Cb,map_tcld_Cb)
293      deallocate (map_emis_ThCi,map_pcld_ThCi,map_tcld_ThCi)
294      deallocate (map_emis_Anv,map_pcld_Anv,map_tcld_Anv)
[2585]295  !   endif
[2580]296
[4703]297    DEALLOCATE(scdnc)
298    DEALLOCATE(cldncl)
299    DEALLOCATE(reffclwtop)
300    DEALLOCATE(lcc)
301    DEALLOCATE(reffclws)
302    DEALLOCATE(reffclwc)
303    DEALLOCATE(cldnvi)
304    DEALLOCATE(lcc3d)
305    DEALLOCATE(lcc3dcon)
306    DEALLOCATE(lcc3dstra)
307    DEALLOCATE(icc3dcon)
308    DEALLOCATE(icc3dstra)
309
[4773]310    !AI cloud_cover_sw, cloud_cover_sw_s2 from Ecrad
311    DEALLOCATE(cloud_cover_sw, cloud_cover_sw_s2)
312
[1938]313  END SUBROUTINE phys_output_var_end
314
[1335]315END MODULE phys_output_var_mod
Note: See TracBrowser for help on using the repository browser.