- 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.F90
r4773 r4853 15 15 ! 16 16 17 #include "ecrad_config.h" 18 17 19 module radiation_ecckd 18 20 … … 105 107 ! Vectorized version of the optical depth look-up performs better on 106 108 ! NEC, but slower on x86 107 #ifdef __SX__109 #ifdef DWD_VECTOR_OPTIMIZATIONS 108 110 procedure :: calc_optical_depth => calc_optical_depth_ckd_model_vec 109 111 #else … … 125 127 subroutine read_ckd_model(this, filename, iverbose) 126 128 127 use easy_netcdf, only : netcdf_file 129 #ifdef EASY_NETCDF_READ_MPI 130 use easy_netcdf_read_mpi, only : netcdf_file 131 #else 132 use easy_netcdf, only : netcdf_file 133 #endif 128 134 !use radiation_io, only : nulerr, radiation_abort 129 use yomhook, only : lhook, dr_hook, jphook135 use yomhook, only : lhook, dr_hook, jphook 130 136 131 137 class(ckd_model_type), intent(inout) :: this … … 166 172 this%d_log_pressure = log(pressure_lut(2)) - this%log_pressure1 167 173 call file%get('temperature', temperature_full) 168 ! AI oct 2023 ajout pour le double appel de ecrad169 if (allocated(this%temperature1)) deallocate(this%temperature1)170 174 allocate(this%temperature1(this%npress)); 171 175 this%temperature1 = temperature_full(:,1) … … 200 204 ! Read gases 201 205 call file%get('n_gases', this%ngas) 202 if (allocated(this%single_gas)) deallocate(this%single_gas)203 206 allocate(this%single_gas(this%ngas)) 204 207 call file%get_global_attribute('constituent_id', constituent_id) … … 292 295 subroutine read_spectral_solar_cycle(this, filename, iverbose, use_updated_solar_spectrum) 293 296 294 use easy_netcdf, only : netcdf_file 295 use radiation_io, only : nulout, nulerr, radiation_abort 296 use yomhook, only : lhook, dr_hook, jphook 297 #ifdef EASY_NETCDF_READ_MPI 298 use easy_netcdf_read_mpi, only : netcdf_file 299 #else 300 use easy_netcdf, only : netcdf_file 301 #endif 302 use radiation_io, only : nulout, nulerr, radiation_abort 303 use yomhook, only : lhook, dr_hook, jphook 297 304 298 305 ! Reference total solar irradiance (W m-2) … … 450 457 subroutine calc_optical_depth_ckd_model(this, ncol, nlev, istartcol, iendcol, nmaxgas, & 451 458 & pressure_hl, temperature_fl, mole_fraction_fl, & 452 & optical_depth_fl, rayleigh_od_fl )459 & optical_depth_fl, rayleigh_od_fl, concentration_scaling) 453 460 454 461 use yomhook, only : lhook, dr_hook, jphook … … 466 473 ! Gas mole fractions at full levels (mol mol-1), dimensioned (ncol,nlev,nmaxgas) 467 474 real(jprb), intent(in) :: mole_fraction_fl(ncol,nlev,nmaxgas) 475 ! Optional concentration scaling of each gas 476 real(jprb), optional, intent(in) :: concentration_scaling(nmaxgas) 468 477 469 478 ! Output variables … … 486 495 487 496 real(jprb) :: multiplier(nlev), simple_multiplier(nlev), global_multiplier, temperature1 497 real(jprb) :: scaling 488 498 489 499 ! Indices and weights in temperature, pressure and concentration interpolation … … 547 557 multiplier = simple_multiplier * mole_fraction_fl(jcol,:,igascode) 548 558 559 if (present(concentration_scaling)) then 560 multiplier = multiplier * concentration_scaling(igascode) 561 end if 562 549 563 do jlev = 1,nlev 550 564 optical_depth_fl(:,jlev,jcol) = optical_depth_fl(:,jlev,jcol) & … … 557 571 case (IConcDependenceRelativeLinear) 558 572 molar_abs => this%single_gas(jgas)%molar_abs 559 multiplier = simple_multiplier * (mole_fraction_fl(jcol,:,igascode) & 560 & - single_gas%reference_mole_frac) 573 574 if (present(concentration_scaling)) then 575 multiplier = simple_multiplier & 576 & * (mole_fraction_fl(jcol,:,igascode)*concentration_scaling(igascode) & 577 & - single_gas%reference_mole_frac) 578 else 579 multiplier = simple_multiplier * (mole_fraction_fl(jcol,:,igascode) & 580 & - single_gas%reference_mole_frac) 581 end if 582 561 583 do jlev = 1,nlev 562 584 optical_depth_fl(:,jlev,jcol) = optical_depth_fl(:,jlev,jcol) & … … 579 601 580 602 case (IConcDependenceLUT) 603 604 if (present(concentration_scaling)) then 605 scaling = concentration_scaling(igascode) 606 else 607 scaling = 1.0_jprb 608 end if 609 581 610 ! Logarithmic interpolation in concentration space 582 611 molar_abs_conc => this%single_gas(jgas)%molar_abs_conc … … 584 613 do jlev = 1,nlev 585 614 ! Take care of mole_fraction == 0 586 log_conc = log(max(mole_fraction_fl(jcol,jlev,igascode) , mole_frac1))615 log_conc = log(max(mole_fraction_fl(jcol,jlev,igascode)*scaling, mole_frac1)) 587 616 cindex1 = (log_conc - single_gas%log_mole_frac1) / single_gas%d_log_mole_frac 588 617 cindex1 = 1.0_jprb + max(0.0_jprb, min(cindex1, single_gas%n_mole_frac-1.0001_jprb)) … … 601 630 do jlev = 1,nlev 602 631 optical_depth_fl(:,jlev,jcol) = optical_depth_fl(:,jlev,jcol) & 603 & + (simple_multiplier(jlev) * mole_fraction_fl(jcol,jlev,igascode) ) * ( &632 & + (simple_multiplier(jlev) * mole_fraction_fl(jcol,jlev,igascode) * scaling) * ( & 604 633 & (cw1(jlev) * tw1(jlev) * pw1(jlev)) * molar_abs_conc(:,ip1(jlev),it1(jlev),ic1(jlev)) & 605 634 & +(cw1(jlev) * tw1(jlev) * pw2(jlev)) * molar_abs_conc(:,ip1(jlev)+1,it1(jlev),ic1(jlev)) &
Note: See TracChangeset
for help on using the changeset viewer.