| 1 | module cpdet_phy_mod |
|---|
| 2 | |
|---|
| 3 | implicit none |
|---|
| 4 | |
|---|
| 5 | real,save :: cpp ! reference Cp |
|---|
| 6 | |
|---|
| 7 | contains |
|---|
| 8 | |
|---|
| 9 | SUBROUTINE init_cpdet_phy(cpp_) |
|---|
| 10 | ! initialize module variables |
|---|
| 11 | REAL,INTENT(IN) :: cpp_ ! cpp from dynamics |
|---|
| 12 | |
|---|
| 13 | cpp=cpp_ |
|---|
| 14 | |
|---|
| 15 | END SUBROUTINE init_cpdet_phy |
|---|
| 16 | |
|---|
| 17 | !====================================================================== |
|---|
| 18 | |
|---|
| 19 | FUNCTION cpdet(t) |
|---|
| 20 | |
|---|
| 21 | IMPLICIT none |
|---|
| 22 | |
|---|
| 23 | ! for now in Titan Cp does not change with temperature |
|---|
| 24 | |
|---|
| 25 | real,intent(in) :: t |
|---|
| 26 | real cpdet |
|---|
| 27 | |
|---|
| 28 | cpdet = cpp |
|---|
| 29 | |
|---|
| 30 | end function cpdet |
|---|
| 31 | |
|---|
| 32 | !====================================================================== |
|---|
| 33 | |
|---|
| 34 | SUBROUTINE t2tpot(npoints, yt, yteta, ypk) |
|---|
| 35 | !====================================================================== |
|---|
| 36 | ! Arguments: |
|---|
| 37 | ! |
|---|
| 38 | ! yt --------input-R- Temperature |
|---|
| 39 | ! yteta-------output-R- Temperature potentielle |
|---|
| 40 | ! ypk --------input-R- Fonction d'Exner: RCPD*(pplay/pref)**RKAPPA |
|---|
| 41 | ! |
|---|
| 42 | !====================================================================== |
|---|
| 43 | |
|---|
| 44 | IMPLICIT NONE |
|---|
| 45 | |
|---|
| 46 | integer,intent(in) :: npoints |
|---|
| 47 | REAL,intent(in) :: yt(npoints), ypk(npoints) |
|---|
| 48 | REAL,intent(out) :: yteta(npoints) |
|---|
| 49 | |
|---|
| 50 | yteta = yt * cpp/ypk |
|---|
| 51 | |
|---|
| 52 | end subroutine t2tpot |
|---|
| 53 | |
|---|
| 54 | !====================================================================== |
|---|
| 55 | |
|---|
| 56 | SUBROUTINE tpot2t(npoints,yteta, yt, ypk) |
|---|
| 57 | !====================================================================== |
|---|
| 58 | ! Arguments: |
|---|
| 59 | ! |
|---|
| 60 | ! yteta--------input-R- Temperature potentielle |
|---|
| 61 | ! yt -------output-R- Temperature |
|---|
| 62 | ! ypk --------input-R- Fonction d'Exner: RCPD*(pplay/pref)**RKAPPA |
|---|
| 63 | ! |
|---|
| 64 | !====================================================================== |
|---|
| 65 | |
|---|
| 66 | IMPLICIT NONE |
|---|
| 67 | |
|---|
| 68 | integer,intent(in) :: npoints |
|---|
| 69 | REAL,intent(in) :: yteta(npoints), ypk(npoints) |
|---|
| 70 | REAL,intent(out) :: yt(npoints) |
|---|
| 71 | |
|---|
| 72 | yt = yteta * ypk/cpp |
|---|
| 73 | |
|---|
| 74 | end subroutine tpot2t |
|---|
| 75 | |
|---|
| 76 | !====================================================================== |
|---|
| 77 | |
|---|
| 78 | end module cpdet_phy_mod |
|---|