1 subroutine da_nl_model (it)
3 !-----------------------------------------------------------------------
4 ! Purpose: Acrivate nonlinear model
5 ! Author: Xin Zhang, MMM/ESSL/NCAR, Date: 04/28/2010
6 !-----------------------------------------------------------------------
10 integer, intent(in) :: it ! outer looper counter.
11 integer :: time_step, alarmid
13 if (trace_use_dull) call da_trace_entry("da_nl_model")
21 ! We need the communicator generated in WRFDA
22 local_communicator = comm
26 call wrf_init ( .false. )
33 ! Turn off history output
34 call nl_set_history_begin_y (head_grid%id, 9999)
35 call nl_set_history_end_y (head_grid%id, 9999)
36 call nl_set_history_interval (head_grid%id, 0)
38 ! Set up basic states output
39 if ( multi_inc == 1 ) then
40 call nl_set_auxhist6_interval_s ( head_grid%id, var4d_bin )
42 call nl_get_time_step ( head_grid%id, time_step )
43 call nl_set_auxhist6_interval_s ( head_grid%id, time_step )
45 call nl_set_io_form_auxhist6 ( head_grid%id, 2 )
46 call nl_set_frames_per_auxhist6 ( head_grid%id, 1 )
48 IF ( ASSOCIATED( head_grid%domain_clock ) ) THEN
49 IF ( head_grid%domain_clock_created ) THEN
50 CALL WRFU_ClockDestroy( head_grid%domain_clock )
51 head_grid%domain_clock_created = .FALSE.
54 IF ( ASSOCIATED( head_grid%alarms ) .AND. &
55 ASSOCIATED( head_grid%alarms_created ) ) THEN
56 DO alarmid = 1, MAX_WRF_ALARMS
57 IF ( head_grid%alarms_created( alarmid ) ) THEN
58 CALL WRFU_AlarmDestroy( head_grid%alarms( alarmid ) )
59 head_grid%alarms_created( alarmid ) = .FALSE.
63 call Setup_Timekeeping ( head_grid )
65 ! Set the physics options to what they are in TL and AD
66 !call nl_set_mp_physics (head_grid%id, 0)
67 !call nl_set_ra_lw_physics (head_grid%id, 0)
68 !call nl_set_ra_sw_physics (head_grid%id, 0)
69 !call nl_set_sf_sfclay_physics (head_grid%id, 0)
70 !call nl_set_bl_pbl_physics (head_grid%id, 0)
71 !call nl_set_cu_physics (head_grid%id, 0)
72 !call nl_set_mp_zero_out (head_grid%id, 0)
73 !call nl_set_sf_surface_physics (head_grid%id, 1)
74 !call nl_set_ifsnow (head_grid%id, 1)
75 !call nl_set_icloud (head_grid%id, 0)
76 !call nl_set_isfflx (head_grid%id, 0)
78 ! WRF model time-stepping. Calls integrate().
81 ! restore the physics options to the originals
82 !call nl_set_mp_physics (head_grid%id, original_ra_lw_physics)
83 !call nl_set_ra_sw_physics (head_grid%id, original_ra_sw_physics)
84 !call nl_set_sf_sfclay_physics (head_grid%id, original_sf_sfclay_physics)
85 !call nl_set_bl_pbl_physics (head_grid%id, original_bl_pbl_physics)
86 !call nl_set_cu_physics (head_grid%id, original_cu_physics)
87 !call nl_set_mp_zero_out (head_grid%id, original_mp_zero_out)
88 !call nl_set_sf_surface_physics (head_grid%id, original_sf_surface_physics)
89 !call nl_set_ifsnow (head_grid%id, original_ifsnow)
90 !call nl_set_icloud (head_grid%id, original_icloud)
91 !call nl_set_isfflx (head_grid%id, original_isfflx)
93 ! Turn off basic states output
94 call nl_set_io_form_auxhist6 ( head_grid%id, 0 )
95 call nl_set_auxhist6_interval_s ( head_grid%id, 0 )
97 IF ( ASSOCIATED( head_grid%domain_clock ) ) THEN
98 IF ( head_grid%domain_clock_created ) THEN
99 CALL WRFU_ClockDestroy( head_grid%domain_clock )
100 head_grid%domain_clock_created = .FALSE.
103 IF ( ASSOCIATED( head_grid%alarms ) .AND. &
104 ASSOCIATED( head_grid%alarms_created ) ) THEN
105 DO alarmid = 1, MAX_WRF_ALARMS
106 IF ( head_grid%alarms_created( alarmid ) ) THEN
107 CALL WRFU_AlarmDestroy( head_grid%alarms( alarmid ) )
108 head_grid%alarms_created( alarmid ) = .FALSE.
112 call Setup_Timekeeping ( head_grid )
114 ! Turn off boundary input from now.
115 CALL nl_set_io_form_boundary( head_grid%id, 0 )
117 if (trace_use_dull) call da_trace_exit("da_nl_model")
119 end subroutine da_nl_model