1 | PROGRAM convdate |
---|
2 | |
---|
3 | IMPLICIT NONE |
---|
4 | |
---|
5 | ! |
---|
6 | ! compile: pgf90 convdate.F90 -o convdate |
---|
7 | ! use: echo 352 | convdate |
---|
8 | ! |
---|
9 | |
---|
10 | |
---|
11 | INTEGER :: gcm_day |
---|
12 | |
---|
13 | INTEGER :: wrf_month,wrf_day |
---|
14 | |
---|
15 | INTEGER :: init,i |
---|
16 | INTEGER, PARAMETER :: MONTHS_PER_YEAR = 12 |
---|
17 | INTEGER, PARAMETER :: mday(MONTHS_PER_YEAR) & |
---|
18 | = (/61,66,66,65,60,54,50,46,47,47,51,56/) |
---|
19 | |
---|
20 | print *, 'which day ?' |
---|
21 | read *, gcm_day |
---|
22 | |
---|
23 | PRINT *,'*****************' |
---|
24 | print *, 'GCM sol is ... (starting 0)', gcm_day |
---|
25 | PRINT *,'*****************' |
---|
26 | |
---|
27 | ! |
---|
28 | ! Find WRF month and day |
---|
29 | ! |
---|
30 | |
---|
31 | IF (gcm_day >= 669) THEN !! gcm_day commence au jour 0 |
---|
32 | PRINT *,'out of bounds ! martian year is 669 sols !' |
---|
33 | gcm_day=MOD(gcm_day,669) |
---|
34 | !STOP |
---|
35 | ENDIF |
---|
36 | |
---|
37 | |
---|
38 | init=gcm_day+1 !!+1 sinon on decale tout |
---|
39 | DO i=1,MONTHS_PER_YEAR |
---|
40 | wrf_month=i |
---|
41 | init=init-mday(i) |
---|
42 | IF (init <= 0) EXIT |
---|
43 | END DO |
---|
44 | |
---|
45 | PRINT *,'corresponding WRF month is ',wrf_month |
---|
46 | wrf_day=init+mday(wrf_month) |
---|
47 | PRINT *,'corresponding WRF day is ',wrf_day |
---|
48 | PRINT *,'*****************' |
---|
49 | |
---|
50 | |
---|
51 | END PROGRAM convdate |
---|