[4590] | 1 | MODULE lmdz_thermcell_ini |
---|
| 2 | |
---|
[4090] | 3 | IMPLICIT NONE |
---|
| 4 | |
---|
| 5 | save |
---|
[4441] | 6 | |
---|
[4090] | 7 | |
---|
[4690] | 8 | integer, protected :: dvdq=1,dqimpl=-1,prt_level=0,lunout |
---|
| 9 | real , protected :: RG,RD,RCPD,RKAPPA,RLVTT,RLvCp,RETV |
---|
| 10 | |
---|
[4090] | 11 | !$OMP THREADPRIVATE(dvdq,dqimpl,prt_level,lunout) |
---|
| 12 | !$OMP THREADPRIVATE(RG,RD,RCPD,RKAPPA,RLVTT,RLvCp) |
---|
[4690] | 13 | |
---|
| 14 | |
---|
| 15 | ! Parameters that can be modified directly by a getin call |
---|
| 16 | real, protected :: r_aspect_thermals=2. ! Aspect ratio for thermal celles |
---|
| 17 | real, protected :: tau_thermals = 0. ! relaxation time constant |
---|
| 18 | real, protected :: fact_thermals_ed_dz = 0.1 ! bouyancy computed with a delta |
---|
| 19 | real, protected :: betalpha=0.9 ! |
---|
| 20 | real, protected :: afact=2./3. ! |
---|
| 21 | real, protected :: fact_shell=1. ! |
---|
| 22 | real, protected :: detr_min=1.e-5 ! |
---|
| 23 | real, protected :: entr_min=1.e-5 ! |
---|
| 24 | real, protected :: detr_q_coef=0.012 ! |
---|
| 25 | real, protected :: detr_q_power=0.5 ! |
---|
| 26 | real, protected :: mix0=0. ! |
---|
| 27 | integer, protected :: iflag_thermals_ed = 0 ! |
---|
| 28 | integer, protected :: iflag_thermals_optflux = 0 ! |
---|
| 29 | integer, protected :: iflag_thermals_closure = 1 ! |
---|
| 30 | integer, protected :: iflag_thermals_down = 0 ! |
---|
[4863] | 31 | real, protected :: fact_thermals_down = 0.5 ! |
---|
[4690] | 32 | integer, protected :: thermals_flag_alim=0 ! |
---|
| 33 | integer, protected :: iflag_thermals_tenv=0 ! |
---|
| 34 | |
---|
| 35 | ! WARNING !!! fact_epsilon is not protected. It can be modified in thermcell_plume* |
---|
| 36 | ! depending on other flags. |
---|
| 37 | |
---|
| 38 | real :: fact_epsilon=0.002 |
---|
| 39 | |
---|
[4090] | 40 | !$OMP THREADPRIVATE(r_aspect_thermals,tau_thermals,fact_thermals_ed_dz) |
---|
| 41 | !$OMP THREADPRIVATE(iflag_thermals_ed,iflag_thermals_optflux,iflag_thermals_closure) |
---|
[4381] | 42 | !$OMP THREADPRIVATE(iflag_thermals_down) |
---|
[4443] | 43 | !$OMP THREADPRIVATE(fact_thermals_down) |
---|
[4090] | 44 | !$OMP THREADPRIVATE(fact_epsilon, betalpha, afact, fact_shell) |
---|
| 45 | !$OMP THREADPRIVATE(detr_min, entr_min, detr_q_coef, detr_q_power) |
---|
| 46 | !$OMP THREADPRIVATE( mix0, thermals_flag_alim) |
---|
[4690] | 47 | !$OMP THREADPRIVATE(iflag_thermals_tenv) |
---|
[4090] | 48 | |
---|
| 49 | |
---|
| 50 | CONTAINS |
---|
| 51 | |
---|
| 52 | SUBROUTINE thermcell_ini(iflag_thermals,prt_level_in,tau_thermals_in,lunout_in, & |
---|
| 53 | & RG_in,RD_in,RCPD_in,RKAPPA_in,RLVTT_in,RETV_in) |
---|
| 54 | |
---|
| 55 | USE ioipsl_getin_p_mod, ONLY : getin_p |
---|
| 56 | |
---|
| 57 | integer, intent(in) :: iflag_thermals,prt_level_in,lunout_in |
---|
| 58 | real, intent(in) :: RG_in,RD_in,RCPD_in,RKAPPA_in,RLVTT_in,RETV_in,tau_thermals_in |
---|
| 59 | |
---|
| 60 | print*,'thermcell_ini' |
---|
| 61 | if (iflag_thermals==15.or.iflag_thermals==16) then |
---|
| 62 | dvdq=0 |
---|
| 63 | dqimpl=-1 |
---|
| 64 | else |
---|
| 65 | dvdq=1 |
---|
| 66 | dqimpl=1 |
---|
| 67 | endif |
---|
| 68 | prt_level=prt_level_in |
---|
| 69 | RG=RG_in |
---|
| 70 | RD=RD_in |
---|
| 71 | RCPD=RCPD_in |
---|
| 72 | RKAPPA=RKAPPA_in |
---|
| 73 | RLVTT=RLVTT_in |
---|
| 74 | RLvCp = RLVTT/RCPD |
---|
| 75 | RETV=RETV_in |
---|
| 76 | tau_thermals=tau_thermals_in |
---|
| 77 | lunout=lunout_in |
---|
| 78 | |
---|
| 79 | |
---|
| 80 | !===================================================================== |
---|
| 81 | ! a la fois les vieilles param et thermcell_main : |
---|
| 82 | !===================================================================== |
---|
| 83 | |
---|
| 84 | CALL getin_p('r_aspect_thermals',r_aspect_thermals) |
---|
| 85 | CALL getin_p('tau_thermals',tau_thermals) |
---|
| 86 | CALL getin_p('fact_thermals_ed_dz',fact_thermals_ed_dz) |
---|
| 87 | CALL getin_p('iflag_thermals_ed',iflag_thermals_ed) |
---|
| 88 | CALL getin_p('iflag_thermals_optflux',iflag_thermals_optflux) |
---|
| 89 | CALL getin_p('iflag_thermals_closure',iflag_thermals_closure) |
---|
[4381] | 90 | CALL getin_p('iflag_thermals_down',iflag_thermals_down) |
---|
[4441] | 91 | CALL getin_p('fact_thermals_down',fact_thermals_down) |
---|
[4690] | 92 | CALL getin_p('thermals_fact_epsilon',fact_epsilon) |
---|
| 93 | CALL getin_p('thermals_betalpha',betalpha) |
---|
| 94 | CALL getin_p('thermals_afact',afact) |
---|
| 95 | CALL getin_p('thermals_fact_shell',fact_shell) |
---|
| 96 | CALL getin_p('thermals_detr_min',detr_min) |
---|
| 97 | CALL getin_p('thermals_entr_min',entr_min) |
---|
| 98 | CALL getin_p('thermals_detr_q_coef',detr_q_coef) |
---|
| 99 | CALL getin_p('thermals_detr_q_power',detr_q_power) |
---|
| 100 | CALL getin_p('thermals_mix0',mix0) |
---|
| 101 | CALL getin_p('thermals_flag_alim',thermals_flag_alim) |
---|
| 102 | CALL getin_p('iflag_thermals_tenv',iflag_thermals_tenv) |
---|
[4381] | 103 | |
---|
[4090] | 104 | |
---|
| 105 | |
---|
[4664] | 106 | write(lunout,*) 'thermcell_ini ,prt_level =', prt_level |
---|
| 107 | write(lunout,*) 'thermcell_ini ,RG =', RG |
---|
| 108 | write(lunout,*) 'thermcell_ini ,RD =', RD |
---|
| 109 | write(lunout,*) 'thermcell_ini ,RCPD =', RCPD |
---|
| 110 | write(lunout,*) 'thermcell_ini ,RKAPPA =', RKAPPA |
---|
| 111 | write(lunout,*) 'thermcell_ini ,RLVTT =', RLVTT |
---|
| 112 | write(lunout,*) 'thermcell_ini ,RLvCp =', RLvCp |
---|
| 113 | write(lunout,*) 'thermcell_ini ,RETV =', RETV |
---|
| 114 | write(lunout,*) 'thermcell_ini ,tau_thermals =', tau_thermals |
---|
| 115 | write(lunout,*) 'thermcell_ini ,lunout =', lunout |
---|
| 116 | write(lunout,*) 'thermcell_ini ,r_aspect_thermals =', r_aspect_thermals |
---|
| 117 | write(lunout,*) 'thermcell_ini ,tau_thermals =', tau_thermals |
---|
| 118 | write(lunout,*) 'thermcell_ini ,fact_thermals_ed_dz =', fact_thermals_ed_dz |
---|
| 119 | write(lunout,*) 'thermcell_ini ,fact_thermals_ed_dz =', fact_thermals_ed_dz |
---|
| 120 | write(lunout,*) 'thermcell_ini ,iflag_thermals_ed =', iflag_thermals_ed |
---|
| 121 | write(lunout,*) 'thermcell_ini ,iflag_thermals_optflux =', iflag_thermals_optflux |
---|
| 122 | write(lunout,*) 'thermcell_ini ,iflag_thermals_closure =', iflag_thermals_closure |
---|
| 123 | write(lunout,*) 'thermcell_ini ,iflag_thermals_down =', iflag_thermals_down |
---|
| 124 | write(lunout,*) 'thermcell_ini ,fact_thermals_down =', fact_thermals_down |
---|
| 125 | write(lunout,*) 'thermcell_ini ,fact_epsilon =', fact_epsilon |
---|
| 126 | write(lunout,*) 'thermcell_ini ,betalpha =', betalpha |
---|
| 127 | write(lunout,*) 'thermcell_ini ,afact =', afact |
---|
| 128 | write(lunout,*) 'thermcell_ini ,fact_shell =', fact_shell |
---|
| 129 | write(lunout,*) 'thermcell_ini ,detr_min =', detr_min |
---|
| 130 | write(lunout,*) 'thermcell_ini ,entr_min =', entr_min |
---|
| 131 | write(lunout,*) 'thermcell_ini ,detr_q_coef =', detr_q_coef |
---|
| 132 | write(lunout,*) 'thermcell_ini ,detr_q_power =', detr_q_power |
---|
| 133 | write(lunout,*) 'thermcell_ini ,mix0 =', mix0 |
---|
| 134 | write(lunout,*) 'thermcell_ini ,thermals_flag_alim =', thermals_flag_alim |
---|
[4690] | 135 | write(lunout,*) 'thermcell_ini ,iflag_thermals_tenv =', iflag_thermals_tenv |
---|
[4664] | 136 | |
---|
[4094] | 137 | RETURN |
---|
[4090] | 138 | |
---|
| 139 | END SUBROUTINE thermcell_ini |
---|
[4590] | 140 | END MODULE lmdz_thermcell_ini |
---|