source: LMDZ5/trunk/libf/phylmd/write_histrac.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!$Id $
2!***************************************
3!  ECRITURE DU FICHIER :  histrac.nc
4!***************************************
5  IF (ecrit_tra > 0.) THEN
6     
7     itau_w = itau_phy + nstep + start_time * day_step / iphysiq
8     
9     CALL histwrite_phy(nid_tra,.FALSE.,"phis",itau_w,pphis)
10     CALL histwrite_phy(nid_tra,.FALSE.,"aire",itau_w,airephy)
11     CALL histwrite_phy(nid_tra,.FALSE.,"zmasse",itau_w,zmasse)
12
13!TRACEURS
14!----------------
15     DO it=1,nbtr
16        iiq=niadv(it+2)
17
18! CONCENTRATIONS
19        CALL histwrite_phy(nid_tra,.FALSE.,tname(iiq),itau_w,tr_seri(:,:,it))
20
21! TD LESSIVAGE       
22        IF (lessivage .AND. aerosol(it)) THEN
23           CALL histwrite_phy(nid_tra,.FALSE.,"fl"//tname(iiq),itau_w,flestottr(:,:,it))
24        ENDIF
25
26! TD THERMIQUES
27        IF (iflag_thermals.gt.0) THEN
28           CALL histwrite_phy(nid_tra,.FALSE.,"d_tr_th_"//tname(iiq),itau_w,d_tr_th(:,:,it))
29        ENDIF
30
31! TD CONVECTION
32        IF (iflag_con.GE.2) THEN
33           CALL histwrite_phy(nid_tra,.FALSE.,"d_tr_cv_"//tname(iiq),itau_w,d_tr_cv(:,:,it))
34        ENDIF
35
36! TD COUCHE-LIMITE
37        CALL histwrite_phy(nid_tra,.FALSE.,"d_tr_cl_"//tname(iiq),itau_w,d_tr_cl(:,:,it))
38     ENDDO
39!---------------
40!
41!
42! VENT (niveau 1)   
43     CALL histwrite_phy(nid_tra,.FALSE.,"pyu1",itau_w,yu1)
44     CALL histwrite_phy(nid_tra,.FALSE.,"pyv1",itau_w,yv1)
45!
46! TEMPERATURE DU SOL
47     zx_tmp_fi2d(:)=ftsol(:,1)         
48     CALL histwrite_phy(nid_tra,.FALSE.,"ftsol1",itau_w,zx_tmp_fi2d)
49     zx_tmp_fi2d(:)=ftsol(:,2)
50     CALL histwrite_phy(nid_tra,.FALSE.,"ftsol2",itau_w,zx_tmp_fi2d)
51     zx_tmp_fi2d(:)=ftsol(:,3)
52     CALL histwrite_phy(nid_tra,.FALSE.,"ftsol3",itau_w,zx_tmp_fi2d)
53     zx_tmp_fi2d(:)=ftsol(:,4)
54     CALL histwrite_phy(nid_tra,.FALSE.,"ftsol4",itau_w,zx_tmp_fi2d)
55!     
56! NATURE DU SOL
57     zx_tmp_fi2d(:)=pctsrf(:,1)
58     CALL histwrite_phy(nid_tra,.FALSE.,"psrf1",itau_w,zx_tmp_fi2d)
59     zx_tmp_fi2d(:)=pctsrf(:,2)
60     CALL histwrite_phy(nid_tra,.FALSE.,"psrf2",itau_w,zx_tmp_fi2d)
61     zx_tmp_fi2d(:)=pctsrf(:,3)
62     CALL histwrite_phy(nid_tra,.FALSE.,"psrf3",itau_w,zx_tmp_fi2d)
63     zx_tmp_fi2d(:)=pctsrf(:,4)
64     CALL histwrite_phy(nid_tra,.FALSE.,"psrf4",itau_w,zx_tmp_fi2d)
65 
66! DIVERS   
67     CALL histwrite_phy(nid_tra,.FALSE.,"pplay",itau_w,pplay)     
68     CALL histwrite_phy(nid_tra,.FALSE.,"T",itau_w,t_seri)     
69     CALL histwrite_phy(nid_tra,.FALSE.,"mfu",itau_w,pmfu)
70     CALL histwrite_phy(nid_tra,.FALSE.,"mfd",itau_w,pmfd)
71     CALL histwrite_phy(nid_tra,.FALSE.,"en_u",itau_w,pen_u)
72     CALL histwrite_phy(nid_tra,.FALSE.,"en_d",itau_w,pen_d)
73     CALL histwrite_phy(nid_tra,.FALSE.,"de_d",itau_w,pde_d)
74     CALL histwrite_phy(nid_tra,.FALSE.,"de_u",itau_w,pde_u)
75     CALL histwrite_phy(nid_tra,.FALSE.,"coefh",itau_w,coefh)
76
77     IF (ok_sync) THEN
78!$OMP MASTER
79        CALL histsync(nid_tra)
80!$OMP END MASTER
81     ENDIF
82
83  ENDIF !ecrit_tra>0.
84
Note: See TracBrowser for help on using the repository browser.