1 subroutine da_med_initialdata_output_lbc (grid , config_flags, out_filename)
3 !-----------------------------------------------------------------------
4 ! Purpose: Write out LBC condition at the t=0 for 4DVAR with LBC control
5 ! We only use the perturbation of LBC
7 !-----------------------------------------------------------------------
11 type(domain), intent(inout) :: grid
12 type (grid_config_rec_type) , intent(inout) :: config_flags
13 character(*), intent (in), optional :: out_filename
18 character (len=80) :: file_name
20 integer :: julyr, julday
23 if (trace_use) call da_trace_entry("da_med_initialdata_output_lbc")
25 if (present(out_filename)) then
26 file_name = trim(out_filename)
28 file_name = 'wrfvar_bdyout'
31 call open_w_dataset (bid, trim(file_name), grid , config_flags , &
32 output_boundary , "DATASET=BOUNDARY", ierr )
35 write(unit=message(1),fmt=*) 'Error opening ', &
36 trim(file_name),' for writing ierr=',ierr
37 call da_error(__FILE__,__LINE__,message(1:1))
40 start_date=current_date
42 call geth_julgmt(julyr, julday, gmt)
43 config_flags%gmt = gmt
44 config_flags%julyr = julyr
45 config_flags%julday = julday
46 call nl_set_bdyfrq ( grid%id , REAL(model_config_rec%interval_seconds) )
47 call model_to_grid_config_rec (grid%id , model_config_rec , config_flags)
49 call output_boundary (bid, grid , config_flags , ierr)
51 call close_dataset (bid , config_flags, "DATASET=BOUNDARY")
53 if (trace_use) call da_trace_exit("da_med_initialdata_output_lbc")
56 end subroutine da_med_initialdata_output_lbc