source: LMDZ5/branches/AI-cosp/libf/dynphy_lonlat/phylmd/test_disvert_m.F90 @ 3906

Last change on this file since 3906 was 2345, checked in by Ehouarn Millour, 9 years ago

Physics/dynamics separation:

  • move test_disvert_m to dynlonlat_phylonlat/phylmd since it is only used by ce0l and relies on dynamics.
  • put "config_inca" in tracinca_mod so physics routines can get the info from there rather than from control_mod.
  • get rid of references to "control_mod" from within the physics.

EM

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory

File size: 2.1 KB
Line 
1module test_disvert_m
2
3  implicit none
4
5contains
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
641000 format (3(a, g10.4, a, i0))
65
66  end subroutine test_disvert
67
68end module test_disvert_m
Note: See TracBrowser for help on using the repository browser.