Changeset 2193 for trunk/LMDZ.VENUS/libf/phyvenus/phytrac_chimie.F
- Timestamp:
- Dec 13, 2019, 10:44:42 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.VENUS/libf/phyvenus/phytrac_chimie.F
r2188 r2193 3 3 $ gmtime, 4 4 $ nqmax, 5 $ n _lon,5 $ nlon, 6 6 $ lat, 7 7 $ lon, 8 $ n _lev,8 $ nlev, 9 9 $ pdtphys, 10 10 $ temp, 11 11 $ pplay, 12 $ trac )13 14 ! $ iter) temporary 12 $ trac, 13 $ d_tr_chem, 14 $ iter) 15 15 16 16 use chemparam_mod … … 26 26 !=================================================================== 27 27 28 integer :: n_lon, n_lev ! number of gridpoints and levels 29 integer :: nqmax ! number of tracers 30 31 real :: gmtime 32 real :: pdtphys ! physics timestep (s) 33 real, dimension(n_lon,n_lev) :: temp ! temperature (k) 34 real, dimension(n_lon,n_lev) :: pplay ! pressure (pa) 35 36 logical :: debutphy ! first call flag 28 integer :: nlon, nlev ! number of gridpoints and levels 29 integer :: nqmax ! number of tracers 30 31 real :: gmtime ! day fraction 32 real :: pdtphys ! phytrac_chimie timestep (s) 33 real, dimension(nlon,nlev) :: temp ! temperature (k) 34 real, dimension(nlon,nlev) :: pplay ! pressure (pa) 35 real, dimension(nlon,nlev,nqmax) :: trac ! tracer mass mixing ratio 36 37 logical :: debutphy ! first call flag 37 38 38 39 !=================================================================== … … 40 41 !=================================================================== 41 42 42 integer, dimension(n_lon,n_lev) :: iter ! chemical iterations 43 44 !=================================================================== 45 ! input/output 46 !=================================================================== 47 48 real, dimension(n_lon,n_lev,nqmax) :: trac ! tracer mass mixing ratio 43 real, dimension(nlon,nlev,nqmax) :: d_tr_chem ! chemical tendency for each tracer 44 integer, dimension(nlon,nlev) :: iter ! chemical iterations 49 45 50 46 !=================================================================== … … 58 54 integer :: ilon, ilev 59 55 60 real lat(n_lon), lat_local(n_lon) 61 real lon(n_lon), lon_local(n_lon) 62 63 real, dimension(n_lon,n_lev) :: mrtwv, mrtsa ! total water and total sulfuric acid 64 real, dimension(n_lon,n_lev) :: mrwv, mrsa ! gas-phase water and gas-phase sulfuric acid 65 real, dimension(n_lon,n_lev) :: trac_sum 56 real lat(nlon), lat_local(nlon) 57 real lon(nlon), lon_local(nlon) 58 59 real, dimension(nlon,nlev) :: mrtwv, mrtsa ! total water and total sulfuric acid 60 real, dimension(nlon,nlev) :: mrwv, mrsa ! gas-phase water and gas-phase sulfuric acid 61 real, dimension(nlon,nlev) :: trac_sum 62 real, dimension(nlon,nlev,nqmax) :: ztrac ! local tracer mixing ratio 66 63 67 64 !=================================================================== … … 120 117 ! case of detailed microphysics without chemistry 121 118 !------------------------------------------------------------------- 122 if (.not. ok_chem .and. ok_cloud .and. cl_scheme ==2) then119 if (.not. ok_chem .and. ok_cloud .and. cl_scheme == 2) then 123 120 124 121 ! convert mass to volume mixing ratio 125 122 126 123 do iq = 1,nqmax - nmicro 127 trac(:,:,iq) = trac(:,:,iq)*mmean(:,:)/m_tr(iq)124 ztrac(:,:,iq) = trac(:,:,iq)*mmean(:,:)/m_tr(iq) 128 125 end do 129 126 130 127 ! initialise microphysics 131 128 132 call vapors4muphy_ini(n _lon,n_lev,trac)129 call vapors4muphy_ini(nlon,nlev,ztrac) 133 130 134 131 ! convert volume to mass mixing ratio 135 132 136 133 do iq = 1,nqmax - nmicro 137 trac(:,:,iq) = trac(:,:,iq)*m_tr(iq)/mmean(:,:)134 trac(:,:,iq) = ztrac(:,:,iq)*m_tr(iq)/mmean(:,:) 138 135 end do 139 136 … … 147 144 148 145 do iq = 1,nqmax - nmicro 149 trac(:,:,iq) = max(trac(:,:,iq)*mmean(:,:)/m_tr(iq),1.e-30)146 ztrac(:,:,iq) = max(trac(:,:,iq)*mmean(:,:)/m_tr(iq), 1.e-30) 150 147 end do 151 148 … … 158 155 ! convert mass to volume mixing ratio : liquid phase 159 156 160 trac(:,:,i_h2so4liq) = max(trac(:,:,i_h2so4liq)161 $ *mmean(:,:)/m_tr(i_h2so4liq),1.e-30)162 trac(:,:,i_h2oliq) = max(trac(:,:,i_h2oliq)163 $ *mmean(:,:)/m_tr(i_h2oliq),1.e-30)157 ztrac(:,:,i_h2so4liq) = max(trac(:,:,i_h2so4liq) 158 $ *mmean(:,:)/m_tr(i_h2so4liq), 1.e-30) 159 ztrac(:,:,i_h2oliq) = max(trac(:,:,i_h2oliq) 160 $ *mmean(:,:)/m_tr(i_h2oliq), 1.e-30) 164 161 165 162 ! total water and sulfuric acid (gas + liquid) 166 163 167 mrtwv(:,:) = trac(:,:,i_h2o) +trac(:,:,i_h2oliq)168 mrtsa(:,:) = trac(:,:,i_h2so4) +trac(:,:,i_h2so4liq)164 mrtwv(:,:) = ztrac(:,:,i_h2o) + ztrac(:,:,i_h2oliq) 165 mrtsa(:,:) = ztrac(:,:,i_h2so4) + ztrac(:,:,i_h2so4liq) 169 166 170 167 ! all water and sulfuric acid is put in the gas-phase … … 175 172 ! call microphysics 176 173 177 call new_cloud_venus(n _lev, n_lon, temp, pplay,174 call new_cloud_venus(nlev, nlon, temp, pplay, 178 175 $ mrtwv, mrtsa, mrwv, mrsa) 179 176 180 177 ! update water vapour and sulfuric acid 181 178 182 trac(:,:,i_h2o) = mrwv(:,:)183 trac(:,:,i_h2oliq) = mrtwv(:,:) -trac(:,:,i_h2o)179 ztrac(:,:,i_h2o) = mrwv(:,:) 180 ztrac(:,:,i_h2oliq) = mrtwv(:,:) - ztrac(:,:,i_h2o) 184 181 185 trac(:,:,i_h2so4) = mrsa(:,:)186 trac(:,:,i_h2so4liq) = mrtsa(:,:) -trac(:,:,i_h2so4)182 ztrac(:,:,i_h2so4) = mrsa(:,:) 183 ztrac(:,:,i_h2so4liq) = mrtsa(:,:) - ztrac(:,:,i_h2so4) 187 184 188 185 end if ! simplified scheme … … 194 191 if (ok_cloud .and. cl_scheme == 2) then 195 192 196 c Boucle sur grille (n_lon) et niveaux (n_lev) 197 DO ilon=1, n_lon 198 DO ilev=1, n_lev 199 200 if (temp(ilon,ilev).lt.500.) then 201 CALL MAD_MUPHY(pdtphys, ! Timestep 202 & temp(ilon,ilev),pplay(ilon,ilev), ! Temperature and pressure 203 & trac(ilon,ilev,i_h2o),trac(ilon,ilev,i_h2so4), ! Mixing ratio of SA and W 204 & trac(ilon,ilev,i_m0_aer),trac(ilon,ilev,i_m3_aer), ! Moments of aerosols 205 & trac(ilon,ilev,i_m0_mode1drop),trac(ilon,ilev,i_m0_mode1ccn), ! Moments of mode 1 206 & trac(ilon,ilev,i_m3_mode1sa),trac(ilon,ilev,i_m3_mode1w), ! Moments of mode 1 207 & trac(ilon,ilev,i_m3_mode1ccn), ! Moments of mode 1 208 & trac(ilon,ilev,i_m0_mode2drop),trac(ilon,ilev,i_m0_mode2ccn), ! Moments of mode 2 209 & trac(ilon,ilev,i_m3_mode2sa),trac(ilon,ilev,i_m3_mode2w), ! Moments of mode 2 210 & trac(ilon,ilev,i_m3_mode2ccn)) ! Moments of mode 2 211 else 212 trac(ilon,ilev,i_m0_aer)=0. 213 trac(ilon,ilev,i_m3_aer)=0. 214 trac(ilon,ilev,i_m0_mode1drop)=0. 215 trac(ilon,ilev,i_m0_mode1ccn)=0. 216 trac(ilon,ilev,i_m3_mode1sa)=0. 217 trac(ilon,ilev,i_m3_mode1w)=0. 218 trac(ilon,ilev,i_m3_mode1ccn)=0. 219 trac(ilon,ilev,i_m0_mode2drop)=0. 220 trac(ilon,ilev,i_m0_mode2ccn)=0. 221 trac(ilon,ilev,i_m3_mode2sa)=0. 222 trac(ilon,ilev,i_m3_mode2w)=0. 223 trac(ilon,ilev,i_m3_mode2ccn)=0. 224 endif 225 ENDDO 226 ENDDO 193 do ilon = 1,nlon 194 do ilev = 1, nlev 195 if (temp(ilon,ilev) < 500.) then 196 call mad_muphy(pdtphys, ! timestep 197 $ temp(ilon,ilev),pplay(ilon,ilev), ! temperature and pressure 198 $ ztrac(ilon,ilev,i_h2o), 199 $ ztrac(ilon,ilev,i_h2so4), 200 $ ztrac(ilon,ilev,i_m0_aer), 201 $ ztrac(ilon,ilev,i_m3_aer), 202 $ ztrac(ilon,ilev,i_m0_mode1drop), 203 $ ztrac(ilon,ilev,i_m0_mode1ccn), 204 $ ztrac(ilon,ilev,i_m3_mode1sa), 205 $ ztrac(ilon,ilev,i_m3_mode1w), 206 $ ztrac(ilon,ilev,i_m3_mode1ccn), 207 $ ztrac(ilon,ilev,i_m0_mode2drop), 208 $ ztrac(ilon,ilev,i_m0_mode2ccn), 209 $ ztrac(ilon,ilev,i_m3_mode2sa), 210 $ ztrac(ilon,ilev,i_m3_mode2w), 211 $ ztrac(ilon,ilev,i_m3_mode2ccn)) 212 else 213 ztrac(ilon,ilev,i_m0_aer) = 0. 214 ztrac(ilon,ilev,i_m3_aer) = 0. 215 ztrac(ilon,ilev,i_m0_mode1drop) = 0. 216 ztrac(ilon,ilev,i_m0_mode1ccn) = 0. 217 ztrac(ilon,ilev,i_m3_mode1sa) = 0. 218 ztrac(ilon,ilev,i_m3_mode1w) = 0. 219 ztrac(ilon,ilev,i_m3_mode1ccn) = 0. 220 ztrac(ilon,ilev,i_m0_mode2drop) = 0. 221 ztrac(ilon,ilev,i_m0_mode2ccn) = 0. 222 ztrac(ilon,ilev,i_m3_mode2sa) = 0. 223 ztrac(ilon,ilev,i_m3_mode2w) = 0. 224 ztrac(ilon,ilev,i_m3_mode2ccn) = 0. 225 end if 226 end do 227 end do 227 228 228 229 end if ! detailed scheme … … 238 239 lat_local(:) = lat(:)*rpi/180. 239 240 240 do ilon = 1,n _lon241 do ilon = 1,nlon 241 242 242 243 ! solar zenith angle … … 246 247 $ *sin(lon_local(ilon))*sin(lon_sun))*180./rpi 247 248 248 call photochemistry_venus(n _lev, n_lon, pdtphys,249 call photochemistry_venus(nlev, nlon, pdtphys, 249 250 $ pplay(ilon,:)/100., 250 251 $ temp(ilon,:), 251 $ trac(ilon,:,:),252 $ ztrac(ilon,:,:), 252 253 $ mmean(ilon,:), 253 254 $ sza_local, nqmax, iter(ilon,:)) … … 258 259 259 260 !=================================================================== 260 ! co nvert volume to mass mixing ratio261 ! compute tendencies 261 262 !=================================================================== 262 263 … … 264 265 265 266 do iq = 1,nqmax - nmicro 266 trac(:,:,iq) = trac(:,:,iq)*m_tr(iq)/mmean(:,:) 267 ztrac(:,:,iq) = ztrac(:,:,iq)*m_tr(iq)/mmean(:,:) 268 d_tr_chem(:,:,iq) = (ztrac(:,:,iq) - trac(:,:,iq))/pdtphys 267 269 end do 268 270 … … 270 272 271 273 if (ok_cloud .and. cl_scheme == 1) then 272 trac(:,:,i_h2so4liq) = trac(:,:,i_h2so4liq)*m_tr(i_h2so4liq) 273 & /mmean(:,:) 274 trac(:,:,i_h2oliq) = trac(:,:,i_h2oliq)*m_tr(i_h2oliq) 275 & /mmean(:,:) 274 ztrac(:,:,i_h2so4liq) = ztrac(:,:,i_h2so4liq)*m_tr(i_h2so4liq) 275 $ /mmean(:,:) 276 ztrac(:,:,i_h2oliq) = ztrac(:,:,i_h2oliq)*m_tr(i_h2oliq) 277 $ /mmean(:,:) 278 d_tr_chem(:,:,i_h2so4liq) = (ztrac(:,:,i_h2so4liq) 279 $ - trac(:,:,i_h2so4liq))/pdtphys 280 d_tr_chem(:,:,i_h2oliq) = (ztrac(:,:,i_h2oliq) 281 $ - trac(:,:,i_h2oliq))/pdtphys 276 282 end if 277 283 278 284 end subroutine phytrac_chimie
Note: See TracChangeset
for help on using the changeset viewer.