/[lmdze]/trunk/phylmd/physiq.f90
ViewVC logotype

Diff of /trunk/phylmd/physiq.f90

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

trunk/phylmd/physiq.f revision 322 by guez, Thu Jan 24 16:17:39 2019 UTC trunk/phylmd/physiq.f90 revision 340 by guez, Thu Sep 26 17:29:50 2019 UTC
# Line 19  contains Line 19  contains
19      use ajsec_m, only: ajsec      use ajsec_m, only: ajsec
20      use calltherm_m, only: calltherm      use calltherm_m, only: calltherm
21      USE clesphys, ONLY: cdhmax, cdmmax, ecrit_ins, ok_instan      USE clesphys, ONLY: cdhmax, cdmmax, ecrit_ins, ok_instan
22      USE clesphys2, ONLY: conv_emanuel, nbapp_rad, new_oliq, ok_orodr, ok_orolf      USE clesphys2, ONLY: conv_emanuel, nbapp_rad, ok_orodr, ok_orolf
23      USE conf_interface_m, ONLY: conf_interface      USE conf_interface_m, ONLY: conf_interface
24      USE pbl_surface_m, ONLY: pbl_surface      USE pbl_surface_m, ONLY: pbl_surface
25      use clouds_gno_m, only: clouds_gno      use clouds_gno_m, only: clouds_gno
# Line 29  contains Line 29  contains
29      USE conf_gcm_m, ONLY: lmt_pas      USE conf_gcm_m, ONLY: lmt_pas
30      USE conf_phys_m, ONLY: conf_phys      USE conf_phys_m, ONLY: conf_phys
31      use conflx_m, only: conflx      use conflx_m, only: conflx
32      USE ctherm, ONLY: iflag_thermals, nsplit_thermals      USE ctherm_m, ONLY: iflag_thermals, ctherm
33      use diagcld2_m, only: diagcld2      use diagcld2_m, only: diagcld2
34      USE dimensions, ONLY: llm, nqmx      USE dimensions, ONLY: llm, nqmx
35      USE dimphy, ONLY: klon      USE dimphy, ONLY: klon
# Line 41  contains Line 41  contains
41      USE hgardfou_m, ONLY: hgardfou      USE hgardfou_m, ONLY: hgardfou
42      USE histsync_m, ONLY: histsync      USE histsync_m, ONLY: histsync
43      USE histwrite_phy_m, ONLY: histwrite_phy      USE histwrite_phy_m, ONLY: histwrite_phy
44      USE indicesol, ONLY: clnsurf, epsfra, is_lic, is_oce, is_sic, is_ter, &      USE indicesol, ONLY: clnsurf, epsfra, nbsrf
          nbsrf  
45      USE ini_histins_m, ONLY: ini_histins, nid_ins      USE ini_histins_m, ONLY: ini_histins, nid_ins
46      use lift_noro_m, only: lift_noro      use lift_noro_m, only: lift_noro
47      use netcdf95, only: NF95_CLOSE      use netcdf95, only: NF95_CLOSE
48      use newmicro_m, only: newmicro      use newmicro_m, only: newmicro
49      use nr_util, only: assert      use nr_util, only: assert
     use nuage_m, only: nuage  
50      USE orbite_m, ONLY: orbite      USE orbite_m, ONLY: orbite
51      USE ozonecm_m, ONLY: ozonecm      USE ozonecm_m, ONLY: ozonecm
52      USE phyetat0_m, ONLY: phyetat0      USE phyetat0_m, ONLY: phyetat0
# Line 105  contains Line 103  contains
103    
104      LOGICAL:: firstcal = .true.      LOGICAL:: firstcal = .true.
105    
     LOGICAL, PARAMETER:: ok_stratus = .FALSE.  
     ! Ajouter artificiellement les stratus  
   
