da_med_initialdata_output.inc

References to this file elsewhere.
1 subroutine da_med_initialdata_output (grid , config_flags, out_filename)
2 
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
6 
7    implicit none
8 
9    type(domain), intent(in)                   :: grid
10    type (grid_config_rec_type) , intent(inout) :: config_flags       
11    character(*),  intent (in),  optional       :: out_filename
12 
13    integer                :: fid
14    character (len=80)     :: file_name
15 
16    integer :: julyr, julday
17    real    :: gmt
18 
19    if (trace_use) call da_trace_entry("da_med_initialdata_output")
20 
21    if (present(out_filename)) then
22       file_name = trim(out_filename)
23    else
24       file_name = 'wrfvar_output'
25    end if
26 
27    call da_trace ("da_med_initialdata_ouput",Message="Writing wrfvar output")
28    call open_w_dataset (fid, trim(file_name), grid , config_flags , &
29                          output_model_input , "DATASET=INPUT,REAL_OUTPUT_SIZE=4", ierr)
30 
31    if (ierr /= 0) then
32       write(unit=message(1),fmt=*) 'Error opening ', &
33          trim(file_name),' for writing ierr=',ierr
34       call da_error(__FILE__,__LINE__,message(1:1))
35    end if
36 
37    start_date=current_date
38 
39    call geth_julgmt(julyr, julday, gmt)
40    config_flags%gmt = gmt
41    config_flags%julyr = julyr
42    config_flags%julday = julday
43 
44    call output_model_input (fid, grid , config_flags , ierr)
45 
46    call close_dataset (fid , config_flags, "DATASET=INPUT,REAL_OUTPUT_SIZE=4")
47 
48    if (trace_use) call da_trace_exit("da_med_initialdata_output")
49 
50 end subroutine da_med_initialdata_output
51 
52