Changeset 3280 for trunk/LMDZ.GENERIC
- Timestamp:
- Mar 20, 2024, 4:29:25 PM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/condensation_generic_mod.F90
r3103 r3280 49 49 REAL, SAVE :: qvap_deep ! deep mixing ratio of vapor when simulating bottom less planets 50 50 REAL, SAVE :: qvap_top ! top mixing ratio of vapor when simulating bottom less planets 51 logical, save :: perfect_vap_profile52 !$OMP THREADPRIVATE(metallicity, qvap_deep, qvap_top, perfect_vap_profile)51 logical, save :: align_strato_cold_trap 52 !$OMP THREADPRIVATE(metallicity, qvap_deep, qvap_top, align_strato_cold_trap) 53 53 54 54 ! Local variables … … 68 68 DOUBLE PRECISION zqs(ngrid) 69 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 71 integer igcm_generic_vap, igcm_generic_ice! index of the vap and ice of generic_tracer 72 ! CHARACTER(len=*) :: tname_ice 70 real zqs_temp_1, zqs_temp_2 71 integer igcm_generic_vap, igcm_generic_ice ! index of the vap and ice of generic_tracer 73 72 ! evaporation calculations 74 73 REAL dqevap(ngrid,nlayer),dtevap(ngrid,nlayer) … … 95 94 call getin_p("qvap_top",qvap_top) 96 95 write(*,*) " qvap_top = ",qvap_top 97 98 write(*,*) " perfect_vap_profile? "99 perfect_vap_profile=.false. ! default value100 call getin_p(" perfect_vap_profile",perfect_vap_profile)101 write(*,*) " perfect_vap_profile = ",perfect_vap_profile96 97 write(*,*) " align_strato_cold_trap ? " 98 align_strato_cold_trap=.false. ! default value 99 call getin_p("align_strato_cold_trap",align_strato_cold_trap) 100 write(*,*) " align_strato_cold_trap = ",align_strato_cold_trap 102 101 103 102 firstcall = .false. … … 195 194 Enddo ! k= nlayer, 1, -1 196 195 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 ! as it is written below, 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 204 ! perfect_vap_profile can be customed as you want 205 206 tau = 10. * ptimestep ! tau must not be lower than the physical step time. 207 208 k_cold_trap = 2 196 if (align_strato_cold_trap .and. (ngrid.eq.1)) then 197 ! aligns GCS vapor in the stratosphere to the quantity fixed by the cold trap 198 ! works only in 1D 199 tau = 10. * ptimestep 200 ! tau is in seconds and must not be lower than the physical step time. 201 202 ! Look for the cold trap 203 k_cold_trap = 1 ! initialization of cold trap layer 204 zqs_temp_2 = 1 ! initialization of minimum of saturation 209 205 do k=2,nlayer-1 210 211 zt(1)=pt(1,k-1)+pdt(1,k-1)*ptimestep 212 call Psat_generic(zt(1),pplay(1,k-1),metallicity,psat_tmp,zqs_temp_1) 213 zt(1)=pt(1,k)+pdt(1,k)*ptimestep 214 call Psat_generic(zt(1),pplay(1,k),metallicity,psat_tmp,zqs_temp_2) 215 zt(1)=pt(1,k+1)+pdt(1,k+1)*ptimestep 216 call Psat_generic(zt(1),pplay(1,k+1),metallicity,psat_tmp,zqs_temp_3) 217 218 if ((zqs_temp_1 .gt. zqs_temp_2) .and. (zqs_temp_3 .gt. zqs_temp_2)) then 206 zt(1) = pt(1,k)+pdt(1,k)*ptimestep 207 call Psat_generic(zt(1),pplay(1,k),metallicity,psat_tmp,zqs_temp_1) 208 if (zqs_temp_1 .lt. zqs_temp_2) then 219 209 k_cold_trap = k 220 exit210 zqs_temp_2 = zqs_temp_1 221 211 endif 222 212 enddo 223 if (k_cold_trap .lt. nlayer) then 224 do k=k_cold_trap+1,nlayer 225 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) 226 enddo 227 endif 228 229 do k=1,k_cold_trap 230 zt(1)=pt(1,k)+pdt(1,k)*ptimestep 231 call Psat_generic(zt(1),pplay(1,k),metallicity,psat_tmp,zqs_temp) 232 if (zqs_temp .gt. qvap_deep) then 233 pdqvaplsc(1,k,igcm_generic_vap) = (qvap_deep - pq(1,k,igcm_generic_vap))/tau - pdq(1,k,igcm_generic_vap) 234 endif 235 if (zqs_temp .lt. qvap_deep) then 236 pdqvaplsc(1,k,igcm_generic_vap) = (0.99*zqs_temp - pq(1,k,igcm_generic_vap))/tau - pdq(1,k,igcm_generic_vap) 237 endif 213 214 ! aligning 215 do k=k_cold_trap,nlayer 216 pdqvaplsc(1,k,igcm_generic_vap) = (zqs_temp_2 - pq(1,k,igcm_generic_vap))/tau - pdq(1,k,igcm_generic_vap) 217 pdtlsc(1,k) = 0. 238 218 enddo 239 240 pdqliqlsc(1:ngrid,:,igcm_generic_ice) = 0.241 pdtlsc(1:ngrid,:) = 0.242 219 endif 243 220 244 221 if (qvap_deep >= 0.) then 245 tau = 10. * ptimestep ! tau must not be lower than the physical step time.222 tau = 10. * ptimestep 246 223 ! brings lower generic vapor ratio to a fixed value. 247 224 ! tau is in seconds and must not be lower than the physical step time. 248 225 pdqvaplsc(1:ngrid,1,igcm_generic_vap) = (qvap_deep - pq(1:ngrid,1,igcm_generic_vap))/tau - pdq(1:ngrid,1,igcm_generic_vap) 249 226 endif 227 250 228 if (qvap_top >= 0.) then 251 tau = 10. * ptimestep ! tau must not be lower than the physical step time.229 tau = 10. * ptimestep 252 230 ! brings lower generic vapor ratio to a fixed value. 253 231 ! tau is in seconds and must not be lower than the physical step time. 254 232 pdqvaplsc(1:ngrid,nlayer,igcm_generic_vap) = (qvap_top - pq(1:ngrid,nlayer,igcm_generic_vap))/tau - pdq(1:ngrid,nlayer,igcm_generic_vap) 255 233 endif 234 256 235 endif !if(call_ice_vap_generic) 257 236 enddo ! iq=1,nq
Note: See TracChangeset
for help on using the changeset viewer.