source: LMDZ6/branches/Amaury_dev/libf/phylmd/initphysto.F90 @ 5225

Last change on this file since 5225 was 5158, checked in by abarral, 3 months ago

Add missing klon on strataer_emiss_mod.F90
Correct various missing explicit declarations
Replace tabs by spaces (tabs are not part of the fortran charset)
Continue cleaning modules
Removed unused arguments and variables

  • 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.7 KB
Line 
1
2! $Id: initphysto.F90 5158 2024-08-02 12:12:03Z abarral $
3
4SUBROUTINE initphysto(infile,tstep,t_ops,t_wrt,fileid)
5 
6  USE dimphy
7  USE lmdz_phys_para
8  USE IOIPSL
9  USE iophy
10  USE indice_sol_mod
11  USE lmdz_grid_phy, ONLY: nbp_lon, nbp_lat, nbp_lev
12  USE time_phylmdz_mod, ONLY: day_ref, annee_ref
13 
14  IMPLICIT NONE
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!   Arguments
41  CHARACTER(len=*), INTENT(IN) :: infile
42  REAL, INTENT(IN)             :: tstep
43  REAL, INTENT(IN)             :: t_ops
44  REAL, INTENT(IN)             :: t_wrt
45  INTEGER, INTENT(OUT)         :: fileid
46
47! Variables locales
48  INTEGER nhoriid, i
49  INTEGER l,k
50  REAL nivsigs(nbp_lev)
51  INTEGER tau0
52  REAL zjulian
53  INTEGER iq
54  INTEGER uhoriid, vhoriid, thoriid, zvertiid
55  INTEGER ii,jj
56  INTEGER zan, idayref
57  LOGICAL ok_sync
58  REAL zx_lon(nbp_lon,nbp_lat), zx_lat(nbp_lon,nbp_lat)
59  CHARACTER(len=12) :: nvar
60
61!  Initialisations
62
63  ok_sync= .TRUE.
64
65!  Appel a histbeg: creation du fichier netcdf et initialisations diverses
66
67  zan = annee_ref
68  idayref = day_ref
69  CALL ymds2ju(zan, 1, idayref, 0.0, zjulian)
70  tau0 = 0
71 
72  CALL histbeg_phy(infile,tau0, zjulian, tstep, &
73       nhoriid, fileid)
74
75!$OMP MASTER
76!  Appel a histvert pour la grille verticale
77
78  DO l=1,nbp_lev
79     nivsigs(l)=REAL(l)
80  ENDDO
81 
82  CALL histvert(fileid, 'sig_s', 'Niveaux sigma', &
83       'sigma_level', &
84       nbp_lev, nivsigs, zvertiid)
85
86!  Appels a histdef pour la definition des variables a sauvegarder
87
88  CALL histdef(fileid, "phis", "Surface geop. height", "-", &
89       nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, &
90       "once", t_ops, t_wrt)
91 
92  CALL histdef(fileid, "aire", "Grid area", "-", &
93       nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, &
94       "once", t_ops, t_wrt)
95
96  CALL histdef(fileid, "longitudes", "longitudes", "-", &
97       nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, &
98       "once", t_ops, t_wrt)
99
100  CALL histdef(fileid, "latitudes", "latitudes", "-", &
101       nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, &
102       "once", t_ops, t_wrt)
103! T
104  CALL histdef(fileid, 't', 'Temperature', 'K', nbp_lon, jj_nb, nhoriid, &
105       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
106! mfu
107  CALL histdef(fileid, 'mfu', 'flx m. pan. mt', 'kg m/s',nbp_lon, jj_nb, nhoriid, &
108       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
109! mfd
110  CALL histdef(fileid, 'mfd', 'flx m. pan. des', 'kg m/s',nbp_lon, jj_nb, nhoriid, &
111       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
112! en_u
113  CALL histdef(fileid, 'en_u', 'flx ent pan mt', 'kg m/s', nbp_lon, jj_nb, nhoriid, &
114       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
115! de_u
116  CALL histdef(fileid, 'de_u', 'flx det pan mt', 'kg m/s',nbp_lon, jj_nb, nhoriid, &
117       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
118! en_d
119  CALL histdef(fileid, 'en_d', 'flx ent pan dt', 'kg m/s', nbp_lon, jj_nb, nhoriid, &
120       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
121! de_d
122  CALL histdef(fileid, 'de_d', 'flx det pan dt', 'kg m/s', nbp_lon, jj_nb, nhoriid, &
123       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
124! coefh
125  CALL histdef(fileid, "coefh", " ", " ", nbp_lon, jj_nb, nhoriid, &
126       nbp_lev, 1, nbp_lev, zvertiid,32, "inst(X)", t_ops, t_wrt)
127! fm_th
128  CALL histdef(fileid, "fm_th", " ", " ",nbp_lon, jj_nb, nhoriid, &
129       nbp_lev, 1, nbp_lev, zvertiid,32, "inst(X)", t_ops, t_wrt)
130! en_th
131  CALL histdef(fileid, "en_th", " ", " ",nbp_lon, jj_nb, nhoriid, &
132       nbp_lev, 1, nbp_lev, zvertiid,32, "inst(X)", t_ops, t_wrt)
133! frac_impa
134  CALL histdef(fileid, 'frac_impa', ' ', ' ',nbp_lon, jj_nb, nhoriid, &
135       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
136! frac_nucl
137  CALL histdef(fileid, 'frac_nucl', ' ', ' ',nbp_lon, jj_nb, nhoriid, &
138       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
139! pyu1
140  CALL histdef(fileid, "pyu1", " ", " ", nbp_lon,jj_nb,nhoriid, &
141       1,1,1, -99, 32, "inst(X)", t_ops, t_wrt)
142! pyv1
143  CALL histdef(fileid, "pyv1", " ", " ", nbp_lon,jj_nb,nhoriid, &
144       1,1,1, -99, 32,"inst(X)", t_ops, t_wrt)   
145! ftsol1
146  CALL histdef(fileid, "ftsol1", " ", " ",nbp_lon, jj_nb, nhoriid, &
147       1, 1,1, -99,32, "inst(X)", t_ops, t_wrt)
148! ftsol2
149  CALL histdef(fileid, "ftsol2", " ", " ",nbp_lon, jj_nb, nhoriid, &
150       1, 1,1, -99,32, "inst(X)", t_ops, t_wrt)
151! ftsol3
152  CALL histdef(fileid, "ftsol3", " ", " ", nbp_lon, jj_nb, nhoriid, &
153       1, 1,1, -99,32, "inst(X)", t_ops, t_wrt)
154! ftsol4
155  CALL histdef(fileid, "ftsol4", " ", " ",nbp_lon, jj_nb, nhoriid, &
156       1, 1,1, -99, 32, "inst(X)", t_ops, t_wrt)
157! psrf1
158  CALL histdef(fileid, "psrf1", " ", " ",nbp_lon, jj_nb, nhoriid, &
159       1, 1, 1, -99,32, "inst(X)", t_ops, t_wrt)
160! psrf2
161  CALL histdef(fileid, "psrf2", " ", " ",nbp_lon, jj_nb, nhoriid, &
162       1, 1, 1, -99, 32, "inst(X)", t_ops, t_wrt)
163! psrf3
164  CALL histdef(fileid, "psrf3", " ", " ",nbp_lon, jj_nb, nhoriid, &
165       1, 1, 1, -99, 32, "inst(X)", t_ops, t_wrt)
166! psrf4
167  CALL histdef(fileid, "psrf4", " ", " ", nbp_lon, jj_nb, nhoriid, &
168       1, 1, 1, -99,32, "inst(X)", t_ops, t_wrt)
169! sh
170  CALL histdef(fileid, 'sh', '', '', nbp_lon, jj_nb, nhoriid, &
171       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
172! da
173  CALL histdef(fileid, 'da', '', '', nbp_lon, jj_nb, nhoriid, &
174       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
175! mp
176  CALL histdef(fileid, 'mp', '', '', nbp_lon, jj_nb, nhoriid, &
177       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
178! upwd
179  CALL histdef(fileid, 'upwd', '', '', nbp_lon, jj_nb, nhoriid, &
180       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
181! dnwd
182  CALL histdef(fileid, 'dnwd', '', '', nbp_lon, jj_nb, nhoriid, &
183       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
184
185! phi
186  DO k=1,nbp_lev
187     IF (k<10) THEN
188        WRITE(nvar,'(i1)') k
189     ELSE IF (k<100) THEN
190        WRITE(nvar,'(i2)') k
191     ELSE
192        WRITE(nvar,'(i3)') k
193     END IF
194     nvar='phi_lev'//trim(nvar)
195     
196     CALL histdef(fileid, nvar, '', '', nbp_lon, jj_nb, nhoriid, &
197          nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
198  END DO
199
200  CALL histend(fileid)
201  IF (ok_sync) CALL histsync
202!$OMP END MASTER
203
204END SUBROUTINE initphysto
Note: See TracBrowser for help on using the repository browser.