/[lmdze]/trunk/Sources/phylmd/phytrac.f
ViewVC logotype

Diff of /trunk/Sources/phylmd/phytrac.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 18 by guez, Thu Aug 7 12:29:13 2008 UTC revision 47 by guez, Fri Jul 1 15:00:48 2011 UTC
# Line 1  Line 1 
1  module phytrac_m  module phytrac_m
2    
   ! This module is clean: no C preprocessor directive, no include line.  
   
3    IMPLICIT none    IMPLICIT none
4    
5    private    private
# Line 10  module phytrac_m Line 8  module phytrac_m
8  contains  contains
9    
10    SUBROUTINE phytrac(rnpb, itap, lmt_pas, julien, gmtime, firstcal, lafin, &    SUBROUTINE phytrac(rnpb, itap, lmt_pas, julien, gmtime, firstcal, lafin, &
11         nq_phys, pdtphys, u, v, t_seri, paprs, pplay, pmfu, pmfd, pen_u, &         nq_phys, pdtphys, u, t_seri, paprs, pplay, pmfu, pmfd, pen_u, pde_u, &
12         pde_u, pen_d, pde_d, coefh, fm_therm, entr_therm, yu1, yv1, ftsol, &         pen_d, pde_d, coefh, fm_therm, entr_therm, yu1, yv1, ftsol, pctsrf, &
13         pctsrf, frac_impa, frac_nucl, presnivs, pphis, &         frac_impa, frac_nucl, pphis, albsol, rh, cldfra, rneb, diafra, cldliq, &
14         pphi, albsol, rh, cldfra, rneb, diafra, cldliq, itop_con, &         pmflxr, pmflxs, prfl, psfl, da, phi, mp, upwd, dnwd, tr_seri, zmasse)
        ibas_con, pmflxr, pmflxs, prfl, psfl, da, phi, mp, upwd, dnwd, &  
        tr_seri, zmasse)  
15    
16      ! From phylmd/phytrac.F, version 1.15 2006/02/21 08:08:30      ! From phylmd/phytrac.F, version 1.15 2006/02/21 08:08:30 (SVN revision 679)
17    
18      ! Authors: Frédéric Hourdin, Abderrahmane Idelkadi, Marie-Alice      ! Authors: Frédéric Hourdin, Abderrahmane Idelkadi, Marie-Alice
19      ! Foujols, Olivia      ! Foujols, Olivia
20      ! Objet : moniteur général des tendances des traceurs      ! Objet : moniteur général des tendances des traceurs
21    
22      ! Remarques :      ! L'appel de "phytrac" se fait avec "nqmx-2" donc nous avons bien
     ! 1/ L'appel de "phytrac" se fait avec "nq-2" donc nous avons bien  
23      ! les vrais traceurs (en nombre "nbtr", sans la vapeur d'eau ni l'eau      ! les vrais traceurs (en nombre "nbtr", sans la vapeur d'eau ni l'eau
24      ! liquide) dans "phytrac".      ! liquide) dans "phytrac".
25      ! 2/ Le choix du radon et du plomb se fait juste avec un "data"  
26      ! (peu propre).      ! Modifications pour les traceurs :
27      ! Pourrait-on avoir une variable qui indiquerait le type de traceur ?      ! - uniformisation des parametrisations ds phytrac
28        ! - stockage des moyennes des champs necessaires en mode traceur off-line
29    
30      use dimens_m, only: llm      use dimens_m, only: llm
31      use indicesol, only: nbsrf      use indicesol, only: nbsrf
# Line 37  contains Line 33  contains
33      use clesphys, only: ecrit_tra      use clesphys, only: ecrit_tra
34      use clesphys2, only: iflag_con      use clesphys2, only: iflag_con
35      use abort_gcm_m, only: abort_gcm      use abort_gcm_m, only: abort_gcm
36      use YOMCST, only: rg      use SUPHEC_M, only: rg
37      use ctherm, only: iflag_thermals      use ctherm, only: iflag_thermals
38      use regr_pr_comb_coefoz_m, only: regr_pr_comb_coefoz      use regr_pr_comb_coefoz_m, only: regr_pr_comb_coefoz
39      use phyetat0_m, only: rlat      use phyetat0_m, only: rlat
40      use o3_chem_m, only: o3_chem      use o3_chem_m, only: o3_chem
41      use ini_hist, only: ini_histrac      use ini_histrac_m, only: ini_histrac
42      use radiornpb_m, only: radiornpb      use radiornpb_m, only: radiornpb
43      use minmaxqfi_m, only: minmaxqfi      use minmaxqfi_m, only: minmaxqfi
44      use numer_rec, only: assert      use nr_util, only: assert
45      use press_coefoz_m, only: press_coefoz      use press_coefoz_m, only: press_coefoz
46    
     ! Arguments:  
   
     !   EN ENTREE:  
   
     !   divers:  
   
