source: LMDZ5/trunk/libf/phylmd/phys_output_mod.F90 @ 2107

Last change on this file since 2107 was 2097, checked in by Laurent Fairhead, 10 years ago

Changement de nom de clef CPP:
CPP_NO_IOIPSL devient CPP_IOIPSL_NO_OUTPUT pour éviter la confusion. Elle
permet de ne pas sortir les fichiers IOIPSL "proprement"
L'option -io de makelmdz et makelmdz_fcm est changée:
avec la valeur ioipsl, on ne sort que les fichier IOIPSL

mix, on sort les fichiers IOIPSL et XIOS
xios, on ne sort que les fichiers XIOS


Change in the name of a CPP key:
CPP_NO_IOIPSL becomes CPP_IOIPSL_NO_OUTPUT. If defined, IOIPSL outputs are not
generated.
The -io option for makelmdz and makelmdz_fcm is changed as well:
with the value ioipsl, only IOIPSL files are output

mix, IOIPSL and XIOS files are output
xios, only XIOS files are output

  • 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: 23.4 KB
RevLine 
[1279]1! $Id: phys_output_mod.F90 2097 2014-07-21 12:39:49Z fhourdin $
2!
[1813]3
4MODULE phys_output_mod
5  USE indice_sol_mod
6  USE phys_output_var_mod
7  USE aero_mod, only : naero_spc,name_aero
8  USE phys_output_write_mod, ONLY : phys_output_write
[1920]9  REAL, DIMENSION(nfiles),SAVE :: ecrit_files
[1813]10
[907]11! Abderrahmane 12 2007
12!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
13!!! Ecreture des Sorties du modele dans les fichiers Netcdf :
14! histmth.nc : moyennes mensuelles
15! histday.nc : moyennes journalieres
16! histhf.nc  : moyennes toutes les 3 heures
17! histins.nc : valeurs instantanees
18!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
19
[1562]20CONTAINS
[907]21
22!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
23!!!!!!!!! Ouverture des fichier et definition des variable de sortie !!!!!!!!
[1562]24  !! histbeg, histvert et histdef
[907]25!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[1562]26
[1539]27  SUBROUTINE phys_output_open(rlon,rlat,pim,tabij,ipt,jpt,plon,plat, &
[2037]28       jjmp1,nlevSTD,clevSTD,rlevSTD, dtime, ok_veget, &
[1279]29       type_ocean, iflag_pbl,ok_mensuel,ok_journe, &
30       ok_hf,ok_instan,ok_LES,ok_ade,ok_aie, read_climoz, &
[1539]31       phys_out_filestations, &
[1807]32       new_aod, aerosol_couple, flag_aerosol_strat, &
33       pdtphys, paprs, pphis, pplay, lmax_th, ptconv, ptconvth, ivap, &
34       d_t, qx, d_qx, zmasse, ok_sync)   
[907]35
[1562]36    USE iophy
37    USE dimphy
38    USE infotrac
39    USE ioipsl
[1742]40    USE phys_cal_mod, only : hour
[1562]41    USE mod_phys_lmdz_para
42    USE aero_mod, only : naero_spc,name_aero
[1865]43        !Martin
44    USE surface_data, ONLY : ok_snow
[1807]45    USE phys_output_ctrlout_mod
[1912]46    USE mod_grid_phy_lmdz, only: klon_glo
[907]47
[1825]48#ifdef CPP_XIOS
49    ! ug Pour les sorties XIOS
50    USE wxios
51#endif
52
[1562]53    IMPLICIT NONE
54    include "dimensions.h"
55    include "temps.h"
56    include "clesphys.h"
57    include "thermcell.h"
58    include "comvert.h"
[1575]59    include "iniprint.h"
[907]60
[1807]61    ! ug Nouveaux arguments nécessaires au histwrite_mod:
62    INTEGER, INTENT(IN)                         :: ivap
63    INTEGER, DIMENSION(klon), INTENT(IN)        :: lmax_th
64    LOGICAL, INTENT(IN)                         :: ok_sync
65    LOGICAL, DIMENSION(klon, klev), INTENT(IN)  :: ptconv, ptconvth
66    REAL, INTENT(IN)                            :: pdtphys
67    REAL, DIMENSION(klon), INTENT(IN)           :: pphis
68    REAL, DIMENSION(klon, klev), INTENT(IN)     :: pplay, d_t
69    REAL, DIMENSION(klon, klev+1), INTENT(IN)   :: paprs
70    REAL, DIMENSION(klon,klev,nqtot), INTENT(IN):: qx, d_qx
71    REAL, DIMENSION(klon, llm), INTENT(IN)      :: zmasse
72
73
74    REAL,DIMENSION(klon),INTENT(IN) :: rlon
75    REAL,DIMENSION(klon),INTENT(IN) :: rlat
76    INTEGER, INTENT(IN)             :: pim
[1539]77    INTEGER, DIMENSION(pim)            :: tabij
[1807]78    INTEGER,DIMENSION(pim), INTENT(IN) :: ipt, jpt
79    REAL,DIMENSION(pim), INTENT(IN) :: plat, plon
80    REAL,DIMENSION(pim,2) :: plat_bounds, plon_bounds
[1539]81
[1791]82    INTEGER                               :: jjmp1
[2037]83    INTEGER                               :: nlevSTD, radpas
[1791]84    LOGICAL                               :: ok_mensuel, ok_journe, ok_hf, ok_instan
85    LOGICAL                               :: ok_LES,ok_ade,ok_aie,flag_aerosol_strat
86    LOGICAL                               :: new_aod, aerosol_couple
[1807]87    INTEGER, INTENT(IN)::  read_climoz ! read ozone climatology
[1562]88    !     Allowed values are 0, 1 and 2
89    !     0: do not read an ozone climatology
90    !     1: read a single ozone climatology that will be used day and night
91    !     2: read two ozone climatologies, the average day and night
92    !     climatology and the daylight climatology
[1279]93
[1791]94    REAL                                  :: dtime
95    INTEGER                               :: idayref
[2095]96    REAL                                  :: zjulian_start, zjulian
[1791]97    REAL, DIMENSION(klev)                 :: Ahyb, Bhyb, Alt
98    CHARACTER(LEN=4), DIMENSION(nlevSTD)  :: clevSTD
[1828]99    REAL, DIMENSION(nlevSTD)              :: rlevSTD
[1791]100    INTEGER                               :: nsrf, k, iq, iiq, iff, i, j, ilev
101    INTEGER                               :: naero
102    LOGICAL                               :: ok_veget
103    INTEGER                               :: iflag_pbl
104    CHARACTER(LEN=4)                      :: bb2
105    CHARACTER(LEN=2)                      :: bb3
106    CHARACTER(LEN=6)                      :: type_ocean
107    INTEGER, DIMENSION(iim*jjmp1)         ::  ndex2d
108    INTEGER, DIMENSION(iim*jjmp1*klev)    :: ndex3d
109    INTEGER                               :: imin_ins, imax_ins
110    INTEGER                               :: jmin_ins, jmax_ins
111    INTEGER, DIMENSION(nfiles)            :: phys_out_levmin, phys_out_levmax
112    INTEGER, DIMENSION(nfiles)            :: phys_out_filelevels
[1884]113    CHARACTER(LEN=20), DIMENSION(nfiles)  :: chtimestep = (/ 'Default', 'Default', 'Default', 'Default', 'Default', &
114                                                             'Default', 'Default', 'Default', 'Default' /)
[1791]115    LOGICAL, DIMENSION(nfiles)            :: phys_out_filekeys
116    LOGICAL, DIMENSION(nfiles)            :: phys_out_filestations
[907]117
[1065]118!!!!!!!!!! stockage dans une region limitee pour chaque fichier !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[1562]119    !                 entre [phys_out_lonmin,phys_out_lonmax] et [phys_out_latmin,phys_out_latmax]
[1054]120
[1828]121    LOGICAL, DIMENSION(nfiles), SAVE  :: phys_out_regfkey       = (/ .FALSE., .FALSE., .FALSE.,  .FALSE., &
122                                                                    .FALSE., .FALSE., .FALSE., .FALSE.,  .FALSE. /)
123    REAL, DIMENSION(nfiles), SAVE     :: phys_out_lonmin        = (/   -180.,   -180.,   -180.,    -180., &
124                                                                     -180.,   -180., -180.,   -180.,    -180. /)
125    REAL, DIMENSION(nfiles), SAVE     :: phys_out_lonmax        = (/    180.,    180.,    180.,     180., &
126                                                                      180.,    180., 180.,    180.,     180. /)
127    REAL, DIMENSION(nfiles), SAVE     :: phys_out_latmin        = (/    -90.,    -90.,    -90.,     -90., &
128                                                                    -90., -90., -90.,    -90.,     -90. /)
129    REAL, DIMENSION(nfiles), SAVE     :: phys_out_latmax        = (/  90.,     90.,     90.,     90., &
130                                                                    90., 90., 90., 90., 90. /)                       
[1825]131#ifdef CPP_XIOS
132    ! ug Variables utilisées pour récupérer le calendrier pour xios
133    INTEGER :: x_an, x_mois, x_jour
134    REAL :: x_heure
[2095]135    INTEGER :: ini_an, ini_mois, ini_jour
136    REAL :: ini_heure
[1825]137#endif
138
[1791]139    WRITE(lunout,*) 'Debut phys_output_mod.F90'
[1562]140    ! Initialisations (Valeurs par defaut
[1403]141
[1791]142    IF (.NOT. ALLOCATED(o_trac)) ALLOCATE(o_trac(nqtot))
143    IF (.NOT. ALLOCATED(o_trac_cum)) ALLOCATE(o_trac_cum(nqtot))
[1813]144    ALLOCATE(o_dtr_the(nqtot),o_dtr_con(nqtot),o_dtr_lessi_impa(nqtot))
145    ALLOCATE(o_dtr_lessi_nucl(nqtot),o_dtr_insc(nqtot),o_dtr_bcscav(nqtot))
146    ALLOCATE(o_dtr_evapls(nqtot),o_dtr_ls(nqtot),o_dtr_trsp(nqtot))
147    ALLOCATE(o_dtr_sscav(nqtot),o_dtr_sat(nqtot),o_dtr_uscav(nqtot))
148    ALLOCATE(o_dtr_dry(nqtot),o_dtr_vdf(nqtot))
[1403]149
[1813]150
[1828]151    levmax = (/ klev, klev, klev, klev, klev, klev, nlevSTD, nlevSTD, nlevSTD /)
[1065]152
[1562]153    phys_out_filenames(1) = 'histmth'
154    phys_out_filenames(2) = 'histday'
155    phys_out_filenames(3) = 'histhf'
156    phys_out_filenames(4) = 'histins'
157    phys_out_filenames(5) = 'histLES'
158    phys_out_filenames(6) = 'histstn'
[1828]159    phys_out_filenames(7) = 'histmthNMC'
160    phys_out_filenames(8) = 'histdayNMC'
161    phys_out_filenames(9) = 'histhfNMC.nc'
[907]162
[1562]163    type_ecri(1) = 'ave(X)'
164    type_ecri(2) = 'ave(X)'
165    type_ecri(3) = 'ave(X)'
166    type_ecri(4) = 'inst(X)'
167    type_ecri(5) = 'ave(X)'
168    type_ecri(6) = 'inst(X)'
[1828]169    type_ecri(7) = 'inst(X)'
170    type_ecri(8) = 'inst(X)'
171    type_ecri(9) = 'inst(X)'
[907]172
[1562]173    clef_files(1) = ok_mensuel
174    clef_files(2) = ok_journe
175    clef_files(3) = ok_hf
176    clef_files(4) = ok_instan
177    clef_files(5) = ok_LES
178    clef_files(6) = ok_instan
[1828]179    clef_files(7) = ok_histNMC(1)
180    clef_files(8) = ok_histNMC(2)
181    clef_files(9) = ok_histNMC(3)
[907]182
[1562]183    !sortir des fichiers "stations" si clef_stations(:)=.TRUE.
184    clef_stations(1) = .FALSE.
185    clef_stations(2) = .FALSE.
186    clef_stations(3) = .FALSE.
187    clef_stations(4) = .FALSE.
188    clef_stations(5) = .FALSE.
189    clef_stations(6) = .FALSE.
[1828]190    clef_stations(7) = .FALSE.
191    clef_stations(8) = .FALSE.
192    clef_stations(9) = .FALSE.
[1539]193
[1562]194    lev_files(1) = lev_histmth
195    lev_files(2) = lev_histday
196    lev_files(3) = lev_histhf
197    lev_files(4) = lev_histins
198    lev_files(5) = lev_histLES
199    lev_files(6) = lev_histins
[1828]200    lev_files(7) = levout_histNMC(1)
201    lev_files(8) = levout_histNMC(2)
202    lev_files(9) = levout_histNMC(3)
[907]203
[1562]204    ecrit_files(1) = ecrit_mth
205    ecrit_files(2) = ecrit_day
206    ecrit_files(3) = ecrit_hf
207    ecrit_files(4) = ecrit_ins
208    ecrit_files(5) = ecrit_LES
209    ecrit_files(6) = ecrit_ins
[1912]210    ecrit_files(7) = freq_outNMC(1)
211    ecrit_files(8) = freq_outNMC(2)
212    ecrit_files(9) = freq_outNMC(3)
[1279]213
[1562]214    !! Lectures des parametres de sorties dans physiq.def
[1279]215
[1791]216    CALL getin('phys_out_regfkey',phys_out_regfkey)
217    CALL getin('phys_out_lonmin',phys_out_lonmin)
218    CALL getin('phys_out_lonmax',phys_out_lonmax)
219    CALL getin('phys_out_latmin',phys_out_latmin)
220    CALL getin('phys_out_latmax',phys_out_latmax)
[1562]221    phys_out_levmin(:)=levmin(:)
[1791]222    CALL getin('phys_out_levmin',levmin)
[1562]223    phys_out_levmax(:)=levmax(:)
[1791]224    CALL getin('phys_out_levmax',levmax)
225    CALL getin('phys_out_filenames',phys_out_filenames)
[1562]226    phys_out_filekeys(:)=clef_files(:)
[1791]227    CALL getin('phys_out_filekeys',clef_files)
[1562]228    phys_out_filestations(:)=clef_stations(:)
[1791]229    CALL getin('phys_out_filestations',clef_stations)
[1562]230    phys_out_filelevels(:)=lev_files(:)
[1791]231    CALL getin('phys_out_filelevels',lev_files)
232    CALL getin('phys_out_filetimesteps',chtimestep)
[1562]233    phys_out_filetypes(:)=type_ecri(:)
[1791]234    CALL getin('phys_out_filetypes',type_ecri)
[1279]235
[1562]236    type_ecri_files(:)=type_ecri(:)
[1279]237
[1791]238    WRITE(lunout,*)'phys_out_lonmin=',phys_out_lonmin
239    WRITE(lunout,*)'phys_out_lonmax=',phys_out_lonmax
240    WRITE(lunout,*)'phys_out_latmin=',phys_out_latmin
241    WRITE(lunout,*)'phys_out_latmax=',phys_out_latmax
242    WRITE(lunout,*)'phys_out_filenames=',phys_out_filenames
243    WRITE(lunout,*)'phys_out_filetypes=',type_ecri
244    WRITE(lunout,*)'phys_out_filekeys=',clef_files
245    WRITE(lunout,*)'phys_out_filestations=',clef_stations
246    WRITE(lunout,*)'phys_out_filelevels=',lev_files
[1562]247
[1971]248! A noter pour
249! l heure initiale - dans les fichiers histoire hist* - on met comme 
250! heure de debut soit la vraie heure (pour le 1D) soit 0h (pour le 3D)
251! afin d avoir une seule sortie mensuelle par mois lorsque l on tourne
252! par annee (IM).
253!
254     idayref = day_ref
255     IF (klon_glo==1) THEN
256         CALL ymds2ju(annee_ref, 1, idayref, hour, zjulian)     !jyg
257     ELSE
258         CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
[2095]259         CALL ymds2ju(annee_ref, 1, day_ini, start_time, zjulian_start)
[1971]260     END IF
261
[1825]262#ifdef CPP_XIOS
263    ! ug Réglage du calendrier xios
264    !Temps julian => an, mois, jour, heure
265    CALL ju2ymds(zjulian, x_an, x_mois, x_jour, x_heure)
[2095]266    CALL ju2ymds(zjulian_start, ini_an, ini_mois, ini_jour, ini_heure)
267    CALL wxios_set_cal(dtime, calend, x_an, x_mois, x_jour, x_heure, ini_an, &
268                       ini_mois, ini_jour, ini_heure )
[1825]269#endif
270
[907]271!!!!!!!!!!!!!!!!!!!!!!! Boucle sur les fichiers !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[1562]272    ! Appel de histbeg et histvert pour creer le fichier et les niveaux verticaux !!
273    ! Appel des histbeg pour definir les variables (nom, moy ou inst, freq de sortie ..
[907]274!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
275
[1807]276    zdtime_moy = dtime         ! Frequence ou l on moyenne
[1279]277
[1562]278    ! Calcul des Ahyb, Bhyb et Alt
[1791]279    DO k=1,klev
[1562]280       Ahyb(k)=(ap(k)+ap(k+1))/2.
281       Bhyb(k)=(bp(k)+bp(k+1))/2.
282       Alt(k)=log(preff/presnivs(k))*8.
[1791]283    ENDDO
[1562]284    !          if(prt_level.ge.1) then
[1791]285    WRITE(lunout,*)'Ap Hybrid = ',Ahyb(1:klev)
286    WRITE(lunout,*)'Bp Hybrid = ',Bhyb(1:klev)
287    WRITE(lunout,*)'Alt approx des couches pour une haut d echelle de 8km = ',Alt(1:klev)
[1562]288    !          endif
[1971]289  DO iff=1,nfiles
[929]290
[1641]291       ! Calculate ecrit_files for all files
[1884]292      IF ( chtimestep(iff).eq.'Default' ) then
293          ! Par defaut ecrit_files = (ecrit_mensuel ecrit_jour ecrit_hf
294          ! ...)*86400.
[1641]295          ecrit_files(iff)=ecrit_files(iff)*86400.
[1912]296      ELSE IF (chtimestep(iff).eq.'-1') then
297          PRINT*,'ecrit_files(',iff,') < 0 so IOIPSL work on different'
298          PRINT*,'months length'
299          ecrit_files(iff)=-1.
[1884]300      else
301       CALL convers_timesteps(chtimestep(iff),dtime,ecrit_files(iff))
302      ENDIF
303
[1791]304       WRITE(lunout,*)'ecrit_files(',iff,')= ',ecrit_files(iff)
[1641]305       zoutm(iff) = ecrit_files(iff) ! Frequence ou l on ecrit en seconde
[1279]306
[1971]307    IF (clef_files(iff)) THEN
308
[1852]309#ifdef CPP_XIOS
[1971]310!!! Ouverture de chaque fichier XIOS !!!!!!!!!!!
[2001]311    if (prt_level >= 10) then
312      print*,'phys_output_open: call wxios_add_file with phys_out_filenames(iff)=',trim(phys_out_filenames(iff))                                                                       
313    endif
[1971]314    CALL wxios_add_file(phys_out_filenames(iff),chtimestep(iff),lev_files(iff)) 
315
316!!! Declaration des axes verticaux de chaque fichier:
[2001]317    if (prt_level >= 10) then
318      print*,'phys_output_open: Declare vertical axes for each file'
319    endif
[1971]320   if (iff.le.6) then
[2002]321    CALL wxios_add_vaxis("presnivs", &
[1852]322            levmax(iff) - levmin(iff) + 1, presnivs(levmin(iff):levmax(iff)))
[2002]323    CALL wxios_add_vaxis("Ahyb", &
[1852]324            levmax(iff) - levmin(iff) + 1, Ahyb)
[2002]325    CALL wxios_add_vaxis("Bhyb", &
[1852]326            levmax(iff) - levmin(iff) + 1, Bhyb)
[2002]327    CALL wxios_add_vaxis("Alt", &
[1852]328            levmax(iff) - levmin(iff) + 1, Alt)
[1971]329   else
[2001]330    ! NMC files
[2002]331    CALL wxios_add_vaxis("plev", &
[1971]332            levmax(iff) - levmin(iff) + 1, rlevSTD(levmin(iff):levmax(iff)))
333   endif
[1852]334#endif
335
[907]336!!!!!!!!!!!!!!!!! Traitement dans le cas ou l'on veut stocker sur un domaine limite !!
337!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[1791]338          IF (phys_out_regfkey(iff)) then
[1562]339             imin_ins=1
340             imax_ins=iim
341             jmin_ins=1
342             jmax_ins=jjmp1
[907]343
[1562]344             ! correction abderr       
345             do i=1,iim
[1791]346                WRITE(lunout,*)'io_lon(i)=',io_lon(i)
347                IF (io_lon(i).le.phys_out_lonmin(iff)) imin_ins=i
348                IF (io_lon(i).le.phys_out_lonmax(iff)) imax_ins=i+1
[1562]349             enddo
[907]350
[1562]351             do j=1,jjmp1
[1791]352                WRITE(lunout,*)'io_lat(j)=',io_lat(j)
353                IF (io_lat(j).ge.phys_out_latmin(iff)) jmax_ins=j+1
354                IF (io_lat(j).ge.phys_out_latmax(iff)) jmin_ins=j
[1562]355             enddo
[907]356
[1791]357             WRITE(lunout,*)'On stoke le fichier histoire numero ',iff,' sur ', &
[1562]358                  imin_ins,imax_ins,jmin_ins,jmax_ins
[1791]359             WRITE(lunout,*)'longitudes : ', &
[1562]360                  io_lon(imin_ins),io_lon(imax_ins), &
361                  'latitudes : ', &
362                  io_lat(jmax_ins),io_lat(jmin_ins)
[907]363
[1562]364             CALL histbeg(phys_out_filenames(iff),iim,io_lon,jjmp1,io_lat, &
365                  imin_ins,imax_ins-imin_ins+1, &
366                  jmin_ins,jmax_ins-jmin_ins+1, &
367                  itau_phy,zjulian,dtime,nhorim(iff),nid_files(iff))
[907]368!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[1562]369             !IM fichiers stations
[1791]370          else IF (clef_stations(iff)) THEN
[1539]371
[2001]372             if (prt_level >= 10) then
373             WRITE(lunout,*)'phys_output_open: iff=',iff,'  phys_out_filenames(iff)=',phys_out_filenames(iff)
374             endif
375             
[1791]376             CALL histbeg_phy_all(rlon,rlat,pim,tabij,ipt,jpt,plon,plat,plon_bounds,plat_bounds, &
[1562]377                  phys_out_filenames(iff), &
378                  itau_phy,zjulian,dtime,nhorim(iff),nid_files(iff))
379          else
[1825]380             CALL histbeg_phy_all(phys_out_filenames(iff),itau_phy,zjulian,&
[1852]381                 dtime,nhorim(iff),nid_files(iff))
[1562]382          endif
[907]383
[2097]384#ifndef CPP_IOIPSL_NO_OUTPUT
[1828]385          if (iff.le.6) then
386             CALL histvert(nid_files(iff), "presnivs", "Vertical levels", "Pa", & 
[1562]387               levmax(iff) - levmin(iff) + 1, &
388               presnivs(levmin(iff):levmax(iff)), nvertm(iff),"down")
[1807]389!!!! Composantes de la coordonnee sigma-hybride
[1562]390          CALL histvert(nid_files(iff), "Ahyb","Ahyb comp of Hyb Cord ", "Pa", &
391               levmax(iff) - levmin(iff) + 1,Ahyb,nvertap(iff))
[907]392
[1562]393          CALL histvert(nid_files(iff), "Bhyb","Bhyb comp of Hyb Cord", " ", &
394               levmax(iff) - levmin(iff) + 1,Bhyb,nvertbp(iff))
[1279]395
[1828]396          CALL histvert(nid_files(iff), "Alt","Height approx for scale heigh of 8km at levels", "Km", &                       
[1562]397               levmax(iff) - levmin(iff) + 1,Alt,nvertAlt(iff))
[1279]398
[1828]399          else
400             CALL histvert(nid_files(iff), "plev", "pressure", "Pa", &
401               levmax(iff) - levmin(iff) + 1, &
402              rlevSTD(levmin(iff):levmax(iff)), nvertm(iff), "down")
403          endif
404#endif
[907]405
[2086]406!CR: ajout d'une variable eau
407!      IF (nqtot>=3) THEN
408       IF (nqtot>=nqo+1) THEN
409!            DO iq=3,nqtot 
410            DO iq=nqo+1,nqtot
[1791]411            iiq=niadv(iq)
[2086]412            o_trac(iq-nqo) = ctrl_out((/ 4, 5, 1, 1, 1, 10, 11, 11, 11 /), &
[1828]413                           tname(iiq),'Tracer '//ttext(iiq), "-",  &
414                           (/ '', '', '', '', '', '', '', '', '' /))
[1813]415
[2086]416            o_dtr_vdf(iq-nqo) = ctrl_out((/ 5, 7, 7, 7, 10, 10, 11, 11, 11 /), &
[1828]417                              'd'//trim(tname(iq))//'_vdf',  &
418                              'Tendance tracer '//ttext(iiq), "-" , &
419                              (/ '', '', '', '', '', '', '', '', '' /))
[1813]420
[2086]421            o_dtr_the(iq-nqo) = ctrl_out((/ 5, 7, 7, 7, 10, 10, 11, 11, 11 /), &
[1828]422                              'd'//trim(tname(iq))//'_the', &
423                              'Tendance tracer '//ttext(iiq), "-", &
424                              (/ '', '', '', '', '', '', '', '', '' /))
[1813]425
[2086]426            o_dtr_con(iq-nqo) = ctrl_out((/ 5, 7, 7, 7, 10, 10, 11, 11, 11 /), &
[1828]427                              'd'//trim(tname(iq))//'_con', &
428                              'Tendance tracer '//ttext(iiq), "-", &
429                              (/ '', '', '', '', '', '', '', '', '' /))
[1813]430
[2086]431            o_dtr_lessi_impa(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), &
[1828]432                                     'd'//trim(tname(iq))//'_lessi_impa', &
433                                     'Tendance tracer '//ttext(iiq), "-", &
434                                     (/ '', '', '', '', '', '', '', '', '' /))
[1813]435
[2086]436            o_dtr_lessi_nucl(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), &
[1828]437                                     'd'//trim(tname(iq))//'_lessi_nucl', &
438                                     'Tendance tracer '//ttext(iiq), "-", &
439                                     (/ '', '', '', '', '', '', '', '', '' /))
[1813]440
[2086]441            o_dtr_insc(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), &
[1828]442                               'd'//trim(tname(iq))//'_insc', &
443                               'Tendance tracer '//ttext(iiq), "-", &
444                               (/ '', '', '', '', '', '', '', '', '' /))
[1813]445
[2086]446            o_dtr_bcscav(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), &
[1828]447                                 'd'//trim(tname(iq))//'_bcscav', &
448                                 'Tendance tracer '//ttext(iiq), "-", &
449                                 (/ '', '', '', '', '', '', '', '', '' /))
[1813]450
[2086]451            o_dtr_evapls(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), &
[1828]452                                 'd'//trim(tname(iq))//'_evapls', &
453                                 'Tendance tracer '//ttext(iiq), "-", &
454                                 (/ '', '', '', '', '', '', '', '', '' /))
[1813]455
[2086]456            o_dtr_ls(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), &
[1828]457                             'd'//trim(tname(iq))//'_ls', &
458                             'Tendance tracer '//ttext(iiq), "-", &
459                             (/ '', '', '', '', '', '', '', '', '' /))
[1813]460
[2086]461            o_dtr_trsp(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), &
[1828]462                               'd'//trim(tname(iq))//'_trsp', &
463                               'Tendance tracer '//ttext(iiq), "-", &
464                               (/ '', '', '', '', '', '', '', '', '' /))
[1813]465
[2086]466            o_dtr_sscav(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), &
[1828]467                                'd'//trim(tname(iq))//'_sscav', &
468                                'Tendance tracer '//ttext(iiq), "-", &
469                                (/ '', '', '', '', '', '', '', '', '' /))
[1813]470
[2086]471            o_dtr_sat(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), &
[1828]472                               'd'//trim(tname(iq))//'_sat', &
473                               'Tendance tracer '//ttext(iiq), "-", &
474                               (/ '', '', '', '', '', '', '', '', '' /))
[1813]475
[2086]476            o_dtr_uscav(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), &
[1828]477                                'd'//trim(tname(iq))//'_uscav', &
478                                'Tendance tracer '//ttext(iiq), "-", &
479                                 (/ '', '', '', '', '', '', '', '', '' /))
[1813]480
[2086]481            o_dtr_dry(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), &
[1828]482                              'cum'//'d'//trim(tname(iq))//'_dry', &
483                              'tracer tendency dry deposition'//ttext(iiq), "-", &
484                              (/ '', '', '', '', '', '', '', '', '' /))
[1813]485
[2086]486            o_trac_cum(iq-nqo) = ctrl_out((/ 3, 4, 10, 10, 10, 10, 11, 11, 11 /), &
[1828]487                               'cum'//tname(iiq),&
488                               'Cumulated tracer '//ttext(iiq), "-", &
489                               (/ '', '', '', '', '', '', '', '', '' /))
[1791]490            ENDDO
491      ENDIF
[1539]492
[1971]493     ENDIF ! clef_files
[1539]494
[1971]495   ENDDO !  iff
[1539]496
[1641]497    ! Updated write frequencies due to phys_out_filetimesteps.
498    ! Write frequencies are now in seconds. 
499    ecrit_mth = ecrit_files(1)
500    ecrit_day = ecrit_files(2)
501    ecrit_hf  = ecrit_files(3)
502    ecrit_ins = ecrit_files(4)
503    ecrit_LES = ecrit_files(5)
504    ecrit_ins = ecrit_files(6)
505
[2001]506    if (prt_level >= 10) then
507      WRITE(lunout,*)'swaero_diag=',swaero_diag
508      WRITE(lunout,*)'phys_output_open: ends here'
509    endif
[1920]510
[1791]511  end SUBROUTINE phys_output_open
[907]512
513
514
[1562]515  SUBROUTINE convers_timesteps(str,dtime,timestep)
[1279]516
[1562]517    use ioipsl
518    USE phys_cal_mod
[1279]519
[1562]520    IMPLICIT NONE
[1279]521
[1791]522    CHARACTER(LEN=20)   :: str
523    CHARACTER(LEN=10)   :: type
524    INTEGER             :: ipos,il
[1562]525    real                :: ttt,xxx,timestep,dayseconde,dtime
526    parameter (dayseconde=86400.)
527    include "temps.h"
528    include "comconst.h"
[1575]529    include "iniprint.h"
[1279]530
[1791]531    ipos=scan(str,'0123456789.',.TRUE.)
[1562]532    ! 
533    il=len_trim(str)
[1937]534    WRITE(lunout,*) "ipos = ", ipos
535    WRITE(lunout,*) "il = ", il
536    if (ipos == 0) call abort_gcm("convers_timesteps", "bad str", 1)
[1562]537    read(str(1:ipos),*) ttt
[1791]538    WRITE(lunout,*)ttt
[1562]539    type=str(ipos+1:il)
[1279]540
541
[1791]542    IF ( il == ipos ) then
[1562]543       type='day'
544    endif
[1279]545
[1791]546    IF ( type == 'day'.or.type == 'days'.or.type == 'jours'.or.type == 'jour' ) timestep = ttt * dayseconde
547    IF ( type == 'mounths'.or.type == 'mth'.or.type == 'mois' ) then
548       WRITE(lunout,*)'annee_ref,day_ref mon_len',annee_ref,day_ref,mth_len
[1562]549       timestep = ttt * dayseconde * mth_len
550    endif
[1791]551    IF ( type == 'hours'.or.type == 'hr'.or.type == 'heurs') timestep = ttt * dayseconde / 24.
552    IF ( type == 'mn'.or.type == 'minutes'  ) timestep = ttt * 60.
553    IF ( type == 's'.or.type == 'sec'.or.type == 'secondes'   ) timestep = ttt
554    IF ( type == 'TS' ) timestep = ttt * dtime
[1279]555
[1791]556    WRITE(lunout,*)'type =      ',type
557    WRITE(lunout,*)'nb j/h/m =  ',ttt
558    WRITE(lunout,*)'timestep(s)=',timestep
[1279]559
[1562]560  END SUBROUTINE convers_timesteps
[1279]561
[907]562END MODULE phys_output_mod
563
Note: See TracBrowser for help on using the repository browser.