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