Changeset 3044
- Timestamp:
- Sep 19, 2023, 5:31:26 PM (15 months ago)
- Location:
- trunk/LMDZ.GENERIC/libf/phystd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/callcorrk.F90
r2972 r3044 444 444 445 445 if(varfixed .and. generic_condensation .and. .not. water)then 446 write(*,*) "Deep water vapor mixing ratio ? (no effect if negative) "446 write(*,*) "Deep generic tracer vapor mixing ratio ? (no effect if negative) " 447 447 qvap_deep=-1. ! default value 448 448 call getin_p("qvap_deep",qvap_deep) -
trunk/LMDZ.GENERIC/libf/phystd/condensation_generic_mod.F90
r2890 r3044 47 47 ! Options : 48 48 real, save :: metallicity !metallicity of planet 49 REAL, SAVE :: qvap_deep ! deep mixing ratio of water vapor when simulating bottom less planets 50 !$OMP THREADPRIVATE(metallicity, qvap_deep) 49 REAL, SAVE :: qvap_deep ! deep mixing ratio of vapor when simulating bottom less planets 50 REAL, SAVE :: qvap_top ! top mixing ratio of vapor when simulating bottom less planets 51 logical, save :: perfect_vap_profile 52 !$OMP THREADPRIVATE(metallicity, qvap_deep, qvap_top, perfect_vap_profile) 51 53 52 54 ! Local variables … … 57 59 INTEGER i, k , nn, iq 58 60 INTEGER,PARAMETER :: nitermax=5000 59 INTEGER,PARAMETER :: tau=86400 ! tau is in seconds and must not be lower than the physical step time. 61 REAL tau ! tau is in seconds and must not be lower than the physical step time. 62 integer k_cold_trap 60 63 DOUBLE PRECISION,PARAMETER :: alpha=.1,qthreshold=1.d-8 61 64 ! JL13: if "careful, T<Tmin in psat water" appears often, you may want to stabilise the model by … … 65 68 DOUBLE PRECISION zqs(ngrid) 66 69 real zt(ngrid),local_p,psat_tmp,dlnpsat_tmp,Lcp,zqs_temp,zdqs 70 real zqs_temp_1, zqs_temp_2, zqs_temp_3 67 71 integer igcm_generic_vap, igcm_generic_ice! index of the vap and ice of generic_tracer 68 72 ! CHARACTER(len=*) :: tname_ice … … 82 86 write(*,*) " metallicity = ",metallicity 83 87 84 write(*,*) "Deep water vapor mixing ratio ? (no effect if negative) "88 write(*,*) "Deep generic tracer vapor mixing ratio ? (no effect if negative) " 85 89 qvap_deep=-1. ! default value 86 90 call getin_p("qvap_deep",qvap_deep) 87 91 write(*,*) " qvap_deep = ",qvap_deep 92 93 write(*,*) "top generic tracer vapor mixing ratio ? (no effect if negative) " 94 qvap_top=-1. ! default value 95 call getin_p("qvap_top",qvap_top) 96 write(*,*) " qvap_top = ",qvap_top 97 98 write(*,*) " perfect_vap_profile ? " 99 perfect_vap_profile=.false. ! default value 100 call getin_p("perfect_vap_profile",perfect_vap_profile) 101 write(*,*) " perfect_vap_profile = ",perfect_vap_profile 88 102 89 103 firstcall = .false. … … 181 195 Enddo ! k= nlayer, 1, -1 182 196 197 if ((perfect_vap_profile) .and. (ngrid.eq.1)) then 198 ! perfect_vap_profile is a mode that should a priori only be used in 1D: 199 ! it aims to force the vap profile: 200 ! - below condensation, it is forced to qvap_deep 201 ! - at condensation levels, it is forced to 99% of sat 202 ! - above the cold trap, it is forced to the value allowed by the cold trap 203 tau=3*24*3600 204 205 k_cold_trap = 2 206 do k=2,nlayer-1 207 208 zt(1)=pt(1,k-1)+pdt(1,k-1)*ptimestep 209 call Psat_generic(zt(1),pplay(1,k-1),metallicity,psat_tmp,zqs_temp_1) 210 zt(1)=pt(1,k)+pdt(1,k)*ptimestep 211 call Psat_generic(zt(1),pplay(1,k),metallicity,psat_tmp,zqs_temp_2) 212 zt(1)=pt(1,k+1)+pdt(1,k+1)*ptimestep 213 call Psat_generic(zt(1),pplay(1,k+1),metallicity,psat_tmp,zqs_temp_3) 214 215 if ((zqs_temp_1 .gt. zqs_temp_2) .and. (zqs_temp_3 .gt. zqs_temp_2)) then 216 k_cold_trap = k 217 exit 218 endif 219 enddo 220 if (k_cold_trap .lt. nlayer) then 221 do k=k_cold_trap+1,nlayer 222 pdqvaplsc(1,k,igcm_generic_vap) = (pq(1,k_cold_trap,igcm_generic_vap) - pq(1,k,igcm_generic_vap))/tau - pdq(1,k,igcm_generic_vap) 223 enddo 224 endif 225 226 do k=1,k_cold_trap 227 zt(1)=pt(1,k)+pdt(1,k)*ptimestep 228 call Psat_generic(zt(1),pplay(1,k),metallicity,psat_tmp,zqs_temp) 229 if (zqs_temp .gt. qvap_deep) then 230 pdqvaplsc(1,k,igcm_generic_vap) = (qvap_deep - pq(1,k,igcm_generic_vap))/tau - pdq(1,k,igcm_generic_vap) 231 endif 232 if (zqs_temp .lt. qvap_deep) then 233 pdqvaplsc(1,k,igcm_generic_vap) = (0.99*zqs_temp - pq(1,k,igcm_generic_vap))/tau - pdq(1,k,igcm_generic_vap) 234 endif 235 enddo 236 237 pdqliqlsc(1:ngrid,:,igcm_generic_ice) = 0. 238 pdtlsc(1:ngrid,:) = 0. 239 endif 240 183 241 if (qvap_deep >= 0.) then 242 if (ngrid.eq.1) then ! if 1D 243 tau=3*24*3600 ! tau must not be lower than the physical step time. In 1D time step is very long 244 else 245 tau=3600 ! for 3D 246 endif 184 247 !brings lower generic vapor ratio to a fixed value. 185 248 ! tau is in seconds and must not be lower than the physical step time. 186 249 pdqvaplsc(1:ngrid,1,igcm_generic_vap) = (qvap_deep - pq(1:ngrid,1,igcm_generic_vap))/tau - pdq(1:ngrid,1,igcm_generic_vap) 187 250 endif 251 if (qvap_top >= 0.) then 252 if (ngrid.eq.1) then ! if 1D 253 tau=3*24*3600 ! tau must not be lower than the physical step time. In 1D time step is very long 254 else 255 tau=3600 ! for 3D 256 endif 257 !brings lower generic vapor ratio to a fixed value. 258 ! tau is in seconds and must not be lower than the physical step time. 259 pdqvaplsc(1:ngrid,nlayer,igcm_generic_vap) = (qvap_top - pq(1:ngrid,nlayer,igcm_generic_vap))/tau - pdq(1:ngrid,nlayer,igcm_generic_vap) 260 endif 188 261 endif !if(call_ice_vap_generic) 189 262 enddo ! iq=1,nq
Note: See TracChangeset
for help on using the changeset viewer.