Ignore:
Timestamp:
Sep 4, 2023, 10:17:16 AM (12 months ago)
Author:
Laurent Fairhead
Message:

Merged with trunk revision 4586 corresponding to june 2023 testing

Location:
LMDZ6/branches/LMDZ_cdrag_LSCE
Files:
5 edited
1 copied

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/LMDZ_cdrag_LSCE

  • LMDZ6/branches/LMDZ_cdrag_LSCE/libf/phylmd/ecrad/radiation_aerosol_optics.F90

    r4489 r4669  
    5353        ! properties and average to the spectral intervals of the
    5454        ! current gas-optics scheme
    55 !        call setup_general_aerosol_optics(config)
    56         call setup_general_aerosol_optics_lmdz(config,trim(config%aerosol_optics_file_name))
     55        call setup_general_aerosol_optics(config)
    5756      else
    5857        ! Read file containing optical properties already in the bands
     
    334333
    335334  end subroutine setup_general_aerosol_optics
    336 
    337     !---------------------------------------------------------------------
    338   ! Read LMDZ file containing high spectral resolution optical properties
    339   ! and average to the spectral intervals of the current gas-optics
    340   ! scheme
    341   subroutine setup_general_aerosol_optics_lmdz(config,file_name)
    342 
    343     use parkind1,                      only : jprb
    344     use yomhook,                       only : lhook, dr_hook
    345 !    use easy_netcdf,                   only : netcdf_file
    346     use radiation_config,              only : config_type
    347     use radiation_aerosol_optics_data, only : aerosol_optics_type
    348     use radiation_spectral_definition, only : SolarReferenceTemperature, &
    349          &                                    TerrestrialReferenceTemperature
    350     use radiation_io,                  only : nulout
    351     use netcdf95, only: nf95_open, nf95_inq_grp_full_ncid, nf95_close, &
    352          nf95_inq_dimid, nf95_inq_varid, nf95_inquire_dimension, &
    353          nf95_get_var, nf95_gw_var
    354     use netcdf, only: nf90_nowrite
    355 
    356 
    357     type(config_type), intent(inout), target :: config
    358 
    359 !    ! The NetCDF file containing the aerosol optics data
    360 !    type(netcdf_file)  :: file
    361 
    362     character(len=*), intent(in):: file_name
    363     ! NetCDF file containing the aerosol optics data
    364 
    365     ! Wavenumber points in NetCDF file
    366     real(jprb), allocatable :: wavenumber(:) ! cm-1
    367 
    368     ! Hydrophilic aerosol properties
    369     real(jprb), allocatable :: mass_ext_philic(:,:,:)    ! Mass-ext coefficient (m2 kg-1)
    370     real(jprb), allocatable :: ssa_philic(:,:,:)         ! Single-scattering albedo
    371     real(jprb), allocatable :: g_philic(:,:,:)           ! Asymmetry factor
    372     real(jprb), allocatable :: lidar_ratio_philic(:,:,:) ! Lidar ratio (sr)
    373 
    374     ! Hydrophobic aerosol properties
    375     real(jprb), allocatable :: mass_ext_phobic(:,:)      ! Mass-ext coefficient (m2 kg-1)
    376     real(jprb), allocatable :: ssa_phobic(:,:)           ! Single-scattering albedo
    377     real(jprb), allocatable :: g_phobic(:,:)             ! Asymmetry factor
    378     real(jprb), allocatable :: lidar_ratio_phobic(:,:)   ! Lidar ratio (sr)
    379 
    380     ! Mapping matrix between optical properties at the wavenumbers in
    381     ! the file, and spectral intervals used by the gas-optics scheme
    382     real(jprb), allocatable :: mapping(:,:)
    383 
    384     ! Pointer to the aerosol optics coefficients for brevity of access
    385     type(aerosol_optics_type), pointer :: ao
    386 
    387     ! Target monochromatic wavenumber for interpolation (cm-1)
    388     real(jprb) :: wavenumber_target
    389 
    390     ! Number of spectral points describing aerosol properties in the
    391     ! shortwave and longwave
    392     integer    :: nspecsw, nspeclw
    393 
    394     ! Number of monochromatic wavelengths required
    395     integer    :: nmono
    396 
    397     integer    :: n_type_philic, n_type_phobic, nrh, nwn
    398     integer    :: jtype, jwl, iwn
    399 
    400     ! Weight of first point in interpolation
    401     real(jprb) :: weight1
    402 
    403     real(jprb) :: hook_handle
    404 
    405     ! Local:
    406     integer ncid, grpid, dimid, varid
    407 
    408     if (lhook) call dr_hook('radiation_aerosol_optics:setup_general_aerosol_optics',0,hook_handle)
    409 
    410     ao => config%aerosol_optics
    411 
    412     ao%use_hydrophilic = .true.
    413     ao%use_monochromatic = .true.
    414     print*,'file_name= ',file_name
    415     call nf95_open(file_name, nf90_nowrite, ncid)
    416     call nf95_inq_grp_full_ncid(ncid, "Hydrophilic", grpid)
    417     call nf95_inq_dimid(grpid, "hur", dimid)
    418     call nf95_inquire_dimension(grpid, dimid, nclen = ao%nrh)
    419 !    allocate(ao%rh_lower(ao%nrh))
    420     call nf95_inq_varid(grpid, "hur_bounds", varid)
    421     call nf95_get_var(grpid, varid, ao%rh_lower, count_nc = [1, ao%nrh])
    422 
    423     ! Hydrophilic/LW_bands:
    424     call nf95_inq_grp_full_ncid(ncid, "Hydrophilic/LW_bands", grpid)
    425     call nf95_inq_varid(grpid, "asymmetry", varid)
    426     call nf95_gw_var(grpid, varid, ao%g_lw_philic)
    427     call nf95_inq_varid(grpid, "single_scat_alb", varid)
    428     call nf95_gw_var(grpid, varid, ao%ssa_lw_philic)
    429     call nf95_inq_varid(grpid, "mass_ext", varid)
    430     call nf95_gw_var(grpid, varid, ao%mass_ext_lw_philic)
    431 
    432     ! Hydrophilic/SW_bands:
    433     call nf95_inq_grp_full_ncid(ncid, "Hydrophilic/SW_bands", grpid)
    434     call nf95_inq_varid(grpid, "asymmetry", varid)
    435     call nf95_gw_var(grpid, varid, ao%g_sw_philic)
    436     ao%g_sw_philic = cshift(ao%g_sw_philic, 1)
    437     call nf95_inq_varid(grpid, "single_scat_alb", varid)
    438     call nf95_gw_var(grpid, varid, ao%ssa_sw_philic)
    439     ao%g_sw_philic = cshift(ao%ssa_sw_philic, 1)
    440     call nf95_inq_varid(grpid, "mass_ext", varid)
    441     call nf95_gw_var(grpid, varid, ao%mass_ext_sw_philic)
    442     ao%g_sw_philic = cshift(ao%mass_ext_sw_philic, 1)
    443 
    444     ! Hydrophilic/Monochromatic:
    445     call nf95_inq_grp_full_ncid(ncid, "Hydrophilic/Monochromatic", grpid)
    446     call nf95_inq_varid(grpid, "mass_ext", varid)
    447     call nf95_gw_var(grpid, varid, ao%mass_ext_mono_philic)
    448 
    449     ! Hydrophobic/LW_bands:
    450     call nf95_inq_grp_full_ncid(ncid, "Hydrophobic/LW_bands", grpid)
    451     call nf95_inq_varid(grpid, "asymmetry", varid)
    452     call nf95_gw_var(grpid, varid, ao%g_lw_phobic)
    453     call nf95_inq_varid(grpid, "single_scat_alb", varid)
    454     call nf95_gw_var(grpid, varid, ao%ssa_lw_phobic)
    455     call nf95_inq_varid(grpid, "mass_ext", varid)
    456     call nf95_gw_var(grpid, varid, ao%mass_ext_lw_phobic)
    457 
    458     ! Hydrophobic/SW_bands:
    459     call nf95_inq_grp_full_ncid(ncid, "Hydrophobic/SW_bands", grpid)
    460     call nf95_inq_varid(grpid, "asymmetry", varid)
    461     call nf95_gw_var(grpid, varid, ao%g_sw_phobic)
    462     ao%g_sw_phobic = cshift(ao%g_sw_phobic, 1)
    463     call nf95_inq_varid(grpid, "single_scat_alb", varid)
    464     call nf95_gw_var(grpid, varid, ao%ssa_sw_phobic)
    465     ao%g_sw_phobic = cshift(ao%ssa_sw_phobic, 1)
    466     call nf95_inq_varid(grpid, "mass_ext", varid)
    467     call nf95_gw_var(grpid, varid, ao%mass_ext_sw_phobic)
    468     ao%g_sw_phobic = cshift(ao%mass_ext_sw_phobic, 1)
    469 ! AI ATTENTION   
    470     call nf95_inq_varid(grpid, "wavenumber", varid)
    471     call nf95_gw_var(grpid, varid, wavenumber)
    472 
    473     ! Hydrophobic/Monochromatic:
    474     call nf95_inq_grp_full_ncid(ncid, "Hydrophobic/Monochromatic", grpid)
    475     call nf95_inq_varid(grpid, "mass_ext", varid)
    476     call nf95_gw_var(grpid, varid, ao%mass_ext_mono_phobic)
    477 
    478 !    call file%get('wavenumber', wavenumber)
    479 !    nwn = size(wavenumber)
    480 
    481 !    call file%get_global_attribute('description_hydrophobic', &
    482 !         &                         ao%description_phobic_str)
    483 
    484 
    485 !      call file%get('relative_humidity1',      ao%rh_lower)
    486 
    487 !      call file%get_global_attribute('description_hydrophilic', &
    488 !           &                         ao%description_philic_str)
    489 
    490     ! Close aerosol scattering file
    491 !    call file%close()
    492 
    493     call nf95_close(ncid)
    494 
    495     ! Get array sizes
    496 !    ao%n_bands_lw = size(ao%mass_ext_lw_phobic, 1)
    497 !    ao%n_bands_sw = size(ao%mass_ext_sw_phobic, 1)
    498 !    ao%n_mono_wl = size(ao%mass_ext_mono_phobic, 1)
    499 !    ao%n_type_phobic = size(ao%mass_ext_lw_phobic, 2)
    500 !    ao%n_type_philic = size(ao%mass_ext_lw_philic, 3)
    501 
    502     ! Allocate memory for mapping arrays
    503 !    ao%ntype = ao%n_type_phobic + ao%n_type_philic
    504 !    allocate(ao%iclass(ao%ntype))
    505 !    allocate(ao%itype(ao%ntype))
    506 
    507 !    ao%iclass = IAerosolClassUndefined
    508 !    ao%itype  = 0
    509 
    510     n_type_phobic = size(mass_ext_phobic, 2)
    511     if (ao%use_hydrophilic) then
    512       n_type_philic = size(mass_ext_philic, 3)
    513       nrh = size(ao%rh_lower)
    514     else
    515       n_type_philic = 0
    516       nrh = 0
    517     end if
    518 
    519     if (config%do_cloud_aerosol_per_sw_g_point) then
    520       nspecsw = config%gas_optics_sw%spectral_def%ng
    521     else
    522       nspecsw = config%gas_optics_sw%spectral_def%nband
    523     end if
    524 
    525     if (config%do_cloud_aerosol_per_lw_g_point) then
    526       nspeclw = config%gas_optics_lw%spectral_def%ng
    527     else
    528       nspeclw = config%gas_optics_lw%spectral_def%nband
    529     end if
    530 
    531     if (allocated(ao%wavelength_mono)) then
    532       ! Monochromatic wavelengths also required
    533       nmono = size(ao%wavelength_mono)
    534     else
    535       nmono = 0
    536     end if
    537 
    538     call ao%allocate(n_type_phobic, n_type_philic, nrh, nspeclw, nspecsw, nmono)
    539 
    540     if (config%do_sw) then
    541       call config%gas_optics_sw%spectral_def%calc_mapping(SolarReferenceTemperature, &
    542            &  wavenumber, mapping, use_bands=(.not. config%do_cloud_aerosol_per_sw_g_point))
    543 
    544       ao%mass_ext_sw_phobic = matmul(mapping, mass_ext_phobic)
    545       ao%ssa_sw_phobic = matmul(mapping, mass_ext_phobic*ssa_phobic) &
    546            &           / ao%mass_ext_sw_phobic
    547       ao%g_sw_phobic = matmul(mapping, mass_ext_phobic*ssa_phobic*g_phobic) &
    548            &         / (ao%mass_ext_sw_phobic*ao%ssa_sw_phobic)
    549 
    550       if (ao%use_hydrophilic) then
    551         do jtype = 1,n_type_philic
    552           ao%mass_ext_sw_philic(:,:,jtype) = matmul(mapping, mass_ext_philic(:,:,jtype))
    553           ao%ssa_sw_philic(:,:,jtype) = matmul(mapping, mass_ext_philic(:,:,jtype) &
    554                &                                        *ssa_philic(:,:,jtype)) &
    555                &           / ao%mass_ext_sw_philic(:,:,jtype)
    556           ao%g_sw_philic(:,:,jtype) = matmul(mapping, mass_ext_philic(:,:,jtype) &
    557                &                       *ssa_philic(:,:,jtype)*g_philic(:,:,jtype)) &
    558                &         / (ao%mass_ext_sw_philic(:,:,jtype)*ao%ssa_sw_philic(:,:,jtype))
    559         end do
    560       end if
    561     end if
    562     if (config%do_lw) then
    563       call config%gas_optics_lw%spectral_def%calc_mapping(TerrestrialReferenceTemperature, &
    564            &  wavenumber, mapping, use_bands=(.not. config%do_cloud_aerosol_per_lw_g_point))
    565 
    566       ao%mass_ext_lw_phobic = matmul(mapping, mass_ext_phobic)
    567       ao%ssa_lw_phobic = matmul(mapping, mass_ext_phobic*ssa_phobic) &
    568            &           / ao%mass_ext_lw_phobic
    569       ao%g_lw_phobic = matmul(mapping, mass_ext_phobic*ssa_phobic*g_phobic) &
    570            &         / (ao%mass_ext_lw_phobic*ao%ssa_lw_phobic)
    571 
    572       if (ao%use_hydrophilic) then
    573         do jtype = 1,n_type_philic
    574           ao%mass_ext_lw_philic(:,:,jtype) = matmul(mapping, mass_ext_philic(:,:,jtype))
    575           ao%ssa_lw_philic(:,:,jtype) = matmul(mapping, mass_ext_philic(:,:,jtype) &
    576                &                                        *ssa_philic(:,:,jtype)) &
    577                &           / ao%mass_ext_lw_philic(:,:,jtype)
    578           ao%g_lw_philic(:,:,jtype) = matmul(mapping, mass_ext_philic(:,:,jtype) &
    579                &                       *ssa_philic(:,:,jtype)*g_philic(:,:,jtype)) &
    580                &         / (ao%mass_ext_lw_philic(:,:,jtype)*ao%ssa_lw_philic(:,:,jtype))
    581         end do
    582       end if
    583     end if
    584 
    585     if (allocated(ao%wavelength_mono)) then
    586       ! Monochromatic wavelengths also required
    587       do jwl = 1,nmono
    588         ! Wavelength (m) to wavenumber (cm-1)
    589         wavenumber_target = 0.01_jprb / ao%wavelength_mono(jwl)
    590         ! Find index to first interpolation point, and its weight
    591         if (wavenumber_target <= wavenumber(1)) then
    592           weight1 = 1.0_jprb
    593           iwn = 1
    594         else if (wavenumber_target >= wavenumber(nwn)) then
    595           iwn = nwn-1
    596           weight1 = 0.0_jprb
    597         else
    598           iwn = 1
    599           do while (wavenumber(iwn+1) < wavenumber_target .and. iwn < nwn-1)
    600             iwn = iwn + 1
    601           end do
    602           weight1 = (wavenumber(iwn+1)-wavenumber_target) &
    603                &  / (wavenumber(iwn+1)-wavenumber(iwn))
    604         end if
    605         ! Linear interpolation
    606         ao%mass_ext_mono_phobic(jwl,:) = weight1 * mass_ext_phobic(iwn,:) &
    607              &             + (1.0_jprb - weight1)* mass_ext_phobic(iwn+1,:)
    608         ao%ssa_mono_phobic(jwl,:)      = weight1 * ssa_phobic(iwn,:) &
    609              &             + (1.0_jprb - weight1)* ssa_phobic(iwn+1,:)
    610         ao%g_mono_phobic(jwl,:)        = weight1 * g_phobic(iwn,:) &
    611              &             + (1.0_jprb - weight1)* g_phobic(iwn+1,:)
    612         ao%lidar_ratio_mono_phobic(jwl,:) = weight1 * lidar_ratio_phobic(iwn,:) &
    613              &                + (1.0_jprb - weight1)* lidar_ratio_phobic(iwn+1,:)
    614         if (ao%use_hydrophilic) then
    615           ao%mass_ext_mono_philic(jwl,:,:) = weight1 * mass_ext_philic(iwn,:,:) &
    616                &               + (1.0_jprb - weight1)* mass_ext_philic(iwn+1,:,:)
    617           ao%ssa_mono_philic(jwl,:,:)      = weight1 * ssa_philic(iwn,:,:) &
    618                &               + (1.0_jprb - weight1)* ssa_philic(iwn+1,:,:)
    619           ao%g_mono_philic(jwl,:,:)        = weight1 * g_philic(iwn,:,:) &
    620                &               + (1.0_jprb - weight1)* g_philic(iwn+1,:,:)
    621           ao%lidar_ratio_mono_philic(jwl,:,:) = weight1 * lidar_ratio_philic(iwn,:,:) &
    622                &                  + (1.0_jprb - weight1)* lidar_ratio_philic(iwn+1,:,:)
    623         end if
    624       end do
    625     end if
    626 
    627     ! Deallocate memory local to this routine
    628     deallocate(mass_ext_phobic)
    629     deallocate(ssa_phobic)
    630     deallocate(g_phobic)
    631     deallocate(lidar_ratio_phobic)
    632     if (ao%use_hydrophilic) then
    633       deallocate(mass_ext_philic)
    634       deallocate(ssa_philic)
    635       deallocate(g_philic)
    636       deallocate(lidar_ratio_philic)
    637     end if
    638 
    639     if (lhook) call dr_hook('radiation_aerosol_optics:setup_general_aerosol_optics',1,hook_handle)
    640 
    641   end subroutine setup_general_aerosol_optics_lmdz
    642    
    643335
    644336  !---------------------------------------------------------------------
  • LMDZ6/branches/LMDZ_cdrag_LSCE/libf/phylmd/ecrad/radiation_cloud_generator.F90

    r4489 r4669  
    541541    use radiation_pdf_sampler, only : pdf_sampler_type
    542542    implicit none
    543 #if defined(__GFORTRAN__) || defined(__PGI) || defined(__NEC__)
    544 #else
    545     !$omp declare simd(sample_from_pdf_simd) uniform(this) &
    546     !$omp linear(ref(fsd)) linear(ref(cdf))
    547 #endif
    548543    type(pdf_sampler_type), intent(in)  :: this
    549544
  • LMDZ6/branches/LMDZ_cdrag_LSCE/libf/phylmd/ecrad/radiation_scheme.F90

    r4489 r4669  
    8787     &  NWEIGHT_PAR, IBAND_PAR, WEIGHT_PAR, &
    8888     &  ITYPE_TROP_BG_AER,  TROP_BG_AER_MASS_EXT, &
    89      &  ITYPE_STRAT_BG_AER, STRAT_BG_AER_MASS_EXT
     89     &  ITYPE_STRAT_BG_AER, STRAT_BG_AER_MASS_EXT, ISolverSpartacus
    9090! Commentes : jour, date de la simulation
    9191!USE YOMRIP0  , ONLY : NINDAT
     
    105105
    106106USE mod_phys_lmdz_para
     107USE setup_config_from_lmdz,   ONLY : driver_config_type
    107108
    108109IMPLICIT NONE
     
    269270! Ratio of cloud overlap decorrelation length for cloud water
    270271! inhomogeneities to that for cloud boundaries (typically 0.5)
    271 REAL(KIND=JPRB)           :: ZDECORR_LEN_RATIO
     272!REAL(KIND=JPRB)           :: ZDECORR_LEN_RATIO = 0.5_jprb
     273
     274!AI mai 2023
     275! A mettre dans namelist
     276!real(jprb) :: high_inv_effective_size
     277!real(jprb) :: middle_inv_effective_size
     278!real(jprb) :: low_inv_effective_size
     279
     280!real(jprb) :: cloud_inhom_separation_factor
     281!real(jprb) :: cloud_separation_scale_surface
     282!real(jprb) :: cloud_separation_scale_toa
     283!real(jprb) :: cloud_separation_scale_power
    272284
    273285! The surface net longwave flux if the surface was a black body, used
     
    290302
    291303! AI ATTENTION
    292 real(jprb), parameter    :: frac_std = 0.75
     304! A mettre dans namelist
     305!real(jprb), parameter    :: frac_std = 0.75
    293306
    294307! Name of file names specified on command line
     
    301314!$OMP THREADPRIVATE(debut_ecrad)
    302315
     316type(driver_config_type) :: driver_config
    303317! Import time functions for iseed calculation
    304318! AI ATTENTION propre a ifs
     
    342356! AI appel radiation_setup
    343357call SETUP_RADIATION_SCHEME(loutput)
     358! Read "radiation_driver" namelist into radiation driver config type
     359  file_name="namelist_ecrad"
     360call driver_config%read(file_name)
     361
     362if (rad_config%i_solver_sw == ISolverSPARTACUS &
     363      & .or.   rad_config%i_solver_lw == ISolverSPARTACUS) then
     364       print*,'Solveur SW: ', rad_config%i_solver_sw
     365       print*,'Solveur LW: ', rad_config%i_solver_lw
     366   if (driver_config%ok_effective_size) then
     367       print*,'low_inv_effective_size = ',driver_config%low_inv_effective_size
     368       print*,'middle_inv_effective_size = ',driver_config%middle_inv_effective_size
     369       print*,'high_inv_effective_size = ',driver_config%high_inv_effective_size
     370   else if (driver_config%ok_separation) then   
     371       print*,'cloud_separation_scale_surface =',driver_config%cloud_separation_scale_surface
     372       print*,'cloud_separation_scale_toa =',driver_config%cloud_separation_scale_toa
     373       print*,'cloud_separation_scale_power =',driver_config%cloud_separation_scale_power
     374       print*,'cloud_inhom_separation_factor =',driver_config%cloud_inhom_separation_factor
     375   endif   
     376endif   
    344377
    345378 if (lprint_config) then
     
    450483cloud%fraction(KIDIA:KFDIA,:) = PCLOUD_FRAC(KIDIA:KFDIA,:)
    451484
    452 !AI ATTENTION a voir avec JL
    453 ! Compute effective radii and convert to metres
    454 !CALL LIQUID_EFFECTIVE_RADIUS(KIDIA, KFDIA, KLON, KLEV, &
    455 !     &  PPRESSURE, PTEMPERATURE, PCLOUD_FRAC, PQ_LIQUID, PQ_RAIN, &
    456 !     &  PLAND_SEA_MASK, PCCN_LAND, PCCN_SEA, &
    457 !     &  ZRE_LIQUID_UM)
     485!!! ok AI ATTENTION a voir avec JL
     486! Compute effective radi and convert to metres
     487! AI. : on passe directement les champs de LMDZ
    458488cloud%re_liq(KIDIA:KFDIA,:) = ZRE_LIQUID_UM(KIDIA:KFDIA,:)
    459 
    460 !CALL ICE_EFFECTIVE_RADIUS(KIDIA, KFDIA, KLON, KLEV, &
    461 !     &  PPRESSURE, PTEMPERATURE, PCLOUD_FRAC, PQ_ICE, PQ_SNOW, PGEMU, &
    462 !     &  ZRE_ICE_UM)
    463489cloud%re_ice(KIDIA:KFDIA,:) = ZRE_ICE_UM(KIDIA:KFDIA,:)
    464490
     
    468494! decorrelation lengths for cloud water content inhomogeneities and
    469495! cloud boundaries, and set it in the "rad_config" object.
     496! IFS :
    470497!CALL CLOUD_OVERLAP_DECORR_LEN(KIDIA, KFDIA, KLON, PGEMU, YRERAD%NDECOLAT, &
    471498!     &    ZDECORR_LEN_KM, PDECORR_LEN_RATIO=ZDECORR_LEN_RATIO)
    472 
    473 ! AI ATTENTION (valeur lue dans namelist)
    474 !ZDECORR_LEN_RATIO = 0.5_JPRB
    475 !rad_config%cloud_inhom_decorr_scaling = ZDECORR_LEN_RATIO
     499! AI valeur dans namelist
     500! rad_config%cloud_inhom_decorr_scaling = ZDECORR_LEN_RATIO
     501
    476502!AI ATTENTION meme valeur que dans offline
    477 ZDECORR_LEN_KM = 2000.0_JPRB
     503! A mettre dans namelist
     504ZDECORR_LEN_KM = driver_config%overlap_decorr_length
    478505DO JLON = KIDIA,KFDIA
    479506  CALL cloud%set_overlap_param(thermodynamics, &
    480        &                       ZDECORR_LEN_KM(JLON), &
    481        &                       istartcol=JLON, iendcol=JLON)
     507       &                 ZDECORR_LEN_KM(JLON), &
     508       &                 istartcol=JLON, iendcol=JLON)
    482509ENDDO
    483510
     511! IFS :
    484512! Cloud water content fractional standard deviation is configurable
    485513! from namelist NAERAD but must be globally constant. Before it was
     
    487515!CALL cloud%create_fractional_std(KLON, KLEV, YRERAD%RCLOUD_FRAC_STD)
    488516! AI ATTENTION frac_std=0.75 meme valeur que dans la version offline
    489 CALL cloud%create_fractional_std(KLON, KLEV, frac_std)
    490 
     517CALL cloud%create_fractional_std(KLON, KLEV, driver_config%frac_std)
     518
     519if (rad_config%i_solver_sw == ISolverSPARTACUS &
     520      & .or.   rad_config%i_solver_lw == ISolverSPARTACUS) then
    491521! AI ! Read cloud properties needed by SPARTACUS
     522!AI ATTENTION meme traitement dans le version offline
     523
    492524! By default mid and high cloud effective size is 10 km
    493525!CALL cloud%create_inv_cloud_effective_size(KLON,KLEV,1.0_JPRB/10000.0_JPRB)
    494 ! But for boundary clouds (eta > 0.8) we set it to 1 km
    495 !DO JLEV = 1,KLEV
    496 !  DO JLON = KIDIA,KFDIA
    497 !    IF (PPRESSURE(JLON,JLEV) > 0.8_JPRB * PPRESSURE_H(JLON,KLEV+1)) THEN
    498 !      cloud%inv_cloud_effective_size(JLON,JLEV) = 1.0e-3_JPRB
    499 !    ENDIF
    500 !  ENDDO
    501 !ENDDO
    502 !AI ATTENTION meme traitement dans le version offline
    503 call cloud%create_inv_cloud_effective_size_eta(KLON, KLEV, &
     526
     527!  if (driver_config%low_inv_effective_size >= 0.0_jprb &
     528!     & .or. driver_config%middle_inv_effective_size >= 0.0_jprb &
     529!     & .or. driver_config%high_inv_effective_size >= 0.0_jprb) then
     530  if (driver_config%ok_effective_size) then
     531     call cloud%create_inv_cloud_effective_size_eta(klon, klev, &
    504532               &  thermodynamics%pressure_hl, &
    505                &  0.005_JPRB, &
    506                &  0.0001_JPRB, &
    507                &  0.0001, 0.8_jprb, 0.45_jprb)     
     533               &  driver_config%low_inv_effective_size, &
     534               &  driver_config%middle_inv_effective_size, &
     535               &  driver_config%high_inv_effective_size, 0.8_jprb, 0.45_jprb)
     536!  else if (driver_config%cloud_separation_scale_surface > 0.0_jprb &
     537!         .and. driver_config%cloud_separation_scale_toa > 0.0_jprb) then
     538  else if (driver_config%ok_separation) then
     539      call cloud%param_cloud_effective_separation_eta(klon, klev, &
     540               &  thermodynamics%pressure_hl, &
     541               &  driver_config%cloud_separation_scale_surface, &
     542               &  driver_config%cloud_separation_scale_toa, &
     543               &  driver_config%cloud_separation_scale_power, &
     544               &  driver_config%cloud_inhom_separation_factor)
     545  endif
     546endif 
    508547
    509548print*,'******** AEROSOLS (allocate + input) **************************************'
  • LMDZ6/branches/LMDZ_cdrag_LSCE/libf/phylmd/ecrad/setup_aerosol_optics_lmdz_m.F90

    r4489 r4669  
    2929    use netcdf95, only: nf95_open, nf95_inq_grp_full_ncid, nf95_close, &
    3030         nf95_inq_dimid, nf95_inq_varid, nf95_inquire_dimension, &
    31          nf95_get_var, nf95_gw_var
    32     use netcdf, only: nf90_nowrite
     31         nf95_get_var, nf95_gw_var, nf95_nowrite
    3332
    3433    type(aerosol_optics_type), intent(out):: ao
     
    4443    ao%use_hydrophilic = .true.
    4544    ao%use_monochromatic = .true.
    46     print*,'file_name= ',file_name
    47     call nf95_open(file_name, nf90_nowrite, ncid)
     45    call nf95_open(file_name, nf95_nowrite, ncid)
    4846    call nf95_inq_grp_full_ncid(ncid, "Hydrophilic", grpid)
    4947    call nf95_inq_dimid(grpid, "hur", dimid)
     
    6967    call nf95_inq_varid(grpid, "single_scat_alb", varid)
    7068    call nf95_gw_var(grpid, varid, ao%ssa_sw_philic)
    71     ao%g_sw_philic = cshift(ao%ssa_sw_philic, 1)
     69    ao%ssa_sw_philic = cshift(ao%ssa_sw_philic, 1)
    7270    call nf95_inq_varid(grpid, "mass_ext", varid)
    7371    call nf95_gw_var(grpid, varid, ao%mass_ext_sw_philic)
    74     ao%g_sw_philic = cshift(ao%mass_ext_sw_philic, 1)
     72    ao%mass_ext_sw_philic = cshift(ao%mass_ext_sw_philic, 1)
    7573
    7674    ! Hydrophilic/Monochromatic:
     
    9593    call nf95_inq_varid(grpid, "single_scat_alb", varid)
    9694    call nf95_gw_var(grpid, varid, ao%ssa_sw_phobic)
    97     ao%g_sw_phobic = cshift(ao%ssa_sw_phobic, 1)
     95    ao%ssa_sw_phobic = cshift(ao%ssa_sw_phobic, 1)
    9896    call nf95_inq_varid(grpid, "mass_ext", varid)
    9997    call nf95_gw_var(grpid, varid, ao%mass_ext_sw_phobic)
    100     ao%g_sw_phobic = cshift(ao%mass_ext_sw_phobic, 1)
     98    ao%mass_ext_sw_phobic = cshift(ao%mass_ext_sw_phobic, 1)
    10199
    102100    ! Hydrophobic/Monochromatic:
Note: See TracChangeset for help on using the changeset viewer.