1 | ! $Id: phys_output_mod.F90 5310 2024-11-01 12:05:47Z abarral $ |
---|
2 | ! |
---|
3 | |
---|
4 | MODULE phys_output_mod |
---|
5 | USE indice_sol_mod |
---|
6 | USE phys_output_var_mod |
---|
7 | USE phys_output_write_mod, ONLY : phys_output_write |
---|
8 | REAL, DIMENSION(nfiles),SAVE :: ecrit_files |
---|
9 | |
---|
10 | ! Abderrahmane 12 2007 |
---|
11 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
12 | !!! Ecreture des Sorties du modele dans les fichiers Netcdf : |
---|
13 | ! histmth.nc : moyennes mensuelles |
---|
14 | ! histday.nc : moyennes journalieres |
---|
15 | ! histhf.nc : moyennes toutes les 3 heures |
---|
16 | ! histins.nc : valeurs instantanees |
---|
17 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
18 | |
---|
19 | CONTAINS |
---|
20 | |
---|
21 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
22 | !!!!!!!!! Ouverture des fichier et definition des variable de sortie !!!!!!!! |
---|
23 | !! histbeg, histvert et histdef |
---|
24 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
25 | |
---|
26 | SUBROUTINE phys_output_open(rlon,rlat,pim,tabij,ipt,jpt,plon,plat, & |
---|
27 | jjmp1,nlevSTD,clevSTD,rlevSTD, dtime, ok_veget, & |
---|
28 | type_ocean, iflag_pbl,iflag_pbl_split,ok_mensuel,ok_journe, & |
---|
29 | ok_hf,ok_instan,ok_LES,ok_ade,ok_aie, read_climoz, & |
---|
30 | phys_out_filestations, & |
---|
31 | aerosol_couple, flag_aerosol_strat, & |
---|
32 | pdtphys, paprs, pphis, pplay, lmax_th, ptconv, ptconvth, ivap, & |
---|
33 | d_u, d_t, qx, d_qx, zmasse, ok_sync) |
---|
34 | |
---|
35 | USE iophy |
---|
36 | USE dimphy |
---|
37 | USE infotrac_phy, ONLY: nqtot, tracers, niso, ntraciso=>ntiso |
---|
38 | USE strings_mod, ONLY: maxlen |
---|
39 | USE ioipsl |
---|
40 | USE phys_cal_mod, only : hour, calend |
---|
41 | USE mod_phys_lmdz_para |
---|
42 | !Martin |
---|
43 | USE surface_data, ONLY : landice_opt |
---|
44 | USE phys_output_ctrlout_mod |
---|
45 | USE mod_grid_phy_lmdz, only: klon_glo,nbp_lon,nbp_lat |
---|
46 | USE print_control_mod, ONLY: prt_level,lunout |
---|
47 | USE vertical_layers_mod, ONLY: ap,bp,preff,presnivs, aps, bps, pseudoalt, presinter |
---|
48 | USE time_phylmdz_mod, ONLY: day_ini, itau_phy, start_time, annee_ref, day_ref |
---|
49 | ! ug Pour les sorties XIOS |
---|
50 | use wxios_mod |
---|
51 | USE infotrac_phy, ONLY: nbtr_bin |
---|
52 | #ifdef ISO |
---|
53 | USE isotopes_mod, ONLY: isoName,iso_HTO |
---|
54 | #ifdef ISOTRAC |
---|
55 | use isotrac_mod, only: index_zone,index_iso,strtrac |
---|
56 | #endif |
---|
57 | #endif |
---|
58 | |
---|
59 | USE clesphys_mod_h |
---|
60 | USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_STRATAER |
---|
61 | |
---|
62 | USE yomcst_mod_h |
---|
63 | IMPLICIT NONE |
---|
64 | |
---|
65 | |
---|
66 | ! ug Nouveaux arguments n\'ecessaires au histwrite_mod: |
---|
67 | INTEGER, INTENT(IN) :: ivap |
---|
68 | INTEGER, DIMENSION(klon), INTENT(IN) :: lmax_th |
---|
69 | LOGICAL, INTENT(IN) :: ok_sync |
---|
70 | LOGICAL, DIMENSION(klon, klev), INTENT(IN) :: ptconv, ptconvth |
---|
71 | REAL, INTENT(IN) :: pdtphys |
---|
72 | REAL, DIMENSION(klon), INTENT(IN) :: pphis |
---|
73 | REAL, DIMENSION(klon, klev), INTENT(IN) :: pplay, d_u, d_t |
---|
74 | REAL, DIMENSION(klon, klev+1), INTENT(IN) :: paprs |
---|
75 | REAL, DIMENSION(klon,klev,nqtot), INTENT(IN):: qx, d_qx |
---|
76 | REAL, DIMENSION(klon, klev), INTENT(IN) :: zmasse |
---|
77 | |
---|
78 | |
---|
79 | REAL,DIMENSION(klon),INTENT(IN) :: rlon |
---|
80 | REAL,DIMENSION(klon),INTENT(IN) :: rlat |
---|
81 | INTEGER, INTENT(IN) :: pim |
---|
82 | INTEGER, DIMENSION(pim) :: tabij |
---|
83 | INTEGER,DIMENSION(pim), INTENT(IN) :: ipt, jpt |
---|
84 | REAL,DIMENSION(pim), INTENT(IN) :: plat, plon |
---|
85 | REAL,DIMENSION(pim,2) :: plat_bounds, plon_bounds |
---|
86 | |
---|
87 | INTEGER :: jjmp1 |
---|
88 | INTEGER :: nlevSTD, radpas |
---|
89 | LOGICAL :: ok_mensuel, ok_journe, ok_hf, ok_instan |
---|
90 | LOGICAL :: ok_LES,ok_ade,ok_aie |
---|
91 | INTEGER :: flag_aerosol_strat |
---|
92 | LOGICAL :: aerosol_couple |
---|
93 | INTEGER, INTENT(IN):: read_climoz ! read ozone climatology |
---|
94 | ! Allowed values are 0, 1 and 2 |
---|
95 | ! 0: do not read an ozone climatology |
---|
96 | ! 1: read a single ozone climatology that will be used day and night |
---|
97 | ! 2: read two ozone climatologies, the average day and night |
---|
98 | ! climatology and the daylight climatology |
---|
99 | |
---|
100 | REAL :: dtime |
---|
101 | INTEGER :: idayref |
---|
102 | REAL :: zjulian_start, zjulian |
---|
103 | CHARACTER(LEN=4), DIMENSION(nlevSTD) :: clevSTD |
---|
104 | REAL, DIMENSION(nlevSTD) :: rlevSTD |
---|
105 | INTEGER :: nsrf, k, iq, iff, i, j, ilev, itr, itrb, ixt, iiso, izone |
---|
106 | INTEGER :: naero |
---|
107 | LOGICAL :: ok_veget |
---|
108 | INTEGER :: iflag_pbl |
---|
109 | INTEGER :: iflag_pbl_split |
---|
110 | CHARACTER(LEN=4) :: bb2 |
---|
111 | CHARACTER(LEN=2) :: bb3 |
---|
112 | CHARACTER(LEN=6) :: type_ocean |
---|
113 | INTEGER, DIMENSION(nbp_lon*jjmp1) :: ndex2d |
---|
114 | INTEGER, DIMENSION(nbp_lon*jjmp1*klev) :: ndex3d |
---|
115 | INTEGER :: imin_ins, imax_ins |
---|
116 | INTEGER :: jmin_ins, jmax_ins |
---|
117 | INTEGER, DIMENSION(nfiles) :: phys_out_levmin, phys_out_levmax |
---|
118 | INTEGER, DIMENSION(nfiles) :: phys_out_filelevels |
---|
119 | CHARACTER(LEN=20), DIMENSION(nfiles) :: chtimestep = (/ 'Default', 'Default', 'Default', 'Default', 'Default', & |
---|
120 | 'Default', 'Default', 'Default', 'Default', 'Default' /) |
---|
121 | LOGICAL, DIMENSION(nfiles) :: phys_out_filekeys |
---|
122 | LOGICAL, DIMENSION(nfiles) :: phys_out_filestations |
---|
123 | |
---|
124 | #ifdef ISO |
---|
125 | CHARACTER(LEN=maxlen) :: outiso |
---|
126 | CHARACTER(LEN=20) :: unit |
---|
127 | #endif |
---|
128 | CHARACTER(LEN=maxlen) :: tnam, lnam, dn |
---|
129 | INTEGER :: flag(nfiles) |
---|
130 | |
---|
131 | !!!!!!!!!! stockage dans une region limitee pour chaque fichier !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
132 | ! entre [phys_out_lonmin,phys_out_lonmax] et [phys_out_latmin,phys_out_latmax] |
---|
133 | LOGICAL, DIMENSION(nfiles), SAVE :: & |
---|
134 | phys_out_regfkey = [.FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE.] |
---|
135 | REAL, DIMENSION(nfiles), SAVE :: & |
---|
136 | phys_out_lonmin = [ -180., -180., -180., -180., -180., -180., -180., -180., -180., -180.], & |
---|
137 | phys_out_lonmax = [ 180., 180., 180., 180., 180., 180., 180., 180., 180., 180.], & |
---|
138 | phys_out_latmin = [ -90., -90., -90., -90., -90., -90., -90., -90., -90., -90.], & |
---|
139 | phys_out_latmax = [ 90., 90., 90., 90., 90., 90., 90., 90., 90., 90.] |
---|
140 | REAL, DIMENSION(klev,2) :: Ahyb_bounds, Bhyb_bounds |
---|
141 | REAL, DIMENSION(klev+1) :: lev_index |
---|
142 | |
---|
143 | ! ug Variables utilis\'ees pour r\'ecup\'erer le calendrier pour xios |
---|
144 | INTEGER :: x_an, x_mois, x_jour |
---|
145 | REAL :: x_heure |
---|
146 | INTEGER :: ini_an, ini_mois, ini_jour |
---|
147 | REAL :: ini_heure |
---|
148 | |
---|
149 | INTEGER :: ISW |
---|
150 | REAL, DIMENSION(NSW) :: wl1_sun, wl2_sun !wavelength bounds (in um) for SW |
---|
151 | REAL, DIMENSION(NSW) :: wn1_sun, wn2_sun !wavenumber bounds (in m-1) for SW |
---|
152 | REAL, DIMENSION(NSW) :: spectband !mean wavenumb. of each sp.band |
---|
153 | REAL, DIMENSION(NSW,2) :: spbnds_sun !bounds of spectband |
---|
154 | |
---|
155 | WRITE(lunout,*) 'Debut phys_output_mod.F90' |
---|
156 | ! Initialisations (Valeurs par defaut |
---|
157 | |
---|
158 | DO ilev=1,klev |
---|
159 | Ahyb_bounds(ilev,1) = ap(ilev) |
---|
160 | Ahyb_bounds(ilev,2) = ap(ilev+1) |
---|
161 | Bhyb_bounds(ilev,1) = bp(ilev) |
---|
162 | Bhyb_bounds(ilev,2) = bp(ilev+1) |
---|
163 | lev_index(ilev) = REAL(ilev) |
---|
164 | END DO |
---|
165 | lev_index(klev+1) = REAL(klev+1) |
---|
166 | |
---|
167 | IF (.NOT. ALLOCATED(o_trac)) ALLOCATE(o_trac(nqtot)) |
---|
168 | IF (.NOT. ALLOCATED(o_trac_cum)) ALLOCATE(o_trac_cum(nqtot)) |
---|
169 | ALLOCATE(o_dtr_the(nqtot),o_dtr_con(nqtot),o_dtr_lessi_impa(nqtot)) |
---|
170 | ALLOCATE(o_dtr_lessi_nucl(nqtot),o_dtr_insc(nqtot),o_dtr_bcscav(nqtot)) |
---|
171 | ALLOCATE(o_dtr_evapls(nqtot),o_dtr_ls(nqtot),o_dtr_trsp(nqtot)) |
---|
172 | ALLOCATE(o_dtr_sscav(nqtot),o_dtr_sat(nqtot),o_dtr_uscav(nqtot)) |
---|
173 | ALLOCATE(o_dtr_dry(nqtot),o_dtr_vdf(nqtot)) |
---|
174 | IF (CPPKEY_STRATAER) THEN |
---|
175 | ALLOCATE(o_nd_mode(nbtr_bin),o_sulfmmr_mode(nbtr_bin)) |
---|
176 | END IF |
---|
177 | #ifdef ISO |
---|
178 | ALLOCATE(o_xtprecip(ntraciso)) |
---|
179 | ALLOCATE(o_xtplul(ntraciso)) |
---|
180 | ALLOCATE(o_xtpluc(ntraciso)) |
---|
181 | ALLOCATE(o_xtevap(ntraciso)) |
---|
182 | ALLOCATE(o_xtevap_srf(ntraciso,4)) |
---|
183 | ALLOCATE(o_xtovap(ntraciso)) |
---|
184 | ALLOCATE(o_xtoliq(ntraciso)) |
---|
185 | ALLOCATE(o_xtcond(ntraciso)) |
---|
186 | ALLOCATE(o_xtrunoff_diag(ntraciso)) |
---|
187 | ALLOCATE(o_dxtdyn(ntraciso)) |
---|
188 | ALLOCATE(o_dxtldyn(ntraciso)) |
---|
189 | ALLOCATE(o_dxtcon(ntraciso)) |
---|
190 | ALLOCATE(o_dxtlsc(ntraciso)) |
---|
191 | ALLOCATE(o_dxteva(ntraciso)) |
---|
192 | ALLOCATE(o_dxtajs(ntraciso)) |
---|
193 | ALLOCATE(o_dxtvdf(ntraciso)) |
---|
194 | ALLOCATE(o_dxtthe(ntraciso)) |
---|
195 | ALLOCATE(o_dxtch4(ntraciso)) |
---|
196 | if (iso_HTO.gt.0) then |
---|
197 | ALLOCATE(o_dxtprod_nucl(ntraciso)) |
---|
198 | ALLOCATE(o_dxtcosmo(ntraciso)) |
---|
199 | ALLOCATE(o_dxtdecroiss(ntraciso)) |
---|
200 | endif |
---|
201 | #endif |
---|
202 | |
---|
203 | levmax = [klev, klev, klev, klev, klev, klev, nlevSTD, nlevSTD, nlevSTD, klev] |
---|
204 | |
---|
205 | phys_out_filenames(1) = 'histmth' |
---|
206 | phys_out_filenames(2) = 'histday' |
---|
207 | phys_out_filenames(3) = 'histhf6h' |
---|
208 | phys_out_filenames(4) = 'histhf3h' |
---|
209 | phys_out_filenames(5) = 'histhf3hm' |
---|
210 | phys_out_filenames(6) = 'histstn' |
---|
211 | phys_out_filenames(7) = 'histmthNMC' |
---|
212 | phys_out_filenames(8) = 'histdayNMC' |
---|
213 | phys_out_filenames(9) = 'histhfNMC' |
---|
214 | phys_out_filenames(10)= 'histstrataer' |
---|
215 | |
---|
216 | type_ecri(1) = 'ave(X)' |
---|
217 | type_ecri(2) = 'ave(X)' |
---|
218 | type_ecri(3) = 'inst(X)' |
---|
219 | type_ecri(4) = 'inst(X)' |
---|
220 | type_ecri(5) = 'ave(X)' |
---|
221 | type_ecri(6) = 'inst(X)' |
---|
222 | type_ecri(7) = 'inst(X)' |
---|
223 | type_ecri(8) = 'inst(X)' |
---|
224 | type_ecri(9) = 'inst(X)' |
---|
225 | type_ecri(10)= 'ave(X)' |
---|
226 | |
---|
227 | clef_files(1) = ok_mensuel |
---|
228 | clef_files(2) = ok_journe |
---|
229 | clef_files(3) = ok_hf |
---|
230 | clef_files(4) = ok_instan |
---|
231 | clef_files(5) = ok_LES |
---|
232 | clef_files(6) = ok_instan |
---|
233 | clef_files(7) = ok_histNMC(1) |
---|
234 | clef_files(8) = ok_histNMC(2) |
---|
235 | clef_files(9) = ok_histNMC(3) |
---|
236 | IF (CPPKEY_STRATAER) THEN |
---|
237 | clef_files(10)= .TRUE. |
---|
238 | ELSE |
---|
239 | clef_files(10)= .FALSE. |
---|
240 | END IF |
---|
241 | |
---|
242 | !sortir des fichiers "stations" si clef_stations(:)=.TRUE. |
---|
243 | clef_stations(1) = .FALSE. |
---|
244 | clef_stations(2) = .FALSE. |
---|
245 | clef_stations(3) = .FALSE. |
---|
246 | clef_stations(4) = .FALSE. |
---|
247 | clef_stations(5) = .FALSE. |
---|
248 | clef_stations(6) = .FALSE. |
---|
249 | clef_stations(7) = .FALSE. |
---|
250 | clef_stations(8) = .FALSE. |
---|
251 | clef_stations(9) = .FALSE. |
---|
252 | clef_stations(10)= .FALSE. |
---|
253 | |
---|
254 | lev_files(1) = lev_histmth |
---|
255 | lev_files(2) = lev_histday |
---|
256 | lev_files(3) = lev_histhf |
---|
257 | lev_files(4) = lev_histins |
---|
258 | lev_files(5) = lev_histLES |
---|
259 | lev_files(6) = lev_histins |
---|
260 | lev_files(7) = levout_histNMC(1) |
---|
261 | lev_files(8) = levout_histNMC(2) |
---|
262 | lev_files(9) = levout_histNMC(3) |
---|
263 | lev_files(10)= 5 |
---|
264 | |
---|
265 | ecrit_files(1) = ecrit_mth |
---|
266 | ecrit_files(2) = ecrit_day |
---|
267 | ecrit_files(3) = ecrit_hf |
---|
268 | ecrit_files(4) = ecrit_ins |
---|
269 | ecrit_files(5) = ecrit_LES |
---|
270 | ecrit_files(6) = ecrit_ins |
---|
271 | ecrit_files(7) = freq_outNMC(1) |
---|
272 | ecrit_files(8) = freq_outNMC(2) |
---|
273 | ecrit_files(9) = freq_outNMC(3) |
---|
274 | ecrit_files(10)= ecrit_mth |
---|
275 | |
---|
276 | !! Lectures des parametres de sorties dans physiq.def |
---|
277 | |
---|
278 | CALL getin('phys_out_regfkey',phys_out_regfkey) |
---|
279 | CALL getin('phys_out_lonmin',phys_out_lonmin) |
---|
280 | CALL getin('phys_out_lonmax',phys_out_lonmax) |
---|
281 | CALL getin('phys_out_latmin',phys_out_latmin) |
---|
282 | CALL getin('phys_out_latmax',phys_out_latmax) |
---|
283 | phys_out_levmin(:)=levmin(:) |
---|
284 | CALL getin('phys_out_levmin',levmin) |
---|
285 | phys_out_levmax(:)=levmax(:) |
---|
286 | CALL getin('phys_out_levmax',levmax) |
---|
287 | CALL getin('phys_out_filenames',phys_out_filenames) |
---|
288 | phys_out_filekeys(:)=clef_files(:) |
---|
289 | CALL getin('phys_out_filekeys',clef_files) |
---|
290 | phys_out_filestations(:)=clef_stations(:) |
---|
291 | CALL getin('phys_out_filestations',clef_stations) |
---|
292 | phys_out_filelevels(:)=lev_files(:) |
---|
293 | CALL getin('phys_out_filelevels',lev_files) |
---|
294 | CALL getin('phys_out_filetimesteps',chtimestep) |
---|
295 | phys_out_filetypes(:)=type_ecri(:) |
---|
296 | CALL getin('phys_out_filetypes',type_ecri) |
---|
297 | |
---|
298 | type_ecri_files(:)=type_ecri(:) |
---|
299 | |
---|
300 | ! if (ok_all_xml) phys_out_filelevels = 999 |
---|
301 | |
---|
302 | WRITE(lunout,*)'phys_out_lonmin=',phys_out_lonmin |
---|
303 | WRITE(lunout,*)'phys_out_lonmax=',phys_out_lonmax |
---|
304 | WRITE(lunout,*)'phys_out_latmin=',phys_out_latmin |
---|
305 | WRITE(lunout,*)'phys_out_latmax=',phys_out_latmax |
---|
306 | WRITE(lunout,*)'phys_out_filenames=',phys_out_filenames |
---|
307 | WRITE(lunout,*)'phys_out_filetypes=',type_ecri |
---|
308 | WRITE(lunout,*)'phys_out_filekeys=',clef_files |
---|
309 | WRITE(lunout,*)'phys_out_filestations=',clef_stations |
---|
310 | WRITE(lunout,*)'phys_out_filelevels=',lev_files |
---|
311 | WRITE(lunout,*)'phys_out_regfkey=',phys_out_regfkey |
---|
312 | |
---|
313 | ! A noter pour |
---|
314 | ! l heure initiale - dans les fichiers histoire hist* - on met comme |
---|
315 | ! heure de debut soit la vraie heure (pour le 1D) soit 0h (pour le 3D) |
---|
316 | ! afin d avoir une seule sortie mensuelle par mois lorsque l on tourne |
---|
317 | ! par annee (IM). |
---|
318 | ! |
---|
319 | idayref = day_ref |
---|
320 | IF (klon_glo==1) THEN |
---|
321 | ! current_time (used to compute hour) is updated at the begining of |
---|
322 | ! the physics; to set the correct outputs "initial time" we thus |
---|
323 | ! have to use (hour-dtphys). |
---|
324 | CALL ymds2ju(annee_ref, 1, idayref, hour-pdtphys, zjulian) |
---|
325 | print *,'phys_output_mod: annee,iday,hour,zjulian=',annee_ref,idayref, hour, zjulian |
---|
326 | ELSE |
---|
327 | CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian) |
---|
328 | CALL ymds2ju(annee_ref, 1, day_ini, start_time*rday, zjulian_start) |
---|
329 | ENDIF |
---|
330 | |
---|
331 | IF (using_xios) THEN |
---|
332 | ! ug R\'eglage du calendrier xios |
---|
333 | !Temps julian => an, mois, jour, heure |
---|
334 | CALL ju2ymds(zjulian, x_an, x_mois, x_jour, x_heure) |
---|
335 | CALL ju2ymds(zjulian_start, ini_an, ini_mois, ini_jour, ini_heure) |
---|
336 | CALL wxios_set_cal(dtime, calend, x_an, x_mois, x_jour, x_heure, ini_an, & |
---|
337 | ini_mois, ini_jour, ini_heure ) |
---|
338 | ENDIF |
---|
339 | |
---|
340 | !!!!!!!!!!!!!!!!!!!!!!! Boucle sur les fichiers !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
341 | ! Appel de histbeg et histvert pour creer le fichier et les niveaux verticaux !! |
---|
342 | ! Appel des histbeg pour definir les variables (nom, moy ou inst, freq de sortie .. |
---|
343 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
344 | |
---|
345 | zdtime_moy = dtime ! Frequence ou l on moyenne |
---|
346 | |
---|
347 | |
---|
348 | ecrit_files(7) = ecrit_files(1) |
---|
349 | ecrit_files(8) = ecrit_files(2) |
---|
350 | ecrit_files(9) = ecrit_files(3) |
---|
351 | |
---|
352 | DO iff=1,nfiles |
---|
353 | |
---|
354 | ! Calculate ecrit_files for all files |
---|
355 | IF ( chtimestep(iff).eq.'Default' ) THEN |
---|
356 | ! Par defaut ecrit_files = (ecrit_mensuel ecrit_jour ecrit_hf |
---|
357 | ! ...)*86400. |
---|
358 | ecrit_files(iff)=ecrit_files(iff)*86400. |
---|
359 | ELSE IF (chtimestep(iff).eq.'-1') THEN |
---|
360 | PRINT*,'ecrit_files(',iff,') < 0 so IOIPSL work on different' |
---|
361 | PRINT*,'months length' |
---|
362 | ecrit_files(iff)=-1. |
---|
363 | ELSE |
---|
364 | CALL convers_timesteps(chtimestep(iff),dtime,ecrit_files(iff)) |
---|
365 | ENDIF |
---|
366 | |
---|
367 | WRITE(lunout,*)'ecrit_files(',iff,')= ',ecrit_files(iff) |
---|
368 | zoutm(iff) = ecrit_files(iff) ! Frequence ou l on ecrit en seconde |
---|
369 | |
---|
370 | |
---|
371 | IF (using_xios) THEN |
---|
372 | !!! Ouverture de chaque fichier XIOS !!!!!!!!!!! |
---|
373 | IF (.not. ok_all_xml) THEN |
---|
374 | IF (prt_level >= 10) THEN |
---|
375 | print*,'phys_output_open: call wxios_add_file with phys_out_filenames(iff)=',trim(phys_out_filenames(iff)) |
---|
376 | ENDIF |
---|
377 | CALL wxios_add_file(phys_out_filenames(iff),chtimestep(iff),lev_files(iff)) |
---|
378 | ENDIF |
---|
379 | |
---|
380 | !!! Declaration des axes verticaux de chaque fichier: |
---|
381 | IF (prt_level >= 10) THEN |
---|
382 | print*,'phys_output_open: Declare vertical axes for each file' |
---|
383 | ENDIF |
---|
384 | |
---|
385 | IF (iff.LE.6.OR.iff.EQ.10) THEN |
---|
386 | CALL wxios_add_vaxis("presnivs", & |
---|
387 | levmax(iff) - levmin(iff) + 1, presnivs(levmin(iff):levmax(iff))) |
---|
388 | CALL wxios_add_vaxis("presinter", & |
---|
389 | klev + 1, presinter(1:klev+1)) |
---|
390 | CALL wxios_add_vaxis("Ahyb", & |
---|
391 | levmax(iff) - levmin(iff) + 1, aps(levmin(iff):levmax(iff)), positif='down', & |
---|
392 | bnds=Ahyb_bounds(levmin(iff):levmax(iff),:)) |
---|
393 | CALL wxios_add_vaxis("Bhyb", & |
---|
394 | levmax(iff) - levmin(iff) + 1, bps(levmin(iff):levmax(iff)), positif='down', & |
---|
395 | bnds=Bhyb_bounds(levmin(iff):levmax(iff),:)) |
---|
396 | CALL wxios_add_vaxis("klev", levmax(iff) - levmin(iff) + 1, & |
---|
397 | lev_index(levmin(iff):levmax(iff))) |
---|
398 | CALL wxios_add_vaxis("klevp1", klev+1, & |
---|
399 | lev_index(1:klev+1)) |
---|
400 | CALL wxios_add_vaxis("bnds", 2, (/1.,2./)) |
---|
401 | |
---|
402 | CALL wxios_add_vaxis("Alt", & |
---|
403 | levmax(iff) - levmin(iff) + 1, pseudoalt) |
---|
404 | |
---|
405 | ! wl1_sun/wl2_sun: minimum/maximum bound of wavelength (in um) |
---|
406 | SELECT CASE(NSW) |
---|
407 | CASE(6) |
---|
408 | wl1_sun(1:6) = [0.180, 0.250, 0.440, 0.690, 1.190, 2.380] |
---|
409 | wl2_sun(1:6) = [0.250, 0.440, 0.690, 1.190, 2.380, 4.000] |
---|
410 | CASE(2) |
---|
411 | wl1_sun(1:2) = [0.250, 0.690] |
---|
412 | wl2_sun(1:2) = [0.690, 4.000] |
---|
413 | END SELECT |
---|
414 | |
---|
415 | DO ISW=1, NSW |
---|
416 | wn1_sun(ISW)=1.e+6/wl1_sun(ISW) |
---|
417 | wn2_sun(ISW)=1.e+6/wl2_sun(ISW) |
---|
418 | spbnds_sun(ISW,1)=wn2_sun(ISW) |
---|
419 | spbnds_sun(ISW,2)=wn1_sun(ISW) |
---|
420 | spectband(ISW)=(wn1_sun(ISW)+wn2_sun(ISW))/2 |
---|
421 | ENDDO |
---|
422 | ! |
---|
423 | !!! ajout axe vertical spectband : solar band number |
---|
424 | CALL wxios_add_vaxis("spectband", NSW, spectband, positif='down') |
---|
425 | ELSE |
---|
426 | ! NMC files |
---|
427 | CALL wxios_add_vaxis("plev", & |
---|
428 | levmax(iff) - levmin(iff) + 1, rlevSTD(levmin(iff):levmax(iff))) |
---|
429 | ENDIF |
---|
430 | ENDIF !using_xios |
---|
431 | |
---|
432 | IF (clef_files(iff)) THEN |
---|
433 | !!!!!!!!!!!!!!!!! Traitement dans le cas ou l'on veut stocker sur un domaine limite !! |
---|
434 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
435 | IF (phys_out_regfkey(iff)) THEN |
---|
436 | imin_ins=1 |
---|
437 | imax_ins=nbp_lon |
---|
438 | jmin_ins=1 |
---|
439 | jmax_ins=jjmp1 |
---|
440 | |
---|
441 | ! correction abderr |
---|
442 | DO i=1,nbp_lon |
---|
443 | WRITE(lunout,*)'io_lon(i)=',io_lon(i) |
---|
444 | IF (io_lon(i).le.phys_out_lonmin(iff)) imin_ins=i |
---|
445 | IF (io_lon(i).le.phys_out_lonmax(iff)) imax_ins=i+1 |
---|
446 | ENDDO |
---|
447 | |
---|
448 | DO j=1,jjmp1 |
---|
449 | WRITE(lunout,*)'io_lat(j)=',io_lat(j) |
---|
450 | IF (io_lat(j).ge.phys_out_latmin(iff)) jmax_ins=j+1 |
---|
451 | IF (io_lat(j).ge.phys_out_latmax(iff)) jmin_ins=j |
---|
452 | ENDDO |
---|
453 | |
---|
454 | WRITE(lunout,*)'On stoke le fichier histoire numero ',iff,' sur ', & |
---|
455 | imin_ins,imax_ins,jmin_ins,jmax_ins |
---|
456 | WRITE(lunout,*)'longitudes : ', & |
---|
457 | io_lon(imin_ins),io_lon(imax_ins), & |
---|
458 | 'latitudes : ', & |
---|
459 | io_lat(jmax_ins),io_lat(jmin_ins) |
---|
460 | |
---|
461 | CALL histbeg(phys_out_filenames(iff),nbp_lon,io_lon,jjmp1,io_lat, & |
---|
462 | imin_ins,imax_ins-imin_ins+1, & |
---|
463 | jmin_ins,jmax_ins-jmin_ins+1, & |
---|
464 | itau_phy,zjulian,dtime,nhorim(iff),nid_files(iff)) |
---|
465 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
466 | !IM fichiers stations |
---|
467 | ELSE IF (clef_stations(iff)) THEN |
---|
468 | |
---|
469 | IF (prt_level >= 10) THEN |
---|
470 | WRITE(lunout,*)'phys_output_open: iff=',iff,' phys_out_filenames(iff)=',phys_out_filenames(iff) |
---|
471 | ENDIF |
---|
472 | |
---|
473 | CALL histbeg_phy_all(rlon,rlat,pim,tabij,ipt,jpt,plon,plat,plon_bounds,plat_bounds, & |
---|
474 | phys_out_filenames(iff), & |
---|
475 | itau_phy,zjulian,dtime,nhorim(iff),nid_files(iff)) |
---|
476 | ELSE |
---|
477 | |
---|
478 | IF (prt_level >= 10) THEN |
---|
479 | WRITE(lunout,*)'phys_output_open: iff=',iff,' phys_out_filenames(iff)=',phys_out_filenames(iff) |
---|
480 | ENDIF |
---|
481 | |
---|
482 | CALL histbeg_phy_all(phys_out_filenames(iff),itau_phy,zjulian,& |
---|
483 | dtime,nhorim(iff),nid_files(iff)) |
---|
484 | ENDIF |
---|
485 | |
---|
486 | #ifndef CPP_IOIPSL_NO_OUTPUT |
---|
487 | IF (iff.LE.6.OR.iff.EQ.10) THEN |
---|
488 | CALL histvert(nid_files(iff), "presnivs", "Vertical levels", "Pa", & |
---|
489 | levmax(iff) - levmin(iff) + 1, & |
---|
490 | presnivs(levmin(iff):levmax(iff)), nvertm(iff),"down") |
---|
491 | !!!! Composantes de la coordonnee sigma-hybride |
---|
492 | CALL histvert(nid_files(iff), "Ahyb","Ahyb comp of Hyb Cord ", "Pa", & |
---|
493 | levmax(iff) - levmin(iff) + 1,aps,nvertap(iff)) |
---|
494 | |
---|
495 | CALL histvert(nid_files(iff), "Bhyb","Bhyb comp of Hyb Cord", " ", & |
---|
496 | levmax(iff) - levmin(iff) + 1,bps,nvertbp(iff)) |
---|
497 | |
---|
498 | CALL histvert(nid_files(iff), "Alt","Height approx for scale heigh of 8km at levels", "Km", & |
---|
499 | levmax(iff) - levmin(iff) + 1,pseudoalt,nvertAlt(iff)) |
---|
500 | |
---|
501 | ELSE |
---|
502 | ! NMC files |
---|
503 | CALL histvert(nid_files(iff), "plev", "pressure", "Pa", & |
---|
504 | levmax(iff) - levmin(iff) + 1, & |
---|
505 | rlevSTD(levmin(iff):levmax(iff)), nvertm(iff), "down") |
---|
506 | ENDIF |
---|
507 | #endif |
---|
508 | |
---|
509 | ENDIF ! clef_files |
---|
510 | |
---|
511 | itr = 0; itrb = 0 |
---|
512 | DO iq = 1, nqtot |
---|
513 | IF(.NOT.(tracers(iq)%isAdvected .AND. tracers(iq)%isInPhysics)) CYCLE |
---|
514 | itr = itr + 1 |
---|
515 | dn = 'd'//TRIM(tracers(iq)%name)//'_' |
---|
516 | |
---|
517 | flag = [1, 5, 5, 5, 10, 10, 11, 11, 11, 11] |
---|
518 | lnam = 'Tracer '//TRIM(tracers(iq)%longName) |
---|
519 | tnam = TRIM(tracers(iq)%name); o_trac (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) |
---|
520 | |
---|
521 | flag = [4, 7, 7, 7, 10, 10, 11, 11, 11, 11] |
---|
522 | lnam = 'Tendance tracer '//TRIM(tracers(iq)%longName) |
---|
523 | tnam = TRIM(dn)//'vdf'; o_dtr_vdf (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) |
---|
524 | |
---|
525 | flag = [5, 7, 7, 7, 10, 10, 11, 11, 11, 11] |
---|
526 | tnam = TRIM(dn)//'the'; o_dtr_the (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) |
---|
527 | tnam = TRIM(dn)//'con'; o_dtr_con (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) |
---|
528 | |
---|
529 | flag = [7, 7, 7, 7, 10, 10, 11, 11, 11, 11] |
---|
530 | tnam = TRIM(dn)//'lessi_impa'; o_dtr_lessi_impa(itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) |
---|
531 | tnam = TRIM(dn)//'lessi_nucl'; o_dtr_lessi_nucl(itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) |
---|
532 | tnam = TRIM(dn)//'insc'; o_dtr_insc (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) |
---|
533 | tnam = TRIM(dn)//'bcscav'; o_dtr_bcscav (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) |
---|
534 | tnam = TRIM(dn)//'evapls'; o_dtr_evapls (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) |
---|
535 | tnam = TRIM(dn)//'ls'; o_dtr_ls (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) |
---|
536 | tnam = TRIM(dn)//'trsp'; o_dtr_trsp (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) |
---|
537 | tnam = TRIM(dn)//'sscav'; o_dtr_sscav (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) |
---|
538 | tnam = TRIM(dn)//'sat'; o_dtr_sat (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) |
---|
539 | tnam = TRIM(dn)//'uscav'; o_dtr_uscav (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) |
---|
540 | |
---|
541 | lnam = 'tracer tendency dry deposition'//TRIM(tracers(iq)%longName) |
---|
542 | tnam = 'cum'//TRIM(dn)//'dry'; o_dtr_dry (itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) |
---|
543 | |
---|
544 | flag = [1, 4, 10, 10, 10, 10, 11, 11, 11, 11] |
---|
545 | lnam = 'Cumulated tracer '//TRIM(tracers(iq)%longName) |
---|
546 | tnam = 'cum'//TRIM(tracers(iq)%name); o_trac_cum(itr) = ctrl_out(flag, tnam, lnam, "-", [('',i=1,nfiles)]) |
---|
547 | |
---|
548 | IF (CPPKEY_STRATAER) THEN |
---|
549 | if(tracers(iq)%name(1:3)=='BIN') then |
---|
550 | itrb = itrb + 1 |
---|
551 | flag = [11, 11, 11, 11, 11, 11, 11, 11, 11, 1] |
---|
552 | lnam = 'Dry particle concentration in '//TRIM(tracers(iq)%longName) |
---|
553 | tnam = TRIM(tracers(iq)%name)//'_nd_mode'; o_nd_mode (itrb) = ctrl_out(flag, tnam, lnam, "part/m3", [('',i=1,nfiles)]) |
---|
554 | lnam = 'Sulfate MMR in '//TRIM(tracers(iq)%longName) |
---|
555 | tnam = TRIM(tracers(iq)%name)//'_sulfmmr_mode';o_sulfmmr_mode (itrb) = ctrl_out(flag, tnam, lnam, "kg(H2SO4)/kg(air)", [('',i=1,nfiles)]) |
---|
556 | endif |
---|
557 | END IF |
---|
558 | ENDDO |
---|
559 | |
---|
560 | ENDDO ! iff |
---|
561 | |
---|
562 | #ifdef ISO |
---|
563 | write(*,*) 'phys_output_mid 589' |
---|
564 | do ixt=1,ntraciso |
---|
565 | outiso = TRIM(isoName(ixt)) |
---|
566 | i = INDEX(outiso, '_', .TRUE.) |
---|
567 | outiso = outiso(1:i-1)//outiso(i+1:LEN_TRIM(outiso)) |
---|
568 | |
---|
569 | flag = [1, 1, 1, 10, 5, 10, 11, 11, 11, 11]; unit = 'kg/(s*m2)' |
---|
570 | o_xtprecip(ixt)=ctrl_out(flag, 'precip'//TRIM(outiso), 'Precip Totale liq+sol', unit, [('',i=1,nfiles)]) |
---|
571 | o_xtpluc (ixt)=ctrl_out(flag, 'pluc'//TRIM(outiso), 'Convective Precip.', unit, [('',i=1,nfiles)]) |
---|
572 | |
---|
573 | flag = [1, 1, 1, 10, 10, 10, 11, 11, 11, 11] |
---|
574 | o_xtplul (ixt)=ctrl_out(flag, 'plul'//TRIM(outiso), 'Large-scale Precip.', unit, [('',i=1,nfiles)]) |
---|
575 | o_xtevap (ixt)=ctrl_out(flag, 'evap'//TRIM(outiso), 'Evaporat.', unit, [('',i=1,nfiles)]) |
---|
576 | |
---|
577 | ! ajout Camille 8 mai 2023 |
---|
578 | flag = [1, 6, 10, 10, 10, 10, 11, 11, 11, 11] |
---|
579 | o_xtevap_srf (ixt,1)=ctrl_out(flag, 'evap_ter'//TRIM(outiso), 'Evap sfc'//clnsurf(1), unit, [('',i=1,nfiles)]) |
---|
580 | o_xtevap_srf (ixt,2)=ctrl_out(flag, 'evap_lic'//TRIM(outiso), 'Evap sfc'//clnsurf(2), unit, [('',i=1,nfiles)]) |
---|
581 | o_xtevap_srf (ixt,3)=ctrl_out(flag, 'evap_oce'//TRIM(outiso), 'Evap sfc'//clnsurf(3), unit, [('',i=1,nfiles)]) |
---|
582 | o_xtevap_srf (ixt,4)=ctrl_out(flag, 'evap_sic'//TRIM(outiso), 'Evap sfc'//clnsurf(4), unit, [('',i=1,nfiles)]) |
---|
583 | |
---|
584 | flag = [2, 3, 4, 10, 10, 10, 11, 11, 11, 11]; unit = 'kg/kg' |
---|
585 | o_xtovap (ixt)=ctrl_out(flag, 'ovap'//TRIM(outiso), 'Specific humidity', unit, [('',i=1,nfiles)]) |
---|
586 | o_xtoliq (ixt)=ctrl_out(flag, 'oliq'//TRIM(outiso), 'Liquid water', unit, [('',i=1,nfiles)]) |
---|
587 | o_xtcond (ixt)=ctrl_out(flag, 'ocond'//TRIM(outiso), 'Condensed water', unit, [('',i=1,nfiles)]) |
---|
588 | |
---|
589 | flag = [1, 1, 1, 10, 5, 10, 11, 11, 11, 11]; unit = 'kg/m2/s' |
---|
590 | o_xtrunoff_diag (ixt)=ctrl_out(flag, 'runoffland'//TRIM(outiso), 'Run-off rate land for bucket', unit, [('',i=1,nfiles)]) |
---|
591 | |
---|
592 | flag = [4, 10, 10, 10, 10, 10, 11, 11, 11, 11]; unit = '(kg/kg)/s' |
---|
593 | o_dxtdyn (ixt)=ctrl_out(flag, 'dqdyn'//TRIM(outiso), 'Dynamics dQ', unit, [('',i=1,nfiles)]) |
---|
594 | o_dxtldyn (ixt)=ctrl_out(flag, 'dqldyn'//TRIM(outiso), 'Dynamics dQL', unit, [('',i=1,nfiles)]) |
---|
595 | o_dxtcon (ixt)=ctrl_out(flag, 'dqcon'//TRIM(outiso), 'Convection dQ', unit, [('',i=1,nfiles)]) |
---|
596 | o_dxteva (ixt)=ctrl_out(flag, 'dqeva'//TRIM(outiso), 'Reevaporation dQ', unit, [('',i=1,nfiles)]) |
---|
597 | o_dxtlsc (ixt)=ctrl_out(flag, 'dqlsc'//TRIM(outiso), 'Condensation dQ', unit, [('',i=1,nfiles)]) |
---|
598 | o_dxtajs (ixt)=ctrl_out(flag, 'dqajs'//TRIM(outiso), 'Dry adjust. dQ', unit, [('',i=1,nfiles)]) |
---|
599 | o_dxtvdf (ixt)=ctrl_out(flag, 'dqvdf'//TRIM(outiso), 'Boundary-layer dQ', unit, [('',i=1,nfiles)]) |
---|
600 | o_dxtthe (ixt)=ctrl_out(flag, 'dqthe'//TRIM(outiso), 'Thermal dQ', unit, [('',i=1,nfiles)]) |
---|
601 | |
---|
602 | IF(ok_qch4) o_dxtch4(ixt)=ctrl_out(flag, 'dqch4'//TRIM(outiso), 'H2O due to CH4 oxidation & photolysis', & |
---|
603 | unit, [('',i=1,nfiles)]) |
---|
604 | IF(ixt == iso_HTO) THEN |
---|
605 | o_dxtprod_nucl(ixt)=ctrl_out(flag, 'dqprodnucl'//TRIM(outiso), 'dHTO/dt due to nuclear production', & |
---|
606 | unit, [('',i=1,nfiles)]) |
---|
607 | o_dxtcosmo (ixt)=ctrl_out(flag, 'dqcosmo'//TRIM(outiso), 'dHTO/dt due to cosmogenic production', & |
---|
608 | unit, [('',i=1,nfiles)]) |
---|
609 | o_dxtdecroiss (ixt)=ctrl_out(flag, 'dqdecroiss'//TRIM(outiso), 'dHTO/dt due to radiative destruction', & |
---|
610 | unit, [('',i=1,nfiles)]) |
---|
611 | END IF |
---|
612 | enddo !do ixt=1,niso |
---|
613 | write(*,*) 'phys_output_mid 596' |
---|
614 | #endif |
---|
615 | |
---|
616 | ! Updated write frequencies due to phys_out_filetimesteps. |
---|
617 | ! Write frequencies are now in seconds. |
---|
618 | ecrit_mth = ecrit_files(1) |
---|
619 | ecrit_day = ecrit_files(2) |
---|
620 | ecrit_hf = ecrit_files(3) |
---|
621 | ecrit_ins = ecrit_files(4) |
---|
622 | ecrit_LES = ecrit_files(5) |
---|
623 | ecrit_ins = ecrit_files(6) |
---|
624 | |
---|
625 | IF (prt_level >= 10) THEN |
---|
626 | WRITE(lunout,*)'swaerofree_diag=',swaerofree_diag |
---|
627 | WRITE(lunout,*)'swaero_diag=',swaero_diag |
---|
628 | WRITE(lunout,*)'dryaod_diag=',dryaod_diag |
---|
629 | WRITE(lunout,*)'ok_4xCO2atm=',ok_4xCO2atm |
---|
630 | WRITE(lunout,*)'phys_output_open: ends here' |
---|
631 | ENDIF |
---|
632 | |
---|
633 | ! DO iq=1,nqtot |
---|
634 | ! IF(.NOT.(tracers(iq)%isAdvected .AND. tracers(iq)%isInPhysics)) CYCLE |
---|
635 | ! WRITE(*,'(a,i1,a,10i3)')'trac(',iq,')%flag = ',o_trac(iq)%flag |
---|
636 | ! WRITE(*,'(a,i1,a)')'trac(',iq,')%name = '//TRIM(o_trac(iq)%name) |
---|
637 | ! WRITE(*,'(a,i1,a)')'trac(',iq,')%description = '//TRIM(o_trac(iq)%description) |
---|
638 | ! END DO |
---|
639 | |
---|
640 | END SUBROUTINE phys_output_open |
---|
641 | |
---|
642 | SUBROUTINE convers_timesteps(str,dtime,timestep) |
---|
643 | |
---|
644 | use ioipsl |
---|
645 | USE phys_cal_mod |
---|
646 | USE time_phylmdz_mod, ONLY: day_ref, annee_ref |
---|
647 | USE print_control_mod, ONLY: lunout |
---|
648 | |
---|
649 | IMPLICIT NONE |
---|
650 | |
---|
651 | CHARACTER(LEN=20) :: str |
---|
652 | CHARACTER(LEN=10) :: type |
---|
653 | INTEGER :: ipos,il |
---|
654 | real :: ttt,xxx,timestep,dayseconde,dtime |
---|
655 | parameter (dayseconde=86400.) |
---|
656 | |
---|
657 | ipos=scan(str,'0123456789.',.TRUE.) |
---|
658 | ! |
---|
659 | il=len_trim(str) |
---|
660 | WRITE(lunout,*) "ipos = ", ipos |
---|
661 | WRITE(lunout,*) "il = ", il |
---|
662 | IF (ipos == 0) CALL abort_physic("convers_timesteps", "bad str", 1) |
---|
663 | read(str(1:ipos),*) ttt |
---|
664 | WRITE(lunout,*)ttt |
---|
665 | type=str(ipos+1:il) |
---|
666 | |
---|
667 | IF ( il == ipos ) THEN |
---|
668 | type='day' |
---|
669 | ENDIF |
---|
670 | |
---|
671 | IF ( type == 'day'.or.type == 'days'.or.type == 'jours'.or.type == 'jour' ) timestep = ttt * dayseconde |
---|
672 | IF ( type == 'mounths'.or.type == 'mth'.or.type == 'mois' ) THEN |
---|
673 | WRITE(lunout,*)'annee_ref,day_ref mon_len',annee_ref,day_ref,mth_len |
---|
674 | timestep = ttt * dayseconde * mth_len |
---|
675 | ENDIF |
---|
676 | IF ( type == 'hours'.or.type == 'hr'.or.type == 'heurs') timestep = ttt * dayseconde / 24. |
---|
677 | IF ( type == 'mn'.or.type == 'minutes' ) timestep = ttt * 60. |
---|
678 | IF ( type == 's'.or.type == 'sec'.or.type == 'secondes' ) timestep = ttt |
---|
679 | IF ( type == 'TS' ) timestep = ttt * dtime |
---|
680 | |
---|
681 | WRITE(lunout,*)'type = ',type |
---|
682 | WRITE(lunout,*)'nb j/h/m = ',ttt |
---|
683 | WRITE(lunout,*)'timestep(s)=',timestep |
---|
684 | |
---|
685 | END SUBROUTINE convers_timesteps |
---|
686 | |
---|
687 | END MODULE phys_output_mod |
---|