- Timestamp:
- Dec 1, 2023, 10:09:29 PM (13 months ago)
- Location:
- LMDZ6/branches/LMDZ_ECRad/libf/phylmd
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/clesphys.h
r4727 r4758 109 109 !AI flags pour ECRAD 110 110 LOGICAL :: ok_3Deffect 111 CHARACTER(len=512) :: namelist_ecrad_file112 111 113 112 COMMON/clesphys/ & … … 162 161 & , iflag_phytrac, ok_new_lscp, ok_bs, ok_rad_bs & 163 162 & , iflag_thermals,nsplit_thermals, tau_thermals & 164 & , iflag_physiq, ok_3Deffect , namelist_ecrad_file163 & , iflag_physiq, ok_3Deffect 165 164 save /clesphys/ 166 165 !$OMP THREADPRIVATE(/clesphys/) -
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/CHANGELOG
r4728 r4758 13 13 saves look-up table averaged to the bands of the radiation scheme 14 14 (general cloud optics only) 15 - Increased security value in single-precision SW 16 reflectance-transmittance calculation from 1e-12 to 1e-6 15 17 16 18 version 1.6.0 (27 April 2023) -
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation/radiation_aerosol_optics.F90
r4728 r4758 37 37 use yomhook, only : lhook, dr_hook, jphook 38 38 use radiation_config, only : config_type 39 use radiation_aerosol_optics_data, only : aerosol_optics_type, & 40 data_setup_aerosol_optics => setup_aerosol_optics 39 use radiation_aerosol_optics_data, only : aerosol_optics_type 41 40 use radiation_io, only : nulerr, radiation_abort 42 41 … … 58 57 ! Read file containing optical properties already in the bands 59 58 ! of the gas-optics scheme 60 if (.not. associated(config%aerosol_optics%setup)) &61 config%aerosol_optics%setup => data_setup_aerosol_optics62 59 call config%aerosol_optics%setup(trim(config%aerosol_optics_file_name), & 63 60 & iverbose=config%iverbosesetup) … … 346 343 use easy_netcdf, only : netcdf_file 347 344 use radiation_config, only : config_type 348 use radiation_aerosol_optics_data, only : aerosol_optics_type, & 349 data_setup_aerosol_optics => setup_aerosol_optics 345 use radiation_aerosol_optics_data, only : aerosol_optics_type 350 346 use radiation_spectral_definition, only : SolarReferenceTemperature, & 351 347 & TerrestrialReferenceTemperature … … 374 370 if (lhook) call dr_hook('radiation_aerosol_optics:setup_general_aerosol_optics_legacy',0,hook_handle) 375 371 ao => config%aerosol_optics 376 ao_legacy%setup => data_setup_aerosol_optics377 372 378 373 ! Load file into a local structure -
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation/radiation_aerosol_optics_data.F90
r4728 r4758 135 135 logical :: use_monochromatic = .false. 136 136 137 procedure(setup_aerosol_optics), pointer:: setup => null()138 139 137 contains 138 procedure :: setup => setup_aerosol_optics 140 139 procedure :: save => save_aerosol_optics 141 140 procedure :: allocate -
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation/radiation_cloud.F90
r4728 r4758 64 64 ! gridbox area for use in representing 3D effects. This variable 65 65 ! is dimensioned (ncol,nlev). 66 real(jprb), allocatable, dimension(:,:) :: inv_cloud_effective_size ! m-166 real(jprb), allocatable, dimension(:,:) :: inv_cloud_effective_size ! m-1 67 67 68 68 ! Similarly for the in-cloud heterogeneities, used to compute the … … 606 606 607 607 use yomhook, only : lhook, dr_hook, jphook 608 ! USE mod_phys_lmdz_para 608 609 609 610 class(cloud_type), intent(inout) :: this -
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation/radiation_cloud_generator.F90
r4728 r4758 540 540 use radiation_pdf_sampler, only : pdf_sampler_type 541 541 implicit none 542 #if defined(__GFORTRAN__) || defined(__PGI) || defined(__NEC__)543 #else544 !$omp declare simd(sample_from_pdf_simd) uniform(this) &545 !$omp linear(ref(fsd)) linear(ref(cdf))546 #endif542 !#if defined(__GFORTRAN__) || defined(__PGI) || defined(__NEC__) 543 !#else 544 ! !$omp declare simd(sample_from_pdf_simd) uniform(this) & 545 ! !$omp linear(ref(fsd)) linear(ref(cdf)) 546 !#endif 547 547 type(pdf_sampler_type), intent(in) :: this 548 548 -
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation/radiation_ecckd_interface.F90
r4728 r4758 57 57 end if 58 58 59 if (allocated(config%i_band_from_g_sw)) deallocate(config%i_band_from_g_sw) 60 allocate(config%i_band_from_g_sw (config%n_g_sw)) 61 if (allocated(config%i_band_from_reordered_g_sw)) deallocate(config%i_band_from_reordered_g_sw) 62 allocate(config%i_band_from_reordered_g_sw(config%n_g_sw)) 63 if (allocated(config%i_g_from_reordered_g_sw)) deallocate(config%i_g_from_reordered_g_sw) 64 allocate(config%i_g_from_reordered_g_sw (config%n_g_sw)) 59 ! if (allocated(config%i_band_from_g_sw)) deallocate(config%i_band_from_g_sw) 60 ! allocate(config%i_band_from_g_sw(config%n_g_sw)) 61 ! if (allocated(config%i_band_from_reordered_g_sw)) deallocate(config%i_band_from_reordered_g_sw) 62 ! allocate(config%i_band_from_reordered_g_sw(config%n_g_sw)) 63 ! if (allocated(config%i_g_from_reordered_g_sw)) deallocate(config%i_g_from_reordered_g_sw) 64 ! allocate(config%i_g_from_reordered_g_sw(config%n_g_sw)) 65 if (.not.allocated(config%i_band_from_g_sw)) & 66 allocate(config%i_band_from_g_sw(config%n_g_sw)) 67 if (.not.allocated(config%i_band_from_reordered_g_sw)) & 68 allocate(config%i_band_from_reordered_g_sw(config%n_g_sw)) 69 if (.not.allocated(config%i_g_from_reordered_g_sw)) & 70 allocate(config%i_g_from_reordered_g_sw(config%n_g_sw)) 65 71 66 72 if (config%do_cloud_aerosol_per_sw_g_point) then … … 105 111 end if 106 112 107 if (allocated(config%i_band_from_g_lw)) deallocate(config%i_band_from_g_lw) 108 allocate(config%i_band_from_g_lw (config%n_g_lw)) 109 if (allocated(config%i_band_from_reordered_g_lw)) deallocate(config%i_band_from_reordered_g_lw) 110 allocate(config%i_band_from_reordered_g_lw(config%n_g_lw)) 111 if (allocated(config%i_g_from_reordered_g_lw)) deallocate(config%i_g_from_reordered_g_lw) 112 allocate(config%i_g_from_reordered_g_lw (config%n_g_lw)) 113 ! if (allocated(config%i_band_from_g_lw)) deallocate(config%i_band_from_g_lw) 114 ! allocate(config%i_band_from_g_lw (config%n_g_lw)) 115 ! if (allocated(config%i_band_from_reordered_g_lw)) deallocate(config%i_band_from_reordered_g_lw) 116 ! allocate(config%i_band_from_reordered_g_lw(config%n_g_lw)) 117 ! if (allocated(config%i_g_from_reordered_g_lw)) deallocate(config%i_g_from_reordered_g_lw) 118 ! allocate(config%i_g_from_reordered_g_lw (config%n_g_lw)) 119 if (.not.allocated(config%i_band_from_g_lw)) & 120 allocate(config%i_band_from_g_lw (config%n_g_lw)) 121 if (.not.allocated(config%i_band_from_reordered_g_lw)) & 122 allocate(config%i_band_from_reordered_g_lw(config%n_g_lw)) 123 if (.not.allocated(config%i_g_from_reordered_g_lw)) & 124 allocate(config%i_g_from_reordered_g_lw (config%n_g_lw)) 125 113 126 114 127 if (config%do_cloud_aerosol_per_lw_g_point) then -
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation/radiation_general_cloud_optics.F90
r4728 r4758 75 75 ! Allocate structures 76 76 if (config%do_sw) then 77 if (allocated(config%cloud_optics_sw)) deallocate(config%cloud_optics_sw)77 if (allocated(config%cloud_optics_sw)) deallocate(config%cloud_optics_sw) 78 78 allocate(config%cloud_optics_sw(config%n_cloud_types)) 79 79 end if 80 80 81 81 if (config%do_lw) then 82 if (allocated(config%cloud_optics_lw)) deallocate(config%cloud_optics_lw)82 if (allocated(config%cloud_optics_lw)) deallocate(config%cloud_optics_lw) 83 83 allocate(config%cloud_optics_lw(config%n_cloud_types)) 84 84 end if -
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation/radiation_interface.F90
r4728 r4758 227 227 use radiation_general_cloud_optics, only : general_cloud_optics 228 228 use radiation_aerosol_optics, only : add_aerosol_optics 229 USE mod_phys_lmdz_para 230 229 231 230 232 ! Inputs … … 236 238 type(thermodynamics_type),intent(in) :: thermodynamics 237 239 type(gas_type), intent(in) :: gas 238 type(cloud_type), 240 type(cloud_type), intent(inout):: cloud 239 241 type(aerosol_type), intent(in) :: aerosol 240 242 ! Output … … 295 297 296 298 real(jphook) :: hook_handle 299 integer :: jcol, jlev 297 300 298 301 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 299 317 300 318 if (thermodynamics%pressure_hl(istartcol,2) & … … 456 474 else if (config%i_solver_sw == ISolverSPARTACUS) then 457 475 ! 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 458 484 call solver_spartacus_sw(nlev,istartcol,iendcol, & 459 485 & config, single_level, thermodynamics, cloud, & -
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation/radiation_spartacus_sw.F90
r4728 r4758 87 87 use radiation_constants, only : Pi, GasConstantDryAir, & 88 88 & AccelDueToGravity 89 USE mod_phys_lmdz_para 89 90 90 91 implicit none … … 326 327 write(nulout,'(a)',advance='no') ' Processing columns' 327 328 end if 329 330 print*,'Dans radiation_spartacus, mpi_rank, omp_rank, & 331 size, chape inv_cloud = ',& 332 mpi_rank, omp_rank, & 333 shape(cloud%inv_cloud_effective_size), & 334 size(cloud%inv_cloud_effective_size) 328 335 329 336 ! Main loop over columns … … 497 504 & .not. (nreg == 2 .and. cloud%fraction(jcol,jlev) & 498 505 & > 1.0-config%cloud_fraction_threshold)) then 506 ! print*,' Dans radiation_spartacus mpi_rank, omp_rank, jcol, jlev, & 507 ! & cloud%inv_cloud_effective_size =', mpi_rank, & 508 ! & omp_rank, jcol, jlev, & 509 ! & cloud%inv_cloud_effective_size(jcol,jlev) 499 510 if (cloud%inv_cloud_effective_size(jcol,jlev) > 0.0_jprb) then 500 511 ! 3D effects are only simulated if -
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation/radiation_two_stream.F90
r4728 r4758 20 20 ! 2021-02-19 R Hogan Security for shortwave singularity 21 21 ! 2022-11-22 P Ukkonen/R Hogan Single precision uses no double precision 22 ! 2023-09-28 R Hogan Increased security for single-precision SW "k" 22 23 23 24 module radiation_two_stream … … 212 213 if (od(jg) > 1.0e-3_jprd) then 213 214 k_exponent = sqrt(max((gamma1(jg) - gamma2(jg)) * (gamma1(jg) + gamma2(jg)), & 214 1. E-12_jprd)) ! Eq 18 of Meador & Weaver (1980)215 1.0e-12_jprd)) ! Eq 18 of Meador & Weaver (1980) 215 216 exponential = exp_fast(-k_exponent*od(jg)) 216 217 exponential2 = exponential*exponential … … 235 236 else 236 237 k_exponent = sqrt(max((gamma1(jg) - gamma2(jg)) * (gamma1(jg) + gamma2(jg)), & 237 1. E-12_jprd)) ! Eq 18 of Meador & Weaver (1980)238 1.0e-12_jprd)) ! Eq 18 of Meador & Weaver (1980) 238 239 reflectance(jg) = gamma2(jg) * od(jg) 239 240 transmittance(jg) = (1.0_jprb - k_exponent*od(jg)) / (1.0_jprb + od(jg)*(gamma1(jg)-k_exponent)) … … 312 313 gamma2 = factor * (1.0_jprb - asymmetry(jg)) 313 314 k_exponent = sqrt(max((gamma1 - gamma2) * (gamma1 + gamma2), & 314 1. E-12_jprb)) ! Eq 18 of Meador & Weaver (1980)315 1.0e-12_jprb)) ! Eq 18 of Meador & Weaver (1980) 315 316 if (od(jg) > 1.0e-3_jprb) then 316 317 exponential = exp_fast(-k_exponent*od(jg)) … … 646 647 alpha2(jg) = gamma1(jg)*gamma3(jg) + gamma2(jg)*gamma4(jg) ! Eq. 17 647 648 ! The following line crashes inexplicably with gfortran 8.5.0 in 648 ! single precision - try a later version 649 ! single precision - try a later version. Note that the minimum 650 ! value is needed to produce correct results for single 651 ! scattering albedos very close to or equal to one. 652 #ifdef PARKIND1_SINGLE 653 k_exponent(jg) = sqrt(max((gamma1(jg) - gamma2(jg)) * (gamma1(jg) + gamma2(jg)), & 654 & 1.0e-6_jprb)) ! Eq 18 655 #else 649 656 k_exponent(jg) = sqrt(max((gamma1(jg) - gamma2(jg)) * (gamma1(jg) + gamma2(jg)), & 650 657 & 1.0e-12_jprb)) ! Eq 18 658 #endif 651 659 end do 652 660 … … 665 673 ! Meador & Weaver (1980) Eq. 25 666 674 ref_diff(jg) = gamma2(jg) * (1.0_jprb - exponential2) * reftrans_factor 667 668 ! Meador & Weaver (1980) Eq. 26 669 trans_diff(jg) = k_2_exponential * reftrans_factor 670 675 !ref_diff(jg) = max(0.0_jprb, min(ref_diff(jg)), 1.0_jprb) 676 677 ! Meador & Weaver (1980) Eq. 26, with security (which is 678 ! sometimes needed, but apparently not on ref_diff) 679 trans_diff(jg) = max(0.0_jprb, min(k_2_exponential * reftrans_factor, 1.0_jprb-ref_diff(jg))) 680 671 681 ! Here we need mu0 even though it wasn't in Meador and Weaver 672 682 ! because we are assuming the incoming direct flux is defined to … … 694 704 ref_dir(jg) = max(0.0_jprb, min(ref_dir(jg), mu0*(1.0_jprb-trans_dir_dir(jg)))) 695 705 trans_dir_diff(jg) = max(0.0_jprb, min(trans_dir_diff(jg), mu0*(1.0_jprb-trans_dir_dir(jg))-ref_dir(jg))) 696 697 706 end do 698 707 -
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/phys_output_ctrlout_mod.F90
r4727 r4758 539 539 !AI Ecrad 3Deffect 540 540 #ifdef CPP_ECRAD 541 TYPE(ctrl_out), SAVE :: o_cloud_cover_sw = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), & 542 'cloud_cover_sw', 'Ecrad SW cloud cover', '-', (/ ('', i=1, 10) /)) 543 TYPE(ctrl_out), SAVE :: o_cloud_cover_sw_s2 = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), & 544 'cloud_cover_sw_s2', 'Ecrad SW cloud cover 2 call', '-', (/ ('', i=1, 10) /)) 541 545 TYPE(ctrl_out), SAVE :: o_sols_s2 = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), & 542 546 'sols_s2', 'Solar rad. at surf.', 'W/m2', (/ ('', i=1, 10) /)) -
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/phys_output_var_mod.F90
r4727 r4758 174 174 REAL, SAVE, ALLOCATABLE:: sss(:) ! (klon) 175 175 ! bulk salinity of the surface layer of the ocean, in ppt 176 177 176 !$OMP THREADPRIVATE(tkt, tks, taur, sss) 178 177 178 !AI. cloud_cover_sw, cloud_cover_sw_s2 from Ecrad (1rt and 2 call) 179 REAL, SAVE, ALLOCATABLE:: cloud_cover_sw(:), cloud_cover_sw_s2(:) 180 !$OMP THREADPRIVATE(cloud_cover_sw, cloud_cover_sw_s2) 181 179 182 CONTAINS 180 183 181 !===================================================== =================184 !=====================================================taur================= 182 185 SUBROUTINE phys_output_var_init 183 186 use dimphy … … 253 256 ALLOCATE(icc3dstra(klon, klev)) 254 257 258 ! cloud_cover_sw, cloud_cover_sw_s2 from Ecrad 259 ALLOCATE(cloud_cover_sw(klon)) 260 ALLOCATE(cloud_cover_sw_s2(klon)) 261 255 262 END SUBROUTINE phys_output_var_init 256 263 … … 304 311 DEALLOCATE(icc3dstra) 305 312 313 !AI cloud_cover_sw, cloud_cover_sw_s2 from Ecrad 314 DEALLOCATE(cloud_cover_sw, cloud_cover_sw_s2) 315 306 316 END SUBROUTINE phys_output_var_end 307 317 -
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/phys_output_write_mod.F90
r4727 r4758 231 231 USE phys_output_ctrlout_mod, ONLY: & 232 232 o_soll0_s2,o_soll_s2,o_sols0_s2,o_sols_s2, & 233 o_topl0_s2,o_topl_s2,o_tops0_s2,o_tops_s2 233 o_topl0_s2,o_topl_s2,o_tops0_s2,o_tops_s2, & 234 o_SWupTOA_s2,o_SWupTOAclr_s2,o_cloud_cover_sw, & 235 o_cloud_cover_sw_s2,o_SWdnTOA_s2,o_SWdnTOAclr_s2, & 236 o_LWupSFCclr_s2, o_LWdnSFCclr_s2, o_SWupSFC_s2, & 237 o_SWupSFCclr_s2, o_SWdnSFC_s2, o_SWdnSFCclr_s2, & 238 o_LWupSFC_s2, o_LWdnSFC_s2 234 239 #endif 235 240 … … 290 295 USE phys_state_var_mod, ONLY: & 291 296 sollw0_s2,sollw_s2,solsw0_s2,solsw_s2, & 292 toplw0_s2,toplw_s2,topsw0_s2,topsw_s2 297 toplw0_s2,toplw_s2,topsw0_s2,topsw_s2, & 298 swup0_s2,swup_s2,swdn_s2,swdn0_s2,sollwdownclr_s2, & 299 sollwdown_s2,lwdn0_s2 300 USE phys_output_var_mod, ONLY: cloud_cover_sw, & 301 cloud_cover_sw_s2 293 302 #endif 303 294 304 295 305 … … 1068 1078 !AI 08 2023 Ecrad 3Deffect 1069 1079 #ifdef CPP_ECRAD 1080 CALL histwrite_phy(o_cloud_cover_sw, cloud_cover_sw) 1070 1081 if (ok_3Deffect) then 1071 1082 IF (vars_defined) THEN … … 1091 1102 CALL histwrite_phy(o_topl_s2, toplw_s2) 1092 1103 CALL histwrite_phy(o_topl0_s2, toplw0_s2) 1104 1105 IF (vars_defined) THEN 1106 zx_tmp_fi2d(:) = swup_s2(:,klevp1)*swradcorr(:) 1107 ENDIF 1108 CALL histwrite_phy(o_SWupTOA_s2, zx_tmp_fi2d) 1109 1110 IF (vars_defined) THEN 1111 zx_tmp_fi2d(:) = swup0_s2(:,klevp1)*swradcorr(:) 1112 ENDIF 1113 CALL histwrite_phy(o_SWupTOAclr_s2, zx_tmp_fi2d) 1114 1115 IF (vars_defined) THEN 1116 zx_tmp_fi2d(:) = swdn_s2(:,klevp1)*swradcorr(:) 1117 ENDIF 1118 CALL histwrite_phy(o_SWdnTOA_s2, zx_tmp_fi2d) 1119 1120 IF (vars_defined) THEN 1121 zx_tmp_fi2d(:) = swdn0_s2(:,klevp1)*swradcorr(:) 1122 ENDIF 1123 CALL histwrite_phy(o_SWdnTOAclr_s2, zx_tmp_fi2d) 1124 1125 IF (vars_defined) THEN 1126 zx_tmp_fi2d(:)=sollwdown_s2(:)-sollw_s2(:) 1127 ENDIF 1128 CALL histwrite_phy(o_LWupSFC_s2, zx_tmp_fi2d) 1129 CALL histwrite_phy(o_LWdnSFC_s2, sollwdown_s2) 1130 1131 IF (vars_defined) THEN 1132 sollwdownclr_s2(1:klon) = -1.*lwdn0_s2(1:klon,1) 1133 zx_tmp_fi2d(1:klon)=sollwdownclr_s2(1:klon)-sollw0_s2(1:klon) 1134 ENDIF 1135 CALL histwrite_phy(o_LWupSFCclr_s2, zx_tmp_fi2d) 1136 CALL histwrite_phy(o_LWdnSFCclr_s2, sollwdownclr_s2) 1137 1138 IF (vars_defined) THEN 1139 zx_tmp_fi2d(:) = swup_s2(:,1)*swradcorr(:) 1140 ENDIF 1141 CALL histwrite_phy(o_SWupSFC_s2, zx_tmp_fi2d) 1142 1143 IF (vars_defined) THEN 1144 zx_tmp_fi2d(:) = swup0_s2(:,1)*swradcorr(:) 1145 ENDIF 1146 CALL histwrite_phy(o_SWupSFCclr_s2, zx_tmp_fi2d) 1147 1148 IF (vars_defined) THEN 1149 zx_tmp_fi2d(:) = swdn_s2(:,1)*swradcorr(:) 1150 ENDIF 1151 CALL histwrite_phy(o_SWdnSFC_s2, zx_tmp_fi2d) 1152 1153 IF (vars_defined) THEN 1154 zx_tmp_fi2d(:) = swdn0_s2(:,1)*swradcorr(:) 1155 ENDIF 1156 CALL histwrite_phy(o_SWdnSFCclr_s2, zx_tmp_fi2d) 1157 1093 1158 endif 1094 1159 #endif -
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/phys_state_var_mod.F90
r4727 r4758 410 410 REAL,ALLOCATABLE,SAVE :: solsw_s2(:), solswfdiff_s2(:), sollw_s2(:) 411 411 !$OMP THREADPRIVATE(solsw_s2, solswfdiff_s2, sollw_s2) 412 REAL,ALLOCATABLE,SAVE :: sollwdown_s2(:) 413 !$OMP THREADPRIVATE(sollwdown_s2 )412 REAL,ALLOCATABLE,SAVE :: sollwdown_s2(:), sollwdownclr_s2(:) 413 !$OMP THREADPRIVATE(sollwdown_s2, sollwdownclr_s2) 414 414 REAL,ALLOCATABLE,SAVE :: topsw0_s2(:),toplw0_s2(:) 415 415 REAL,ALLOCATABLE,SAVE :: solsw0_s2(:),sollw0_s2(:) … … 727 727 ALLOCATE(albpla_s2(klon)) 728 728 ALLOCATE(solsw_s2(klon), solswfdiff_s2(klon), sollw_s2(klon)) 729 ALLOCATE(sollwdown_s2(klon) )729 ALLOCATE(sollwdown_s2(klon),sollwdownclr_s2(klon)) 730 730 ALLOCATE(topsw0_s2(klon),toplw0_s2(klon)) 731 731 ALLOCATE(solsw0_s2(klon),sollw0_s2(klon)) … … 900 900 DEALLOCATE(albpla_s2) 901 901 DEALLOCATE(solsw_s2, solswfdiff_s2, sollw_s2) 902 DEALLOCATE(sollwdown_s2 )902 DEALLOCATE(sollwdown_s2, sollwdownclr_s2) 903 903 DEALLOCATE(topsw0_s2,toplw0_s2) 904 904 DEALLOCATE(solsw0_s2,sollw0_s2) -
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/physiq_mod.F90
r4741 r4758 92 92 USE lmdz_cloud_optics_prop_ini, ONLY : cloud_optics_prop_ini 93 93 USE phys_output_var_mod, ONLY : cloudth_sth,cloudth_senv,cloudth_sigmath,cloudth_sigmaenv 94 USE phys_output_var_mod, ONLY : cloud_cover_sw, cloud_cover_sw_s2 94 95 95 96 … … 1266 1267 REAL pi 1267 1268 INTEGER ieru 1269 1270 CHARACTER(len=512) :: namelist_ecrad_file 1268 1271 1269 1272 !======================================================================! … … 4579 4582 ENDIF 4580 4583 ! 4584 namelist_ecrad_file='namelist_ecrad' 4585 ! 4581 4586 CALL radlwsw & 4582 4587 (dist, rmu0, fract, & … … 4597 4602 zqsat, flwc, fiwc, & 4598 4603 ref_liq, ref_ice, ref_liq_pi, ref_ice_pi, & 4604 namelist_ecrad_file, & 4599 4605 heat,heat0,cool,cool0,albpla, & 4600 4606 heat_volc,cool_volc, & … … 4616 4622 !-end 4617 4623 ZLWFT0_i, ZFLDN0, ZFLUP0, & 4618 ZSWFT0_i, ZFSDN0, ZFSUP0) 4624 ZSWFT0_i, ZFSDN0, ZFSUP0, & 4625 cloud_cover_sw) 4619 4626 4620 4627 !lwoff=y, betalwoff=1. : offset LW CRE for radiation code and other … … 4653 4660 ENDIF 4654 4661 ! 4662 namelist_ecrad_file='namelist_ecrad' 4663 ! 4655 4664 CALL radlwsw & 4656 4665 (dist, rmu0, fract, & … … 4671 4680 zqsat, flwc, fiwc, & 4672 4681 ref_liq, ref_ice, ref_liq_pi, ref_ice_pi, & 4682 namelist_ecrad_file, & 4673 4683 heatp,heat0p,coolp,cool0p,albplap, & 4674 4684 heat_volc,cool_volc, & … … 4690 4700 !-end 4691 4701 ZLWFT0_i, ZFLDN0, ZFLUP0, & 4692 ZSWFT0_i, ZFSDN0, ZFSUP0) 4702 ZSWFT0_i, ZFSDN0, ZFSUP0, & 4703 cloud_cover_sw) 4693 4704 ENDIF !ok_4xCO2atm 4694 4705 … … 4714 4725 zqsat, flwc, fiwc, & 4715 4726 ref_liq, ref_ice, ref_liq_pi, ref_ice_pi, & 4727 namelist_ecrad_file, & 4716 4728 ! A modifier 4717 4729 heat_s2,heat0_s2,cool_s2,cool0_s2,albpla_s2, & … … 4734 4746 !-end 4735 4747 ZLWFT0_i, ZFLDN0, ZFLUP0, & 4736 ZSWFT0_i, ZFSDN0, ZFSUP0 )4737 namelist_ecrad_file='namelist_ecrad'4748 ZSWFT0_i, ZFSDN0, ZFSUP0, & 4749 cloud_cover_sw_s2) 4738 4750 ENDIF ! ok_3Deffect 4739 4751 #endif -
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/radiation_scheme.F90
r4728 r4758 12 12 ! 13 13 ! ============================================================================ 14 module interface_lmdz_ecrad 15 16 IMPLICIT NONE 17 18 contains 14 19 15 20 SUBROUTINE RADIATION_SCHEME & … … 35 40 & PFLUX_UV, PFLUX_PAR, PFLUX_PAR_CLEAR, & 36 41 & PEMIS_OUT, PLWDERIVATIVE, & 37 & PSWDIFFUSEBAND, PSWDIRECTBAND )38 42 & PSWDIFFUSEBAND, PSWDIRECTBAND, & 43 & ecrad_cloud_cover_sw) 39 44 40 45 ! RADIATION_SCHEME - Interface to modular radiation scheme … … 84 89 USE RADIATION_SETUP 85 90 USE YOMCST , ONLY : RSIGMA ! Stefan-Boltzmann constant 86 USE RADIATION_SETUP, ONLY : SETUP_RADIATION_SCHEME, &87 & config_type, driver_config_type, &88 & NWEIGHT_UV, IBAND_UV, WEIGHT_UV, &89 & NWEIGHT_PAR, IBAND_PAR, WEIGHT_PAR, &90 & ITYPE_TROP_BG_AER, TROP_BG_AER_MASS_EXT, &91 & ITYPE_STRAT_BG_AER, STRAT_BG_AER_MASS_EXT, &92 & ISolverSpartacus91 !USE RADIATION_SETUP, ONLY : SETUP_RADIATION_SCHEME, & 92 ! & config_type, driver_config_type, & 93 ! & NWEIGHT_UV, IBAND_UV, WEIGHT_UV, & 94 ! & NWEIGHT_PAR, IBAND_PAR, WEIGHT_PAR, & 95 ! & ITYPE_TROP_BG_AER, TROP_BG_AER_MASS_EXT, & 96 ! & ITYPE_STRAT_BG_AER, STRAT_BG_AER_MASS_EXT, & 97 ! & ISolverSpartacus 93 98 94 99 ! Modules from radiation library … … 176 181 REAL(KIND=JPRB), INTENT(IN) :: TIME 177 182 183 ! Name of file names specified on command line 184 character(len=512), INTENT(IN) :: namelist_file 185 logical, INTENT(IN) :: ok_3Deffect 178 186 179 187 ! OUTPUT ARGUMENTS … … 222 230 REAL(KIND=JPRB), INTENT(OUT) :: PSWDIFFUSEBAND(KLON,NSW) 223 231 REAL(KIND=JPRB), INTENT(OUT) :: PSWDIRECTBAND (KLON,NSW) 232 233 !AI Nov 2023 234 REAL(KIND=JPRB), INTENT(OUT) :: ecrad_cloud_cover_sw(KLON) 224 235 225 236 ! LOCAL VARIABLES … … 270 281 INTEGER, PARAMETER :: NAERMACC = 1 271 282 272 ! Name of file names specified on command line273 character(len=512) :: namelist_file274 275 283 logical :: loutput=.true. 276 284 logical :: lprint_input=.false. 277 logical :: lprint_config=. true.285 logical :: lprint_config=.false. 278 286 logical, save :: debut_ecrad=.true. 279 287 !$OMP THREADPRIVATE(debut_ecrad) 280 integer, save :: itap_ecrad=1 281 logical :: ok_3Deffect 288 integer, save :: itap_ecrad=0 289 !$OMP THREADPRIVATE(itap_ecrad) 290 291 REAL(KIND=JPRB) :: inv_cloud_effective_size(KLON,KLEV) 292 REAL(KIND=JPRB) :: inv_inhom_effective_size(KLON,KLEV) 293 294 integer :: irang 295 282 296 283 297 IF (LHOOK) CALL DR_HOOK('RADIATION_SCHEME',0,ZHOOK_HANDLE) … … 298 312 ! Fin partie initialisation et configuration 299 313 300 !AI juillet 2023 : verif des param de config : 301 if (lprint_config) then 302 ! IF (is_master) THEN 303 print*,'Parametres de configuration de ecrad, etape ',itap_ecrad 304 print*,'Entree dans radiation_scheme' 305 print*,'ok_3Deffect = ',ok_3Deffect 306 print*,'Fichier namelist = ',namelist_file 307 308 print*,'do_sw, do_lw, do_sw_direct, do_3d_effects = ', & 309 rad_config%do_sw, rad_config%do_lw, rad_config%do_sw_direct, rad_config%do_3d_effects 310 print*,'do_lw_side_emissivity, do_clear, do_save_radiative_properties = ', & 311 rad_config%do_lw_side_emissivity, rad_config%do_clear, rad_config%do_save_radiative_properties 312 ! print*,'sw_entrapment_name, sw_encroachment_name = ', & 313 ! rad_config%sw_entrapment_name, rad_config%sw_encroachment_name 314 print*,'do_3d_lw_multilayer_effects, do_fu_lw_ice_optics_bug = ', & 315 rad_config%do_3d_lw_multilayer_effects, rad_config%do_fu_lw_ice_optics_bug 316 print*,'do_save_spectral_flux, do_save_gpoint_flux = ', & 317 rad_config%do_save_spectral_flux, rad_config%do_save_gpoint_flux 318 print*,'do_surface_sw_spectral_flux, do_lw_derivatives = ', & 319 rad_config%do_surface_sw_spectral_flux, rad_config%do_lw_derivatives 320 print*,'do_lw_aerosol_scattering, do_lw_cloud_scattering = ', & 321 rad_config%do_lw_aerosol_scattering, rad_config%do_lw_cloud_scattering 322 print*, 'nregions, i_gas_model = ', & 323 rad_config%nregions, rad_config%i_gas_model 324 ! print*, 'ice_optics_override_file_name, liq_optics_override_file_name = ', & 325 ! rad_config%ice_optics_override_file_name, rad_config%liq_optics_override_file_name 326 ! print*, 'aerosol_optics_override_file_name, cloud_pdf_override_file_name = ', & 327 ! rad_config%aerosol_optics_override_file_name, rad_config%cloud_pdf_override_file_name 328 ! print*, 'gas_optics_sw_override_file_name, gas_optics_lw_override_file_name = ', & 329 ! rad_config%gas_optics_sw_override_file_name, rad_config%gas_optics_lw_override_file_name 330 print*, 'i_liq_model, i_ice_model, max_3d_transfer_rate = ', & 331 rad_config%i_liq_model, rad_config%i_ice_model, rad_config%max_3d_transfer_rate 332 print*, 'min_cloud_effective_size, overhang_factor = ', & 333 rad_config%min_cloud_effective_size, rad_config%overhang_factor 334 print*, 'use_canopy_full_spectrum_sw, use_canopy_full_spectrum_lw = ', & 335 rad_config%use_canopy_full_spectrum_sw, rad_config%use_canopy_full_spectrum_lw 336 print*, 'do_canopy_fluxes_sw, do_canopy_fluxes_lw = ', & 337 rad_config%do_canopy_fluxes_sw, rad_config%do_canopy_fluxes_lw 338 print*, 'do_canopy_gases_sw, do_canopy_gases_lw = ', & 339 rad_config%do_canopy_gases_sw, rad_config%do_canopy_gases_lw 340 print*, 'use_general_cloud_optics, use_general_aerosol_optics = ', & 341 rad_config%use_general_cloud_optics, rad_config%use_general_aerosol_optics 342 print*, 'do_sw_delta_scaling_with_gases, i_overlap_scheme = ', & 343 rad_config%do_sw_delta_scaling_with_gases, rad_config%i_overlap_scheme 344 print*, 'i_solver_sw, i_solver_sw, use_beta_overlap, use_vectorizable_generator = ', & 345 rad_config%i_solver_sw, rad_config%i_solver_lw, & 346 rad_config%use_beta_overlap, rad_config%use_vectorizable_generator 347 print*, 'use_expm_everywhere, iverbose, iverbosesetup = ', & 348 rad_config%use_expm_everywhere, rad_config%iverbose, rad_config%iverbosesetup 349 print*, 'cloud_inhom_decorr_scaling, cloud_fraction_threshold = ', & 350 rad_config%cloud_inhom_decorr_scaling, rad_config%cloud_fraction_threshold 351 print*, 'clear_to_thick_fraction, max_gas_od_3d, max_cloud_od = ', & 352 rad_config%clear_to_thick_fraction, rad_config%max_gas_od_3d, rad_config%max_cloud_od 353 print*, 'cloud_mixing_ratio_threshold, overhead_sun_factor =', & 354 rad_config%cloud_mixing_ratio_threshold, rad_config%overhead_sun_factor 355 print*, 'n_aerosol_types, i_aerosol_type_map, use_aerosols = ', & 356 rad_config%n_aerosol_types, rad_config%i_aerosol_type_map, rad_config%use_aerosols 357 print*, 'mono_lw_wavelength, mono_lw_total_od, mono_sw_total_od = ', & 358 rad_config%mono_lw_wavelength, rad_config%mono_lw_total_od,rad_config% mono_sw_total_od 359 print*, 'mono_lw_single_scattering_albedo, mono_sw_single_scattering_albedo = ', & 360 rad_config%mono_lw_single_scattering_albedo, rad_config%mono_sw_single_scattering_albedo 361 print*, 'mono_lw_asymmetry_factor, mono_sw_asymmetry_factor = ', & 362 rad_config%mono_lw_asymmetry_factor, rad_config%mono_sw_asymmetry_factor 363 print*, 'i_cloud_pdf_shape = ', & 364 rad_config%i_cloud_pdf_shape 365 ! cloud_type_name, use_thick_cloud_spectral_averaging = ', & 366 ! rad_config%i_cloud_pdf_shape, rad_config%cloud_type_name, & 367 ! rad_config%use_thick_cloud_spectral_averaging 368 print*, 'do_nearest_spectral_sw_albedo, do_nearest_spectral_lw_emiss = ', & 369 rad_config%do_nearest_spectral_sw_albedo, rad_config%do_nearest_spectral_lw_emiss 370 print*, 'sw_albedo_wavelength_bound, lw_emiss_wavelength_bound = ', & 371 rad_config%sw_albedo_wavelength_bound, rad_config%lw_emiss_wavelength_bound 372 print*, 'i_sw_albedo_index, i_lw_emiss_index = ', & 373 rad_config%i_sw_albedo_index, rad_config%i_lw_emiss_index 374 print*, 'do_cloud_aerosol_per_lw_g_point = ', & 375 rad_config%do_cloud_aerosol_per_lw_g_point 376 print*, 'do_cloud_aerosol_per_sw_g_point, do_weighted_surface_mapping = ', & 377 rad_config%do_cloud_aerosol_per_sw_g_point, rad_config%do_weighted_surface_mapping 378 print*, 'n_bands_sw, n_bands_lw, n_g_sw, n_g_lw = ', & 379 rad_config%n_bands_sw, rad_config%n_bands_lw, rad_config%n_g_sw, rad_config%n_g_lw 380 381 itap_ecrad=itap_ecrad+1 382 ! ENDIF 383 endif 384 314 !AI print fichiers namelist utilise 315 !if (is_omp_root) then 316 ! itap_ecrad=itap_ecrad+1 317 ! print*,'Dans radiation_scheme itap_ecrad, mpi_rank, omp_rank, namelist_file : ', & 318 ! itap_ecrad, mpi_rank, omp_rank, namelist_file 319 !else 320 ! print*,'mpi_rank omp_rank, namelist_file :', mpi_rank, omp_rank, namelist_file 321 !endif 322 323 ! AI 11 23 Allocates depplaces au debut 324 print*,'*********** ALLOCATES *******************************' 385 325 ! AI ATTENTION 386 326 ! Allocate memory in radiation objects … … 388 328 CALL single_level%allocate(KLON, NSW, 1, & 389 329 & use_sw_albedo_direct=.TRUE.) 390 391 print*,'************* THERMO (allocate + input) ************************************' 330 CALL thermodynamics%allocate(KLON, KLEV, use_h2o_sat=.true.) 331 CALL cloud%allocate(KLON, KLEV) 332 CALL aerosol%allocate(KLON, 1, KLEV, KAEROSOL) 333 CALL gas%allocate(KLON, KLEV) 334 CALL flux%allocate(rad_config, 1, KLON, KLEV) 335 336 print*,'************* THERMO (input) ************************************' 392 337 ! Set thermodynamic profiles: simply copy over the half-level 393 338 ! pressure and temperature 394 !print*,'Appel allocate thermo'395 CALL thermodynamics%allocate(KLON, KLEV, use_h2o_sat=.true.)396 !print*,'Definir les champs thermo'397 339 ! AI 398 340 ! pressure_hl > paprs … … 400 342 thermodynamics%pressure_hl (KIDIA:KFDIA,:) = PPRESSURE_H (KIDIA:KFDIA,:) 401 343 thermodynamics%temperature_hl(KIDIA:KFDIA,:) = PTEMPERATURE_H(KIDIA:KFDIA,:) 402 403 344 !print*,'Compute saturation specific humidity' 404 345 ! Compute saturation specific humidity, used to hydrate aerosols. The … … 429 370 !cur_day 430 371 !ITIM = NINT(NSTEP * YRRIP%TSTEP / 60.0_JPRB) 431 ITIM = NINT(TIME / 60.0_JPRB)372 !ITIM = NINT(TIME / 60.0_JPRB) 432 373 !current_time 433 374 !allocate(single_level%iseed(KIDIA:KFDIA)) 434 DO JLON = KIDIA, KFDIA375 !DO JLON = KIDIA, KFDIA 435 376 ! This method gives a unique value for roughly every 1-km square 436 377 ! on the globe and every minute. ASIN(PGEMU)*60 gives rough … … 442 383 ! since random numbers are generated with the help of integer 443 384 ! overflow, it should not matter if the number did overflow). 444 single_level%iseed(JLON) = ITIM + IDAY & 445 & + NINT(PGELAM(JLON)*108000000.0_JPRB & 446 & + ASIN(PGEMU(JLON))*6000.0_JPRB) 447 ENDDO 385 ! single_level%iseed(JLON) = ITIM + IDAY & 386 ! & + NINT(PGELAM(JLON)*108000000.0_JPRB & 387 ! & + ASIN(PGEMU(JLON))*6000.0_JPRB) 388 !ENDDO 389 !AI Nov 23 390 ! Simple initialization of the seeds for the Monte Carlo scheme 391 call single_level%init_seed_simple(kidia, kfdia) 448 392 449 393 print*,'********** CLOUDS (allocate + input) *******************************************' 450 394 !print*,'Appel Allocate clouds' 451 CALL cloud%allocate(KLON, KLEV)452 395 ! Set cloud fields 453 396 cloud%q_liq(KIDIA:KFDIA,:) = PQ_LIQUID(KIDIA:KFDIA,:) 454 397 cloud%q_ice(KIDIA:KFDIA,:) = PQ_ICE(KIDIA:KFDIA,:) + PQ_SNOW(KIDIA:KFDIA,:) 455 398 cloud%fraction(KIDIA:KFDIA,:) = PCLOUD_FRAC(KIDIA:KFDIA,:) 456 457 399 !!! ok AI ATTENTION a voir avec JL 458 400 ! Compute effective radi and convert to metres … … 460 402 cloud%re_liq(KIDIA:KFDIA,:) = ZRE_LIQUID_UM(KIDIA:KFDIA,:) 461 403 cloud%re_ice(KIDIA:KFDIA,:) = ZRE_ICE_UM(KIDIA:KFDIA,:) 462 463 404 ! Get the cloud overlap decorrelation length (for cloud boundaries), 464 405 ! in km, according to the parameterization specified by NDECOLAT, … … 471 412 ! AI valeur dans namelist 472 413 ! rad_config%cloud_inhom_decorr_scaling = ZDECORR_LEN_RATIO 473 474 414 !AI ATTENTION meme valeur que dans offline 475 415 ! A mettre dans namelist … … 480 420 & istartcol=JLON, iendcol=JLON) 481 421 ENDDO 482 483 422 ! IFS : 484 423 ! Cloud water content fractional standard deviation is configurable … … 489 428 CALL cloud%create_fractional_std(KLON, KLEV, driver_config%frac_std) 490 429 491 if (rad_config%i_solver_sw == ISolverSPARTACUS & 492 & .or. rad_config%i_solver_lw == ISolverSPARTACUS) then 493 ! AI ! Read cloud properties needed by SPARTACUS 494 !AI ATTENTION meme traitement dans le version offline 495 496 ! By default mid and high cloud effective size is 10 km 497 !CALL cloud%create_inv_cloud_effective_size(KLON,KLEV,1.0_JPRB/10000.0_JPRB) 498 499 ! if (driver_config%low_inv_effective_size >= 0.0_jprb & 500 ! & .or. driver_config%middle_inv_effective_size >= 0.0_jprb & 501 ! & .or. driver_config%high_inv_effective_size >= 0.0_jprb) then 502 if (driver_config%ok_effective_size) then 430 if (ok_3Deffect) then 431 if (driver_config%ok_effective_size) then 503 432 call cloud%create_inv_cloud_effective_size_eta(klon, klev, & 504 433 & thermodynamics%pressure_hl, & 505 434 & driver_config%low_inv_effective_size, & 506 435 & driver_config%middle_inv_effective_size, & 507 & driver_config%high_inv_effective_size, 0.8_jprb, 0.45_jprb) 508 ! else if (driver_config%cloud_separation_scale_surface > 0.0_jprb & 509 ! .and. driver_config%cloud_separation_scale_toa > 0.0_jprb) then 510 else if (driver_config%ok_separation) then 511 call cloud%param_cloud_effective_separation_eta(klon, klev, & 436 & driver_config%high_inv_effective_size, 0.8_jprb, 0.45_jprb, & 437 & KIDIA, KFDIA) 438 else if (driver_config%ok_separation) then 439 call cloud%param_cloud_effective_separation_eta(klon, klev, & 512 440 & thermodynamics%pressure_hl, & 513 441 & driver_config%cloud_separation_scale_surface, & 514 442 & driver_config%cloud_separation_scale_toa, & 515 443 & driver_config%cloud_separation_scale_power, & 516 & driver_config%cloud_inhom_separation_factor) 517 endif 518 endif 519 520 print*,'******** AEROSOLS (allocate + input) **************************************' 444 & driver_config%cloud_inhom_separation_factor, & 445 & KIDIA, KFDIA) 446 endif 447 else 448 if (rad_config%i_solver_sw == ISolverSPARTACUS & 449 & .or. rad_config%i_solver_lw == ISolverSPARTACUS) then 450 ! AI ! Read cloud properties needed by SPARTACUS 451 if (driver_config%ok_effective_size) then 452 call cloud%create_inv_cloud_effective_size_eta(klon, klev, & 453 & thermodynamics%pressure_hl, & 454 & driver_config%low_inv_effective_size, & 455 & driver_config%middle_inv_effective_size, & 456 & driver_config%high_inv_effective_size, 0.8_jprb, 0.45_jprb, & 457 & KIDIA, KFDIA) 458 else if (driver_config%ok_separation) then 459 call cloud%param_cloud_effective_separation_eta(klon, klev, & 460 & thermodynamics%pressure_hl, & 461 & driver_config%cloud_separation_scale_surface, & 462 & driver_config%cloud_separation_scale_toa, & 463 & driver_config%cloud_separation_scale_power, & 464 & driver_config%cloud_inhom_separation_factor, & 465 & KIDIA, KFDIA) 466 endif 467 endif 468 endif 469 470 print*,'******** AEROSOLS (input) **************************************' 521 471 !IF (NAERMACC > 0) THEN 522 CALL aerosol%allocate(KLON, 1, KLEV, KAEROSOL) ! MACC climatology523 472 !ELSE 524 473 ! CALL aerosol%allocate(KLON, 1, KLEV, 6) ! Tegen climatology … … 571 520 ! ENDDO 572 521 ! ENDDO 573 574 522 !ENDIF 575 523 576 print*,'********** GAS ( allocate +input) ************************************************'524 print*,'********** GAS (input) ************************************************' 577 525 !print*,'Appel Allocate gas' 578 CALL gas%allocate(KLON, KLEV)579 580 526 ! Convert ozone Pa*kg/kg to kg/kg 581 527 ! AI ATTENTION … … 586 532 ! ENDDO 587 533 !ENDDO 588 589 534 ! Insert gas mixing ratios 590 535 !print*,'Insert gas mixing ratios' … … 603 548 call set_gas_units(rad_config, gas) 604 549 605 print*,'************** FLUX (allocate) ***********************'606 CALL flux%allocate(rad_config, 1, KLON, KLEV)607 608 550 ! Call radiation scheme 609 print*,'******** Appel radiation scheme **************************' 551 !print*,'*** Appel radiation *** namelist **** omp_rank ****', & 552 ! omp_rank, namelist_file 553 ! if (rad_config%i_solver_sw == ISolverSPARTACUS) then 554 ! if (driver_config%ok_separation) then 555 ! print*,'Avant radiation, mpi_rank, omp_rank, size, chape inv_cloud = ',& 556 ! mpi_rank, omp_rank, & 557 ! shape(cloud%inv_cloud_effective_size), & 558 ! size(cloud%inv_cloud_effective_size) 559 ! do jlon=KIDIA, KFDIA 560 ! do jlev=1,klev 561 ! print*,' Avant radiation mpi_rank, omp_rank, jlon, jlev, & 562 ! & cloud%inv_cloud_effective_size =', mpi_rank, & 563 ! & omp_rank, jlon, jlev, & 564 ! & cloud%inv_cloud_effective_size(jlon,jlev) 565 ! enddo 566 ! enddo 567 ! cloud%inv_cloud_effective_size=inv_cloud_effective_size 568 ! cloud%inv_inhom_effective_size=inv_inhom_effective_size 569 ! endif 570 ! endif 610 571 CALL radiation(KLON, KLEV, KIDIA, KFDIA, rad_config, & 611 572 & single_level, thermodynamics, gas, cloud, aerosol, flux) 612 573 574 print*,'*********** Sortie flux ****************' 575 576 ! Cloud cover 577 ecrad_cloud_cover_sw = flux%cloud_cover_sw 613 578 ! Compute required output fluxes 614 579 ! DN and UP flux … … 621 586 PFLUX_LW_DN_CLEAR(KIDIA:KFDIA,:) = flux%lw_dn_clear(KIDIA:KFDIA,:) 622 587 PFLUX_LW_UP_CLEAR(KIDIA:KFDIA,:) = flux%lw_up_clear(KIDIA:KFDIA,:) 623 624 588 ! First the net fluxes 625 589 PFLUX_SW(KIDIA:KFDIA,:) = flux%sw_dn(KIDIA:KFDIA,:) - flux%sw_up(KIDIA:KFDIA,:) … … 629 593 PFLUX_LW_CLEAR(KIDIA:KFDIA,:) & 630 594 & = flux%lw_dn_clear(KIDIA:KFDIA,:) - flux%lw_up_clear(KIDIA:KFDIA,:) 631 632 595 ! Now the surface fluxes 633 596 !PFLUX_SW_DN_SURF(KIDIA:KFDIA) = flux%sw_dn(KIDIA:KFDIA,KLEV+1) … … 645 608 PFLUX_DIR_INTO_SUN(KIDIA:KFDIA) = PFLUX_DIR(KIDIA:KFDIA) / PMU0(KIDIA:KFDIA) 646 609 END WHERE 647 648 610 ! Top-of-atmosphere downwelling flux 649 611 !PFLUX_SW_DN_TOA(KIDIA:KFDIA) = flux%sw_dn(KIDIA:KFDIA,1) … … 651 613 !PFLUX_LW_DN_TOA(KIDIA:KFDIA) = flux%lw_dn(KIDIA:KFDIA,1) 652 614 !PFLUX_LW_UP_TOA(KIDIA:KFDIA) = flux%lw_up(KIDIA:KFDIA,1) 653 654 ! Compute UV fluxes as weighted sum of appropriate shortwave bands655 615 !AI ATTENTION 656 616 if (0.eq.1) then … … 660 620 & * flux%sw_dn_surf_band(IBAND_UV(JBAND),KIDIA:KFDIA) 661 621 ENDDO 662 663 622 ! Compute photosynthetically active radiation similarly 664 623 PFLUX_PAR (KIDIA:KFDIA) = 0.0_JPRB … … 679 638 PEMIS_OUT(KIDIA:KFDIA) = PFLUX_LW(KIDIA:KFDIA,KLEV+1) / ZBLACK_BODY_NET_LW 680 639 END WHERE 681 682 640 ! Copy longwave derivatives 683 641 ! AI ATTENTION … … 686 644 PLWDERIVATIVE(KIDIA:KFDIA,:) = flux%lw_derivatives(KIDIA:KFDIA,:) 687 645 END IF 688 689 646 ! Store the shortwave downwelling fluxes in each albedo band 690 647 !AI ATTENTION … … 706 663 ENDIF 707 664 endif 665 666 print*,'********** DEALLOCATIONS ************************' 708 667 CALL single_level%deallocate 709 668 CALL thermodynamics%deallocate … … 716 675 717 676 END SUBROUTINE RADIATION_SCHEME 677 678 end module interface_lmdz_ecrad -
LMDZ6/branches/LMDZ_ECRad/libf/phylmd/radlwsw_m.F90
r4647 r4758 24 24 qsat, flwc, fiwc, & 25 25 ref_liq, ref_ice, ref_liq_pi, ref_ice_pi, & 26 namelist_ecrad_file, & 26 27 heat,heat0,cool,cool0,albpla,& 27 28 heat_volc, cool_volc,& … … 43 44 !-end 44 45 ZLWFT0_i, ZFLDN0, ZFLUP0,& 45 ZSWFT0_i, ZFSDN0, ZFSUP0) 46 ZSWFT0_i, ZFSDN0, ZFSUP0,& 47 cloud_cover_sw) 46 48 47 49 ! Modules necessaires … … 84 86 USE time_phylmdz_mod, only: current_time 85 87 USE phys_cal_mod, only: day_cur 88 USE interface_lmdz_ecrad 86 89 #endif 87 90 … … 245 248 REAL, INTENT(in) :: ref_ice_pi(klon,klev) ! ice crystal radius pre-industrial from newmicro 246 249 250 CHARACTER(len=512), INTENT(in) :: namelist_ecrad_file 251 247 252 ! Output arguments 248 253 REAL, INTENT(out) :: heat(KLON,KLEV), cool(KLON,KLEV) … … 333 338 ZFLUX_PAR_CLEAR(klon), & ! CS photosynthetically 334 339 ZFLUX_SW_DN_TOA(klon), & ! DN SW flux at TOA 335 ZEMIS_OUT(klon) ! effective broadband emissivity 340 ZEMIS_OUT(klon), & ! effective broadband emissivity 341 cloud_cover_sw(klon) 342 336 343 REAL(KIND=8) ZLWDERIVATIVE(klon,klev+1) ! LW derivatives 337 344 REAL(KIND=8) ZSWDIFFUSEBAND(klon,NSW), & ! SW DN flux in diffuse albedo band … … 1384 1391 ! & ZFLUX_SW_DN_TOA, 1385 1392 & ZEMIS_OUT, ZLWDERIVATIVE, & 1386 & PSFSWDIF, PSFSWDIR) 1393 & PSFSWDIF, PSFSWDIR, & 1394 & cloud_cover_sw) 1387 1395 1388 1396 print *,'========= RADLWSW: apres RADIATION_SCHEME ==================== '
Note: See TracChangeset
for help on using the changeset viewer.