1 |
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 |
INTEGER nlevSTD, klevSTD, itap |
29 |
PARAMETER(klevSTD=17) |
30 |
INTEGER ecrit_day, ecrit_mth, ecrit_hf2mth |
31 |
c |
32 |
c variables locales |
33 |
INTEGER i, k, nout |
34 |
PARAMETER(nout=3) !nout=1 day/nout=2 mth/nout=3 NMC |
35 |
c |
36 |
c variables Output |
37 |
REAL tnondef(klon,klevSTD,nout) |
38 |
REAL tsumSTD(klon,klevSTD,nout) |
39 |
c |
40 |
c calcul 1 fois par jour |
41 |
c |
42 |
IF(MOD(itap,ecrit_day).EQ.0) THEN |
43 |
DO k=1, nlevSTD |
44 |
DO i=1, klon |
45 |
IF(tnondef(i,k,1).NE.FLOAT(ecrit_day)) THEN |
46 |
tsumSTD(i,k,1)=tsumSTD(i,k,1)/ |
47 |
$ (FLOAT(ecrit_day)-tnondef(i,k,1)) |
48 |
ELSE |
49 |
tsumSTD(i,k,1)=1.E+20 |
50 |
ENDIF !tnondef |
51 |
ENDDO !i |
52 |
ENDDO !k |
53 |
ENDIF !MOD(itap,ecrit_day).EQ.0 |
54 |
c |
55 |
c calcul 1 fois par mois |
56 |
c |
57 |
IF(MOD(itap,ecrit_mth).EQ.0) THEN |
58 |
DO k=1, nlevSTD |
59 |
DO i=1, klon |
60 |
IF(tnondef(i,k,2).NE.FLOAT(ecrit_mth)) THEN |
61 |
tsumSTD(i,k,2)=tsumSTD(i,k,2)/ |
62 |
$ (FLOAT(ecrit_mth)-tnondef(i,k,2)) |
63 |
ELSE |
64 |
tsumSTD(i,k,2)=1.E+20 |
65 |
ENDIF !tnondef |
66 |
c |
67 |
IF(tnondef(i,k,3).NE.FLOAT(ecrit_hf2mth)) THEN |
68 |
tsumSTD(i,k,3)=tsumSTD(i,k,3)/ |
69 |
$ (FLOAT(ecrit_hf2mth)-tnondef(i,k,3)) |
70 |
ELSE |
71 |
tsumSTD(i,k,3)=1.E+20 |
72 |
ENDIF !tnondef |
73 |
c |
74 |
ENDDO !i |
75 |
ENDDO !k |
76 |
ENDIF !MOD |
77 |
c |
78 |
RETURN |
79 |
END |