Ignore:
Timestamp:
Mar 19, 2024, 3:34:21 PM (2 months ago)
Author:
idelkadi
Message:

Ecrad update in LMDZ / Implementation of Ecrad double call in LMDZ

  • version 1.6.1 (commit 210d7911380f53a788c3cad73b3cf9b4e022ef87)
  • interface routines between lmdz and ecrad grouped in a new "lmdz" directory
  • double call method redesigned so as to go through the Ecrad initialization and configuration part only once for the entire simulation
  • clean-up in the read.F routine: delete unitules arguments
  • modification of default gas model in namelist (default: ECCKD)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/ecrad/radiation/radiation_interface.F90

    r4773 r4853  
    6868
    6969    ! Load the look-up tables from files in the specified directory
    70     if (config%i_gas_model == IGasModelMonochromatic) then
     70    if (config%i_gas_model_sw == IGasModelMonochromatic) then
    7171      call setup_gas_optics_mono(config, trim(config%directory_name))
    72     else if (config%i_gas_model == IGasModelIFSRRTMG) then
    73       call setup_gas_optics_rrtmg(config, trim(config%directory_name))
    74     else if (config%i_gas_model == IGasModelECCKD) then
    75       call setup_gas_optics_ecckd(config)
     72    else
     73      ! Note that we can run RRTMG and ECCKD for different parts of
     74      ! the spectrum: the setup routines only configure the relevant
     75      ! part.
     76      if (config%i_gas_model_sw == IGasModelIFSRRTMG .or. config%i_gas_model_lw == IGasModelIFSRRTMG) then
     77        call setup_gas_optics_rrtmg(config, trim(config%directory_name))
     78      end if
     79      if (config%i_gas_model_sw == IGasModelECCKD .or. config%i_gas_model_lw == IGasModelECCKD) then
     80        call setup_gas_optics_ecckd(config)
     81      end if
    7682    end if
    7783
     
    122128
    123129    if (config%do_clouds) then
    124       if (config%i_gas_model == IGasModelMonochromatic) then
     130      if (config%i_gas_model_sw == IGasModelMonochromatic) then
    125131        !      call setup_cloud_optics_mono(config)
    126132      elseif (config%use_general_cloud_optics) then
     
    132138
    133139    if (config%use_aerosols) then
    134       if (config%i_gas_model == IGasModelMonochromatic) then
     140      if (config%i_gas_model_sw == IGasModelMonochromatic) then
    135141!        call setup_aerosol_optics_mono(config)
    136142      else
     
    167173    type(gas_type),    intent(inout) :: gas
    168174
    169     if (config%i_gas_model == IGasModelMonochromatic) then
     175    if (config%i_gas_model_sw == IGasModelMonochromatic) then
    170176      call set_gas_units_mono(gas)
    171     elseif (config%i_gas_model == IGasModelECCKD) then
     177    elseif (config%i_gas_model_sw == IGasModelIFSRRTMG &
     178         &  .or. config%i_gas_model_lw == IGasModelIFSRRTMG) then
     179      ! Convert to mass-mixing ratio for RRTMG; note that ecCKD can
     180      ! work with this but performs an internal scaling
     181      call set_gas_units_ifs(gas)
     182    else
     183      ! Use volume mixing ratio preferred by ecCKD
    172184      call set_gas_units_ecckd(gas)
    173     else
    174       call set_gas_units_ifs(gas)
    175185    end if
    176186
     
    196206    use radiation_io,             only : nulout
    197207    use radiation_config,         only : config_type, &
    198          &   IGasModelMonochromatic, IGasModelIFSRRTMG, &
     208         &   IGasModelMonochromatic, IGasModelIFSRRTMG, IGasModelECCKD, &
    199209         &   ISolverMcICA, ISolverSpartacus, ISolverHomogeneous, &
    200210         &   ISolverTripleclouds
     
    227237    use radiation_general_cloud_optics, only : general_cloud_optics
    228238    use radiation_aerosol_optics, only : add_aerosol_optics
    229     USE mod_phys_lmdz_para
    230 
    231239
    232240    ! Inputs
     
    238246    type(thermodynamics_type),intent(in)   :: thermodynamics
    239247    type(gas_type),           intent(in)   :: gas
    240     type(cloud_type),        intent(inout):: cloud
     248    type(cloud_type),         intent(inout):: cloud
    241249    type(aerosol_type),       intent(in)   :: aerosol
    242250    ! Output
     
    297305
    298306    real(jphook) :: hook_handle
    299     integer :: jcol, jlev
    300307
    301308    if (lhook) call dr_hook('radiation_interface:radiation',0,hook_handle)
    302 
    303     if (config%i_solver_sw == ISolverSPARTACUS) then
    304          print*,'Dans radiation, mpi_rank, omp_rank, size, chape inv_cloud = ',&
    305               mpi_rank, omp_rank, &
    306               shape(cloud%inv_cloud_effective_size), &
    307               size(cloud%inv_cloud_effective_size)   
    308 !         do jcol=istartcol, iendcol
    309 !              do jlev=1,nlev
    310 !              print*,'Entree radiation_interf, mpi_rank, omp_rank, jcol, jlev &
    311 !           &  cloud%inv_cloud_effective_size =',mpi_rank, omp_rank, jcol, jlev, &
    312 !           &  cloud%inv_cloud_effective_size(jcol,jlev)
    313 !              enddo
    314 !          enddo
    315     endif
    316 !    cloud%inv_cloud_effective_size=0.05_jprb
    317309
    318310    if (thermodynamics%pressure_hl(istartcol,2) &
     
    339331      ! incoming shortwave flux at each g-point, for the specified
    340332      ! range of atmospheric columns
    341       if (config%i_gas_model == IGasModelMonochromatic) then
     333      if (config%i_gas_model_sw == IGasModelMonochromatic) then
    342334        call gas_optics_mono(ncol,nlev,istartcol,iendcol, config, &
    343335             &  single_level, thermodynamics, gas, lw_albedo, &
    344336             &  od_lw, od_sw, ssa_sw, &
    345337             &  planck_hl, lw_emission, incoming_sw)
    346       else if (config%i_gas_model == IGasModelIFSRRTMG) then
    347         call gas_optics_rrtmg(ncol,nlev,istartcol,iendcol, config, &
    348              &  single_level, thermodynamics, gas, &
    349              &  od_lw, od_sw, ssa_sw, lw_albedo=lw_albedo, &
    350              &  planck_hl=planck_hl, lw_emission=lw_emission, &
    351              &  incoming_sw=incoming_sw)
    352338      else
    353         call gas_optics_ecckd(ncol,nlev,istartcol,iendcol, config, &
    354              &  single_level, thermodynamics, gas, &
    355              &  od_lw, od_sw, ssa_sw, lw_albedo=lw_albedo, &
    356              &  planck_hl=planck_hl, lw_emission=lw_emission, &
    357              &  incoming_sw=incoming_sw)
     339        if (config%i_gas_model_sw == IGasModelIFSRRTMG &
     340             &   .or. config%i_gas_model_lw == IGasModelIFSRRTMG) then
     341          call gas_optics_rrtmg(ncol,nlev,istartcol,iendcol, config, &
     342               &  single_level, thermodynamics, gas, &
     343               &  od_lw, od_sw, ssa_sw, lw_albedo=lw_albedo, &
     344               &  planck_hl=planck_hl, lw_emission=lw_emission, &
     345               &  incoming_sw=incoming_sw)
     346        end if
     347        if (config%i_gas_model_sw == IGasModelECCKD &
     348             &   .or. config%i_gas_model_lw == IGasModelECCKD) then
     349          call gas_optics_ecckd(ncol,nlev,istartcol,iendcol, config, &
     350               &  single_level, thermodynamics, gas, &
     351               &  od_lw, od_sw, ssa_sw, lw_albedo=lw_albedo, &
     352               &  planck_hl=planck_hl, lw_emission=lw_emission, &
     353               &  incoming_sw=incoming_sw)
     354        end if
    358355      end if
    359356
     
    368365        ! Compute hydrometeor absorption/scattering properties in each
    369366        ! shortwave and longwave band
    370         if (config%i_gas_model == IGasModelMonochromatic) then
     367        if (config%i_gas_model_sw == IGasModelMonochromatic) then
    371368          call cloud_optics_mono(nlev, istartcol, iendcol, &
    372369               &  config, thermodynamics, cloud, &
     
    387384
    388385      if (config%use_aerosols) then
    389         if (config%i_gas_model == IGasModelMonochromatic) then
     386        if (config%i_gas_model_sw == IGasModelMonochromatic) then
    390387!          call add_aerosol_optics_mono(nlev,istartcol,iendcol, &
    391388!               &  config, thermodynamics, gas, aerosol, &
     
    474471        else if (config%i_solver_sw == ISolverSPARTACUS) then
    475472          ! Compute fluxes using the SPARTACUS shortwave solver
    476 !             cloud%inv_cloud_effective_size=0.05_jprb
    477 !             do jcol=istartcol, iendcol
    478 !              do jlev=1,nlev
    479 !              print*,'jcol, jlev, dans radiation_interf i &
    480 !               &       cloud%inv_cloud_effective_size =',jcol, jlev, &
    481 !               cloud%inv_cloud_effective_size(jcol,jlev)
    482 !              enddo
    483 !             enddo
    484473          call solver_spartacus_sw(nlev,istartcol,iendcol, &
    485474               &  config, single_level, thermodynamics, cloud, &
Note: See TracChangeset for help on using the changeset viewer.