Ignore:
Timestamp:
Aug 2, 2024, 2:12:03 PM (3 months ago)
Author:
abarral
Message:

Add missing klon on strataer_emiss_mod.F90
Correct various missing explicit declarations
Replace tabs by spaces (tabs are not part of the fortran charset)
Continue cleaning modules
Removed unused arguments and variables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_inicp.F90

    r5117 r5158  
    1010  ! **************************************************************
    1111  USE lmdz_abort_physic, ONLY: abort_physic
     12  USE lmdz_yomcst2
     13
    1214  IMPLICIT NONE
    13   include "YOMCST2.h"
    1415
    1516  INTEGER iflag_clos
    16   CHARACTER (LEN=20) :: modname = 'cv3_inicp'
    17   CHARACTER (LEN=80) :: abort_message
     17  CHARACTER (LEN = 20) :: modname = 'cv3_inicp'
     18  CHARACTER (LEN = 80) :: abort_message
    1819
    1920  ! --   Mixing probability distribution functions
    2021
    2122  REAL qcoef1, qcoef2, qff, qfff, qmix, rmix, qmix1, rmix1, qmix2, rmix2, f
    22   REAL :: sumcoef,sigma,aire,pdf,mu,df,ff
     23  REAL :: sumcoef, sigma, aire, pdf, mu, df, ff
    2324
    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.)
    2728  qfff(f) = min(qff(f), scut)
    28   qmix1(f) = (tanh((qff(f)-fmax)/gammas)+qcoef1max)/qcoef2max
    29   rmix1(f) = (gammas*log(cosh((qff(f)-fmax)/gammas))+qff(f)*qcoef1max)/ &
    30     qcoef2max
    31   qmix2(f) = -log(1.-qfff(f))/scut
    32   rmix2(f) = (qfff(f)+(1.-qff(f))*log(1.-qfff(f)))/scut
    33   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)
    3536
    3637  ! cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
     
    7677
    7778    sumcoef = qqa1 + qqa2
    78     qqa1 = qqa1/sumcoef
    79     qqa2 = qqa2/sumcoef
     79    qqa1 = qqa1 / sumcoef
     80    qqa2 = qqa2 / sumcoef
    8081
    8182    qcoef1max = qcoef1(fmax)
     
    9091    ! do ff = 0.0 + df, 1.0 - 2.*df, df
    9192    ff = df
    92     DO WHILE (ff<=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
     93    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
    9697      ! c              WRITE(*,*) pdf,  Qmix(ff), aire, ff
    9798      ff = ff + df
     
    100101    ! do ff=0.0+df,1.0 - 2.*df,df
    101102    ff = df
    102     DO WHILE (ff<=1.0-2.*df)
    103       pdf = (qmix(ff+df)-qmix(ff))*(1.-ff)/df
    104       sigma = sigma + pdf*(ff-mu)*(ff-mu)*df
     103    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
    105106      ff = ff + df
    106107    END DO
    107108    sigma = sqrt(sigma)
    108109
    109     IF (abs(aire-1.0)>0.02) THEN
     110    IF (abs(aire - 1.0)>0.02) THEN
    110111      PRINT *, 'WARNING:: AREA OF MIXING PDF IS::', aire
    111112      abort_message = ''
     
    116117  END IF !  (iflag_mix .gt. 0)
    117118
    118 
    119119END SUBROUTINE cv3_inicp
Note: See TracChangeset for help on using the changeset viewer.