1 !IDEAL:MODEL_LAYER:INITIALIZATION
4 ! This MODULE holds the routines which are used to perform various initializations
5 ! for the individual domains.
7 ! This MODULE CONTAINS the following routines:
9 ! initialize_field_test - 1. Set different fields to different constant
10 ! values. This is only a test. If the correct
11 ! domain is not found (based upon the "id")
12 ! then a fatal error is issued.
14 MODULE module_initialize
17 USE module_state_description
18 USE module_model_constants
25 SUBROUTINE init_domain_exp ( grid &
27 # include <exp_dummy_args.inc>
33 TYPE (domain), POINTER :: grid
35 # include <exp_dummy_decl.inc>
37 TYPE (grid_config_rec_type) :: config_flags
41 ids, ide, jds, jde, kds, kde, &
42 ims, ime, jms, jme, kms, kme, &
43 its, ite, jts, jte, kts, kte, &
47 #include <exp_scalar_derefs.inc>
49 SELECT CASE ( model_data_order )
50 CASE ( DATA_ORDER_ZXY )
51 kds = grid%sd31 ; kde = grid%ed31 ;
52 ids = grid%sd32 ; ide = grid%ed32 ;
53 jds = grid%sd33 ; jde = grid%ed33 ;
55 kms = grid%sm31 ; kme = grid%em31 ;
56 ims = grid%sm32 ; ime = grid%em32 ;
57 jms = grid%sm33 ; jme = grid%em33 ;
59 kts = grid%sp31 ; kte = grid%ep31 ; ! note that tile is entire patch
60 its = grid%sp32 ; ite = grid%ep32 ; ! note that tile is entire patch
61 jts = grid%sp33 ; jte = grid%ep33 ; ! note that tile is entire patch
62 CASE ( DATA_ORDER_XYZ )
63 ids = grid%sd31 ; ide = grid%ed31 ;
64 jds = grid%sd32 ; jde = grid%ed32 ;
65 kds = grid%sd33 ; kde = grid%ed33 ;
67 ims = grid%sm31 ; ime = grid%em31 ;
68 jms = grid%sm32 ; jme = grid%em32 ;
69 kms = grid%sm33 ; kme = grid%em33 ;
71 its = grid%sp31 ; ite = grid%ep31 ; ! note that tile is entire patch
72 jts = grid%sp32 ; jte = grid%ep32 ; ! note that tile is entire patch
73 kts = grid%sp33 ; kte = grid%ep33 ; ! note that tile is entire patch
74 CASE ( DATA_ORDER_XZY )
75 ids = grid%sd31 ; ide = grid%ed31 ;
76 kds = grid%sd32 ; kde = grid%ed32 ;
77 jds = grid%sd33 ; jde = grid%ed33 ;
79 ims = grid%sm31 ; ime = grid%em31 ;
80 kms = grid%sm32 ; kme = grid%em32 ;
81 jms = grid%sm33 ; jme = grid%em33 ;
83 its = grid%sp31 ; ite = grid%ep31 ; ! note that tile is entire patch
84 kts = grid%sp32 ; kte = grid%ep32 ; ! note that tile is entire patch
85 jts = grid%sp33 ; jte = grid%ep33 ; ! note that tile is entire patch
90 CALL model_to_grid_config_rec ( grid%id , model_config_rec , config_flags )
92 ! set the boundaries of the X array
96 IF ( i == ids .OR. i == ide-1 .OR. j == jds .OR. j == jde-1 ) THEN
108 #include <exp_scalar_derefs.inc>
112 END SUBROUTINE init_domain_exp
114 !-------------------------------------------------------------------
115 ! this is a wrapper for the solver-specific init_domain routines.
116 ! Also dereferences the grid variables and passes them down as arguments.
117 ! This is crucial, since the lower level routines may do message passing
118 ! and this will get fouled up on machines that insist on passing down
119 ! copies of assumed-shape arrays (by passing down as arguments, the
120 ! data are treated as assumed-size -- ie. f77 -- arrays and the copying
121 ! business is avoided). Fie on the F90 designers. Fie and a pox.
123 SUBROUTINE init_domain ( grid )
128 TYPE (domain), POINTER :: grid
130 INTEGER :: idum1, idum2
133 ! see http://www.mmm.ucar.edu/wrf/WG2/topics/deref_kludge.htm
134 INTEGER :: sm31 , em31 , sm32 , em32 , sm33 , em33
135 INTEGER :: sm31x, em31x, sm32x, em32x, sm33x, em33x
136 INTEGER :: sm31y, em31y, sm32y, em32y, sm33y, em33y
139 #include "deref_kludge.h"
141 CALL set_scalar_indices_from_config ( head_grid%id , idum1, idum2 )
143 CALL init_domain_exp( grid &
145 #include <actual_args.inc>
149 END SUBROUTINE init_domain
151 SUBROUTINE init_module_initialize
152 END SUBROUTINE init_module_initialize
155 END MODULE module_initialize