47      logical, intent(in):: rnpb      logical, intent(in):: rnpb
48    
49      integer, intent(in):: nq_phys      integer, intent(in):: nq_phys
# Line 62  contains Line 52  contains
52      integer, intent(in):: itap  ! number of calls to "physiq"      integer, intent(in):: itap  ! number of calls to "physiq"
53      integer, intent(in):: lmt_pas ! number of time steps of "physics" per day      integer, intent(in):: lmt_pas ! number of time steps of "physics" per day
54      integer, intent(in):: julien !jour julien, 1 <= julien <= 360      integer, intent(in):: julien !jour julien, 1 <= julien <= 360
     integer itop_con(klon)  
     integer ibas_con(klon)  
55      real, intent(in):: gmtime ! heure de la journée en fraction de jour      real, intent(in):: gmtime ! heure de la journée en fraction de jour
56      real, intent(in):: pdtphys  ! pas d'integration pour la physique (s)      real, intent(in):: pdtphys  ! pas d'integration pour la physique (s)
57      real, intent(in):: t_seri(klon, llm) ! temperature, in K      real, intent(in):: t_seri(klon, llm) ! temperature, in K
# Line 71  contains Line 59  contains
59      real, intent(inout):: tr_seri(:, :, :) ! (klon, llm, nbtr)      real, intent(inout):: tr_seri(:, :, :) ! (klon, llm, nbtr)
60      ! (mass fractions of tracers, excluding water, at mid-layers)      ! (mass fractions of tracers, excluding water, at mid-layers)
61    
62      real u(klon, llm)      real, intent(in):: u(klon, llm)
     real v(klon, llm)  
63      real rh(klon, llm)     ! humidite relative      real rh(klon, llm)     ! humidite relative
64      real cldliq(klon, llm) ! eau liquide nuageuse      real cldliq(klon, llm) ! eau liquide nuageuse
65      real cldfra(klon, llm) ! fraction nuageuse (tous les nuages)      real cldfra(klon, llm) ! fraction nuageuse (tous les nuages)
# Line 89  contains Line 76  contains
76      real, intent(in):: pplay(klon, llm)      real, intent(in):: pplay(klon, llm)
77      ! (pression pour le mileu de chaque couche, en Pa)      ! (pression pour le mileu de chaque couche, en Pa)
78    
     real pphi(klon, llm) ! geopotentiel  
79      real pphis(klon)      real pphis(klon)
     REAL, intent(in):: presnivs(llm)  
80      logical, intent(in):: firstcal ! first call to "calfis"      logical, intent(in):: firstcal ! first call to "calfis"
81      logical, intent(in):: lafin ! fin de la physique      logical, intent(in):: lafin ! fin de la physique
82    
# Line 221  contains Line 206  contains
206         inirnpb=rnpb         inirnpb=rnpb
207    
208         ! Initialisation des sorties :         ! Initialisation des sorties :
209         call ini_histrac(nid_tra, pdtphys, presnivs, nq_phys, lessivage)         call ini_histrac(nid_tra, pdtphys, nq_phys, lessivage)
210    
211         ! Initialisation de certaines variables pour le radon et le plomb         ! Initialisation de certaines variables pour le radon et le plomb
212         ! Initialisation du traceur dans le sol (couche limite radonique)         ! Initialisation du traceur dans le sol (couche limite radonique)
# Line 470  contains Line 455  contains
455        ! From phylmd/write_histrac.h, version 1.9 2006/02/21 08:08:30        ! From phylmd/write_histrac.h, version 1.9 2006/02/21 08:08:30
456    
457        use dimens_m, only: iim, jjm, llm        use dimens_m, only: iim, jjm, llm
458        use ioipsl, only: histwrite, histsync        use histcom, only: histsync
459          use histwrite_m, only: histwrite
460        use temps, only: itau_phy        use temps, only: itau_phy
461        use iniadvtrac_m, only: tnom        use iniadvtrac_m, only: tnom
462        use comgeomphy, only: airephy        use comgeomphy, only: airephy
463        use dimphy, only: klon        use dimphy, only: klon
464          use grid_change, only: gr_phy_write_2d
465          use gr_phy_write_3d_m, only: gr_phy_write_3d
466    
467        logical, intent(in):: lessivage        logical, intent(in):: lessivage
468    
# Line 487  contains Line 475  contains
475        ! Variables local to the procedure:        ! Variables local to the procedure:
476        integer it        integer it
477        integer itau_w   ! pas de temps ecriture        integer itau_w   ! pas de temps ecriture
       REAL zx_tmp_2d(iim, jjm+1), zx_tmp_3d(iim, jjm+1, llm)  
