source: trunk/WRF.COMMON/WRFV2/share/mediation_interp_domain.F @ 3547

Last change on this file since 3547 was 11, checked in by aslmd, 14 years ago

spiga@svn-planeto:ajoute le modele meso-echelle martien

File size: 8.7 KB
Line 
1!
2!WRF:MEDIATION_LAYER:NESTING
3!
4SUBROUTINE med_interp_domain ( parent_grid , nested_grid )
5   USE module_domain
6   USE module_configure
7   USE module_timing
8   IMPLICIT NONE
9   TYPE(domain), POINTER :: parent_grid , nested_grid
10   TYPE(domain), POINTER :: grid
11   INTEGER nlev, msize
12   TYPE (grid_config_rec_type)            :: config_flags
13!  see http://www.mmm.ucar.edu/wrf/WG2/topics/deref_kludge.htm
14   INTEGER     :: sm31 , em31 , sm32 , em32 , sm33 , em33
15   INTEGER     :: sm31x, em31x, sm32x, em32x, sm33x, em33x
16   INTEGER     :: sm31y, em31y, sm32y, em32y, sm33y, em33y
17
18! ----------------------------------------------------------
19! ----------------------------------------------------------
20! Interface blocks
21! ----------------------------------------------------------
22   INTERFACE
23! ----------------------------------------------------------
24!    Interface definitions for EM CORE
25! ----------------------------------------------------------
26#if (EM_CORE == 1)
27! ----------------------------------------------------------
28!    These routines are supplied by module_dm.F from the
29!    external communication package (e.g. external/RSL)
30! ----------------------------------------------------------
31      SUBROUTINE interp_domain_em_part1 ( grid, intermediate_grid, ngrid, config_flags   &
32!
33#        include "em_dummy_new_args.inc"
34!
35                 )
36         USE module_domain
37         USE module_configure
38         TYPE(domain), POINTER :: grid          ! name of the grid being dereferenced (must be "grid")
39         TYPE(domain), POINTER :: intermediate_grid
40         TYPE(domain), POINTER :: ngrid
41         TYPE (grid_config_rec_type)            :: config_flags
42#        include <em_dummy_new_decl.inc>
43      END SUBROUTINE interp_domain_em_part1
44
45      SUBROUTINE interp_domain_em_part2 ( grid, nested_grid, config_flags   &
46!
47#        include "em_dummy_new_args.inc"
48!
49                 )
50         USE module_domain
51         USE module_configure
52         TYPE(domain), POINTER :: grid          ! name of the grid being dereferenced (must be "grid")
53         TYPE(domain), POINTER :: nested_grid
54         TYPE (grid_config_rec_type)            :: config_flags
55#        include <em_dummy_new_decl.inc>
56      END SUBROUTINE interp_domain_em_part2
57#endif
58! ----------------------------------------------------------
59!    Interface definitions for NMM (placeholder)
60! ----------------------------------------------------------
61#if (NMM_CORE == 1 && NMM_NEST == 1)
62!=======================================================================
63!  Added for the NMM core. This is gopal's doing.
64!=======================================================================
65
66      SUBROUTINE interp_domain_nmm_part1 ( grid, intermediate_grid, ngrid, config_flags    &
67!
68# include "nmm_dummy_args.inc"
69!
70                 )
71         USE module_domain
72         USE module_configure
73         TYPE(domain), POINTER :: grid          ! name of the grid being dereferenced (must be "grid")
74         TYPE(domain), POINTER :: intermediate_grid
75         TYPE(domain), POINTER :: ngrid
76         TYPE (grid_config_rec_type)            :: config_flags
77# include <nmm_dummy_decl.inc>
78      END SUBROUTINE interp_domain_nmm_part1
79
80      SUBROUTINE interp_domain_nmm_part2 ( grid, nested_grid, config_flags    &
81!
82# include "nmm_dummy_args.inc"
83!
84                 )
85         USE module_domain
86         USE module_configure
87         TYPE(domain), POINTER :: grid          ! name of the grid being dereferenced (must be "grid")
88         TYPE(domain), POINTER :: nested_grid
89         TYPE (grid_config_rec_type)            :: config_flags
90# include <nmm_dummy_decl.inc>
91      END SUBROUTINE interp_domain_nmm_part2
92
93!=======================================================================
94!  End of gopal's doing.
95!=======================================================================
96#endif
97! ----------------------------------------------------------
98!    Interface definitions for COAMPS (placeholder)
99! ----------------------------------------------------------
100#if (COAMPS_CORE == 1)
101#endif
102   END INTERFACE
103! ----------------------------------------------------------
104! End of Interface blocks
105! ----------------------------------------------------------
106! ----------------------------------------------------------
107! ----------------------------------------------------------
108! Executable code
109! ----------------------------------------------------------
110! ----------------------------------------------------------
111!    Interpolation calls for EM CORE.  The called
112!    routines below are supplied by module_dm.F
113!    from the external communications package (e.g. RSL)
114! ----------------------------------------------------------
115#if (EM_CORE == 1 && defined( DM_PARALLEL ))
116  CALL model_to_grid_config_rec ( nested_grid%id , model_config_rec , config_flags )
117  IF ( config_flags%dyn_opt == DYN_EM ) THEN
118
119    grid => nested_grid%intermediate_grid
120    CALL alloc_space_field ( grid, grid%id , 1 , 2 , .TRUE. ,   &
121                             grid%sd31, grid%ed31, grid%sd32, grid%ed32, grid%sd33, grid%ed33, &
122                             grid%sm31,  grid%em31,  grid%sm32,  grid%em32,  grid%sm33,  grid%em33, &
123                             grid%sm31x, grid%em31x, grid%sm32x, grid%em32x, grid%sm33x, grid%em33x, &   ! x-xpose
124                             grid%sm31y, grid%em31y, grid%sm32y, grid%em32y, grid%sm33y, grid%em33y  &   ! y-xpose
125      )
126
127    grid => parent_grid
128
129    CALL model_to_grid_config_rec ( grid%id , model_config_rec , config_flags )
130    CALL interp_domain_em_part1 ( grid , nested_grid%intermediate_grid, nested_grid, config_flags   &
131!
132#     include "em_actual_new_args.inc"
133!
134                                )
135    grid => nested_grid%intermediate_grid
136    CALL model_to_grid_config_rec ( grid%id , model_config_rec , config_flags )
137    CALL interp_domain_em_part2 ( grid, nested_grid, config_flags   &
138!
139#     include "em_actual_new_args.inc"
140!
141                                )
142
143    grid => nested_grid%intermediate_grid
144    CALL model_to_grid_config_rec ( grid%id , model_config_rec , config_flags )
145    CALL dealloc_space_field ( grid )
146
147  ENDIF
148#endif
149! ------------------------------------------------------
150!    End of Interpolation calls for EM CORE.
151! ------------------------------------------------------
152! ------------------------------------------------------
153! ------------------------------------------------------
154!    Interpolation calls for NMM. (Placeholder)
155! ------------------------------------------------------
156#if (NMM_CORE == 1 && NMM_NEST == 1)
157!=======================================================================
158!  Added for the NMM core. This is gopal's doing.
159!=======================================================================
160!
161  CALL model_to_grid_config_rec ( nested_grid%id , model_config_rec , config_flags )
162  IF ( config_flags%dyn_opt == DYN_NMM) THEN
163
164    grid => nested_grid%intermediate_grid
165!    CALL alloc_space_field ( grid, grid%id , 1 , 2 , .TRUE. ,   &
166    CALL alloc_space_field ( grid, grid%id , 1 , 3 , .FALSE. ,   &
167                             grid%sd31, grid%ed31, grid%sd32, grid%ed32, grid%sd33, grid%ed33, &
168                             grid%sm31,  grid%em31,  grid%sm32,  grid%em32,  grid%sm33,  grid%em33, &
169                             grid%sm31x, grid%em31x, grid%sm32x, grid%em32x, grid%sm33x, grid%em33x, &   ! x-xpose
170                             grid%sm31y, grid%em31y, grid%sm32y, grid%em32y, grid%sm33y, grid%em33y  &   ! y-xpose
171      )
172
173    grid => parent_grid
174
175#   include "deref_kludge.h"
176
177
178    CALL model_to_grid_config_rec ( grid%id , model_config_rec , config_flags )
179
180    CALL interp_domain_nmm_part1 ( grid , nested_grid%intermediate_grid, nested_grid, config_flags    &
181!
182#     include "nmm_actual_args.inc"
183!
184                                )
185    grid => nested_grid%intermediate_grid
186    CALL model_to_grid_config_rec ( grid%id , model_config_rec , config_flags )
187#   include "deref_kludge.h"
188
189    CALL interp_domain_nmm_part2 ( grid, nested_grid, config_flags    &
190!
191#     include "nmm_actual_args.inc"
192!
193                                )
194  ENDIF
195! ------------------------------------------------------------
196!    End of gopal's doing
197! ------------------------------------------------------------
198#endif
199! ------------------------------------------------------
200!    End of Interpolation calls for NMM.
201! ------------------------------------------------------
202! ------------------------------------------------------
203! ------------------------------------------------------
204!    Interpolation calls for COAMPS. (Placeholder)
205! ------------------------------------------------------
206#if (COAMPS_CORE == 1)
207#endif
208! ------------------------------------------------------
209!    End of Interpolation calls for COAMPS.
210! ------------------------------------------------------
211   RETURN
212END SUBROUTINE med_interp_domain
213
214
Note: See TracBrowser for help on using the repository browser.