LMDZ
test_disvert_m.F90
Go to the documentation of this file.
2 
3  implicit none
4 
5 contains
6 
7  subroutine test_disvert
8 
9  ! Author: Lionel GUEZ
10 
11  ! This procedure tests the order of pressure values at half-levels
12  ! and full levels. We arbitrarily choose to test ngrid values of
13  ! the surface pressure, which sample possible values on Earth.
14 
15  use exner_hyb_m, only: exner_hyb
16  use vertical_layers_mod, only: ap,bp,preff
17 
18  ! For llm:
19  include "dimensions.h"
20 
21  ! For kappa, cpp:
22  include "comconst.h"
23 
24  ! Local:
25  integer l, i
26  integer, parameter:: ngrid = 7
27  real p(ngrid, llm + 1) ! pressure at half-level, in Pa
28  real pks(ngrid) ! exner function at the surface, in J K-1 kg-1
29  real pk(ngrid, llm) ! exner function at full level, in J K-1 kg-1
30  real ps(ngrid) ! surface pressure, in Pa
31  real p_lay(ngrid, llm) ! pressure at full level, in Pa
32  real delta_ps ! in Pa
33 
34  !---------------------
35 
36  print *, "Call sequence information: test_disvert"
37 
38  delta_ps = 6e4 / (ngrid - 1)
39  ps = (/(5e4 + delta_ps * i, i = 0, ngrid - 1)/)
40  forall (l = 1: llm + 1) p(:, l) = ap(l) + bp(l) * ps
41  call exner_hyb(ngrid, ps, p, pks, pk)
42  p_lay = preff * (pk / cpp)**(1. / kappa)
43 
44  ! Are pressure values in the right order?
45  if (any(p(:, :llm) <= p_lay .or. p_lay <= p(:, 2:))) then
46  ! List details and stop:
47  do l = 1, llm
48  do i = 1, ngrid
49  if (p(i, l) <= p_lay(i, l)) then
50  print 1000, "ps = ", ps(i) / 100., "hPa, p(level ", l, &
51  ") = ", p(i, l) / 100., " hPa <= p(layer ", l, ") = ", &
52  p_lay(i, l) / 100., " hPa"
53  end if
54  if (p_lay(i, l) <= p(i, l + 1)) then
55  print 1000, "ps = ", ps(i) / 100., "hPa, p(layer ", l, ") = ", &
56  p_lay(i, l) / 100., " hPa <= p(level ", l + 1, ") = ", &
57  p(i, l + 1) / 100., " hPa"
58  end if
59  end do
60  end do
61  call abort_physic("test_disvert", "bad order of pressure values", 1)
62  end if
63 
64 1000 format (3(a, g10.4, a, i0))
65 
66  end subroutine test_disvert
67 
68 end module test_disvert_m
!$Id preff
Definition: comvert.h:8
!$Id mode_top_bound COMMON comconstr kappa
Definition: comconst.h:7
subroutine exner_hyb(ngrid, ps, p, pks, pk, pkf)
Definition: exner_hyb_m.F90:8
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice tg_prof vg_profd w_profd omega_profd!do llm!print llm l llm
!$Id mode_top_bound COMMON comconstr cpp
Definition: comconst.h:7
real, dimension(:), allocatable, save ap
subroutine test_disvert
subroutine abort_physic(modname, message, ierr)
Definition: abort_physic.F90:3
real, dimension(:), allocatable, save bp