source: LMDZ5/trunk/libf/phylmd/write_histmthNMC.h @ 1577

Last change on this file since 1577 was 1577, checked in by Laurent Fairhead, 13 years ago

Modifications au code qui permettent de commencer une simulation à n'importe
quelle heure de la journée. On fait toujours un nombre entier de jours de
simulation.
On spécifie cette heure de départ dans la variable starttime du run.def (la
valeur est en jour et elle est à zéro par défaut).
La valeur est sauvegardée dans le fichier restart.nc. Les valeurs lues dans
le fichier start et le run.def sont comparées en début de simulation. La
simulation s'arrête si elles ne sont pas égales sauf si une remise à zéro de
la date a été demandée.
Par ailleurs, la fréquence de lecture des conditions aux limites a été modifiée
pour qu'à chaque changement de jour, celles-ci soient mises à jour (jusqu'à
maintenant elles étaient mises à jour à une fréquence donnée qui, en cas de
départ de simulation à une heure différente de minuit, ne correspondait pas
forcèment à un changement dans la date).
Validation effectuée en traçant le flux solaire descendant au sommet de
l'atmosphère à différentes heures de la journée, après un redémarrage, en
s'assurant que le maximum est bien là où il est sensé être.


Modifications to the code to enable it to be started at any time of the day.
The code still runs for an integer number of days.
The start time is specified using variable starttime in the run.def file (the
value is in days and is zero by default).
The start time is saved in the restart.nc file at the end of the simulation.
The values read in from the start.nc file and the run.def file are compared
at the start of the simulation. If they differ, the simulation is aborted
unless the raz_date variable has been set.
Furthermore, the frequency at which boundary conditions are read in has been
modified so that they are updated everyday at midnight (until now, they were
updated at a certain frequency that, in case of a simulation starting at a time
other than midnight, did not ensure that those conditions would be updated each
day at midnight)
The modifications were validated by plotting the downward solaf flux at TOA at
different times of the day (and after having restarted the simulation) and
ensuring that the maximum of flux was at the right place according to local
time.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
1!
2! $Id: write_histmthNMC.h 1577 2011-10-20 15:06:47Z fairhead $
3!
4      IF (ok_histNMC(1)) THEN
5c
6       ndex3d = 0
7       itau_w = itau_phy + itap + start_time * day_step / iphysiq
8ccc
9c  Champs interpolles sur des niveaux de pression du NMC
10c
11c     PARAMETER(nout=3) 
12c nout=1 : in=pdtphys,    out=mth
13c nout=2 : in=pdtphys,    out=day
14c nout=3 : in=pdtphys,    out=hf
15ccc
16      CALL histwrite_phy(nid_mthnmc,lNMC,"tnondef",itau_w,
17     $tnondef(:,:,1))
18c
19      CALL histwrite_phy(nid_mthnmc,lNMC,"ta",itau_w,
20     $twriteSTD(:,:,1))
21c
22      CALL histwrite_phy(nid_mthnmc,lNMC,"zg",itau_w,
23     $phiwriteSTD(:,:,1))
24c
25       CALL histwrite_phy(nid_mthnmc,lNMC,"hus",itau_w,
26     $qwriteSTD(:,:,1))
27c
28       CALL histwrite_phy(nid_mthnmc,lNMC,"hur",itau_w,
29     $rhwriteSTD(:,:,1))
30c
31       CALL histwrite_phy(nid_mthnmc,lNMC,"ua",itau_w,
32     $uwriteSTD(:,:,1))
33c
34       CALL histwrite_phy(nid_mthnmc,lNMC,"va",itau_w,
35     $vwriteSTD(:,:,1))
36c
37       CALL histwrite_phy(nid_mthnmc,lNMC,"wap",itau_w,
38     $wwriteSTD(:,:,1))
39c
40       DO k=1, nlevSTD
41        DO i=1, klon
42         IF(tnondef(i,k,1).NE.missing_val) THEN
43          zx_tmp_fiNC(i,k) = (100.*tnondef(i,k,1))/freq_moyNMC(1)
44         ELSE
45          zx_tmp_fiNC(i,k) = missing_val
46         ENDIF
47        ENDDO
48       ENDDO !k=1, nlevSTD
49c
50      CALL histwrite_phy(nid_mthnmc,lNMC,"psbg",itau_w,
51     $zx_tmp_fiNC)
52c
53      CALL histwrite_phy(nid_mthnmc,lNMC,"uv",itau_w,
54     $uvsumSTD(:,:,1))
55c
56      CALL histwrite_phy(nid_mthnmc,lNMC,"vq",itau_w,
57     $vqsumSTD(:,:,1))
58c
59      CALL histwrite_phy(nid_mthnmc,lNMC,"vT",itau_w,
60     $vTsumSTD(:,:,1))
61c
62      CALL histwrite_phy(nid_mthnmc,lNMC,"wq",itau_w,
63     $wqsumSTD(:,:,1))
64c
65      CALL histwrite_phy(nid_mthnmc,lNMC,"vphi",itau_w,
66     $vphisumSTD(:,:,1))
67c
68       CALL histwrite_phy(nid_mthnmc,lNMC,"wT",itau_w,
69     $wTsumSTD(:,:,1))
70c
71       CALL histwrite_phy(nid_mthnmc,lNMC,"uxu",itau_w,
72     $u2sumSTD(:,:,1))
73c
74       CALL histwrite_phy(nid_mthnmc,lNMC,"vxv",itau_w,
75     $v2sumSTD(:,:,1))
76c
77       CALL histwrite_phy(nid_mthnmc,lNMC,"TxT",itau_w,
78     $T2sumSTD(:,:,1))
79c
80       DO k=1, nlevSTD
81        DO i=1, klon
82         IF(O3sumSTD(i,k,1).NE.missing_val) THEN
83          zx_tmp_fiNC(i,k) = O3sumSTD(i,k,1) * 1.e+9
84         ELSE
85          zx_tmp_fiNC(i,k) = missing_val
86         ENDIF
87        ENDDO
88       ENDDO !k=1, nlevSTD
89       CALL histwrite_phy(nid_mthnmc,lNMC,"tro3",itau_w,
90     $ zx_tmp_fiNC)
91c
92       if (read_climoz == 2) THEN
93       DO k=1, nlevSTD
94        DO i=1, klon
95         IF(O3daysumSTD(i,k,1).NE.missing_val) THEN
96          zx_tmp_fiNC(i,k) = O3daysumSTD(i,k,1) * 1.e+9
97         ELSE
98          zx_tmp_fiNC(i,k) = missing_val
99         ENDIF
100        ENDDO
101       ENDDO !k=1, nlevSTD
102c
103        CALL histwrite_phy(nid_mthnmc,lNMC,"tro3_daylight",
104     $itau_w, zx_tmp_fiNC)
105       endif
106c
107      if (ok_sync) then
108c$OMP MASTER
109        call histsync(nid_mthnmc)
110c$OMP END MASTER
111      endif
112c
113      ENDIF !(ok_histNMC(1)) THEN
Note: See TracBrowser for help on using the repository browser.