Changeset 2968
- Timestamp:
- May 24, 2023, 8:26:35 AM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/aeronomars/photolysis_online.F
r2615 r2968 2 2 3 3 subroutine photolysis_online(nlayer, deutchem, nb_phot_max, 4 $ alt, press, temp, zmmean,4 $ alt, press, temp, mmean, 5 5 $ i_co2, i_co, i_o, i_o1d, i_o2, i_o3, i_h, 6 6 $ i_h2, i_oh, i_ho2, i_h2o2, i_h2o, … … 22 22 $ i_n, i_n2d, i_no, i_no2, i_n2 23 23 24 real, dimension(nlayer), intent(in) :: press, temp, zmmean! pressure (hpa)/temperature (k)/mean molecular mass (g.mol-1)24 real, dimension(nlayer), intent(in) :: press, temp, mmean ! pressure (hpa)/temperature (k)/mean molecular mass (g.mol-1) 25 25 real, dimension(nlayer), intent(in) :: alt ! altitude (km) 26 26 real, dimension(nlayer,nesp), intent(in) :: rm ! mixing ratios … … 44 44 ! atmosphere 45 45 46 real, dimension(nlayer) :: colinc ! air column increment (molecule.cm-2) 47 real, dimension(nlayer,nw) :: dtrl ! rayleigh optical depth 48 real, dimension(nlayer,nw) :: dtaer ! aerosol optical depth 49 real, dimension(nlayer,nw) :: omaer ! aerosol single scattering albedo 50 real, dimension(nlayer,nw) :: gaer ! aerosol asymmetry parameter 51 real, dimension(nlayer,nw) :: dtcld ! cloud optical depth 52 real, dimension(nlayer,nw) :: omcld ! cloud single scattering albedo 53 real, dimension(nlayer,nw) :: gcld ! cloud asymmetry parameter 54 real, dimension(nlayer,nw,nabs) :: dtgas ! optical depth for each gas 55 real, dimension(nlayer,nw) :: dagas ! total gas optical depth 56 real, dimension(nlayer) :: edir, edn, eup ! normalised irradiances 57 real, dimension(nlayer) :: fdir, fdn, fup ! normalised actinic fluxes 58 real, dimension(nlayer) :: saflux ! total actinic flux 59 60 integer, dimension(0:nlayer) :: nid 61 real, dimension(0:nlayer,nlayer) :: dsdh 46 real, dimension(nlayer+1) :: zpress, zalt, ztemp, zmmean ! pressure (hpa)/altitude (km)/temperature (k)/mean molecular mass (g.mol-1) 47 48 real, dimension(nlayer+1) :: colinc ! air column increment (molecule.cm-2) 49 real, dimension(nlayer+1,nw) :: dtrl ! rayleigh optical depth 50 real, dimension(nlayer+1,nw) :: dtaer ! aerosol optical depth 51 real, dimension(nlayer+1,nw) :: omaer ! aerosol single scattering albedo 52 real, dimension(nlayer+1,nw) :: gaer ! aerosol asymmetry parameter 53 real, dimension(nlayer+1,nw) :: dtcld ! cloud optical depth 54 real, dimension(nlayer+1,nw) :: omcld ! cloud single scattering albedo 55 real, dimension(nlayer+1,nw) :: gcld ! cloud asymmetry parameter 56 real, dimension(nlayer+1,nw,nabs) :: dtgas ! optical depth for each gas 57 real, dimension(nlayer+1,nw) :: dagas ! total gas optical depth 58 real, dimension(nlayer+1) :: edir, edn, eup ! normalised irradiances 59 real, dimension(nlayer+1) :: fdir, fdn, fup ! normalised actinic fluxes 60 real, dimension(nlayer+1) :: saflux ! total actinic flux 61 62 integer, dimension(0:nlayer+1) :: nid 63 real, dimension(0:nlayer+1,nlayer+1) :: dsdh 62 64 63 65 integer :: j_o2_o, j_o2_o1d, j_co2_o, j_co2_o1d, j_o3_o1d, j_o3_o, … … 67 69 integer :: a_o2, a_co2, a_o3, a_h2o, a_h2o2, a_ho2, a_h2, a_no, 68 70 $ a_no2, a_n2 69 integer :: i, ilay, iw, ialt71 integer :: nlev, i, ilay, ilev, iw, ialt 70 72 real :: deltaj 71 73 … … 102 104 j_hdo_d = 15 ! hdo + hv -> d + oh 103 105 106 !==== define working vertical grid for the uv radiative code 107 108 nlev = nlayer + 1 109 110 do ilev = 1,nlev-1 111 zpress(ilev) = press(ilev) 112 zalt(ilev) = alt(ilev) 113 ztemp(ilev) = temp(ilev) 114 zmmean(ilev) = mmean(ilev) 115 end do 116 117 zpress(nlev) = 0. ! top of the atmosphere 118 zalt(nlev) = zalt(nlev-1) + (zalt(nlev-1) - zalt(nlev-2)) 119 ztemp(nlev) = ztemp(nlev-1) 120 zmmean(nlev) = zmmean(nlev-1) 121 104 122 !==== air column increments and rayleigh optical depth 105 123 106 call setair(nl ayer, nw, wl, wc, press,temp, zmmean, colinc, dtrl)124 call setair(nlev, nw, wl, wc, zpress, ztemp, zmmean, colinc, dtrl) 107 125 108 126 !==== set temperature-dependent cross-sections and optical depths 127 128 dtgas(:,:,:) = 0. 109 129 110 130 ! o2: … … 112 132 call seto2(nphot, nlayer, nw, wc, mopt, temp, xso2_150, xso2_200, 113 133 $ xso2_250, xso2_300, yieldo2, j_o2_o, j_o2_o1d, 114 $ colinc, rm(:,i_o2), dtgas(:,:,a_o2), sj) 134 $ colinc(1:nlayer), rm(:,i_o2), 135 $ dtgas(1:nlayer,:,a_o2), sj) 115 136 116 137 ! co2: … … 118 139 call setco2(nphot, nlayer, nw, wc, temp, xsco2_195, xsco2_295, 119 140 $ xsco2_370, yieldco2, j_co2_o, j_co2_o1d, 120 $ colinc, rm(:,i_co2), dtgas(:,:,a_co2), sj) 141 $ colinc(1:nlayer), rm(:,i_co2), 142 $ dtgas(1:nlayer,:,a_co2), sj) 121 143 122 144 ! o3: … … 124 146 call seto3(nphot, nlayer, nw, wc, temp, xso3_218, xso3_298, 125 147 $ j_o3_o, j_o3_o1d, 126 $ colinc, rm(:,i_o3), dtgas(:,:,a_o3), sj) 148 $ colinc(1:nlayer), rm(:,i_o3), 149 $ dtgas(1:nlayer,:,a_o3), sj) 127 150 128 151 ! h2o2: 129 152 130 153 call seth2o2(nphot, nlayer, nw, wc, temp, xsh2o2, j_h2o2, 131 $ colinc, rm(:,i_h2o2), dtgas(:,:,a_h2o2), sj) 154 $ colinc(1:nlayer), rm(:,i_h2o2), 155 $ dtgas(1:nlayer,:,a_h2o2), sj) 132 156 133 157 ! no2: … … 135 159 call setno2(nphot, nlayer, nw, wc, temp, xsno2, xsno2_220, 136 160 $ xsno2_294, yldno2_248, yldno2_298, j_no2, 137 $ colinc, rm(:,i_no2), dtgas(:,:,a_no2), sj) 138 139 !==== temperature independent optical depths and cross-sections 161 $ colinc(1:nlayer), rm(:,i_no2), 162 $ dtgas(1:nlayer,:,a_no2), sj) 163 164 !==== temperature-independent optical depths and cross-sections 140 165 141 166 ! optical depths … … 175 200 end do 176 201 177 !HDO cross section 202 ! if deuterium chemistry: hdo cross-section 203 178 204 if (deutchem) then 179 do ilay =1,nlayer180 do iw =1,nw-1181 ! Two chanels for HDO, with same crosssection205 do ilay = 1,nlayer 206 do iw = 1,nw-1 207 ! two chanels for hdo, with same cross-section 182 208 sj(ilay,iw,j_hdo_od) = 0.5*xshdo(iw) ! hdo -> od + h 183 209 sj(ilay,iw,j_hdo_d) = 0.5*xshdo(iw) ! hdo -> d + oh 184 end do185 end do186 end if210 end do 211 end do 212 end if 187 213 188 214 !==== set aerosol properties and optical depth 189 215 190 call setaer(nl ayer,alt,tau,nw,dtaer,omaer,gaer)216 call setaer(nlev,zalt,tau,nw,dtaer,omaer,gaer) 191 217 192 218 !==== set cloud properties and optical depth 193 219 194 call setcld(nl ayer,nw,dtcld,omcld,gcld)220 call setcld(nlev,nw,dtcld,omcld,gcld) 195 221 196 222 !==== slant path lengths in spherical geometry 197 223 198 call sphers(nl ayer,alt,sza,dsdh,nid)224 call sphers(nlev,zalt,sza,dsdh,nid) 199 225 200 226 !==== solar flux at mars … … 214 240 215 241 ! monochromatic radiative transfer. outputs are: 216 ! normalized irradiances edir(nl ayer), edn(nlayer), eup(nlayer)217 ! normalized actinic fluxes fdir(nl ayer), fdn(nlayer), fup(nlayer)242 ! normalized irradiances edir(nlev), edn(nlev), eup(nlev) 243 ! normalized actinic fluxes fdir(nlev), fdn(nlev), fup(nlev) 218 244 ! where 219 245 ! dir = direct beam, dn = down-welling diffuse, up = up-welling diffuse 220 246 221 call rtlink(nl ayer, nw, iw, albedo(iw), sza, dsdh, nid, dtrl,247 call rtlink(nlev, nw, iw, albedo(iw), sza, dsdh, nid, dtrl, 222 248 $ dagas, dtcld, omcld, gcld, dtaer, omaer, gaer, 223 249 $ edir, edn, eup, fdir, fdn, fup) … … 287 313 colinc(ilev) = avo*0.1*dp/(zmmean(ilev)*g) 288 314 end do 289 colinc(nlev) = avo*0.1*press(nlev)*100./(zmmean(nlev)*g)315 colinc(nlev) = 0. 290 316 291 317 do iw = 1, nw - 1 … … 711 737 !============================================================================== 712 738 713 subroutine setaer(nl ayer,alt,tau,nw,dtaer,omaer,gaer)739 subroutine setaer(nlev,zalt,tau,nw,dtaer,omaer,gaer) 714 740 715 741 !-----------------------------------------------------------------------------* … … 723 749 ! input 724 750 725 integer :: nl ayer ! number of vertical layers751 integer :: nlev ! number of vertical levels 726 752 integer :: nw ! number of wavelength grid points 727 real, dimension(nl ayer) :: alt! altitude (km)753 real, dimension(nlev) :: zalt ! altitude (km) 728 754 real :: tau ! integrated aerosol optical depth at the surface 729 755 730 756 ! output 731 757 732 real, dimension(nl ayer,nw) :: dtaer! aerosol optical depth733 real, dimension(nl ayer,nw) :: omaer! aerosol single scattering albedo734 real, dimension(nl ayer,nw) :: gaer! aerosol asymmetry parameter758 real, dimension(nlev,nw) :: dtaer ! aerosol optical depth 759 real, dimension(nlev,nw) :: omaer ! aerosol single scattering albedo 760 real, dimension(nlev,nw) :: gaer ! aerosol asymmetry parameter 735 761 736 762 ! local 737 763 738 integer :: il ay, iw739 real, dimension(nl ayer) :: aer! dust extinction764 integer :: ilev, iw 765 real, dimension(nlev) :: aer ! dust extinction 740 766 real :: omega, g, scaleh, gamma 741 767 real :: dz, tautot, q0 … … 753 779 754 780 tautot = 0. 755 do il ay = 1, nlayer-1756 dz = alt(ilay+1) - alt(ilay)757 tautot = tautot + exp(gamma*(1. - exp( alt(ilay)/scaleh)))*dz781 do ilev = 1, nlev-1 782 dz = zalt(ilev+1) - zalt(ilev) 783 tautot = tautot + exp(gamma*(1. - exp(zalt(ilev)/scaleh)))*dz 758 784 end do 759 785 760 786 q0 = tau/tautot 761 do il ay = 1, nlayer-1762 dz = alt(ilay+1) - alt(ilay)763 dtaer(il ay,:) = q0*exp(gamma*(1. - exp(alt(ilay)/scaleh)))*dz764 omaer(il ay,:) = omega765 gaer(il ay,:) = g787 do ilev = 1, nlev-1 788 dz = zalt(ilev+1) - zalt(ilev) 789 dtaer(ilev,:) = q0*exp(gamma*(1. - exp(zalt(ilev)/scaleh)))*dz 790 omaer(ilev,:) = omega 791 gaer(ilev,:) = g 766 792 end do 767 793 … … 770 796 !============================================================================== 771 797 772 subroutine setcld(nl ayer,nw,dtcld,omcld,gcld)798 subroutine setcld(nlev,nw,dtcld,omcld,gcld) 773 799 774 800 !-----------------------------------------------------------------------------* … … 782 808 ! input 783 809 784 integer :: nl ayer ! number of vertical layers810 integer :: nlev ! number of vertical levels 785 811 integer :: nw ! number of wavelength grid points 786 812 787 813 ! output 788 814 789 real, dimension(nl ayer,nw) :: dtcld ! cloud optical depth790 real, dimension(nl ayer,nw) :: omcld ! cloud single scattering albedo791 real, dimension(nl ayer,nw) :: gcld ! cloud asymmetry parameter815 real, dimension(nlev,nw) :: dtcld ! cloud optical depth 816 real, dimension(nlev,nw) :: omcld ! cloud single scattering albedo 817 real, dimension(nlev,nw) :: gcld ! cloud asymmetry parameter 792 818 793 819 ! local 794 820 795 integer :: il ay, iw821 integer :: ilev, iw 796 822 797 823 ! dtcld : optical depth … … 799 825 ! gcld : asymmetry factor 800 826 801 do ilay = 1, nlayer - 1 802 do iw = 1, nw - 1 803 dtcld(ilay,iw) = 0. ! no clouds for the moment 804 omcld(ilay,iw) = 0.99 805 gcld(ilay,iw) = 0.85 827 dtcld(:,:) = 0. 828 829 do ilev = 1,nlev-1 830 do iw = 1,nw-1 831 dtcld(ilev,iw) = 0. ! no clouds for the moment 832 omcld(ilev,iw) = 0.99 833 gcld(ilev,iw) = 0.85 806 834 end do 807 835 end do
Note: See TracChangeset
for help on using the changeset viewer.