1 |
guez |
3 |
SUBROUTINE moy_undefSTD(nlevSTD,itap, |
2 |
|
|
$ ecrit_day,ecrit_mth,ecrit_hf2mth, |
3 |
|
|
$ tnondef,tsumSTD) |
4 |
|
|
use dimens_m |
5 |
|
|
use dimphy |
6 |
|
|
IMPLICIT none |
7 |
|
|
c moyenne d'1 var a 1 niveau de pression |
8 |
|
|
c==================================================================== |
9 |
|
|
c |
10 |
|
|
c I. Musat : 09.2004 |
11 |
|
|
c |
12 |
|
|
c Moyenne - a des frequences differentes - des valeurs bien definies |
13 |
|
|
c (.NE.1.E+20) des variables interpolees a un niveau de |
14 |
|
|
c pression. |
15 |
|
|
c 1) les variables de type "day" (nout=1) ou "mth" (nout=2) sont sommees |
16 |
|
|
c tous les pas de temps de la physique |
17 |
|
|
c |
18 |
|
|
c 2) les variables de type "NMC" (nout=3) sont calculees a partir |
19 |
|
|
c des valeurs instantannees toutes les 6 heures |
20 |
|
|
c |
21 |
|
|
c |
22 |
|
|
c NB: mettre "inst(X)" dans le write_histXXX.h ! |
23 |
|
|
c==================================================================== |
24 |
|
|
integer jjmp1 |
25 |
|
|
parameter (jjmp1=jjm+1-1/jjm) |
26 |
|
|
c |
27 |
|
|
c variables Input |
28 |
guez |
7 |
INTEGER nlevSTD, klevSTD |
29 |
|
|
integer, intent(in):: itap |
30 |
guez |
3 |
PARAMETER(klevSTD=17) |
31 |
|
|
INTEGER ecrit_day, ecrit_mth, ecrit_hf2mth |
32 |
|
|
c |
33 |
|
|
c variables locales |
34 |
|
|
INTEGER i, k, nout |
35 |
|
|
PARAMETER(nout=3) !nout=1 day/nout=2 mth/nout=3 NMC |
36 |
|
|
c |
37 |
|
|
c variables Output |
38 |
|
|
REAL tnondef(klon,klevSTD,nout) |
39 |
|
|
REAL tsumSTD(klon,klevSTD,nout) |
40 |
|
|
c |
41 |
|
|
c calcul 1 fois par jour |
42 |
|
|
c |
43 |
|
|
IF(MOD(itap,ecrit_day).EQ.0) THEN |
44 |
|
|
DO k=1, nlevSTD |
45 |
|
|
DO i=1, klon |
46 |
|
|
IF(tnondef(i,k,1).NE.FLOAT(ecrit_day)) THEN |
47 |
|
|
tsumSTD(i,k,1)=tsumSTD(i,k,1)/ |
48 |
|
|
$ (FLOAT(ecrit_day)-tnondef(i,k,1)) |
49 |
|
|
ELSE |
50 |
|
|
tsumSTD(i,k,1)=1.E+20 |
51 |
|
|
ENDIF !tnondef |
52 |
|
|
ENDDO !i |
53 |
|
|
ENDDO !k |
54 |
|
|
ENDIF !MOD(itap,ecrit_day).EQ.0 |
55 |
|
|
c |
56 |
|
|
c calcul 1 fois par mois |
57 |
|
|
c |
58 |
|
|
IF(MOD(itap,ecrit_mth).EQ.0) THEN |
59 |
|
|
DO k=1, nlevSTD |
60 |
|
|
DO i=1, klon |
61 |
|
|
IF(tnondef(i,k,2).NE.FLOAT(ecrit_mth)) THEN |
62 |
|
|
tsumSTD(i,k,2)=tsumSTD(i,k,2)/ |
63 |
|
|
$ (FLOAT(ecrit_mth)-tnondef(i,k,2)) |
64 |
|
|
ELSE |
65 |
|
|
tsumSTD(i,k,2)=1.E+20 |
66 |
|
|
ENDIF !tnondef |
67 |
|
|
c |
68 |
|
|
IF(tnondef(i,k,3).NE.FLOAT(ecrit_hf2mth)) THEN |
69 |
|
|
tsumSTD(i,k,3)=tsumSTD(i,k,3)/ |
70 |
|
|
$ (FLOAT(ecrit_hf2mth)-tnondef(i,k,3)) |
71 |
|
|
ELSE |
72 |
|
|
tsumSTD(i,k,3)=1.E+20 |
73 |
|
|
ENDIF !tnondef |
74 |
|
|
c |
75 |
|
|
ENDDO !i |
76 |
|
|
ENDDO !k |
77 |
|
|
ENDIF !MOD |
78 |
|
|
c |
79 |
|
|
RETURN |
80 |
|
|
END |