2 ***************************************************************
5 * et calcul
de leurs coefficients normalisés. *
7 * written
by : jean-yves grandpeix, 06/06/2006, 19.39.27 *
9 ***************************************************************
16 CHARACTER (LEN=20) :: modname=
'cv3_inip'
17 CHARACTER (LEN=80) :: abort_message
20 c -- mixing probability distribution functions
22 real qcoef1,qcoef2,qff,qfff,qmix,rmix,qmix1,rmix1,qmix2,rmix2,
f
26 qff(
f) = max(min(
f,1.),0.)
28 qmix1(
f) = ( tanh((qff(
f) - fmax)/
gammas)+qcoef1max )/
31 1 +qff(
f)*qcoef1max ) / qcoef2max
32 qmix2(
f) = -log(1.-qfff(
f))/
scut
33 rmix2(
f) = (qfff(
f)+(1.-qff(
f))*log(1.-qfff(
f)))/
scut
37 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
40 c===========================================================================
41 c READ in parameters for the mixing distribution
42 c and pass these through a
COMMON block to
SUBROUTINE convect etc.
43 c(written
by v.t.
j. phillips, 20-30/jan/99)
44 c===========================================================================
46 c line 1: a flag(0 or 1) to decide whether p(
f) = 1 or the general p(
f) is to be
47 c used, followed
by scut, which is the cut-off value of
f in convect
49 c line 3: the coefficients for the linear combination of p(
f)s to
50 c make the general p(
f)
52 c line 5:
gammas, fmax for the cosh^2 component of p(
f)
54 c line 7:
alphas for the 1st irrational p(
f)
56 c line 9:
betas for the 2nd irrational p(
f)
59 cc$$$
open(57,file=
'parameter_mix.data')
61 cc$$$
read(57,*) iflag_mix,
scut
63 cc$$$
if(iflag_mix .gt. 0)
then
66 cc$$$
read(57,*)
gammas, fmax
73 if(iflag_mix .gt. 0)
then
75 c-- normalize pdf weights
81 qcoef1max = qcoef1(fmax)
82 qcoef2max = qcoef2(fmax)
90 c do ff = 0.0 + df, 1.0 - 2.*df, df
92 dowhile( ff .le. 1.0 - 2.*df )
93 pdf = (qmix(ff+df) - qmix(ff)) * (1.-ff) / df
94 aire=
aire+(qmix(ff+df) - qmix(ff)) * (1.-ff)
95 mu =
mu + pdf * ff * df
97 & pdf, qmix(ff),
aire, ff
101 c do ff=0.0+df,1.0 - 2.*df,df
103 dowhile( ff .le. 1.0 - 2.*df )
104 pdf = (qmix(ff+df)- qmix(ff)) * (1.-ff) / df
105 sigma = sigma+pdf*(ff -
mu)*(ff -
mu)*df
110 if (abs(
aire-1.0) .gt. 0.02)
then
111 write(
lunout,*)
'WARNING:: AREA OF MIXING PDF IS::',
aire
115 print *,
'Area, mean & std deviation are ::',
aire,
mu,sigma