Ignore:
Timestamp:
Mar 5, 2014, 2:19:12 PM (10 years ago)
Author:
lguez
Message:

Converted to free source form files in libf/phylmd which were still in
fixed source form. The conversion was done using the polish mode of
the NAG Fortran Compiler.

In addition to converting to free source form, the processing of the
files also:

-- indented the code (including comments);

-- set Fortran keywords to uppercase, and set all other identifiers
to lower case;

-- added qualifiers to end statements (for example "end subroutine
conflx", instead of "end");

-- changed the terminating statements of all DO loops so that each
loop ends with an ENDDO statement (instead of a labeled continue).

-- replaced #include by include.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phylmd/clift.F90

    r1988 r1992  
    1 !
     1
    22! $Header$
    3 !
    4         SUBROUTINE CLIFT (P,T,RR,RS,PLCL,DPLCLDT,DPLCLDQ)
    5 C***************************************************************
    6 C*                                                             *
    7 C* CLIFT : COMPUTE LIFTING CONDENSATION LEVEL AND ITS          *
    8 C*         DERIVATIVES RELATIVE TO T AND R                     *
    9 C*   (WITHIN 0.2% OF FORMULA OF BOLTON, MON. WEA. REV.,1980)   *
    10 C*                                                             *
    11 C* written by   : GRANDPEIX Jean-Yves, 17/11/98, 12.39.01      *
    12 C* modified by :                                               *
    13 C***************************************************************
    14 C*
    15 C*Arguments :
    16 C*
    17 C* Input :  P = pressure of level from wich lifting is performed
    18 C*          T = temperature of level P
    19 C*          RR = vapour mixing ratio at level P
    20 C*          RS = vapour saturation mixing ratio at level P
    21 C*
    22 C* Output : PLCL = lifting condensation level
    23 C*          DPLCLDT = derivative of PLCL relative to T
    24 C*          DPLCLDQ = derivative of PLCL relative to R
    25 C*
    26 ccccccccccccccccccccccc
    27 c constantes coherentes avec le modele du Centre Europeen
    28 c      RD = 1000.0 * 1.380658E-23 * 6.0221367E+23 / 28.9644
    29 c      RV = 1000.0 * 1.380658E-23 * 6.0221367E+23 / 18.0153
    30 c      CPD = 3.5 * RD
    31 c      CPV = 4.0 * RV
    32 c      CL = 4218.0
    33 c      CI=2090.0
    34 c      CPVMCL=CL-CPV
    35 c      CLMCI=CL-CI
    36 c      EPS=RD/RV
    37 c      ALV0=2.5008E+06
    38 c      ALF0=3.34E+05
    39 c
    40 c on utilise les constantes thermo du Centre Europeen: (sb)
    41 c
    42 #include "YOMCST.h"
    43 c
    44        CPD = RCPD
    45        CPV = RCPV
    46        CL = RCW
    47        CPVMCL = CL-CPV
    48        EPS = RD/RV
    49        ALV0 = RLVTT
    50 c
    51 c
    52 c      Bolton formula coefficients :
    53       A = 1669.0
    54       B = 122.0
    55 c
    56       RH=RR/RS
    57       CHI=T/(A-B*RH-T)
    58       PLCL=P*(RH**CHI)
    59 c
    60       ALV = ALV0 - CPVMCL*(T-273.15)
    61 c
    62 c -- sb: correction:
    63 c       DPLCLDQ = PLCL*CHI*( 1./RR - B*CHI/T/RS*ALOG(RH) )
    64       DPLCLDQ = PLCL*CHI*( 1./RR + B*CHI/T/RS*ALOG(RH) )
    65 c sb --
    66 c
    67       DPLCLDT = PLCL*CHI*((A-B*RH*(1.+ALV/RV/T))/T**2*CHI*ALOG(RH)
    68      $                    - ALV/RV/T**2 )
    69 c
    70 c
    71       RETURN
    72       END
     3
     4SUBROUTINE clift(p, t, rr, rs, plcl, dplcldt, dplcldq)
     5  ! ***************************************************************
     6  ! *                                                             *
     7  ! * CLIFT : COMPUTE LIFTING CONDENSATION LEVEL AND ITS          *
     8  ! *         DERIVATIVES RELATIVE TO T AND R                     *
     9  ! *   (WITHIN 0.2% OF FORMULA OF BOLTON, MON. WEA. REV.,1980)   *
     10  ! *                                                             *
     11  ! * written by   : GRANDPEIX Jean-Yves, 17/11/98, 12.39.01      *
     12  ! * modified by :                                               *
     13  ! ***************************************************************
     14  ! *
     15  ! *Arguments :
     16  ! *
     17  ! * Input :  P = pressure of level from wich lifting is performed
     18  ! *          T = temperature of level P
     19  ! *          RR = vapour mixing ratio at level P
     20  ! *          RS = vapour saturation mixing ratio at level P
     21  ! *
     22  ! * Output : PLCL = lifting condensation level
     23  ! *          DPLCLDT = derivative of PLCL relative to T
     24  ! *          DPLCLDQ = derivative of PLCL relative to R
     25  ! *
     26  ! cccccccccccccccccccccc
     27  ! constantes coherentes avec le modele du Centre Europeen
     28  ! RD = 1000.0 * 1.380658E-23 * 6.0221367E+23 / 28.9644
     29  ! RV = 1000.0 * 1.380658E-23 * 6.0221367E+23 / 18.0153
     30  ! CPD = 3.5 * RD
     31  ! CPV = 4.0 * RV
     32  ! CL = 4218.0
     33  ! CI=2090.0
     34  ! CPVMCL=CL-CPV
     35  ! CLMCI=CL-CI
     36  ! EPS=RD/RV
     37  ! ALV0=2.5008E+06
     38  ! ALF0=3.34E+05
     39
     40  ! on utilise les constantes thermo du Centre Europeen: (sb)
     41
     42  include "YOMCST.h"
     43
     44  cpd = rcpd
     45  cpv = rcpv
     46  cl = rcw
     47  cpvmcl = cl - cpv
     48  eps = rd/rv
     49  alv0 = rlvtt
     50
     51
     52  ! Bolton formula coefficients :
     53  a = 1669.0
     54  b = 122.0
     55
     56  rh = rr/rs
     57  chi = t/(a-b*rh-t)
     58  plcl = p*(rh**chi)
     59
     60  alv = alv0 - cpvmcl*(t-273.15)
     61
     62  ! -- sb: correction:
     63  ! DPLCLDQ = PLCL*CHI*( 1./RR - B*CHI/T/RS*ALOG(RH) )
     64  dplcldq = plcl*chi*(1./rr+b*chi/t/rs*alog(rh))
     65  ! sb --
     66
     67  dplcldt = plcl*chi*((a-b*rh*(1.+alv/rv/t))/t**2*chi*alog(rh)-alv/rv/t**2)
     68
     69
     70  RETURN
     71END SUBROUTINE clift
Note: See TracChangeset for help on using the changeset viewer.