source: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/initphysto.F90 @ 5434

Last change on this file since 5434 was 1907, checked in by lguez, 11 years ago

Added a copyright property to every file of the distribution, except
for the fcm files (which have their own copyright). Use svn propget on
a file to see the copyright. For instance:

$ svn propget copyright libf/phylmd/physiq.F90
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

Also added the files defining the CeCILL version 2 license, in French
and English, at the top of the LMDZ tree.

  • 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: 6.6 KB
Line 
1!
2! $Id: initphysto.F90 1907 2013-11-26 13:10:46Z fhourdin $
3!
4SUBROUTINE initphysto(infile,tstep,t_ops,t_wrt,fileid)
5 
6  USE dimphy
7  USE mod_phys_lmdz_para
8  USE IOIPSL
9  USE iophy
10  USE control_mod
11  USE indice_sol_mod
12 
13  IMPLICIT NONE
14
15!
16!   Routine d'initialisation des ecritures des fichiers histoires LMDZ
17!   au format IOIPSL
18!
19!   Appels succesifs des routines: histbeg
20!                                  histhori
21!                                  histver
22!                                  histdef
23!                                  histend
24!
25!   Entree:
26!
27!      infile: nom du fichier histoire a creer
28!      day0,anne0: date de reference
29!      tstep: duree du pas de temps en seconde
30!      t_ops: frequence de l'operation pour IOIPSL
31!      t_wrt: frequence d'ecriture sur le fichier
32!
33!   Sortie:
34!      fileid: ID du fichier netcdf cree
35!
36!   L. Fairhead, LMD, 03/99
37!
38! =====================================================================
39!
40!   Declarations
41  INCLUDE "dimensions.h"
42  INCLUDE "paramet.h"
43  INCLUDE "comconst.h"
44  INCLUDE "comgeom.h"
45  INCLUDE "temps.h"
46  INCLUDE "logic.h"
47  INCLUDE "description.h"
48  INCLUDE "serre.h"
49
50!   Arguments
51  CHARACTER(len=*), INTENT(IN) :: infile
52  REAL, INTENT(IN)             :: tstep
53  REAL, INTENT(IN)             :: t_ops
54  REAL, INTENT(IN)             :: t_wrt
55  INTEGER, INTENT(OUT)         :: fileid
56
57! Variables locales
58  INTEGER nhoriid, i
59  INTEGER l,k
60  REAL nivsigs(llm)
61  INTEGER tau0
62  REAL zjulian
63  INTEGER iq
64  INTEGER uhoriid, vhoriid, thoriid, zvertiid
65  INTEGER ii,jj
66  INTEGER zan, idayref
67  LOGICAL ok_sync
68  REAL zx_lon(iim,jjm+1), zx_lat(iim,jjm+1)
69  CHARACTER(len=12) :: nvar
70
71!  Initialisations
72!
73  pi = 4. * ATAN (1.)
74  ok_sync= .TRUE.
75!
76!  Appel a histbeg: creation du fichier netcdf et initialisations diverses
77!         
78
79  zan = annee_ref
80  idayref = day_ref
81  CALL ymds2ju(zan, 1, idayref, 0.0, zjulian)
82  tau0 = 0
83 
84  CALL histbeg_phy(infile,tau0, zjulian, tstep, &
85       nhoriid, fileid)
86
87!$OMP MASTER   
88!  Appel a histvert pour la grille verticale
89!
90  DO l=1,llm
91     nivsigs(l)=REAL(l)
92  ENDDO
93 
94  CALL histvert(fileid, 'sig_s', 'Niveaux sigma', &
95       'sigma_level', &
96       llm, nivsigs, zvertiid)
97!
98!  Appels a histdef pour la definition des variables a sauvegarder
99!
100  CALL histdef(fileid, "phis", "Surface geop. height", "-", &
101       iim,jj_nb,nhoriid, 1,1,1, -99, 32, &
102       "once", t_ops, t_wrt)
103 
104  CALL histdef(fileid, "aire", "Grid area", "-", &
105       iim,jj_nb,nhoriid, 1,1,1, -99, 32, &
106       "once", t_ops, t_wrt)
107
108  CALL histdef(fileid, "longitudes", "longitudes", "-", &
109       iim,jj_nb,nhoriid, 1,1,1, -99, 32, &
110       "once", t_ops, t_wrt)
111
112  CALL histdef(fileid, "latitudes", "latitudes", "-", &
113       iim,jj_nb,nhoriid, 1,1,1, -99, 32, &
114       "once", t_ops, t_wrt)
115! T
116  CALL histdef(fileid, 't', 'Temperature', 'K', iim, jj_nb, nhoriid, &
117       llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
118! mfu
119  CALL histdef(fileid, 'mfu', 'flx m. pan. mt', 'kg m/s',iim, jj_nb, nhoriid, &
120       llm, 1, llm, zvertiid,32, 'inst(X)', t_ops, t_wrt)
121! mfd
122  CALL histdef(fileid, 'mfd', 'flx m. pan. des', 'kg m/s',iim, jj_nb, nhoriid, &
123       llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
124! en_u
125  CALL histdef(fileid, 'en_u', 'flx ent pan mt', 'kg m/s', iim, jj_nb, nhoriid, &
126       llm, 1, llm, zvertiid,32, 'inst(X)', t_ops, t_wrt)
127! de_u
128  CALL histdef(fileid, 'de_u', 'flx det pan mt', 'kg m/s',iim, jj_nb, nhoriid, &
129       llm, 1, llm, zvertiid,32, 'inst(X)', t_ops, t_wrt)
130! en_d
131  CALL histdef(fileid, 'en_d', 'flx ent pan dt', 'kg m/s', iim, jj_nb, nhoriid, &
132       llm, 1, llm, zvertiid,32, 'inst(X)', t_ops, t_wrt)
133! de_d
134  CALL histdef(fileid, 'de_d', 'flx det pan dt', 'kg m/s', iim, jj_nb, nhoriid, &
135       llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
136! coefh
137  CALL histdef(fileid, "coefh", " ", " ", iim, jj_nb, nhoriid, &
138       llm, 1, llm, zvertiid,32, "inst(X)", t_ops, t_wrt)
139! fm_th
140  CALL histdef(fileid, "fm_th", " ", " ",iim, jj_nb, nhoriid, &
141       llm, 1, llm, zvertiid,32, "inst(X)", t_ops, t_wrt)
142! en_th
143  CALL histdef(fileid, "en_th", " ", " ",iim, jj_nb, nhoriid, &
144       llm, 1, llm, zvertiid,32, "inst(X)", t_ops, t_wrt)
145! frac_impa
146  CALL histdef(fileid, 'frac_impa', ' ', ' ',iim, jj_nb, nhoriid, &
147       llm, 1, llm, zvertiid,32, 'inst(X)', t_ops, t_wrt)
148! frac_nucl
149  CALL histdef(fileid, 'frac_nucl', ' ', ' ',iim, jj_nb, nhoriid, &
150       llm, 1, llm, zvertiid,32, 'inst(X)', t_ops, t_wrt)
151! pyu1
152  CALL histdef(fileid, "pyu1", " ", " ", iim,jj_nb,nhoriid, &
153       1,1,1, -99, 32, "inst(X)", t_ops, t_wrt)
154! pyv1
155  CALL histdef(fileid, "pyv1", " ", " ", iim,jj_nb,nhoriid, &
156       1,1,1, -99, 32,"inst(X)", t_ops, t_wrt)   
157! ftsol1
158  CALL histdef(fileid, "ftsol1", " ", " ",iim, jj_nb, nhoriid, &
159       1, 1,1, -99,32, "inst(X)", t_ops, t_wrt)
160! ftsol2
161  CALL histdef(fileid, "ftsol2", " ", " ",iim, jj_nb, nhoriid, &
162       1, 1,1, -99,32, "inst(X)", t_ops, t_wrt)
163! ftsol3
164  CALL histdef(fileid, "ftsol3", " ", " ", iim, jj_nb, nhoriid, &
165       1, 1,1, -99,32, "inst(X)", t_ops, t_wrt)
166! ftsol4
167  CALL histdef(fileid, "ftsol4", " ", " ",iim, jj_nb, nhoriid, &
168       1, 1,1, -99, 32, "inst(X)", t_ops, t_wrt)
169! psrf1
170  CALL histdef(fileid, "psrf1", " ", " ",iim, jj_nb, nhoriid, &
171       1, 1, 1, -99,32, "inst(X)", t_ops, t_wrt)
172! psrf2
173  CALL histdef(fileid, "psrf2", " ", " ",iim, jj_nb, nhoriid, &
174       1, 1, 1, -99, 32, "inst(X)", t_ops, t_wrt)
175! psrf3
176  CALL histdef(fileid, "psrf3", " ", " ",iim, jj_nb, nhoriid, &
177       1, 1, 1, -99, 32, "inst(X)", t_ops, t_wrt)
178! psrf4
179  CALL histdef(fileid, "psrf4", " ", " ", iim, jj_nb, nhoriid, &
180       1, 1, 1, -99,32, "inst(X)", t_ops, t_wrt)
181! sh
182  CALL histdef(fileid, 'sh', '', '', iim, jj_nb, nhoriid, &
183       llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
184! da
185  CALL histdef(fileid, 'da', '', '', iim, jj_nb, nhoriid, &
186       llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
187! mp
188  CALL histdef(fileid, 'mp', '', '', iim, jj_nb, nhoriid, &
189       llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
190! upwd
191  CALL histdef(fileid, 'upwd', '', '', iim, jj_nb, nhoriid, &
192       llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
193! dnwd
194  CALL histdef(fileid, 'dnwd', '', '', iim, jj_nb, nhoriid, &
195       llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
196
197! phi
198  DO k=1,llm
199     IF (k<10) THEN
200        WRITE(nvar,'(i1)') k
201     ELSE IF (k<100) THEN
202        WRITE(nvar,'(i2)') k
203     ELSE
204        WRITE(nvar,'(i3)') k
205     END IF
206     nvar='phi_lev'//trim(nvar)
207     
208     CALL histdef(fileid, nvar, '', '', iim, jj_nb, nhoriid, &
209          llm, 1, llm, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
210  END DO
211
212  CALL histend(fileid)
213  IF (ok_sync) CALL histsync
214!$OMP END MASTER
215       
216END SUBROUTINE initphysto
Note: See TracBrowser for help on using the repository browser.