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_config.F90

    r4773 r4853  
    3434!
    3535
     36#include "ecrad_config.h"
     37
    3638module radiation_config
    3739
     
    202204    ! more random numbers being generated?  This is the default on NEC
    203205    ! SX.
    204 #ifdef __SX__
     206#ifdef DWD_VECTOR_OPTIMIZATIONS
    205207    logical :: use_vectorizable_generator = .true.
    206208#else
     
    276278
    277279    ! Codes describing the gas model
    278     integer :: i_gas_model = IGasModelIFSRRTMG
     280    integer :: i_gas_model_sw = IGasModelIFSRRTMG
     281    integer :: i_gas_model_lw = IGasModelIFSRRTMG
    279282
    280283    ! Optics if i_gas_model==IGasModelMonochromatic.
     
    702705    character(511) :: ssi_override_file_name
    703706    character(63)  :: liquid_model_name, ice_model_name, gas_model_name
     707    character(63)  :: sw_gas_model_name, lw_gas_model_name
    704708    character(63)  :: sw_solver_name, lw_solver_name, overlap_scheme_name
    705709    character(63)  :: sw_entrapment_name, sw_encroachment_name, cloud_pdf_shape_name
     
    709713         &     .false.,.false.,.false.,.false.,.false.,.false.]
    710714    integer :: i_aerosol_type_map(NMaxAerosolTypes) ! More than 256 is an error
    711 
     715   
    712716    logical :: do_nearest_spectral_sw_albedo
    713717    logical :: do_nearest_spectral_lw_emiss
     
    716720    integer :: i_sw_albedo_index(NMaxAlbedoIntervals)
    717721    integer :: i_lw_emiss_index (NMaxAlbedoIntervals)
     722    integer :: i_gas_model
    718723
    719724    integer :: iunit ! Unit number of namelist file
     
    726731         &  do_surface_sw_spectral_flux, do_lw_derivatives, do_toa_spectral_flux, &
    727732         &  do_lw_aerosol_scattering, do_lw_cloud_scattering, &
    728          &  n_regions, directory_name, gas_model_name, &
     733         &  n_regions, directory_name, gas_model_name, sw_gas_model_name, lw_gas_model_name, &
    729734         &  ice_optics_override_file_name, liq_optics_override_file_name, &
    730735         &  aerosol_optics_override_file_name, cloud_pdf_override_file_name, &
     
    815820    encroachment_scaling = -1.0_jprb
    816821    gas_model_name = '' !DefaultGasModelName
     822    sw_gas_model_name = '' !DefaultGasModelName
     823    lw_gas_model_name = '' !DefaultGasModelName
    817824    liquid_model_name = '' !DefaultLiquidModelName
    818825    ice_model_name = '' !DefaultIceModelName
     
    10141021         &            'ice_model_name', this%i_ice_model)
    10151022
    1016     ! Determine gas optics model
     1023    ! Determine gas optics model(s) - firstly try the generic gas_model_name
     1024    i_gas_model = -1
    10171025    call get_enum_code(gas_model_name, GasModelName, &
    1018          &            'gas_model_name', this%i_gas_model)
    1019 
     1026         &            'gas_model_name', i_gas_model)
     1027    if (i_gas_model > -1) then
     1028      this%i_gas_model_sw = i_gas_model
     1029      this%i_gas_model_lw = i_gas_model
     1030    end if
     1031    ! ...then the band-specific values
     1032    call get_enum_code(sw_gas_model_name, GasModelName, &
     1033         &            'sw_gas_model_name', this%i_gas_model_sw)
     1034    call get_enum_code(lw_gas_model_name, GasModelName, &
     1035         &            'lw_gas_model_name', this%i_gas_model_lw)
     1036   
    10201037    ! Determine solvers
    10211038    call get_enum_code(sw_solver_name, SolverName, &
     
    10551072    end if
    10561073
    1057     if (this%i_gas_model == IGasModelIFSRRTMG &
    1058          & .and. (this%use_general_cloud_optics &
    1059          &        .or. this%use_general_aerosol_optics)) then
    1060       if (this%do_sw .and. this%do_cloud_aerosol_per_sw_g_point) then
     1074    if (this%use_general_cloud_optics .or. this%use_general_aerosol_optics) then
     1075      if (this%do_sw .and. this%do_cloud_aerosol_per_sw_g_point &
     1076           &  .and. this%i_gas_model_sw == IGasModelIFSRRTMG) then
    10611077        write(nulout,'(a)') 'Warning: RRTMG SW only supports cloud/aerosol/surface optical properties per band, not per g-point'
    10621078        this%do_cloud_aerosol_per_sw_g_point = .false.
    10631079      end if
    1064       if (this%do_lw .and. this%do_cloud_aerosol_per_lw_g_point) then
     1080      if (this%do_lw .and. this%do_cloud_aerosol_per_lw_g_point &
     1081           &  .and. this%i_gas_model_lw == IGasModelIFSRRTMG) then
    10651082        write(nulout,'(a)') 'Warning: RRTMG LW only supports cloud/aerosol/surface optical properties per band, not per g-point'
    10661083        this%do_cloud_aerosol_per_lw_g_point = .false.
     
    11281145
    11291146    ! If ecCKD gas optics model is being used set relevant file names
    1130     if (this%i_gas_model == IGasModelECCKD) then
     1147    if (this%i_gas_model_sw == IGasModelECCKD .or. this%i_gas_model_lw == IGasModelECCKD) then
    11311148
    11321149      ! This gas optics model usually used with general cloud and
     
    11381155        write(nulout,'(a)') 'Warning: ecCKD gas optics model usually used with general aerosol optics'
    11391156      end if
     1157
     1158    end if
     1159
     1160    if (this%i_gas_model_sw == IGasModelECCKD) then
    11401161
    11411162      if (len_trim(this%gas_optics_sw_override_file_name) > 0) then
     
    11531174      end if
    11541175
     1176    end if
     1177
     1178    if (this%i_gas_model_lw == IGasModelECCKD) then
     1179
    11551180      if (len_trim(this%gas_optics_lw_override_file_name) > 0) then
    11561181        if (this%gas_optics_lw_override_file_name(1:1) == '/') then
     
    11701195
    11711196    if (this%use_spectral_solar_cycle) then
    1172       if (this%i_gas_model /= IGasModelECCKD) then
     1197      if (this%i_gas_model_sw /= IGasModelECCKD) then
    11731198        write(nulerr,'(a)') '*** Error: solar cycle only available with ecCKD gas optics model'
    11741199        call radiation_abort('Radiation configuration error')
     
    12781303    end if
    12791304
    1280     ! In the monochromatic case we need to override the liquid, ice
    1281     ! and aerosol models to ensure compatibility
    1282     if (this%i_gas_model == IGasModelMonochromatic) then
     1305    if (this%i_gas_model_sw == IGasModelMonochromatic .or. this%i_gas_model_lw == IGasModelMonochromatic) then
     1306
     1307      if (this%i_gas_model_sw /= this%i_gas_model_lw) then
     1308        write(nulerr,'(a,i0)') '*** Error: Monochromatic gas optics model must be used in shortwave and longwave'
     1309        call radiation_abort('Radiation configuration error')
     1310      end if
     1311   
     1312      ! In the monochromatic case we need to override the liquid, ice
     1313      ! and aerosol models to ensure compatibility
    12831314      this%i_liq_model = ILiquidModelMonochromatic
    12841315      this%i_ice_model = IIceModelMonochromatic
    12851316      this%use_aerosols = .false.
     1317     
    12861318    end if
    12871319
     
    13921424      call print_logical('  Saving spectral flux profiles', &
    13931425           &   'do_save_spectral_flux', this%do_save_spectral_flux)
    1394       call print_enum('  Gas model is', GasModelName, 'i_gas_model', &
    1395            &          this%i_gas_model)
     1426      call print_enum('  Shortwave gas model is', GasModelName, 'i_gas_model_sw', &
     1427           &          this%i_gas_model_sw)
     1428      call print_enum('  Longwave gas model is', GasModelName, 'i_gas_model_lw', &
     1429           &          this%i_gas_model_lw)
    13961430      call print_logical('  Aerosols are', 'use_aerosols', this%use_aerosols)
    13971431      if (this%use_aerosols) then
     
    14811515             &          'i_solver_sw', this%i_solver_sw)
    14821516       
    1483         if (this%i_gas_model == IGasModelMonochromatic) then
     1517        if (this%i_gas_model_sw == IGasModelMonochromatic) then
    14841518          call print_real('  Shortwave atmospheric optical depth', &
    14851519               &   'mono_sw_total_od', this%mono_sw_total_od)
     
    15021536             &          this%i_solver_lw)
    15031537
    1504         if (this%i_gas_model == IGasModelMonochromatic) then
     1538        if (this%i_gas_model_lw == IGasModelMonochromatic) then
    15051539          if (this%mono_lw_wavelength > 0.0_jprb) then
    15061540            call print_real('  Longwave effective wavelength (m)', &
Note: See TracChangeset for help on using the changeset viewer.