source: LMDZ6/branches/cirrus/libf/phylmd/cosp/mod_cosp_constants.F90 @ 5202

Last change on this file since 5202 was 4785, checked in by idelkadi, 10 months ago

Declaration change in the mod_cosp_constants.F90 routine to resolve compilation problems with some compilers

  • 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: 15.1 KB
Line 
1! (c) British Crown Copyright 2008, the Met Office.
2! All rights reserved.
3!
4! Redistribution and use in source and binary forms, with or without modification, are permitted
5! provided that the following conditions are met:
6!
7!     * Redistributions of source code must retain the above copyright notice, this list
8!       of conditions and the following disclaimer.
9!     * Redistributions in binary form must reproduce the above copyright notice, this list
10!       of conditions and the following disclaimer in the documentation and/or other materials
11!       provided with the distribution.
12!     * Neither the name of the Met Office nor the names of its contributors may be used
13!       to endorse or promote products derived from this software without specific prior written
14!       permission.
15!
16! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
17! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
18! FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20! DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21! DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
22! IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
23! OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
25!
26! History:
27! Jul 2007 - A. Bodas-Salcedo - Initial version
28! Jul 2008 - A. Bodas-Salcedo - Added definitions of ISCCP axes
29! Oct 2008 - H. Chepfer       - Added PARASOL_NREFL
30! Jun 2010 - R. Marchand      - Modified to support quickbeam V3, added ifdef for hydrometeor definitions
31!
32!
33!
34
35!!#INCLUDE "cosp_defs.h"
36#define MMF_V3_SINGLE_MOMENT mmf_v3_single_momen
37MODULE MOD_COSP_CONSTANTS
38    IMPLICIT NONE
39
40    character(len=32) :: COSP_VERSION='COSP v1.4'
41
42    ! Mode debug ou prod (AI 0302018)
43    logical :: ok_debug_cosp = .true.
44
45    ! Indices to address arrays of LS and CONV hydrometeors
46    integer,parameter :: I_LSCLIQ = 1
47    integer,parameter :: I_LSCICE = 2
48    integer,parameter :: I_LSRAIN = 3
49    integer,parameter :: I_LSSNOW = 4
50    integer,parameter :: I_CVCLIQ = 5
51    integer,parameter :: I_CVCICE = 6
52    integer,parameter :: I_CVRAIN = 7
53    integer,parameter :: I_CVSNOW = 8
54    integer,parameter :: I_LSGRPL = 9
55
56    ! Missing value
57    real,parameter :: R_UNDEF = -1.0E30
58
59    ! Number of possible output variables
60    integer,parameter :: N_OUT_LIST = 74 !OPAQ 65+7 !TIBO 72+2
61    integer,parameter :: N3D = 11                   !TIBO 10+1
62    integer,parameter :: N2D = 19        !OPAQ 14+4 !TIBO 18+1
63    integer,parameter :: N1D = 43        !OPAQ 40+3
64
65    ! Value for forward model result from a level that is under the ground
66    real,parameter :: R_GROUND = -1.0E20
67
68    ! Stratiform and convective clouds in frac_out
69    integer, parameter :: I_LSC = 1, & ! Large-scale clouds
70                          I_CVC = 2    ! Convective clouds
71
72    ! Timing of different simulators, including statistics module
73    integer, parameter :: N_SIMULATORS = 7
74    integer,parameter :: I_RADAR = 1
75    integer,parameter :: I_LIDAR = 2
76    integer,parameter :: I_ISCCP = 3
77    integer,parameter :: I_MISR  = 4
78    integer,parameter :: I_MODIS = 5
79    integer,parameter :: I_RTTOV = 6
80    integer,parameter :: I_STATS = 7
81    character*32, dimension(N_SIMULATORS) :: SIM_NAME = (/'Radar','Lidar','ISCCP','MISR ','MODIS','RTTOV','Stats'/)
82    integer,dimension(N_SIMULATORS) :: tsim
83    data tsim/N_SIMULATORS*0.0/
84
85    !--- Radar constants
86    ! CFAD constants
87    integer,parameter :: DBZE_BINS     =   15   ! Number of dBZe bins in histogram (cfad)
88    real,parameter    :: DBZE_MIN      = -100.0 ! Minimum value for radar reflectivity
89    real,parameter    :: DBZE_MAX      =   80.0 ! Maximum value for radar reflectivity
90    real,parameter    :: CFAD_ZE_MIN   =  -50.0 ! Lower value of the first CFAD Ze bin
91    real,parameter    :: CFAD_ZE_WIDTH =    5.0 ! Bin width (dBZe)
92
93
94    !--- Lidar constants
95    ! CFAD constants
96    integer,parameter :: SR_BINS       =   15
97    integer,parameter :: DPOL_BINS     =   6
98    real,parameter    :: LIDAR_UNDEF   =   999.999
99
100    ! Other constants
101    integer,parameter :: LIDAR_NCAT    =   4
102    integer,parameter :: LIDAR_NTYPE   =   3 !OPAQ
103    integer,parameter :: PARASOL_NREFL =   5 ! parasol
104    real,parameter,dimension(PARASOL_NREFL) :: PARASOL_SZA = (/0.0, 20.0, 40.0, 60.0, 80.0/)
105    real,parameter    :: DEFAULT_LIDAR_REFF = 30.0e-6 ! Default lidar effective radius
106
107    integer,parameter :: LIDAR_NTEMP = 40
108    real,parameter,dimension(LIDAR_NTEMP) :: LIDAR_PHASE_TEMP=(/-91.5,-88.5,-85.5,-82.5,-79.5,-76.5,-73.5,-70.5,-67.5,-64.5, &
109                   -61.5,-58.5,-55.5,-52.5,-49.5,-46.5,-43.5,-40.5,-37.5,-34.5, &
110                   -31.5,-28.5,-25.5,-22.5,-19.5,-16.5,-13.5,-10.5, -7.5, -4.5, &
111                    -1.5,  1.5,  4.5,  7.5, 10.5, 13.5, 16.5, 19.5, 22.5, 25.5/)
112    real,parameter,dimension(2,LIDAR_NTEMP) :: LIDAR_PHASE_TEMP_BNDS=reshape(source=(/-273.15,-90.,-90.,-87.,-87.,-84.,-84.,-81.,-81.,-78., &
113                   -78.,-75.,-75.,-72.,-72.,-69.,-69.,-66.,-66.,-63., &
114                   -63.,-60.,-60.,-57.,-57.,-54.,-54.,-51.,-51.,-48., &
115                   -48.,-45.,-45.,-42.,-42.,-39.,-39.,-36.,-36.,-33., &
116                   -33.,-30.,-30.,-27.,-27.,-24.,-24.,-21.,-21.,-18., &
117                   -18.,-15.,-15.,-12.,-12., -9., -9., -6., -6., -3., &
118                    -3.,  0.,  0.,  3.,  3.,  6.,  6.,  9.,  9., 12., &
119                    12., 15., 15., 18., 18., 21., 21., 24., 24.,100./),shape=(/2,40/))
120
121    !--- MISR constants
122    integer,parameter :: MISR_N_CTH = 16
123
124    !--- RTTOV constants
125    integer,parameter :: RTTOV_MAX_CHANNELS = 20
126
127    ! ISCCP tau-Pc axes
128    real,parameter,dimension(7) :: ISCCP_TAU = (/0.15, 0.80, 2.45, 6.5, 16.2, 41.5, 100.0/)
129    real,parameter,dimension(2,7) :: ISCCP_TAU_BNDS = reshape(source=(/0.0,0.3,0.3,1.30,1.30,3.6,3.6,9.4, &
130                                                      9.4,23.0,23.0,60.0,60.0,100000.0/), shape=(/2,7/))
131
132    real,parameter,dimension(7) :: ISCCP_PC = (/90000., 74000., 62000., 50000., 37500., 24500., 9000./)
133    real,parameter,dimension(2,7) :: ISCCP_PC_BNDS = reshape(source=(/100000.0,80000.0,80000.0,68000.0,68000.0,56000.0 &
134                               ,56000.0,44000.0,44000.0,31000.0,31000.0,18000.0,18000.0,0.0/), shape=(/2,7/))
135
136    real,parameter,dimension(MISR_N_CTH) :: MISR_CTH = 1000.0*(/ 0., 0.25, 0.75, 1.25, 1.75, 2.25, 2.75, 3.5, &
137                                            4.5, 6., 8., 10., 12., 14.5, 16., 18./)
138    real,parameter,dimension(2,MISR_N_CTH) :: MISR_CTH_BNDS = 1000.0*reshape(source=(/ &
139                                            -99.0,  0.0,       0.0,  0.5,       0.5,  1.0,      1.0,  1.5, &
140                                              1.5,  2.0,       2.0,  2.5,       2.5,  3.0,      3.0,  4.0, &
141                                              4.0,  5.0,       5.0,  7.0,       7.0,  9.0,      9.0, 11.0, &
142                                             11.0, 13.0,      13.0, 15.0,      15.0, 17.0,     17.0, 99.0/), &
143                                             shape=(/2,MISR_N_CTH/))
144
145
146    !
147    ! The following code was modifed by Roj with implementation of quickbeam V3
148    !   (1) use ifdef to support more than one microphyscis scheme
149    !   (2) added constants  microphysic_scheme_name, LOAD_scale_LUTs, and SAVE_scale_LUTs
150    !
151
152    ! directory where LUTs will be stored
153    character*120 :: RADAR_SIM_LUT_DIRECTORY = './'
154
155#ifdef MMF_V3_SINGLE_MOMENT
156
157    !       
158    !  Table hclass for quickbeam to support one-moment (bulk) microphysics scheme used by MMF V3.0 & V3.5
159    !
160
161    !
162    ! NOTE:  if ANY value in this section of code is changed, the existing LUT
163    !        (i.e., the associated *.dat file) MUST be deleted so that a NEW
164    !        LUT will be created !!!
165    !
166    character*120 :: RADAR_SIM_MICROPHYSICS_SCHEME_NAME = 'MMF_v3_single_moment'
167
168    logical :: RADAR_SIM_LOAD_scale_LUTs_flag   = .false.
169    logical :: RADAR_SIM_UPDATE_scale_LUTs_flag = .false.
170    integer,parameter :: N_HYDRO = 9
171
172    integer :: HCLASS_TYPE(N_HYDRO),HCLASS_PHASE(N_HYDRO)
173
174    real :: HCLASS_DMIN(N_HYDRO),HCLASS_DMAX(N_HYDRO), &
175            HCLASS_APM(N_HYDRO),HCLASS_BPM(N_HYDRO),HCLASS_RHO(N_HYDRO), &
176            HCLASS_P1(N_HYDRO),HCLASS_P2(N_HYDRO),HCLASS_P3(N_HYDRO)
177
178    ! HCLASS_CP is not used in the version of Quickbeam included in COSP
179    !                   LSL    LSI      LSR     LSS   CVL    CVI   CVR     CVS   LSG
180    data HCLASS_TYPE/    5,      1,      2,      2,     5,     1,   2,      2,    2/
181    data HCLASS_PHASE/   0,      1,      0,      1,     0,     1,   0,      1,    1/
182    data HCLASS_DMIN/   -1,     -1,     -1,     -1,    -1,    -1,   -1,    -1,   -1/
183    data HCLASS_DMAX/   -1,     -1,     -1,     -1,    -1,    -1,   -1,    -1,   -1/
184    data HCLASS_APM/   524,  110.8,    524,     -1,   524, 110.8,  524,    -1,   -1/
185    data HCLASS_BPM/     3,   2.91,      3,     -1,     3,  2.91,    3,    -1,   -1/
186    data HCLASS_RHO/    -1,     -1,     -1,    100,    -1,    -1,   -1,   100,  400/
187    data HCLASS_P1/     -1,     -1,   8.e6,   3.e6,    -1,    -1, 8.e6,  3.e6, 4.e6/
188    data HCLASS_P2/      6,     40,     -1,      -1,    6,    40,   -1,    -1,   -1/
189    data HCLASS_P3/    0.3,      2,     -1,      -1,  0.3,     2,   -1,    -1,   -1/
190
191    ! NOTES on HCLASS variables
192    !
193    ! TYPE - Set to
194    ! 1 for modified gamma distribution,
195    ! 2 for exponential distribution,
196    ! 3 for power law distribution,
197    ! 4 for monodisperse distribution,
198    ! 5 for lognormal distribution.
199
200    ! PHASE - Set to 0 for liquid, 1 for ice.
201
202    ! DMIN - The minimum drop size for this class (micron), ignored for monodisperse.
203    ! DMAX - The maximum drop size for this class (micron), ignored for monodisperse.
204    ! Important note: The settings for DMIN and DMAX are
205    ! ignored in the current version for all distributions except for power
206    ! law. Except when the power law distribution is used, particle size
207    ! is fixed to vary from zero to infinity, a restriction that is expected
208    ! to be lifted in future versions. A placeholder must still be specified
209    ! for each.
210
211    ! Density of particles is given by apm*D^bpm or a fixed value rho. ONLY specify ONE of these two!!
212    ! APM - The alpha_m coefficient in equation (1) (kg m**-beta_m )
213    ! BPM - The beta_m coefficient in equation (1), see section 4.1.
214
215    ! RHO - Hydrometeor density (kg m-3 ).
216
217    ! P1, P2, P3 - are default distribution parameters that depend on the type
218    ! of distribution (see quickmbeam documentation for more information)
219    !
220    ! Modified Gamma (must set P3 and one of P1 or P2)
221    ! P1 - Set to the total particle number concentration Nt /rho_a (kg-1 ), where
222    ! rho_a is the density of air in the radar volume.
223    ! P2 - Set to the particle mean diameter D (micron).
224    ! P3 - Set to the distribution width nu.
225    !
226    ! Exponetial (set one of)
227    ! P1 - Set to a constant intercept parameter N0 (m-4).
228    ! P2 - Set to a constant lambda (micron-1).
229    !
230    ! Power Law
231    ! P1 - Set this to the value of a constant power law parameter br
232    !
233    ! Monodisperse
234    ! P1 - Set to a constant diameter D0 (micron) = Re.
235    !
236    ! Log-normal (must set P3 and one of P1 or P2)
237    ! P1 - Set to the total particle number concentration Nt /rho_a (kg-1 )
238    ! P2 - Set to the geometric mean particle radius rg (micron).
239    ! P3 - Set to the natural logarithm of the geometric standard deviation.
240    !
241
242
243    real,dimension(N_HYDRO) :: N_ax,N_bx,alpha_x,c_x,d_x,g_x,a_x,b_x,gamma_1,gamma_2,gamma_3,gamma_4
244
245    ! Microphysical settings for the precipitation flux to mixing ratio conversion
246    !                LSL    LSI       LSR       LSS   CVL    CVI       CVR       CVS      LSG
247    data N_ax/       -1.,   -1.,     8.e6,     3.e6,  -1.,   -1.,     8.e6,     3.e6,     4.e6/
248    data N_bx/       -1.,   -1.,      0.0,      0.0,  -1.,   -1.,      0.0,      0.0,      0.0/
249    data alpha_x/    -1.,   -1.,      0.0,      0.0,  -1.,   -1.,      0.0,      0.0,      0.0/
250    data c_x/        -1.,   -1.,    842.0,     4.84,  -1.,   -1.,    842.0,     4.84,     94.5/
251    data d_x/        -1.,   -1.,      0.8,     0.25,  -1.,   -1.,      0.8,     0.25,      0.5/
252    data g_x/        -1.,   -1.,      0.5,      0.5,  -1.,   -1.,      0.5,      0.5,      0.5/
253    data a_x/        -1.,   -1.,    524.0,    52.36,  -1.,   -1.,    524.0,    52.36,   209.44/
254    data b_x/        -1.,   -1.,      3.0,      3.0,  -1.,   -1.,      3.0,      3.0,      3.0/
255    data gamma_1/    -1.,   -1., 17.83725, 8.284701,  -1.,   -1., 17.83725, 8.284701, 11.63230/
256    data gamma_2/    -1.,   -1.,      6.0,      6.0,  -1.,   -1.,      6.0,      6.0,      6.0/
257    data gamma_3/    -1.,   -1.,      2.0,      2.0,  -1.,   -1.,      2.0,      2.0,      2.0/
258    data gamma_4/    -1.,   -1.,      6.0,      6.0,  -1.,   -1.,      6.0,      6.0,      6.0/
259
260
261
262#endif
263
264
265#ifdef MMF_V3p5_TWO_MOMENT
266
267    !
268    !  Table hclass for quickbeam to support two-moment "morrison" microphysics scheme used by V3.5 (SAM 6.8)
269    !
270    !  This Number concentriation Np in [1/kg] MUST be input to COSP/radar simulator
271    !
272    !  NOTE:  Be sure to check that the ice-density (rho) set it this tables matches what you used
273    !
274
275    !
276    ! NOTE:  if ANY value in this section of code is changed, the existing LUT
277    !        (i.e., the associated *.dat file) MUST be deleted so that a NEW
278    !        LUT will be created !!!
279    !
280    character*120 :: RADAR_SIM_MICROPHYSICS_SCHEME_NAME = 'MMF_v3.5_two_moment'
281
282    logical :: RADAR_SIM_LOAD_scale_LUTs_flag   = .false.
283    logical :: RADAR_SIM_UPDATE_scale_LUTs_flag = .false.
284
285    integer,parameter :: N_HYDRO = 9
286
287    integer :: HCLASS_TYPE(N_HYDRO),HCLASS_PHASE(N_HYDRO)
288
289    real :: HCLASS_DMIN(N_HYDRO),HCLASS_DMAX(N_HYDRO), &           
290            HCLASS_APM(N_HYDRO),HCLASS_BPM(N_HYDRO),HCLASS_RHO(N_HYDRO), &
291            HCLASS_P1(N_HYDRO),HCLASS_P2(N_HYDRO),HCLASS_P3(N_HYDRO)
292
293    ! HCLASS_CP is not used in the version of Quickbeam included in COSP
294    !                   LSL    LSI      LSR     LSS   CVL    CVI   CVR     CVS   LSG
295    data HCLASS_TYPE/    1,      1,      1,      1,     1,     1,    1,      1,    1/
296    data HCLASS_PHASE/   0,      1,      0,      1,     0,     1,    0,      1,    1/
297    data HCLASS_DMIN/   -1,     -1,     -1,     -1,    -1,    -1,   -1,     -1,   -1/
298    data HCLASS_DMAX/   -1,     -1,     -1,     -1,    -1,    -1,   -1,     -1,   -1/
299    data HCLASS_APM/   524,     -1,    524,     -1,   524,    -1,  524,     -1,   -1/
300    data HCLASS_BPM/     3,     -1,      3,     -1,     3,    -1,    3,     -1,   -1/
301    data HCLASS_RHO/    -1,    500,     -1,    100,    -1,   500,   -1,    100,  900/
302    data HCLASS_P1/     -1,     -1,     -1,     -1,    -1,    -1,   -1,     -1,   -1/
303    data HCLASS_P2/     -1,     -1,     -1,     -1,    -1,    -1,   -1,     -1,   -1/
304    data HCLASS_P3/     -2,      1,      1,      1,    -2,     1,    1,      1,    1/
305    ! Note: value of "-2" for HCLASS_P3 uses martin 1994 parameteriztion of gamma function width with Number concentration
306#endif
307
308END MODULE MOD_COSP_CONSTANTS
Note: See TracBrowser for help on using the repository browser.