--- trunk/libf/dyn3d/comvert.f90 2011/10/07 13:11:58 53 +++ trunk/dyn3d/disvert.f90 2013/11/15 18:45:49 76 @@ -1,4 +1,4 @@ -module comvert +module disvert_m use dimens_m, only: llm @@ -19,15 +19,17 @@ SUBROUTINE disvert ! From dyn3d/disvert.F, v 1.1.1.1 2004/05/19 12:53:05 - ! Auteur : P. Le Van + ! Author: P. Le Van - ! This procedure sets the vertical grid. - ! It defines the host variables "ap", "bp", "presnivs", "nivsigs" - ! and "nivsig". - ! "pa" should be defined before this procedure is called. + ! This procedure sets the vertical grid. It defines the host + ! variables "ap", "bp", "presnivs", "nivsigs" and "nivsig". "pa" + ! should be defined before this procedure is called. - use nr_util, only: pi use jumble, only: new_unit + use nr_util, only: pi + use unit_nml_m, only: unit_nml + + ! Local: REAL s(llm+1) ! "s(l)" is the atmospheric hybrid sigma-pressure coordinate at @@ -39,8 +41,8 @@ INTEGER l, unit REAL alpha, x(llm) - character(len=7):: s_sampling = "LMD5" - ! (other allowed values are "param", "strato1", "strato2" and "read") + character(len=7):: s_sampling = "tropo" + ! (other allowed values are "param", "strato1", "strato" and "read") real:: h = 7. ! scale height, in km ! (used only if "s_sampling" == "param" or "strato1") @@ -66,7 +68,7 @@ print *, "Enter namelist 'disvert_nml'." read(unit=*, nml=disvert_nml) - write(unit=*, nml=disvert_nml) + write(unit_nml, nml=disvert_nml) select case (s_sampling) case ("param") @@ -77,12 +79,11 @@ = cosh((l - 1) / k0) **(- alpha * k0 / h) & * exp(- alpha / h * tanh((llm - k1) / k0) & * beta **(l - 1 - (llm - k1)) / log(beta)) - case ("LMD5") - ! Ancienne discrétisation + case ("tropo") s(1) = 1. s(llm+1) = 0. forall (l = 1: llm) ds(l) & - = 1. + 7. * SIN(pi * (REAL(l)-0.5) / real(llm+1))**2 + = 1. + 7. * SIN(pi * (REAL(l) - 0.5) / real(llm + 1))**2 ds = ds / sum(ds) DO l = llm, 2, -1 @@ -102,13 +103,13 @@ s(2:llm) = (exp(- zz(2:llm) / h) - exp(- zz(llm + 1) / h)) & / (1. - exp(- zz(llm + 1) / h)) - case ("strato2") + case ("strato") ! Recommended by F. Lott for a domain including the stratosphere s(1) = 1. s(llm+1) = 0. forall (l = 1: llm) x(l) = pi * (l - 0.5) / (llm + 1) - ds = (1. + 7. * SIN(x)**2) * (1. - tanh(2 * x / pi - 1.))**2 / 4. + ds = (0.3 + 7. * SIN(x)**2) * (1. - tanh(2 * x / pi - 1.))**2 / 4. ds = ds / sum(ds) DO l = llm, 2, -1 @@ -143,4 +144,4 @@ END SUBROUTINE disvert -end module comvert +end module disvert_m