Changeset 4911 for LMDZ6/trunk/libf/phylmd/ecrad
- Timestamp:
- Apr 19, 2024, 11:12:57 AM (8 months ago)
- Location:
- LMDZ6/trunk/libf/phylmd/ecrad
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmd/ecrad/lmdz/radiation_scheme_mod.F90
r4853 r4911 1 1 ! AI mars 2021 2 2 ! ====================== Interface between ECRAD and LMDZ ==================== 3 ! Depart de la version IFS R.H 3 4 ! radiation_scheme.F90 appelee dans radlwsw_m.F90 si iflag_rttm = 2 4 5 ! revoir toutes les parties avec "AI ATTENTION" … … 45 46 & ecrad_cloud_cover_sw) 46 47 47 ! RADIATION_SCHEME - Interface to modular radiation scheme48 !49 ! (C) Copyright 2015- ECMWF.50 !51 ! This software is licensed under the terms of the Apache Licence Version 2.052 ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.53 !54 ! In applying this licence, ECMWF does not waive the privileges and immunities55 ! granted to it by virtue of its status as an intergovernmental organisation56 ! nor does it submit to any jurisdiction.57 !58 ! PURPOSE59 ! -------60 ! The modular radiation scheme is contained in a separate61 ! library. This routine puts the the IFS arrays into appropriate62 ! objects, computing the additional data that is required, and sends63 ! it to the radiation scheme. It returns net fluxes and surface64 ! flux components needed by the rest of the model.65 !66 ! Lower case is used for variables and types taken from the67 ! radiation library68 !69 ! INTERFACE70 ! ---------71 ! RADIATION_SCHEME is called from RADLSWR. The72 ! SETUP_RADIATION_SCHEME routine (in the RADIATION_SETUP module)73 ! should have been run first.74 !75 ! AUTHOR76 ! ------77 ! Robin Hogan, ECMWF78 ! Original: 2015-09-1679 !80 ! MODIFICATIONS81 ! -------------82 !83 ! TO DO84 ! -----85 !86 48 !----------------------------------------------------------------------- 87 49 … … 91 53 USE RADIATION_SETUP 92 54 USE YOMCST , ONLY : RSIGMA ! Stefan-Boltzmann constant 93 !USE RADIATION_SETUP, ONLY : SETUP_RADIATION_SCHEME, &94 ! & config_type, driver_config_type, &95 ! & NWEIGHT_UV, IBAND_UV, WEIGHT_UV, &96 ! & NWEIGHT_PAR, IBAND_PAR, WEIGHT_PAR, &97 ! & ITYPE_TROP_BG_AER, TROP_BG_AER_MASS_EXT, &98 ! & ITYPE_STRAT_BG_AER, STRAT_BG_AER_MASS_EXT, &99 ! & ISolverSpartacus100 55 101 56 ! Modules from radiation library … … 117 72 INTEGER(KIND=JPIM),INTENT(IN) :: KIDIA ! Start column to process 118 73 INTEGER(KIND=JPIM),INTENT(IN) :: KFDIA ! End column to process 119 !INTEGER, INTENT(IN) :: KIDIA, KFDIA120 74 INTEGER(KIND=JPIM),INTENT(IN) :: KLON ! Number of columns 121 75 INTEGER(KIND=JPIM),INTENT(IN) :: KLEV ! Number of levels 122 !INTEGER, INTENT(IN) :: KLON, KLEV123 !INTEGER(KIND=JPIM),INTENT(IN) :: KAEROLMDZ ! Number of aerosol types124 76 INTEGER(KIND=JPIM),INTENT(IN) :: KAEROSOL 125 77 INTEGER(KIND=JPIM),INTENT(IN) :: NSW ! Numbe of bands … … 244 196 type(driver_config_type),save :: driver_config 245 197 !!$OMP THREADPRIVATE(driver_config) 246 !type(config_type) :: rad_config247 !type(driver_config_type) :: driver_config248 198 TYPE(single_level_type) :: single_level 249 199 TYPE(thermodynamics_type) :: thermodynamics … … 261 211 262 212 ! Cloud overlap decorrelation length for cloud boundaries in km 263 REAL(KIND=JPRB) :: ZDECORR_LEN_KM(KLON) 213 REAL(KIND=JPRB) :: ZDECORR_LEN_M 214 REAL(KIND=JPRB) :: ZDECORR_LEN_M_1D(KLON) 215 REAL(KIND=JPRB) :: ZDECORR_LEN_M_2D(KLON,KLEV) 264 216 265 217 ! Ratio of cloud overlap decorrelation length for cloud water … … 306 258 ! Initialisation dans radiation_setup au 1er passage dans Ecrad 307 259 !$OMP MASTER 308 !if (.not.ok_3Deffect) then309 260 if (debut_ecrad) then 310 261 call SETUP_RADIATION_SCHEME(loutput,namelist_file,rad_config,driver_config) 311 262 debut_ecrad=.false. 312 263 endif 313 !else314 ! call SETUP_RADIATION_SCHEME(loutput,namelist_file,rad_config,driver_config)315 !endif316 264 !$OMP END MASTER 317 265 !$OMP BARRIER … … 341 289 342 290 print*,'************* THERMO (input) ************************************' 343 ! Set thermodynamic profiles: simply copy over the half-level344 ! pressure and temperature345 291 ! AI 346 292 ! pressure_hl > paprs … … 416 362 !CALL CLOUD_OVERLAP_DECORR_LEN(KIDIA, KFDIA, KLON, PGEMU, YRERAD%NDECOLAT, & 417 363 ! & ZDECORR_LEN_KM, PDECORR_LEN_RATIO=ZDECORR_LEN_RATIO) 418 ! AI valeur dans namelist 419 ! rad_config%cloud_inhom_decorr_scaling = ZDECORR_LEN_RATIO 420 !AI ATTENTION meme valeur que dans offline 421 ! A mettre dans namelist 422 ZDECORR_LEN_KM = driver_config%overlap_decorr_length 423 DO JLON = KIDIA,KFDIA 424 CALL cloud%set_overlap_param(thermodynamics, & 425 & ZDECORR_LEN_KM(JLON), & 364 CALL CALCUL_CLOUD_OVERLAP_DECORR_LEN & 365 & (KIDIA, KFDIA, KLON, KLEV, & 366 & driver_config, & 367 & thermodynamics%pressure_hl, & 368 & ZDECORR_LEN_M_2D) 369 370 if (driver_config%kdecolat.eq.0) then 371 ZDECORR_LEN_M = ZDECORR_LEN_M_2D(1,1) 372 DO JLON = KIDIA,KFDIA 373 CALL cloud%set_overlap_param(thermodynamics, & 374 & ZDECORR_LEN_M, & 426 375 & istartcol=JLON, iendcol=JLON) 427 ENDDO 376 ENDDO 377 else if (driver_config%kdecolat.eq.1.or.driver_config%kdecolat.eq.2) then 378 ZDECORR_LEN_M_1D = ZDECORR_LEN_M_2D(:,1) 379 DO JLON = KIDIA,KFDIA 380 CALL cloud%set_overlap_param(thermodynamics, & 381 & ZDECORR_LEN_M_1D, & 382 & istartcol=JLON, iendcol=JLON) 383 ENDDO 384 else if (driver_config%kdecolat.eq.3) then 385 DO JLON = KIDIA,KFDIA 386 CALL cloud%set_overlap_param_var2D(thermodynamics, & 387 & ZDECORR_LEN_M_2D, KLEV, & 388 & istartcol=JLON, iendcol=JLON) 389 ENDDO 390 endif 391 392 393 428 394 ! IFS : 429 395 ! Cloud water content fractional standard deviation is configurable … … 936 902 937 903 ! Cloud overlap decorrelation length for cloud boundaries in km 938 REAL(KIND=JPRB) :: ZDECORR_LEN_KM(KLON) 904 REAL(KIND=JPRB) :: ZDECORR_LEN_M 905 REAL(KIND=JPRB) :: ZDECORR_LEN_M_1D(KLON) 906 REAL(KIND=JPRB) :: ZDECORR_LEN_M_2D(KLON,KLEV) 939 907 940 908 ! Ratio of cloud overlap decorrelation length for cloud water … … 1095 1063 !AI ATTENTION meme valeur que dans offline 1096 1064 ! A mettre dans namelist 1097 ZDECORR_LEN_KM = driver_config%overlap_decorr_length 1098 DO JLON = KIDIA,KFDIA 1099 CALL cloud%set_overlap_param(thermodynamics, & 1100 & ZDECORR_LEN_KM(JLON), & 1065 CALL CALCUL_CLOUD_OVERLAP_DECORR_LEN & 1066 & (KIDIA, KFDIA, KLON, KLEV, & 1067 & driver_config, & 1068 & thermodynamics%pressure_hl , & 1069 & ZDECORR_LEN_M_2D) 1070 1071 if (driver_config%kdecolat.eq.0) then 1072 ZDECORR_LEN_M = ZDECORR_LEN_M_2D(1,1) 1073 DO JLON = KIDIA,KFDIA 1074 CALL cloud%set_overlap_param(thermodynamics, & 1075 & ZDECORR_LEN_M, & 1101 1076 & istartcol=JLON, iendcol=JLON) 1102 ENDDO 1077 ENDDO 1078 else if (driver_config%kdecolat.eq.1.or.driver_config%kdecolat.eq.2) then 1079 ZDECORR_LEN_M_1D = ZDECORR_LEN_M_2D(:,1) 1080 DO JLON = KIDIA,KFDIA 1081 CALL cloud%set_overlap_param(thermodynamics, & 1082 & ZDECORR_LEN_M_1D, & 1083 & istartcol=JLON, iendcol=JLON) 1084 ENDDO 1085 else if (driver_config%kdecolat.eq.3) then 1086 DO JLON = KIDIA,KFDIA 1087 CALL cloud%set_overlap_param_var2D(thermodynamics, & 1088 & ZDECORR_LEN_M_2D, KLEV, & 1089 & istartcol=JLON, iendcol=JLON) 1090 ENDDO 1091 endif 1092 1103 1093 ! IFS : 1104 1094 ! Cloud water content fractional standard deviation is configurable -
LMDZ6/trunk/libf/phylmd/ecrad/lmdz/setup_config_from_lmdz.F90
r4853 r4911 19 19 real(jprb) :: frac_std = 0.75_jprb 20 20 real(jprb) :: overlap_decorr_length = 2000.0_jprb 21 21 ! KDECOLAT : 0 > cste, 1 > Shonk et al. (2010) 2 > 1 lisse a l'equateur 22 ! 3 : 1+variation sur la verticale 23 ! 4 : 2+variation sur la verticale 24 integer :: kdecolat = 0 25 real(jprb) :: low_decorrelation_length = 2000.0_jprb 26 real(jprb) :: mid_decorrelation_length = 2000.0_jprb 27 real(jprb) :: high_decorrelation_length = 2000.0_jprb 22 28 23 29 contains … … 47 53 real(jprb) :: frac_std 48 54 real(jprb) :: overlap_decorr_length 55 integer :: kdecolat 56 real(jprb) :: low_decorrelation_length 57 real(jprb) :: mid_decorrelation_length 58 real(jprb) :: high_decorrelation_length 49 59 50 60 namelist /radiation_driver/ ok_effective_size, ok_separation, & 51 & frac_std, overlap_decorr_length, & 61 & frac_std, overlap_decorr_length, kdecolat, & 62 & low_decorrelation_length, mid_decorrelation_length, high_decorrelation_length, & 52 63 & high_inv_effective_size, middle_inv_effective_size, low_inv_effective_size, & 53 64 & cloud_inhom_separation_factor, cloud_separation_scale_surface, & … … 65 76 frac_std = 0.75_jprb 66 77 overlap_decorr_length = 2000.0_jprb 78 kdecolat = 0 79 low_decorrelation_length = 2000.0_jprb 80 mid_decorrelation_length = 2000.0_jprb 81 high_decorrelation_length = 2000.0_jprb 67 82 68 83 ! Open the namelist file and read the radiation_driver namelist … … 92 107 this%frac_std = frac_std 93 108 this%overlap_decorr_length = overlap_decorr_length 109 this%kdecolat = kdecolat 110 this%low_decorrelation_length = low_decorrelation_length 111 this%mid_decorrelation_length = mid_decorrelation_length 112 this%high_decorrelation_length = high_decorrelation_length 94 113 this%cloud_inhom_separation_factor = cloud_inhom_separation_factor 95 114 this%cloud_separation_scale_surface = cloud_separation_scale_surface -
LMDZ6/trunk/libf/phylmd/ecrad/radiation/radiation_cloud.F90
r4853 r4911 85 85 procedure :: set_overlap_param_var 86 86 generic :: set_overlap_param => set_overlap_param_fix, set_overlap_param_var 87 procedure :: set_overlap_param_var2D 87 88 procedure :: set_overlap_param_approx 88 89 procedure :: create_fractional_std … … 380 381 end subroutine set_overlap_param_var 381 382 383 ! AI 04 2024 variation de la longueur Ld en fonction de la verticale 384 subroutine set_overlap_param_var2D(this, thermodynamics, decorrelation_length, & 385 & klev, istartcol, iendcol) 386 387 use yomhook, only : lhook, dr_hook, jphook 388 use radiation_thermodynamics, only : thermodynamics_type 389 use radiation_constants, only : GasConstantDryAir, AccelDueToGravity 390 391 integer, intent(in) :: klev 392 class(cloud_type), intent(inout) :: this 393 type(thermodynamics_type), intent(in) :: thermodynamics 394 integer, intent(in) :: istartcol, iendcol 395 real(jprb), intent(in) :: decorrelation_length(istartcol:iendcol,klev) ! m 396 397 ! Ratio of gas constant for dry air to acceleration due to gravity 398 real(jprb), parameter :: R_over_g = GasConstantDryAir / AccelDueToGravity 399 400 integer :: ncol, nlev 401 402 integer :: jcol, jlev 403 404 real(jphook) :: hook_handle 405 406 if (lhook) call dr_hook('radiation_cloud:set_overlap_param_var',0,hook_handle) 407 408 ! Pressure at half-levels, pressure_hl, is defined at nlev+1 409 ! points 410 ncol = size(thermodynamics%pressure_hl,dim=1) 411 nlev = size(thermodynamics%pressure_hl,dim=2)-1 412 413 if (.not. allocated(this%overlap_param)) then 414 ! If pressure is of size (ncol,nlev+1) then overlap_param is of 415 ! size (ncol,nlev-1), since overlap parameter is only defined here 416 ! for interfaces between model layers, not for the interface to 417 ! space or the surface 418 allocate(this%overlap_param(ncol, nlev-1)) 419 end if 420 421 if (thermodynamics%pressure_hl(istartcol,2) > thermodynamics%pressure_hl(istartcol,1)) then 422 ! Pressure is increasing with index (order of layers is 423 ! top-of-atmosphere to surface). In case pressure_hl(:,1)=0, we 424 ! don't take the logarithm of the first pressure in each column. 425 do jcol = istartcol,iendcol 426 this%overlap_param(jcol,1) = exp(-(R_over_g/decorrelation_length(jcol,1)) & 427 & * thermodynamics%temperature_hl(jcol,2) & 428 & *log(thermodynamics%pressure_hl(jcol,3) & 429 & /thermodynamics%pressure_hl(jcol,2))) 430 end do 431 432 do jlev = 2,nlev-1 433 do jcol = istartcol,iendcol 434 this%overlap_param(jcol,jlev) = exp(-(0.5_jprb*R_over_g/decorrelation_length(jcol,jlev)) & 435 & * thermodynamics%temperature_hl(jcol,jlev+1) & 436 & *log(thermodynamics%pressure_hl(jcol,jlev+2) & 437 & /thermodynamics%pressure_hl(jcol,jlev))) 438 end do 439 end do 440 441 else 442 ! Pressure is decreasing with index (order of layers is surface 443 ! to top-of-atmosphere). In case pressure_hl(:,nlev+1)=0, we 444 ! don't take the logarithm of the last pressure in each column. 445 do jlev = 1,nlev-2 446 do jcol = istartcol,iendcol 447 this%overlap_param(jcol,jlev) = exp(-(0.5_jprb*R_over_g/decorrelation_length(jcol,jlev)) & 448 & * thermodynamics%temperature_hl(jcol,jlev+1) & 449 & *log(thermodynamics%pressure_hl(jcol,jlev) & 450 & /thermodynamics%pressure_hl(jcol,jlev+2))) 451 end do 452 end do 453 454 do jcol = istartcol,iendcol 455 ! AI ATTENTION a verifier decorrelation_length(jcol,nlev-1) ou nlev 456 this%overlap_param(jcol,nlev-1) = exp(-(R_over_g/decorrelation_length(jcol,nlev-1)) & 457 & * thermodynamics%temperature_hl(jcol,nlev) & 458 & *log(thermodynamics%pressure_hl(jcol,nlev-1) & 459 & /thermodynamics%pressure_hl(jcol,nlev))) 460 end do 461 end if 462 463 if (lhook) call dr_hook('radiation_cloud:set_overlap_param_var',1,hook_handle) 464 465 end subroutine set_overlap_param_var2D 382 466 383 467 !---------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.