source: LMDZ6/branches/Ocean_skin/libf/phylmd/phys_output_var_mod.F90 @ 4115

Last change on this file since 4115 was 4021, checked in by lguez, 3 years ago

Polish

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