1 |
|
|
|
2 |
|
|
! $Id: undefSTD.F90 4593 2023-06-29 13:55:54Z ymeurdesoif $ |
3 |
|
|
|
4 |
|
288 |
SUBROUTINE undefstd(itap, read_climoz) |
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 |
|
|
IMPLICIT NONE |
15 |
|
|
include "clesphys.h" |
16 |
|
|
#ifndef CPP_XIOS |
17 |
|
|
REAL :: missing_val |
18 |
|
|
#endif |
19 |
|
|
|
20 |
|
|
! ==================================================================== |
21 |
|
|
|
22 |
|
|
! I. Musat : 09.2004 |
23 |
|
|
|
24 |
|
|
! Calcul * du nombre de pas de temps (FLOAT(ecrit_XXX)-tnondef)) |
25 |
|
|
! ou la variable tlevSTD est bien definie (.NE.missing_val), |
26 |
|
|
! et |
27 |
|
|
! * de la somme de tlevSTD => tsumSTD |
28 |
|
|
|
29 |
|
|
! nout=1 !var. journaliere "day" moyenne sur tous les pas de temps |
30 |
|
|
! ! de la physique |
31 |
|
|
! nout=2 !var. mensuelle "mth" moyennee sur tous les pas de temps |
32 |
|
|
! ! de la physique |
33 |
|
|
! nout=3 !var. mensuelle "NMC" moyennee toutes les ecrit_hf |
34 |
|
|
|
35 |
|
|
|
36 |
|
|
! NB: mettre "inst(X)" dans le write_hist*NMC.h ! |
37 |
|
|
! ==================================================================== |
38 |
|
|
|
39 |
|
|
! ymINCLUDE "dimphy.h" |
40 |
|
|
! variables Input |
41 |
|
|
|
42 |
|
|
! INTEGER nlevSTD, klevSTD, itap |
43 |
|
|
! PARAMETER(klevSTD=17) |
44 |
|
|
INTEGER itap |
45 |
|
|
|
46 |
|
|
! variables locales |
47 |
|
|
! INTEGER i, k, nout, n |
48 |
|
|
! PARAMETER(nout=3) !nout=1 : day; =2 : mth; =3 : NMC |
49 |
|
|
INTEGER i, k, n |
50 |
|
|
! REAL freq_calNMC(nout) |
51 |
|
|
INTEGER read_climoz |
52 |
|
|
|
53 |
|
|
! variables Output |
54 |
|
|
! REAL tlevSTD(klon,klevSTD), tsumSTD(klon,klevSTD,nout) |
55 |
|
|
! LOGICAL oknondef(klon,klevSTD,nout) |
56 |
|
|
! REAL tnondef(klon,klevSTD,nout) |
57 |
|
|
|
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 |
✓✓ |
1152 |
DO n = 1, nout |
66 |
|
|
|
67 |
|
|
|
68 |
|
|
! calcul variables tous les freq_calNMC(n)/phys_tstep pas de temps |
69 |
|
|
! de la physique |
70 |
|
|
|
71 |
✓✗ |
1152 |
IF (mod(itap,nint(freq_calnmc(n)/phys_tstep))==0) THEN |
72 |
✓✓ |
15552 |
DO k = 1, nlevstd |
73 |
✓✓ |
14615424 |
DO i = 1, klon |
74 |
✓✓ |
14614560 |
IF (tlevstd(i,k)==missing_val) THEN |
75 |
|
|
! IF(oknondef(i,k,n)) THEN |
76 |
|
673119 |
tnondef(i, k, n) = tnondef(i, k, n) + 1. |
77 |
|
|
! ENDIF !oknondef(i,k) |
78 |
|
|
|
79 |
|
|
ELSE IF (tlevstd(i,k)/=missing_val) THEN |
80 |
|
13926753 |
tsumstd(i, k, n) = tsumstd(i, k, n) + tlevstd(i, k) |
81 |
|
13926753 |
usumstd(i, k, n) = usumstd(i, k, n) + ulevstd(i, k) |
82 |
|
13926753 |
vsumstd(i, k, n) = vsumstd(i, k, n) + vlevstd(i, k) |
83 |
|
13926753 |
wsumstd(i, k, n) = wsumstd(i, k, n) + wlevstd(i, k) |
84 |
|
13926753 |
phisumstd(i, k, n) = phisumstd(i, k, n) + philevstd(i, k) |
85 |
|
13926753 |
qsumstd(i, k, n) = qsumstd(i, k, n) + qlevstd(i, k) |
86 |
|
13926753 |
rhsumstd(i, k, n) = rhsumstd(i, k, n) + rhlevstd(i, k) |
87 |
|
13926753 |
uvsumstd(i, k, n) = uvsumstd(i, k, n) + uvstd(i, k) |
88 |
|
13926753 |
vqsumstd(i, k, n) = vqsumstd(i, k, n) + vqstd(i, k) |
89 |
|
13926753 |
vtsumstd(i, k, n) = vtsumstd(i, k, n) + vtstd(i, k) |
90 |
|
13926753 |
wqsumstd(i, k, n) = wqsumstd(i, k, n) + wqstd(i, k) |
91 |
|
13926753 |
vphisumstd(i, k, n) = vphisumstd(i, k, n) + vphistd(i, k) |
92 |
|
13926753 |
wtsumstd(i, k, n) = wtsumstd(i, k, n) + wtstd(i, k) |
93 |
|
13926753 |
u2sumstd(i, k, n) = u2sumstd(i, k, n) + u2std(i, k) |
94 |
|
13926753 |
v2sumstd(i, k, n) = v2sumstd(i, k, n) + v2std(i, k) |
95 |
|
13926753 |
t2sumstd(i, k, n) = t2sumstd(i, k, n) + t2std(i, k) |
96 |
|
13926753 |
o3sumstd(i, k, n) = o3sumstd(i, k, n) + o3std(i, k) |
97 |
✗✓ |
13926753 |
IF (read_climoz==2) o3daysumstd(i, k, n) = o3daysumstd(i, k, n) + & |
98 |
|
|
o3daystd(i, k) |
99 |
|
|
|
100 |
|
|
END IF |
101 |
|
|
END DO !i |
102 |
|
|
END DO !k |
103 |
|
|
|
104 |
|
|
END IF !MOD(itap,NINT(freq_calNMC(n)/phys_tstep)).EQ.0 |
105 |
|
|
|
106 |
|
|
END DO !n |
107 |
|
|
|
108 |
|
288 |
RETURN |
109 |
|
|
END SUBROUTINE undefstd |