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

Last change on this file since 1336 was 1279, checked in by Laurent Fairhead, 15 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
RevLine 
[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
10c
11c====================================================================
12c
13c I. Musat : 09.2004
14c
15c Moyenne - a des frequences differentes - des valeurs bien definies
[1279]16c         (.NE.1.E+20) des variables interpolees a un niveau de
[644]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====================================================================
[766]27cym#include "dimensions.h"
28cym      integer jjmp1
29cym      parameter (jjmp1=jjm+1-1/jjm)
30cym#include "dimphy.h"
[644]31c
[1279]32c
[644]33c variables Input
34      INTEGER nlevSTD, klevSTD, itap
35      PARAMETER(klevSTD=17)
[684]36      REAL dtime, ecrit_day, ecrit_mth, ecrit_hf2mth
[644]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
[1233]46      REAL missing_val
47c
48      missing_val=nf90_fill_real
49c
[644]50c calcul 1 fois par jour
51c
[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
64c
65c calcul 1 fois par mois
66c
[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
76c
[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
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.