Changeset 2720 for trunk/LMDZ.GENERIC
- Timestamp:
- Jun 21, 2022, 11:05:44 AM (3 years ago)
- Location:
- trunk/LMDZ.GENERIC/libf/phystd
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/condensation_generic_mod.F90
r2717 r2720 10 10 USE tracer_h 11 11 USE mod_phys_lmdz_para, only: is_master 12 use generic_tracer_index_mod, only: generic_tracer_index 12 13 IMPLICIT none 13 14 … … 45 46 ! Options : 46 47 real, save :: metallicity !metallicity of planet 47 !$OMP THREADPRIVATE(metallicity) 48 REAL, SAVE :: qvap_deep ! deep mixing ratio of water vapor when simulating bottom less planets 49 !$OMP THREADPRIVATE(metallicity, qvap_deep) 48 50 49 51 ! Local variables 52 53 ! to call only one time the ice/vap pair of a tracer 54 logical one_call_ice_vap_generic 55 50 56 INTEGER i, k , nn, iq 51 57 INTEGER,PARAMETER :: nitermax=5000 58 INTEGER,PARAMETER :: tau=14400. 52 59 DOUBLE PRECISION,PARAMETER :: alpha=.1,qthreshold=1.d-8 53 60 ! JL13: if "careful, T<Tmin in psat water" appears often, you may want to stabilise the model by … … 72 79 call getin_p("metallicity",metallicity) 73 80 write(*,*) " metallicity = ",metallicity 81 82 write(*,*) "Deep water vapor mixing ratio ? (no effect if negative) " 83 qvap_deep=-1. ! default value 84 call getin_p("qvap_deep",qvap_deep) 85 write(*,*) " qvap_deep = ",qvap_deep 86 74 87 firstcall = .false. 75 88 ENDIF … … 84 97 ! Let's loop on tracers 85 98 do iq=1,nq 86 if((is_condensable(iq)==1) .and. (index(noms(iq),"vap") .ne. 0)) then 87 if (is_master) then 88 write(*,*) "There is a specie which is condensable, for generic condensation : ", noms(iq) 89 endif 90 ! Let's get the index of our tracers (we look for igcm _generic_vap and igcm_generic_ice) 91 igcm_generic_vap=iq 92 igcm_generic_ice = -1 99 one_call_ice_vap_generic = .false. 93 100 94 ! We look for the corresponding ice traceur (before or after in the list of traceurs, maybe could be generalised to the whole list) 95 if (iq .ne. nq) then 96 if ((noms(iq)(1:len(trim(noms(iq)))-4) .eq. noms(iq+1)(1:len(trim(noms(iq+1)))-4)) .and. (index(noms(iq+1),"ice") .ne. 0)) then 97 igcm_generic_ice = iq+1 98 end if 99 end if 100 if ((iq .gt. 1)) then 101 if ((noms(iq)(1:len(trim(noms(iq)))-4) .eq. noms(iq-1)(1:len(trim(noms(iq-1)))-4)) .and. (index(noms(iq-1),"ice") .ne. 0)) then 102 igcm_generic_ice = iq-1 103 end if 104 end if 105 if (igcm_generic_ice .eq. -1) then 106 write(*,*) "ERROR : You set a vap traceur but you forgot to set the corresponding ice traceur, & 107 or the pair vap/ice is not written one after another in traceur.def" 108 endif 101 call generic_tracer_index(nq,iq,igcm_generic_vap,igcm_generic_ice,one_call_ice_vap_generic) 109 102 103 if(one_call_ice_vap_generic) then ! to call only one time the ice/vap pair of a tracer 110 104 m=constants_mass(iq) 111 105 delta_vapH=constants_delta_vapH(iq) … … 154 148 155 149 Enddo ! k= nlayer, 1, -1 156 endif !(is_condensable(iq)==1) .and. (index(noms(iq),"vap") .ne. 0)) 150 151 if (qvap_deep >= 0.) then 152 !brings lower generic vapor ratio to a fixed value. 153 ! tau=3600. seems too fast 154 pdqvaplsc(1:ngrid,1,igcm_generic_vap) = (qvap_deep - pq(1:ngrid,1,igcm_generic_vap))/tau - pdq(1:ngrid,1,igcm_generic_vap) 155 endif 156 endif !if(one_call_ice_vap_generic) 157 157 enddo ! iq=1,nq 158 158
Note: See TracChangeset
for help on using the changeset viewer.