2 ! ---principal wrf output routine (called from routines in module_io_domain )
3 SUBROUTINE output_wrf ( fid , grid , config_flags, switch , ierr )
8 USE module_domain_type, ONLY : fieldlist
9 USE module_state_description
11 ! USE module_date_time
12 USE module_model_constants
15 #include "wrf_io_flags.h"
16 #include "wrf_status_codes.h"
18 TYPE(grid_config_rec_type), INTENT(INOUT) :: config_flags
19 INTEGER, INTENT(IN) :: fid, switch
20 INTEGER, INTENT(INOUT) :: ierr
23 INTEGER ids , ide , jds , jde , kds , kde , &
24 ims , ime , jms , jme , kms , kme , &
25 ips , ipe , jps , jpe , kps , kpe
27 TYPE( fieldlist ), POINTER :: p
29 INTEGER newswitch, itrace
31 INTEGER , DIMENSION(3) :: domain_start , domain_end
32 INTEGER , DIMENSION(3) :: memory_start , memory_end
33 INTEGER , DIMENSION(3) :: patch_start , patch_end
35 INTEGER julyr, julday, idt, iswater , islake, map_proj
38 REAL gmt, cen_lat, cen_lon, bdyfrq , truelat1 , truelat2 , moad_cen_lat , stand_lon
39 INTEGER km_opt, diff_opt, damp_opt, &
40 mp_physics, ra_lw_physics, ra_sw_physics, sf_sfclay_physics, &
41 sf_surface_physics, bl_pbl_physics, cu_physics, hypsometric_opt, sf_lake_physics, &
42 use_theta_m, use_maxw_level, use_trop_level,hybrid_opt, gwd_opt
43 INTEGER swint_opt, aer_type,aer_aod550_opt,aer_angexp_opt,aer_ssa_opt,aer_asy_opt, aer_opt
44 REAL aer_aod550_val,aer_angexp_val,aer_ssa_val,aer_asy_val,etac
45 REAL khdif, kvdif, swrad_scat, dampcoef,radt,bldt,cudt
46 REAL dt, adapt_dt_start, adapt_dt_min, adapt_dt_max
47 INTEGER sf_urban_physics, w_damping, smooth_option, feedback, surface_input_source, sst_update
48 INTEGER skebs_on, sppt_on, rand_perturb_on, nens,ISEED_SKEBS,ISEED_SPPT,ISEED_RAND_PERT
49 INTEGER skebs_vertstruc, sppt_vertstruc, rand_pert_vertstruc
51 INTEGER LMINFORC,LMAXFORC,KMINFORC,KMAXFORC,LMINFORCT,LMAXFORCT,KMINFORCT,KMAXFORCT
52 INTEGER NTASKS_X, NTASKS_Y
53 REAL gridpt_stddev_rand_pert,stddev_cutoff_rand_pert,timescale_rand_pert
54 REAL gridpt_stddev_sppt,stddev_cutoff_sppt,timescale_sppt
55 REAL tot_backscat_psi,tot_backscat_t,REXPONENT_PSI,REXPONENT_T,ZTAU_PSI,ZTAU_T
57 INTEGER grid_id , parent_id , i_parent_start , j_parent_start , parent_grid_ratio
60 INTEGER grid_fdda, gfdda_interval_m, gfdda_end_h, if_ramping, &
61 obs_nudge_opt, obs_nudge_wind, obs_nudge_temp, obs_nudge_mois, obs_nudge_pstr, obs_idynin, obs_ionf
62 INTEGER grid_sfdda, sgfdda_interval_m, sgfdda_end_h
63 REAL fgdt, guv, gt, gq, gph, dtramp_min, &
64 obs_coef_wind, obs_coef_temp, obs_coef_mois, obs_coef_pstr, obs_dtramp, fdda_end
65 REAL guv_sfc, gt_sfc, gq_sfc, rinblw
67 INTEGER moist_adv_opt, scalar_adv_opt, tke_adv_opt
68 INTEGER save_topo_orig
69 INTEGER scalar_pblmix, tracer_pblmix, grav_settling, ysu_topdown_pblmix
71 CHARACTER (len=19) simulation_start_date
72 CHARACTER (len=len_current_date) current_date_save
73 INTEGER simulation_start_year , &
74 simulation_start_month , &
75 simulation_start_day , &
76 simulation_start_hour , &
77 simulation_start_minute , &
78 simulation_start_second
81 LOGICAL, EXTERNAL :: multi_files
82 INTEGER, EXTERNAL :: use_package
83 INTEGER p_hr, p_min, p_sec, p_ms
85 CHARACTER*80 dname, memord
88 CHARACTER*80 char_junk
89 CHARACTER(LEN=256) :: MMINLU
92 TYPE(WRFU_TimeInterval) :: bdy_increment
93 TYPE(WRFU_Time) :: next_time, currentTime, startTime
94 CHARACTER*40 :: next_datestr
95 INTEGER :: start_year , start_month , start_day , start_hour , start_minute , start_second
98 TYPE(WRFU_Time) :: ringTime, stopTime, curtime
99 TYPE(WRFU_TimeInterval) :: interval, tmpinterval
100 CHARACTER*80 alarmname, timestring, debuggal
101 INTEGER seconds, seconds2, iring
102 INTEGER :: nio_tasks_per_group
104 LOGICAL, EXTERNAL :: wrf_dm_on_monitor
106 WRITE(wrf_err_message,*)'output_wrf: begin, fid = ',fid
107 CALL wrf_debug( 300 , wrf_err_message )
109 CALL modify_io_masks ( grid%id ) ! this adjusts the I/O masks according to the users run-time specs, if any
111 CALL wrf_inquire_filename ( fid , fname , filestate , ierr )
112 IF ( ierr /= 0 ) THEN
113 WRITE(wrf_err_message,*)'module_io_wrf: output_wrf: wrf_inquire_filename Status = ',ierr
114 CALL wrf_error_fatal( wrf_err_message )
117 WRITE(wrf_err_message,*)'output_wrf: fid,filestate = ',fid,filestate
118 CALL wrf_debug( 300 , wrf_err_message )
120 ! io_form is used to determine if multi-file I/O is enabled and to
121 ! control writing of format-specific time-independent metadata
122 io_form = io_form_for_stream( switch )
124 dryrun = ( filestate .EQ. WRF_FILE_OPENED_NOT_COMMITTED )
126 WRITE(wrf_err_message,*)'output_wrf: dryrun = ',dryrun
127 CALL wrf_debug( 300 , wrf_err_message )
129 CALL get_ijk_from_grid ( grid , &
130 ids, ide, jds, jde, kds, kde, &
131 ims, ime, jms, jme, kms, kme, &
132 ips, ipe, jps, jpe, kps, kpe )
134 call nl_get_diff_opt ( grid%id , diff_opt )
135 call nl_get_km_opt ( grid%id, km_opt )
136 call nl_get_damp_opt ( 1, damp_opt )
137 call nl_get_dampcoef ( grid%id, dampcoef )
138 call nl_get_khdif ( grid%id, khdif )
139 call nl_get_kvdif ( grid%id, kvdif )
140 call nl_get_mp_physics ( grid%id, mp_physics )
141 call nl_get_ra_lw_physics ( grid%id, ra_lw_physics )
142 call nl_get_ra_sw_physics ( grid%id, ra_sw_physics )
143 call nl_get_sf_sfclay_physics ( grid%id, sf_sfclay_physics )
144 call nl_get_sf_surface_physics ( grid%id, sf_surface_physics )
145 call nl_get_bl_pbl_physics ( grid%id, bl_pbl_physics )
146 call nl_get_cu_physics ( grid%id, cu_physics )
147 call nl_get_radt ( grid%id, radt )
148 call nl_get_bldt ( grid%id, bldt )
149 call nl_get_cudt ( grid%id, cudt )
150 call nl_get_aer_opt ( grid%id, aer_opt )
151 call nl_get_swint_opt ( grid%id, swint_opt )
152 call nl_get_aer_type ( grid%id, aer_type )
153 call nl_get_aer_aod550_opt ( grid%id, aer_aod550_opt )
154 call nl_get_aer_angexp_opt ( grid%id, aer_angexp_opt )
155 call nl_get_aer_ssa_opt ( grid%id, aer_ssa_opt )
156 call nl_get_aer_asy_opt ( grid%id, aer_asy_opt )
157 call nl_get_aer_aod550_val ( grid%id, aer_aod550_val )
158 call nl_get_aer_angexp_val ( grid%id, aer_angexp_val )
159 call nl_get_aer_ssa_val ( grid%id, aer_ssa_val )
160 call nl_get_aer_asy_val ( grid%id, aer_asy_val )
161 call nl_get_sf_lake_physics ( grid%id, sf_lake_physics )
162 call nl_get_nproc_x ( 1, ntasks_x )
163 call nl_get_nproc_y ( 1, ntasks_y )
167 adapt_dt_min = grid%min_time_step
168 adapt_dt_max = grid%max_time_step
169 adapt_dt_start = grid%starting_time_step
170 call nl_get_gwd_opt ( grid%id, gwd_opt )
173 ! add nml variables in 2.2
174 call nl_get_surface_input_source ( 1 , surface_input_source )
175 call nl_get_sst_update ( 1 , sst_update )
176 call nl_get_feedback ( 1 , feedback )
177 call nl_get_smooth_option ( 1 , smooth_option )
178 call nl_get_swrad_scat ( 1 , swrad_scat )
179 call nl_get_sf_urban_physics ( grid%id, sf_urban_physics )
180 call nl_get_w_damping ( 1 , w_damping )
181 call nl_get_ghg_input ( 1 , ghg_input )
184 call nl_get_hypsometric_opt ( 1, hypsometric_opt )
185 call nl_get_use_theta_m ( 1, use_theta_m )
186 call nl_get_use_maxw_level ( 1, use_maxw_level )
187 call nl_get_use_trop_level ( 1, use_trop_level )
188 CALL nl_get_moist_adv_opt ( grid%id , moist_adv_opt )
189 CALL nl_get_scalar_adv_opt ( grid%id , scalar_adv_opt )
190 CALL nl_get_tke_adv_opt ( grid%id , tke_adv_opt )
191 CALL nl_get_diff_6th_opt ( grid%id , diff_6th_opt )
192 CALL nl_get_diff_6th_factor ( grid%id , diff_6th_factor )
193 CALL nl_get_grid_fdda ( grid%id , grid_fdda )
194 CALL nl_get_auxinput10_end_h( grid%id , gfdda_end_h )
195 CALL nl_get_auxinput10_interval_m ( grid%id , gfdda_interval_m )
196 CALL nl_get_grid_sfdda ( grid%id , grid_sfdda )
197 CALL nl_get_auxinput9_end_h( grid%id , sgfdda_end_h )
198 CALL nl_get_auxinput9_interval_m ( grid%id , sgfdda_interval_m )
199 CALL nl_get_scalar_pblmix ( grid%id , scalar_pblmix )
200 CALL nl_get_tracer_pblmix ( grid%id , tracer_pblmix )
201 CALL nl_get_ysu_topdown_pblmix ( grid%id , ysu_topdown_pblmix )
202 CALL nl_get_grav_settling ( grid%id , grav_settling )
204 CALL nl_get_hybrid_opt ( 1 , hybrid_opt )
205 CALL nl_get_etac ( 1 , etac )
206 IF ( hybrid_opt .EQ. 0 ) THEN
210 IF ( grid_fdda == 1 ) THEN
211 CALL nl_get_fgdt ( grid%id , fgdt )
212 CALL nl_get_guv ( grid%id , guv )
213 CALL nl_get_gt ( grid%id , gt )
214 CALL nl_get_gq ( grid%id , gq )
215 CALL nl_get_if_ramping ( 1 , if_ramping )
216 CALL nl_get_dtramp_min ( 1 , dtramp_min )
219 IF ( grid_fdda == 2 ) THEN
220 CALL nl_get_fgdt ( grid%id , fgdt )
221 CALL nl_get_guv ( grid%id , guv )
222 CALL nl_get_gt ( grid%id , gt )
223 CALL nl_get_gph ( grid%id , gph )
224 CALL nl_get_gq ( grid%id , gq )
225 CALL nl_get_if_ramping ( 1 , if_ramping )
226 CALL nl_get_dtramp_min ( 1 , dtramp_min )
229 IF ( grid_sfdda >= 1 ) THEN
230 CALL nl_get_guv_sfc ( grid%id , guv_sfc )
231 CALL nl_get_gt_sfc ( grid%id , gt_sfc )
232 CALL nl_get_gq_sfc ( grid%id , gq_sfc )
233 CALL nl_get_rinblw ( grid%id , rinblw )
236 CALL nl_get_obs_nudge_opt ( grid%id , obs_nudge_opt )
237 IF ( obs_nudge_opt == 1 ) THEN
238 CALL nl_get_fdda_end ( grid%id , fdda_end )
239 CALL nl_get_obs_nudge_wind ( grid%id , obs_nudge_wind )
240 CALL nl_get_obs_coef_wind ( grid%id , obs_coef_wind )
241 CALL nl_get_obs_nudge_temp ( grid%id , obs_nudge_temp )
242 CALL nl_get_obs_coef_temp ( grid%id , obs_coef_temp )
243 CALL nl_get_obs_nudge_mois ( grid%id , obs_nudge_mois )
244 CALL nl_get_obs_coef_mois ( grid%id , obs_coef_mois )
245 CALL nl_get_obs_nudge_pstr ( grid%id , obs_nudge_pstr )
246 CALL nl_get_obs_coef_pstr ( grid%id , obs_coef_pstr )
247 CALL nl_get_obs_ionf ( 1 , obs_ionf )
248 CALL nl_get_obs_idynin ( 1 , obs_idynin )
249 CALL nl_get_obs_dtramp ( 1 , obs_dtramp )
253 CALL nl_get_skebs_on ( grid%id, skebs_on )
254 CALL nl_get_sppt_on ( grid%id, sppt_on )
255 CALL nl_get_rand_perturb_on ( grid%id, rand_perturb_on )
256 CALL nl_get_skebs_vertstruc ( grid%id, skebs_vertstruc )
257 CALL nl_get_tot_backscat_psi ( grid%id, tot_backscat_psi )
258 CALL nl_get_tot_backscat_t ( grid%id, tot_backscat_t )
259 CALL nl_get_REXPONENT_PSI ( grid%id, REXPONENT_PSI )
260 CALL nl_get_REXPONENT_T ( grid%id, REXPONENT_T )
261 CALL nl_get_ZTAU_T ( grid%id, ZTAU_T )
262 CALL nl_get_ZTAU_PSI ( grid%id, ZTAU_PSI )
263 CALL nl_get_LMINFORC ( grid%id, LMINFORC )
264 CALL nl_get_LMAXFORC ( grid%id, LMAXFORC )
265 CALL nl_get_KMINFORC ( grid%id, KMINFORC )
266 CALL nl_get_KMAXFORC ( grid%id, KMAXFORC )
267 CALL nl_get_LMINFORCT ( grid%id, LMINFORCT )
268 CALL nl_get_LMAXFORCT ( grid%id, LMAXFORCT )
269 CALL nl_get_KMINFORCT ( grid%id, KMINFORCT )
270 CALL nl_get_KMAXFORCT ( grid%id, KMAXFORCT )
271 CALL nl_get_ISEED_SKEBS ( grid%id, ISEED_SKEBS )
272 CALL nl_get_ISEED_SPPT ( grid%id, ISEED_SPPT )
273 CALL nl_get_ISEED_RAND_PERT ( grid%id, ISEED_RAND_PERT )
274 CALL nl_get_nens ( grid%id, nens )
275 CALL nl_get_sppt_vertstruc ( grid%id, sppt_vertstruc )
276 CALL nl_get_rand_pert_vertstruc ( grid%id, rand_pert_vertstruc )
277 CALL nl_get_gridpt_stddev_sppt ( grid%id, gridpt_stddev_sppt )
278 CALL nl_get_stddev_cutoff_sppt ( grid%id, stddev_cutoff_sppt )
279 CALL nl_get_timescale_sppt ( grid%id, timescale_sppt )
280 CALL nl_get_gridpt_stddev_rand_pert ( grid%id, gridpt_stddev_rand_pert )
281 CALL nl_get_stddev_cutoff_rand_pert ( grid%id, stddev_cutoff_rand_pert )
282 CALL nl_get_timescale_rand_pert ( grid%id, timescale_rand_pert )
286 ! julday and gmt can be set in namelist_03 for ideal.exe run
287 CALL nl_get_gmt (grid%id, gmt)
288 CALL nl_get_julyr (grid%id, julyr)
289 CALL nl_get_julday (grid%id, julday)
290 CALL nl_get_mminlu ( grid%id, mminlu )
291 call wrf_debug(300,"OUTPUT_WRF: mminlu = " // mminlu )
292 CALL nl_get_iswater (grid%id, iswater )
293 CALL nl_get_islake (grid%id, islake )
294 CALL nl_get_cen_lat ( grid%id , cen_lat )
295 CALL nl_get_cen_lon ( grid%id , cen_lon )
296 CALL nl_get_truelat1 ( grid%id , truelat1 )
297 CALL nl_get_truelat2 ( grid%id , truelat2 )
298 CALL nl_get_moad_cen_lat ( grid%id , moad_cen_lat )
299 CALL nl_get_stand_lon ( grid%id , stand_lon )
300 CALL nl_get_map_proj ( grid%id , map_proj )
303 CALL nl_get_parent_id ( grid%id , parent_id )
304 CALL nl_get_i_parent_start ( grid%id , i_parent_start )
305 CALL nl_get_j_parent_start ( grid%id , j_parent_start )
306 CALL nl_get_parent_grid_ratio ( grid%id , parent_grid_ratio )
309 CALL domain_clockprint(150, grid, &
310 'DEBUG output_wrf(): before call to domain_clock_get,')
311 CALL domain_clock_get( grid, current_time=currentTime, &
312 start_time=startTime, &
313 current_timestr=current_date )
315 IF (switch .EQ. history_only) THEN
316 CALL nl_get_adjust_output_times( grid%id, adjust )
318 CALL adjust_io_timestr( grid%io_intervals( history_alarm ), currentTime, startTime, timestring )
319 current_date_save = current_date
320 current_date = timestring
324 WRITE ( wrf_err_message , * ) 'output_wrf: begin, current_date=',current_date
325 CALL wrf_debug ( 300 , wrf_err_message )
327 WRITE( message , * ) "OUTPUT FROM " , TRIM(program_name)
328 CALL wrf_put_dom_ti_char ( fid , 'TITLE' , TRIM(message) , ierr )
329 ! added grib-specific metadata: Todd Hutchinson 8/21/2005
330 IF ( ( use_package( io_form ) == IO_GRIB1 ) .OR. &
331 ( use_package( io_form ) == IO_GRIB2 ) ) THEN
332 CALL wrf_put_dom_ti_char ( fid, 'PROGRAM_NAME', TRIM(program_name) , ierr )
334 CALL nl_get_start_year(grid%id,start_year)
335 CALL nl_get_start_month(grid%id,start_month)
336 CALL nl_get_start_day(grid%id,start_day)
337 CALL nl_get_start_hour(grid%id,start_hour)
338 CALL nl_get_start_minute(grid%id,start_minute)
339 CALL nl_get_start_second(grid%id,start_second)
341 WRITE ( start_date , FMT = '(I4.4,"-",I5.5,"_",I2.2,":",I2.2,":",I2.2)' ) &
342 start_year,start_day,start_hour,start_minute,start_second
344 WRITE ( start_date , FMT = '(I4.4,"-",I2.2,"-",I2.2,"_",I2.2,":",I2.2,":",I2.2)' ) &
345 start_year,start_month,start_day,start_hour,start_minute,start_second
347 CALL wrf_put_dom_ti_char ( fid , 'START_DATE', TRIM(start_date) , ierr )
348 IF ( switch .EQ. input_only) THEN
349 CALL wrf_put_dom_ti_char ( fid , 'SIMULATION_START_DATE', TRIM(start_date) , ierr )
350 ELSE IF ( ( switch .EQ. restart_only ) .OR. ( switch .EQ. history_only ) ) THEN
351 CALL nl_get_simulation_start_year ( 1, simulation_start_year )
352 CALL nl_get_simulation_start_month ( 1, simulation_start_month )
353 CALL nl_get_simulation_start_day ( 1, simulation_start_day )
354 CALL nl_get_simulation_start_hour ( 1, simulation_start_hour )
355 CALL nl_get_simulation_start_minute ( 1, simulation_start_minute )
356 CALL nl_get_simulation_start_second ( 1, simulation_start_second )
358 WRITE ( simulation_start_date , FMT = '(I4.4,"-",I5.5,"_",I2.2,":",I2.2,":",I2.2)' ) &
359 simulation_start_year,simulation_start_day,&
360 simulation_start_hour,simulation_start_minute,simulation_start_second
362 WRITE ( simulation_start_date , FMT = '(I4.4,"-",I2.2,"-",I2.2,"_",I2.2,":",I2.2,":",I2.2)' ) &
363 simulation_start_year,simulation_start_month,simulation_start_day,&
364 simulation_start_hour,simulation_start_minute,simulation_start_second
366 CALL wrf_put_dom_ti_char ( fid , 'SIMULATION_START_DATE', TRIM(simulation_start_date) , ierr )
369 IF ( switch .EQ. restart_only ) THEN
370 ! Add a flag for "this is a restart file"
371 CALL wrf_put_dom_ti_integer ( fid , 'FLAG_RESTART' , 1 , 1 , ierr )
372 ! add some delicious alarm metadata to the restart files
373 ibuf(1) = MAX_WRF_ALARMS
374 CALL wrf_put_dom_ti_integer( fid, 'MAX_WRF_ALARMS', ibuf, 1, ierr )
375 curtime = domain_get_current_time( grid )
376 DO i = 1, MAX_WRF_ALARMS
377 IF ( grid%alarms_created(i) ) THEN
378 IF ( i .LT. 10 ) THEN
379 write(alarmname,'("WRF_ALARM_ISRINGING_0",i1)')i
381 write(alarmname,'("WRF_ALARM_ISRINGING_",i2)')i
383 IF ( WRFU_AlarmIsRinging( grid%alarms( i ), rc=rc ) ) THEN
388 CALL wrf_put_dom_ti_integer( fid, TRIM(alarmname), iring, 1, ierr )
390 CALL WRFU_AlarmGet( grid%alarms(i),PrevRingTime=ringTime,RingInterval=interval,rc=rc)
393 !different, perhaps simpler way to do this, JM 20100319
394 IF ( i .LT. 10 ) THEN
395 write(alarmname,'("WRF_ALARM_PREVRINGTIME_0",i1)')i
397 write(alarmname,'("WRF_ALARM_PREVRINGTIME_",i2)')i
399 CALL WRFU_TimeGet( ringTime, timeString=prevringtime )
400 CALL wrf_put_dom_ti_char( fid, TRIM(alarmname), TRIM(prevringtime), 1, ierr )
403 ! compute time to next ring as interval minus time since last ring
404 tmpinterval = curtime - ringTime
406 IF ( i .LT. 10 ) THEN
407 write(alarmname,'("WRF_ALARM_SECS_TIL_NEXT_RING_0",i1)')i
409 write(alarmname,'("WRF_ALARM_SECS_TIL_NEXT_RING_",i2)')i
413 if(wrf_dm_on_monitor()) then
415 CALL WRFU_TimeIntervalGet(interval,S=seconds)
416 CALL WRFU_TimeIntervalGet(tmpinterval,S=seconds2)
420 call wrf_dm_bcast_integer(seconds, 1)
421 call wrf_dm_bcast_integer(seconds2, 1)
423 IF ( seconds .GE. 1700000000 .OR. seconds .LE. -1700000000 ) THEN ! it is a forever value, do not change it
424 CALL wrf_put_dom_ti_integer( fid, TRIM(alarmname), seconds, 1, ierr )
426 CALL wrf_put_dom_ti_integer( fid, TRIM(alarmname), seconds-seconds2, 1, ierr )
429 if ( i .eq. history_alarm .or. i .eq. restart_alarm .or. i .eq. auxhist24_alarm) then
430 if ( i .eq. history_alarm ) write(*,*)'----------------- info for history alarm ',i
431 if ( i .eq. restart_alarm ) write(*,*)'----------------- info for restart alarm ',i
432 if ( i .eq. auxhist24_alarm ) write(*,*)'----------------- info for auxhist24 alarm ',i
433 CALL ESMF_TimeGet(curTime, TimeString=debuggal ) ; write(*,*)'curTime ',TRIM(debuggal)
434 CALL ESMF_TimeGet(ringTime, TimeString=debuggal ) ; write(*,*)'ringTime ',TRIM(debuggal)
435 CALL ESMF_TimeIntervalGet(tmpinterval, TimeString=debuggal ) ; write(*,*)'tmpinterval ',TRIM(debuggal)
436 CALL ESMF_TimeIntervalGet(interval, TimeString=debuggal ) ; write(*,*)'interval ',TRIM(debuggal)
437 write(*,*)'interval seconds ',seconds,' tmpinterval seconds ',seconds2,' seconds-seconds2 ',seconds-seconds2
438 write(*,*)'----------------- '
446 ibuf(1) = config_flags%e_we - config_flags%s_we + 1
447 CALL wrf_put_dom_ti_integer ( fid , 'WEST-EAST_GRID_DIMENSION' , ibuf , 1 , ierr )
449 ibuf(1) = config_flags%e_sn - config_flags%s_sn + 1
450 CALL wrf_put_dom_ti_integer ( fid , 'SOUTH-NORTH_GRID_DIMENSION' , ibuf , 1 , ierr )
452 IF ( program_name(1:5) .EQ. 'TC_EM' ) THEN
453 ibuf(1) = config_flags%num_metgrid_levels
454 CALL wrf_put_dom_ti_integer ( fid , 'BOTTOM-TOP_GRID_DIMENSION' , ibuf , 1 , ierr )
456 ibuf(1) = config_flags%e_vert - config_flags%s_vert + 1
457 CALL wrf_put_dom_ti_integer ( fid , 'BOTTOM-TOP_GRID_DIMENSION' , ibuf , 1 , ierr )
461 IF (grid%map_proj == 6) THEN
462 ! Global ... dx determined automatically
463 ! Don't use value from namelist ... used derived value instead
464 CALL wrf_put_dom_ti_real ( fid , 'DX' , grid%dx , 1 , ierr )
465 CALL wrf_put_dom_ti_real ( fid , 'DY' , grid%dy , 1 , ierr )
467 CALL wrf_put_dom_ti_real ( fid , 'DX' , config_flags%dx , 1 , ierr )
468 CALL wrf_put_dom_ti_real ( fid , 'DY' , config_flags%dy , 1 , ierr )
472 CALL wrf_put_dom_ti_integer( fid, 'AERCU_OPT' , config_flags%aercu_opt , 1, ierr )
473 CALL wrf_put_dom_ti_real ( fid, 'AERCU_FCT' , config_flags%aercu_fct , 1, ierr )
475 CALL wrf_put_dom_ti_integer( fid, 'IDEAL_CASE' , config_flags%ideal_case , 1, ierr )
476 CALL wrf_put_dom_ti_integer( fid, 'DIFF_6TH_SLOPEOPT' , config_flags%diff_6th_slopeopt , 1, ierr )
477 CALL wrf_put_dom_ti_integer( fid, 'AUTO_LEVELS_OPT' , config_flags%auto_levels_opt , 1, ierr )
478 CALL wrf_put_dom_ti_real ( fid, 'DIFF_6TH_THRESH' , config_flags%diff_6th_thresh , 1, ierr )
479 CALL wrf_put_dom_ti_real ( fid, 'DZBOT' , config_flags%dzbot , 1, ierr )
480 CALL wrf_put_dom_ti_real ( fid, 'DZSTRETCH_S' , config_flags%dzstretch_s , 1, ierr )
481 CALL wrf_put_dom_ti_real ( fid, 'DZSTRETCH_U' , config_flags%dzstretch_u , 1, ierr )
485 !added the following for tc bogusing
486 if( ((config_flags%insert_bogus_storm) .or. (config_flags%remove_storm)) .and. &
487 ( program_name(1:5) .EQ. 'TC_EM' ) ) then
488 print *,"we have confirmed that insert or remove is true"
490 CALL wrf_put_dom_ti_integer ( fid , 'FLAG_METGRID' , ibuf , 1 , ierr )
491 if( grid%flag_snow .eq. 1) then
492 CALL wrf_put_dom_ti_integer ( fid , 'FLAG_SNOW' , ibuf , 1 , ierr )
494 if( grid%flag_mf_xy .eq. 1) then
495 CALL wrf_put_dom_ti_integer ( fid , 'FLAG_MF_XY' , ibuf , 1 , ierr )
497 if(grid%flag_psfc .eq. 1) then
498 CALL wrf_put_dom_ti_integer ( fid , 'FLAG_PSFC' , ibuf , 1 , ierr )
501 if(grid%flag_slp .eq. 1) then
502 CALL wrf_put_dom_ti_integer ( fid , 'FLAG_SLP' , ibuf , 1 , ierr )
505 if(grid%flag_sm000010 .eq. 1)then
506 CALL wrf_put_dom_ti_integer ( fid , 'FLAG_SM000010' , ibuf , 1 , ierr )
508 if(grid%flag_sm010040 .eq. 1)then
509 CALL wrf_put_dom_ti_integer ( fid , 'FLAG_SM010040' , ibuf , 1 , ierr )
511 if(grid%flag_sm040100 .eq. 1)then
512 CALL wrf_put_dom_ti_integer ( fid , 'FLAG_SM040100' , ibuf , 1 , ierr )
514 if(grid%flag_sm100200 .eq. 1)then
515 CALL wrf_put_dom_ti_integer ( fid , 'FLAG_SM100200' , ibuf , 1 , ierr )
518 if(grid%flag_st000010 .eq. 1)then
519 CALL wrf_put_dom_ti_integer ( fid , 'FLAG_ST000010' , ibuf , 1 , ierr )
521 if(grid%flag_st010040 .eq. 1)then
522 CALL wrf_put_dom_ti_integer ( fid , 'FLAG_ST010040' , ibuf , 1 , ierr )
524 if(grid%flag_st040100 .eq. 1)then
525 CALL wrf_put_dom_ti_integer ( fid , 'FLAG_ST040100' , ibuf , 1 , ierr )
527 if(grid%flag_st100200 .eq. 1)then
528 CALL wrf_put_dom_ti_integer ( fid , 'FLAG_ST100200' , ibuf , 1 , ierr )
531 if(grid%flag_soil_layers .eq. 1)then
532 CALL wrf_put_dom_ti_integer ( fid , 'FLAG_SOIL_LAYERS' , ibuf , 1 , ierr )
535 ibuf(1) = grid%num_metgrid_levels
536 CALL wrf_put_dom_ti_integer ( fid , 'BOTTOM-TOP_GRID_DIMENSION' , ibuf , 1 , ierr )
538 CALL wrf_put_dom_ti_integer ( fid , 'num_metgrid_levels' , ibuf , 1 , ierr )
541 CALL wrf_put_dom_ti_char ( fid , 'SIMULATION_START_DATE', TRIM(start_date) , ierr )
543 WRITE( message , * ) "OUTPUT FROM TC BOGUS"
544 CALL wrf_put_dom_ti_char ( fid , 'TITLE' , TRIM(message) , ierr )
548 #if ((EM_CORE == 1) && (DA_CORE != 1))
549 IF ( config_flags%p_lev_diags .NE. 0 ) THEN
550 IF (switch .EQ. auxhist23_only) THEN
551 CALL wrf_put_dom_ti_real( fid, 'P_LEV_MISSING' , config_flags%p_lev_missing, 1, ierr )
555 IF (switch .EQ. history_only) THEN
556 CALL wrf_put_dom_ti_integer( fid, 'SKEBS_ON' , config_flags%skebs_on , 1, ierr )
557 IF ( config_flags%skebs_on .NE. 0 ) THEN
558 CALL wrf_put_dom_ti_real ( fid, 'TOT_BACKSCAT_PSI' , config_flags%tot_backscat_psi , 1, ierr )
559 CALL wrf_put_dom_ti_real ( fid, 'TOT_BACKSCAT_T' , config_flags%tot_backscat_t , 1, ierr )
560 CALL wrf_put_dom_ti_real ( fid, 'REXPONENT_PSI' , config_flags%REXPONENT_PSI , 1, ierr )
561 CALL wrf_put_dom_ti_real ( fid, 'REXPONENT_T' , config_flags%REXPONENT_T , 1, ierr )
562 CALL wrf_put_dom_ti_real ( fid, 'ZTAU_PSI' , config_flags%ZTAU_PSI , 1, ierr )
563 CALL wrf_put_dom_ti_real ( fid, 'ZTAU_T ' , config_flags%ZTAU_T , 1, ierr )
564 CALL wrf_put_dom_ti_integer( fid, 'LMINFORC' , config_flags%LMINFORC , 1, ierr )
565 CALL wrf_put_dom_ti_integer( fid, 'LMAXFORC' , config_flags%LMAXFORC , 1, ierr )
566 CALL wrf_put_dom_ti_integer( fid, 'KMINFORC' , config_flags%KMINFORC , 1, ierr )
567 CALL wrf_put_dom_ti_integer( fid, 'KMAXFORC' , config_flags%KMAXFORC , 1, ierr )
568 CALL wrf_put_dom_ti_integer( fid, 'LMINFORCT' , config_flags%LMINFORCT , 1, ierr )
569 CALL wrf_put_dom_ti_integer( fid, 'LMAXFORCT' , config_flags%LMAXFORCT , 1, ierr )
570 CALL wrf_put_dom_ti_integer( fid, 'KMINFORCT' , config_flags%KMINFORCT , 1, ierr )
571 CALL wrf_put_dom_ti_integer( fid, 'KMAXFORCT' , config_flags%KMAXFORCT , 1, ierr )
572 CALL wrf_put_dom_ti_integer( fid, 'SKEBS_VERTSTRUC' , config_flags%skebs_vertstruc , 1, ierr )
573 CALL wrf_put_dom_ti_integer( fid, 'NENS' , config_flags%nens , 1, ierr )
574 CALL wrf_put_dom_ti_integer( fid, 'ISEED_SKEBS' , config_flags%ISEED_SKEBS , 1, ierr )
576 IF ( config_flags%rand_perturb_on .NE. 0 ) THEN
577 CALL wrf_put_dom_ti_real ( fid, 'GRIDPT_STDDEV_RAND_PERT', config_flags%gridpt_stddev_rand_pert, 1, ierr )
578 CALL wrf_put_dom_ti_real ( fid, 'STDDEV_CUTOFF_RAND_PERT', config_flags%stddev_cutoff_rand_pert, 1, ierr )
579 CALL wrf_put_dom_ti_real ( fid, 'LENGTHSCALE_RAND_PERT', config_flags%lengthscale_rand_pert, 1, ierr )
580 CALL wrf_put_dom_ti_real ( fid, 'TIMESCALE_RAND_PERT', config_flags%timescale_rand_pert, 1, ierr )
581 CALL wrf_put_dom_ti_integer( fid, 'RAND_PERT_VERTSTRUC', config_flags%rand_pert_vertstruc, 1, ierr )
582 CALL wrf_put_dom_ti_integer( fid, 'NENS' , config_flags%nens , 1, ierr )
583 CALL wrf_put_dom_ti_integer( fid, 'ISEED_RAND_PERT' , config_flags%ISEED_RAND_PERT , 1, ierr )
585 IF ( config_flags%sppt_on .NE. 0 ) THEN
586 CALL wrf_put_dom_ti_real ( fid, 'GRIDPT_STDDEV_SPPT', config_flags%gridpt_stddev_sppt, 1, ierr )
587 CALL wrf_put_dom_ti_real ( fid, 'STDDEV_CUTOFF_SPPT', config_flags%stddev_cutoff_sppt, 1, ierr )
588 CALL wrf_put_dom_ti_real ( fid, 'LENGTHSCALE_SPPT', config_flags%lengthscale_sppt, 1, ierr )
589 CALL wrf_put_dom_ti_real ( fid, 'TIMESCALE_SPPT', config_flags%timescale_sppt, 1, ierr )
590 CALL wrf_put_dom_ti_integer( fid, 'SPPT_VERTSTRUC', config_flags%sppt_vertstruc, 1, ierr )
591 CALL wrf_put_dom_ti_integer( fid, 'NENS' ,config_flags%nens , 1, ierr )
592 CALL wrf_put_dom_ti_integer( fid, 'ISEED_SPPT' ,config_flags% ISEED_SPPT , 1, ierr )
594 IF ( config_flags%perturb_bdy .NE. 0 ) THEN
595 CALL wrf_put_dom_ti_integer( fid, 'PERTURB_BDY', config_flags%perturb_bdy, 1, ierr )
597 CALL wrf_put_dom_ti_integer( fid, 'USE_Q_DIABATIC', config_flags%use_q_diabatic, 1, ierr )
601 ! added by SYHA (09-19-2014)
602 #if ((WRF_CHEM == 1) && (EM_CORE == 1) && (DA_CORE != 1))
603 IF ( config_flags%perturb_chem_bdy .NE. 0 ) THEN
604 CALL wrf_put_dom_ti_integer( fid, 'PERTURB_CHEM_BDY', config_flags%perturb_chem_bdy, 1, ierr )
608 ! added this metadatum for H. Chuan, NCEP, 030417, JM
610 CALL wrf_put_dom_ti_char ( fid , 'GRIDTYPE', 'C' , ierr )
613 ! added these fields for W. Skamarock, 020402, JM
615 CALL wrf_put_dom_ti_integer ( fid , 'DIFF_OPT' , ibuf , 1 , ierr )
617 CALL wrf_put_dom_ti_integer ( fid , 'KM_OPT' , ibuf , 1 , ierr )
619 CALL wrf_put_dom_ti_integer ( fid , 'DAMP_OPT' , ibuf , 1 , ierr )
621 CALL wrf_put_dom_ti_real ( fid , 'DAMPCOEF' , rbuf , 1 , ierr )
623 CALL wrf_put_dom_ti_real ( fid , 'KHDIF' , rbuf , 1 , ierr )
625 CALL wrf_put_dom_ti_real ( fid , 'KVDIF' , rbuf , 1 , ierr )
627 CALL wrf_put_dom_ti_integer ( fid , 'MP_PHYSICS' , ibuf , 1 , ierr )
628 ibuf(1) = ra_lw_physics
629 CALL wrf_put_dom_ti_integer ( fid , 'RA_LW_PHYSICS' , ibuf , 1 , ierr )
630 ibuf(1) = ra_sw_physics
631 CALL wrf_put_dom_ti_integer ( fid , 'RA_SW_PHYSICS' , ibuf , 1 , ierr )
632 ibuf(1) = sf_sfclay_physics
633 CALL wrf_put_dom_ti_integer ( fid , 'SF_SFCLAY_PHYSICS' , ibuf , 1 , ierr )
634 ibuf(1) = sf_surface_physics
635 CALL wrf_put_dom_ti_integer ( fid , 'SF_SURFACE_PHYSICS' , ibuf , 1 , ierr )
636 ibuf(1) = bl_pbl_physics
637 CALL wrf_put_dom_ti_integer ( fid , 'BL_PBL_PHYSICS' , ibuf , 1 , ierr )
639 CALL wrf_put_dom_ti_integer ( fid , 'CU_PHYSICS' , ibuf , 1 , ierr )
640 ibuf(1) = sf_lake_physics
641 CALL wrf_put_dom_ti_integer ( fid , 'SF_LAKE_PHYSICS' , ibuf , 1 , ierr )
643 ! added netcdf-specific metadata:
644 IF ( ( use_package( io_form ) == IO_NETCDF ) .OR. &
645 ( use_package( io_form ) == IO_NETCDFPAR ) .OR. &
646 ( use_package( io_form ) == IO_PHDF5 ) .OR. &
647 ( use_package( io_form ) == IO_PIO ) .OR. &
648 ( use_package( io_form ) == IO_PNETCDF ) ) THEN
649 CALL wrf_put_dom_ti_integer ( fid, 'SURFACE_INPUT_SOURCE', surface_input_source , 1 , ierr )
650 CALL wrf_put_dom_ti_integer ( fid, 'SST_UPDATE', sst_update , 1 , ierr )
651 CALL wrf_put_dom_ti_integer ( fid, 'GHG_INPUT', ghg_input , 1 , ierr )
653 CALL wrf_put_dom_ti_integer ( fid, 'GRID_FDDA', grid_fdda , 1 , ierr )
654 CALL wrf_put_dom_ti_integer ( fid, 'GFDDA_INTERVAL_M', gfdda_interval_m , 1 , ierr )
655 CALL wrf_put_dom_ti_integer ( fid, 'GFDDA_END_H', gfdda_end_h , 1 , ierr )
656 CALL wrf_put_dom_ti_integer ( fid, 'GRID_SFDDA', grid_sfdda , 1 , ierr )
657 CALL wrf_put_dom_ti_integer ( fid, 'SGFDDA_INTERVAL_M', sgfdda_interval_m , 1 , ierr )
658 CALL wrf_put_dom_ti_integer ( fid, 'SGFDDA_END_H', sgfdda_end_h , 1 , ierr )
659 CALL wrf_put_dom_ti_integer ( fid, 'HYPSOMETRIC_OPT', hypsometric_opt , 1 , ierr )
660 CALL wrf_put_dom_ti_integer ( fid, 'USE_THETA_M', use_theta_m , 1 , ierr )
661 IF ( switch .EQ. input_only) THEN
662 CALL wrf_put_dom_ti_integer ( fid, 'USE_MAXW_LEVEL', use_maxw_level , 1 , ierr )
663 CALL wrf_put_dom_ti_integer ( fid, 'USE_TROP_LEVEL', use_trop_level , 1 , ierr )
666 CALL wrf_put_dom_ti_integer ( fid, 'GWD_OPT' , ibuf , 1 , ierr )
667 CALL wrf_put_dom_ti_integer ( fid, 'SF_URBAN_PHYSICS', sf_urban_physics , 1 , ierr )
668 CALL wrf_put_dom_ti_integer ( fid, 'SF_SURFACE_MOSAIC', config_flags%sf_surface_mosaic , 1 , ierr )
669 CALL wrf_put_dom_ti_integer ( fid, 'SF_OCEAN_PHYSICS', config_flags%sf_ocean_physics , 1 , ierr )
672 IF ( switch .EQ. history_only ) THEN
673 CALL wrf_put_dom_ti_integer ( fid, 'SHCU_PHYSICS', config_flags%shcu_physics , 1 , ierr )
674 CALL wrf_put_dom_ti_integer ( fid, 'MFSHCONV', config_flags%mfshconv , 1 , ierr )
675 CALL wrf_put_dom_ti_integer ( fid, 'FEEDBACK', feedback , 1 , ierr )
676 CALL wrf_put_dom_ti_integer ( fid, 'SMOOTH_OPTION', smooth_option , 1 , ierr )
677 CALL wrf_put_dom_ti_real ( fid, 'SWRAD_SCAT', swrad_scat , 1 , ierr )
678 CALL wrf_put_dom_ti_integer ( fid, 'W_DAMPING', w_damping , 1 , ierr )
681 CALL wrf_put_dom_ti_real ( fid, 'DT' , dt, 1 , ierr)
682 IF ( grid%use_adaptive_time_step ) THEN
683 CALL wrf_put_dom_ti_real ( fid, 'ADAPT_DT_START' , adapt_dt_start, 1 , ierr)
684 CALL wrf_put_dom_ti_real ( fid, 'ADAPT_DT_MAX' , adapt_dt_max , 1 , ierr)
685 CALL wrf_put_dom_ti_real ( fid, 'ADAPT_DT_MIN' , adapt_dt_min , 1 , ierr)
689 call wrf_put_dom_ti_real ( fid, 'RADT', radt, 1 , ierr)
690 call wrf_put_dom_ti_real ( fid, 'BLDT', bldt, 1 , ierr)
691 call wrf_put_dom_ti_real ( fid, 'CUDT', cudt, 1 , ierr)
692 call wrf_put_dom_ti_integer ( fid, 'AER_OPT' , aer_opt , 1 , ierr)
693 call wrf_put_dom_ti_integer ( fid, 'SWINT_OPT' , swint_opt , 1 , ierr)
694 call wrf_put_dom_ti_integer ( fid, 'AER_TYPE' , aer_type , 1 , ierr )
695 call wrf_put_dom_ti_integer ( fid, 'AER_AOD550_OPT' , aer_aod550_opt , 1 , ierr )
696 call wrf_put_dom_ti_integer ( fid, 'AER_ANGEXP_OPT' , aer_angexp_opt , 1 , ierr )
697 call wrf_put_dom_ti_integer ( fid, 'AER_SSA_OPT' , aer_ssa_opt , 1 , ierr )
698 call wrf_put_dom_ti_integer ( fid, 'AER_ASY_OPT' , aer_asy_opt , 1 , ierr )
699 call wrf_put_dom_ti_real ( fid, 'AER_AOD550_VAL' , aer_aod550_val , 1 , ierr )
700 call wrf_put_dom_ti_real ( fid, 'AER_ANGEXP_VAL' , aer_angexp_val , 1 , ierr )
701 call wrf_put_dom_ti_real ( fid, 'AER_SSA_VAL' , aer_ssa_val , 1 , ierr )
702 call wrf_put_dom_ti_real ( fid, 'AER_ASY_VAL' , aer_asy_val , 1 , ierr )
705 CALL wrf_put_dom_ti_integer ( fid, 'MOIST_ADV_OPT', moist_adv_opt , 1 , ierr )
706 CALL wrf_put_dom_ti_integer ( fid, 'SCALAR_ADV_OPT', scalar_adv_opt , 1 , ierr )
707 CALL wrf_put_dom_ti_integer ( fid, 'TKE_ADV_OPT', tke_adv_opt , 1 , ierr )
708 CALL wrf_put_dom_ti_integer ( fid, 'DIFF_6TH_OPT', diff_6th_opt , 1 , ierr )
709 CALL wrf_put_dom_ti_real ( fid, 'DIFF_6TH_FACTOR', diff_6th_factor , 1 , ierr )
711 IF ( config_flags%topo_wind == 1 ) THEN
712 CALL wrf_put_dom_ti_integer ( fid, 'TOPO_WIND', config_flags%topo_wind , 1 , ierr )
714 IF ( grid_fdda == 1 ) THEN
715 CALL wrf_put_dom_ti_real ( fid, 'FGDT', fgdt , 1 , ierr )
716 CALL wrf_put_dom_ti_real ( fid, 'GUV', guv , 1 , ierr )
717 CALL wrf_put_dom_ti_real ( fid, 'GT', gt , 1 , ierr )
718 CALL wrf_put_dom_ti_real ( fid, 'GQ', gq , 1 , ierr )
719 CALL wrf_put_dom_ti_integer ( fid, 'IF_RAMPING', if_ramping , 1 , ierr )
720 CALL wrf_put_dom_ti_real ( fid, 'DTRAMP_MIN', dtramp_min , 1 , ierr )
723 IF ( grid_fdda == 2 ) THEN
724 CALL wrf_put_dom_ti_real ( fid, 'FGDT', fgdt , 1 , ierr )
725 CALL wrf_put_dom_ti_real ( fid, 'GUV', guv , 1 , ierr )
726 CALL wrf_put_dom_ti_real ( fid, 'GT', gt , 1 , ierr )
727 CALL wrf_put_dom_ti_real ( fid, 'GPH', gph , 1 , ierr )
728 CALL wrf_put_dom_ti_real ( fid, 'GQ', gq , 1 , ierr )
729 CALL wrf_put_dom_ti_integer ( fid, 'IF_RAMPING', if_ramping , 1 , ierr )
730 CALL wrf_put_dom_ti_real ( fid, 'DTRAMP_MIN', dtramp_min , 1 , ierr )
733 IF ( grid_sfdda >= 1 ) THEN
734 CALL wrf_put_dom_ti_real ( fid, 'GUV_SFC', guv_sfc , 1 , ierr )
735 CALL wrf_put_dom_ti_real ( fid, 'GT_SFC', gt_sfc , 1 , ierr )
736 CALL wrf_put_dom_ti_real ( fid, 'GQ_SFC', gq_sfc , 1 , ierr )
737 CALL wrf_put_dom_ti_real ( fid, 'RINBLW', rinblw , 1 , ierr )
740 CALL wrf_put_dom_ti_integer ( fid, 'OBS_NUDGE_OPT', obs_nudge_opt , 1 , ierr )
741 IF ( obs_nudge_opt == 1 ) THEN
742 CALL wrf_put_dom_ti_real ( fid, 'FDDA_END', fdda_end , 1 , ierr )
743 CALL wrf_put_dom_ti_integer ( fid, 'OBS_NUDGE_WIND', obs_nudge_wind , 1 , ierr )
744 CALL wrf_put_dom_ti_real ( fid, 'OBS_COEF_WIND', obs_coef_wind , 1 , ierr )
745 CALL wrf_put_dom_ti_integer ( fid, 'OBS_NUDGE_TEMP', obs_nudge_temp , 1 , ierr )
746 CALL wrf_put_dom_ti_real ( fid, 'OBS_COEF_TEMP', obs_coef_temp , 1 , ierr )
747 CALL wrf_put_dom_ti_integer ( fid, 'OBS_NUDGE_MOIS', obs_nudge_mois , 1 , ierr )
748 CALL wrf_put_dom_ti_real ( fid, 'OBS_COEF_MOIS', obs_coef_mois , 1 , ierr )
749 CALL wrf_put_dom_ti_integer ( fid, 'OBS_NUDGE_PSTR', obs_nudge_pstr , 1 , ierr )
750 CALL wrf_put_dom_ti_real ( fid, 'OBS_COEF_PSTR', obs_coef_pstr , 1 , ierr )
751 CALL wrf_put_dom_ti_integer ( fid, 'OBS_IONF', obs_ionf , 1 , ierr )
752 CALL wrf_put_dom_ti_integer ( fid, 'OBS_IDYNIN', obs_idynin , 1 , ierr )
753 CALL wrf_put_dom_ti_real ( fid, 'OBS_DTRAMP', obs_dtramp , 1 , ierr )
756 CALL wrf_put_dom_ti_real ( fid, 'BUCKET_MM', config_flags%bucket_mm , 1 , ierr )
757 CALL wrf_put_dom_ti_real ( fid, 'BUCKET_J', config_flags%bucket_J , 1 , ierr )
758 CALL wrf_put_dom_ti_real ( fid, 'PREC_ACC_DT', config_flags%prec_acc_dt , 1 , ierr )
759 CALL wrf_put_dom_ti_integer ( fid, 'ISFTCFLX', config_flags%isftcflx , 1 , ierr )
760 CALL wrf_put_dom_ti_integer ( fid, 'ISHALLOW', config_flags%ishallow , 1 , ierr )
761 CALL wrf_put_dom_ti_integer ( fid, 'ISFFLX', config_flags%isfflx , 1 , ierr )
762 CALL wrf_put_dom_ti_integer ( fid, 'ICLOUD', config_flags%icloud , 1 , ierr )
763 CALL wrf_put_dom_ti_integer ( fid, 'ICLOUD_CU', config_flags%icloud_cu , 1 , ierr )
764 CALL wrf_put_dom_ti_integer ( fid, 'TRACER_PBLMIX', tracer_pblmix , 1 , ierr )
765 CALL wrf_put_dom_ti_integer ( fid, 'SCALAR_PBLMIX', scalar_pblmix , 1 , ierr )
766 CALL wrf_put_dom_ti_integer ( fid, 'YSU_TOPDOWN_PBLMIX', ysu_topdown_pblmix , 1 , ierr )
767 CALL wrf_put_dom_ti_integer ( fid, 'GRAV_SETTLING', grav_settling , 1 , ierr )
768 CALL wrf_put_dom_ti_integer ( fid, 'CLDOVRLP', config_flags%cldovrlp , 1 , ierr )
769 CALL wrf_put_dom_ti_integer ( fid, 'IDCOR', config_flags%idcor , 1 , ierr )
773 IF ( sf_surface_physics == 4 ) THEN
774 CALL wrf_put_dom_ti_integer ( fid, 'OPT_SFC', config_flags%opt_sfc , 1 , ierr )
775 CALL wrf_put_dom_ti_integer ( fid, 'DVEG', config_flags%dveg , 1 , ierr )
776 CALL wrf_put_dom_ti_integer ( fid, 'OPT_CRS', config_flags%opt_crs , 1 , ierr )
777 CALL wrf_put_dom_ti_integer ( fid, 'OPT_BTR', config_flags%opt_btr , 1 , ierr )
778 CALL wrf_put_dom_ti_integer ( fid, 'OPT_RUN', config_flags%opt_run , 1 , ierr )
779 CALL wrf_put_dom_ti_integer ( fid, 'OPT_FRZ', config_flags%opt_frz , 1 , ierr )
780 CALL wrf_put_dom_ti_integer ( fid, 'OPT_INF', config_flags%opt_inf , 1 , ierr )
781 CALL wrf_put_dom_ti_integer ( fid, 'OPT_RAD', config_flags%opt_rad , 1 , ierr )
782 CALL wrf_put_dom_ti_integer ( fid, 'OPT_ALB', config_flags%opt_alb , 1 , ierr )
783 CALL wrf_put_dom_ti_integer ( fid, 'OPT_SNF', config_flags%opt_snf , 1 , ierr )
784 CALL wrf_put_dom_ti_integer ( fid, 'OPT_TBOT', config_flags%opt_tbot , 1 , ierr )
785 CALL wrf_put_dom_ti_integer ( fid, 'OPT_STC', config_flags%opt_stc , 1 , ierr )
786 CALL wrf_put_dom_ti_integer ( fid, 'OPT_GLA', config_flags%opt_gla , 1 , ierr )
787 CALL wrf_put_dom_ti_integer ( fid, 'OPT_RSF', config_flags%opt_rsf , 1 , ierr )
788 CALL wrf_put_dom_ti_integer ( fid, 'OPT_SOIL', config_flags%opt_soil , 1 , ierr )
789 CALL wrf_put_dom_ti_integer ( fid, 'OPT_PEDO', config_flags%opt_pedo , 1 , ierr )
790 CALL wrf_put_dom_ti_integer ( fid, 'OPT_CROP', config_flags%opt_crop , 1 , ierr )
791 CALL wrf_put_dom_ti_integer ( fid, 'OPT_IRR', config_flags%opt_irr , 1 , ierr )
792 CALL wrf_put_dom_ti_integer ( fid, 'OPT_IRRM', config_flags%opt_irrm , 1 , ierr )
795 CALL wrf_put_dom_ti_integer ( fid, 'DFI_OPT', config_flags%dfi_opt , 1 , ierr )
796 CALL wrf_put_dom_ti_integer ( fid, 'NTASKS_X', ntasks_x , 1 , ierr )
797 CALL wrf_put_dom_ti_integer ( fid, 'NTASKS_Y', ntasks_y , 1 , ierr )
798 CALL wrf_put_dom_ti_integer ( fid, 'NTASKS_TOTAL', ntasks_x*ntasks_y , 1 , ierr )
802 #if (WRF_CHEM == 1 && WRF_KPP == 1)
803 IF ( switch == auxhist9_only .and. config_flags%irr_opt /= 0 ) THEN
804 CALL nl_get_chemdt( grid%id, chemdt )
805 CALL wrf_put_dom_ti_real( fid, 'CHEMDT' , chemdt, 1 , ierr)
809 #if (EM_CORE == 1) && ( DA_CORE != 1)
810 IF ( ( switch .EQ. input_only ) .OR. &
811 ( switch .EQ. history_only ) .OR. &
812 ( switch .EQ. restart_only ) ) THEN
813 IF ( grid%this_is_an_ideal_run ) THEN
814 CALL wrf_put_dom_ti_char ( fid , 'SIMULATION_INITIALIZATION_TYPE', "IDEALIZED DATA" , ierr )
816 CALL wrf_put_dom_ti_char ( fid , 'SIMULATION_INITIALIZATION_TYPE', "REAL-DATA CASE" , ierr )
822 ! added these fields for use by reassembly programs , 010831, JM
823 ! modified these fields so "patch" == "domain" when multi-file output
824 ! formats are not used. 051018, TBH
826 ibuf(1) = MAX(ips,ids)
827 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = ids
828 CALL wrf_put_dom_ti_integer ( fid , 'WEST-EAST_PATCH_START_UNSTAG' , ibuf , 1 , ierr )
829 ibuf(1) = MIN(ipe,ide-1)
830 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = ide - 1
831 CALL wrf_put_dom_ti_integer ( fid , 'WEST-EAST_PATCH_END_UNSTAG' , ibuf , 1 , ierr )
832 ibuf(1) = MAX(ips,ids)
833 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = ids
834 CALL wrf_put_dom_ti_integer ( fid , 'WEST-EAST_PATCH_START_STAG' , ibuf , 1 , ierr )
835 ibuf(1) = MIN(ipe,ide)
836 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = ide
837 CALL wrf_put_dom_ti_integer ( fid , 'WEST-EAST_PATCH_END_STAG' , ibuf , 1 , ierr )
838 ibuf(1) = MAX(jps,jds)
839 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = jds
840 CALL wrf_put_dom_ti_integer ( fid , 'SOUTH-NORTH_PATCH_START_UNSTAG' , ibuf , 1 , ierr )
841 ibuf(1) = MIN(jpe,jde-1)
842 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = jde - 1
843 CALL wrf_put_dom_ti_integer ( fid , 'SOUTH-NORTH_PATCH_END_UNSTAG' , ibuf , 1 , ierr )
844 ibuf(1) = MAX(jps,jds)
845 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = jds
846 CALL wrf_put_dom_ti_integer ( fid , 'SOUTH-NORTH_PATCH_START_STAG' , ibuf , 1 , ierr )
847 ibuf(1) = MIN(jpe,jde)
848 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = jde
849 CALL wrf_put_dom_ti_integer ( fid , 'SOUTH-NORTH_PATCH_END_STAG' , ibuf , 1 , ierr )
851 ibuf(1) = MAX(kps,kds)
852 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = kds
853 CALL wrf_put_dom_ti_integer ( fid , 'BOTTOM-TOP_PATCH_START_UNSTAG' , ibuf , 1 , ierr )
854 ibuf(1) = MIN(kpe,kde-1)
855 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = kde - 1
856 CALL wrf_put_dom_ti_integer ( fid , 'BOTTOM-TOP_PATCH_END_UNSTAG' , ibuf , 1 , ierr )
857 ibuf(1) = MAX(kps,kds)
858 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = kds
859 CALL wrf_put_dom_ti_integer ( fid , 'BOTTOM-TOP_PATCH_START_STAG' , ibuf , 1 , ierr )
860 ibuf(1) = MIN(kpe,kde)
861 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = kde
862 CALL wrf_put_dom_ti_integer ( fid , 'BOTTOM-TOP_PATCH_END_STAG' , ibuf , 1 , ierr )
865 CALL wrf_put_dom_ti_integer ( fid , 'GRID_ID' , ibuf , 1 , ierr )
867 CALL wrf_put_dom_ti_integer ( fid , 'PARENT_ID' , ibuf , 1 , ierr )
868 ibuf(1) = i_parent_start
869 CALL wrf_put_dom_ti_integer ( fid , 'I_PARENT_START' , ibuf , 1 , ierr )
870 ibuf(1) = j_parent_start
871 CALL wrf_put_dom_ti_integer ( fid , 'J_PARENT_START' , ibuf , 1 , ierr )
872 ibuf(1) = parent_grid_ratio
873 CALL wrf_put_dom_ti_integer ( fid , 'PARENT_GRID_RATIO' , ibuf , 1 , ierr )
879 CALL wrf_put_dom_ti_real ( fid , 'DX' , config_flags%dx , 1 , ierr )
880 CALL wrf_put_dom_ti_real ( fid , 'DY' , config_flags%dy , 1 , ierr )
882 ! Updated by T. Hutchinson to use adaptive time step.
883 CALL wrf_put_dom_ti_real ( fid , 'DT' , grid%dt , 1 , ierr )
884 ! CALL wrf_put_dom_ti_real ( fid , 'DT' , config%dt , 1 , ierr )
885 CALL wrf_put_dom_ti_real ( fid , 'CEN_LAT' , config_flags%cen_lat , 1 , ierr )
886 CALL wrf_put_dom_ti_real ( fid , 'CEN_LON' , config_flags%cen_lon , 1 , ierr )
887 CALL wrf_put_dom_ti_real ( fid , 'TRUELAT1', config_flags%truelat1, 1 , ierr )
888 CALL wrf_put_dom_ti_real ( fid , 'TRUELAT2', config_flags%truelat2, 1 , ierr )
889 CALL wrf_put_dom_ti_real ( fid , 'MOAD_CEN_LAT', config_flags%moad_cen_lat, 1 , ierr )
890 CALL wrf_put_dom_ti_real ( fid , 'STAND_LON', config_flags%stand_lon, 1 , ierr )
892 CALL wrf_put_dom_ti_real ( fid , 'POLE_LAT', config_flags%pole_lat, 1 , ierr )
893 CALL wrf_put_dom_ti_real ( fid , 'POLE_LON', config_flags%pole_lon, 1 , ierr )
895 IF ( switch .NE. boundary_only .AND. switch .NE. auxinput9_only .AND. switch .NE. auxinput10_only ) THEN
897 ! When writing to restart files, use the values of the instantaneous
898 ! time for determining the values of JULYR, JULDAY, and GMT. If the
899 ! original values in config_flags are used, this assumes that the
900 ! restart simulation will start with an itimestep NE 0. If we use
901 ! the instantaneous time, we can start a restart simulation with a
902 ! different value of delta-t for timestep and still get the clocks
903 ! calendars (and orbital information!) correct.
905 ! Current time is still defined from above call to WRF_UTIL_ClockGet
906 CALL WRFU_TimeGet( currentTime, YY=julyr, dayOfYear=julday, H=p_hr, M=p_min, S=p_sec, MS=p_ms, rc=rc)
907 WRITE(wrf_err_message,*)'output_wrf: julyr,julday,hr,min,sec,ms = ',julyr,julday,p_hr,p_min,p_sec,p_ms
908 CALL wrf_debug( 100 , wrf_err_message )
909 gmt = REAL(p_hr)+REAL(p_min)/60.+REAL(p_sec)/3600.+REAL(p_ms)/3600000.
910 CALL wrf_put_dom_ti_real ( fid , 'GMT' , gmt , 1 , ierr )
911 CALL wrf_put_dom_ti_integer ( fid , 'JULYR' , julyr , 1 , ierr )
912 CALL wrf_put_dom_ti_integer ( fid , 'JULDAY' , julday , 1 , ierr )
914 CALL wrf_put_dom_ti_real ( fid , 'GMT' , config_flags%gmt , 1 , ierr )
915 CALL wrf_put_dom_ti_integer ( fid , 'JULYR' , config_flags%julyr , 1 , ierr )
916 CALL wrf_put_dom_ti_integer ( fid , 'JULDAY' , config_flags%julday , 1 , ierr )
920 CALL wrf_put_dom_ti_integer ( fid , 'MAP_PROJ' , config_flags%map_proj , 1 , ierr )
921 IF ( config_flags%map_proj .EQ. 0 ) THEN
922 CALL wrf_put_dom_ti_char ( fid , 'MAP_PROJ_CHAR' , "Cartesian" , ierr )
923 ELSE IF ( config_flags%map_proj .EQ. 1 ) THEN
924 CALL wrf_put_dom_ti_char ( fid , 'MAP_PROJ_CHAR' , "Lambert Conformal" , ierr )
925 ELSE IF ( config_flags%map_proj .EQ. 2 ) THEN
926 CALL wrf_put_dom_ti_char ( fid , 'MAP_PROJ_CHAR' , "Polar Stereographic" , ierr )
927 ELSE IF ( config_flags%map_proj .EQ. 3 ) THEN
928 CALL wrf_put_dom_ti_char ( fid , 'MAP_PROJ_CHAR' , "Mercator" , ierr )
929 ELSE IF ( config_flags%map_proj .EQ. 6 ) THEN
930 CALL wrf_put_dom_ti_char ( fid , 'MAP_PROJ_CHAR' , "Cylindrical Equidistant" , ierr )
931 ELSE IF ( config_flags%map_proj .EQ. 203 ) THEN
932 CALL wrf_put_dom_ti_char ( fid , 'MAP_PROJ_CHAR' , "NMM Rotated Lat Lon" , ierr )
935 IF(MMINLU(1:4) == 'USGS') THEN
939 IF(MMINLU(1:1) .EQ. " ")THEN
940 CALL wrf_put_dom_ti_char ( fid , 'MMINLU', " " , ierr )
942 CALL wrf_put_dom_ti_char ( fid , 'MMINLU', TRIM(mminlu) , ierr )
944 call wrf_put_dom_ti_integer ( fid , 'NUM_LAND_CAT', config_flags%num_land_cat, 1, ierr)
945 CALL wrf_put_dom_ti_integer ( fid , 'ISWATER' , iswater , 1 , ierr )
946 CALL wrf_put_dom_ti_integer ( fid , 'ISLAKE' , islake , 1 , ierr )
947 ! CALL wrf_put_dom_ti_integer ( fid , 'ISWATER' , config_flags%iswater , 1 , ierr )
948 CALL wrf_put_dom_ti_integer ( fid , 'ISICE' , config_flags%isice , 1 , ierr )
949 CALL wrf_put_dom_ti_integer ( fid , 'ISURBAN' , config_flags%isurban , 1 , ierr )
950 CALL wrf_put_dom_ti_integer ( fid , 'ISOILWATER' , config_flags%isoilwater , 1 , ierr )
951 ! added these fields for restarting of moving nests, JM
952 #if ! defined(EM_CORE)
953 CALL wrf_put_dom_ti_integer ( fid , 'I_PARENT_START' , config_flags%i_parent_start , 1 , ierr )
954 CALL wrf_put_dom_ti_integer ( fid , 'J_PARENT_START' , config_flags%j_parent_start , 1 , ierr )
957 IF ( switch .EQ. boundary_only ) THEN
958 CALL WRFU_TimeIntervalSet( bdy_increment, S=NINT(config_flags%bdyfrq),rc=rc)
959 next_time = currentTime + bdy_increment
960 CALL wrf_timetoa ( next_time, next_datestr )
961 CALL wrf_put_dom_td_char ( fid , 'THISBDYTIME' , current_date(1:19), current_date(1:19), ierr )
962 CALL wrf_put_dom_td_char ( fid , 'NEXTBDYTIME' , current_date(1:19), next_datestr(1:19), ierr )
965 ! Add the hybrid vertical coordinate metadata.
968 CALL wrf_put_dom_ti_integer ( fid , 'HYBRID_OPT', hybrid_opt , 1 , ierr )
969 CALL wrf_put_dom_ti_real ( fid , 'ETAC' , etac , 1 , ierr )
972 ! added grib2-specific metadata: Todd Hutchinson 8/21/2005
973 IF ( use_package( io_form ) == IO_GRIB2 ) THEN
974 CALL wrf_put_dom_ti_integer ( fid , 'BACKGROUND_PROC_ID' , config_flags%background_proc_id , 1 , ierr )
975 CALL wrf_put_dom_ti_integer ( fid , 'FORECAST_PROC_ID' , config_flags%forecast_proc_id , 1 , ierr )
976 CALL wrf_put_dom_ti_integer ( fid , 'PRODUCTION_STATUS' , config_flags%production_status , 1 , ierr )
977 CALL wrf_put_dom_ti_integer ( fid , 'COMPRESSION' , config_flags%compression , 1 , ierr )
980 #if ( (EM_CORE == 1) && (DA_CORE != 1) )
981 save_topo_orig = grid%save_topo_from_real
984 IF ( (first_history .LE. switch .AND. switch .LE. last_history ) .OR. &
985 ( (switch .EQ. input_only) .AND. &
986 (program_name(1:7) .NE. 'REAL_EM') .AND. &
987 (grid%dfi_opt .EQ. DFI_NODFI ) ) .OR. &
988 ( switch .EQ. restart_only ) ) THEN
990 ! This flag sets the switch which defines the topography as the original
991 ! generated by real.exe. The "zero" value means that for the WRF model
992 ! output, the topography has been modified. All output from the ARW
993 ! WRF model has this flag set. However, to allow nests to still be
994 ! instantiated after a parent does IO, and to allow that nest domain
995 ! to have the topo adjusted, we save the incoming value of the save_topo
998 grid%save_topo_from_real=0
1002 IF ( (first_input .LE. switch .AND. switch .LE. last_input) .OR. &
1003 (first_history .LE. switch .AND. switch .LE. last_history ) .OR. &
1004 switch .EQ. restart_only ) THEN
1006 p => grid%head_statevars%next
1007 DO WHILE ( ASSOCIATED( p ) )
1008 IF ( p%ProcOrient .NE. 'X' .AND. p%ProcOrient .NE. 'Y' ) THEN ! no I/O for xposed variables
1009 IF (wrf_at_debug_level(290))then
1010 ! Jan Mandel, 3/17/2020
1011 WRITE(message,*)"ouput_WRF: ",trim(p%VarName)," Ndim:",p%Ndim, &
1012 " in_use_for_config:",in_use_for_config(grid%id,TRIM(p%VarName)), &
1013 " for restart:", p%Restart, switch.EQ.restart_only, &
1014 " on_stream:",on_stream(p%streams,newswitch)
1015 CALL wrf_debug(1,TRIM(message))
1017 IF ( p%Ndim .EQ. 0 ) THEN
1018 IF ((p%Restart.AND.switch.EQ.restart_only).OR.on_stream(p%streams,newswitch)) THEN
1019 IF ( in_use_for_config(grid%id,TRIM(p%VarName)) ) THEN
1021 IF (p%Ntl.GT.0.AND.switch.NE.restart_only)dname=dname(1:len(TRIM(dname))-2)
1022 memord = p%MemoryOrder
1025 ! CF compliancy would have us put the string "minutes since" // simulation_start_date
1026 ! as the ouput in the units attribute. After the WRF p%Units string has the "minutes since"
1027 ! substring, we wipe out the rest of the string and add the model's original (pre-restart)
1028 ! starting date. This is only for the time variable in WRF (XTIME), which is now considered
1029 ! the time coordinate in netcdf.
1031 IF (TRIM(p%DataName).EQ."XTIME") THEN
1032 WRITE ( simulation_start_date , FMT = '(I4.4,"-",I2.2,"-",I2.2," ",I2.2,":",I2.2,":",I2.2)' ) &
1033 simulation_start_year,simulation_start_month,simulation_start_day,&
1034 simulation_start_hour,simulation_start_minute,simulation_start_second
1035 IF ( TRIM(p%Description(1:14)) .EQ. 'minutes since ' ) THEN
1036 p%Description(15:33) = TRIM(simulation_start_date)
1037 p%Units (15:33) = TRIM(simulation_start_date)
1042 IF ( p%Type .EQ. 'r' ) THEN
1043 CALL wrf_ext_write_field ( &
1044 fid , & ! DataHandle
1045 current_date(1:19) , & ! DateStr
1046 TRIM(p%DataName) , & ! Data Name
1047 p%rfield_0d , & ! Field
1048 WRF_FLOAT , & ! FieldType
1050 grid%domdesc , & ! Comm
1051 grid%bdy_mask , & ! bdy_mask
1053 '0' , & ! MemoryOrder
1058 TRIM(p%Description) , & ! Desc
1059 TRIM(p%Units) , & ! Units
1060 "<stdin>" // ' writing 0d real ' // TRIM(p%VarName) , & ! Debug message
1061 1 , 1 , 1 , 1 , 1 , 1 , &
1062 1 , 1 , 1 , 1 , 1 , 1 , &
1063 1 , 1 , 1 , 1 , 1 , 1 , &
1065 ELSE IF ( p%Type .EQ. 'd' ) THEN
1066 CALL wrf_ext_write_field ( &
1067 fid , & ! DataHandle
1068 current_date(1:19) , & ! DateStr
1069 TRIM(p%DataName) , & ! Data Name
1070 p%dfield_0d , & ! Field
1071 WRF_DOUBLE , & ! FieldType
1073 grid%domdesc , & ! Comm
1074 grid%bdy_mask , & ! bdy_mask
1076 '0' , & ! MemoryOrder
1081 TRIM(p%Description) , & ! Desc
1082 TRIM(p%Units) , & ! Units
1083 "<stdin>" // ' writing 0d double ' // TRIM(p%VarName) , & ! Debug message
1084 1 , 1 , 1 , 1 , 1 , 1 , &
1085 1 , 1 , 1 , 1 , 1 , 1 , &
1086 1 , 1 , 1 , 1 , 1 , 1 , &
1088 ELSE IF ( p%Type .EQ. 'i' ) THEN
1089 CALL wrf_ext_write_field ( &
1090 fid , & ! DataHandle
1091 current_date(1:19) , & ! DateStr
1092 TRIM(p%DataName) , & ! Data Name
1093 p%ifield_0d , & ! Field
1094 WRF_INTEGER , & ! FieldType
1096 grid%domdesc , & ! Comm
1097 grid%bdy_mask , & ! bdy_mask
1099 '0' , & ! MemoryOrder
1104 TRIM(p%Description) , & ! Desc
1105 TRIM(p%Units) , & ! Units
1106 "<stdin>" // ' writing 0d integer ' // TRIM(p%VarName) , & ! Debug message
1107 1 , 1 , 1 , 1 , 1 , 1 , &
1108 1 , 1 , 1 , 1 , 1 , 1 , &
1109 1 , 1 , 1 , 1 , 1 , 1 , &
1111 ELSE IF ( p%Type .EQ. 'l' ) THEN
1112 CALL wrf_ext_write_field ( &
1113 fid , & ! DataHandle
1114 current_date(1:19) , & ! DateStr
1115 TRIM(p%DataName) , & ! Data Name
1116 p%lfield_0d , & ! Field
1117 WRF_LOGICAL , & ! FieldType
1119 grid%domdesc , & ! Comm
1120 grid%bdy_mask , & ! bdy_mask
1122 '0' , & ! MemoryOrder
1127 TRIM(p%Description) , & ! Desc
1128 TRIM(p%Units) , & ! Units
1129 "<stdin>" // ' writing 0d logical ' // TRIM(p%VarName) , & ! Debug message
1130 1 , 1 , 1 , 1 , 1 , 1 , &
1131 1 , 1 , 1 , 1 , 1 , 1 , &
1132 1 , 1 , 1 , 1 , 1 , 1 , &
1137 ELSE IF ( p%Ndim .EQ. 1 ) THEN
1138 IF ((p%Restart.AND.switch.EQ.restart_only).OR.on_stream(p%streams,newswitch)) THEN
1139 IF ( in_use_for_config(grid%id,TRIM(p%VarName)) ) THEN
1140 IF (switch.EQ.restart_only.OR.p%Ntl/100.EQ.mod(p%Ntl,100)) THEN
1142 IF (p%Ntl.GT.0.AND.switch.NE.restart_only)dname=dname(1:len(TRIM(dname))-2)
1143 memord = p%MemoryOrder
1144 IF ( p%Type .EQ. 'r' ) THEN
1145 CALL wrf_ext_write_field ( &
1146 fid , & ! DataHandle
1147 current_date(1:19) , & ! DateStr
1148 TRIM(dname) , & ! Data Name
1149 p%rfield_1d , & ! Field
1150 WRF_FLOAT , & ! FieldType
1152 grid%domdesc , & ! Comm
1153 grid%bdy_mask , & ! bdy_mask
1155 TRIM(memord) , & ! MemoryOrder
1156 TRIM(p%Stagger) , & ! Stagger
1157 TRIM(p%dimname1) , & ! Dimname 1
1158 TRIM(p%dimname2) , & ! Dimname 2
1159 TRIM(p%dimname3) , & ! Dimname 3
1160 TRIM(p%Description) , & ! Desc
1161 TRIM(p%Units) , & ! Units
1162 "<stdin>" // ' writing 1d real ' // TRIM(p%VarName) , & ! Debug message
1163 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1164 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1165 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1167 ELSE IF ( p%Type .EQ. 'd' ) THEN
1168 CALL wrf_ext_write_field ( &
1169 fid , & ! DataHandle
1170 current_date(1:19) , & ! DateStr
1171 TRIM(dname) , & ! Data Name
1172 p%dfield_1d , & ! Field
1173 WRF_DOUBLE , & ! FieldType
1175 grid%domdesc , & ! Comm
1176 grid%bdy_mask , & ! bdy_mask
1178 TRIM(memord) , & ! MemoryOrder
1179 TRIM(p%Stagger) , & ! Stagger
1180 TRIM(p%dimname1) , & ! Dimname 1
1181 TRIM(p%dimname2) , & ! Dimname 2
1182 TRIM(p%dimname3) , & ! Dimname 3
1183 TRIM(p%Description) , & ! Desc
1184 TRIM(p%Units) , & ! Units
1185 "<stdin>" // ' writing 1d double ' // TRIM(p%VarName) , & ! Debug message
1186 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1187 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1188 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1190 ELSE IF ( p%Type .EQ. 'i' ) THEN
1191 CALL wrf_ext_write_field ( &
1192 fid , & ! DataHandle
1193 current_date(1:19) , & ! DateStr
1194 TRIM(dname) , & ! Data Name
1195 p%ifield_1d , & ! Field
1196 WRF_INTEGER , & ! FieldType
1198 grid%domdesc , & ! Comm
1199 grid%bdy_mask , & ! bdy_mask
1201 TRIM(memord) , & ! MemoryOrder
1202 TRIM(p%Stagger) , & ! Stagger
1203 TRIM(p%dimname1) , & ! Dimname 1
1204 TRIM(p%dimname2) , & ! Dimname 2
1205 TRIM(p%dimname3) , & ! Dimname 3
1206 TRIM(p%Description) , & ! Desc
1207 TRIM(p%Units) , & ! Units
1208 "<stdin>" // ' writing 1d integer ' // TRIM(p%VarName) , & ! Debug message
1209 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1210 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1211 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1213 ELSE IF ( p%Type .EQ. 'l' ) THEN
1214 CALL wrf_ext_write_field ( &
1215 fid , & ! DataHandle
1216 current_date(1:19) , & ! DateStr
1217 TRIM(dname) , & ! Data Name
1218 p%lfield_1d , & ! Field
1219 WRF_LOGICAL , & ! FieldType
1221 grid%domdesc , & ! Comm
1222 grid%bdy_mask , & ! bdy_mask
1224 TRIM(memord) , & ! MemoryOrder
1225 TRIM(p%Stagger) , & ! Stagger
1226 TRIM(p%dimname1) , & ! Dimname 1
1227 TRIM(p%dimname2) , & ! Dimname 2
1228 TRIM(p%dimname3) , & ! Dimname 3
1229 TRIM(p%Description) , & ! Desc
1230 TRIM(p%Units) , & ! Units
1231 "<stdin>" // ' writing 1d logical ' // TRIM(p%VarName) , & ! Debug message
1232 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1233 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1234 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1240 ELSE IF ( p%Ndim .EQ. 2 ) THEN
1241 IF ((p%Restart.AND.switch.EQ.restart_only).OR.on_stream(p%streams,newswitch)) THEN
1242 IF ( in_use_for_config(grid%id,TRIM(p%VarName)) .AND. &
1243 ( .NOT. p%subgrid_x .OR. (p%subgrid_x .AND. grid%sr_x .GT. 0) ) .AND. &
1244 ( .NOT. p%subgrid_y .OR. (p%subgrid_y .AND. grid%sr_y .GT. 0) ) &
1246 IF (switch.EQ.restart_only.OR.p%Ntl/100.EQ.mod(p%Ntl,100)) THEN
1248 IF (p%Ntl.GT.0.AND.switch.NE.restart_only)dname=dname(1:len(TRIM(dname))-2)
1249 memord = p%MemoryOrder
1250 IF ( p%Type .EQ. 'r' ) THEN
1251 CALL wrf_ext_write_field ( &
1252 fid , & ! DataHandle
1253 current_date(1:19) , & ! DateStr
1254 TRIM(dname) , & ! Data Name
1255 p%rfield_2d , & ! Field
1256 WRF_FLOAT , & ! FieldType
1258 grid%domdesc , & ! Comm
1259 grid%bdy_mask , & ! bdy_mask
1261 TRIM(memord) , & ! MemoryOrder
1262 TRIM(p%Stagger) , & ! Stagger
1263 TRIM(p%dimname1) , & ! Dimname 1
1264 TRIM(p%dimname2) , & ! Dimname 2
1265 TRIM(p%dimname3) , & ! Dimname 3
1266 TRIM(p%Description) , & ! Desc
1267 TRIM(p%Units) , & ! Units
1268 "<stdin>" // ' writing 2d real ' // TRIM(p%VarName) , & ! Debug message
1269 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1270 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1271 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1273 ELSE IF ( p%Type .EQ. 'd' ) THEN
1274 CALL wrf_ext_write_field ( &
1275 fid , & ! DataHandle
1276 current_date(1:19) , & ! DateStr
1277 TRIM(dname) , & ! Data Name
1278 p%dfield_2d , & ! Field
1279 WRF_DOUBLE , & ! FieldType
1281 grid%domdesc , & ! Comm
1282 grid%bdy_mask , & ! bdy_mask
1284 TRIM(memord) , & ! MemoryOrder
1285 TRIM(p%Stagger) , & ! Stagger
1286 TRIM(p%dimname1) , & ! Dimname 1
1287 TRIM(p%dimname2) , & ! Dimname 2
1288 TRIM(p%dimname3) , & ! Dimname 3
1289 TRIM(p%Description) , & ! Desc
1290 TRIM(p%Units) , & ! Units
1291 "<stdin>" // ' writing 2d double ' // TRIM(p%VarName) , & ! Debug message
1292 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1293 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1294 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1296 ELSE IF ( p%Type .EQ. 'i' ) THEN
1297 CALL wrf_ext_write_field ( &
1298 fid , & ! DataHandle
1299 current_date(1:19) , & ! DateStr
1300 TRIM(dname) , & ! Data Name
1301 p%ifield_2d , & ! Field
1302 WRF_INTEGER , & ! FieldType
1304 grid%domdesc , & ! Comm
1305 grid%bdy_mask , & ! bdy_mask
1307 TRIM(memord) , & ! MemoryOrder
1308 TRIM(p%Stagger) , & ! Stagger
1309 TRIM(p%dimname1) , & ! Dimname 1
1310 TRIM(p%dimname2) , & ! Dimname 2
1311 TRIM(p%dimname3) , & ! Dimname 3
1312 TRIM(p%Description) , & ! Desc
1313 TRIM(p%Units) , & ! Units
1314 "<stdin>" // ' writing 2d integer ' // TRIM(p%VarName) , & ! Debug message
1315 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1316 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1317 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1319 ELSE IF ( p%Type .EQ. 'l' ) THEN
1320 CALL wrf_ext_write_field ( &
1321 fid , & ! DataHandle
1322 current_date(1:19) , & ! DateStr
1323 TRIM(dname) , & ! Data Name
1324 p%lfield_2d , & ! Field
1325 WRF_LOGICAL , & ! FieldType
1327 grid%domdesc , & ! Comm
1328 grid%bdy_mask , & ! bdy_mask
1330 TRIM(memord) , & ! MemoryOrder
1331 TRIM(p%Stagger) , & ! Stagger
1332 TRIM(p%dimname1) , & ! Dimname 1
1333 TRIM(p%dimname2) , & ! Dimname 2
1334 TRIM(p%dimname3) , & ! Dimname 3
1335 TRIM(p%Description) , & ! Desc
1336 TRIM(p%Units) , & ! Units
1337 "<stdin>" // ' writing 2d logical ' // TRIM(p%VarName) , & ! Debug message
1338 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1339 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1340 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1346 ELSE IF ( p%Ndim .EQ. 3 ) THEN
1347 IF ((p%Restart.AND.switch.EQ.restart_only).OR.on_stream(p%streams,newswitch)) THEN
1348 IF ( in_use_for_config(grid%id,TRIM(p%VarName)) .AND. &
1349 ( .NOT. p%subgrid_x .OR. (p%subgrid_x .AND. grid%sr_x .GT. 0) ) .AND. &
1350 ( .NOT. p%subgrid_y .OR. (p%subgrid_y .AND. grid%sr_y .GT. 0) ) &
1352 IF (switch.EQ.restart_only.OR.p%Ntl/100.EQ.mod(p%Ntl,100)) THEN
1354 IF (p%Ntl.GT.0.AND.switch.NE.restart_only)dname=dname(1:len(TRIM(dname))-2)
1355 memord = p%MemoryOrder
1356 IF ( p%Type .EQ. 'r' ) THEN
1357 CALL wrf_ext_write_field ( &
1358 fid , & ! DataHandle
1359 current_date(1:19) , & ! DateStr
1360 TRIM(dname) , & ! Data Name
1361 p%rfield_3d , & ! Field
1362 WRF_FLOAT , & ! FieldType
1364 grid%domdesc , & ! Comm
1365 grid%bdy_mask , & ! bdy_mask
1367 TRIM(memord) , & ! MemoryOrder
1368 TRIM(p%Stagger) , & ! Stagger
1369 TRIM(p%dimname1) , & ! Dimname 1
1370 TRIM(p%dimname2) , & ! Dimname 2
1371 TRIM(p%dimname3) , & ! Dimname 3
1372 TRIM(p%Description) , & ! Desc
1373 TRIM(p%Units) , & ! Units
1374 "<stdin>" // ' writing 3d real ' // TRIM(p%VarName) , & ! Debug message
1375 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1376 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1377 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1379 ELSE IF ( p%Type .EQ. 'd' ) THEN
1380 CALL wrf_ext_write_field ( &
1381 fid , & ! DataHandle
1382 current_date(1:19) , & ! DateStr
1383 TRIM(dname) , & ! Data Name
1384 p%dfield_3d , & ! Field
1385 WRF_DOUBLE , & ! FieldType
1387 grid%domdesc , & ! Comm
1388 grid%bdy_mask , & ! bdy_mask
1390 TRIM(memord) , & ! MemoryOrder
1391 TRIM(p%Stagger) , & ! Stagger
1392 TRIM(p%dimname1) , & ! Dimname 1
1393 TRIM(p%dimname2) , & ! Dimname 2
1394 TRIM(p%dimname3) , & ! Dimname 3
1395 TRIM(p%Description) , & ! Desc
1396 TRIM(p%Units) , & ! Units
1397 "<stdin>" // ' writing 3d double ' // TRIM(p%VarName) , & ! Debug message
1398 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1399 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1400 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1402 ELSE IF ( p%Type .EQ. 'i' ) THEN
1403 CALL wrf_ext_write_field ( &
1404 fid , & ! DataHandle
1405 current_date(1:19) , & ! DateStr
1406 TRIM(dname) , & ! Data Name
1407 p%ifield_3d , & ! Field
1408 WRF_INTEGER , & ! FieldType
1410 grid%domdesc , & ! Comm
1411 grid%bdy_mask , & ! bdy_mask
1413 TRIM(memord) , & ! MemoryOrder
1414 TRIM(p%Stagger) , & ! Stagger
1415 TRIM(p%dimname1) , & ! Dimname 1
1416 TRIM(p%dimname2) , & ! Dimname 2
1417 TRIM(p%dimname3) , & ! Dimname 3
1418 TRIM(p%Description) , & ! Desc
1419 TRIM(p%Units) , & ! Units
1420 "<stdin>" // ' writing 3d integer ' // TRIM(p%VarName) , & ! Debug message
1421 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1422 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1423 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1425 ! NOTE no io on logical arrays greater than 2d
1430 ELSE IF ( p%Ndim .EQ. 4 .AND. p%scalar_array ) THEN
1431 IF (switch.EQ.restart_only.OR.p%Ntl/100.EQ.mod(p%Ntl,100)) THEN
1432 ! Use a different write routine, wrf_ext_write_field_arr, and pass in the
1433 ! tracer indeces so that p%rfield_4d can be passsed in without arguments,
1434 ! avoiding the possiblity of a copy-in/copy-out problem for some compilers.
1436 DO itrace = PARAM_FIRST_SCALAR , p%num_table(grid%id)
1437 IF ((p%Restart.AND.switch.EQ.restart_only).OR.on_stream(p%streams_table(grid%id,itrace)%stream,newswitch)) THEN
1438 dname = p%dname_table( grid%id, itrace )
1439 IF (p%Ntl.GT.0.AND.switch.NE.restart_only)dname=dname(1:len(TRIM(dname))-2)
1440 memord = p%MemoryOrder
1441 IF ( p%Type .EQ. 'r' ) THEN
1442 CALL wrf_ext_write_field_arr ( &
1443 fid , & ! DataHandle
1444 current_date(1:19) , & ! DateStr
1445 TRIM(p%dname_table( grid%id, itrace )) , & ! Data Name
1446 p%rfield_4d , & ! Field
1447 itrace, 1, 1, 1 , & ! see comment above
1448 1, 1, 1 , & ! see comment above
1450 WRF_FLOAT , & ! FieldType
1452 grid%domdesc , & ! Comm
1453 grid%bdy_mask , & ! bdy_mask
1455 TRIM(memord) , & ! MemoryOrder
1456 TRIM(p%Stagger) , & ! Stagger
1457 TRIM(p%dimname1) , & ! Dimname 1
1458 TRIM(p%dimname2) , & ! Dimname 2
1459 TRIM(p%dimname3) , & ! Dimname 3
1460 TRIM(p%desc_table( grid%id, itrace)) , & ! Desc
1461 TRIM(p%units_table( grid%id, itrace)) , & ! Units
1462 "<stdin>" // ' writing 4d real ' // TRIM(p%dname_table(grid%id,itrace)) , & ! Debug message
1463 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1464 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1465 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1467 ELSE IF ( p%Type .EQ. 'd' ) THEN
1468 CALL wrf_ext_write_field_arr ( &
1469 fid , & ! DataHandle
1470 current_date(1:19) , & ! DateStr
1471 TRIM(p%dname_table( grid%id, itrace )) , & ! Data Name
1472 p%dfield_4d , & ! Field
1473 itrace, 1, 1, 1 , & ! see comment above
1474 1, 1, 1 , & ! see comment above
1476 WRF_DOUBLE , & ! FieldType
1478 grid%domdesc , & ! Comm
1479 grid%bdy_mask , & ! bdy_mask
1481 TRIM(memord) , & ! MemoryOrder
1482 TRIM(p%Stagger) , & ! Stagger
1483 TRIM(p%dimname1) , & ! Dimname 1
1484 TRIM(p%dimname2) , & ! Dimname 2
1485 TRIM(p%dimname3) , & ! Dimname 3
1486 TRIM(p%desc_table( grid%id, itrace)) , & ! Desc
1487 TRIM(p%units_table( grid%id, itrace)) , & ! Units
1488 "<stdin>" // ' writing 4d double ' // TRIM(p%dname_table(grid%id,itrace)) , & ! Debug message
1489 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1490 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1491 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1493 ELSE IF ( p%Type .EQ. 'i' ) THEN
1494 CALL wrf_ext_write_field_arr ( &
1495 fid , & ! DataHandle
1496 current_date(1:19) , & ! DateStr
1497 TRIM(p%dname_table( grid%id, itrace )) , & ! Data Name
1498 p%ifield_4d , & ! Field
1499 itrace, 1, 1, 1 , & ! see comment above
1500 1, 1, 1 , & ! see comment above
1502 WRF_INTEGER , & ! FieldType
1504 grid%domdesc , & ! Comm
1505 grid%bdy_mask , & ! bdy_mask
1507 TRIM(memord) , & ! MemoryOrder
1508 TRIM(p%Stagger) , & ! Stagger
1509 TRIM(p%dimname1) , & ! Dimname 1
1510 TRIM(p%dimname2) , & ! Dimname 2
1511 TRIM(p%dimname3) , & ! Dimname 3
1512 TRIM(p%desc_table( grid%id, itrace)) , & ! Desc
1513 TRIM(p%units_table( grid%id, itrace)) , & ! Units
1514 "<stdin>" // ' writing 4d integer ' // TRIM(p%dname_table(grid%id,itrace)) , & ! Debug message
1515 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1516 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1517 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1521 ENDDO ! loop over tracers
1522 ENDIF ! if-then-else over dim
1528 IF ( switch .EQ. boundary_only ) THEN
1529 CALL wrf_debug ( 300 , 'output_wrf: calling code in wrf_bdyout.inc' )
1530 CALL wrf_bdyout( fid , grid , config_flags, switch, dryrun, ierr )
1534 IF ( switch .EQ. history_only ) THEN
1536 current_date = current_date_save
1540 #if ( (EM_CORE == 1) && (DA_CORE != 1) )
1541 grid%save_topo_from_real = save_topo_orig
1544 IF ( .NOT. dryrun ) THEN
1545 CALL wrf_debug ( 300 , 'output_wrf: calling wrf_iosync ' )
1546 CALL wrf_iosync ( fid , ierr )
1547 CALL wrf_debug ( 300 , 'output_wrf: back from wrf_iosync ' )
1549 ! If output_ready_flag is set:
1550 ! Write wrfoutReady file if finished dumping
1551 ! history file, unless we're quilting, in which
1552 ! case this file would get dumped before history
1553 ! file was completely written. When quilting
1554 ! this file is written after the file handler
1555 ! is closed in the quilt() subroutine instead of
1556 ! here. (This is diagnosed by checking whether
1557 ! nio_tasks_in_group is zero) GAC 20140321
1559 IF ( switch .EQ. history_only .AND. config_flags%output_ready_flag ) THEN
1560 WRITE ( wrf_err_message , FMT='(I2.2)' ) grid%id
1561 CALL get_nio_tasks_in_group ( grid%id, nio_tasks_per_group )
1562 IF ( nio_tasks_per_group .EQ. 0 ) THEN
1563 OPEN ( UNIT = 99 , &
1564 FILE = 'wrfoutReady_d' // wrf_err_message(1:2) // '_' // TRIM(current_date) , &
1565 STATUS = 'UNKNOWN' , &
1566 ACCESS = 'SEQUENTIAL' )
1572 WRITE(wrf_err_message,*)'output_wrf: end, fid = ',fid
1573 CALL wrf_debug( 300 , wrf_err_message )
1576 END SUBROUTINE output_wrf
1578 SUBROUTINE traverse_statevars_debug (s,l)
1583 TYPE( fieldlist ), POINTER :: p
1584 p => head_grid%head_statevars%next
1585 ! write(0,*)'traverse_statevars_debug called ',TRIM(s),' ',l
1586 DO WHILE ( ASSOCIATED( p ) )
1587 ! IF ( p%Ndim .EQ. 4 .AND. p%scalar_array ) THEN
1588 ! DO itrace = PARAM_FIRST_SCALAR , p%num_table(1)
1589 !write(0,*)TRIM(s),l, itrace, p%streams_table(1,itrace)%stream
1592 ! if ( TRIM(p%VarName) .EQ. 'store_rand' .OR. TRIM(p%VarName) .EQ. 'STORE_RAND' ) then
1593 ! write(0,*)'traverse_statevars_debug sees ',TRIM(p%VarName),' >',p%Type,'<'
1598 END SUBROUTINE traverse_statevars_debug