source: LMDZ6/branches/LMDZ_cdrag_LSCE/libf/phylmd/ecrad/yomhook.F90.or @ 5428

Last change on this file since 5428 was 3908, checked in by idelkadi, 4 years ago

Online implementation of the radiative transfer code ECRAD in the LMDZ model.

  • Inclusion of the ecrad directory containing the sources of the ECRAD code
    • interface routine : radiation_scheme.F90
  • Adaptation of compilation scripts :
    • compilation under CPP key CPP_ECRAD
    • compilation with option "-rad ecard" or "-ecard true"
    • The "-rad old/rtm/ecran" build option will need to replace the "-rrtm true" and "-ecrad true" options in the future.
  • Runing LMDZ simulations with ecrad, you need :
    • logical key iflag_rrtm = 2 in physiq.def
    • namelist_ecrad (DefLists?)
    • the directory "data" containing the configuration files is temporarily placed in ../libfphylmd/ecrad/
  • Compilation and execution are tested in the 1D case. The repository under svn would allow to continue the implementation work: tests, verification of the results, ...
File size: 3.8 KB
Line 
1! (C) Copyright 2014- ECMWF.
2!
3! This software is licensed under the terms of the Apache Licence Version 2.0
4! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5!
6! In applying this licence, ECMWF does not waive the privileges and immunities
7! granted to it by virtue of its status as an intergovernmental organisation
8! nor does it submit to any jurisdiction.
9
10MODULE YOMHOOK
11
12USE PARKIND1  ,ONLY : JPIM, JPRB, JPRM, JPRD
13
14IMPLICIT NONE
15
16! Used by "hook" function
17! LHOOK = true implies "hook" function will be called
18! Altough initialized to TRUE it will be reset by first call to
19! DR_HOOK unless we really want to use the hook function
20
21SAVE
22PUBLIC
23
24LOGICAL :: LHOOK=.TRUE.
25
26#include "dr_hook_util.h"
27#include "dr_hook_util_multi.h"
28
29INTERFACE DR_HOOK 
30
31MODULE PROCEDURE &
32  DR_HOOK_DEFAULT4, &
33  DR_HOOK_DEFAULT8, &
34  DR_HOOK_FILE, &
35  DR_HOOK_SIZE, &
36  DR_HOOK_FILE_SIZE, &
37  DR_HOOK_MULTI_DEFAULT, &
38  DR_HOOK_MULTI_FILE, &
39  DR_HOOK_MULTI_SIZE, &
40  DR_HOOK_MULTI_FILE_SIZE
41END INTERFACE
42
43CONTAINS
44
45SUBROUTINE DR_HOOK_DEFAULT4(CDNAME,KSWITCH,PKEY)
46CHARACTER(LEN=*), INTENT(IN) :: CDNAME
47INTEGER(KIND=JPIM),        INTENT(IN) :: KSWITCH
48REAL(KIND=JPRM),        INTENT(INOUT) :: PKEY
49REAL(KIND=JPRB) :: ZKEY
50ZKEY = TRANSFER(PKEY,ZKEY)
51CALL DR_HOOK_UTIL(LHOOK,CDNAME,KSWITCH,ZKEY,'',0_JPIM)
52PKEY = TRANSFER(ZKEY,PKEY)
53END SUBROUTINE DR_HOOK_DEFAULT4
54
55SUBROUTINE DR_HOOK_DEFAULT8(CDNAME,KSWITCH,PKEY)
56CHARACTER(LEN=*), INTENT(IN) :: CDNAME
57INTEGER(KIND=JPIM),        INTENT(IN) :: KSWITCH
58REAL(KIND=JPRD),        INTENT(INOUT) :: PKEY
59REAL(KIND=JPRB) :: ZKEY
60ZKEY = TRANSFER(PKEY,ZKEY)
61CALL DR_HOOK_UTIL(LHOOK,CDNAME,KSWITCH,ZKEY,'',0_JPIM)
62PKEY = TRANSFER(ZKEY,PKEY)
63END SUBROUTINE DR_HOOK_DEFAULT8
64
65SUBROUTINE DR_HOOK_MULTI_DEFAULT(CDNAME,KSWITCH,PKEY)
66CHARACTER(LEN=*), INTENT(IN) :: CDNAME
67INTEGER(KIND=JPIM),        INTENT(IN) :: KSWITCH
68REAL(KIND=JPRB),        INTENT(INOUT) :: PKEY(:)
69CALL DR_HOOK_UTIL_MULTI(LHOOK,CDNAME,KSWITCH,PKEY,INT(SIZE(PKEY)),'',0_JPIM)
70END SUBROUTINE DR_HOOK_MULTI_DEFAULT
71
72SUBROUTINE DR_HOOK_FILE(CDNAME,KSWITCH,PKEY,CDFILE)
73CHARACTER(LEN=*), INTENT(IN) :: CDNAME,CDFILE
74INTEGER(KIND=JPIM),        INTENT(IN) :: KSWITCH
75REAL(KIND=JPRB),        INTENT(INOUT) :: PKEY
76CALL DR_HOOK_UTIL(LHOOK,CDNAME,KSWITCH,PKEY,CDFILE,0_JPIM)
77END SUBROUTINE DR_HOOK_FILE
78
79SUBROUTINE DR_HOOK_MULTI_FILE(CDNAME,KSWITCH,PKEY,CDFILE)
80CHARACTER(LEN=*), INTENT(IN) :: CDNAME,CDFILE
81INTEGER(KIND=JPIM),        INTENT(IN) :: KSWITCH
82REAL(KIND=JPRB),        INTENT(INOUT) :: PKEY(:)
83CALL DR_HOOK_UTIL_MULTI(LHOOK,CDNAME,KSWITCH,PKEY,INT(SIZE(PKEY)),CDFILE,0_JPIM)
84END SUBROUTINE DR_HOOK_MULTI_FILE
85
86SUBROUTINE DR_HOOK_SIZE(CDNAME,KSWITCH,PKEY,KSIZEINFO)
87CHARACTER(LEN=*), INTENT(IN) :: CDNAME
88INTEGER(KIND=JPIM),        INTENT(IN) :: KSWITCH,KSIZEINFO
89REAL(KIND=JPRB),        INTENT(INOUT) :: PKEY
90CALL DR_HOOK_UTIL(LHOOK,CDNAME,KSWITCH,PKEY,'',KSIZEINFO)
91END SUBROUTINE DR_HOOK_SIZE
92
93SUBROUTINE DR_HOOK_MULTI_SIZE(CDNAME,KSWITCH,PKEY,KSIZEINFO)
94CHARACTER(LEN=*), INTENT(IN) :: CDNAME
95INTEGER(KIND=JPIM),        INTENT(IN) :: KSWITCH,KSIZEINFO
96REAL(KIND=JPRB),        INTENT(INOUT) :: PKEY(:)
97CALL DR_HOOK_UTIL_MULTI(LHOOK,CDNAME,KSWITCH,PKEY,INT(SIZE(PKEY)),'',KSIZEINFO)
98END SUBROUTINE DR_HOOK_MULTI_SIZE
99
100SUBROUTINE DR_HOOK_FILE_SIZE(CDNAME,KSWITCH,PKEY,CDFILE,KSIZEINFO)
101CHARACTER(LEN=*), INTENT(IN) :: CDNAME,CDFILE
102INTEGER(KIND=JPIM),        INTENT(IN) :: KSWITCH,KSIZEINFO
103REAL(KIND=JPRB),        INTENT(INOUT) :: PKEY
104CALL DR_HOOK_UTIL(LHOOK,CDNAME,KSWITCH,PKEY,CDFILE,KSIZEINFO)
105END SUBROUTINE DR_HOOK_FILE_SIZE
106
107SUBROUTINE DR_HOOK_MULTI_FILE_SIZE(CDNAME,KSWITCH,PKEY,CDFILE,KSIZEINFO)
108CHARACTER(LEN=*), INTENT(IN) :: CDNAME,CDFILE
109INTEGER(KIND=JPIM),        INTENT(IN) :: KSWITCH,KSIZEINFO
110REAL(KIND=JPRB),        INTENT(INOUT) :: PKEY(:)
111CALL DR_HOOK_UTIL_MULTI(LHOOK,CDNAME,KSWITCH,PKEY,INT(SIZE(PKEY)),CDFILE,KSIZEINFO)
112END SUBROUTINE DR_HOOK_MULTI_FILE_SIZE
113
114END MODULE YOMHOOK
Note: See TracBrowser for help on using the repository browser.