Changeset 4388 for LMDZ6/branches


Ignore:
Timestamp:
Jan 20, 2023, 3:41:14 PM (23 months ago)
Author:
idelkadi
Message:

Code cleanup:

  • Removal of unnecessary arguments in the LMDZ-ECRAD interface routine.
  • deletion of useless comments
Location:
LMDZ6/branches/LMDZ_ECRad/libf/phylmd
Files:
3 edited

Legend:

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

    r4188 r4388  
    1616     &  IDAY, TIME, &
    1717     &  PSOLAR_IRRADIANCE, &
    18      &  PMU0, PTEMPERATURE_SKIN, PALBEDO_DIF, PALBEDO_DIR, &
     18     &  PMU0, PTEMPERATURE_SKIN, &
     19     &  PALBEDO_DIF, PALBEDO_DIR, &
    1920     &  PEMIS, PEMIS_WINDOW, &
    20      &  PCCN_LAND, PCCN_SEA, &
    21      &  PGELAM, PGEMU, PLAND_SEA_MASK, &
    22      &  PPRESSURE, PTEMPERATURE, &
     21     &  PGELAM, PGEMU, &
    2322     &  PPRESSURE_H, PTEMPERATURE_H, PQ, PQSAT, &
    2423     &  PCO2, PCH4, PN2O, PNO2, PCFC11, PCFC12, PHCFC22, &
    2524     &  PCCL4, PO3, PO2, &
    26      &  PCLOUD_FRAC, PQ_LIQUID, PQ_ICE, PQ_RAIN, PQ_SNOW, &
     25     &  PCLOUD_FRAC, PQ_LIQUID, PQ_ICE, PQ_SNOW, &
    2726     &  ZRE_LIQUID_UM, ZRE_ICE_UM, &
    2827     &  PAEROSOL_OLD, PAEROSOL, &
     
    140139REAL(KIND=JPRB),   INTENT(IN) :: PGEMU(KLON)
    141140! Land-sea mask
    142 REAL(KIND=JPRB),   INTENT(IN) :: PLAND_SEA_MASK(KLON)
     141!REAL(KIND=JPRB),   INTENT(IN) :: PLAND_SEA_MASK(KLON)
    143142
    144143! *** Variables on full levels
    145 REAL(KIND=JPRB),   INTENT(IN) :: PPRESSURE(KLON,KLEV)    ! (Pa)
    146 REAL(KIND=JPRB),   INTENT(IN) :: PTEMPERATURE(KLON,KLEV) ! (K)
     144!REAL(KIND=JPRB),   INTENT(IN) :: PPRESSURE(KLON,KLEV)    ! (Pa)
     145!REAL(KIND=JPRB),   INTENT(IN) :: PTEMPERATURE(KLON,KLEV) ! (K)
    147146! *** Variables on half levels
    148147REAL(KIND=JPRB),   INTENT(IN) :: PPRESSURE_H(KLON,KLEV+1)    ! (Pa)
     
    168167REAL(KIND=JPRB),   INTENT(IN) :: PQ_LIQUID(KLON,KLEV)
    169168REAL(KIND=JPRB),   INTENT(IN) :: PQ_ICE(KLON,KLEV)
    170 REAL(KIND=JPRB),   INTENT(IN) :: PQ_RAIN(KLON,KLEV)
     169!REAL(KIND=JPRB),   INTENT(IN) :: PQ_RAIN(KLON,KLEV)
    171170REAL(KIND=JPRB),   INTENT(IN) :: PQ_SNOW(KLON,KLEV)
    172171
     
    175174REAL(KIND=JPRB),   INTENT(IN) :: PAEROSOL(KLON,KLEV,KAEROSOL)
    176175
    177 REAL(KIND=JPRB),   INTENT(IN) :: PCCN_LAND(KLON)
    178 REAL(KIND=JPRB),   INTENT(IN) :: PCCN_SEA(KLON)
     176!REAL(KIND=JPRB),   INTENT(IN) :: PCCN_LAND(KLON)
     177!REAL(KIND=JPRB),   INTENT(IN) :: PCCN_SEA(KLON)
    179178
    180179!AI mars 2021
     
    321320  print*,'PTEMPERATURE_SKIN =',PTEMPERATURE_SKIN
    322321  print*,'PEMIS, PEMIS_WINDOW =', PEMIS, PEMIS_WINDOW
    323   print*,'PCCN_LAND, PCCN_SEA =', PCCN_LAND, PCCN_SEA
    324322  print*,'PGELAM, PGEMU =', PGELAM, PGEMU
    325   print*,'PPRESSURE =', PPRESSURE
    326   print*,'PTEMPERATURE =', PTEMPERATURE
    327323  print*,'PPRESSURE_H =', PPRESSURE_H
    328324  print*,'PTEMPERATURE_H =', PTEMPERATURE_H
     
    332328        PCO2, PCH4, PN2O, PNO2, PCFC11, PCFC12, PHCFC22, PCCL4
    333329  print*,'PO3 =',PO3
    334   print*,'PCLOUD_FRAC, PQ_LIQUID, PQ_ICE, PQ_RAIN, PQ_SNOW =', &
    335         PCLOUD_FRAC, PQ_LIQUID, PQ_ICE, PQ_RAIN, PQ_SNOW
     330  print*,'PCLOUD_FRAC, PQ_LIQUID, PQ_ICE, PQ_SNOW =', &
     331        PCLOUD_FRAC, PQ_LIQUID, PQ_ICE, PQ_SNOW
    336332  print*,'ZRE_LIQUID_UM, ZRE_ICE_UM =', &
    337333        ZRE_LIQUID_UM, ZRE_ICE_UM
     
    408404! Alternative approximate version using temperature and pressure from
    409405! the thermodynamics structure
    410 CALL thermodynamics%calc_saturation_wrt_liquid(KIDIA, KFDIA)
     406!CALL thermodynamics%calc_saturation_wrt_liquid(KIDIA, KFDIA)
     407!AI ATTENTION
     408thermodynamics%h2o_sat_liq = PQSAT
    411409
    412410print*,'********** SINGLE LEVEL VARS **********************************'
    413411!AI ATTENTION
    414 !thermodynamics%h2o_sat_liq = PQSAT
    415412! Set single-level fileds
    416413single_level%solar_irradiance              = PSOLAR_IRRADIANCE
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation_setup.F90

    r4188 r4388  
    6969CONTAINS
    7070
    71   ! This routine copies information between the IFS radiation
     71  ! This routine copies information between the LMDZ radiation
    7272  ! configuration (stored in global variables) and the radiation
    7373  ! configuration of the modular radiation scheme (stored in
     
    7575  ! to print lots of information during the setup stage (default is
    7676  ! no).
     77! AI At the end of the routine, the parameters are read in namelist
     78!   
    7779  SUBROUTINE SETUP_RADIATION_SCHEME(LOUTPUT)
    7880
    7981    USE YOMHOOK,  ONLY : LHOOK, DR_HOOK
     82! AI (propre a IFS)   
    8083!    USE YOMLUN,   ONLY : NULNAM, NULOUT, NULERR
    8184    USE YOMLUN,   ONLY : NULOUT, NULERR
    8285    USE YOESRTWN, ONLY : NMPSRTM
    83 ! AI ATTENTION
     86! AI ATTENTION (propre a IFS)
    8487!    USE YOERAD,   ONLY : YRERAD
    8588
     
    8790    USE radiation_aerosol_optics, ONLY : dry_aerosol_sw_mass_extinction
    8891
     92! AI (propre a IFS)   
    8993!#include "posname.intfb.h"
    9094
     
    143147    ! Do we do Hogan and Bozzo (2014) approximate longwave updates?
    144148! AI ATTENTION (ifs : )
     149     ! AI (propre a IFS)
    145150!    rad_config%do_lw_derivatives = YRERAD%LAPPROXLWUPDATE
    146151    rad_config%do_lw_derivatives = .false.
     
    161166    ! *** SETUP GAS OPTICS ***
    162167
    163     ! Assume IFS has already set-up RRTM, so the setup_radiation
    164     ! routine below does not have to (ifs : F)
     168! routine below does not have to (ifs : F)
    165169    print*,'i_gas_model =',rad_config%i_gas_model
    166170    rad_config%do_setup_ifsrrtm = .TRUE.
     
    174178! AI ATTENTION
    175179! Choix offline : liquid_model_name = "SOCRATES"
    176 !    IF (YRERAD%NLIQOPT == 2) THEN
    177 !      rad_config%i_liq_model = ILiquidModelSlingo
    178 !    ELSEIF (YRERAD%NLIQOPT == 3) THEN
    179180      rad_config%i_liq_model = ILiquidModelSOCRATES
    180181      if (lprint_setp) then
     
    182183      endif
    183184
    184 !    ELSE
    185 !      WRITE(NULERR,'(a,i0)') 'Unavailable liquid optics model in modular radiation scheme: NLIQOPT=', &
    186 !           &  YRERAD%NLIQOPT
    187 !      CALL ABOR1('RADIATION_SETUP: error interpreting NLIQOPT')   
    188 !    ENDIF
    189 
    190185    ! Setup ice optics
    191186! Choix offline : ice_model_name    = "Fu-IFS"
    192 !    IF (YRERAD%NICEOPT == 3) THEN
    193187      rad_config%i_ice_model = IIceModelFu
    194188      if (lprint_setp) then
    195189        print*,'rad_config%i_ice_model =', rad_config%i_ice_model
    196190      endif
    197 !    ELSEIF (YRERAD%NICEOPT == 4) THEN
    198 !      rad_config%i_ice_model = IIceModelBaran
    199 !    ELSE
    200 !      WRITE(NULERR,'(a,i0)') 'Unavailable ice optics model in modular radiation scheme: NICEOPT=', &
    201 !           &  YRERAD%NICEOPT
    202 !      CALL ABOR1('RADIATION_SETUP: error interpreting NICEOPT')   
    203 !    ENDIF
    204 
     191
     192! AI (propre a IFS)     
    205193    ! For consistency with earlier versions of the IFS radiation
    206194    ! scheme, we perform shortwave delta-Eddington scaling *after* the
     
    215203    endif
    216204
     205! AI (propre a IFS)   
    217206    ! Use Exponential-Exponential cloud overlap to match original IFS
    218207    ! implementation of Raisanen cloud generator
     
    230219    endif
    231220
    232 !    IF (YRERAD%NAERMACC > 0) THEN
    233       ! Using MACC climatology - in this case the aerosol optics file
    234       ! will be chosen automatically
    235 
    236       ! 12 IFS aerosol classes: 1-3 Sea salt, 4-6 Boucher desert dust,
    237       ! 7 hydrophilic organics, 8 hydrophobic organics, 9&10
    238       ! hydrophobic black carbon, 11 ammonium sulphate, 12 inactive
    239       ! 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
    244 
    245       ! Indices to the aerosol optical properties in
    246       ! aerosol_ifs_rrtm_*.nc, for each class, where negative numbers
    247       ! index hydrophilic aerosol types and positive numbers index
    248       ! hydrophobic aerosol types
    249 !      rad_config%i_aerosol_type_map = 0 ! There can be up to 256 types
    250 !      if (lprint_setp) then
    251 !        print*,'rad_config%i_aerosol_type_map =', rad_config%i_aerosol_type_map
    252 !      endif
    253 
    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)
    267 !     if (lprint_setp) then
    268 !       print*,'rad_config%i_aerosol_type_map =', rad_config%i_aerosol_type_map
    269 !     endif
    270 
    271       ! Background aerosol mass-extinction coefficients are obtained
    272       ! after the configuration files have been read - see later in
    273       ! this routine.
    274 
    275 !    ELSE
    276       ! Using Tegen climatology
    277 !      rad_config%n_aerosol_types = 6
    278 !      rad_config%i_aerosol_type_map = 0 ! There can be up to 256 types
    279 !      rad_config%i_aerosol_type_map(1:6) = (/ &
    280 !           &  1, &  ! Continental background
    281 !           &  2, &  ! Maritime
    282 !           &  3, &  ! Desert
    283 !           &  4, &  ! Urban
    284  !          &  5, &  ! Volcanic active
    285 !           &  6 /)  ! Stratospheric background
    286 
    287       ! Manually set the aerosol optics file name (the directory will
    288       ! be added automatically)
    289 !      rad_config%aerosol_optics_override_file_name = 'aerosol_ifs_rrtm_tegen.nc'
    290 !    ENDIF
    291 
    292221! *** SETUP SOLVER ***
    293222
     
    300229    ! Select longwave solver
    301230! AI ATTENTION
    302 !    SELECT CASE (YRERAD%NLWSOLVER)
    303 !    CASE(0)
    304 !      rad_config%i_solver_lw = ISolverMcICA
    305 !    CASE(1)
    306231      rad_config%i_solver_lw = ISolverSpartacus
    307232      if (lprint_setp) then
     
    309234      endif
    310235
    311 !    CASE(2)
    312 !      rad_config%i_solver_lw = ISolverSpartacus
    313 !      rad_config%do_3d_effects = .TRUE.
    314 !    CASE DEFAULT
    315 !      WRITE(NULERR,'(a,i0)') 'Unknown value for NLWSOLVER: ', YRERAD%NLWSOLVER
    316 !      CALL ABOR1('RADIATION_SETUP: error interpreting NLWSOLVER')
    317 !    END SELECT
    318 
    319     ! Select shortwave solver
    320 !    SELECT CASE (YRERAD%NSWSOLVER)
    321 !    CASE(0)
    322 !      rad_config%i_solver_sw = ISolverMcICA
    323 !    CASE(1)
    324236      rad_config%i_solver_sw = ISolverSpartacus
    325237      if (lprint_setp) then
    326238        print*,'rad_config%i_solver_sw =', rad_config%i_solver_sw
    327239      endif
    328 
    329 !      rad_config%do_3d_effects = .FALSE.
    330 !      IF (YRERAD%NLWSOLVER == 2) THEN
    331 !        CALL ABOR1('RADIATION_SETUP: cannot represent 3D effects in LW but not SW')
    332 !      ENDIF
    333 !    CASE(2)
    334 !      rad_config%i_solver_sw = ISolverSpartacus
    335 !      rad_config%do_3d_effects = .TRUE.
    336 !      IF (YRERAD%NLWSOLVER == 1) THEN
    337 !        CALL ABOR1('RADIATION_SETUP: cannot represent 3D effects in SW but not LW')
    338 !      ENDIF
    339 !    CASE DEFAULT
    340 !      WRITE(NULERR,'(a,i0)') 'Unknown value for NSWSOLVER: ', YRERAD%NSWSOLVER
    341 !      CALL ABOR1('RADIATION_SETUP: error interpreting NSWSOLVER')
    342 !    END SELECT
    343240
    344241    ! SPARTACUS solver requires delta scaling to be done separately
     
    357254           rad_config%do_lw_aerosol_scattering
    358255    endif
    359 
    360 !    SELECT CASE (YRERAD%NLWSCATTERING)
    361 !    CASE(1)
    362 !      rad_config%do_lw_cloud_scattering = .TRUE.
    363 !    CASE(2)
    364 !      rad_config%do_lw_cloud_scattering = .TRUE.
    365 !      IF (YRERAD%NAERMACC > 0) THEN
    366         ! Tegen climatology omits data required to do longwave
    367         ! scattering by aerosols, so only turn this on with a more
    368         ! recent scattering database
    369 !      ENDIF
    370 !    END SELECT
    371 
    372256
    373257    ! *** IMPLEMENT SETTINGS ***
     
    379263    ! variables in the NAERAD namelist available in the YRERAD
    380264    ! structure.
    381 !    CALL POSNAME(NULNAM, 'RADIATION', ISTAT)
    382 !    SELECT CASE (ISTAT)
    383 !      CASE(0)
    384 !        CALL rad_config%read(unit=NULNAM)
    385 !      CASE(1)
    386 !        WRITE(NULOUT,'(a)') 'Namelist RADIATION not found, using settings from NAERAD only'
    387 !      CASE DEFAULT
    388 !        CALL ABOR1('RADIATION_SETUP: error reading RADIATION section of namelist file')
    389 !    END SELECT
    390 
    391 ! AI ATTENTION test
     265
     266! AI ATTENTION (parameters read in namelist file)
    392267    file_name="namelist_ecrad"
    393268    call rad_config%read(file_name=file_name)
    394 
    395     ! Print configuration
    396 !    IF (IVERBOSESETUP > 1) THEN
    397 !      WRITE(NULOUT,'(a)') 'Radiation scheme settings:'
    398 !      CALL rad_config%print(IVERBOSE=IVERBOSESETUP)
    399 !    ENDIF
    400269
    401270    ! Use configuration data to set-up radiation scheme, including
     
    409278    ! results...
    410279    ! Note that NMPSRTM(:)=(/  6, 6, 5, 5, 5, 5, 5, 4, 4, 3, 2, 2, 1, 6 /)
    411 ! AI
    412 !!    NMPSRTM(:)=(/ 6, 6, 5, 5, 5, 5, 5, 4, 4, 3, 2, 2, 1, 6 /)
    413 !!    rad_config%i_albedo_from_band_sw = NMPSRTM
    414 !    call rad_config%define_sw_albedo_intervals(6, &
    415 !             &  (/ 0.25e-6_jprb, 0.44e-6_jprb, 1.19e-6_jprb, &
    416 !             &     2.38e-6_jprb, 4.00e-6_jprb /),  (/ 1,2,3,4,5,6 /))
     280! AI (6 albedo SW bands)
    417281    call rad_config%define_sw_albedo_intervals(6, &
    418282       &  [0.25e-6_jprb, 0.44e-6_jprb, 0.69e-6_jprb, &
     
    422286    ! outside and inside the window region of the spectrum
    423287!     rad_config%i_emiss_from_band_lw = (/ 1,1,1,1,1,2,2,2,1,1,1,1,1,1,1,1 /)
    424 ! AI
     288! AI ATTENTION ?????
    425289!!    call rad_config%define_lw_emiss_intervals(3, &
    426290!!         &  (/ 8.0e-6_jprb,13.0e-6_jprb /),  (/ 1,2,1 /))
  • LMDZ6/branches/LMDZ_ECRad/libf/phylmd/radlwsw_m.F90

    r4188 r4388  
    13481348      CALL RADIATION_SCHEME &
    13491349      & (ist, iend, klon, klev, naero_grp, NSW, &
    1350 ! ??? naero_tot
    13511350      & day_cur, current_time, &
     1351!       Cste solaire/(d_Terre-Soleil)**2
    13521352      & SOLARIRAD, &
     1353!       Cos(angle zin), temp sol             
    13531354      & rmu0, tsol, &
    13541355!       Albedo diffuse et directe
     
    13561357!       Emessivite : PEMIS_WINDOW (???), &
    13571358      & ZEMIS, ZEMISW, &
    1358 !       PCCN_LAND, PCCN_SEA, & ???
    1359       & pctsrf(:,is_ter), pctsrf(:,is_oce), &
    13601359!       longitude(rad), sin(latitude), PMASQ_ ???
    1361       & ZGELAM, ZGEMU, zmasq, &
    1362 !       pression et temp aux milieux
    1363       & pplay_i, t_i, &
    1364 !       PTEMPERATURE_H ?,
     1360      & ZGELAM, ZGEMU, &
     1361!       Temp et pres aux interf, vapeur eau, Satur spec humid
    13651362      & paprs_i, ZTH_i, q_i, qsat_i, &
    13661363!       Gas
     
    13681365       & ZCCL4, POZON_i(:,:,1), ZO2, &
    13691366!       nuages :
    1370       & cldfra_i, flwc_i, fiwc_i, ZQ_RAIN, ZQ_SNOW, & 
     1367      & cldfra_i, flwc_i, fiwc_i, ZQ_SNOW, &
     1368!       rayons effectifs des gouttelettes             
    13711369      & ref_liq_i, ref_ice_i, &
    13721370!       aerosols
Note: See TracChangeset for help on using the changeset viewer.