source: trunk/LMDZ.GENERIC/libf/phystd/kastprof_fn.F @ 223

Last change on this file since 223 was 135, checked in by aslmd, 14 years ago

CHANGEMENT ARBORESCENCE ETAPE 2 -- NON COMPLET

File size: 1.1 KB
Line 
1      subroutine kastprof_fn(tsurf,temp,play,plev)
2      IMPLICIT NONE
3
4c     creates a kasting temperature profile
5
6#include "dimensions.h"
7#include "dimphys.h"
8#include "comcstfi.h"
9
10
11      REAL play(nlayermx)   ! Pressure at the middle of the layers (Pa)
12      REAL plev(nlayermx+1) ! intermediate pressure levels (pa)
13      REAL psurf,tsurf     
14      REAL tcond (nlayermx)
15      REAL temp(nlayermx)   ! temperature at the middle of the layers
16
17      real*8 Gamma, dz
18      integer l
19
20!     dTdp = (-RT/gp)*Gamma
21
22!     ideal gas lapse rate
23      Gamma = -5.0556 ! K / km
24
25!     1st layer
26      dz = (plev(1) - play(1)) * (R * tsurf / (g*play(1)))
27      temp(1)=tsurf+dz*Gamma/1000
28
29!     other layers
30      DO l=2,nlayermx
31         dz = (play(l-1) - play(l)) * (R * temp(l-1) / (g*play(l)))
32         temp(l)=temp(l-1)+dz*Gamma/1000 ! convective lower troposphere
33
34!        FORMULE FANALE POUR 100% CO2
35         tcond(l)=(-3167.8)/(log(.01*play(l))-23.23)
36         if (temp(l) .lt. tcond(l)) temp(l)= tcond(l) ! condensing upper troposphere
37         if (temp(l) .lt. 167.) temp(l)= 167.0 ! isothermal stratosphere
38
39      ENDDO
40
41      return
42      end
Note: See TracBrowser for help on using the repository browser.