source: LMDZ6/trunk/libf/phylmd/moy_undefSTD.F90 @ 3981

Last change on this file since 3981 was 3435, checked in by Laurent Fairhead, 5 years ago

"Historic" :-) commit merging the physics branch used for DYNAMICO with the LMDZ trunk.
The same physics branch can now be used seamlessly with the traditional lon-lat LMDZ
dynamical core and DYNAMICO.
Testing consisted in running a lon-lat LMDZ bucket simulation with the NPv6.1 physics package
with the original trunk sources and the merged sources. Tests were succesful in the sense that
numeric continuity was preserved in the restart files from both simulation. Further tests
included running both versions of the physics codes for one year in a LMDZOR setting in which
the restart files also came out identical.

Caution:

  • as the physics package now manages unstructured grids, grid information needs to be transmitted

to the surface scheme ORCHIDEE. This means that the interface defined in surf_land_orchidee_mod.F90
is only compatible with ORCHIDEE version orchidee2.1 and later versions. If previous versions of
ORCHIDEE need to be used, the CPP key ORCHIDEE_NOUNSTRUCT needs to be set at compilation time.
This is done automatically if makelmdz/makelmdz_fcm are called with the veget orchidee2.0 switch

  • due to a limitation in XIOS, the time at which limit conditions will be read in by DYNAMICO will be

delayed by one physic timestep with respect to the time it is read in by the lon-lat model. This is caused
by the line

IF (MOD(itime-1, lmt_pas) == 0 .OR. (jour_lu /= jour .AND. grid_type /= unstructured)) THEN ! time to read

in limit_read_mod.F90

Work still needed on COSP integration and XML files for DYNAMICO

