Changeset 4150 for trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
- Timestamp:
- Mar 24, 2026, 5:27:57 PM (3 weeks ago)
- File:
-
- 1 edited
-
trunk/LMDZ.MARS/libf/phymars/physiq_mod.F (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
r4143 r4150 275 275 REAL,INTENT(in) :: pt(ngrid,nlayer) ! temperature (K) 276 276 REAL,INTENT(in) :: pq(ngrid,nlayer,nq) ! tracers (.../kg_of_air) 277 REAL pq_corrdyn(ngrid,nlayer,nq) ! tracer mass mixing ratio after correcting278 ! mass non-conservations in dynamics279 277 REAL,INTENT(in) :: flxw(ngrid,nlayer) ! vertical mass flux (ks/s) at lower boundary of layer 280 278 … … 286 284 REAL,INTENT(out) :: pdt(ngrid,nlayer) ! temperature tendency (K/s) 287 285 REAL,INTENT(out) :: pdq(ngrid,nlayer,nq) ! tracer tendencies (../kg/s) 288 REAL pdq_corrdyn(ngrid,nlayer,nq) ! tracer mass mixing ratio tendencies in order to correct289 ! mass non-conservations in dynamics290 286 REAL,INTENT(out) :: pdpsrf(ngrid) ! surface pressure tendency (Pa/s) 291 287 … … 451 447 real colden(ngrid,nq) ! vertical column of tracers 452 448 real mass(nq) ! global mass of tracers (g) 453 real, allocatable, save :: mass_predyn(:) ! tracer mass in the whole atmosphere454 ! before dynamics455 real mass_postdyn(nq) ! tracer mass in the whole atmosphere after dynamics456 457 !$OMP THREADPRIVATE(mass_predyn)458 459 real masscorrfac(nq) ! mass correction factor for non-conservations in dynamics460 449 REAL mtot(ngrid) ! Total mass of water vapor (kg/m2) 461 450 REAL mstormdtot(ngrid) ! Total mass of stormdust tracer (kg/m2) … … 826 815 & presnivs,pseudoalt,mlayer) 827 816 #endif 828 829 allocate(mass_predyn(nq))830 831 817 ENDIF ! (end of "if firstcall") 832 818 … … 892 878 zplay(:,:) = pplay(:,:) 893 879 ps(:) = pplev(:,1) 894 895 c Correct mass non-conservation in dynamics896 c ~~~~~~~~~~~~~~~~~~897 call compute_global_mass(pq, ngrid, nlayer, nq, zplev,898 & mass_postdyn)899 900 if (.not.firstcall) then ! At first call, mass_predyn does not exist901 do iq = 1, nq902 if (noms(iq) .ne. "dust_mass" .and.903 & noms(iq) .ne. "dust_number" .and.904 & noms(iq) .ne. "ccn_mass" .and.905 & noms(iq) .ne. "ccn_number" .and.906 & noms(iq) .ne. "ccnco2_mass" .and.907 & noms(iq) .ne. "ccnco2_number" .and.908 & noms(iq) .ne. "stormdust_mass" .and.909 & noms(iq) .ne. "stormdust_number" .and.910 & noms(iq) .ne. "topdust_mass" .and.911 & noms(iq) .ne. "topdust_number") then912 masscorrfac(iq) = mass_predyn(iq)/mass_postdyn(iq)913 endif914 enddo915 916 pq_corrdyn = pq917 do ig = 1, ngrid918 do l = 1, min(nlayer, 40) ! Correction only applied to the lowest 40 layers919 do iq = 1, nq920 if (noms(iq) .ne. "dust_mass" .and.921 & noms(iq) .ne. "dust_number" .and.922 & noms(iq) .ne. "ccn_mass" .and.923 & noms(iq) .ne. "ccn_number" .and.924 & noms(iq) .ne. "ccnco2_mass" .and.925 & noms(iq) .ne. "ccnco2_number" .and.926 & noms(iq) .ne. "stormdust_mass" .and.927 & noms(iq) .ne. "stormdust_number" .and.928 & noms(iq) .ne. "topdust_mass" .and.929 & noms(iq) .ne. "topdust_number" .and.930 & iq .ne. igcm_co2) then931 ! Correcting species other than CO2932 pq_corrdyn(ig, l, iq) =933 & pq(ig, l, iq) * masscorrfac(iq)934 ! Adjust CO2 to compensate for mass creation/loss935 pq_corrdyn(ig, l, igcm_co2) =936 & pq_corrdyn(ig, l, igcm_co2) -937 & pq(ig, l, iq) * (masscorrfac(iq) - 1.)938 endif939 enddo940 enddo941 enddo942 943 pdq_corrdyn = (pq_corrdyn - pq)/ptimestep ! Mass fixer pdq944 pdq = pdq + pdq_corrdyn945 endif946 880 947 881 !#ifndef MESOSCALE … … 2634 2568 ENDDO 2635 2569 ENDDO 2636 2637 call compute_global_mass(zq, ngrid, nlayer, nq, zplev,2638 & mass_predyn)2639 2570 2640 2571 ! Density … … 4199 4130 END SUBROUTINE physiq 4200 4131 4201 subroutine compute_global_mass(zq, ngrid, nlayer, nq, zplev, mass)4202 4203 use tracer_mod, only: mmol4204 use comcstfi_h, only: g4205 use geometry_mod, only: cell_area4206 use tracer_mod, only: noms4207 use planetwide_mod, only: planetwide_sumval4208 4209 real, intent(in) :: zq(ngrid, nlayer, nq)4210 integer, intent(in) :: ngrid4211 integer, intent(in) :: nlayer4212 integer, intent(in) :: nq4213 real, intent(in) :: zplev(ngrid, nlayer + 1)4214 real, intent(out) :: mass(nq)4215 real colden(ngrid, nq)4216 integer iq, ig, l4217 4218 do iq = 1, nq4219 if (noms(iq) .ne. "dust_mass" .and.4220 & noms(iq) .ne. "dust_number" .and.4221 & noms(iq) .ne. "ccn_mass" .and.4222 & noms(iq) .ne. "ccn_number" .and.4223 & noms(iq) .ne. "ccnco2_mass" .and.4224 & noms(iq) .ne. "ccnco2_number" .and.4225 & noms(iq) .ne. "stormdust_mass" .and.4226 & noms(iq) .ne. "stormdust_number" .and.4227 & noms(iq) .ne. "topdust_mass" .and.4228 & noms(iq) .ne. "topdust_number") then4229 4230 do ig = 1, ngrid4231 colden(ig, iq) = 0.4232 end do4233 do l = 1, nlayer4234 do ig = 1, ngrid4235 colden(ig, iq) = colden(ig, iq) + zq(ig, l, iq)*4236 & (zplev(ig, l) - zplev(ig, l+1))*4237 & 6.022e22/(mmol(iq)*g)4238 end do4239 end do4240 4241 call planetwide_sumval(colden(:, iq)/6.022e234242 & *mmol(iq)*1.e4*cell_area, mass(iq))4243 4244 end if4245 end do4246 4247 end subroutine4248 4249 4132 END MODULE physiq_mod
Note: See TracChangeset
for help on using the changeset viewer.
