Changeset 5158 for LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_aerosol_optics.F90
- Timestamp:
- Aug 2, 2024, 2:12:03 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_aerosol_optics.F90
r4853 r5158 243 243 244 244 if (ao%use_hydrophilic) then 245 dojtype = 1,n_type_philic245 DO jtype = 1,n_type_philic 246 246 ao%mass_ext_sw_philic(:,:,jtype) = matmul(mapping, mass_ext_philic(:,:,jtype)) 247 247 ao%ssa_sw_philic(:,:,jtype) = matmul(mapping, mass_ext_philic(:,:,jtype) & … … 266 266 267 267 if (ao%use_hydrophilic) then 268 dojtype = 1,n_type_philic268 DO jtype = 1,n_type_philic 269 269 ao%mass_ext_lw_philic(:,:,jtype) = matmul(mapping, mass_ext_philic(:,:,jtype)) 270 270 ao%ssa_lw_philic(:,:,jtype) = matmul(mapping, mass_ext_philic(:,:,jtype) & … … 280 280 if (allocated(ao%wavelength_mono)) then 281 281 ! Monochromatic wavelengths also required 282 dojwl = 1,nmono282 DO jwl = 1,nmono 283 283 ! Wavelength (m) to wavenumber (cm-1) 284 284 wavenumber_target = 0.01_jprb / ao%wavelength_mono(jwl) … … 292 292 else 293 293 iwn = 1 294 dowhile (wavenumber(iwn+1) < wavenumber_target .and. iwn < nwn-1)294 DO while (wavenumber(iwn+1) < wavenumber_target .and. iwn < nwn-1) 295 295 iwn = iwn + 1 296 296 end do … … 419 419 420 420 if (ao%use_hydrophilic) then 421 dojtype = 1,ao%n_type_philic421 DO jtype = 1,ao%n_type_philic 422 422 ao%mass_ext_sw_philic(:,:,jtype) = matmul(mapping, ao_legacy%mass_ext_sw_philic(:,:,jtype)) 423 423 ao%ssa_sw_philic(:,:,jtype) = matmul(mapping, ao_legacy%mass_ext_sw_philic(:,:,jtype) & … … 451 451 452 452 if (ao%use_hydrophilic) then 453 dojtype = 1,ao%n_type_philic453 DO jtype = 1,ao%n_type_philic 454 454 ao%mass_ext_lw_philic(:,:,jtype) = matmul(mapping, ao_legacy%mass_ext_lw_philic(:,:,jtype)) 455 455 ao%ssa_lw_philic(:,:,jtype) = matmul(mapping, ao_legacy%mass_ext_lw_philic(:,:,jtype) & … … 579 579 ! Aerosol mixing ratios have been provided 580 580 581 dojtype = 1,config%n_aerosol_types581 DO jtype = 1,config%n_aerosol_types 582 582 if (config%aerosol_optics%iclass(jtype) == IAerosolClassUndefined) then 583 583 write(nulerr,'(a)') '*** Error: not all aerosol types are defined' … … 612 612 613 613 ! Loop over column 614 dojcol = istartcol,iendcol614 DO jcol = istartcol,iendcol 615 615 616 616 ! Reset temporary arrays … … 622 622 scat_g_lw_aerosol = 0.0_jprb 623 623 624 dojlev = istartlev,iendlev624 DO jlev = istartlev,iendlev 625 625 ! Compute relative humidity with respect to liquid 626 626 ! saturation and the index to the relative-humidity index of … … 634 634 end do 635 635 636 dojtype = 1,config%n_aerosol_types636 DO jtype = 1,config%n_aerosol_types 637 637 itype = ao%itype(jtype) 638 638 … … 643 643 ! dimension being spectral band. 644 644 if (ao%iclass(jtype) == IAerosolClassHydrophobic) then 645 dojlev = istartlev,iendlev645 DO jlev = istartlev,iendlev 646 646 mixing_ratio = aerosol%mixing_ratio(jcol,jlev,jtype) 647 dojband = 1,config%n_bands_sw647 DO jband = 1,config%n_bands_sw 648 648 local_od_sw = factor(jlev) * mixing_ratio & 649 649 & * ao%mass_ext_sw_phobic(jband,itype) … … 656 656 end do 657 657 if (config%do_lw_aerosol_scattering) then 658 dojband = 1,config%n_bands_lw658 DO jband = 1,config%n_bands_lw 659 659 local_od_lw = factor(jlev) * mixing_ratio & 660 660 & * ao%mass_ext_lw_phobic(jband,itype) … … 670 670 ! weight the optical depth by the single scattering 671 671 ! co-albedo 672 dojband = 1,config%n_bands_lw672 DO jband = 1,config%n_bands_lw 673 673 od_lw_aerosol(jband,jlev) = od_lw_aerosol(jband,jlev) & 674 674 & + factor(jlev) * mixing_ratio & … … 682 682 ! Hydrophilic aerosols require the look-up tables to 683 683 ! be indexed with irh 684 dojlev = istartlev,iendlev684 DO jlev = istartlev,iendlev 685 685 mixing_ratio = aerosol%mixing_ratio(jcol,jlev,jtype) 686 686 irh = irhs(jlev) 687 dojband = 1,config%n_bands_sw687 DO jband = 1,config%n_bands_sw 688 688 local_od_sw = factor(jlev) * mixing_ratio & 689 689 & * ao%mass_ext_sw_philic(jband,irh,itype) … … 696 696 end do 697 697 if (config%do_lw_aerosol_scattering) then 698 dojband = 1,config%n_bands_lw698 DO jband = 1,config%n_bands_lw 699 699 local_od_lw = factor(jlev) * mixing_ratio & 700 700 & * ao%mass_ext_lw_philic(jband,irh,itype) … … 710 710 ! weight the optical depth by the single scattering 711 711 ! co-albedo 712 dojband = 1,config%n_bands_lw712 DO jband = 1,config%n_bands_lw 713 713 od_lw_aerosol(jband,jlev) = od_lw_aerosol(jband,jlev) & 714 714 & + factor(jlev) * mixing_ratio & … … 740 740 741 741 ! We can assume the band and g-point indices are the same 742 dojlev = 1,nlev743 dojg = 1,config%n_g_sw742 DO jlev = 1,nlev 743 DO jg = 1,config%n_g_sw 744 744 local_scat = ssa_sw(jg,jlev,jcol)*od_sw(jg,jlev,jcol) + scat_sw_aerosol(jg,jlev) 745 745 od_sw(jg,jlev,jcol) = od_sw(jg,jlev,jcol) + od_sw_aerosol(jg,jlev) … … 751 751 else 752 752 753 dojlev = 1,nlev754 dojg = 1,config%n_g_sw753 DO jlev = 1,nlev 754 DO jg = 1,config%n_g_sw 755 755 ! Need to map between bands and g-points 756 756 iband = config%i_band_from_reordered_g_sw(jg) … … 781 781 & scat_lw_aerosol, scat_g_lw_aerosol) 782 782 783 dojlev = istartlev,iendlev784 dojg = 1,config%n_g_lw783 DO jlev = istartlev,iendlev 784 DO jg = 1,config%n_g_lw 785 785 iband = config%i_band_from_reordered_g_lw(jg) 786 786 local_od = od_lw(jg,jlev,jcol) + od_lw_aerosol(iband,jlev) … … 802 802 if (config%do_cloud_aerosol_per_lw_g_point) then 803 803 ! We can assume band and g-point indices are the same 804 dojlev = istartlev,iendlev805 dojg = 1,config%n_g_lw804 DO jlev = istartlev,iendlev 805 DO jg = 1,config%n_g_lw 806 806 od_lw(jg,jlev,jcol) = od_lw(jg,jlev,jcol) + od_lw_aerosol(jg,jlev) 807 807 end do 808 808 end do 809 809 else 810 dojlev = istartlev,iendlev811 dojg = 1,config%n_g_lw810 DO jlev = istartlev,iendlev 811 DO jg = 1,config%n_g_lw 812 812 od_lw(jg,jlev,jcol) = od_lw(jg,jlev,jcol) & 813 813 & + od_lw_aerosol(config%i_band_from_reordered_g_lw(jg),jlev) … … 901 901 902 902 ! Loop over position 903 dojcol = istartcol,iendcol903 DO jcol = istartcol,iendcol 904 904 ! Added for DWD (2020) 905 905 !NEC$ forced_collapse 906 dojlev = istartlev,iendlev907 dojb = 1,config%n_bands_sw906 DO jlev = istartlev,iendlev 907 DO jb = 1,config%n_bands_sw 908 908 od_sw_aerosol(jb,jlev) = aerosol%od_sw(jb,jlev,jcol) 909 909 scat_sw_aerosol(jb,jlev) = aerosol%ssa_sw(jb,jlev,jcol) * od_sw_aerosol(jb,jlev) … … 923 923 ! properties (noting that any gas scattering will have an 924 924 ! asymmetry factor of zero) 925 dojlev = istartlev,iendlev925 DO jlev = istartlev,iendlev 926 926 if (od_sw_aerosol(1,jlev) > 0.0_jprb) then 927 dojg = 1,config%n_g_sw927 DO jg = 1,config%n_g_sw 928 928 iband = config%i_band_from_reordered_g_sw(jg) 929 929 local_od = od_sw(jg,jlev,jcol) + od_sw_aerosol(iband,jlev) … … 961 961 962 962 ! Loop over position 963 dojcol = istartcol,iendcol963 DO jcol = istartcol,iendcol 964 964 ! Added for DWD (2020) 965 965 !NEC$ forced_collapse 966 dojlev = istartlev,iendlev967 dojb = 1,config%n_bands_lw966 DO jlev = istartlev,iendlev 967 DO jb = 1,config%n_bands_lw 968 968 od_lw_aerosol(jb,jlev) = aerosol%od_lw(jb,jlev,jcol) 969 969 scat_lw_aerosol(jb,jlev) = aerosol%ssa_lw(jb,jlev,jcol) * od_lw_aerosol(jb,jlev) … … 974 974 end do 975 975 end do 976 dojlev = istartlev,iendlev977 dojg = 1,config%n_g_lw976 DO jlev = istartlev,iendlev 977 DO jg = 1,config%n_g_lw 978 978 iband = config%i_band_from_reordered_g_lw(jg) 979 979 if (od_lw_aerosol(iband,jlev) > 0.0_jprb) then … … 995 995 996 996 ! Loop over position 997 dojcol = istartcol,iendcol997 DO jcol = istartcol,iendcol 998 998 ! Added for DWD (2020) 999 999 !NEC$ forced_collapse 1000 dojlev = istartlev,iendlev1000 DO jlev = istartlev,iendlev 1001 1001 ! If aerosol longwave scattering is not included then we 1002 1002 ! weight the optical depth by the single scattering 1003 1003 ! co-albedo 1004 dojb = 1, config%n_bands_lw1004 DO jb = 1, config%n_bands_lw 1005 1005 od_lw_aerosol(jb,jlev) = aerosol%od_lw(jb,jlev,jcol) & 1006 1006 & * (1.0_jprb - aerosol%ssa_lw(jb,jlev,jcol)) 1007 1007 end do 1008 1008 end do 1009 dojlev = istartlev,iendlev1010 dojg = 1,config%n_g_lw1009 DO jlev = istartlev,iendlev 1010 DO jg = 1,config%n_g_lw 1011 1011 od_lw(jg,jlev,jcol) = od_lw(jg,jlev,jcol) & 1012 1012 & + od_lw_aerosol(config%i_band_from_reordered_g_lw(jg),jlev) … … 1120 1120 if (lhook) call dr_hook('radiation_aerosol_optics:aerosol_extinction',0,hook_handle) 1121 1121 1122 dojtype = 1,config%n_aerosol_types1122 DO jtype = 1,config%n_aerosol_types 1123 1123 if (config%aerosol_optics%iclass(jtype) == IAerosolClassUndefined) then 1124 1124 write(nulerr,'(a)') '*** Error: not all aerosol types are defined' … … 1138 1138 1139 1139 ! Loop over position 1140 dojcol = istartcol,iendcol1140 DO jcol = istartcol,iendcol 1141 1141 ext = 0.0_jprb 1142 1142 ! Get relative-humidity index 1143 1143 irh = ao%calc_rh_index(relative_humidity(jcol)) 1144 1144 ! Add extinction coefficients from each aerosol type 1145 dojtype = 1,config%n_aerosol_types1145 DO jtype = 1,config%n_aerosol_types 1146 1146 if (ao%iclass(jtype) == IAerosolClassHydrophobic) then 1147 1147 ext = ext + mixing_ratio(jcol,jtype) &
Note: See TracChangeset
for help on using the changeset viewer.