Ignore:
Timestamp:
Mar 18, 2016, 12:09:23 PM (9 years ago)
Author:
Laurent Fairhead
Message:

Merged trunk changes r2434:2457 into testing branch

Location:
LMDZ5/branches/testing
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/branches/testing

  • LMDZ5/branches/testing/libf/phylmd/cdrag.F90

    r2408 r2471  
    114114  LOGICAL, PARAMETER    :: zxli=.FALSE. ! calcul des cdrags selon Laurent Li
    115115  REAL, DIMENSION(klon) :: zcdn_m, zcdn_h         ! Drag coefficient in neutral conditions
     116  REAL zzzcd
    116117!
    117118! Fonctions thermodynamiques et fonctions d'instabilite
     
    176177
    177178
    178 ! Coefficients CD neutres pour m et h
    179      zcdn_m(i) = (CKAP/LOG(1.+zgeop1(i)/(RG*z0m(i))))**2
    180      zcdn_h(i) = (CKAP/LOG(1.+zgeop1(i)/(RG*z0h(i))))**2
     179! Coefficients CD neutres pour m et h : k^2/ln(z/z0) et k^2/(ln(z/z0)*ln(z/z0h))
     180     zzzcd=CKAP/LOG(1.+zgeop1(i)/(RG*z0m(i)))
     181     zcdn_m(i) = zzzcd*zzzcd
     182     zcdn_h(i) = zzzcd*(CKAP/LOG(1.+zgeop1(i)/(RG*z0m(i))))
    181183
    182184     IF (zri(i) .GT. 0.) THEN      ! situation stable
  • LMDZ5/branches/testing/libf/phylmd/compbl.h

    r2187 r2471  
    22      ! $Header$
    33      !
    4 !jyg+nrlmd<
    5 !!!      integer iflag_pbl
    6 !!!      common/compbl/iflag_pbl
    7       integer iflag_pbl,iflag_pbl_split
    8       common/compbl/iflag_pbl,iflag_pbl_split
    9 !>jyg+nrlmd
     4!jyg+al1<
     5!!      integer iflag_pbl,iflag_pbl_split
     6!!      common/compbl/iflag_pbl,iflag_pbl_split
     7      integer iflag_pbl, iflag_pbl_split, iflag_order2_sollw
     8      common/compbl/iflag_pbl, iflag_pbl_split, iflag_order2_sollw
     9!>jyg+al1
    1010!$OMP THREADPRIVATE(/compbl/)
  • LMDZ5/branches/testing/libf/phylmd/conf_phys_m.F90

    r2435 r2471  
    179179    INTEGER,SAVE :: iflag_pbl_omp,lev_histhf_omp,lev_histday_omp,lev_histmth_omp
    180180    INTEGER,SAVE :: iflag_pbl_split_omp
     181    INTEGER,SAVE :: iflag_order2_sollw_omp
    181182    Integer, save :: lev_histins_omp, lev_histLES_omp
    182183    INTEGER, SAVE :: lev_histdayNMC_omp
     
    12871288    call getin('iflag_pbl_split',iflag_pbl_split_omp)
    12881289    !
     1290    !Config Key  = iflag_order2_sollw
     1291    !Config Desc =
     1292    !Config Def  = 0
     1293    !Config Help =
     1294    !
     1295    iflag_order2_sollw_omp = 0
     1296    call getin('iflag_order2_sollw',iflag_order2_sollw_omp)
     1297    !
    12891298    !Config Key  = iflag_thermals
    12901299    !Config Desc =
     
    17031712    f_gust_wk_omp = 0.
    17041713    call getin('f_gust_wk',f_gust_wk_omp)
     1714    !
     1715    !Config Key  = iflag_z0_oce
     1716    !Config Desc = 0 (z0h=z0m), 1 (diff. equ. for z0h and z0m), -1 (z0m=z0h=z0min)
     1717    !Config Def  = 0   ! z0h = z0m
     1718    !Config Help =
    17051719    !
    17061720    iflag_z0_oce_omp=0
     
    20252039    iflag_pbl = iflag_pbl_omp
    20262040    iflag_pbl_split = iflag_pbl_split_omp
     2041    iflag_order2_sollw = iflag_order2_sollw_omp
    20272042    lev_histhf = lev_histhf_omp
    20282043    lev_histday = lev_histday_omp
     
    22242239       END IF
    22252240    END IF
     2241
     2242    ! Flag_aerosol cannot be to zero if we are in coupled mode for aerosol
     2243    IF (aerosol_couple .AND. flag_aerosol .eq. 0 ) THEN
     2244       CALL abort_physic('conf_phys', 'flag_aerosol cannot be to zero if aerosol_couple=y ', 1)
     2245    ENDIF
     2246
     2247    ! flag_aerosol need to be different to zero if ok_cdnc is activated
     2248    IF (ok_cdnc .AND. flag_aerosol .eq. 0) THEN
     2249       CALL abort_physic('conf_phys', 'flag_aerosol cannot be to zero if ok_cdnc is activated ', 1)
     2250    ENDIF
    22262251
    22272252    ! ok_cdnc must be set to y if ok_aie is activated
     
    23472372    write(lunout,*)' iflag_pbl = ', iflag_pbl
    23482373    write(lunout,*)' iflag_pbl_split = ', iflag_pbl_split
     2374    write(lunout,*)' iflag_order2_sollw = ', iflag_order2_sollw
    23492375    write(lunout,*)' iflag_thermals = ', iflag_thermals
    23502376    write(lunout,*)' iflag_thermals_ed = ', iflag_thermals_ed
  • LMDZ5/branches/testing/libf/phylmd/cosp/cosp_output_mod.F90

    r2435 r2471  
    1616      INTEGER, DIMENSION(3), SAVE  :: cosp_nidfiles
    1717!$OMP THREADPRIVATE(cosp_outfilekeys, cosp_nidfiles)
    18       INTEGER, DIMENSION(3), SAVE  :: nhoricosp,nvert,nvertmcosp,nvertcol,nvertisccp,nvertp,nverttemp,nvertmisr
     18      INTEGER, DIMENSION(3), SAVE  :: nhoricosp,nvert,nvertmcosp,nvertcol,nvertbze, &
     19                                      nvertsratio,nvertisccp,nvertp,nverttemp,nvertmisr
    1920      REAL, DIMENSION(3), SAVE                :: zoutm_cosp
    20 !$OMP THREADPRIVATE(nhoricosp, nvert, nvertmcosp, nvertcol, nvertisccp, nvertp, zoutm_cosp, nverttemp, nvertmisr)
     21!$OMP THREADPRIVATE(nhoricosp, nvert,nvertmcosp,nvertcol,nvertsratio,nvertbze,nvertisccp,nvertp,zoutm_cosp,nverttemp,nvertmisr)
    2122      REAL, SAVE                   :: zdtimemoy_cosp
    2223!$OMP THREADPRIVATE(zdtimemoy_cosp)
     
    107108  TYPE(ctrl_outcosp), SAVE :: o_clcalipso2 = ctrl_outcosp((/ .TRUE., .TRUE., .TRUE. /), &
    108109         "clcalipso2", "CALIPSO Cloud Fraction Undetected by CloudSat", "1", (/ ('', i=1, 3) /))
    109 
     110  TYPE(ctrl_outcosp), SAVE :: o_cltlidarradar = ctrl_outcosp((/ .TRUE., .TRUE.,.TRUE. /), &         
     111         "cltlidarradar", "Lidar and Radar Total Cloud Fraction", "%", (/ ('', i=1, 3) /))
     112     
    110113! ISCCP vars
    111114  TYPE(ctrl_outcosp), SAVE :: o_sunlit = ctrl_outcosp((/ .TRUE., .TRUE., .TRUE. /), &
     
    220223
    221224!!! Variables locales
    222   integer                  :: idayref, iff, ii
    223   real                     :: zjulian,zjulian_start
    224   real,dimension(Ncolumns) :: column_ax
     225  integer                   :: idayref, iff, ii
     226  real                      :: zjulian,zjulian_start
     227  real,dimension(Ncolumns)  :: column_ax
     228  real,dimension(2,SR_BINS) :: sratio_bounds
     229  real,dimension(SR_BINS)   ::  sratio_ax
    225230  CHARACTER(LEN=20), DIMENSION(3)  :: chfreq = (/ '1day', '1d', '3h' /)           
    226231
     
    239244    ! Initialisations (Valeurs par defaut)
    240245
     246!! Definition valeurs axes
    241247    do ii=1,Ncolumns
    242248      column_ax(ii) = real(ii)
    243249    enddo
    244250
     251!    do ii=1,DBZE_BINS
     252!     dbze_ax(i) = CFAD_ZE_MIN + CFAD_ZE_WIDTH*(ii - 0.5)
     253!    enddo
     254
     255!   sratio_bounds(2,:)=stlidar%srbval(:) ! srbval contains the upper
     256!                                         limits from lmd_ipsl_stats.f90
     257!   sratio_bounds(1,2:SR_BINS) = stlidar%srbval(1:SR_BINS-1)
     258!   sratio_bounds(1,1)         = 0.0
     259!   sratio_bounds(2,SR_BINS)   = 1.e5 ! This matches with Chepfer et al., JGR,
     260!                                    ! 2009. However, it is not consistent
     261                                     ! with the upper limit in
     262                                     ! lmd_ipsl_stats.f90, which is
     263                                     ! LIDAR_UNDEF-1=998.999
     264!    sratio_ax(:) = (sratio_bounds(1,:)+sratio_bounds(2,:))/2.0
    245265
    246266    cosp_outfilenames(1) = 'histmthCOSP'
     
    303323   CALL wxios_add_vaxis("temp", LIDAR_NTEMP, LIDAR_PHASE_TEMP)
    304324   CALL wxios_add_vaxis("cth16", MISR_N_CTH, MISR_CTH)
     325!   CALL wxios_add_vaxis("dbze", DBZE_BINS, dbze_ax)
     326!   CALL wxios_add_vaxis("scatratio", SR_BINS, sratio_ax)
    305327#endif
    306328   
     
    343365      CALL histvert(cosp_nidfiles(iff),"temp","temperature","C",LIDAR_NTEMP,LIDAR_PHASE_TEMP,nverttemp(iff))                                       
    344366      CALL histvert(cosp_nidfiles(iff),"cth16","altitude","m",MISR_N_CTH,MISR_CTH,nvertmisr(iff))                                                                                                 
     367!      CALL histvert(cosp_nidfiles(iff),"dbze","equivalent_reflectivity_factor","dBZ",DBZE_BINS,dbze_ax,nvertbze(iff))
     368     
     369!      CALL histvert(cosp_nidfiles(iff),"scatratio","backscattering_ratio","1",SR_BINS,sratio_ax,nvertsratio(iff))
     370     
    345371!!! Valeur indefinie en cas IOIPSL
    346372     Cosp_fill_value=0.
  • LMDZ5/branches/testing/libf/phylmd/cosp/cosp_output_write_mod.F90

    r2435 r2471  
    209209                           stradar%lidar_only_freq_cloud = 0.0
    210210   CALL histwrite3d_cosp(o_clcalipso2,stradar%lidar_only_freq_cloud,nvert)
     211   where(stradar%radar_lidar_tcc == R_UNDEF) &
     212                           stradar%radar_lidar_tcc = 0.0
     213   CALL histwrite2d_cosp(o_cltlidarradar,stradar%radar_lidar_tcc)
    211214 endif
    212215
  • LMDZ5/branches/testing/libf/phylmd/dyn1d/1DUTILS.h

    r2408 r2471  
    43444344!
    43454345   INTEGER k,i
    4346    REAL zx_qs, rh, tnew, d_rh
     4346   REAL zx_qs, rh, tnew, d_rh, rhnew
    43474347
    43484348! Declaration des constantes et des fonctions thermodynamiques
     
    43614361        print *,'temp ',t
    43624362        print *,'hum ',q
     4363!
    43634364        DO k = 1,klev
    43644365         DO i = 1,klon
    4365 !!           IF (paprs(i,1)-pplay(i,k) .GT. 10000.) THEN
     4366           IF (paprs(i,1)-pplay(i,k) .GT. 10000.) THEN
    43664367            IF (t(i,k).LT.RTT) THEN
    43674368               zx_qs = qsats(t(i,k))/(pplay(i,k))
     
    43744375            d_rh = 1./tau*(rh_targ(i,k)-rh)
    43754376!
    4376             tnew = t(i,k)+d_t(i,k)
     4377            tnew = t(i,k)+d_t(i,k)*dtime
     4378!jyg<
     4379!   Formule pour q :
     4380!                         d_q = (1/tau) [rh_targ*qsat(T_new) - q]
     4381!
     4382!  Cette formule remplace d_q = (1/tau) [rh_targ - rh] qsat(T_new)
     4383!   qui n'était pas correcte.
     4384!
    43774385            IF (tnew.LT.RTT) THEN
    43784386               zx_qs = qsats(tnew)/(pplay(i,k))
     
    43804388               zx_qs = qsatl(tnew)/(pplay(i,k))
    43814389            ENDIF
    4382             d_q(i,k) = d_q(i,k) + d_rh*zx_qs
    4383 !
    4384             print *,' k,d_t,rh,d_rh,d_q ',    &
    4385                       k,d_t(i,k),rh,d_rh,d_q(i,k)
    4386 !!           ENDIF
     4390!!            d_q(i,k) = d_q(i,k) + d_rh*zx_qs
     4391            d_q(i,k) = d_q(i,k) + (1./tau)*(rh_targ(i,k)*zx_qs - q(i,k))
     4392            rhnew = (q(i,k)+d_q(i,k)*dtime)/zx_qs
     4393!
     4394            print *,' k,d_t,rh,d_rh,rhnew,d_q ',    &
     4395                      k,d_t(i,k),rh,d_rh,rhnew,d_q(i,k)
     4396           ENDIF
    43874397!
    43884398         ENDDO
  • LMDZ5/branches/testing/libf/phylmd/dyn1d/lmdz1d.F90

    r2435 r2471  
    932932!   Call physiq :
    933933!---------------------------------------------------------------------
    934 
    935934       call physiq(ngrid,llm, &
    936             firstcall,lastcall,timestep, &
    937             plev,play,phi,phis,presnivs, &
    938             u,v, rot, temp,q,omega2, &
    939             du_phys,dv_phys,dt_phys,dq,dpsrf)
    940         firstcall=.false.
     935                    firstcall,lastcall,timestep, &
     936                    plev,play,phi,phis,presnivs, &
     937                    u,v, rot, temp,q,omega2, &
     938                    du_phys,dv_phys,dt_phys,dq,dpsrf)
     939                firstcall=.false.
    941940
    942941!---------------------------------------------------------------------
  • LMDZ5/branches/testing/libf/phylmd/ini_paramLMDZ_phy.h

    r2435 r2471  
    1010!
    1111       zstophy = pdtphys
    12        zout = mth_len*un_jour
     12       zout = -1
    1313!
    1414       idayref = day_ref
     
    3333                      "Excentricite","-", &
    3434                      1,1,nhori, 1,1,1, -99, 32, &
    35                       "ave", zstophy,zout)
     35                      "ave(X)", zstophy,zout)
    3636!
    3737       CALL histdef(nid_ctesGCM, "R_peri",  &
    3838                      "Equinoxe","-", &
    3939                      1,1,nhori, 1,1,1, -99, 32, &
    40                       "ave", zstophy,zout)
     40                      "ave(X)", zstophy,zout)
    4141!
    4242       CALL histdef(nid_ctesGCM, "R_incl",  &
    4343                      "Inclinaison","deg", &
    4444                      1,1,nhori, 1,1,1, -99, 32, &
    45                       "ave", zstophy,zout)
     45                      "ave(X)", zstophy,zout)
    4646!
    4747       CALL histdef(nid_ctesGCM, "solaire",  &
    4848                      "Constante solaire","W/m2", &
    4949                      1,1,nhori, 1,1,1, -99, 32, &
    50                       "ave", zstophy,zout)
     50                      "ave(X)", zstophy,zout)
    5151!
    5252       CALL histdef(nid_ctesGCM, "co2_ppm",  &
     
    7575                      "ave(X)", zstophy,zout)
    7676!
    77        CALL histdef(nid_ctesGCM, "bils", &
    78                       "Surface total heat flux", "W m-2", &
    79                       1,1,nhori, 1,1,1, -99, 32, &
    80                       "ave", zstophy,zout)
    81 !
    82        CALL histdef(nid_ctesGCM, "evap", &
    83                       "Evaporation", "kg m-2 s-1", &
    84                       1,1,nhori, 1,1,1, -99, 32, &
    85                       "ave", zstophy,zout)
    86 !
    87        CALL histdef(nid_ctesGCM, "evap_land", &
    88                       "Land evaporation", "kg m-2 s-1", &
    89                       1,1,nhori, 1,1,1, -99, 32, &
    90                       "ave", zstophy,zout)
    91 !
    92        CALL histdef(nid_ctesGCM, "flat", &
    93                       "Latent heat flux", "W m-2", &
    94                       1,1,nhori, 1,1,1, -99, 32, &
    95                       "ave", zstophy,zout)
    96 !
    97        CALL histdef(nid_ctesGCM, "nettop0", &
    98                       "Clear sky net downward radiatif flux at TOA",  &
    99                       "W m-2", &
    100                       1,1,nhori, 1,1,1, -99, 32, &
    101                       "ave", zstophy,zout)
    102 !
    103        CALL histdef(nid_ctesGCM, "nettop", &
    104                       "Net downward radiatif flux at TOA", "W m-2", &
    105                       1,1,nhori, 1,1,1, -99, 32, &
    106                       "ave", zstophy,zout)
    107 !
    108        CALL histdef(nid_ctesGCM, "precip", &
    109                       "Total precipitation (liq+sol)", "kg m-2 s-1", &
    110                       1,1,nhori, 1,1,1, -99, 32, &
    111                       "ave", zstophy,zout)
    112 !
    113        CALL histdef(nid_ctesGCM, "tsol", &
    114                       "Surface temperature", "K", &
    115                       1,1,nhori, 1,1,1, -99, 32, &
    116                       "ave", zstophy,zout)
    117 !
    118        CALL histdef(nid_ctesGCM, "t2m", &
    119                       "Temperature at 2m", "K", &
    120                       1,1,nhori, 1,1,1, -99, 32, &
    121                       "ave", zstophy,zout)
    122 !
    123        CALL histdef(nid_ctesGCM, "prw", &
    124                       "Precipitable water", "kg m-2", &
    125                       1,1,nhori, 1,1,1, -99, 32, &
    126                       "ave", zstophy,zout)
    12777!=================================================================
    12878!
  • LMDZ5/branches/testing/libf/phylmd/pbl_surface_mod.F90

    r2435 r2471  
    305305
    306306!!! nrlmd+jyg le 02/05/2011 et le 20/02/2012
    307 !!    REAL, DIMENSION(klon,klev),   INTENT(IN)        :: t_x       ! Température hors poche froide
    308 !!    REAL, DIMENSION(klon,klev),   INTENT(IN)        :: t_w       ! Température dans la poches froide
     307!!    REAL, DIMENSION(klon,klev),   INTENT(IN)        :: t_x       ! Temp\'erature hors poche froide
     308!!    REAL, DIMENSION(klon,klev),   INTENT(IN)        :: t_w       ! Temp\'erature dans la poches froide
    309309!!    REAL, DIMENSION(klon,klev),   INTENT(IN)        :: q_x       !
    310 !!    REAL, DIMENSION(klon,klev),   INTENT(IN)        :: q_w       ! Pareil pour l'humidité
     310!!    REAL, DIMENSION(klon,klev),   INTENT(IN)        :: q_w       ! Pareil pour l'humidit\'e
    311311    REAL, DIMENSION(klon,klev),   INTENT(IN)        :: wake_dlt  !temperature difference between (w) and (x) (K)
    312312    REAL, DIMENSION(klon,klev),   INTENT(IN)        :: wake_dlq  !humidity difference between (w) and (x) (K)
     
    522522!albedo SB <<<
    523523    REAL, DIMENSION(klon)              :: ztsol
     524    REAL, DIMENSION(klon)              :: meansqT ! mean square deviation of subsurface temperatures
    524525    REAL, DIMENSION(klon)              :: alb_m  ! mean albedo for whole SW interval
    525526    REAL, DIMENSION(klon,klev)         :: y_d_t, y_d_q, y_d_t_diss
     
    679680
    680681!!! jyg le 25/03/2013
    681 !!    Variables intermediaires pour le raccord des deux colonnes à la surface
     682!!    Variables intermediaires pour le raccord des deux colonnes \`a la surface
    682683    REAL   ::   dd_Ch
    683684    REAL   ::   dd_Cm
     
    11061107       ENDDO
    11071108    ENDDO
     1109!
     1110!<al1: second order corrections
     1111!- net = dwn -up; up=sig( T4 + 4sum%T3T' + 6sum%T2T'2 +...)
     1112   IF (iflag_order2_sollw == 1) THEN
     1113    meansqT(:) = 0. ! as working buffer
     1114    DO nsrf = 1, nbsrf
     1115     DO i = 1, klon
     1116      meansqT(i) = meansqT(i)+(ts(i,nsrf)-ztsol(i))**2 *pctsrf(i,nsrf)
     1117     END DO
     1118    END DO
     1119    DO nsrf = 1, nbsrf
     1120     DO i = 1, klon
     1121      sollw(i,nsrf) = sollw(i,nsrf) &
     1122                + 6.0*RSIGMA*ztsol(i)**2 *(meansqT(i)-(ztsol(i)-ts(i,nsrf))**2)
     1123     ENDDO
     1124    ENDDO
     1125   ENDIF   ! iflag_order2_sollw == 1
     1126!>al1
    11081127
    11091128!****************************************************************************************
     
    15721591
    15731592!!! nrlmd le 13/06/2011
    1574 !----- On finit le calcul des coefficients d'échange:on multiplie le cdrag par le module du vent et la densité dans la première couche
     1593!----- On finit le calcul des coefficients d'\'echange:on multiplie le cdrag par le module du vent et la densit\'e dans la premi\`ere couche
    15751594!          Kech_h_x(j) = ycdragh_x(j) * &
    15761595!             (1.0+SQRT(yu_x(j,1)**2+yv_x(j,1)**2)) * &
     
    16641683       ENDIF
    16651684!
    1666 ! Calcul des coef A, B équivalents dans la couche 1
     1685! Calcul des coef A, B \'equivalents dans la couche 1
    16671686!
    16681687       AcoefH(j) = AcoefH_x(j) + ywake_s(j)*(Kech_H_wp(j)/Kech_Hp(j))*dd_AH
     
    16841703
    16851704!
    1686 ! Calcul des cdrag équivalents dans la couche
     1705! Calcul des cdrag \'equivalents dans la couche
    16871706!
    16881707       ycdragm(j) = ycdragm_x(j) + ywake_s(j)*dd_CM
    16891708       ycdragh(j) = ycdragh_x(j) + ywake_s(j)*dd_CH
    16901709!
    1691 ! Calcul de T, q, u et v équivalents dans la couche 1
     1710! Calcul de T, q, u et v \'equivalents dans la couche 1
    16921711       yt(j,1) = yt_x(j,1) + ywake_s(j)*(Kech_h_w(j)/Kech_h(j))*dd_t
    16931712       yq(j,1) = yq_x(j,1) + ywake_s(j)*(Kech_h_w(j)/Kech_h(j))*dd_q
     
    19151934
    19161935          DO j = 1, knon
    1917             yt1_new=(1./RCPD)*(AcoefH(j)+BcoefH(j)*yfluxsens(j)*dtime)
    1918             ytsurf_new(j)=yt1_new-yfluxsens(j)/(Kech_h(j)*RCPD)
     1936            yt1_new=(1./RCPD)*(AcoefH(j)+BcoefH(j)*y_flux_t1(j)*dtime)
     1937            ytsurf_new(j)=yt1_new-y_flux_t1(j)/(Kech_h(j)*RCPD)
    19191938          ENDDO
    19201939
     
    19932012!!jyg!!         ENDIF
    19942013!!jyg!!
    1995 !!jyg!!!-----Calcul de ybeta (evap_réelle/evap_potentielle)
     2014!!jyg!!!-----Calcul de ybeta (evap_r\'eelle/evap_potentielle)
    19962015!!jyg!!!!!!! jyg le 23/02/2012
    19972016!!jyg!!!!!!!
     
    28112830       END DO
    28122831    END DO
     2832!
     2833!<al1 order 2 correction to zxtsol, for radiation computations (main atm effect of Ts)
     2834   IF (iflag_order2_sollw == 1) THEN
     2835    meansqT(:) = 0. ! as working buffer
     2836    DO nsrf = 1, nbsrf
     2837     DO i = 1, klon
     2838      meansqT(i) = meansqT(i)+(ts(i,nsrf)-zxtsol(i))**2 *pctsrf(i,nsrf)
     2839     END DO
     2840    END DO
     2841    zxtsol(:) = zxtsol(:)+1.5*meansqT(:)/zxtsol(:)
     2842   ENDIF   ! iflag_order2_sollw == 1
     2843!>al1
    28132844         
    28142845!!! jyg le 07/02/2012
  • LMDZ5/branches/testing/libf/phylmd/physiq_mod.F90

    r2435 r2471  
    451451  real w0(klon)                                          ! Vitesse des thermiques au LCL
    452452  real w_conv(klon)                                      ! Vitesse verticale de grande \'echelle au LCL
    453   real tke0(klon,klev+1)                                 ! TKE au début du pas de temps
     453  real tke0(klon,klev+1)                                 ! TKE au d\'ebut du pas de temps
    454454  real therm_tke_max0(klon)                              ! TKE dans les thermiques au LCL
    455455  real env_tke_max0(klon)                                ! TKE dans l'environnement au LCL
     
    10631063        CALL getin_p('config_inca',config_inca)
    10641064
     1065     ELSE
     1066        config_inca='none' ! default
    10651067     END IF
     1068     
     1069     IF (aerosol_couple .AND. (config_inca /= "aero" .AND. config_inca /= "aeNP ")) THEN
     1070        abort_message = 'if aerosol_couple is activated, config_inca need to be aero or aeNP'
     1071        CALL abort_physic (modname,abort_message,1)
     1072     ENDIF
     1073
     1074
    10661075
    10671076     rnebcon0(:,:) = 0.0
     
    13661375             cell_area, &
    13671376             latitude_deg, &
    1368              longitude_de, &
     1377             longitude_deg, &
    13691378             presnivs, &
    13701379             calday, &
     
    17591768        else
    17601769
    1761 !CR: on ré-évapore eau liquide et glace
     1770!CR: on r\'e-\'evapore eau liquide et glace
    17621771
    17631772!        zdelta = MAX(0.,SIGN(1.,RTT-t_seri(i,k)))
     
    17711780        q_seri(i,k) = q_seri(i,k) + zb
    17721781        ql_seri(i,k) = 0.0
    1773 !on évapore la glace
     1782!on \'evapore la glace
    17741783        qs_seri(i,k) = 0.0
    17751784        d_t_eva(i,k) = za
     
    20942103           zx_qs  = zx_qs*zcor
    20952104        ELSE
    2096            IF (zx_t.LT.t_coup) THEN
     2105!!           IF (zx_t.LT.t_coup) THEN             !jyg
     2106           IF (zx_t.LT.rtt) THEN                  !jyg
    20972107              zx_qs = qsats(zx_t)/pplay(i,k)
    20982108           ELSE
     
    25812591  !
    25822592  !!! nrlmd le 22/03/2011---Si on met les poches hors des thermiques il faut rajouter cette
    2583   !------------------------- tendance calculée hors des poches froides
     2593  !------------------------- tendance calcul\'ee hors des poches froides
    25842594  !
    25852595  if (iflag_wake>=1) then
     
    26452655           DO i=1,klon
    26462656              IF (rneb(i,k)==0.) THEN
    2647 ! On ne tient compte des tendances qu'en dehors des nuages (c'est ï¿½|  dire
     2657! On ne tient compte des tendances qu'en dehors des nuages (c'est-\`a-dire
    26482658! a priri dans une region ou l'eau se reevapore).
    26492659                dt_dwn(i,k)= dt_dwn(i,k)+ &
     
    27962806         IF (mod(iflag_pbl_split/2,2) .EQ. 1) THEN
    27972807!  Si les thermiques ne sont presents que hors des poches, la tendance moyenne
    2798 !  associée doit etre multipliee par la fraction surfacique qu'ils couvrent.
     2808!  associ\'ee doit etre multipliee par la fraction surfacique qu'ils couvrent.
    27992809          DO k=1,klev
    28002810           DO i=1,klon
     
    33623372        zx_t = t_seri(i,k)
    33633373        IF (thermcep) THEN
    3364            if (iflag_ice_thermo.eq.0) then
     3374!!           if (iflag_ice_thermo.eq.0) then                 !jyg
    33653375           zdelta = MAX(0.,SIGN(1.,rtt-zx_t))
    3366            else
    3367            zdelta = MAX(0.,SIGN(1.,t_glace_min-zx_t))
    3368            endif
     3376!!           else                                            !jyg
     3377!!           zdelta = MAX(0.,SIGN(1.,t_glace_min-zx_t))      !jyg
     3378!!           endif                                           !jyg
    33693379           zx_qs  = r2es * FOEEW(zx_t,zdelta)/pplay(i,k)
    33703380           zx_qs  = MIN(0.5,zx_qs)
     
    33723382           zx_qs  = zx_qs*zcor
    33733383        ELSE
    3374            IF (zx_t.LT.t_coup) THEN
     3384!!           IF (zx_t.LT.t_coup) THEN             !jyg
     3385           IF (zx_t.LT.rtt) THEN                  !jyg
    33753386              zx_qs = qsats(zx_t)/pplay(i,k)
    33763387           ELSE
  • LMDZ5/branches/testing/libf/phylmd/regr_lat_time_climoz_m.F90

    r2408 r2471  
    6767
    6868    use mod_grid_phy_lmdz, ONLY : nbp_lat
    69     use regr1_step_av_m, only: regr1_step_av
     69    use regr1_conserv_m, only: regr1_conserv
    7070    use regr3_lint_m, only: regr3_lint
    7171    use netcdf95, only: handle_err, nf95_close, nf95_get_att, nf95_gw_var, &
     
    7676    use regular_lonlat_mod, only : boundslat_reg, south
    7777    use nrtype, only: pi
     78    use slopes_m, only: slopes
    7879
    7980    integer, intent(in):: read_climoz ! read ozone climatology
     
    9293    ! (of input data, converted to rad, sorted in strictly ascending order)
    9394
    94     real, allocatable:: lat_in_edg(:)
    95     ! (edges of latitude intervals for input data, in rad, in strictly
     95    real, allocatable:: sin_lat_in_edg(:)
     96    ! (sine of edges of latitude intervals for input data, in rad, in strictly
    9697    ! ascending order)
    9798
     
    115116
    116117    real, allocatable:: o3_regr_lat(:, :, :, :)
    117     ! (jjm + 1, n_plev, 0:13, read_climoz)
     118    ! (nbp_lat, n_plev, 0:13, read_climoz)
    118119    ! mean of "o3_in" over a latitude interval of LMDZ
    119120    ! First dimension is latitude interval.
    120121    ! The latitude interval for "o3_regr_lat(j,:, :, :)" contains "rlatu(j)".
    121     ! If "j" is between 2 and "jjm" then the interval is:
     122    ! If "j" is between 2 and "nbp_lat - 1" then the interval is:
    122123    ! [rlatv(j), rlatv(j-1)]
    123     ! If "j" is 1 or "jjm + 1" then the interval is:
     124    ! If "j" is 1 or "nbp_lat" then the interval is:
    124125    ! [rlatv(1), pi / 2]
    125126    ! or:
    126     ! [- pi / 2, rlatv(jjm)]
     127    ! [- pi / 2, rlatv(nbp_lat - 1)]
    127128    ! respectively.
    128129    ! "o3_regr_lat(:, k, :, :)" is for pressure level "plev(k)".
     
    132133
    133134    real, allocatable:: o3_out(:, :, :, :)
    134     ! (jjm + 1, n_plev, 360, read_climoz)
     135    ! (nbp_lat, n_plev, 360, read_climoz)
    135136    ! regridded ozone climatology
    136137    ! "o3_out(j, k, l, :)" is at latitude "rlatu(j)", pressure
     
    175176    latitude = latitude / 180. * pi
    176177    n_lat = size(latitude)
    177     ! We need to supply the latitudes to "regr1_step_av" in
     178    ! We need to supply the latitudes to "regr1_conserv" in
    178179    ! ascending order, so invert order if necessary:
    179180    desc_lat = latitude(1) > latitude(n_lat)
     
    181182
    182183    ! Compute edges of latitude intervals:
    183     allocate(lat_in_edg(n_lat + 1))
    184     lat_in_edg(1) = - pi / 2
    185     forall (j = 2:n_lat) lat_in_edg(j) = (latitude(j - 1) + latitude(j)) / 2
    186     lat_in_edg(n_lat + 1) = pi / 2
     184    allocate(sin_lat_in_edg(n_lat + 1))
     185    sin_lat_in_edg(1) = - 1.
     186    forall (j = 2:n_lat) sin_lat_in_edg(j) = sin((latitude(j - 1) &
     187         + latitude(j)) / 2.)
     188    sin_lat_in_edg(n_lat + 1) = 1.
    187189    deallocate(latitude) ! pointer
    188190
     
    292294       print *, &
    293295            "Found 12 months in ozone climatologies, assuming periodicity..."
    294        o3_regr_lat(nbp_lat:1:-1, :, 1:12, :) = regr1_step_av(o3_in, &
    295             xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/)))
     296       call regr1_conserv(o3_in, xs = sin_lat_in_edg, &
     297            xt = (/- 1., sin(boundslat_reg(nbp_lat - 1:1:- 1, south)), 1./), &
     298            vt = o3_regr_lat(nbp_lat:1:- 1, :, 1:12, :), &
     299            slope = slopes(o3_in, sin_lat_in_edg))
    296300       ! (invert order of indices in "o3_regr_lat" because "rlatu" is
    297301       ! in descending order)
     
    303307    else
    304308       print *, "Using 14 months in ozone climatologies..."
    305        o3_regr_lat(nbp_lat:1:-1, :, :, :) = regr1_step_av(o3_in, &
    306             xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/)))
     309       call regr1_conserv(o3_in, xs = sin_lat_in_edg, &
     310            xt = (/- 1., sin(boundslat_reg(nbp_lat - 1:1:- 1, south)), 1./), &
     311            vt = o3_regr_lat(nbp_lat:1:- 1, :, :, :), &
     312            slope = slopes(o3_in, sin_lat_in_edg))
    307313       ! (invert order of indices in "o3_regr_lat" because "rlatu" is
    308314       ! in descending order)
  • LMDZ5/branches/testing/libf/phylmd/regr_lat_time_coefoz_m.F90

    r2408 r2471  
    4141
    4242    use mod_grid_phy_lmdz, ONLY : nbp_lat
    43     use regr1_step_av_m, only: regr1_step_av
     43    use regr1_conserv_m, only: regr1_conserv
    4444    use regr3_lint_m, only: regr3_lint
    4545    use netcdf95, only: nf95_open, nf95_close, nf95_inq_varid, handle_err, &
     
    162162    latitude = latitude / 180. * pi
    163163    n_lat = size(latitude)
    164     ! We need to supply the latitudes to "regr1_step_av" in
     164    ! We need to supply the latitudes to "regr1_conserv" in
    165165    ! ascending order, so invert order if necessary:
    166166    desc_lat = latitude(1) > latitude(n_lat)
     
    209209       ! We average with respect to sine of latitude, which is
    210210       ! equivalent to weighting by cosine of latitude:
    211        v_regr_lat(nbp_lat:1:-1, :, 1:12) = regr1_step_av(o3_par_in, &
    212             xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/)))
     211       call regr1_conserv(o3_par_in, xs = sin(lat_in_edg), &
     212            xt = (/-1., sin((/boundslat_reg(nbp_lat-1:1:-1,south)/)), 1./), &
     213            vt = v_regr_lat(nbp_lat:1:-1, :, 1:12))
    213214       ! (invert order of indices in "v_regr_lat" because "rlatu" is
    214215       ! in descending order)
  • LMDZ5/branches/testing/libf/phylmd/regr_pr_av_m.F90

    r2408 r2471  
    2626
    2727    ! The target vertical LMDZ grid is the grid of layer boundaries.
    28     ! Regridding in pressure is done by averaging a step function of pressure.
     28    ! Regridding in pressure is conservative, second order.
    2929
    3030    ! All the fields are regridded as a single multi-dimensional array
     
    3838    use assert_m, only: assert
    3939    use assert_eq_m, only: assert_eq
    40     use regr1_step_av_m, only: regr1_step_av
     40    use regr1_conserv_m, only: regr1_conserv
     41    use slopes_m, only: slopes
    4142    use mod_phys_lmdz_mpi_data, only: is_mpi_root
    4243    use mod_grid_phy_lmdz, only: nbp_lon, nbp_lat, nbp_lev
     
    8384    !--------------------------------------------
    8485
    85     call assert(size(v3, 1) == klon, size(v3, 2) == nbp_lev, "regr_pr_av v3 klon")
     86    call assert(size(v3, 1) == klon, size(v3, 2) == nbp_lev, &
     87         "regr_pr_av v3 klon")
    8688    n_var = assert_eq(size(name), size(v3, 3), "regr_pr_av v3 n_var")
    8789    call assert(shape(paprs) == (/klon, nbp_lev+1/), "regr_pr_av paprs")
     
    112114    ! Regrid in pressure at each horizontal position:
    113115    do i = 1, klon
    114        v3(i, nbp_lev:1:-1, :) = regr1_step_av(v2(i, :, :), press_in_edg, &
    115             paprs(i, nbp_lev+1:1:-1))
     116       call regr1_conserv(v2(i, :, :), press_in_edg, &
     117            paprs(i, nbp_lev + 1:1:-1), v3(i, nbp_lev:1:-1, :), &
     118            slopes(v2(i, :, :), press_in_edg))
    116119       ! (invert order of indices because "paprs" is in descending order)
    117120    end do
  • LMDZ5/branches/testing/libf/phylmd/regr_pr_o3_m.F90

    r2408 r2471  
    2828    use netcdf, only:  nf90_nowrite, nf90_get_var
    2929    use assert_m, only: assert
    30     use regr1_step_av_m, only: regr1_step_av
     30    use regr1_conserv_m, only: regr1_conserv
    3131    use press_coefoz_m, only: press_in_edg
    3232    use time_phylmdz_mod, only: day_ref
     
    7575    ! Poles:
    7676    do j = 1, nbp_lat, nbp_lat-1
    77        o3_mob_regr(1, j, nbp_lev:1:-1) &
    78             = regr1_step_av(r_mob(j, :), press_in_edg, p3d(1, j, nbp_lev+1:1:-1))
     77       call regr1_conserv(r_mob(j, :), press_in_edg, &
     78            p3d(1, j, nbp_lev + 1:1:-1), o3_mob_regr(1, j, nbp_lev:1:-1))
    7979       ! (invert order of indices because "p3d" is in descending order)
    8080    end do
     
    8383    do j = 2, nbp_lat-1
    8484       do i = 1, nbp_lon
    85           o3_mob_regr(i, j, nbp_lev:1:-1) &
    86                = regr1_step_av(r_mob(j, :), press_in_edg, &
    87                p3d(i, j, nbp_lev+1:1:-1))
    88              ! (invert order of indices because "p3d" is in descending order)
     85          call regr1_conserv(r_mob(j, :), press_in_edg, &
     86               p3d(i, j, nbp_lev + 1:1:-1), o3_mob_regr(i, j, nbp_lev:1:-1))
     87          ! (invert order of indices because "p3d" is in descending order)
    8988       end do
    9089    end do
  • LMDZ5/branches/testing/libf/phylmd/screenc.F90

    r2298 r2471  
    5454!-----------------------------------------------------------------------
    5555      include "YOMCST.h"
     56      include "flux_arp.h"
    5657!
    5758! Variables locales 
    5859      INTEGER :: i
    59       REAL, dimension(klon) :: cdram, cdrah, cdran, zri1, gref
     60      REAL, dimension(klon) :: cdram, cdrah, cdran, zri1, gref,ycdragm
    6061!
    6162!-------------------------------------------------------------------------
     
    7879                    cdram, cdrah, zri1, pref)
    7980      DO i = 1, knon
     81        IF(ok_prescr_ust) THEN
     82! La aussi il faut forcer avec ust (FC + MPL 20160210)
     83        ycdragm(i) = ust*ust/(1.+speed(i))/speed(i)
     84        cdram=ycdragm
     85        delu(i) = ust/sqrt(cdram(i))
     86        ELSE
    8087        delu(i) = ustar(i)/sqrt(cdram(i))
     88        ENDIF
    8189        delte(i)= (testar(i)* sqrt(cdram(i)))/ &
    8290                   cdrah(i)
  • LMDZ5/branches/testing/libf/phylmd/surf_ocean_mod.F90

    r2435 r2471  
    3636
    3737    include "clesphys.h"
    38     ! for cycle_diurne
     38    ! for cycle_diurne and for iflag_z0_oce==-1 (prescribed z0)
    3939
    4040! Input variables
     
    244244       z0h(i)=0.4*14e-6 / SQRT(cdragm(i) * tmp)
    245245    ENDDO
     246ELSE IF (iflag_z0_oce==-1) THEN
     247    DO i = 1, knon
     248       z0m(i) = z0min
     249       z0h(i) = z0min
     250    ENDDO
    246251ELSE
    247252       CALL abort_physic(modname,'version non prevue',1)
  • LMDZ5/branches/testing/libf/phylmd/write_paramLMDZ_phy.h

    r2408 r2471  
    1 !
    2 ! calcul moyennes globales
    3 !
    4        zx_tmp_fi2d=bils*cell_area
    5        CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gbils)
    6        zx_tmp_fi2d=evap*cell_area
    7        CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gevap)
    8        zx_tmp_fi2d(:)=fevap(:, is_ter)*cell_area(:)
    9        CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gevapt)
    10        zx_tmp_fi2d=zxfluxlat*cell_area
    11        CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,glat)
    12        zx_tmp_fi2d=(topsw0-toplw0)*cell_area
    13        CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gnet0)
    14        zx_tmp_fi2d=(topsw-toplw)*cell_area
    15        CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gnet)
    16        zx_tmp_fi2d=(rain_fall+snow_fall)*cell_area
    17        CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,grain)
    18        zx_tmp_fi2d=zxtsol*cell_area
    19        CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gtsol)
    20        zx_tmp_fi2d=zt2m*cell_area
    21        CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gt2m)
    22        zx_tmp_fi2d=prw*cell_area
    23        CALL global_mean(zx_tmp_fi2d,cell_area,.TRUE.,gprw)
    241!
    252!$OMP MASTER
     
    6845!
    6946!=================================================================
    70 ! moyennes globales
    71 !
    72       CALL histwrite(nid_ctesGCM,"bils",itau_w, &
    73                      gbils,np,ndex2d)
    74       CALL histwrite(nid_ctesGCM,"evap",itau_w, &
    75                      gevap,np,ndex2d)
    76       CALL histwrite(nid_ctesGCM,"evap_land",itau_w, &
    77                      gevapt,np,ndex2d)
    78       CALL histwrite(nid_ctesGCM,"flat",itau_w, &
    79                      glat,np,ndex2d)
    80       CALL histwrite(nid_ctesGCM,"nettop0",itau_w, &
    81                      gnet0,np,ndex2d)
    82       CALL histwrite(nid_ctesGCM,"nettop",itau_w, &
    83                      gnet,np,ndex2d)
    84       CALL histwrite(nid_ctesGCM,"precip",itau_w, &
    85                      grain,np,ndex2d)
    86       CALL histwrite(nid_ctesGCM,"tsol",itau_w, &
    87                      gtsol,np,ndex2d)
    88       CALL histwrite(nid_ctesGCM,"t2m",itau_w, &
    89                      gt2m,np,ndex2d)
    90       CALL histwrite(nid_ctesGCM,"prw",itau_w, &
    91                      gprw,np,ndex2d)
    92 !=================================================================
    9347!
    9448      if (ok_sync) then
  • LMDZ5/branches/testing/libf/phylmd/yamada4.F90

    r2408 r2471  
    66  USE dimphy
    77  USE print_control_mod, ONLY: prt_level
     8  USE ioipsl_getin_p_mod, ONLY : getin_p
     9
    810  IMPLICIT NONE
    911
     
    7577  DATA first, ipas/.FALSE., 0/
    7678  !$OMP THREADPRIVATE( first,ipas)
     79  REAL,SAVE :: lmixmin=1.
     80  !$OMP THREADPRIVATE(lmixmin)
     81
    7782
    7883  INTEGER ig, k
     
    107112  fl(zzz, zl0, zq2, zn2) = max(min(l0(ig)*kap*zlev(ig, &
    108113    k)/(kap*zlev(ig,k)+l0(ig)),0.5*sqrt(q2(ig,k))/sqrt( &
    109     max(n2(ig,k),1.E-10))), 1.)
     114    max(n2(ig,k),1.E-10))), lmixmin)
    110115
    111116
     
    116121    ALLOCATE (l0(klon))
    117122    firstcall = .FALSE.
     123    CALL getin_p('lmixmin',lmixmin)
    118124  END IF
    119125
     
    341347    DO k = 2, klev - 1
    342348      DO ig = 1, ngrid
    343         l(ig, k) = max(l(ig,k), 1.)
     349        l(ig, k) = max(l(ig,k), lmixmin)
    344350        km(ig, k) = l(ig, k)*sqrt(q2(ig,k))*sm(ig, k)
    345351        q2(ig, k) = q2(ig, k) + dt*km(ig, k)*m2(ig, k)*(1.-rif(ig,k))
Note: See TracChangeset for help on using the changeset viewer.