| 1 | ! ADAPTATION GCM POUR CP(T) |
|---|
| 2 | c====================================================================== |
|---|
| 3 | c S. Lebonnois, 10/2010 |
|---|
| 4 | c |
|---|
| 5 | c Cp doit être calculé par cpdet(t) pour être valable partout |
|---|
| 6 | c |
|---|
| 7 | c La fonction d'Exner reste pk = RCPD*(play/pref)**RKAPPA |
|---|
| 8 | c (RCPD=cpp, RKAPPA=kappa) |
|---|
| 9 | c |
|---|
| 10 | c On passe de T a teta (temperature potentielle) par t2tpot(t,teta,pk) |
|---|
| 11 | c On passe de teta a T par tpot2t(teta,t,pk) |
|---|
| 12 | c |
|---|
| 13 | c====================================================================== |
|---|
| 14 | |
|---|
| 15 | SUBROUTINE ini_cpdet |
|---|
| 16 | |
|---|
| 17 | USE control_mod, ONLY: planet_type |
|---|
| 18 | IMPLICIT none |
|---|
| 19 | c====================================================================== |
|---|
| 20 | c Initialisation de nu_venus et t0_venus |
|---|
| 21 | c====================================================================== |
|---|
| 22 | |
|---|
| 23 | ! for cpp, nu_venus and t0_venus: |
|---|
| 24 | #include "comconst.h" |
|---|
| 25 | |
|---|
| 26 | if (planet_type.eq."venus") then |
|---|
| 27 | nu_venus=0.35 |
|---|
| 28 | t0_venus=460. |
|---|
| 29 | else |
|---|
| 30 | nu_venus=0. |
|---|
| 31 | t0_venus=0. |
|---|
| 32 | endif |
|---|
| 33 | |
|---|
| 34 | return |
|---|
| 35 | end |
|---|
| 36 | |
|---|
| 37 | c====================================================================== |
|---|
| 38 | c====================================================================== |
|---|
| 39 | |
|---|
| 40 | FUNCTION cpdet(t) |
|---|
| 41 | |
|---|
| 42 | USE control_mod, ONLY: planet_type |
|---|
| 43 | IMPLICIT none |
|---|
| 44 | |
|---|
| 45 | ! for cpp, nu_venus and t0_venus: |
|---|
| 46 | #include "comconst.h" |
|---|
| 47 | |
|---|
| 48 | real cpdet,t |
|---|
| 49 | |
|---|
| 50 | if (planet_type.eq."venus") then |
|---|
| 51 | cpdet = cpp*(t/t0_venus)**nu_venus |
|---|
| 52 | else |
|---|
| 53 | cpdet = cpp |
|---|
| 54 | endif |
|---|
| 55 | |
|---|
| 56 | return |
|---|
| 57 | end |
|---|
| 58 | |
|---|
| 59 | c====================================================================== |
|---|
| 60 | c====================================================================== |
|---|
| 61 | |
|---|
| 62 | SUBROUTINE t2tpot(npoints, yt, yteta, ypk) |
|---|
| 63 | c====================================================================== |
|---|
| 64 | c Arguments: |
|---|
| 65 | c |
|---|
| 66 | c yt --------input-R- Temperature |
|---|
| 67 | c yteta-------output-R- Temperature potentielle |
|---|
| 68 | c ypk --------input-R- Fonction d'Exner: RCPD*(pplay/pref)**RKAPPA |
|---|
| 69 | c |
|---|
| 70 | c====================================================================== |
|---|
| 71 | |
|---|
| 72 | USE control_mod, ONLY: planet_type |
|---|
| 73 | IMPLICIT NONE |
|---|
| 74 | |
|---|
| 75 | ! for cpp, nu_venus and t0_venus: |
|---|
| 76 | #include "comconst.h" |
|---|
| 77 | |
|---|
| 78 | integer npoints |
|---|
| 79 | REAL yt(npoints), yteta(npoints), ypk(npoints) |
|---|
| 80 | |
|---|
| 81 | if (planet_type.eq."venus") then |
|---|
| 82 | yteta = yt**nu_venus & |
|---|
| 83 | & - nu_venus * t0_venus**nu_venus * log(ypk/cpp) |
|---|
| 84 | yteta = yteta**(1./nu_venus) |
|---|
| 85 | else |
|---|
| 86 | yteta = yt * cpp/ypk |
|---|
| 87 | endif |
|---|
| 88 | |
|---|
| 89 | return |
|---|
| 90 | end |
|---|
| 91 | |
|---|
| 92 | c====================================================================== |
|---|
| 93 | c====================================================================== |
|---|
| 94 | |
|---|
| 95 | SUBROUTINE tpot2t(npoints,yteta, yt, ypk) |
|---|
| 96 | c====================================================================== |
|---|
| 97 | c Arguments: |
|---|
| 98 | c |
|---|
| 99 | c yteta--------input-R- Temperature potentielle |
|---|
| 100 | c yt -------output-R- Temperature |
|---|
| 101 | c ypk --------input-R- Fonction d'Exner: RCPD*(pplay/pref)**RKAPPA |
|---|
| 102 | c |
|---|
| 103 | c====================================================================== |
|---|
| 104 | |
|---|
| 105 | USE control_mod, ONLY: planet_type |
|---|
| 106 | IMPLICIT NONE |
|---|
| 107 | |
|---|
| 108 | ! for cpp, nu_venus and t0_venus: |
|---|
| 109 | #include "comconst.h" |
|---|
| 110 | |
|---|
| 111 | integer npoints |
|---|
| 112 | REAL yt(npoints), yteta(npoints), ypk(npoints) |
|---|
| 113 | |
|---|
| 114 | if (planet_type.eq."venus") then |
|---|
| 115 | yt = yteta**nu_venus & |
|---|
| 116 | & + nu_venus * t0_venus**nu_venus * log(ypk/cpp) |
|---|
| 117 | yt = yt**(1./nu_venus) |
|---|
| 118 | else |
|---|
| 119 | yt = yteta * ypk/cpp |
|---|
| 120 | endif |
|---|
| 121 | |
|---|
| 122 | return |
|---|
| 123 | end |
|---|
| 124 | |
|---|
| 125 | c====================================================================== |
|---|
| 126 | c====================================================================== |
|---|
| 127 | c |
|---|
| 128 | c ATTENTION |
|---|
| 129 | c |
|---|
| 130 | c Si un jour on a besoin, il faudra coder les routines |
|---|
| 131 | c dt2dtpot / dtpto2dt |
|---|
| 132 | c |
|---|
| 133 | c====================================================================== |
|---|
| 134 | c====================================================================== |
|---|