source: trunk/LMDZ.GENERIC/libf/phystd/vdif_cd.F @ 3523

Last change on this file since 3523 was 1315, checked in by milmd, 10 years ago

LMDZ.GENERIC. OpenMP directives added in generic physic. When running in pure OpenMP or hybrid OpenMP/MPI, may have some bugs with condense_cloud and wstats routines.

File size: 2.0 KB
RevLine 
[135]1      SUBROUTINE vdif_cd( ngrid,nlay,pz0,pg,pz,pu,pv,pts,ph,pcdv,pcdh)
2      IMPLICIT NONE
3c=======================================================================
4c
5c   Subject: computation of the surface drag coefficient using the
6c   -------  approch developed by Loui for ECMWF.
7c
8c   Author: Frederic Hourdin  15 /10 /93
9c   -------
10c
11c   Arguments:
12c   ----------
13c
14c   inputs:
15c   ------
16c     ngrid            size of the horizontal grid
17c     pg               gravity (m s -2)
18c     pz(ngrid)        height of the first atmospheric layer
19c     pu(ngrid)        u component of the wind in that layer
20c     pv(ngrid)        v component of the wind in that layer
21c     pts(ngrid)       surfacte temperature
22c     ph(ngrid)        potential temperature T*(p/ps)^kappa
23c
24c   outputs:
25c   --------
26c     pcdv(ngrid)      Cd for the wind
27c     pcdh(ngrid)      Cd for potential temperature
28c
29c=======================================================================
30c
31c-----------------------------------------------------------------------
32c   Declarations:
33c   -------------
34
35c   Arguments:
36c   ----------
37
38      INTEGER ngrid,nlay
39      REAL pz0
40      REAL pg,pz(ngrid,nlay)
41      REAL pu(ngrid,nlay),pv(ngrid,nlay)
42      REAL pts(ngrid,nlay),ph(ngrid,nlay)
43      REAL pcdv(ngrid),pcdh(ngrid)
44
45c   Local:
46c   ------
47
48      INTEGER ig
49
50      REAL zu2,z1,zri,zcd0,zz
51
52      REAL karman,b,c,d,c2b,c3bc,c3b,umin2
53      LOGICAL firstcal
54      DATA karman,b,c,d,umin2/.4,5.,5.,5.,1.e-12/
55      DATA firstcal/.true./
56      SAVE b,c,d,karman,c2b,c3bc,c3b,firstcal,umin2
[1315]57!$OMP THREADPRIVATE(b,c,d,karman,c2b,c3bc,c3b,firstcal,umin2)
[135]58
59c-----------------------------------------------------------------------
60c   couche de surface:
61c   ------------------
62
63! simplified calculation
64
65      DO ig=1,ngrid
66         z1=1.E+0 + pz(ig,1)/pz0
67         zcd0=karman/log(z1)
68         zcd0=zcd0*zcd0
69         pcdv(ig)=zcd0
70         pcdh(ig)=zcd0
71      ENDDO
72
73c-----------------------------------------------------------------------
74
75      RETURN
76      END
Note: See TracBrowser for help on using the repository browser.