Changeset 5158 for LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_inicp.F90
- Timestamp:
- Aug 2, 2024, 2:12:03 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_inicp.F90
r5117 r5158 10 10 ! ************************************************************** 11 11 USE lmdz_abort_physic, ONLY: abort_physic 12 USE lmdz_yomcst2 13 12 14 IMPLICIT NONE 13 include "YOMCST2.h"14 15 15 16 INTEGER iflag_clos 16 CHARACTER (LEN =20) :: modname = 'cv3_inicp'17 CHARACTER (LEN =80) :: abort_message17 CHARACTER (LEN = 20) :: modname = 'cv3_inicp' 18 CHARACTER (LEN = 80) :: abort_message 18 19 19 20 ! -- Mixing probability distribution functions 20 21 21 22 REAL qcoef1, qcoef2, qff, qfff, qmix, rmix, qmix1, rmix1, qmix2, rmix2, f 22 REAL :: sumcoef, sigma,aire,pdf,mu,df,ff23 REAL :: sumcoef, sigma, aire, pdf, mu, df, ff 23 24 24 qcoef1(f) = tanh(f /gammas)25 qcoef2(f) = (tanh(f /gammas)+gammas*log(cosh((1.-f)/gammas)/cosh(f/gammas)))26 qff(f) = max(min(f, 1.), 0.)25 qcoef1(f) = tanh(f / gammas) 26 qcoef2(f) = (tanh(f / gammas) + gammas * log(cosh((1. - f) / gammas) / cosh(f / gammas))) 27 qff(f) = max(min(f, 1.), 0.) 27 28 qfff(f) = min(qff(f), scut) 28 qmix1(f) = (tanh((qff(f) -fmax)/gammas)+qcoef1max)/qcoef2max29 rmix1(f) = (gammas *log(cosh((qff(f)-fmax)/gammas))+qff(f)*qcoef1max)/ &30 qcoef2max31 qmix2(f) = -log(1. -qfff(f))/scut32 rmix2(f) = (qfff(f) +(1.-qff(f))*log(1.-qfff(f)))/scut33 qmix(f) = qqa1 *qmix1(f) + qqa2*qmix2(f)34 rmix(f) = qqa1 *rmix1(f) + qqa2*rmix2(f)29 qmix1(f) = (tanh((qff(f) - fmax) / gammas) + qcoef1max) / qcoef2max 30 rmix1(f) = (gammas * log(cosh((qff(f) - fmax) / gammas)) + qff(f) * qcoef1max) / & 31 qcoef2max 32 qmix2(f) = -log(1. - qfff(f)) / scut 33 rmix2(f) = (qfff(f) + (1. - qff(f)) * log(1. - qfff(f))) / scut 34 qmix(f) = qqa1 * qmix1(f) + qqa2 * qmix2(f) 35 rmix(f) = qqa1 * rmix1(f) + qqa2 * rmix2(f) 35 36 36 37 ! cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc … … 76 77 77 78 sumcoef = qqa1 + qqa2 78 qqa1 = qqa1 /sumcoef79 qqa2 = qqa2 /sumcoef79 qqa1 = qqa1 / sumcoef 80 qqa2 = qqa2 / sumcoef 80 81 81 82 qcoef1max = qcoef1(fmax) … … 90 91 ! do ff = 0.0 + df, 1.0 - 2.*df, df 91 92 ff = df 92 DO WHILE (ff<=1.0 -2.*df)93 pdf = (qmix(ff +df)-qmix(ff))*(1.-ff)/df94 aire = aire + (qmix(ff +df)-qmix(ff))*(1.-ff)95 mu = mu + pdf *ff*df93 DO WHILE (ff<=1.0 - 2. * df) 94 pdf = (qmix(ff + df) - qmix(ff)) * (1. - ff) / df 95 aire = aire + (qmix(ff + df) - qmix(ff)) * (1. - ff) 96 mu = mu + pdf * ff * df 96 97 ! c WRITE(*,*) pdf, Qmix(ff), aire, ff 97 98 ff = ff + df … … 100 101 ! do ff=0.0+df,1.0 - 2.*df,df 101 102 ff = df 102 DO WHILE (ff<=1.0 -2.*df)103 pdf = (qmix(ff +df)-qmix(ff))*(1.-ff)/df104 sigma = sigma + pdf *(ff-mu)*(ff-mu)*df103 DO WHILE (ff<=1.0 - 2. * df) 104 pdf = (qmix(ff + df) - qmix(ff)) * (1. - ff) / df 105 sigma = sigma + pdf * (ff - mu) * (ff - mu) * df 105 106 ff = ff + df 106 107 END DO 107 108 sigma = sqrt(sigma) 108 109 109 IF (abs(aire -1.0)>0.02) THEN110 IF (abs(aire - 1.0)>0.02) THEN 110 111 PRINT *, 'WARNING:: AREA OF MIXING PDF IS::', aire 111 112 abort_message = '' … … 116 117 END IF ! (iflag_mix .gt. 0) 117 118 118 119 119 END SUBROUTINE cv3_inicp
Note: See TracChangeset
for help on using the changeset viewer.