Subroutine : ALLOC_AND_CONFIGURE_DOMAIN

Defined in: frame/module_domain.F

Description:

This subroutine is used to allocate a domain data structure of TYPE(DOMAIN) pointed to by the argument grid, link it into the nested domain hierarchy, and set its configuration information from the appropriate settings in the WRF namelist file. Specifically, if the domain being allocated and configured is nest, the parent argument will point to the already existing domain data structure for the parent domain and the kid argument will be set to an integer indicating which child of the parent this grid will be (child indices start at 1). If this is the top-level domain, the parent and kid arguments are ignored. WRF domains may have multiple children but only ever have one parent.

The domain_id argument is the integer handle by which this new domain will be referred; it comes from the grid_id setting in the namelist, and these grid ids correspond to the ordering of settings in the namelist, starting with 1 for the top-level domain. The id of 1 always corresponds to the top-level domain. and these grid ids correspond to the ordering of settings in the namelist, starting with 1 for the top-level domain.

Model_data_order is provide by USE association of module_driver_constants and is set from dimspec entries in the Registry.

The allocation of the TYPE(DOMAIN) itself occurs in this routine. However, the numerous multi-dimensional arrays that make up the members of the domain are allocated in the call to alloc_space_field, after wrf_patch_domain has been called to determine the dimensions in memory that should be allocated. It bears noting here that arrays and code that indexes these arrays are always global, regardless of how the model is decomposed over patches. Thus, when arrays are allocated on a given process, the start and end of an array dimension are the global indices of the start and end of that processs subdomain.

Configuration information for the domain (that is, information from the namelist) is added by the call to med_add_config_info_to_grid, defined in share/mediation_wrfmain.F.

Called by :

integrate (frame/module_integrate.F)
      wrf_run (share/module_wrf_top.F)
ndown_em (main/ndown_em.F)
real_data (main/real_em.F)
wrf_init (share/module_wrf_top.F)
Arguments:

  1. domain_id    :: INTEGER , INTENT( IN )    
  2. grid         :: TYPE(DOMAIN), INTENT( INOUT ) 
  3. parent       :: TYPE(DOMAIN), INTENT( INOUT ) 
  4. kid          :: INTEGER , INTENT( IN )    
ALLOC_AND_CONFIGURE_DOMAIN calls :

nl_get_e_vert(frame/module_configure.F)
nl_get_s_we(frame/module_configure.F)
nl_get_s_sn(frame/module_configure.F)
nl_get_e_sn(frame/module_configure.F)
nl_get_s_vert(frame/module_configure.F)
nl_get_e_we(frame/module_configure.F)
wrf_error_fatal3(frame/module_wrf_error.F)
wrf_patch_domain(frame/module_domain.F)
alloc_space_field(frame/module_domain.F)
med_add_config_info_to_grid(share/mediation_wrfmain.F)
wrf_get_dm_communicator(frame/module_dm.F)
wrf_dm_define_comms(frame/module_dm.F)