[776] | 1 | ! |
---|
[1403] | 2 | ! $Id: moy_undefSTD.F 1403 2010-07-01 09:02:53Z emillour $ |
---|
[776] | 3 | ! |
---|
[1352] | 4 | SUBROUTINE moy_undefSTD(itap,freq_outNMC,freq_moyNMC) |
---|
[1233] | 5 | USE netcdf |
---|
[766] | 6 | USE dimphy |
---|
[1352] | 7 | USE phys_state_var_mod ! Variables sauvegardees de la physique |
---|
[644] | 8 | IMPLICIT none |
---|
| 9 | c |
---|
| 10 | c==================================================================== |
---|
| 11 | c |
---|
| 12 | c I. Musat : 09.2004 |
---|
| 13 | c |
---|
| 14 | c Moyenne - a des frequences differentes - des valeurs bien definies |
---|
[1352] | 15 | c (.NE.missing_val) des variables interpolees a un niveau de |
---|
[644] | 16 | c pression. |
---|
| 17 | c 1) les variables de type "day" (nout=1) ou "mth" (nout=2) sont sommees |
---|
| 18 | c tous les pas de temps de la physique |
---|
| 19 | c |
---|
| 20 | c 2) les variables de type "NMC" (nout=3) sont calculees a partir |
---|
| 21 | c des valeurs instantannees toutes les 6 heures |
---|
| 22 | c |
---|
| 23 | c |
---|
[1352] | 24 | c NB: mettre "inst(X)" dans le write_hist*NMC.h ! |
---|
[644] | 25 | c==================================================================== |
---|
[766] | 26 | cym#include "dimensions.h" |
---|
| 27 | cym integer jjmp1 |
---|
| 28 | cym parameter (jjmp1=jjm+1-1/jjm) |
---|
| 29 | cym#include "dimphy.h" |
---|
[644] | 30 | c |
---|
[1279] | 31 | c |
---|
[644] | 32 | c variables Input |
---|
[1352] | 33 | c INTEGER nlevSTD, klevSTD, itap |
---|
| 34 | c PARAMETER(klevSTD=17) |
---|
| 35 | INTEGER itap |
---|
[644] | 36 | c |
---|
| 37 | c variables locales |
---|
[1352] | 38 | c INTEGER i, k, nout, n |
---|
| 39 | c PARAMETER(nout=3) !nout=1 day/nout=2 mth/nout=3 NMC |
---|
| 40 | INTEGER i, k, n |
---|
| 41 | c REAL dtime, freq_outNMC(nout), freq_moyNMC(nout) |
---|
| 42 | REAL freq_outNMC(nout), freq_moyNMC(nout) |
---|
[644] | 43 | c |
---|
| 44 | c variables Output |
---|
[1352] | 45 | c REAL tnondef(klon,klevSTD,nout) |
---|
| 46 | c REAL tsumSTD(klon,klevSTD,nout) |
---|
[644] | 47 | c |
---|
[1233] | 48 | REAL missing_val |
---|
| 49 | c |
---|
| 50 | missing_val=nf90_fill_real |
---|
| 51 | c |
---|
[1352] | 52 | DO n=1, nout |
---|
| 53 | c |
---|
[644] | 54 | c calcul 1 fois par jour |
---|
| 55 | c |
---|
[1352] | 56 | IF(MOD(itap,NINT(freq_outNMC(n)/dtime)).EQ.0) THEN |
---|
[644] | 57 | c |
---|
[1352] | 58 | DO k=1, nlevSTD |
---|
| 59 | DO i=1, klon |
---|
| 60 | IF(tnondef(i,k,n).NE.(freq_moyNMC(n))) THEN |
---|
| 61 | tsumSTD(i,k,n)=tsumSTD(i,k,n)/ |
---|
| 62 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
| 63 | cIM BEG |
---|
| 64 | usumSTD(i,k,n)=usumSTD(i,k,n)/ |
---|
| 65 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
| 66 | vsumSTD(i,k,n)=vsumSTD(i,k,n)/ |
---|
| 67 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
| 68 | wsumSTD(i,k,n)=wsumSTD(i,k,n)/ |
---|
| 69 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
| 70 | phisumSTD(i,k,n)=phisumSTD(i,k,n)/ |
---|
| 71 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
| 72 | qsumSTD(i,k,n)=qsumSTD(i,k,n)/ |
---|
| 73 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
| 74 | rhsumSTD(i,k,n)=rhsumSTD(i,k,n)/ |
---|
| 75 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
| 76 | uvsumSTD(i,k,n)=uvsumSTD(i,k,n)/ |
---|
| 77 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
| 78 | vqsumSTD(i,k,n)=vqsumSTD(i,k,n)/ |
---|
| 79 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
| 80 | vTsumSTD(i,k,n)=vTsumSTD(i,k,n)/ |
---|
| 81 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
| 82 | wqsumSTD(i,k,n)=wqsumSTD(i,k,n)/ |
---|
| 83 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
| 84 | vphisumSTD(i,k,n)=vphisumSTD(i,k,n)/ |
---|
| 85 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
| 86 | wTsumSTD(i,k,n)=wTsumSTD(i,k,n)/ |
---|
| 87 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
| 88 | u2sumSTD(i,k,n)=u2sumSTD(i,k,n)/ |
---|
| 89 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
| 90 | v2sumSTD(i,k,n)=v2sumSTD(i,k,n)/ |
---|
| 91 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
| 92 | T2sumSTD(i,k,n)=T2sumSTD(i,k,n)/ |
---|
| 93 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
[1398] | 94 | O3sumSTD(i,k,n)=O3sumSTD(i,k,n)/ |
---|
| 95 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
| 96 | O3daysumSTD(i,k,n)=O3daysumSTD(i,k,n)/ |
---|
| 97 | $ (freq_moyNMC(n)-tnondef(i,k,n)) |
---|
[1352] | 98 | cIM END |
---|
| 99 | ELSE |
---|
| 100 | tsumSTD(i,k,n)=missing_val |
---|
| 101 | usumSTD(i,k,n)=missing_val |
---|
| 102 | vsumSTD(i,k,n)=missing_val |
---|
| 103 | wsumSTD(i,k,n)=missing_val |
---|
| 104 | phisumSTD(i,k,n)=missing_val |
---|
| 105 | qsumSTD(i,k,n)=missing_val |
---|
| 106 | rhsumSTD(i,k,n)=missing_val |
---|
| 107 | uvsumSTD(i,k,n)=missing_val |
---|
| 108 | vqsumSTD(i,k,n)=missing_val |
---|
| 109 | vTsumSTD(i,k,n)=missing_val |
---|
| 110 | wqsumSTD(i,k,n)=missing_val |
---|
| 111 | vphisumSTD(i,k,n)=missing_val |
---|
| 112 | wTsumSTD(i,k,n)=missing_val |
---|
| 113 | u2sumSTD(i,k,n)=missing_val |
---|
| 114 | v2sumSTD(i,k,n)=missing_val |
---|
| 115 | T2sumSTD(i,k,n)=missing_val |
---|
[1398] | 116 | O3sumSTD(i,k,n)=missing_val |
---|
| 117 | O3daysumSTD(i,k,n)=missing_val |
---|
[1352] | 118 | ENDIF !tnondef(i,k,n).NE.(freq_moyNMC(n)) |
---|
| 119 | ENDDO !i |
---|
| 120 | ENDDO !k |
---|
| 121 | ENDIF !MOD(itap,NINT(freq_outNMC(n)/dtime)).EQ.0 |
---|
[644] | 122 | c |
---|
[1352] | 123 | ENDDO !n |
---|
| 124 | c |
---|
[644] | 125 | RETURN |
---|
| 126 | END |
---|