- Timestamp:
- Mar 19, 2024, 3:34:21 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmd/ecrad/radiation/radiation_ecckd_interface.F90
r4773 r4853 39 39 if (lhook) call dr_hook('radiation_ecckd_interface:setup_gas_optics',0,hook_handle) 40 40 41 if (config%do_sw ) then41 if (config%do_sw .and. config%i_gas_model_sw == IGasModelECCKD) then 42 42 43 43 ! Read shortwave ecCKD gas optics NetCDF file … … 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)) 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)) 59 allocate(config%i_band_from_g_sw (config%n_g_sw)) 60 allocate(config%i_band_from_reordered_g_sw(config%n_g_sw)) 61 allocate(config%i_g_from_reordered_g_sw (config%n_g_sw)) 71 62 72 63 if (config%do_cloud_aerosol_per_sw_g_point) then … … 93 84 end if 94 85 95 if (config%do_lw ) then86 if (config%do_lw .and. config%i_gas_model_lw == IGasModelECCKD) then 96 87 97 88 ! Read longwave ecCKD gas optics NetCDF file … … 111 102 end if 112 103 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 104 allocate(config%i_band_from_g_lw (config%n_g_lw)) 105 allocate(config%i_band_from_reordered_g_lw(config%n_g_lw)) 106 allocate(config%i_g_from_reordered_g_lw (config%n_g_lw)) 126 107 127 108 if (config%do_cloud_aerosol_per_lw_g_point) then … … 199 180 use yomhook, only : lhook, dr_hook, jphook 200 181 201 use radiation_config, only : config_type 182 use radiation_config, only : config_type, IGasModelECCKD 202 183 use radiation_thermodynamics, only : thermodynamics_type 203 184 use radiation_single_level, only : single_level_type … … 242 223 real(jprb) :: temperature_fl(istartcol:iendcol,nlev) 243 224 244 integer :: jcol 225 real(jprb) :: concentration_scaling(NMaxGases) 226 227 logical :: is_volume_mixing_ratio 228 229 integer :: jcol, jlev, jg 245 230 246 231 real(jphook) :: hook_handle … … 259 244 & / (thermodynamics%pressure_hl(istartcol:iendcol,1:nlev) & 260 245 & +thermodynamics%pressure_hl(istartcol:iendcol,2:nlev+1)) 261 262 if (config%do_sw) then 263 264 call config%gas_optics_sw%calc_optical_depth(ncol,nlev,istartcol,iendcol, & 265 & NMaxGases, thermodynamics%pressure_hl, & 266 & temperature_fl, & 267 & gas%mixing_ratio, & 268 ! & reshape(gas%mixing_ratio(istartcol:iendcol,:,:), & 269 ! & [nlev,iendcol-istartcol+1,NMaxGases],order=[2,1,3]), & 270 & od_sw, rayleigh_od_fl=ssa_sw) 246 247 ! Check that the gas concentrations are stored in volume mixing 248 ! ratio with no scaling; if not, return a vector of scalings 249 call gas%assert_units(IVolumeMixingRatio, scale_factor=1.0_jprb, & 250 & istatus=is_volume_mixing_ratio) 251 if (.not. is_volume_mixing_ratio) then 252 call gas%get_scaling(IVolumeMixingRatio, concentration_scaling) 253 else 254 concentration_scaling = 1.0_jprb 255 end if 256 257 if (config%do_sw .and. config%i_gas_model_sw == IGasModelECCKD) then 258 259 if (is_volume_mixing_ratio) then 260 call config%gas_optics_sw%calc_optical_depth(ncol,nlev,istartcol,iendcol, & 261 & NMaxGases, thermodynamics%pressure_hl, & 262 & temperature_fl, gas%mixing_ratio, & 263 & od_sw, rayleigh_od_fl=ssa_sw) 264 else 265 call config%gas_optics_sw%calc_optical_depth(ncol,nlev,istartcol,iendcol, & 266 & NMaxGases, thermodynamics%pressure_hl, & 267 & temperature_fl, gas%mixing_ratio, & 268 & od_sw, rayleigh_od_fl=ssa_sw, concentration_scaling=concentration_scaling) 269 end if 270 271 271 ! At this point od_sw = absorption optical depth and ssa_sw = 272 272 ! rayleigh optical depth: convert to total optical depth and 273 273 ! single-scattering albedo 274 od_sw = od_sw + ssa_sw 275 ssa_sw = ssa_sw / od_sw 274 do jcol = istartcol,iendcol 275 do jlev = 1, nlev 276 do jg = 1, config%n_g_sw 277 od_sw(jg,jlev,jcol) = od_sw(jg,jlev,jcol) + ssa_sw(jg,jlev,jcol) 278 ssa_sw(jg,jlev,jcol) = ssa_sw(jg,jlev,jcol) / od_sw(jg,jlev,jcol) 279 end do 280 end do 281 end do 276 282 277 283 if (present(incoming_sw)) then … … 287 293 end if 288 294 289 if (config%do_lw) then 290 291 call config%gas_optics_lw%calc_optical_depth(ncol,nlev,istartcol,iendcol, & 292 & NMaxGases, thermodynamics%pressure_hl, & 293 & temperature_fl, & 294 & gas%mixing_ratio, & 295 ! & reshape(gas%mixing_ratio(istartcol:iendcol,:,:), & 296 ! & [nlev,iendcol-istartcol+1,NMaxGases],order=[2,1,3]), & 297 & od_lw) 295 if (config%do_lw .and. config%i_gas_model_lw == IGasModelECCKD) then 296 297 if (is_volume_mixing_ratio) then 298 call config%gas_optics_lw%calc_optical_depth(ncol,nlev,istartcol,iendcol, & 299 & NMaxGases, thermodynamics%pressure_hl, & 300 & temperature_fl, gas%mixing_ratio, & 301 & od_lw) 302 else 303 call config%gas_optics_lw%calc_optical_depth(ncol,nlev,istartcol,iendcol, & 304 & NMaxGases, thermodynamics%pressure_hl, & 305 & temperature_fl, gas%mixing_ratio, & 306 & od_lw, concentration_scaling=concentration_scaling) 307 end if 298 308 299 309 ! Calculate the Planck function for each g point … … 305 315 & single_level%skin_temperature(istartcol:iendcol), & 306 316 & lw_emission(:,:)) 317 !NEC$ forced_collapse 307 318 lw_emission = lw_emission * (1.0_jprb - lw_albedo) 308 319
Note: See TracChangeset
for help on using the changeset viewer.