source: LMDZ4/trunk/libf/phylmd/moy_undefSTD.F @ 1279

Last change on this file since 1279 was 1279, checked in by Laurent Fairhead, 14 years ago

Merged LMDZ4-dev branch changes r1241:1278 into the trunk
Running trunk and LMDZ4-dev in LMDZOR configuration on local
machine (sequential) and SX8 (4-proc) yields identical results
(restart and restartphy are identical binarily)
Log history from r1241 to r1278 is available by switching to
source:LMDZ4/branches/LMDZ4-dev-20091210

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