106      ! pour phystoke avec thermiques      ! pour phystoke avec thermiques
107      REAL fm_therm(klon, llm + 1)      REAL fm_therm(klon, llm + 1)
108      REAL entr_therm(klon, llm)      REAL entr_therm(klon, llm)
# Line 145  contains Line 140  contains
140      ! "physiq".      ! "physiq".
141    
142      REAL, save:: radsol(klon)      REAL, save:: radsol(klon)
143      ! bilan radiatif net au sol (W/m2), positif vers le bas      ! Bilan radiatif net au sol (W/m2), positif vers le bas. Must be
144        ! saved because radlwsw is not called at every time step.
145            
146      REAL, save:: ftsol(klon, nbsrf) ! skin temperature of surface fraction, in K      REAL, save:: ftsol(klon, nbsrf) ! skin temperature of surface fraction, in K
147    
# Line 158  contains Line 154  contains
154      ! humidite de l'air au contact de la surface      ! humidite de l'air au contact de la surface
155    
156      REAL, save:: qsol(klon) ! column-density of water in soil, in kg m-2      REAL, save:: qsol(klon) ! column-density of water in soil, in kg m-2
157      REAL, save:: fsnow(klon, nbsrf) ! \'epaisseur neigeuse  
158        REAL, save:: fsnow(klon, nbsrf)
159        ! column-density of mass of snow at the surface, in kg m-2
160    
161      REAL, save:: falbe(klon, nbsrf) ! albedo visible par type de surface      REAL, save:: falbe(klon, nbsrf) ! albedo visible par type de surface
162    
163      ! Param\`etres de l'orographie \`a l'\'echelle sous-maille (OESM) :      ! Param\`etres de l'orographie \`a l'\'echelle sous-maille (OESM) :
# Line 217  contains Line 216  contains
216      REAL sens(klon) ! flux de chaleur sensible au sol      REAL sens(klon) ! flux de chaleur sensible au sol
217      real dflux_t(klon) ! derivee du flux de chaleur sensible au sol      real dflux_t(klon) ! derivee du flux de chaleur sensible au sol
218      REAL, save:: dlw(klon) ! derivative of infra-red flux      REAL, save:: dlw(klon) ! derivative of infra-red flux
219      REAL bils(klon) ! bilan de chaleur au sol      REAL fder(klon) ! d\'erive de flux (sensible et latente)
     REAL fder(klon) ! Derive de flux (sensible et latente)  
220      REAL ve(klon) ! integr. verticale du transport meri. de l'energie      REAL ve(klon) ! integr. verticale du transport meri. de l'energie
221      REAL vq(klon) ! integr. verticale du transport meri. de l'eau      REAL vq(klon) ! integr. verticale du transport meri. de l'eau
222      REAL ue(klon) ! integr. verticale du transport zonal de l'energie      REAL ue(klon) ! integr. verticale du transport zonal de l'energie
# Line 243  contains Line 241  contains
241      REAL diafra(klon, llm) ! fraction nuageuse      REAL diafra(klon, llm) ! fraction nuageuse
242      REAL cldliq(klon, llm) ! eau liquide nuageuse      REAL cldliq(klon, llm) ! eau liquide nuageuse
243      REAL cldfra(klon, llm) ! fraction nuageuse      REAL cldfra(klon, llm) ! fraction nuageuse
244      REAL cldtau(klon, llm) ! epaisseur optique      REAL cldtau(klon, llm) ! \'epaisseur optique
245      REAL cldemi(klon, llm) ! emissivite infrarouge      REAL cldemi(klon, llm) ! \'emissivit\'e infrarouge
246    
247      REAL flux_q(klon, nbsrf) ! flux turbulent d'humidite à la surface      REAL flux_q(klon, nbsrf) ! flux turbulent d'humidite à la surface
248    
# Line 264  contains Line 262  contains
262      REAL, save:: topsw(klon), toplw(klon), solsw(klon)      REAL, save:: topsw(klon), toplw(klon), solsw(klon)
263    
264      REAL, save:: sollw(klon) ! surface net downward longwave flux, in W m-2      REAL, save:: sollw(klon) ! surface net downward longwave flux, in W m-2
265      real, save:: sollwdown(klon) ! downward LW flux at surface      real, save:: sollwdown(klon) ! downwelling longwave flux at surface
266      REAL, save:: topsw0(klon), toplw0(klon), solsw0(klon), sollw0(klon)      REAL, save:: topsw0(klon), toplw0(klon), solsw0(klon), sollw0(klon)
267      REAL, save:: albpla(klon)      REAL, save:: albpla(klon)
268    
# Line 279  contains Line 277  contains
277      real longi      real longi
278      REAL z_avant(klon), z_apres(klon), z_factor(klon)      REAL z_avant(klon), z_apres(klon), z_factor(klon)
279      REAL zb      REAL zb
280      REAL zx_t, zx_qs, zcor      REAL zx_qs, zcor
281      real zqsat(klon, llm)      real zqsat(klon, llm)
282      INTEGER i, k, iq, nsrf      INTEGER i, k, iq, nsrf
283      REAL zphi(klon, llm)      REAL zphi(klon, llm)
# Line 334  contains Line 332  contains
332      real rain_lsc(klon)      real rain_lsc(klon)
333      REAL snow_con(klon) ! neige (mm / s)      REAL snow_con(klon) ! neige (mm / s)
334      real snow_lsc(klon)      real snow_lsc(klon)
     REAL d_ts(klon, nbsrf) ! variation of ftsol  
335    
336      REAL d_u_vdf(klon, llm), d_v_vdf(klon, llm)      REAL d_u_vdf(klon, llm), d_v_vdf(klon, llm)
337      REAL d_t_vdf(klon, llm), d_q_vdf(klon, llm)      REAL d_t_vdf(klon, llm), d_q_vdf(klon, llm)
# Line 348  contains Line 345  contains
345      real ratqss(klon, llm), ratqsc(klon, llm)      real ratqss(klon, llm), ratqsc(klon, llm)
346      real:: ratqsbas = 0.01, ratqshaut = 0.3      real:: ratqsbas = 0.01, ratqshaut = 0.3
347    
348      ! Parametres lies au nouveau schema de nuages (SB, PDF)      ! Param\`etres li\'es au nouveau sch\'ema de nuages :
349      real:: fact_cldcon = 0.375      real:: fact_cldcon = 0.375
350      real:: facttemps = 1.e-4      real:: facttemps = 1.e-4
     logical:: ok_newmicro = .true.  
351      real facteur      real facteur
352    
353      integer:: iflag_cldcon = 1      integer:: iflag_cldcon = 1
# Line 405  contains Line 401  contains
401    
402      integer, save:: ncid_startphy      integer, save:: ncid_startphy
403    
404      namelist /physiq_nml/ fact_cldcon, facttemps, ok_newmicro, iflag_cldcon, &      namelist /physiq_nml/ fact_cldcon, facttemps, iflag_cldcon, ratqsbas, &
405           ratqsbas, ratqshaut, ok_ade, bl95_b0, bl95_b1, iflag_thermals, &           ratqshaut, ok_ade, bl95_b0, bl95_b1
          nsplit_thermals  
406    
407      !----------------------------------------------------------------      !----------------------------------------------------------------
408    
# Line 435  contains Line 430  contains
430         pblt =0.         pblt =0.
431         therm =0.         therm =0.
432    
        iflag_thermals = 0  
        nsplit_thermals = 1  
433         print *, "Enter namelist 'physiq_nml'."         print *, "Enter namelist 'physiq_nml'."
434         read(unit=*, nml=physiq_nml)         read(unit=*, nml=physiq_nml)
435         write(unit_nml, nml=physiq_nml)         write(unit_nml, nml=physiq_nml)
436    
437           call ctherm
438         call conf_phys         call conf_phys
439    
440         ! Initialiser les compteurs:         ! Initialiser les compteurs:
# Line 472  contains Line 466  contains
466         ENDIF         ENDIF
467    
468         ! Initialisation des sorties         ! Initialisation des sorties
469         call ini_histins(ok_newmicro)         call ini_histins
470         CALL phyredem0         CALL phyredem0
471         call conf_interface         call conf_interface
472      ENDIF test_firstcal      ENDIF test_firstcal
# Line 545  contains Line 539  contains
539      CALL pbl_surface(pctsrf, t_seri, q_seri, u_seri, v_seri, julien, mu0, &      CALL pbl_surface(pctsrf, t_seri, q_seri, u_seri, v_seri, julien, mu0, &
540           ftsol, cdmmax, cdhmax, ftsoil, qsol, paprs, play, fsnow, fqsurf, &           ftsol, cdmmax, cdhmax, ftsoil, qsol, paprs, play, fsnow, fqsurf, &
541           falbe, fluxlat, rain_fall, snow_fall, frugs, agesno, rugoro, d_t_vdf, &           falbe, fluxlat, rain_fall, snow_fall, frugs, agesno, rugoro, d_t_vdf, &
542           d_q_vdf, d_u_vdf, d_v_vdf, d_ts, flux_t, flux_q, flux_u, flux_v, &           d_q_vdf, d_u_vdf, d_v_vdf, flux_t, flux_q, flux_u, flux_v, cdragh, &
543           cdragh, cdragm, q2, dflux_t, dflux_q, coefh, t2m, q2m, u10m_srf, &           cdragm, q2, dflux_t, dflux_q, coefh, t2m, q2m, u10m_srf, v10m_srf, &
544           v10m_srf, pblh, capCL, oliqCL, cteiCL, pblT, therm, plcl, fqcalving, &           pblh, capCL, oliqCL, cteiCL, pblT, therm, plcl, fqcalving, ffonte, &
545           ffonte, run_off_lic_0, albsol, sollw, solsw, tsol)           run_off_lic_0, albsol, sollw, solsw, tsol)
546    
547      ! Incr\'ementation des flux      ! Incr\'ementation des flux
548    
# Line 566  contains Line 560  contains
560      ENDDO      ENDDO
561    
562      call assert(abs(sum(pctsrf, dim = 2) - 1.) <= EPSFRA, 'physiq: pctsrf')      call assert(abs(sum(pctsrf, dim = 2) - 1.) <= EPSFRA, 'physiq: pctsrf')
     ftsol = ftsol + d_ts ! update surface temperature  
563      tsol = sum(ftsol * pctsrf, dim = 2)      tsol = sum(ftsol * pctsrf, dim = 2)
564      zxfluxlat = sum(fluxlat * pctsrf, dim = 2)      zxfluxlat = sum(fluxlat * pctsrf, dim = 2)
565      zt2m = sum(t2m * pctsrf, dim = 2)      zt2m = sum(t2m * pctsrf, dim = 2)
# Line 656  contains Line 649  contains
649         z_factor = (z_avant - (rain_con + snow_con) * dtphys) / z_apres         z_factor = (z_avant - (rain_con + snow_con) * dtphys) / z_apres
650         DO k = 1, llm         DO k = 1, llm
651            DO i = 1, klon            DO i = 1, klon
652               IF (z_factor(i) > 1. + 1E-8 .OR. z_factor(i) < 1. - 1E-8) THEN               IF (z_factor(i) /= 1.) THEN
653                  q_seri(i, k) = q_seri(i, k) * z_factor(i)                  q_seri(i, k) = q_seri(i, k) * z_factor(i)
654               ENDIF               ENDIF
655            ENDDO            ENDDO
# Line 672  contains Line 665  contains
665      fm_therm = 0.      fm_therm = 0.
666      entr_therm = 0.      entr_therm = 0.
667    
668      if (iflag_thermals == 0) then      if (iflag_thermals) then
669           call calltherm(play, paprs, pphi, u_seri, v_seri, t_seri, q_seri, &
670                d_u_ajs, d_v_ajs, d_t_ajs, d_q_ajs, fm_therm, entr_therm)
671        else
672         CALL ajsec(paprs, play, t_seri, q_seri, d_t_ajs, d_q_ajs)         CALL ajsec(paprs, play, t_seri, q_seri, d_t_ajs, d_q_ajs)
673         t_seri = t_seri + d_t_ajs         t_seri = t_seri + d_t_ajs
674         q_seri = q_seri + d_q_ajs         q_seri = q_seri + d_q_ajs
     else  
        call calltherm(play, paprs, pphi, u_seri, v_seri, t_seri, q_seri, &  
             d_u_ajs, d_v_ajs, d_t_ajs, d_q_ajs, fm_therm, entr_therm)  
675      endif      endif
676    
677      ! Caclul des ratqs      ! Caclul des ratqs
# Line 731  contains Line 724  contains
724            q_seri(i, k) = q_seri(i, k) + d_q_lsc(i, k)            q_seri(i, k) = q_seri(i, k) + d_q_lsc(i, k)
725            ql_seri(i, k) = ql_seri(i, k) + d_ql_lsc(i, k)            ql_seri(i, k) = ql_seri(i, k) + d_ql_lsc(i, k)
726            cldfra(i, k) = rneb(i, k)            cldfra(i, k) = rneb(i, k)
           IF (.NOT.new_oliq) cldliq(i, k) = ql_seri(i, k)  
727         ENDDO         ENDDO
728      ENDDO      ENDDO
729    
# Line 788  contains Line 780  contains
780         cldliq = cldliq + rnebcon * clwcon         cldliq = cldliq + rnebcon * clwcon
781      ENDIF      ENDIF
782    
     ! 2. Nuages stratiformes  
   
     IF (ok_stratus) THEN  
        CALL diagcld2(paprs, play, t_seri, q_seri, diafra, dialiq)  
        DO k = 1, llm  
           DO i = 1, klon  
              IF (diafra(i, k) > cldfra(i, k)) THEN  
                 cldliq(i, k) = dialiq(i, k)  
                 cldfra(i, k) = diafra(i, k)  
              ENDIF  
           ENDDO  
        ENDDO  
     ENDIF  
   
783      ! Precipitation totale      ! Precipitation totale
784      DO i = 1, klon      DO i = 1, klon
785         rain_fall(i) = rain_con(i) + rain_lsc(i)         rain_fall(i) = rain_con(i) + rain_lsc(i)
# Line 811  contains Line 789  contains
789      ! Humidit\'e relative pour diagnostic :      ! Humidit\'e relative pour diagnostic :
790      DO k = 1, llm      DO k = 1, llm
791         DO i = 1, klon         DO i = 1, klon
792            zx_t = t_seri(i, k)            zx_qs = r2es * FOEEW(t_seri(i, k), rtt >= t_seri(i, k)) / play(i, k)
           zx_qs = r2es * FOEEW(zx_t, rtt >= zx_t) / play(i, k)  
793            zx_qs = MIN(0.5, zx_qs)            zx_qs = MIN(0.5, zx_qs)
794            zcor = 1. / (1. - retv * zx_qs)            zcor = 1. / (1. - retv * zx_qs)
795            zx_qs = zx_qs * zcor            zx_qs = zx_qs * zcor
# Line 823  contains Line 800  contains
800    
801      ! Param\`etres optiques des nuages et quelques param\`etres pour      ! Param\`etres optiques des nuages et quelques param\`etres pour
802      ! diagnostics :      ! diagnostics :
803      if (ok_newmicro) then      CALL newmicro(paprs, play, t_seri, cldliq, cldfra, cldtau, cldemi, cldh, &
804         CALL newmicro(paprs, play, t_seri, cldliq, cldfra, cldtau, cldemi, &           cldl, cldm, cldt, cldq, flwp, fiwp, flwc, fiwc)
             cldh, cldl, cldm, cldt, cldq, flwp, fiwp, flwc, fiwc)  
     else  
        CALL nuage(paprs, play, t_seri, cldliq, cldfra, cldtau, cldemi, cldh, &  
             cldl, cldm, cldt, cldq)  
     endif  
805    
806      IF (MOD(itap - 1, radpas) == 0) THEN      IF (MOD(itap - 1, radpas) == 0) THEN
807         wo = ozonecm(REAL(julien), paprs)         wo = ozonecm(REAL(julien), paprs)
# Line 849  contains Line 821  contains
821         ENDDO         ENDDO
822      ENDDO      ENDDO
823    
     ! Calculer le bilan du sol et la d\'erive de temp\'erature (couplage)  
     DO i = 1, klon  
        bils(i) = radsol(i) + sens(i) + zxfluxlat(i)  
     ENDDO  
   
824      ! Param\'etrisation de l'orographie \`a l'\'echelle sous-maille :      ! Param\'etrisation de l'orographie \`a l'\'echelle sous-maille :
825    
826      IF (ok_orodr) THEN      IF (ok_orodr) THEN
# Line 917  contains Line 884  contains
884    
885      ! diag. bilKP      ! diag. bilKP
886    
887      CALL transp_lay(paprs, t_seri, q_seri, u_seri, v_seri, zphi, &      CALL transp_lay(paprs, t_seri, q_seri, u_seri, v_seri, zphi, ve_lay, &
888           ve_lay, vq_lay, ue_lay, uq_lay)           vq_lay, ue_lay, uq_lay)
889    
890      ! Accumuler les variables a stocker dans les fichiers histoire:      ! Accumuler les variables a stocker dans les fichiers histoire:
891    
# Line 989  contains Line 956  contains
956      CALL histwrite_phy("sols", solsw)      CALL histwrite_phy("sols", solsw)
957      CALL histwrite_phy("rls", sollw)      CALL histwrite_phy("rls", sollw)
958      CALL histwrite_phy("solldown", sollwdown)      CALL histwrite_phy("solldown", sollwdown)
959      CALL histwrite_phy("bils", bils)      CALL histwrite_phy("bils", radsol + sens + zxfluxlat)
960      CALL histwrite_phy("sens", sens)      CALL histwrite_phy("sens", sens)
961      CALL histwrite_phy("fder", fder)      CALL histwrite_phy("fder", fder)
     CALL histwrite_phy("dtsvdfo", d_ts(:, is_oce))  
     CALL histwrite_phy("dtsvdft", d_ts(:, is_ter))  
     CALL histwrite_phy("dtsvdfg", d_ts(:, is_lic))  
     CALL histwrite_phy("dtsvdfi", d_ts(:, is_sic))  
962      CALL histwrite_phy("zxfqcalving", sum(fqcalving * pctsrf, dim = 2))      CALL histwrite_phy("zxfqcalving", sum(fqcalving * pctsrf, dim = 2))
963      CALL histwrite_phy("albs", albsol)      CALL histwrite_phy("albs", albsol)
964      CALL histwrite_phy("tro3", wo * dobson_u * 1e3 / zmasse / rmo3 * md)      CALL histwrite_phy("tro3", wo * dobson_u * 1e3 / zmasse / rmo3 * md)
# Line 1018  contains Line 981  contains
981      CALL histwrite_phy("d_t_ec", d_t_ec)      CALL histwrite_phy("d_t_ec", d_t_ec)
982      CALL histwrite_phy("dtsw0", heat0 / 86400.)      CALL histwrite_phy("dtsw0", heat0 / 86400.)
983      CALL histwrite_phy("dtlw0", - cool0 / 86400.)      CALL histwrite_phy("dtlw0", - cool0 / 86400.)
984        call histwrite_phy("pmflxr", pmflxr(:, :llm))
985      CALL histwrite_phy("msnow", sum(fsnow * pctsrf, dim = 2))      CALL histwrite_phy("msnow", sum(fsnow * pctsrf, dim = 2))
986      call histwrite_phy("qsurf", sum(fqsurf * pctsrf, dim = 2))      call histwrite_phy("qsurf", sum(fqsurf * pctsrf, dim = 2))
987      call histwrite_phy("flat", zxfluxlat)      call histwrite_phy("flat", zxfluxlat)

Legend:
Removed from v.322  
changed lines
  Added in v.340

  ViewVC Help
Powered by ViewVC 1.1.21