| 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 | IMPLICIT none |
|---|
| 17 | c====================================================================== |
|---|
| 18 | c Initialisation de nu_venus et t0_venus |
|---|
| 19 | c====================================================================== |
|---|
| 20 | |
|---|
| 21 | ! for planet_type: |
|---|
| 22 | USE control_mod |
|---|
| 23 | |
|---|
| 24 | ! for cpp, nu_venus and t0_venus: |
|---|
| 25 | #include "comconst.h" |
|---|
| 26 | |
|---|
| 27 | if (planet_type.eq."venus") then |
|---|
| 28 | nu_venus=0.35 |
|---|
| 29 | t0_venus=460. |
|---|
| 30 | else |
|---|
| 31 | nu_venus=0. |
|---|
| 32 | t0_venus=0. |
|---|
| 33 | endif |
|---|
| 34 | |
|---|
| 35 | return |
|---|
| 36 | end |
|---|
| 37 | |
|---|
| 38 | c====================================================================== |
|---|
| 39 | c====================================================================== |
|---|
| 40 | |
|---|
| 41 | FUNCTION cpdet(t) |
|---|
| 42 | IMPLICIT none |
|---|
| 43 | |
|---|
| 44 | ! for planet_type: |
|---|
| 45 | USE control_mod |
|---|
| 46 | |
|---|
| 47 | ! for cpp, nu_venus and t0_venus: |
|---|
| 48 | #include "comconst.h" |
|---|
| 49 | |
|---|
| 50 | real cpdet,t |
|---|
| 51 | |
|---|
| 52 | if (planet_type.eq."venus") then |
|---|
| 53 | cpdet = cpp*(t/t0_venus)**nu_venus |
|---|
| 54 | else |
|---|
| 55 | cpdet = cpp |
|---|
| 56 | endif |
|---|
| 57 | |
|---|
| 58 | return |
|---|
| 59 | end |
|---|
| 60 | |
|---|
| 61 | c====================================================================== |
|---|
| 62 | c====================================================================== |
|---|
| 63 | |
|---|
| 64 | SUBROUTINE t2tpot(npoints, yt, yteta, ypk) |
|---|
| 65 | IMPLICIT none |
|---|
| 66 | c====================================================================== |
|---|
| 67 | c Arguments: |
|---|
| 68 | c |
|---|
| 69 | c yt --------input-R- Temperature |
|---|
| 70 | c yteta-------output-R- Temperature potentielle |
|---|
| 71 | c ypk --------input-R- Fonction d'Exner: RCPD*(pplay/pref)**RKAPPA |
|---|
| 72 | c |
|---|
| 73 | c====================================================================== |
|---|
| 74 | |
|---|
| 75 | ! for planet_type: |
|---|
| 76 | USE control_mod |
|---|
| 77 | |
|---|
| 78 | ! for cpp, nu_venus and t0_venus: |
|---|
| 79 | #include "comconst.h" |
|---|
| 80 | |
|---|
| 81 | integer npoints |
|---|
| 82 | REAL yt(npoints), yteta(npoints), ypk(npoints) |
|---|
| 83 | |
|---|
| 84 | if (planet_type.eq."venus") then |
|---|
| 85 | yteta = yt**nu_venus & |
|---|
| 86 | & - nu_venus * t0_venus**nu_venus * log(ypk/cpp) |
|---|
| 87 | yteta = yteta**(1./nu_venus) |
|---|
| 88 | else |
|---|
| 89 | yteta = yt * cpp/ypk |
|---|
| 90 | endif |
|---|
| 91 | |
|---|
| 92 | return |
|---|
| 93 | end |
|---|
| 94 | |
|---|
| 95 | c====================================================================== |
|---|
| 96 | c====================================================================== |
|---|
| 97 | |
|---|
| 98 | SUBROUTINE tpot2t(npoints,yteta, yt, ypk) |
|---|
| 99 | IMPLICIT none |
|---|
| 100 | c====================================================================== |
|---|
| 101 | c Arguments: |
|---|
| 102 | c |
|---|
| 103 | c yteta--------input-R- Temperature potentielle |
|---|
| 104 | c yt -------output-R- Temperature |
|---|
| 105 | c ypk --------input-R- Fonction d'Exner: RCPD*(pplay/pref)**RKAPPA |
|---|
| 106 | c |
|---|
| 107 | c====================================================================== |
|---|
| 108 | |
|---|
| 109 | ! for planet_type: |
|---|
| 110 | USE control_mod |
|---|
| 111 | |
|---|
| 112 | ! for cpp, nu_venus and t0_venus: |
|---|
| 113 | #include "comconst.h" |
|---|
| 114 | |
|---|
| 115 | integer npoints |
|---|
| 116 | REAL yt(npoints), yteta(npoints), ypk(npoints) |
|---|
| 117 | |
|---|
| 118 | if (planet_type.eq."venus") then |
|---|
| 119 | yt = yteta**nu_venus & |
|---|
| 120 | & + nu_venus * t0_venus**nu_venus * log(ypk/cpp) |
|---|
| 121 | yt = yt**(1./nu_venus) |
|---|
| 122 | else |
|---|
| 123 | yt = yteta * ypk/cpp |
|---|
| 124 | endif |
|---|
| 125 | |
|---|
| 126 | return |
|---|
| 127 | end |
|---|
| 128 | |
|---|
| 129 | c====================================================================== |
|---|
| 130 | c====================================================================== |
|---|
| 131 | c |
|---|
| 132 | c ATTENTION |
|---|
| 133 | c |
|---|
| 134 | c Si un jour on a besoin, il faudra coder les routines |
|---|
| 135 | c dt2dtpot / dtpto2dt |
|---|
| 136 | c |
|---|
| 137 | c====================================================================== |
|---|
| 138 | c====================================================================== |
|---|