[1279] | 1 | ! $Id: phys_output_mod.F90 2086 2014-07-09 21:19:07Z fhourdin $ |
---|
| 2 | ! |
---|
[1813] | 3 | |
---|
| 4 | MODULE 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] | 20 | CONTAINS |
---|
[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 |
---|
| 96 | REAL :: zjulian |
---|
| 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 |
---|
| 135 | #endif |
---|
| 136 | |
---|
[1791] | 137 | WRITE(lunout,*) 'Debut phys_output_mod.F90' |
---|
[1562] | 138 | ! Initialisations (Valeurs par defaut |
---|
[1403] | 139 | |
---|
[1791] | 140 | IF (.NOT. ALLOCATED(o_trac)) ALLOCATE(o_trac(nqtot)) |
---|
| 141 | IF (.NOT. ALLOCATED(o_trac_cum)) ALLOCATE(o_trac_cum(nqtot)) |
---|
[1813] | 142 | ALLOCATE(o_dtr_the(nqtot),o_dtr_con(nqtot),o_dtr_lessi_impa(nqtot)) |
---|
| 143 | ALLOCATE(o_dtr_lessi_nucl(nqtot),o_dtr_insc(nqtot),o_dtr_bcscav(nqtot)) |
---|
| 144 | ALLOCATE(o_dtr_evapls(nqtot),o_dtr_ls(nqtot),o_dtr_trsp(nqtot)) |
---|
| 145 | ALLOCATE(o_dtr_sscav(nqtot),o_dtr_sat(nqtot),o_dtr_uscav(nqtot)) |
---|
| 146 | ALLOCATE(o_dtr_dry(nqtot),o_dtr_vdf(nqtot)) |
---|
[1403] | 147 | |
---|
[1813] | 148 | |
---|
[1828] | 149 | levmax = (/ klev, klev, klev, klev, klev, klev, nlevSTD, nlevSTD, nlevSTD /) |
---|
[1065] | 150 | |
---|
[1562] | 151 | phys_out_filenames(1) = 'histmth' |
---|
| 152 | phys_out_filenames(2) = 'histday' |
---|
| 153 | phys_out_filenames(3) = 'histhf' |
---|
| 154 | phys_out_filenames(4) = 'histins' |
---|
| 155 | phys_out_filenames(5) = 'histLES' |
---|
| 156 | phys_out_filenames(6) = 'histstn' |
---|
[1828] | 157 | phys_out_filenames(7) = 'histmthNMC' |
---|
| 158 | phys_out_filenames(8) = 'histdayNMC' |
---|
| 159 | phys_out_filenames(9) = 'histhfNMC.nc' |
---|
[907] | 160 | |
---|
[1562] | 161 | type_ecri(1) = 'ave(X)' |
---|
| 162 | type_ecri(2) = 'ave(X)' |
---|
| 163 | type_ecri(3) = 'ave(X)' |
---|
| 164 | type_ecri(4) = 'inst(X)' |
---|
| 165 | type_ecri(5) = 'ave(X)' |
---|
| 166 | type_ecri(6) = 'inst(X)' |
---|
[1828] | 167 | type_ecri(7) = 'inst(X)' |
---|
| 168 | type_ecri(8) = 'inst(X)' |
---|
| 169 | type_ecri(9) = 'inst(X)' |
---|
[907] | 170 | |
---|
[1562] | 171 | clef_files(1) = ok_mensuel |
---|
| 172 | clef_files(2) = ok_journe |
---|
| 173 | clef_files(3) = ok_hf |
---|
| 174 | clef_files(4) = ok_instan |
---|
| 175 | clef_files(5) = ok_LES |
---|
| 176 | clef_files(6) = ok_instan |
---|
[1828] | 177 | clef_files(7) = ok_histNMC(1) |
---|
| 178 | clef_files(8) = ok_histNMC(2) |
---|
| 179 | clef_files(9) = ok_histNMC(3) |
---|
[907] | 180 | |
---|
[1562] | 181 | !sortir des fichiers "stations" si clef_stations(:)=.TRUE. |
---|
| 182 | clef_stations(1) = .FALSE. |
---|
| 183 | clef_stations(2) = .FALSE. |
---|
| 184 | clef_stations(3) = .FALSE. |
---|
| 185 | clef_stations(4) = .FALSE. |
---|
| 186 | clef_stations(5) = .FALSE. |
---|
| 187 | clef_stations(6) = .FALSE. |
---|
[1828] | 188 | clef_stations(7) = .FALSE. |
---|
| 189 | clef_stations(8) = .FALSE. |
---|
| 190 | clef_stations(9) = .FALSE. |
---|
[1539] | 191 | |
---|
[1562] | 192 | lev_files(1) = lev_histmth |
---|
| 193 | lev_files(2) = lev_histday |
---|
| 194 | lev_files(3) = lev_histhf |
---|
| 195 | lev_files(4) = lev_histins |
---|
| 196 | lev_files(5) = lev_histLES |
---|
| 197 | lev_files(6) = lev_histins |
---|
[1828] | 198 | lev_files(7) = levout_histNMC(1) |
---|
| 199 | lev_files(8) = levout_histNMC(2) |
---|
| 200 | lev_files(9) = levout_histNMC(3) |
---|
[907] | 201 | |
---|
[1562] | 202 | ecrit_files(1) = ecrit_mth |
---|
| 203 | ecrit_files(2) = ecrit_day |
---|
| 204 | ecrit_files(3) = ecrit_hf |
---|
| 205 | ecrit_files(4) = ecrit_ins |
---|
| 206 | ecrit_files(5) = ecrit_LES |
---|
| 207 | ecrit_files(6) = ecrit_ins |
---|
[1912] | 208 | ecrit_files(7) = freq_outNMC(1) |
---|
| 209 | ecrit_files(8) = freq_outNMC(2) |
---|
| 210 | ecrit_files(9) = freq_outNMC(3) |
---|
[1279] | 211 | |
---|
[1562] | 212 | !! Lectures des parametres de sorties dans physiq.def |
---|
[1279] | 213 | |
---|
[1791] | 214 | CALL getin('phys_out_regfkey',phys_out_regfkey) |
---|
| 215 | CALL getin('phys_out_lonmin',phys_out_lonmin) |
---|
| 216 | CALL getin('phys_out_lonmax',phys_out_lonmax) |
---|
| 217 | CALL getin('phys_out_latmin',phys_out_latmin) |
---|
| 218 | CALL getin('phys_out_latmax',phys_out_latmax) |
---|
[1562] | 219 | phys_out_levmin(:)=levmin(:) |
---|
[1791] | 220 | CALL getin('phys_out_levmin',levmin) |
---|
[1562] | 221 | phys_out_levmax(:)=levmax(:) |
---|
[1791] | 222 | CALL getin('phys_out_levmax',levmax) |
---|
| 223 | CALL getin('phys_out_filenames',phys_out_filenames) |
---|
[1562] | 224 | phys_out_filekeys(:)=clef_files(:) |
---|
[1791] | 225 | CALL getin('phys_out_filekeys',clef_files) |
---|
[1562] | 226 | phys_out_filestations(:)=clef_stations(:) |
---|
[1791] | 227 | CALL getin('phys_out_filestations',clef_stations) |
---|
[1562] | 228 | phys_out_filelevels(:)=lev_files(:) |
---|
[1791] | 229 | CALL getin('phys_out_filelevels',lev_files) |
---|
| 230 | CALL getin('phys_out_filetimesteps',chtimestep) |
---|
[1562] | 231 | phys_out_filetypes(:)=type_ecri(:) |
---|
[1791] | 232 | CALL getin('phys_out_filetypes',type_ecri) |
---|
[1279] | 233 | |
---|
[1562] | 234 | type_ecri_files(:)=type_ecri(:) |
---|
[1279] | 235 | |
---|
[1791] | 236 | WRITE(lunout,*)'phys_out_lonmin=',phys_out_lonmin |
---|
| 237 | WRITE(lunout,*)'phys_out_lonmax=',phys_out_lonmax |
---|
| 238 | WRITE(lunout,*)'phys_out_latmin=',phys_out_latmin |
---|
| 239 | WRITE(lunout,*)'phys_out_latmax=',phys_out_latmax |
---|
| 240 | WRITE(lunout,*)'phys_out_filenames=',phys_out_filenames |
---|
| 241 | WRITE(lunout,*)'phys_out_filetypes=',type_ecri |
---|
| 242 | WRITE(lunout,*)'phys_out_filekeys=',clef_files |
---|
| 243 | WRITE(lunout,*)'phys_out_filestations=',clef_stations |
---|
| 244 | WRITE(lunout,*)'phys_out_filelevels=',lev_files |
---|
[1562] | 245 | |
---|
[1971] | 246 | ! A noter pour |
---|
| 247 | ! l heure initiale - dans les fichiers histoire hist* - on met comme |
---|
| 248 | ! heure de debut soit la vraie heure (pour le 1D) soit 0h (pour le 3D) |
---|
| 249 | ! afin d avoir une seule sortie mensuelle par mois lorsque l on tourne |
---|
| 250 | ! par annee (IM). |
---|
| 251 | ! |
---|
| 252 | idayref = day_ref |
---|
| 253 | IF (klon_glo==1) THEN |
---|
| 254 | CALL ymds2ju(annee_ref, 1, idayref, hour, zjulian) !jyg |
---|
| 255 | ELSE |
---|
| 256 | CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian) |
---|
| 257 | END IF |
---|
| 258 | |
---|
[1825] | 259 | #ifdef CPP_XIOS |
---|
| 260 | ! ug Réglage du calendrier xios |
---|
| 261 | !Temps julian => an, mois, jour, heure |
---|
| 262 | CALL ju2ymds(zjulian, x_an, x_mois, x_jour, x_heure) |
---|
| 263 | CALL wxios_set_cal(dtime, calend, x_an, x_mois, x_jour, x_heure) |
---|
| 264 | #endif |
---|
| 265 | |
---|
[907] | 266 | !!!!!!!!!!!!!!!!!!!!!!! Boucle sur les fichiers !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[1562] | 267 | ! Appel de histbeg et histvert pour creer le fichier et les niveaux verticaux !! |
---|
| 268 | ! Appel des histbeg pour definir les variables (nom, moy ou inst, freq de sortie .. |
---|
[907] | 269 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 270 | |
---|
[1807] | 271 | zdtime_moy = dtime ! Frequence ou l on moyenne |
---|
[1279] | 272 | |
---|
[1562] | 273 | ! Calcul des Ahyb, Bhyb et Alt |
---|
[1791] | 274 | DO k=1,klev |
---|
[1562] | 275 | Ahyb(k)=(ap(k)+ap(k+1))/2. |
---|
| 276 | Bhyb(k)=(bp(k)+bp(k+1))/2. |
---|
| 277 | Alt(k)=log(preff/presnivs(k))*8. |
---|
[1791] | 278 | ENDDO |
---|
[1562] | 279 | ! if(prt_level.ge.1) then |
---|
[1791] | 280 | WRITE(lunout,*)'Ap Hybrid = ',Ahyb(1:klev) |
---|
| 281 | WRITE(lunout,*)'Bp Hybrid = ',Bhyb(1:klev) |
---|
| 282 | WRITE(lunout,*)'Alt approx des couches pour une haut d echelle de 8km = ',Alt(1:klev) |
---|
[1562] | 283 | ! endif |
---|
[1971] | 284 | DO iff=1,nfiles |
---|
[929] | 285 | |
---|
[1641] | 286 | ! Calculate ecrit_files for all files |
---|
[1884] | 287 | IF ( chtimestep(iff).eq.'Default' ) then |
---|
| 288 | ! Par defaut ecrit_files = (ecrit_mensuel ecrit_jour ecrit_hf |
---|
| 289 | ! ...)*86400. |
---|
[1641] | 290 | ecrit_files(iff)=ecrit_files(iff)*86400. |
---|
[1912] | 291 | ELSE IF (chtimestep(iff).eq.'-1') then |
---|
| 292 | PRINT*,'ecrit_files(',iff,') < 0 so IOIPSL work on different' |
---|
| 293 | PRINT*,'months length' |
---|
| 294 | ecrit_files(iff)=-1. |
---|
[1884] | 295 | else |
---|
| 296 | CALL convers_timesteps(chtimestep(iff),dtime,ecrit_files(iff)) |
---|
| 297 | ENDIF |
---|
| 298 | |
---|
[1791] | 299 | WRITE(lunout,*)'ecrit_files(',iff,')= ',ecrit_files(iff) |
---|
[1641] | 300 | zoutm(iff) = ecrit_files(iff) ! Frequence ou l on ecrit en seconde |
---|
[1279] | 301 | |
---|
[1971] | 302 | IF (clef_files(iff)) THEN |
---|
| 303 | |
---|
[1852] | 304 | #ifdef CPP_XIOS |
---|
[1971] | 305 | !!! Ouverture de chaque fichier XIOS !!!!!!!!!!! |
---|
[2001] | 306 | if (prt_level >= 10) then |
---|
| 307 | print*,'phys_output_open: call wxios_add_file with phys_out_filenames(iff)=',trim(phys_out_filenames(iff)) |
---|
| 308 | endif |
---|
[1971] | 309 | CALL wxios_add_file(phys_out_filenames(iff),chtimestep(iff),lev_files(iff)) |
---|
| 310 | |
---|
| 311 | !!! Declaration des axes verticaux de chaque fichier: |
---|
[2001] | 312 | if (prt_level >= 10) then |
---|
| 313 | print*,'phys_output_open: Declare vertical axes for each file' |
---|
| 314 | endif |
---|
[1971] | 315 | if (iff.le.6) then |
---|
[2002] | 316 | CALL wxios_add_vaxis("presnivs", & |
---|
[1852] | 317 | levmax(iff) - levmin(iff) + 1, presnivs(levmin(iff):levmax(iff))) |
---|
[2002] | 318 | CALL wxios_add_vaxis("Ahyb", & |
---|
[1852] | 319 | levmax(iff) - levmin(iff) + 1, Ahyb) |
---|
[2002] | 320 | CALL wxios_add_vaxis("Bhyb", & |
---|
[1852] | 321 | levmax(iff) - levmin(iff) + 1, Bhyb) |
---|
[2002] | 322 | CALL wxios_add_vaxis("Alt", & |
---|
[1852] | 323 | levmax(iff) - levmin(iff) + 1, Alt) |
---|
[1971] | 324 | else |
---|
[2001] | 325 | ! NMC files |
---|
[2002] | 326 | CALL wxios_add_vaxis("plev", & |
---|
[1971] | 327 | levmax(iff) - levmin(iff) + 1, rlevSTD(levmin(iff):levmax(iff))) |
---|
| 328 | endif |
---|
[1852] | 329 | #endif |
---|
| 330 | |
---|
[907] | 331 | !!!!!!!!!!!!!!!!! Traitement dans le cas ou l'on veut stocker sur un domaine limite !! |
---|
| 332 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[1791] | 333 | IF (phys_out_regfkey(iff)) then |
---|
[1562] | 334 | imin_ins=1 |
---|
| 335 | imax_ins=iim |
---|
| 336 | jmin_ins=1 |
---|
| 337 | jmax_ins=jjmp1 |
---|
[907] | 338 | |
---|
[1562] | 339 | ! correction abderr |
---|
| 340 | do i=1,iim |
---|
[1791] | 341 | WRITE(lunout,*)'io_lon(i)=',io_lon(i) |
---|
| 342 | IF (io_lon(i).le.phys_out_lonmin(iff)) imin_ins=i |
---|
| 343 | IF (io_lon(i).le.phys_out_lonmax(iff)) imax_ins=i+1 |
---|
[1562] | 344 | enddo |
---|
[907] | 345 | |
---|
[1562] | 346 | do j=1,jjmp1 |
---|
[1791] | 347 | WRITE(lunout,*)'io_lat(j)=',io_lat(j) |
---|
| 348 | IF (io_lat(j).ge.phys_out_latmin(iff)) jmax_ins=j+1 |
---|
| 349 | IF (io_lat(j).ge.phys_out_latmax(iff)) jmin_ins=j |
---|
[1562] | 350 | enddo |
---|
[907] | 351 | |
---|
[1791] | 352 | WRITE(lunout,*)'On stoke le fichier histoire numero ',iff,' sur ', & |
---|
[1562] | 353 | imin_ins,imax_ins,jmin_ins,jmax_ins |
---|
[1791] | 354 | WRITE(lunout,*)'longitudes : ', & |
---|
[1562] | 355 | io_lon(imin_ins),io_lon(imax_ins), & |
---|
| 356 | 'latitudes : ', & |
---|
| 357 | io_lat(jmax_ins),io_lat(jmin_ins) |
---|
[907] | 358 | |
---|
[1562] | 359 | CALL histbeg(phys_out_filenames(iff),iim,io_lon,jjmp1,io_lat, & |
---|
| 360 | imin_ins,imax_ins-imin_ins+1, & |
---|
| 361 | jmin_ins,jmax_ins-jmin_ins+1, & |
---|
| 362 | itau_phy,zjulian,dtime,nhorim(iff),nid_files(iff)) |
---|
[907] | 363 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
[1562] | 364 | !IM fichiers stations |
---|
[1791] | 365 | else IF (clef_stations(iff)) THEN |
---|
[1539] | 366 | |
---|
[2001] | 367 | if (prt_level >= 10) then |
---|
| 368 | WRITE(lunout,*)'phys_output_open: iff=',iff,' phys_out_filenames(iff)=',phys_out_filenames(iff) |
---|
| 369 | endif |
---|
| 370 | |
---|
[1791] | 371 | CALL histbeg_phy_all(rlon,rlat,pim,tabij,ipt,jpt,plon,plat,plon_bounds,plat_bounds, & |
---|
[1562] | 372 | phys_out_filenames(iff), & |
---|
| 373 | itau_phy,zjulian,dtime,nhorim(iff),nid_files(iff)) |
---|
| 374 | else |
---|
[1825] | 375 | CALL histbeg_phy_all(phys_out_filenames(iff),itau_phy,zjulian,& |
---|
[1852] | 376 | dtime,nhorim(iff),nid_files(iff)) |
---|
[1562] | 377 | endif |
---|
[907] | 378 | |
---|
[1852] | 379 | #ifndef CPP_NO_IOIPSL |
---|
[1828] | 380 | if (iff.le.6) then |
---|
| 381 | CALL histvert(nid_files(iff), "presnivs", "Vertical levels", "Pa", & |
---|
[1562] | 382 | levmax(iff) - levmin(iff) + 1, & |
---|
| 383 | presnivs(levmin(iff):levmax(iff)), nvertm(iff),"down") |
---|
[1807] | 384 | !!!! Composantes de la coordonnee sigma-hybride |
---|
[1562] | 385 | CALL histvert(nid_files(iff), "Ahyb","Ahyb comp of Hyb Cord ", "Pa", & |
---|
| 386 | levmax(iff) - levmin(iff) + 1,Ahyb,nvertap(iff)) |
---|
[907] | 387 | |
---|
[1562] | 388 | CALL histvert(nid_files(iff), "Bhyb","Bhyb comp of Hyb Cord", " ", & |
---|
| 389 | levmax(iff) - levmin(iff) + 1,Bhyb,nvertbp(iff)) |
---|
[1279] | 390 | |
---|
[1828] | 391 | CALL histvert(nid_files(iff), "Alt","Height approx for scale heigh of 8km at levels", "Km", & |
---|
[1562] | 392 | levmax(iff) - levmin(iff) + 1,Alt,nvertAlt(iff)) |
---|
[1279] | 393 | |
---|
[1828] | 394 | else |
---|
| 395 | CALL histvert(nid_files(iff), "plev", "pressure", "Pa", & |
---|
| 396 | levmax(iff) - levmin(iff) + 1, & |
---|
| 397 | rlevSTD(levmin(iff):levmax(iff)), nvertm(iff), "down") |
---|
| 398 | endif |
---|
| 399 | #endif |
---|
[907] | 400 | |
---|
[2086] | 401 | !CR: ajout d'une variable eau |
---|
| 402 | ! IF (nqtot>=3) THEN |
---|
| 403 | IF (nqtot>=nqo+1) THEN |
---|
| 404 | ! DO iq=3,nqtot |
---|
| 405 | DO iq=nqo+1,nqtot |
---|
[1791] | 406 | iiq=niadv(iq) |
---|
[2086] | 407 | o_trac(iq-nqo) = ctrl_out((/ 4, 5, 1, 1, 1, 10, 11, 11, 11 /), & |
---|
[1828] | 408 | tname(iiq),'Tracer '//ttext(iiq), "-", & |
---|
| 409 | (/ '', '', '', '', '', '', '', '', '' /)) |
---|
[1813] | 410 | |
---|
[2086] | 411 | o_dtr_vdf(iq-nqo) = ctrl_out((/ 5, 7, 7, 7, 10, 10, 11, 11, 11 /), & |
---|
[1828] | 412 | 'd'//trim(tname(iq))//'_vdf', & |
---|
| 413 | 'Tendance tracer '//ttext(iiq), "-" , & |
---|
| 414 | (/ '', '', '', '', '', '', '', '', '' /)) |
---|
[1813] | 415 | |
---|
[2086] | 416 | o_dtr_the(iq-nqo) = ctrl_out((/ 5, 7, 7, 7, 10, 10, 11, 11, 11 /), & |
---|
[1828] | 417 | 'd'//trim(tname(iq))//'_the', & |
---|
| 418 | 'Tendance tracer '//ttext(iiq), "-", & |
---|
| 419 | (/ '', '', '', '', '', '', '', '', '' /)) |
---|
[1813] | 420 | |
---|
[2086] | 421 | o_dtr_con(iq-nqo) = ctrl_out((/ 5, 7, 7, 7, 10, 10, 11, 11, 11 /), & |
---|
[1828] | 422 | 'd'//trim(tname(iq))//'_con', & |
---|
| 423 | 'Tendance tracer '//ttext(iiq), "-", & |
---|
| 424 | (/ '', '', '', '', '', '', '', '', '' /)) |
---|
[1813] | 425 | |
---|
[2086] | 426 | o_dtr_lessi_impa(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), & |
---|
[1828] | 427 | 'd'//trim(tname(iq))//'_lessi_impa', & |
---|
| 428 | 'Tendance tracer '//ttext(iiq), "-", & |
---|
| 429 | (/ '', '', '', '', '', '', '', '', '' /)) |
---|
[1813] | 430 | |
---|
[2086] | 431 | o_dtr_lessi_nucl(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), & |
---|
[1828] | 432 | 'd'//trim(tname(iq))//'_lessi_nucl', & |
---|
| 433 | 'Tendance tracer '//ttext(iiq), "-", & |
---|
| 434 | (/ '', '', '', '', '', '', '', '', '' /)) |
---|
[1813] | 435 | |
---|
[2086] | 436 | o_dtr_insc(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), & |
---|
[1828] | 437 | 'd'//trim(tname(iq))//'_insc', & |
---|
| 438 | 'Tendance tracer '//ttext(iiq), "-", & |
---|
| 439 | (/ '', '', '', '', '', '', '', '', '' /)) |
---|
[1813] | 440 | |
---|
[2086] | 441 | o_dtr_bcscav(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), & |
---|
[1828] | 442 | 'd'//trim(tname(iq))//'_bcscav', & |
---|
| 443 | 'Tendance tracer '//ttext(iiq), "-", & |
---|
| 444 | (/ '', '', '', '', '', '', '', '', '' /)) |
---|
[1813] | 445 | |
---|
[2086] | 446 | o_dtr_evapls(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), & |
---|
[1828] | 447 | 'd'//trim(tname(iq))//'_evapls', & |
---|
| 448 | 'Tendance tracer '//ttext(iiq), "-", & |
---|
| 449 | (/ '', '', '', '', '', '', '', '', '' /)) |
---|
[1813] | 450 | |
---|
[2086] | 451 | o_dtr_ls(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), & |
---|
[1828] | 452 | 'd'//trim(tname(iq))//'_ls', & |
---|
| 453 | 'Tendance tracer '//ttext(iiq), "-", & |
---|
| 454 | (/ '', '', '', '', '', '', '', '', '' /)) |
---|
[1813] | 455 | |
---|
[2086] | 456 | o_dtr_trsp(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), & |
---|
[1828] | 457 | 'd'//trim(tname(iq))//'_trsp', & |
---|
| 458 | 'Tendance tracer '//ttext(iiq), "-", & |
---|
| 459 | (/ '', '', '', '', '', '', '', '', '' /)) |
---|
[1813] | 460 | |
---|
[2086] | 461 | o_dtr_sscav(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), & |
---|
[1828] | 462 | 'd'//trim(tname(iq))//'_sscav', & |
---|
| 463 | 'Tendance tracer '//ttext(iiq), "-", & |
---|
| 464 | (/ '', '', '', '', '', '', '', '', '' /)) |
---|
[1813] | 465 | |
---|
[2086] | 466 | o_dtr_sat(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), & |
---|
[1828] | 467 | 'd'//trim(tname(iq))//'_sat', & |
---|
| 468 | 'Tendance tracer '//ttext(iiq), "-", & |
---|
| 469 | (/ '', '', '', '', '', '', '', '', '' /)) |
---|
[1813] | 470 | |
---|
[2086] | 471 | o_dtr_uscav(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), & |
---|
[1828] | 472 | 'd'//trim(tname(iq))//'_uscav', & |
---|
| 473 | 'Tendance tracer '//ttext(iiq), "-", & |
---|
| 474 | (/ '', '', '', '', '', '', '', '', '' /)) |
---|
[1813] | 475 | |
---|
[2086] | 476 | o_dtr_dry(iq-nqo) = ctrl_out((/ 7, 7, 7, 7, 10, 10, 11, 11, 11 /), & |
---|
[1828] | 477 | 'cum'//'d'//trim(tname(iq))//'_dry', & |
---|
| 478 | 'tracer tendency dry deposition'//ttext(iiq), "-", & |
---|
| 479 | (/ '', '', '', '', '', '', '', '', '' /)) |
---|
[1813] | 480 | |
---|
[2086] | 481 | o_trac_cum(iq-nqo) = ctrl_out((/ 3, 4, 10, 10, 10, 10, 11, 11, 11 /), & |
---|
[1828] | 482 | 'cum'//tname(iiq),& |
---|
| 483 | 'Cumulated tracer '//ttext(iiq), "-", & |
---|
| 484 | (/ '', '', '', '', '', '', '', '', '' /)) |
---|
[1791] | 485 | ENDDO |
---|
| 486 | ENDIF |
---|
[1539] | 487 | |
---|
[1971] | 488 | ENDIF ! clef_files |
---|
[1539] | 489 | |
---|
[1971] | 490 | ENDDO ! iff |
---|
[1539] | 491 | |
---|
[1641] | 492 | ! Updated write frequencies due to phys_out_filetimesteps. |
---|
| 493 | ! Write frequencies are now in seconds. |
---|
| 494 | ecrit_mth = ecrit_files(1) |
---|
| 495 | ecrit_day = ecrit_files(2) |
---|
| 496 | ecrit_hf = ecrit_files(3) |
---|
| 497 | ecrit_ins = ecrit_files(4) |
---|
| 498 | ecrit_LES = ecrit_files(5) |
---|
| 499 | ecrit_ins = ecrit_files(6) |
---|
| 500 | |
---|
[2001] | 501 | if (prt_level >= 10) then |
---|
| 502 | WRITE(lunout,*)'swaero_diag=',swaero_diag |
---|
| 503 | WRITE(lunout,*)'phys_output_open: ends here' |
---|
| 504 | endif |
---|
[1920] | 505 | |
---|
[1791] | 506 | end SUBROUTINE phys_output_open |
---|
[907] | 507 | |
---|
| 508 | |
---|
| 509 | |
---|
[1562] | 510 | SUBROUTINE convers_timesteps(str,dtime,timestep) |
---|
[1279] | 511 | |
---|
[1562] | 512 | use ioipsl |
---|
| 513 | USE phys_cal_mod |
---|
[1279] | 514 | |
---|
[1562] | 515 | IMPLICIT NONE |
---|
[1279] | 516 | |
---|
[1791] | 517 | CHARACTER(LEN=20) :: str |
---|
| 518 | CHARACTER(LEN=10) :: type |
---|
| 519 | INTEGER :: ipos,il |
---|
[1562] | 520 | real :: ttt,xxx,timestep,dayseconde,dtime |
---|
| 521 | parameter (dayseconde=86400.) |
---|
| 522 | include "temps.h" |
---|
| 523 | include "comconst.h" |
---|
[1575] | 524 | include "iniprint.h" |
---|
[1279] | 525 | |
---|
[1791] | 526 | ipos=scan(str,'0123456789.',.TRUE.) |
---|
[1562] | 527 | ! |
---|
| 528 | il=len_trim(str) |
---|
[1937] | 529 | WRITE(lunout,*) "ipos = ", ipos |
---|
| 530 | WRITE(lunout,*) "il = ", il |
---|
| 531 | if (ipos == 0) call abort_gcm("convers_timesteps", "bad str", 1) |
---|
[1562] | 532 | read(str(1:ipos),*) ttt |
---|
[1791] | 533 | WRITE(lunout,*)ttt |
---|
[1562] | 534 | type=str(ipos+1:il) |
---|
[1279] | 535 | |
---|
| 536 | |
---|
[1791] | 537 | IF ( il == ipos ) then |
---|
[1562] | 538 | type='day' |
---|
| 539 | endif |
---|
[1279] | 540 | |
---|
[1791] | 541 | IF ( type == 'day'.or.type == 'days'.or.type == 'jours'.or.type == 'jour' ) timestep = ttt * dayseconde |
---|
| 542 | IF ( type == 'mounths'.or.type == 'mth'.or.type == 'mois' ) then |
---|
| 543 | WRITE(lunout,*)'annee_ref,day_ref mon_len',annee_ref,day_ref,mth_len |
---|
[1562] | 544 | timestep = ttt * dayseconde * mth_len |
---|
| 545 | endif |
---|
[1791] | 546 | IF ( type == 'hours'.or.type == 'hr'.or.type == 'heurs') timestep = ttt * dayseconde / 24. |
---|
| 547 | IF ( type == 'mn'.or.type == 'minutes' ) timestep = ttt * 60. |
---|
| 548 | IF ( type == 's'.or.type == 'sec'.or.type == 'secondes' ) timestep = ttt |
---|
| 549 | IF ( type == 'TS' ) timestep = ttt * dtime |
---|
[1279] | 550 | |
---|
[1791] | 551 | WRITE(lunout,*)'type = ',type |
---|
| 552 | WRITE(lunout,*)'nb j/h/m = ',ttt |
---|
| 553 | WRITE(lunout,*)'timestep(s)=',timestep |
---|
[1279] | 554 | |
---|
[1562] | 555 | END SUBROUTINE convers_timesteps |
---|
[1279] | 556 | |
---|
[907] | 557 | END MODULE phys_output_mod |
---|
| 558 | |
---|