1 subroutine da_wrfvar_init1(no_init1)
3 !-----------------------------------------------------------------------
4 ! Purpose: WRFVAR initialization routine, part 1
5 !-----------------------------------------------------------------------
9 logical, optional, intent(in) :: no_init1
12 ! Program_name, a global variable defined in frame/module_domain.F, is
13 ! set, then a routine <a href=init_modules.html>init_modules</a> is
14 ! called. This calls all the init programs that are provided by the
15 ! modules that are linked into WRF. These include initialization of
16 ! external I/O packages. Also, some key initializations for
17 ! distributed-memory parallelism occur here if DM_PARALLEL is specified
18 ! in the compile: setting up I/O quilt processes to act as I/O servers
19 ! and dividing up MPI communicators among those as well as initializing
20 ! external communication packages.
24 ! Set "program_name", which will be printed to output and netcdf metadata
25 program_name = "WRFDA "//release_version
27 ! Initialize WRF modules:
28 ! Phase 1 returns after mpi_init() (if it is called)
29 if (.NOT. present(no_init1)) then
31 ! Initialize utilities (time manager, etc.)
32 #ifdef NO_LEAP_CALENDAR
33 call wrfu_initialize (defaultCalKind=WRFU_CAL_NOLEAP)
35 call wrfu_initialize (defaultCalKind=WRFU_CAL_GREGORIAN)
38 ! Phase 2 resumes after mpi_init() (if it is called)
42 ! The wrf namelist.input file is read and stored in the use associated
43 ! structure model_config_rec, defined in frame/module_configure.F, by the
44 ! call to <a href=initial_config.html>initial_config</a>. On distributed
45 ! memory parallel runs this is done only on one processor, and then
46 ! broadcast as a buffer. For distributed-memory, the broadcast of the
47 ! configuration information is accomplished by first putting the
48 ! configuration information into a buffer (<a
49 ! href=get_config_as_buffer.html>get_config_as_buffer</a>), broadcasting
50 ! the buffer, then setting the configuration information (<a
51 ! href=set_config_as_buffer.html>set_config_as_buffer</a>).
55 ! Don't use stdout here, too early
56 write(unit=6,fmt='(/A)') "*** VARIATIONAL ANALYSIS ***"
57 write(unit=6,fmt='(A,A/)') " ",program_name
60 call wrf_get_dm_communicator (comm)
61 call mpi_comm_size (comm, num_procs, ierr)
62 call mpi_comm_rank (comm, myproc, ierr)
79 call get_config_as_buffer (configbuf, configbuflen, nbytes)
80 call wrf_dm_bcast_bytes (configbuf, nbytes)
81 call set_config_as_buffer (configbuf, configbuflen)
82 call wrf_dm_initialize
87 ! Copy namelist variables to da_control
89 #define SOURCE_RECORD model_config_rec%
92 #include "config_assigns.inc"
94 if (.NOT. rootproc) check_max_iv_print=.false.
96 end subroutine da_wrfvar_init1