source: codes/icosagcm/branches/SATURN_DYNAMICO/LMDZ.COMMON/libf/phystd/cpdet.F @ 222

Last change on this file since 222 was 222, checked in by ymipsl, 10 years ago

Creating temporary dynamico/lmdz/saturn branche

YM

File size: 3.6 KB
Line 
1! ADAPTATION GCM POUR CP(T)
2c======================================================================
3c S. Lebonnois, 10/2007:
4c
5c VENUS: Cp(T) = cpp*(T/T0)^nu 
6c avec T0=460. et nu=0.35
7c cpp=RCPD=cp0 = 1000.
8c R/RCPD = RKAPPA
9c
10c La fonction d'Exner reste pk = RCPD*(play/pref)**RKAPPA
11c
12c T et teta (temperature potentielle) sont liees par:
13c
14c   integrale[teta a T](cp/T dT) = integrale[pref a p](R/p dp)
15c
16c Dans le cas de l'expression pour Venus, ca donne:
17c
18c   teta**nu = T**nu - nu * T0**nu * ln[ (p/pref)**RKAPPA ]
19c ou
20c   teta**nu = T**nu - nu * T0**nu * ln[pk/RCPD]
21c
22c On passe de T a teta par t2tpot(t,teta,pk)
23c On passe de teta a T par tpot2t(teta,t,pk)
24c
25c Pour DT <-> Dteta, on utilise: dteta = dT *(T/teta)**(nu-1)
26c -> routine dt2dtpot(dt,dteta,t,teta) 
27c (utilisee seulement pour le contregradient)
28c
29c======================================================================
30
31      FUNCTION cpdet(t)
32      IMPLICIT none
33#include "cpdet.h"
34
35      real cpdet,t
36
37      cpdet = cp0*(t/t0)**nu
38
39      return
40      end
41     
42c======================================================================
43c======================================================================
44
45      SUBROUTINE t2tpot(npoints,yt, yteta, ypk)
46      IMPLICIT none
47c======================================================================
48c Arguments:
49c
50c yt   --------input-R- Temperature
51c yteta-------output-R- Temperature potentielle
52c ypk  --------input-R- Fonction d'Exner: RCPD*(pplay/pref)**RKAPPA
53c
54c======================================================================
55#include "cpdet.h"
56
57      integer npoints
58      REAL    yt(npoints), yteta(npoints), ypk(npoints)
59     
60      yteta = yt**nu - nu * t0**nu * log(ypk/cp0)
61      yteta = yteta**(1./nu)
62       
63
64      !yteta = yt/ypk
65
66
67      return
68      end
69
70c======================================================================
71c======================================================================
72
73      SUBROUTINE tpot2t(npoints,yteta, yt, ypk)
74      IMPLICIT none
75c======================================================================
76c Arguments:
77c
78c yteta--------input-R- Temperature potentielle
79c yt   -------output-R- Temperature
80c ypk  --------input-R- Fonction d'Exner: RCPD*(pplay/pref)**RKAPPA
81c
82c======================================================================
83#include "cpdet.h"
84
85      integer npoints
86      REAL yt(npoints), yteta(npoints), ypk(npoints)
87
88      yt = yteta**nu + nu * t0**nu * log(ypk/cp0)
89      yt = yt**(1./nu)
90
91      !yt = yteta*ypk
92
93      return
94      end
95
96c$$$c======================================================================
97c$$$c======================================================================
98c$$$
99c$$$      SUBROUTINE dt2dtpot(npoints,ydt, ydteta, yt, yteta, ypk, ydpk)
100c$$$      IMPLICIT none
101c$$$c======================================================================
102c$$$c Arguments:
103c$$$c
104c$$$c ydt  --------input-R- D Temperature
105c$$$c ydteta------output-R- D Temperature potentielle
106c$$$c yt   --------input-R- Temperature
107c$$$c yteta--------input-R- Temperature potentielle
108c$$$c ypk  --------input-R- Fonction d'Exner: RCPD*(pplay/pref)**RKAPPA
109c$$$c ydpk  -------input-R- D Fonction d'Exner
110c$$$c
111c$$$c======================================================================
112c$$$#include "cpdet.h"
113c$$$
114c$$$      integer npoints
115c$$$      REAL    ydt(npoints), ydteta(npoints), ydpk(npoints)
116c$$$      REAL    yt(npoints), yteta(npoints), ypk(npoints)
117c$$$     
118c$$$      ydteta =  yteta**(1.-nu)* (ydt * yt**(nu-1.) 
119c$$$     .                           - t0**nu * ydpk / ypk)
120c$$$       
121c$$$      return
122c$$$      end
123
Note: See TracBrowser for help on using the repository browser.