Changeset 2447 for trunk


Ignore:
Timestamp:
Jan 21, 2021, 10:12:41 AM (4 years ago)
Author:
cmathe
Message:

CO2 microphysics: correction r_sedim (co2cloud.F); add: co2 cloud radiatively active

Location:
trunk/LMDZ.MARS/libf/phymars
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/aeropacity_mod.F

    r2417 r2447  
    2121     &                      igcm_dust_submicron, rho_dust, rho_ice,
    2222     &                      nqdust, igcm_stormdust_mass,
    23      &                      igcm_topdust_mass
     23     &                      igcm_topdust_mass, igcm_co2_ice
    2424      use geometry_mod, only: latitude ! grid point latitudes (rad)
    2525      use comgeomfi_h, only: sinlat ! sines of grid point latitudes
     
    160160      CHARACTER(LEN=20) :: txt ! to temporarly store text
    161161      CHARACTER(LEN=1) :: txt2 ! to temporarly store text
     162! indexes of co2 ice :
     163      INTEGER,SAVE :: i_co2ice=0 ! co2 ice
    162164! indexes of dust scatterers:
    163165      INTEGER,SAVE :: naerdust ! number of dust scatterers
     
    194196          i_ice=igcm_h2o_ice
    195197          write(*,*) "aeropacity: i_ice=",i_ice
     198        ENDIF
     199
     200        IF (co2clouds.AND.activeco2ice) THEN
     201          i_co2ice=igcm_co2_ice
     202          write(*,*) "aeropacity: i_co2ice =",i_co2ice
    196203        ENDIF
    197204
     
    476483
    477484c==================================================================
     485        CASE("co2_ice") aerkind             ! CO2 ice crystals
     486c==================================================================
     487
     488c       1. Initialization
     489        aerosol(1:ngrid,1:nlayer,iaer) = 0.
     490        taucloudvis(1:ngrid) = 0.
     491        taucloudtes(1:ngrid) = 0.
     492c       2. Opacity calculation
     493        ! NO CLOUDS
     494        IF (clearsky) THEN
     495            aerosol(1:ngrid,1:nlayer,iaer) =1.e-9
     496        ! CLOUDSs
     497        ELSE ! else (clearsky)
     498          DO ig=1, ngrid
     499            DO l=1,nlayer
     500              aerosol(ig,l,iaer) = max(1E-20,
     501     &          (  0.75 * QREFvis3d(ig,l,iaer) /
     502     &          ( rho_ice * reffrad(ig,l,iaer) )  ) *
     503     &          pq(ig,l,i_co2ice) *
     504     &          ( pplev(ig,l) - pplev(ig,l+1) ) / g
     505     &                              )
     506              taucloudvis(ig) = taucloudvis(ig) + aerosol(ig,l,iaer)
     507              taucloudtes(ig) = taucloudtes(ig) + aerosol(ig,l,iaer)*
     508     &          QREFir3d(ig,l,iaer) / QREFvis3d(ig,l,iaer) *
     509     &          ( 1.E0 - omegaREFir3d(ig,l,iaer) )
     510            ENDDO
     511          ENDDO
     512          ! SUB-GRID SCALE CLOUDS
     513          IF (CLFvarying) THEN
     514             DO ig=1, ngrid
     515                DO l=1,nlayer-1
     516                   CLFtot  = max(totcloudfrac(ig),0.01)
     517                   aerosol(ig,l,iaer)=
     518     &                    aerosol(ig,l,iaer)/CLFtot
     519                   aerosol(ig,l,iaer) =
     520     &                    max(aerosol(ig,l,iaer),1.e-9)
     521                ENDDO
     522             ENDDO
     523          ENDIF ! end (CLFvarying)             
     524        ENDIF ! end (clearsky)
     525
     526c==================================================================
    478527        CASE("stormdust_doubleq") aerkind ! CW17 : Two-moment scheme for
    479528c       stormdust  (transport of mass and number mixing ratio)
  • trunk/LMDZ.MARS/libf/phymars/callkeys.h

    r2409 r2447  
    1414     &   ,activice,water,tifeedback,microphys,supersat,caps,photochem   &
    1515     &   ,calltherm,callrichsl,callslope,tituscap,callyamada4,co2clouds &
    16      &   ,co2useh2o,meteo_flux,CLFvaryingCO2,spantCO2,CLFvarying        &
    17      &   ,satindexco2,rdstorm,slpwind,calllott_nonoro                   &
     16     &   ,co2useh2o,meteo_flux,activeco2ice,CLFvaryingCO2,spantCO2      &
     17     &   ,CLFvarying,satindexco2,rdstorm,slpwind,calllott_nonoro        &
    1818     &   ,latentheat_surfwater,gwd_convective_source,startphy_file      &
    1919     &   ,hdo,hdofrac
     
    7272      logical activice,tifeedback,supersat,caps
    7373      logical co2clouds,co2useh2o,meteo_flux,CLFvaryingCO2,satindexco2
     74      logical activeco2ice
    7475      integer spantCO2
    7576      logical CLFvarying
  • trunk/LMDZ.MARS/libf/phymars/callradite_mod.F

    r2417 r2447  
    1010     $     fluxtop_sw,tau_pref_scenario,tau_pref_gcm,
    1111     &     tau,aerosol,dsodust,tauscaling,dust_rad_adjust,
    12      $     taucloudtes,rdust,rice,nuice,co2ice,rstormdust,rtopdust,
    13      $     totstormfract,clearatm,dsords,dsotop,alpha_hmons,nohmons,
    14      $     clearsky,totcloudfrac)
     12     $     taucloudtes,rdust,rice,nuice,riceco2,nuiceco2,co2ice,
     13     $     rstormdust,rtopdust,totstormfract,clearatm,dsords,dsotop,
     14     $     alpha_hmons,nohmons,clearsky,totcloudfrac)
    1515
    1616      use aeropacity_mod, only: aeropacity
     
    1919      use dimradmars_mod, only: naerkind, name_iaer,
    2020     &            iaer_dust_conrath,iaer_dust_doubleq,
    21      &            iaer_dust_submicron,iaer_h2o_ice,
     21     &            iaer_dust_submicron, iaer_h2o_ice, iaer_co2_ice,
    2222     &            iaer_stormdust_doubleq,iaer_topdust_doubleq
    2323      use yomlw_h, only: gcp, nlaylte
     
    203203      REAL,INTENT(OUT) :: rice(ngrid,nlayer)   ! Ice geometric mean radius (m)
    204204      REAL,INTENT(OUT) :: nuice(ngrid,nlayer)  ! Estimated effective variance
     205      REAL,INTENT(OUT) :: riceco2(ngrid,nlayer) ! CO2 ice mean radius(m)
     206      REAL,INTENT(OUT) :: nuiceco2(ngrid,nlayer) ! Effective variance
    205207      REAL,INTENT(IN) :: co2ice(ngrid)           ! co2 ice surface layer (kg.m-2)
    206208
     
    317319         iaer_dust_submicron=0
    318320         iaer_h2o_ice=0
     321         iaer_co2_ice=0
    319322         iaer_stormdust_doubleq=0
    320323         iaer_topdust_doubleq=0
     
    349352             if (name_iaer(iaer).eq."h2o_ice") then
    350353               iaer_h2o_ice = iaer
     354               aer_count = aer_count + 1
     355             endif
     356           enddo
     357         endif
     358         if (co2clouds.AND.activeco2ice) then
     359           do iaer=1,naerkind
     360             if (name_iaer(iaer).eq."co2_ice") then
     361               iaer_co2_ice = iaer
    351362               aer_count = aer_count + 1
    352363             endif
     
    412423c     Computing aerosol optical properties and opacity
    413424c     ------------------------------------------------
    414 
    415425c     Updating aerosol size distributions:
    416426      CALL updatereffrad(ngrid,nlayer,
    417427     &                rdust,rstormdust,rtopdust,rice,nuice,
    418      &                reffrad,nueffrad,
     428     &                reffrad,nueffrad, riceco2, nuiceco2,
    419429     &                pq,tauscaling,tau,pplay)
    420 
    421430c     Computing 3D scattering parameters:
    422431      CALL aeroptproperties(ngrid,nlayer,reffrad,nueffrad,
     
    425434     &                      QREFvis3d,QREFir3d,
    426435     &                      omegaREFvis3d,omegaREFir3d)
    427 
    428436c     Computing aerosol optical depth in each layer:
    429437      CALL aeropacity(ngrid,nlayer,nq,zday,pplay,pplev,ls,
  • trunk/LMDZ.MARS/libf/phymars/callsedim_mod.F

    r2409 r2447  
    673673       ENDIF ! of IF(microphys)
    674674      endif ! of if (water)
    675 
    676675      END SUBROUTINE callsedim
    677676     
  • trunk/LMDZ.MARS/libf/phymars/co2cloud.F90

    r2386 r2447  
    9898!======================================================================================================================!
    9999  subroutine co2cloud(ngrid, nlay, ptimestep, pplev, pplay, pdpsrf, pzlay, pt, pdt, pq, pdq, pdqcloudco2, pdtcloudco2, &
    100                       nq, tau, tauscaling, rdust, rice, riceco2, nuice, rsedcloud, rhocloud, pzlev, pdqs_sedco2, pdu, &
     100                      nq, tau, tauscaling, rdust, rice, riceco2, nuice, rhocloud, rsedcloudco2, rhocloudco2, pzlev, pdqs_sedco2, pdu, &
    101101                      pu, pcondicea, co2ice)
    102102
     
    115115
    116116  use improvedCO2clouds_mod, only: improvedCO2clouds, density_co2_ice
     117
     118#ifndef MESOSCALE
     119  use vertical_layers_mod, only: ap, bp
     120#endif
    117121
    118122  implicit none
     
    151155!------------------
    152156  real, intent(out) :: &
    153      rdust(ngrid,nlay),         & ! Dust geometric mean radius (m)
    154157     rice(ngrid,nlay),          & ! Water Ice mass mean radius (m)
    155      rsedcloud(ngrid,nlay),     & ! Water Cloud sedimentation radius
     158!     rsedcloud(ngrid,nlay),     & ! Water Cloud sedimentation radius
    156159     rhocloud(ngrid,nlay),      & ! Water Cloud density (kg.m-3)
    157160     pdqs_sedco2(ngrid),        & ! CO2 flux at the surface
     
    159162     pcondicea(ngrid,nlay),     & ! Rate of condensation/sublimation of co2 ice in layers
    160163     pdtcloudco2(ngrid,nlay),   & ! Tendency on temperature due to latent heat
    161      riceco2(ngrid,nlay)          ! Ice mass mean radius (m) r_c in Montmessin et al. (2004)
     164     riceco2(ngrid,nlay),       & ! Ice mass mean radius (m) r_c in Montmessin et al. (2004)
     165     rsedcloudco2(ngrid,nlay)     ! Cloud sedimentation radius
     166
     167  real, intent(inout) :: &
     168     rdust(ngrid,nlay) ! Dust geometric mean radius (m)
     169
    162170!----------------------------------------------------------------------------------------------------------------------!
    163171! Local:
     
    225233     sum_subpdt(ngrid,nlay),        &! On temperature, cf. pdtcloud
    226234!  ---Sedimentation
    227      rsedcloudco2(ngrid,nlay),      &! Cloud sedimentation radius
    228235     ztsed(ngrid,nlay),             &! Temperature with real-time value in microtimeloop
    229236     zqsed(ngrid,nlay,nq),          &! Tracers with real-time value in µloop
     
    249256     wq(ngrid,nlay+1),              &! Displaced tracer mass (kg.m-2) during microtimestep
    250257     satuco2(ngrid,nlay),           &! CO2 satu ratio for output diagfi
    251      zqsatco2(ngrid,nlay)            ! Saturation co2
    252 
     258     zqsatco2(ngrid,nlay),          &! Saturation co2
     259     availco2,&
     260     masslayer, &
     261     tmp, a,b, &
     262     new_pdq(ngrid,nlay)
     263     
    253264  double precision :: &
    254265! ---Extinction coefficients at 1 micron of CO2 particles
     
    416427  do l = 1, nlay
    417428    do ig = 1, ngrid
    418       masse(ig,l) = (pplev(ig,l) - pplev(ig,l+1)) / g
     429      masse(ig,l) = (pplev(ig,l) - pplev(ig,l+1) + (bp(l)-bp(l+1)) ) / g
    419430      epaisseur(ig,l) = pzlev(ig,l+1) - pzlev(ig,l)
    420431    end do
     
    545556! 4. Microphysics of CO2 cloud formation
    546557!----------------------------------------------------------------------------------------------------------------------!
     558  pqeff(:,:,:) = pq(:,:,:)
     559  pteff(:,:) = pt(:,:)
     560!----------------------------------------------------------------------------------------------------------------------!
     561! 4.2. Effective tracers quantities in the cloud
     562!----------------------------------------------------------------------------------------------------------------------!
     563  if (CLFvaryingCO2) then
     564    pqeff(:,:,igcm_ccnco2_mass) = pq(:,:,igcm_ccnco2_mass) / co2cloudfrac(:,:)
     565
     566    pqeff(:,:,igcm_ccnco2_number) = pq(:,:,igcm_ccnco2_number) / co2cloudfrac(:,:)
     567
     568    pqeff(:,:,igcm_co2_ice) = pq(:,:,igcm_co2_ice) / co2cloudfrac(:,:)
     569  end if
     570!----------------------------------------------------------------------------------------------------------------------!
    547571  do microstep = 1, imicroco2
    548572!----------------------------------------------------------------------------------------------------------------------!
    549573! 4.1. Stepped entry for tendancies: At each micro timestep we add pdt in order to have a stepped entry
     574!----------------------------------------------------------------------------------------------------------------------!
     575   do l = 1, nlay
     576     do ig = 1, ngrid
     577       ! on temperature
     578       sum_subpdt(ig,l) = sum_subpdt(ig,l) + pdt(ig,l)
     579       
     580       ! on tracers
     581       sum_subpdq(ig,l,igcm_dust_mass) = sum_subpdq(ig,l,igcm_dust_mass) + pdq(ig,l,igcm_dust_mass)
     582
     583       sum_subpdq(ig,l,igcm_dust_number) = sum_subpdq(ig,l,igcm_dust_number) + pdq(ig,l,igcm_dust_number)
     584
     585       sum_subpdq(ig,l,igcm_ccnco2_mass) = sum_subpdq(ig,l,igcm_ccnco2_mass) + pdq(ig,l,igcm_ccnco2_mass)
     586
     587       sum_subpdq(ig,l,igcm_ccnco2_number) = sum_subpdq(ig,l,igcm_ccnco2_number) + pdq(ig,l,igcm_ccnco2_number)
     588
     589       sum_subpdq(ig,l,igcm_co2_ice) = sum_subpdq(ig,l,igcm_co2_ice) + pdq(ig,l,igcm_co2_ice)
     590
     591       sum_subpdq(ig,l,igcm_co2) = sum_subpdq(ig,l,igcm_co2) + pdq(ig,l,igcm_co2)
     592
     593       if (co2useh2o) then
     594         sum_subpdq(ig,l,igcm_h2o_ice) = sum_subpdq(ig,l,igcm_h2o_ice) + pdq(ig,l,igcm_h2o_ice)
     595
     596         sum_subpdq(ig,l,igcm_ccn_mass) = sum_subpdq(ig,l,igcm_ccn_mass) + pdq(ig,l,igcm_ccn_mass)
     597
     598         sum_subpdq(ig,l,igcm_ccn_number) = sum_subpdq(ig,l,igcm_ccn_number) + pdq(ig,l,igcm_ccn_number)
     599       end if
     600     end do ! ngrid
     601   end do ! nlay
     602!----------------------------------------------------------------------------------------------------------------------!
     603! 4.4. Main call to the cloud scheme
     604!----------------------------------------------------------------------------------------------------------------------!
     605   call improvedco2clouds(ngrid, nlay, microtimestep, pplay, pplev, pteff, sum_subpdt, pqeff, sum_subpdq, &
     606                          subpdqcloudco2, subpdtcloudco2, nq, tauscaling, mem_Mccn_co2, mem_Mh2o_co2, mem_Nccn_co2, &
     607                          rb_cldco2, sigma_iceco2, dev2)
     608   do l = 1, nlay
     609     do ig = 1, ngrid
     610       if(pq(ig,l,igcm_co2_ice) + microtimestep*(sum_subpdq(ig,l,igcm_co2_ice)+subpdqcloudco2(ig,l,igcm_co2_ice)) &
     611         .le. 1.e-12) then
     612         subpdqcloudco2(ig,l,igcm_co2_ice) = -pq(ig,l,igcm_co2_ice)/microtimestep - sum_subpdq(ig,l,igcm_co2_ice)
     613         subpdqcloudco2(ig,l,igcm_co2) = -subpdqcloudco2(ig,l,igcm_co2_ice)
     614       end if
     615
     616       if(pq(ig,l,igcm_co2) + microtimestep*(sum_subpdq(ig,l,igcm_co2)+subpdqcloudco2(ig,l,igcm_co2)) .le. 1.e-12) then
     617         subpdqcloudco2(ig,l,igcm_co2) =  - pq(ig,l,igcm_co2)/microtimestep - sum_subpdq(ig,l,igcm_co2)
     618         subpdqcloudco2(ig,l,igcm_co2_ice) = -subpdqcloudco2(ig,l,igcm_co2)
     619       end if
     620  ! ccnco2_number and ccnco2_mass
     621       if (((pq(ig,l,igcm_ccnco2_number)+(sum_subpdq(ig,l,igcm_ccnco2_number)+subpdqcloudco2(ig,l,igcm_ccnco2_number)) &
     622          *microtimestep).le.1.) .or. &
     623         (pq(ig,l,igcm_ccnco2_mass)+(sum_subpdq(ig,l,igcm_ccnco2_mass)+subpdqcloudco2(ig,l,igcm_ccnco2_mass)) &
     624          *microtimestep.le.1e-20)) then
     625         subpdqcloudco2(ig,l,igcm_ccnco2_number) = - pq(ig,l,igcm_ccnco2_number)/microtimestep + 1. &
     626                                                  - sum_subpdq(ig,l,igcm_ccnco2_number)
     627         subpdqcloudco2(ig,l,igcm_dust_number) = - subpdqcloudco2(ig,l,igcm_ccnco2_number)
     628
     629         subpdqcloudco2(ig,l,igcm_ccnco2_mass) = - pq(ig,l,igcm_ccnco2_mass)/microtimestep + 1e-20 &
     630                                                - sum_subpdq(ig,l,igcm_ccnco2_mass)
     631         subpdqcloudco2(ig,l,igcm_dust_mass) = - subpdqcloudco2(ig,l,igcm_ccnco2_mass)
     632       end if
     633     end do
     634   end do
     635!----------------------------------------------------------------------------------------------------------------------!
     636! 4.5. Updating tendencies after cloud scheme
    550637!----------------------------------------------------------------------------------------------------------------------!
    551638    do l = 1, nlay
    552639      do ig = 1, ngrid
    553         ! on temperature
    554         sum_subpdt(ig,l) = sum_subpdt(ig,l) + pdt(ig,l)
    555 
    556         ! on tracers
    557         sum_subpdq(ig,l,igcm_dust_mass) = sum_subpdq(ig,l,igcm_dust_mass) + pdq(ig,l,igcm_dust_mass)
    558 
    559         sum_subpdq(ig,l,igcm_dust_number) = sum_subpdq(ig,l,igcm_dust_number) + pdq(ig,l,igcm_dust_number)
    560 
    561         sum_subpdq(ig,l,igcm_ccnco2_mass) = sum_subpdq(ig,l,igcm_ccnco2_mass) + pdq(ig,l,igcm_ccnco2_mass)
    562 
    563         sum_subpdq(ig,l,igcm_ccnco2_number) = sum_subpdq(ig,l,igcm_ccnco2_number) + pdq(ig,l,igcm_ccnco2_number)
    564 
    565         sum_subpdq(ig,l,igcm_co2_ice) = sum_subpdq(ig,l,igcm_co2_ice) + pdq(ig,l,igcm_co2_ice)
    566 
    567         sum_subpdq(ig,l,igcm_co2) = sum_subpdq(ig,l,igcm_co2) + pdq(ig,l,igcm_co2)
     640        sum_subpdt(ig,l) = sum_subpdt(ig,l) + subpdtcloudco2(ig,l)
     641
     642        sum_subpdq(ig,l,igcm_dust_mass) = sum_subpdq(ig,l,igcm_dust_mass) + subpdqcloudco2(ig,l,igcm_dust_mass)
     643
     644        sum_subpdq(ig,l,igcm_dust_number) = sum_subpdq(ig,l,igcm_dust_number) + subpdqcloudco2(ig,l,igcm_dust_number)
     645
     646        sum_subpdq(ig,l,igcm_ccnco2_mass) = sum_subpdq(ig,l,igcm_ccnco2_mass) + subpdqcloudco2(ig,l,igcm_ccnco2_mass)
     647
     648        sum_subpdq(ig,l,igcm_ccnco2_number) = sum_subpdq(ig,l,igcm_ccnco2_number) + &
     649                                              subpdqcloudco2(ig,l,igcm_ccnco2_number)
     650
     651        sum_subpdq(ig,l,igcm_co2_ice) = sum_subpdq(ig,l,igcm_co2_ice) + subpdqcloudco2(ig,l,igcm_co2_ice)
     652
     653        sum_subpdq(ig,l,igcm_co2) = sum_subpdq(ig,l,igcm_co2) + subpdqcloudco2(ig,l,igcm_co2)
    568654
    569655        if (co2useh2o) then
    570           sum_subpdq(ig,l,igcm_h2o_ice) = sum_subpdq(ig,l,igcm_h2o_ice) + pdq(ig,l,igcm_h2o_ice)
    571 
    572           sum_subpdq(ig,l,igcm_ccn_mass) = sum_subpdq(ig,l,igcm_ccn_mass) + pdq(ig,l,igcm_ccn_mass)
    573 
    574           sum_subpdq(ig,l,igcm_ccn_number) = sum_subpdq(ig,l,igcm_ccn_number) + pdq(ig,l,igcm_ccn_number)
     656          sum_subpdq(ig,l,igcm_h2o_ice) = sum_subpdq(ig,l,igcm_h2o_ice) + subpdqcloudco2(ig,l,igcm_h2o_ice)
     657
     658          sum_subpdq(ig,l,igcm_ccn_mass) = sum_subpdq(ig,l,igcm_ccn_mass) + subpdqcloudco2(ig,l,igcm_ccn_mass)
     659
     660          sum_subpdq(ig,l,igcm_ccn_number) = sum_subpdq(ig,l,igcm_ccn_number) + subpdqcloudco2(ig,l,igcm_ccn_number)
    575661        end if
    576662      end do ! ngrid
    577663    end do ! nlay
    578 !----------------------------------------------------------------------------------------------------------------------!
    579 ! 4.2. Effective tracers quantities in the cloud
    580 !----------------------------------------------------------------------------------------------------------------------!
    581     pqeff(:,:,:) = pq(:,:,:)
    582 
    583     if (CLFvaryingCO2) then
    584       pqeff(:,:,igcm_ccnco2_mass) = pq(:,:,igcm_ccnco2_mass) / co2cloudfrac(:,:)
    585 
    586       pqeff(:,:,igcm_ccnco2_number) = pq(:,:,igcm_ccnco2_number) / co2cloudfrac(:,:)
    587 
    588       pqeff(:,:,igcm_co2_ice) = pq(:,:,igcm_co2_ice) / co2cloudfrac(:,:)
    589     end if
    590664!----------------------------------------------------------------------------------------------------------------------!
    591665! 4.3. Gravitational sedimentation
     
    612686
    613687          ! Get density cloud and co2 ice particle radius
    614           call updaterice_microco2(Niceco2, Qccnco2, Nccnco2, tauscaling(ig), riceco2(ig,l), rhocloudco2t(ig,l))
    615 
    616           ! conflict with updaterice_microco2 C.M.
    617           if (Niceco2 <= threshold .or. Nccnco2*tauscaling(ig) <= 1) then
    618             riceco2(ig,l) = 1.e-9
     688          if (Niceco2.ne.0d0) then
     689            call updaterice_microco2(Niceco2, Qccnco2, Nccnco2, tauscaling(ig), riceco2(ig,l), rhocloudco2t(ig,l))
     690          else
     691            riceco2(ig,l) = 0.
     692            rhocloudco2t(ig,l) = 0.
    619693          end if
    620 
    621           ! done in updaterice_microco2 C.M.
    622           rhocloudco2t(ig,l) = min( max(rhocloudco2t(ig,l),rho_ice_co2T(ig,l)), rho_dust )
    623694        end do ! ngrid
    624695      end do ! nlay
     
    632703! 4.3.c. Sedimentation of co2 ice
    633704!----------------------------------------------------------------------------------------------------------------------!
    634       rsedcloudco2(1:ngrid, 1:nlay) = 5e-6
     705      do ig = 1, ngrid
     706        do l = 1, nlay
     707          rsedcloudco2(ig,l) = max( riceco2(ig,l)*(1.+sigma_iceco2)*(1.+sigma_iceco2)*(1.+sigma_iceco2), &
     708                                    rdust(ig,l) )
     709        end do
     710      end do
     711
    635712      wq(:,:) = 0.
    636713      call newsedim(ngrid, nlay, ngrid*nlay, ngrid*nlay, microtimestep, pplev, masse, epaisseur, ztsed, &
     
    638715
    639716      do ig = 1, ngrid
    640         sum_subpdqs_sedco2(ig) = sum_subpdqs_sedco2(ig) + wq(ig,1) / microtimestep
     717        sum_subpdqs_sedco2(ig) = sum_subpdqs_sedco2(ig) + wq(ig,1) / microtimestep !wq est en kg.m-2
    641718      end do
    642719!----------------------------------------------------------------------------------------------------------------------!
     
    653730      call newsedim(ngrid, nlay, ngrid*nlay, ngrid*nlay,microtimestep, pplev, masse, epaisseur, ztsed, &
    654731                   rsedcloudco2, rhocloudco2t, zqsed(:,:,igcm_ccnco2_number), wq, beta)
    655 
    656732      !TODO: ajouter le calcule de la tendance a la surface comme co2ice
    657733!----------------------------------------------------------------------------------------------------------------------!
     
    669745        end do
    670746      end do
    671 
    672747      ! update subtimestep tendencies with sedimentation input
    673748      do l = 1, nlay
     
    681756      end do
    682757    end if !(end if sedimentation)
    683 !----------------------------------------------------------------------------------------------------------------------!
    684 ! 4.4. Main call to the cloud scheme
    685 !----------------------------------------------------------------------------------------------------------------------!
    686     call improvedco2clouds(ngrid, nlay, microtimestep, pplay, pplev, pteff, sum_subpdt, pqeff, sum_subpdq, &
    687                            subpdqcloudco2, subpdtcloudco2, nq, tauscaling, mem_Mccn_co2, mem_Mh2o_co2, mem_Nccn_co2, &
    688                            rb_cldco2, sigma_iceco2, dev2)
    689 !----------------------------------------------------------------------------------------------------------------------!
    690 ! 4.5. Updating tendencies after cloud scheme
    691 !----------------------------------------------------------------------------------------------------------------------!
    692     do l = 1, nlay
    693       do ig = 1, ngrid
    694         sum_subpdt(ig,l) = sum_subpdt(ig,l) + subpdtcloudco2(ig,l)
    695 
    696         sum_subpdq(ig,l,igcm_dust_mass) = sum_subpdq(ig,l,igcm_dust_mass) + subpdqcloudco2(ig,l,igcm_dust_mass)
    697 
    698         sum_subpdq(ig,l,igcm_dust_number) = sum_subpdq(ig,l,igcm_dust_number) + subpdqcloudco2(ig,l,igcm_dust_number)
    699 
    700         sum_subpdq(ig,l,igcm_ccnco2_mass) = sum_subpdq(ig,l,igcm_ccnco2_mass) + subpdqcloudco2(ig,l,igcm_ccnco2_mass)
    701 
    702         sum_subpdq(ig,l,igcm_ccnco2_number) = sum_subpdq(ig,l,igcm_ccnco2_number) + &
    703                                               subpdqcloudco2(ig,l,igcm_ccnco2_number)
    704 
    705         sum_subpdq(ig,l,igcm_co2_ice) = sum_subpdq(ig,l,igcm_co2_ice) + subpdqcloudco2(ig,l,igcm_co2_ice)
    706 
    707         sum_subpdq(ig,l,igcm_co2) = sum_subpdq(ig,l,igcm_co2) + subpdqcloudco2(ig,l,igcm_co2)
    708 
    709         if (co2useh2o) then
    710           sum_subpdq(ig,l,igcm_h2o_ice) = sum_subpdq(ig,l,igcm_h2o_ice) + subpdqcloudco2(ig,l,igcm_h2o_ice)
    711 
    712           sum_subpdq(ig,l,igcm_ccn_mass) = sum_subpdq(ig,l,igcm_ccn_mass) + subpdqcloudco2(ig,l,igcm_ccn_mass)
    713 
    714           sum_subpdq(ig,l,igcm_ccn_number) = sum_subpdq(ig,l,igcm_ccn_number) + subpdqcloudco2(ig,l,igcm_ccn_number)
    715         end if
    716       end do ! ngrid
    717     end do ! nlay
    718758  end do ! of do microstep = 1, imicroco2
    719759!----------------------------------------------------------------------------------------------------------------------!
    720760! 5. Compute final tendencies after time loop
    721761!----------------------------------------------------------------------------------------------------------------------!
    722 ! condensation/sublimation rate in the atmosphere
     762! condensation/sublimation rate in the atmosphere (kg.kg-1.s-1)
    723763  do l = nlay, 1, -1
    724764    do ig = 1, ngrid
     
    732772  end do
    733773
    734   ! temperature tendency
     774  ! temperature tendency (T.s-1)
    735775  do l = 1, nlay
    736776    do ig = 1, ngrid
     
    753793
    754794      pdqcloudco2(ig,l,igcm_dust_mass) = ( sum_subpdq(ig,l,igcm_dust_mass) / real(imicroco2) ) - &
    755                                          pdq(ig,l,igcm_dust_mass)
     795                                          pdq(ig,l,igcm_dust_mass)
    756796
    757797      pdqcloudco2(ig,l,igcm_dust_number) = ( sum_subpdq(ig,l,igcm_dust_number)/real(imicroco2) ) - &
     
    759799
    760800      if (co2useh2o) then
    761         pdqcloudco2(ig,l,igcm_h2o_ice) = ( sum_subpdq(ig,l,igcm_h2o_ice) / real(imicroco2) ) -&
    762                                          pdq(ig,l,igcm_h2o_ice)
     801        pdqcloudco2(ig,l,igcm_h2o_ice) = ( sum_subpdq(ig,l,igcm_h2o_ice) / real(imicroco2) ) - &
     802                                          pdq(ig,l,igcm_h2o_ice)
    763803
    764804        pdqcloudco2(ig,l,igcm_ccn_mass) = ( sum_subpdq(ig,l,igcm_ccn_mass) / real(imicroco2) ) - &
    765                                           pdq(ig,l,igcm_ccn_mass)
     805                                           pdq(ig,l,igcm_ccn_mass)
    766806
    767807        pdqcloudco2(ig,l,igcm_ccn_number) = ( sum_subpdq(ig,l,igcm_ccn_number) / real(imicroco2) ) - &
     
    778818    do ig = 1, ngrid
    779819      Niceco2 = pqeff(ig,l,igcm_co2_ice) + ( pdq(ig,l,igcm_co2_ice) + pdqcloudco2(ig,l,igcm_co2_ice) ) * ptimestep
     820      Niceco2 = max (Niceco2, threshold)
    780821
    781822      Nccnco2 = max( (pqeff(ig,l,igcm_ccnco2_number) + (pdq(ig,l,igcm_ccnco2_number) + &
     
    848889  end do
    849890!----------------------------------------------------------------------------------------------------------------------!
    850 ! 8. Compute water cloud sedimentation radius
    851 !----------------------------------------------------------------------------------------------------------------------!
    852   do l = 1, nlay
    853     do ig= 1, ngrid
    854       rsedcloud(ig,l) = max( rice(ig,l)*(1.+nuice_sed)* (1.+nuice_sed)*(1.+nuice_sed), rdust(ig,l) )
    855     end do
    856   end do
    857 !----------------------------------------------------------------------------------------------------------------------!
    858891! 9. CO2 saturated quantities
    859892!----------------------------------------------------------------------------------------------------------------------!
     
    916949  call WRITEDIAGFI(ngrid, "satuco2", "vap in satu", " ", 3, satuco2)
    917950
    918   call WRITEDIAGFI(ngrid, "co2cloudfrac", "co2 cloud fraction", " ", 3, co2cloudfrac)
     951  if (CLFvaryingCO2) then
     952    call WRITEDIAGFI(ngrid, "co2cloudfrac", "co2 cloud fraction", " ", 3, co2cloudfrac)
     953  end if
    919954
    920955  call writediagfi(ngrid, "riceco2", "ice radius", "m", 3, riceco2)
  • trunk/LMDZ.MARS/libf/phymars/co2condens_mod4micro.F90

    r2362 r2447  
    194194  logical :: &
    195195     condsub(ngrid) ! True if there is condensation/sublimation (used for co2snow)
     196
     197
     198  ! check with co2 cloud parameterisation
     199  real :: &
     200     zt_2(ngrid,nlayer), &
     201     ztcond_2(ngrid,nlayer+1), &
     202     zfallice_2(ngrid,nlayer+1), &
     203     pdtc_2(ngrid,nlayer), &
     204     zfallheat_2, &
     205     zcondicea_2(ngrid,nlayer), &
     206     diff_zcondicea(ngrid,nlayer), &
     207     diff_zfallice(ngrid)
    196208!======================================================================================================================!
    197209! BEGIN ===============================================================================================================!
     
    281293! Only sedimentation falls on the ground !
    282294  do ig = 1, ngrid
    283       zfallice(ig) =  zdqssed_co2(ig)
     295      zfallice(ig) = zdqssed_co2(ig)
    284296      piceco2(ig) = piceco2(ig) + zfallice(ig)*ptimestep
    285297  end do
     
    288300
    289301  call writediagfi(ngrid,"zfallice", "Sedimentation rate", " ", 2, zfallice)
     302
     303! Compute without microphysics
     304 do l =1, nlayer
     305   do ig = 1, ngrid
     306     zt_2(ig,l) = pt(ig,l) + pdt(ig,l)*ptimestep
     307   end do
     308 end do
     309
     310 do l = 1, nlayer
     311   do ig = 1, ngrid
     312     if (pplay(ig,l).ge.1e-4) then
     313       ztcond_2(ig,l) = 1. / (bcond-acond*log(.01*vmr_co2(ig,l)*pplay(ig,l)))
     314     else
     315       ztcond_2(ig,l) = 0.0 !mars Monica
     316     endif
     317   end do
     318 end do
     319
     320 ztcond_2(:,nlayer+1)=ztcond_2(:,nlayer)
     321 zfallice_2(:,:) = 0
     322
     323 do l = nlayer , 1, -1
     324   do ig = 1, ngrid
     325     pdtc_2(ig,l) = 0.
     326     if ((zt_2(ig,l).lt.ztcond_2(ig,l)).or.(zfallice_2(ig,l+1).gt.0)) then
     327       if (zfallice_2(ig,l+1).gt.0) then 
     328         zfallheat_2 = zfallice_2(ig,l+1)*(pphi(ig,l+1)-pphi(ig,l) + cpice*(ztcond_2(ig,l+1)-ztcond_2(ig,l)))/latcond
     329       else
     330         zfallheat_2 = 0.
     331       end if
     332       pdtc_2(ig,l) = (ztcond_2(ig,l) - zt_2(ig,l))/ptimestep
     333       zcondicea_2(ig,l) = (pplev(ig,l)-pplev(ig,l+1))*ccond*pdtc(ig,l)- zfallheat_2
     334       ! Case when the ice from above sublimes entirely
     335       ! """""""""""""""""""""""""""""""""""""""""""""""
     336       if (zfallice_2(ig,l+1).lt.- zcondicea_2(ig,l)) then
     337         zcondicea_2(ig,l)= -zfallice_2(ig,l+1)
     338       end if
     339       zfallice_2(ig,l) = zcondicea_2(ig,l)+zfallice_2(ig,l+1)
     340     end if
     341   end do
     342 end do
     343 diff_zcondicea(:,:) = zcondicea_2(:,:) - zcondicea(:,:)
     344 diff_zfallice(:) = zfallice_2(:,1) - zfallice(:)
     345 call writediagfi(ngrid, "diff_zfallice", "sans - avec microphysique", "", 2, diff_zfallice)
     346 call writediagfi(ngrid, "diff_zcondicea", "sans - avec microphysique", "", 3, diff_zcondicea)
    290347!----------------------------------------------------------------------------------------------------------------------!
    291348! 5. Main co2condens
     
    307364!   5.3. Compute zfallheat
    308365!----------------------------------------------------------------------------------------------------------------------!
    309       if (zfallice(ig)>0) then
    310         zfallheat = zfallice(ig) * ( pphi(ig,1) - phisfi(ig) + cpice*(ztcond(ig,1) - ztcondsol(ig)) )/latcond
    311       else
    312         zfallheat = 0.
    313       end if
     366      zfallheat = 0.
    314367!----------------------------------------------------------------------------------------------------------------------!
    315368!   5.4. Compute direct condensation/sublimation of CO2 ice
     
    320373!   5.4.a. If there is not enough CO2 tracer in 1st layer to condense
    321374!----------------------------------------------------------------------------------------------------------------------!
    322       if (igcm_co2/=0) then
    323 !       Available CO2 tracer in layer 1 at end of timestep (kg/m2)
    324         availco2 = pq(ig,1,igcm_co2) * ( (ap(1)-ap(2)) + (bp(1)-bp(2)) * (pplev(ig,1)/g - zcondices(ig)*ptimestep) )
    325         if ( zcondices(ig) * ptimestep>availco2 ) then
    326           zcondices(ig) = availco2/ptimestep
    327           zdiceco2(ig) = zcondices(ig) + zfallice(ig)
    328           pdtsrfc(ig) = (latcond/pcapcal(ig)) *  (zcondices(ig)+zfallheat)
    329         end if
     375!     Available CO2 tracer in layer 1 at end of timestep (kg/m2)
     376      availco2 = pq(ig,1,igcm_co2) * ( (ap(1)-ap(2)) + (bp(1)-bp(2)) * (pplev(ig,1)/g - zcondices(ig)*ptimestep) )
     377      if ( zcondices(ig) * ptimestep>availco2 ) then
     378        zcondices(ig) = availco2/ptimestep
     379        zdiceco2(ig) = zcondices(ig) + zfallice(ig)
     380        pdtsrfc(ig) = (latcond/pcapcal(ig)) *  (zcondices(ig)+zfallheat)
    330381      end if
    331382!----------------------------------------------------------------------------------------------------------------------!
     
    364415        end if
    365416      end if
    366 !----------------------------------------------------------------------------------------------------------------------!
    367 !   5.6.b. Set albedo and emissivity of the surface
    368 !----------------------------------------------------------------------------------------------------------------------!
    369       call albedocaps(zls,ngrid,piceco2,psolaralb,emisref)
    370417!----------------------------------------------------------------------------------------------------------------------!
    371418!   5.6.c. Set pemisurf to emissiv when there is bare surface (needed for co2snow)
     
    481528#else
    482529      do l = 1, nlayer
    483         if (.not. co2clouds) then
    484 !         Tendencies on T
    485           pdtc(ig,l) = (1./masse(l)) * ( zmflux(l)*(ztm(l) - zt(l))  - zmflux(l+1)*(ztm(l+1) - zt(l)) &
    486                          + zcondicea(ig,l)*(ztcond(ig,l)-zt(l)) )
    487         else
    488           pdtc(ig,l) = (1./masse(l)) * ( zmflux(l)*(ztm(l) - zt(l))  - zmflux(l+1)*(ztm(l+1) - zt(l)) )
    489         end if
     530!       Tendencies on T
     531        pdtc(ig,l) = (1./masse(l)) * ( zmflux(l)*(ztm(l) - zt(l))  - zmflux(l+1)*(ztm(l+1) - zt(l)) )
    490532
    491533!       Tendencies on U
     
    513555  end do  ! loop on ig
    514556!----------------------------------------------------------------------------------------------------------------------!
     557!   5.6.b. Set albedo and emissivity of the surface
     558!----------------------------------------------------------------------------------------------------------------------!
     559  call albedocaps(zls,ngrid,piceco2,psolaralb,emisref)
     560!----------------------------------------------------------------------------------------------------------------------!
    515561! 6. CO2 snow / clouds scheme
    516562!----------------------------------------------------------------------------------------------------------------------!
    517   call co2snow(ngrid, nlayer, ptimestep, emisref, condsub, pplev, zcondicea, zcondices, zdqssed_co2*ptimestep, &
     563  call co2snow(ngrid, nlayer, ptimestep, emisref, condsub, pplev, zcondicea, zcondices, zdqssed_co2, &
    518564               pemisurf)
    519565!----------------------------------------------------------------------------------------------------------------------!
  • trunk/LMDZ.MARS/libf/phymars/co2snow.F

    r2362 r2447  
    3131#include "callkeys.h"
    3232
    33 
    3433c=======================================================================
    3534c     Variables
     
    5049                                  !   (kg/m2/s)       
    5150     &   pfallice(ngrid,nlayer+1) ! falling CO2 ice (kg/m2/s)
    52                            
     51
    5352      logical, intent(in) ::
    5453     &   condsub(ngrid) ! true if there is CO2 condensation or
     
    107106      do ig = 1, ngrid
    108107        if (condsub(ig)) then
     108
    109109          if (latitude(ig).lt.0.) then
    110110              icap = 2 ! Southern hemisphere
     
    123123     &       - pemisurf(ig)
    124124     &      ) / ptimestep
    125          
    126125          pemisurf(ig) = pemisurf(ig) + zdemisurf * ptimestep
    127126          if (pemisurf(ig).lt.0.1) then
  • trunk/LMDZ.MARS/libf/phymars/conf_phys.F

    r2417 r2447  
    565565         write(*,*) " hdofrac = ",hdofrac
    566566
     567! Activeco2ice
     568         write(*,*) "Radiatively active transported atmospheric ",
     569     &              "Co2 ice ?"
     570         activeco2ice=.false. ! default value
     571         call getin_p("activeco2ice",activeco2ice)
     572         write(*,*) " activeco2ice = ",activeco2ice
    567573
    568574! sub-grid cloud fraction: fixed
     
    650656
    651657         
     658         if (activeco2ice.and..not.co2clouds) then
     659          print*,'if activeco2ice is used, co2clouds should be used too'
     660          call abort_physic(modname,
     661     &          "activeco2ice requires co2clouds",1)
     662         endif
     663
    652664! water ice clouds effective variance distribution for sedimentaion       
    653665        write(*,*) "Sed effective variance for water ice clouds ?"
     
    834846         name_iaer(1) = "dust_conrath"   !! default choice is good old Conrath profile
    835847         IF (doubleq.AND.active) name_iaer(1) = "dust_doubleq" !! two-moment scheme
     848
    836849         if (nq.gt.1) then
    837           ! trick to avoid problems compiling with 1 tracer
    838           ! and picky compilers who know name_iaer(2) is out of bounds
    839           j=2
    840          IF (rdstorm.AND..NOT.activice.AND..NOT.slpwind) name_iaer(2) =
    841      &                       "stormdust_doubleq" !! storm dust two-moment scheme
    842          IF (rdstorm.AND.water.AND.activice.AND..NOT.slpwind)
    843      &              name_iaer(3) = "stormdust_doubleq"
    844          IF (slpwind.AND..NOT.activice.AND..NOT.rdstorm) name_iaer(2) =
    845      &                       "topdust_doubleq" !! storm dust two-moment scheme
    846          IF (slpwind.AND.water.AND.activice.AND..NOT.rdstorm)
    847      &              name_iaer(3) =  "topdust_doubleq"
    848          IF (rdstorm.AND.slpwind.AND..NOT.activice) THEN
    849              name_iaer(2) = "stormdust_doubleq"
    850              name_iaer(3) = "topdust_doubleq"
    851          ENDIF
    852          IF (rdstorm.AND.slpwind.AND.water.AND.activice) THEN
    853              name_iaer(3) = "stormdust_doubleq"
    854              name_iaer(4) = "topdust_doubleq"
    855          ENDIF
    856          IF (water.AND.activice) name_iaer(j) = "h2o_ice"      !! radiatively-active clouds
    857          IF (submicron.AND.active) name_iaer(j) = "dust_submicron" !! JBM experimental stuff
     850           ! trick to avoid problems compiling with 1 tracer
     851           ! and picky compilers who know name_iaer(2) is out of bounds
     852           j=2
     853           IF (rdstorm.AND..NOT.activice.AND..NOT.slpwind) then
     854             name_iaer(j) = "stormdust_doubleq" !! storm dust two-moment scheme
     855             j = j+1
     856           END IF
     857
     858           IF (rdstorm.AND.water.AND.activice.AND..NOT.slpwind) then
     859             name_iaer(j) = "stormdust_doubleq"
     860             j = j+1
     861           END IF
     862
     863           IF (slpwind.AND..NOT.activice.AND..NOT.rdstorm) then
     864             name_iaer(j) = "topdust_doubleq" !! storm dust two-moment scheme
     865             j = j+1
     866           END IF
     867 
     868           IF (slpwind.AND.water.AND.activice.AND..NOT.rdstorm) then
     869             name_iaer(j) =  "topdust_doubleq"
     870             j = j+1
     871           END IF
     872
     873           IF (rdstorm.AND.slpwind.AND..NOT.activice) THEN
     874             name_iaer(j) = "stormdust_doubleq"
     875             name_iaer(j+1) = "topdust_doubleq"
     876             j = j+2
     877           ENDIF
     878
     879           IF (rdstorm.AND.slpwind.AND.water.AND.activice) THEN
     880             name_iaer(j) = "stormdust_doubleq"
     881             name_iaer(j+1) = "topdust_doubleq"
     882             j = j+2
     883           ENDIF
     884
     885           IF (water.AND.activice) then
     886            name_iaer(j) = "h2o_ice"      !! radiatively-active clouds
     887            j = j+1
     888           END IF
     889
     890           IF (co2clouds.AND.activeco2ice) then
     891             name_iaer(j) = "co2_ice" !! radiatively-active co2 clouds
     892             j = j+1
     893           ENDIF
     894
     895           IF (submicron.AND.active) then
     896             name_iaer(j) = "dust_submicron" !! JBM experimental stuff
     897             j = j+1
     898           ENDIF
    858899         endif ! of if (nq.gt.1)
    859 
    860900c        ----------------------------------------------------------
    861901
  • trunk/LMDZ.MARS/libf/phymars/improvedco2clouds_mod.F90

    r2394 r2447  
    291291  ! pqeff traceur kg/kg; sum_subpdq tendance idem .s-1
    292292  zq(:,:,:) = pqeff(:,:,:) + sum_subpdq(:,:,:) * microtimestep
    293 
    294293  where( zq(:,:,:) < threshold ) zq(:,:,:) = threshold
    295294
  • trunk/LMDZ.MARS/libf/phymars/physiq_mod.F

    r2443 r2447  
    251251      real rsedcloud(ngrid,nlayer) ! Cloud sedimentation radius
    252252      real rhocloud(ngrid,nlayer)  ! Cloud density (kg.m-3)
     253      real rsedcloudco2(ngrid,nlayer) ! CO2 Cloud sedimentation radius
     254      real rhocloudco2(ngrid,nlayer)  ! CO2 Cloud density (kg.m-3)
     255      real nuiceco2(ngrid,nlayer) ! Estimated effective variance of the
     256                                  !   size distribution
    253257      REAL inertiesoil(ngrid,nsoilmx) ! Time varying subsurface
    254258                                      ! thermal inertia (J.s-1/2.m-2.K-1)
     
    506510
    507511c=======================================================================
    508 c---------- begin added by CM
    509512      pdq(:,:,:) = 0.
    510 c---------end added by CM
    511513
    512514
     
    544546     &         mem_Mccn_co2,mem_Nccn_co2,
    545547     &         mem_Mh2o_co2,watercap)
    546 
    547548
    548549#else
     
    864865           IF(callnlte) then
    865866              if(nltemodel.eq.0.or.nltemodel.eq.1) then
    866                  CALL nltecool(ngrid,nlayer,nq,zplay,pt,pq,zdtnlte)
     867                CALL nltecool(ngrid,nlayer,nq,zplay,pt,pq,zdtnlte)
    867868              else if(nltemodel.eq.2) then
    868869                co2vmr_gcm(1:ngrid,1:nlayer)=
     
    934935     &     fluxtop_sw,tau_pref_scenario,tau_pref_gcm,
    935936     &     tau,aerosol,dsodust,tauscaling,dust_rad_adjust,
    936      &     taucloudtes,rdust,rice,nuice,co2ice,rstormdust,rtopdust,
    937      &     totstormfract,clearatm,dsords,dsotop,alpha_hmons,nohmons,
    938      &     clearsky,totcloudfrac)
    939 
     937     &     taucloudtes,rdust,rice,nuice,riceco2,nuiceco2,co2ice,
     938     &     rstormdust,rtopdust,totstormfract,clearatm,dsords,dsotop,
     939     &     alpha_hmons,nohmons,clearsky,totcloudfrac)
    940940           ! case of sub-grid water ice clouds: callradite for the clear case
    941941            IF (CLFvarying) THEN
     
    944944               ! if
    945945               ! CLFvarying ...) ?? AP ??
    946                clearsky=.true. !
     946               clearsky=.true.  
    947947               CALL callradite(icount,ngrid,nlayer,nq,zday,zls,pq,
    948948     &              albedo,emis,mu0,zplev,zplay,pt,tsurf,fract,
     
    952952     &              tau,aerosol,dsodust,tauscaling,dust_rad_adjust,
    953953     &              taucloudtesclf,rdust,
    954      &              rice,nuice,co2ice,rstormdust,rtopdust,totstormfract,
     954     &              rice,nuice,riceco2, nuiceco2,co2ice,rstormdust,
     955     &              rtopdust,totstormfract,
    955956     &              clearatm,dsords,dsotop,alpha_hmons,nohmons,
    956957     &              clearsky,totcloudfrac)
     
    13181319     &        zcondicea_co2microp,sensibFlux,
    13191320     &        dustliftday,local_time,watercap,dwatercap_dif)
    1320 
    13211321          DO ig=1,ngrid
    13221322             zdtsurf(ig)=zdtsurf(ig)+zdtsdif(ig)
     
    16251625     &           pq,pdq,zdqcloudco2,zdtcloudco2,
    16261626     &           nq,tau,tauscaling,rdust,rice,riceco2,nuice,
    1627      &           rsedcloud,rhocloud,zzlev,zdqssed_co2,
     1627     &           rhocloud, rsedcloudco2,rhocloudco2,zzlev,zdqssed_co2,
    16281628     &           pdu,pu,zcondicea_co2microp, co2ice)
    16291629
     
    21562156       ENDDO
    21572157
    2158       ! test for co2 conservation with co2 microphysics
    2159       if (igcm_co2_ice.ne.0) then
    2160         ! Total mass of co2
    2161         mtotco2 = 0.
    2162         icetotco2 = 0.
    2163         vaptotco2 = 0.
    2164         do ig=1,ngrid
    2165           do l=1,nlayer
    2166             vaptotco2 = vaptotco2 + zq(ig,l,igcm_co2) *
    2167      &                    (zplev(ig,l) - zplev(ig,l+1)) / g
    2168             icetotco2 = icetotco2 + zq(ig,l,igcm_co2_ice) *
    2169      &                    (zplev(ig,l) - zplev(ig,l+1)) / g
    2170           end do
    2171           mtotco2 = mtotco2 + co2ice(ig)
    2172         end do
    2173         mtotco2 = mtotco2 + vaptotco2 + icetotco2
    2174       endif ! of if (igcm_co2_ice.ne.0)
    2175 
    21762158c    Compute surface stress : (NB: z0 is a common in surfdat.h)
    21772159c     DO ig=1,ngrid
     
    24322414c               if (icetot(ig)*1e3.lt.0.01) rave(ig)=0.
    24332415             enddo
    2434 
    24352416             call watersat(ngrid*nlayer,zt,zplay,zqsat)
    24362417             satu(:,:) = zq(:,:,igcm_h2o_vap)/zqsat(:,:)
     
    28182799c        WRITEDIAGFI can ALSO be called from any other subroutines
    28192800c        for any variables !!
    2820 c        call WRITEDIAGFI(ngrid,"emis","Surface emissivity","w.m-1",2,
    2821 c    &                  emis)
     2801c         call WRITEDIAGFI(ngrid,"emis","Surface emissivity","w.m-1",2,
     2802c     &                  emis)
    28222803c        call WRITEDIAGFI(ngrid,"pplay","Pressure","Pa",3,zplay)
    28232804c        call WRITEDIAGFI(ngrid,"pplev","Pressure","Pa",3,zplev)
     
    28682849     &                         '',2,taucloudtes)
    28692850             endif
    2870 
    28712851#else
    28722852      !!! this is to ensure correct initialisation of mesoscale model
     
    37743754     &                   'temperature variation of CO2 latent heat',
    37753755     &                   'K/s',3,zdtcloudco2)
     3756         call WRITEDIAGFI(ngrid,"emis","Surface emissivity","w.m-1",2,
     3757     &                  emis)
     3758
    37763759      end if
    37773760         
     
    37943777
    37953778      END IF       ! if(ngrid.ne.1)
    3796 
    37973779! test for co2 conservation with co2 microphysics
    37983780      if (igcm_co2_ice.ne.0) then
     
    38103792     &                     'Total CO2 mass conservation in physic',
    38113793     &                     '%',0,(co2totA-co2totB)/co2totA)
    3812         call test_vmr(pq(:,:,igcm_co2), pdq(:,:,igcm_co2), ptimestep,
    3813      &                 ngrid, nlayer, 'end physiq_mod')
    38143794      endif ! of if (igcm_co2_ice.ne.0)
    38153795! XIOS outputs
  • trunk/LMDZ.MARS/libf/phymars/suaer.F90

    r2311 r2447  
    154154!       Reference wavelength in the infrared:
    155155        longrefir(iaer)=12.1E-6  ! 825cm-1 TES/MGS
     156!==================================================================
     157        CASE("co2_ice") aerkind             ! CO2 ice crystals
     158!==================================================================
     159!       Visible domain:
     160        file_id(iaer,1) = 'optprop_co2ice_vis_n50.dat' !
     161!       Infrared domain:
     162        file_id(iaer,2) = 'optprop_co2ice_ir_n50.dat'  !
     163!       Reference wavelength in the visible:
     164        longrefvis(iaer) = 0.67E-6  ! 1.5um OMEGA/MEx
     165!       Reference wavelength in the infrared:
     166        longrefir(iaer) = 1E-6   ! 1 micron a vérifier si on prends cette valeur
    156167!==================================================================
    157168        CASE("stormdust_doubleq") aerkind   ! Two-moment scheme for stormdust - radiative properties
  • trunk/LMDZ.MARS/libf/phymars/updatereffrad_mod.F

    r2409 r2447  
    77      SUBROUTINE updatereffrad(ngrid,nlayer,
    88     &                rdust,rstormdust,rtopdust,rice,nuice,
    9      &                reffrad,nueffrad,
     9     &                reffrad,nueffrad, riceco2, nuiceco2,
    1010     &                pq,tauscaling,tau,pplay)
    1111       USE updaterad, ONLY: updaterdust, updaterice_micro,
    12      &                      updaterice_typ
     12     &                      updaterice_microco2, updaterice_typ
    1313       use tracer_mod, only: nqmx, igcm_dust_mass, igcm_dust_number,
    1414     &                       igcm_h2o_ice, igcm_ccn_mass, radius,
     15     &                       igcm_co2_ice, nuiceco2_ref,
     16     &                       igcm_ccnco2_number, igcm_ccnco2_mass,
    1517     &                       igcm_ccn_number, nuice_ref, varian,
    1618     &                       ref_r0, igcm_dust_submicron,
     
    6870      REAL, INTENT(out) :: nueffrad(ngrid,nlayer,naerkind)
    6971      REAL, INTENT(in) :: tauscaling(ngrid)         ! Convertion factor for qccn and Nccn
    70      
     72c     CO2 ice mean radius (m)
     73      REAL, INTENT(out) :: riceco2(ngrid,nlayer) ! co2 ice radius
     74      REAL, INTENT(out) :: nuiceco2(ngrid,nlayer)
     75
     76     
    7177c     Local variables:
    7278c     ---------------
     
    8591      REAL Mo,No                       ! Mass and number of ccn
    8692      REAL rhocloud(ngrid,nlayer)  ! Cloud density (kg.m-3)
     93c     For CO2 microphysics only:
     94      REAL :: rhocloudco2(ngrid, nlayer) ! co2 cloud density
    8795
    8896      LOGICAL,SAVE :: firstcall=.true.
     
    176184       ENDIF ! of if (water.AND.activice)
    177185
     186
     187c       1.3 CO2-ice particles --- in progress.....
     188c       ----------------------- j'ai juste copié-collé la partie 1.2
     189
     190        IF (co2clouds.AND.activeco2ice) THEN
     191
     192c    At firstcall, the true number and true mass of cloud condensation nuclei are not known.
     193c    Indeed it is scaled on the prescribed dust opacity via a 'tauscaling' coefficient
     194c    computed after radiative transfer. If tauscaling is not in startfi, we make an assumption for its value.
     195
     196          IF (firstcall) THEN
     197            !IF (minval(tauscaling).lt.0) tauscaling(:) = 1.e-3 ! default value when non-read in startfi is -1
     198            !IF (freedust)                tauscaling(:) = 1.    ! if freedust, enforce no rescaling at all
     199            firstcall = .false.
     200          ENDIF
     201          DO l=1,nlayer
     202            DO ig=1,ngrid
     203              call updaterice_microco2(pq(ig,l,igcm_co2_ice),
     204     &                              pq(ig,l,igcm_ccnco2_mass),
     205     &                              pq(ig,l,igcm_ccnco2_number),
     206     &                              tauscaling(ig),riceco2(ig,l),
     207     &                              rhocloudco2(ig,l))
     208              nuiceco2(ig,l) = nuiceco2_ref
     209            END DO
     210          ENDDO
     211        ENDIF ! of if (co2clouds.AND.activeco2ice)
     212
    178213c==================================================================
    179214c 2. Radius used in the radiative transfer code (reffrad)
     
    227262          ENDDO
    228263c==================================================================
     264        CASE("co2_ice") aerkind             ! CO2 ice crystals
     265c==================================================================
     266          DO l=1,nlayer
     267            DO ig=1,ngrid
     268              reffrad(ig,l,iaer)=riceco2(ig,l)*(1.+nuiceco2_ref)
     269              nueffrad(ig,l,iaer)=nuiceco2_ref
     270            ENDDO
     271          ENDDO
     272c==================================================================
    229273        CASE("stormdust_doubleq") aerkind! Two-moment scheme for
    230274c       stormdust; same distribution than normal dust
Note: See TracChangeset for help on using the changeset viewer.