source: LMDZ6/trunk/libf/phylmd/Ocean_skin/config_ocean_skin_m.F90 @ 4013

Last change on this file since 4013 was 3834, checked in by Laurent Fairhead, 4 years ago

Renaming module files so that makelmdz and create_make_gcm finds them

File size: 2.3 KB
Line 
1module config_ocean_skin_m
2
3  implicit none
4
5  logical, protected:: jcool ! cool skin calculation
6  logical, protected:: jwarm ! warm layer calculation
7  logical, protected:: rain_effect
8
9  real, protected:: depth_1 = 20.
10  ! Depth at which the temperature and salinity are input. Could be
11  ! the depth of a sensor, or the depth at the middle of the first
12  ! layer of an ocean model (half the depth of the first layer). In
13  ! m. Setting depth_1 to any value >= depth has the same effect as
14  ! setting depth_1 to depth.
15
16  !$omp threadprivate(jcool, jwarm, rain_effect, depth_1)
17
18#ifdef IN_LMDZ
19  integer, protected:: activate_ocean_skin = 0
20  ! Allowed values: 0 do not activate; 1 activate without retroaction
21  ! on LMDZ; 2 activate with retroaction on LMDZ
22 
23  !$omp threadprivate(activate_ocean_skin)
24#endif
25
26contains
27
28  subroutine config_ocean_skin
29
30#ifdef IN_LMDZ
31    use ioipsl_getin_p_mod, only: getin_p
32    use assert_m, only: assert
33#endif
34
35    integer:: flag_ocean_skin = 3
36    !$omp threadprivate(flag_ocean_skin)
37   
38    namelist /config_ocean_skin_nml/ flag_ocean_skin, depth_1
39
40    !-----------------------------------------------------------------------
41
42#ifdef IN_LMDZ
43    call getin_p("activate_ocean_skin", activate_ocean_skin)
44    call assert(activate_ocean_skin >= 0 .and. activate_ocean_skin <= 2, &
45         "config_ocean_skin bad value of activate_ocean_skin")
46    if (activate_ocean_skin >= 1) then
47       call getin_p("flag_ocean_skin", flag_ocean_skin)
48       call getin_p("depth_1", depth_1)
49    end if
50#else
51    write(unit = *, nml = config_ocean_skin_nml)
52    print *, "Enter namelist config_ocean_skin_nml."
53    read(unit = *, nml = config_ocean_skin_nml)
54    write(unit = *, nml = config_ocean_skin_nml)
55#endif
56
57    select case (flag_ocean_skin)
58    case (0)
59       jwarm = .false.
60       jcool = .false.
61       rain_effect = .false.
62    case (1)
63       jwarm = .false.
64       jcool = .true.
65       rain_effect = .false.
66    case (2)
67       jwarm = .true.
68       jcool = .true.
69       rain_effect = .false.
70    case (3)
71       jwarm = .true.
72       jcool = .true.
73       rain_effect = .true.
74    case default
75       print *, "config_ocean_skin: bad value for flag_ocean_skin."
76       stop 1
77    end select
78
79  end subroutine config_ocean_skin
80
81end module config_ocean_skin_m
Note: See TracBrowser for help on using the repository browser.