[1227] | 1 | ! $Id:$ |
---|
| 2 | MODULE phys_cal_mod |
---|
| 3 | ! This module contains information on the calendar at the actual time step |
---|
| 4 | |
---|
| 5 | SAVE |
---|
| 6 | |
---|
| 7 | INTEGER :: year_cur ! current year |
---|
| 8 | INTEGER :: mth_cur ! current month |
---|
| 9 | INTEGER :: day_cur ! current day |
---|
| 10 | INTEGER :: days_elapsed ! number of whole days since start of the simulation |
---|
| 11 | INTEGER :: mth_len ! number of days in the current month |
---|
[2098] | 12 | INTEGER year_len ! number of days in the current year |
---|
[1227] | 13 | REAL :: hour |
---|
| 14 | REAL :: jD_1jan |
---|
| 15 | REAL :: jH_1jan |
---|
| 16 | REAL :: xjour |
---|
| 17 | |
---|
| 18 | |
---|
| 19 | CONTAINS |
---|
| 20 | |
---|
| 21 | SUBROUTINE phys_cal_update(jD_cur, jH_cur) |
---|
| 22 | ! This subroutine updates the module saved variables. |
---|
| 23 | |
---|
[2098] | 24 | USE IOIPSL, only: ju2ymds, ymds2ju, ioget_mon_len, ioget_year_len |
---|
[1227] | 25 | |
---|
| 26 | REAL, INTENT(IN) :: jD_cur ! jour courant a l'appel de la physique (jour julien) |
---|
| 27 | REAL, INTENT(IN) :: jH_cur ! heure courante a l'appel de la physique (jour julien) |
---|
| 28 | |
---|
| 29 | CALL ju2ymds(jD_cur+jH_cur, year_cur, mth_cur, day_cur, hour) |
---|
| 30 | CALL ymds2ju(year_cur, 1, 1, 0., jD_1jan) |
---|
| 31 | |
---|
| 32 | jH_1jan = jD_1jan - int (jD_1jan) |
---|
| 33 | jD_1jan = int (jD_1jan) |
---|
| 34 | xjour = jD_cur - jD_1jan |
---|
| 35 | days_elapsed = jD_cur - jD_1jan |
---|
| 36 | |
---|
| 37 | ! Get lenght of acutual month |
---|
| 38 | mth_len = ioget_mon_len(year_cur,mth_cur) |
---|
| 39 | |
---|
[2098] | 40 | year_len = ioget_year_len(year_cur) |
---|
| 41 | |
---|
[1227] | 42 | END SUBROUTINE phys_cal_update |
---|
| 43 | |
---|
| 44 | END MODULE phys_cal_mod |
---|