Changeset 4188 for LMDZ6/branches


Ignore:
Timestamp:
Jun 29, 2022, 9:23:14 AM (23 months ago)
Author:
idelkadi
Message:

Implementation of the Ecrad radiative transfer code in the LMD model (continued) :
Integration of aerosols (direct effect)

Location:
LMDZ6/branches/LMDZ_ECRad/libf/phylmd
Files:
2 added
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation_aerosol_optics.F90

    r4182 r4188  
    8989         &  IAerosolClassUndefined,   IAerosolClassIgnored, &
    9090         &  IAerosolClassHydrophobic, IAerosolClassHydrophilic
     91    USE phys_local_var_mod, ONLY: rhcl
    9192
    9293    integer, intent(in) :: nlev               ! number of model levels
     
    187188      end if
    188189
    189       call gas%get(IH2O, IMassMixingRatio, h2o_mmr, istartcol=istartcol)
     190!AI juin 2022     
     191      !call gas%get(IH2O, IMassMixingRatio, h2o_mmr, istartcol=istartcol)
    190192
    191193      ! Loop over position
     
    195197          ! saturation and the index to the relative-humidity index of
    196198          ! hydrophilic-aerosol data
    197           rh  = h2o_mmr(jcol,jlev) / thermodynamics%h2o_sat_liq(jcol,jlev)
    198           irh = ao%calc_rh_index(rh)
     199! AI juin 2022         
     200!          rh  = h2o_mmr(jcol,jlev) / thermodynamics%h2o_sat_liq(jcol,jlev)
     201!          irh = ao%calc_rh_index(rh)
     202          irh = ao%calc_rh_index(rhcl(jcol,jlev))
     203!          print*,'irh=',irh
    199204
    200205          factor = ( thermodynamics%pressure_hl(jcol,jlev+1) &
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation_scheme.F90

    r4115 r4188  
    1313SUBROUTINE RADIATION_SCHEME &
    1414! Inputs
    15      & (KIDIA, KFDIA, KLON, KLEV, KAEROLMDZ, NSW, &
     15     & (KIDIA, KFDIA, KLON, KLEV, KAEROSOL, NSW, &
    1616     &  IDAY, TIME, &
    1717     &  PSOLAR_IRRADIANCE, &
     
    117117INTEGER(KIND=JPIM),INTENT(IN) :: KLEV     ! Number of levels
    118118!INTEGER, INTENT(IN) :: KLON, KLEV
    119 INTEGER(KIND=JPIM),INTENT(IN) :: KAEROLMDZ ! Number of aerosol types
     119!INTEGER(KIND=JPIM),INTENT(IN) :: KAEROLMDZ ! Number of aerosol types
     120INTEGER(KIND=JPIM),INTENT(IN) :: KAEROSOL
    120121INTEGER(KIND=JPIM),INTENT(IN) :: NSW ! Numbe of bands
    121122
    122123! AI ATTENTION
    123 INTEGER, PARAMETER :: KAEROSOL = 12
     124!INTEGER, PARAMETER :: KAEROSOL = 12
    124125
    125126! *** Single-level fields
     
    313314if (lprint_input) then
    314315  print*,'********** Verification des entrees *************'
    315   print*,'KIDIA, KFDIA, KLON, KLEV, KAEROLMDZ, NSW =', &
    316         KIDIA, KFDIA, KLON, KLEV, KAEROLMDZ, NSW
     316  print*,'KIDIA, KFDIA, KLON, KLEV, KAEROSOL, NSW =', &
     317        KIDIA, KFDIA, KLON, KLEV, KAEROSOL, NSW
    317318  print*,'IDAY, TIME =', IDAY, TIME
    318319  print*,'PSOLAR_IRRADIANCE =', PSOLAR_IRRADIANCE
     
    510511
    511512print*,'******** AEROSOLS (allocate + input) **************************************'
    512 IF (NAERMACC > 0) THEN
     513!IF (NAERMACC > 0) THEN
    513514  CALL aerosol%allocate(KLON, 1, KLEV, KAEROSOL) ! MACC climatology
    514 ELSE
    515   CALL aerosol%allocate(KLON, 1, KLEV, 6) ! Tegen climatology
    516 ENDIF
     515!ELSE
     516!  CALL aerosol%allocate(KLON, 1, KLEV, 6) ! Tegen climatology
     517!ENDIF
    517518! Compute the dry mass of each layer neglecting humidity effects, in
    518519! kg m-2, needed to scale some of the aerosol inputs
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation_setup.F90

    r4115 r4188  
    238238      ! hydrophobic black carbon, 11 ammonium sulphate, 12 inactive
    239239      ! SO2
    240       rad_config%n_aerosol_types = 12
    241       if (lprint_setp) then
    242         print*,'rad_config%n_aerosol_types =', rad_config%n_aerosol_types
    243       endif
     240!      rad_config%n_aerosol_types = 12
     241!      if (lprint_setp) then
     242!        print*,'rad_config%n_aerosol_types =', rad_config%n_aerosol_types
     243!      endif
    244244
    245245      ! Indices to the aerosol optical properties in
     
    247247      ! index hydrophilic aerosol types and positive numbers index
    248248      ! hydrophobic aerosol types
    249       rad_config%i_aerosol_type_map = 0 ! There can be up to 256 types
     249!      rad_config%i_aerosol_type_map = 0 ! There can be up to 256 types
    250250!      if (lprint_setp) then
    251251!        print*,'rad_config%i_aerosol_type_map =', rad_config%i_aerosol_type_map
    252252!      endif
    253253
    254       rad_config%i_aerosol_type_map(1:12) = (/ &
    255            &  -1, &  ! Sea salt, size bin 1 (OPAC)
    256            &  -2, &  ! Sea salt, size bin 2 (OPAC)
    257            &  -3, &  ! Sea salt, size bin 3 (OPAC)
    258            &   7, &  ! Desert dust, size bin 1 (Woodward 2001)
    259            &   8, &  ! Desert dust, size bin 2 (Woodward 2001)
    260            &   9, &  ! Desert dust, size bin 3 (Woodward 2001)
    261            &  -4, &  ! Hydrophilic organic matter (OPAC)
    262            &  10, &  ! Hydrophobic organic matter (OPAC)
    263            &  11, &  ! Black carbon (Boucher)
    264            &  11, &  ! Black carbon (Boucher)
    265            &  -5, &  ! Ammonium sulphate (OPAC)
    266            &  14 /)  ! Stratospheric sulphate (hand edited from OPAC)
     254!      rad_config%i_aerosol_type_map(1:12) = (/ &
     255!           &  -1, &  ! Sea salt, size bin 1 (OPAC)
     256!           &  -2, &  ! Sea salt, size bin 2 (OPAC)
     257!           &  -3, &  ! Sea salt, size bin 3 (OPAC)
     258!           &   7, &  ! Desert dust, size bin 1 (Woodward 2001)
     259!           &   8, &  ! Desert dust, size bin 2 (Woodward 2001)
     260!           &   9, &  ! Desert dust, size bin 3 (Woodward 2001)
     261!           &  -4, &  ! Hydrophilic organic matter (OPAC)
     262!           &  10, &  ! Hydrophobic organic matter (OPAC)
     263!           &  11, &  ! Black carbon (Boucher)
     264!           &  11, &  ! Black carbon (Boucher)
     265!           &  -5, &  ! Ammonium sulphate (OPAC)
     266!           &  14 /)  ! Stratospheric sulphate (hand edited from OPAC)
    267267!     if (lprint_setp) then
    268268!       print*,'rad_config%i_aerosol_type_map =', rad_config%i_aerosol_type_map
     
    433433         &  'photosynthetically active radiation, PAR')
    434434
     435     rad_config%i_aerosol_type_map(1:13) = (/ &
     436           &  -1, &  ! Sea salt, size bin 1 (OPAC)
     437           &  -2, &  ! Sea salt, size bin 2 (OPAC)
     438           &  -3, &  ! Sea salt, size bin 3 (OPAC)
     439           &  -4, &  ! Hydrophilic organic matter (OPAC)
     440           &  -5, &  ! Ammonium sulphate (OPAC)
     441           &  -6, &
     442           &  -7, &
     443           &   1, &
     444           &   2, &
     445           &   3, &
     446           &  -8, &
     447           &  -9, &
     448           &   4 /)  ! Stratospheric sulphate (hand edited from OPAC)
     449   rad_config%aerosol_optics_override_file_name = 'aerosol_optics_lmdz.nc'
     450
    435451!    IF (YRERAD%NAERMACC > 0) THEN
    436452      ! With the MACC aerosol climatology we need to add in the
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/phys_local_var_mod.F90

    r4118 r4188  
    2424      REAL, SAVE, ALLOCATABLE :: tr_seri(:,:,:)
    2525      !$OMP THREADPRIVATE(tr_seri)
     26      REAL, SAVE, ALLOCATABLE :: rhcl(:,:)
     27      !$OMP THREADPRIVATE(rhcl)
    2628      REAL, SAVE, ALLOCATABLE :: d_t_dyn(:,:), d_q_dyn(:,:)
    2729      !$OMP THREADPRIVATE(d_t_dyn, d_q_dyn)
     
    116118      !$OMP THREADPRIVATE(d_ts, d_tr)
    117119
     120! aerosols
     121      REAL, SAVE, ALLOCATABLE :: m_allaer (:,:,:)
     122      !$OMP THREADPRIVATE(m_allaer)
    118123! diagnostique pour le rayonnement
    119124      REAL, SAVE, ALLOCATABLE :: topswad_aero(:),  solswad_aero(:)      ! diag
     
    608613      l_mix(:,:,:)=0.;l_mixmin(:,:,:)=0.;tke_dissip(:,:,:)=0.;wprime(:,:,:)=0. ! doit etre initialse car pas toujours remplis
    609614
     615      ALLOCATE(rhcl(klon,klev))
    610616      ALLOCATE(tr_seri(klon,klev,nbtr))
    611617      ALLOCATE(d_t_dyn(klon,klev),d_q_dyn(klon,klev))
     
    647653      ALLOCATE(d_u_lif(klon,klev),d_v_lif(klon,klev))
    648654      ALLOCATE(d_ts(klon,nbsrf), d_tr(klon,klev,nbtr))
     655
     656! aerosols
     657      ALLOCATE(m_allaer(klon,klev,naero_tot))
    649658! Special RRTM
    650659      ALLOCATE(ZLWFT0_i(klon,klev+1),ZSWFT0_i(klon,klev+1),ZFLDN0(klon,klev+1))
     
    937946      DEALLOCATE(l_mixmin,l_mix, tke_dissip,wprime)
    938947
     948      DEALLOCATE(rhcl)
    939949      DEALLOCATE(tr_seri)
    940950      DEALLOCATE(d_t_dyn,d_q_dyn)
     
    10461056      DEALLOCATE(solsw_aerop, solsw0_aerop)
    10471057      DEALLOCATE(topswcf_aerop, solswcf_aerop)
    1048 
     1058!AI Aerosols
     1059      DEALLOCATE(m_allaer)
    10491060!CK LW diagnostics
    10501061      DEALLOCATE(toplwad_aerop, sollwad_aerop)
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/phys_output_write_mod.F90

    r4170 r4188  
    15681568!--OLIVIER
    15691569!This is warranted by treating INCA aerosols as offline aerosols
     1570#ifndef CPP_ECRAD
    15701571       IF (flag_aerosol.GT.0) THEN
    15711572          IF (ALL(types_trac/='inca') .OR. config_inca=='aeNP') THEN
     
    17731774          ENDIF
    17741775       ENDIF
     1776
    17751777       CALL histwrite_phy(o_lwcon, flwc)
    17761778       CALL histwrite_phy(o_iwcon, fiwc)
     
    18071809#endif
    18081810!solbnd end
     1811#endif
    18091812#endif
    18101813
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/physiq_mod.F90

    r4179 r4188  
    132132       ! Variables locales pour effectuer les appels en serie
    133133       t_seri,q_seri,ql_seri,qs_seri,u_seri,v_seri,tr_seri,rneb_seri, &
     134       rhcl, &       
    134135       ! Dynamic tendencies (diagnostics)
    135136       d_t_dyn,d_q_dyn,d_ql_dyn,d_qs_dyn,d_u_dyn,d_v_dyn,d_tr_dyn,d_rneb_dyn, &
     
    813814    ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    814815    !
    815     REAL rhcl(klon,klev)    ! humiditi relative ciel clair
     816!    REAL rhcl(klon,klev)    ! humiditi relative ciel clair
    816817    REAL dialiq(klon,klev)  ! eau liquide nuageuse
    817818    REAL diafra(klon,klev)  ! fraction nuageuse
     
    39693970                     tausum_aero, tau3d_aero)
    39703971             ENDIF
    3971           ELSE                       ! RRTM radiation
     3972          ELSE IF (iflag_rrtm .EQ.1) THEN  ! RRTM radiation
    39723973             IF (aerosol_couple .AND. config_inca == 'aero' ) THEN
    39733974                abort_message='config_inca=aero et rrtm=1 impossible'
     
    40354036                !
    40364037             ENDIF
     4038          ELSE IF (iflag_rrtm .EQ.2) THEN    ! ecrad RADIATION
     4039#ifdef CPP_ECRAD
     4040             !--climatologies or INCA aerosols
     4041             CALL readaerosol_optic_ecrad( debut, aerosol_couple, ok_alw, ok_volcan, &
     4042                  flag_aerosol, flag_bc_internal_mixture, itap, jD_cur-jD_ref, &
     4043                  pdtphys, pplay, paprs, t_seri, rhcl, presnivs,  &
     4044                  tr_seri, mass_solu_aero, mass_solu_aero_pi,  &
     4045                  tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm,  &
     4046                  tausum_aero, drytausum_aero, tau3d_aero)
     4047#else
     4048                abort_message='You should compile with -rad ecrad if running with iflag_rrtm=2'
     4049                CALL abort_physic(modname,abort_message,1)
     4050#endif
    40374051          ENDIF
     4052
    40384053       ELSE   !--flag_aerosol = 0
    40394054          tausum_aero(:,:,:) = 0.
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/radlwsw_m.F90

    r4170 r4188  
    7878! Besoin pour ECRAD de pctsrf, zmasq, longitude, altitude
    7979#ifdef CPP_ECRAD
     80      USE phys_local_var_mod, ONLY: rhcl, m_allaer
    8081      USE geometry_mod, ONLY: latitude, longitude
    8182      USE phys_state_var_mod, ONLY: pctsrf
     
    323324               ZQ_SNOW(klon,klev)           ! Snow cloud mass mixing ratio (kg/kg) ?
    324325  REAL(KIND=8) ZAEROSOL_OLD(KLON,6,KLEV), &  !
    325                ZAEROSOL(KLON,KLEV,naero_tot) !
     326               ZAEROSOL(KLON,KLEV,naero_grp) !
    326327! OUTPUTS
    327328  REAL(KIND=8) ZFLUX_DIR(klon), &           ! Direct compt of surf flux into horizontal plane
     
    11811182!
    11821183! AI ATTENTION Aerosols A REVOIR
    1183 !      DO i = 1, kdlon
    1184 !      DO k = 1, kflev
    1185 !      DO kk= 1, naero_tot
     1184      DO i = 1, kdlon
     1185      DO k = 1, kflev
     1186      DO kk= 1, naero_grp
    11861187!      DO kk=1, NSW
    11871188!
     
    11941195!      PCGA_NAT(i,kflev+1-k,kk)=cg_aero_sw_rrtm(i,k,1,kk)
    11951196!       ZAEROSOL(i,kflev+1-k,kk)=m_allaer(i,k,kk)
    1196 !
    1197 !      ENDDO
    1198 !      ENDDO
    1199 !      ENDDO
     1197       ZAEROSOL(i,kflev+1-k,kk)=m_allaer(i,k,kk)
     1198!
     1199      ENDDO
     1200      ENDDO
     1201      ENDDO
    12001202!-end OB
    12011203!
     
    13451347 
    13461348      CALL RADIATION_SCHEME &
    1347       & (ist, iend, klon, klev, naero_tot, NSW, &
     1349      & (ist, iend, klon, klev, naero_grp, NSW, &
    13481350! ??? naero_tot
    13491351      & day_cur, current_time, &
Note: See TracChangeset for help on using the changeset viewer.