478        logical, parameter:: ok_sync = .true.        logical, parameter:: ok_sync = .true.
479    
480        !-----------------------------------------------------        !-----------------------------------------------------
481    
482        itau_w = itau_phy + itap        itau_w = itau_phy + itap
483    
484        CALL gr_fi_ecrit(1, klon, iim, jjm+1, pphis, zx_tmp_2d)        CALL histwrite(nid_tra, "phis", itau_w, gr_phy_write_2d(pphis))
485        CALL histwrite(nid_tra, "phis", itau_w, zx_tmp_2d)        CALL histwrite(nid_tra, "aire", itau_w, gr_phy_write_2d(airephy))
486          CALL histwrite(nid_tra, "zmasse", itau_w, gr_phy_write_3d(zmasse))
       CALL gr_fi_ecrit(1, klon, iim, jjm+1, airephy, zx_tmp_2d)        
       CALL histwrite(nid_tra, "aire", itau_w, zx_tmp_2d)  
   
       CALL gr_fi_ecrit(llm, klon, iim, jjm+1, zmasse, zx_tmp_3d)        
       CALL histwrite(nid_tra, "zmasse", itau_w, zx_tmp_3d)  
487    
488        DO it=1, nq_phys        DO it=1, nq_phys
489           CALL gr_fi_ecrit(llm, klon, iim, jjm+1, tr_seri(1, 1, it), zx_tmp_3d)           CALL histwrite(nid_tra, tnom(it+2), itau_w, &
490           CALL histwrite(nid_tra, tnom(it+2), itau_w, zx_tmp_3d)                gr_phy_write_3d(tr_seri(:, :, it)))
491           if (lessivage) THEN           if (lessivage) THEN
492              CALL gr_fi_ecrit(llm, klon, iim, jjm+1, flestottr(1, 1, it), &              CALL histwrite(nid_tra, "fl"//tnom(it+2), itau_w, &
493                   zx_tmp_3d)                   gr_phy_write_3d(flestottr(:, :, it)))
             CALL histwrite(nid_tra, "fl"//tnom(it+2), itau_w, zx_tmp_3d)  
494           endif           endif
495             CALL histwrite(nid_tra, "d_tr_th_"//tnom(it+2), itau_w, &
496           CALL gr_fi_ecrit(llm, klon, iim, jjm+1, d_tr_th(1, 1, it), zx_tmp_3d)                gr_phy_write_3d(d_tr_th(:, :, it)))
497           CALL histwrite(nid_tra, "d_tr_th_"//tnom(it+2), itau_w, zx_tmp_3d)           CALL histwrite(nid_tra, "d_tr_cv_"//tnom(it+2), itau_w, &
498           CALL gr_fi_ecrit(llm, klon, iim, jjm+1, d_tr_cv(1, 1, it), zx_tmp_3d)                gr_phy_write_3d(d_tr_cv(:, :, it)))
499           CALL histwrite(nid_tra, "d_tr_cv_"//tnom(it+2), itau_w, zx_tmp_3d)           CALL histwrite(nid_tra, "d_tr_cl_"//tnom(it+2), itau_w, &
500           CALL gr_fi_ecrit(llm, klon, iim, jjm+1, d_tr_cl(1, 1, it), zx_tmp_3d)                gr_phy_write_3d(d_tr_cl(:, :, it)))
          CALL histwrite(nid_tra, "d_tr_cl_"//tnom(it+2), itau_w, zx_tmp_3d)  
501        ENDDO        ENDDO
502    
503        CALL gr_fi_ecrit(llm, klon, iim, jjm+1, pplay, zx_tmp_3d)        CALL histwrite(nid_tra, "pplay", itau_w, gr_phy_write_3d(pplay))
504        CALL histwrite(nid_tra, "pplay", itau_w, zx_tmp_3d)        CALL histwrite(nid_tra, "T", itau_w, gr_phy_write_3d(t_seri))
   
       CALL gr_fi_ecrit(llm, klon, iim, jjm+1, t_seri, zx_tmp_3d)  
       CALL histwrite(nid_tra, "t", itau_w, zx_tmp_3d)  
505    
506        if (ok_sync) then        if (ok_sync) then
507           call histsync(nid_tra)           call histsync(nid_tra)

Legend:
Removed from v.18  
changed lines
  Added in v.47

  ViewVC Help
Powered by ViewVC 1.1.21