EM, YM, LF

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.8 KB
Line 
1
2! $Id: moy_undefSTD.F90 3435 2019-01-22 15:21:59Z fairhead $
3
4SUBROUTINE moy_undefstd(itap, itapm1)
5  USE netcdf
6  USE dimphy
7#ifdef CPP_IOIPSL
8  USE phys_state_var_mod
9#endif
10#ifdef CPP_XIOS
11  USE wxios, ONLY: missing_val
12#endif
13 
14  USE phys_cal_mod, ONLY: mth_len
15  IMPLICIT NONE
16  include "clesphys.h"
17#ifndef CPP_XIOS
18  REAL :: missing_val
19#endif
20
21  ! ====================================================================
22
23  ! I. Musat : 09.2004
24
25  ! Moyenne - a des frequences differentes - des valeurs bien definies
26  ! (.NE.missing_val) des variables interpolees a un niveau de
27  ! pression.
28  ! 1) les variables de type "day" (nout=1) ou "mth" (nout=2) sont sommees
29  ! tous les pas de temps de la physique
30
31  ! 2) les variables de type "NMC" (nout=3) sont calculees a partir
32  ! des valeurs instantannees toutes les 6 heures
33
34
35  ! NB: mettre "inst(X)" dans le write_hist*NMC.h !
36  ! ====================================================================
37
38
39  ! variables Input
40  ! INTEGER nlevSTD, klevSTD, itap
41  ! PARAMETER(klevSTD=17)
42  INTEGER itap, itapm1
43
44  ! variables locales
45  ! INTEGER i, k, nout, n
46  ! PARAMETER(nout=3) !nout=1 day/nout=2 mth/nout=3 NMC
47  INTEGER i, k, n
48  ! REAL dtime, freq_outNMC(nout), freq_moyNMC(nout)
49  ! REAL freq_outNMC(nout), freq_calNMC(nout)
50  REAL freq_moynmc(nout)
51
52  ! variables Output
53  ! REAL tnondef(klon,klevSTD,nout)
54  ! REAL tsumSTD(klon,klevSTD,nout)
55
56  REAL un_jour
57  PARAMETER (un_jour=86400.)
58! REAL missing_val
59
60! missing_val = nf90_fill_real
61#ifndef CPP_XIOS
62      missing_val=missing_val_nf90
63#endif
64
65  DO n = 1, nout
66    IF (freq_outnmc(n)<0) THEN
67      freq_moynmc(n) = (mth_len*un_jour)/freq_calnmc(n)
68      ! print*,'moy_undefSTD n freq_out freq_moy =',
69      ! $n,freq_moyNMC(n)
70    ELSE
71      freq_moynmc(n) = freq_outnmc(n)/freq_calnmc(n)
72    END IF
73
74    ! calcul 1 fois pas mois, 1 fois par jour ou toutes les 6h
75
76    IF (n==1 .AND. itap==itapm1 .OR. n>1 .AND. mod(itap,nint(freq_outnmc(n)/ &
77        phys_tstep))==0) THEN
78
79      ! print*,'moy_undefSTD n itap itapm1',n,itap,itapm1
80
81      DO k = 1, nlevstd
82        DO i = 1, klon
83          IF (tnondef(i,k,n)/=(freq_moynmc(n))) THEN
84            tsumstd(i, k, n) = tsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k,n &
85              ))
86            usumstd(i, k, n) = usumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k,n &
87              ))
88            vsumstd(i, k, n) = vsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k,n &
89              ))
90            wsumstd(i, k, n) = wsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k,n &
91              ))
92            phisumstd(i, k, n) = phisumstd(i, k, n)/ &
93              (freq_moynmc(n)-tnondef(i,k,n))
94            qsumstd(i, k, n) = qsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k,n &
95              ))
96            rhsumstd(i, k, n) = rhsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
97              ,n))
98            uvsumstd(i, k, n) = uvsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
99              ,n))
100            vqsumstd(i, k, n) = vqsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
101              ,n))
102            vtsumstd(i, k, n) = vtsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
103              ,n))
104            wqsumstd(i, k, n) = wqsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
105              ,n))
106            vphisumstd(i, k, n) = vphisumstd(i, k, n)/ &
107              (freq_moynmc(n)-tnondef(i,k,n))
108            wtsumstd(i, k, n) = wtsumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
109              ,n))
110            u2sumstd(i, k, n) = u2sumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
111              ,n))
112            v2sumstd(i, k, n) = v2sumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
113              ,n))
114            t2sumstd(i, k, n) = t2sumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
115              ,n))
116            o3sumstd(i, k, n) = o3sumstd(i, k, n)/(freq_moynmc(n)-tnondef(i,k &
117              ,n))
118            o3daysumstd(i, k, n) = o3daysumstd(i, k, n)/ &
119              (freq_moynmc(n)-tnondef(i,k,n))
120          ELSE
121            tsumstd(i, k, n) = missing_val
122            usumstd(i, k, n) = missing_val
123            vsumstd(i, k, n) = missing_val
124            wsumstd(i, k, n) = missing_val
125            phisumstd(i, k, n) = missing_val
126            qsumstd(i, k, n) = missing_val
127            rhsumstd(i, k, n) = missing_val
128            uvsumstd(i, k, n) = missing_val
129            vqsumstd(i, k, n) = missing_val
130            vtsumstd(i, k, n) = missing_val
131            wqsumstd(i, k, n) = missing_val
132            vphisumstd(i, k, n) = missing_val
133            wtsumstd(i, k, n) = missing_val
134            u2sumstd(i, k, n) = missing_val
135            v2sumstd(i, k, n) = missing_val
136            t2sumstd(i, k, n) = missing_val
137            o3sumstd(i, k, n) = missing_val
138            o3daysumstd(i, k, n) = missing_val
139          END IF !tnondef(i,k,n).NE.(freq_moyNMC(n))
140        END DO !i
141      END DO !k
142    END IF !MOD(itap,NINT(freq_outNMC(n)/phys_tstep)).EQ.0
143
144  END DO !n
145
146  RETURN
147END SUBROUTINE moy_undefstd
Note: See TracBrowser for help on using the repository browser.