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 ( p%Ndim .EQ. 0 ) THEN
1010 IF ((p%Restart.AND.switch.EQ.restart_only).OR.on_stream(p%streams,newswitch)) THEN
1011 IF ( in_use_for_config(grid%id,TRIM(p%VarName)) ) THEN
1013 IF (p%Ntl.GT.0.AND.switch.NE.restart_only)dname=dname(1:len(TRIM(dname))-2)
1014 memord = p%MemoryOrder
1017 ! CF compliancy would have us put the string "minutes since" // simulation_start_date
1018 ! as the ouput in the units attribute. After the WRF p%Units string has the "minutes since"
1019 ! substring, we wipe out the rest of the string and add the model's original (pre-restart)
1020 ! starting date. This is only for the time variable in WRF (XTIME), which is now considered
1021 ! the time coordinate in netcdf.
1023 IF (TRIM(p%DataName).EQ."XTIME") THEN
1024 WRITE ( simulation_start_date , FMT = '(I4.4,"-",I2.2,"-",I2.2," ",I2.2,":",I2.2,":",I2.2)' ) &
1025 simulation_start_year,simulation_start_month,simulation_start_day,&
1026 simulation_start_hour,simulation_start_minute,simulation_start_second
1027 IF ( TRIM(p%Description(1:14)) .EQ. 'minutes since ' ) THEN
1028 p%Description(15:33) = TRIM(simulation_start_date)
1029 p%Units (15:33) = TRIM(simulation_start_date)
1034 IF ( p%Type .EQ. 'r' ) THEN
1035 CALL wrf_ext_write_field ( &
1036 fid , & ! DataHandle
1037 current_date(1:19) , & ! DateStr
1038 TRIM(p%DataName) , & ! Data Name
1039 p%rfield_0d , & ! Field
1040 WRF_FLOAT , & ! FieldType
1042 grid%domdesc , & ! Comm
1043 grid%bdy_mask , & ! bdy_mask
1045 '0' , & ! MemoryOrder
1050 TRIM(p%Description) , & ! Desc
1051 TRIM(p%Units) , & ! Units
1052 "<stdin>" // ' writing 0d real ' // TRIM(p%VarName) , & ! Debug message
1053 1 , 1 , 1 , 1 , 1 , 1 , &
1054 1 , 1 , 1 , 1 , 1 , 1 , &
1055 1 , 1 , 1 , 1 , 1 , 1 , &
1057 ELSE IF ( p%Type .EQ. 'd' ) THEN
1058 CALL wrf_ext_write_field ( &
1059 fid , & ! DataHandle
1060 current_date(1:19) , & ! DateStr
1061 TRIM(p%DataName) , & ! Data Name
1062 p%dfield_0d , & ! Field
1063 WRF_DOUBLE , & ! FieldType
1065 grid%domdesc , & ! Comm
1066 grid%bdy_mask , & ! bdy_mask
1068 '0' , & ! MemoryOrder
1073 TRIM(p%Description) , & ! Desc
1074 TRIM(p%Units) , & ! Units
1075 "<stdin>" // ' writing 0d double ' // TRIM(p%VarName) , & ! Debug message
1076 1 , 1 , 1 , 1 , 1 , 1 , &
1077 1 , 1 , 1 , 1 , 1 , 1 , &
1078 1 , 1 , 1 , 1 , 1 , 1 , &
1080 ELSE IF ( p%Type .EQ. 'i' ) THEN
1081 CALL wrf_ext_write_field ( &
1082 fid , & ! DataHandle
1083 current_date(1:19) , & ! DateStr
1084 TRIM(p%DataName) , & ! Data Name
1085 p%ifield_0d , & ! Field
1086 WRF_INTEGER , & ! FieldType
1088 grid%domdesc , & ! Comm
1089 grid%bdy_mask , & ! bdy_mask
1091 '0' , & ! MemoryOrder
1096 TRIM(p%Description) , & ! Desc
1097 TRIM(p%Units) , & ! Units
1098 "<stdin>" // ' writing 0d integer ' // TRIM(p%VarName) , & ! Debug message
1099 1 , 1 , 1 , 1 , 1 , 1 , &
1100 1 , 1 , 1 , 1 , 1 , 1 , &
1101 1 , 1 , 1 , 1 , 1 , 1 , &
1103 ELSE IF ( p%Type .EQ. 'l' ) THEN
1104 CALL wrf_ext_write_field ( &
1105 fid , & ! DataHandle
1106 current_date(1:19) , & ! DateStr
1107 TRIM(p%DataName) , & ! Data Name
1108 p%lfield_0d , & ! Field
1109 WRF_LOGICAL , & ! FieldType
1111 grid%domdesc , & ! Comm
1112 grid%bdy_mask , & ! bdy_mask
1114 '0' , & ! MemoryOrder
1119 TRIM(p%Description) , & ! Desc
1120 TRIM(p%Units) , & ! Units
1121 "<stdin>" // ' writing 0d logical ' // TRIM(p%VarName) , & ! Debug message
1122 1 , 1 , 1 , 1 , 1 , 1 , &
1123 1 , 1 , 1 , 1 , 1 , 1 , &
1124 1 , 1 , 1 , 1 , 1 , 1 , &
1129 ELSE IF ( p%Ndim .EQ. 1 ) THEN
1130 IF ((p%Restart.AND.switch.EQ.restart_only).OR.on_stream(p%streams,newswitch)) THEN
1131 IF ( in_use_for_config(grid%id,TRIM(p%VarName)) ) THEN
1132 IF (switch.EQ.restart_only.OR.p%Ntl/100.EQ.mod(p%Ntl,100)) THEN
1134 IF (p%Ntl.GT.0.AND.switch.NE.restart_only)dname=dname(1:len(TRIM(dname))-2)
1135 memord = p%MemoryOrder
1136 IF ( p%Type .EQ. 'r' ) THEN
1137 CALL wrf_ext_write_field ( &
1138 fid , & ! DataHandle
1139 current_date(1:19) , & ! DateStr
1140 TRIM(dname) , & ! Data Name
1141 p%rfield_1d , & ! Field
1142 WRF_FLOAT , & ! FieldType
1144 grid%domdesc , & ! Comm
1145 grid%bdy_mask , & ! bdy_mask
1147 TRIM(memord) , & ! MemoryOrder
1148 TRIM(p%Stagger) , & ! Stagger
1149 TRIM(p%dimname1) , & ! Dimname 1
1150 TRIM(p%dimname2) , & ! Dimname 2
1151 TRIM(p%dimname3) , & ! Dimname 3
1152 TRIM(p%Description) , & ! Desc
1153 TRIM(p%Units) , & ! Units
1154 "<stdin>" // ' writing 1d real ' // TRIM(p%VarName) , & ! Debug message
1155 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1156 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1157 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1159 ELSE IF ( p%Type .EQ. 'd' ) THEN
1160 CALL wrf_ext_write_field ( &
1161 fid , & ! DataHandle
1162 current_date(1:19) , & ! DateStr
1163 TRIM(dname) , & ! Data Name
1164 p%dfield_1d , & ! Field
1165 WRF_DOUBLE , & ! FieldType
1167 grid%domdesc , & ! Comm
1168 grid%bdy_mask , & ! bdy_mask
1170 TRIM(memord) , & ! MemoryOrder
1171 TRIM(p%Stagger) , & ! Stagger
1172 TRIM(p%dimname1) , & ! Dimname 1
1173 TRIM(p%dimname2) , & ! Dimname 2
1174 TRIM(p%dimname3) , & ! Dimname 3
1175 TRIM(p%Description) , & ! Desc
1176 TRIM(p%Units) , & ! Units
1177 "<stdin>" // ' writing 1d double ' // TRIM(p%VarName) , & ! Debug message
1178 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1179 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1180 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1182 ELSE IF ( p%Type .EQ. 'i' ) THEN
1183 CALL wrf_ext_write_field ( &
1184 fid , & ! DataHandle
1185 current_date(1:19) , & ! DateStr
1186 TRIM(dname) , & ! Data Name
1187 p%ifield_1d , & ! Field
1188 WRF_INTEGER , & ! FieldType
1190 grid%domdesc , & ! Comm
1191 grid%bdy_mask , & ! bdy_mask
1193 TRIM(memord) , & ! MemoryOrder
1194 TRIM(p%Stagger) , & ! Stagger
1195 TRIM(p%dimname1) , & ! Dimname 1
1196 TRIM(p%dimname2) , & ! Dimname 2
1197 TRIM(p%dimname3) , & ! Dimname 3
1198 TRIM(p%Description) , & ! Desc
1199 TRIM(p%Units) , & ! Units
1200 "<stdin>" // ' writing 1d integer ' // TRIM(p%VarName) , & ! Debug message
1201 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1202 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1203 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1205 ELSE IF ( p%Type .EQ. 'l' ) THEN
1206 CALL wrf_ext_write_field ( &
1207 fid , & ! DataHandle
1208 current_date(1:19) , & ! DateStr
1209 TRIM(dname) , & ! Data Name
1210 p%lfield_1d , & ! Field
1211 WRF_LOGICAL , & ! FieldType
1213 grid%domdesc , & ! Comm
1214 grid%bdy_mask , & ! bdy_mask
1216 TRIM(memord) , & ! MemoryOrder
1217 TRIM(p%Stagger) , & ! Stagger
1218 TRIM(p%dimname1) , & ! Dimname 1
1219 TRIM(p%dimname2) , & ! Dimname 2
1220 TRIM(p%dimname3) , & ! Dimname 3
1221 TRIM(p%Description) , & ! Desc
1222 TRIM(p%Units) , & ! Units
1223 "<stdin>" // ' writing 1d logical ' // TRIM(p%VarName) , & ! Debug message
1224 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1225 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1226 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1232 ELSE IF ( p%Ndim .EQ. 2 ) THEN
1233 IF ((p%Restart.AND.switch.EQ.restart_only).OR.on_stream(p%streams,newswitch)) THEN
1234 IF ( in_use_for_config(grid%id,TRIM(p%VarName)) .AND. &
1235 ( .NOT. p%subgrid_x .OR. (p%subgrid_x .AND. grid%sr_x .GT. 0) ) .AND. &
1236 ( .NOT. p%subgrid_y .OR. (p%subgrid_y .AND. grid%sr_y .GT. 0) ) &
1238 IF (switch.EQ.restart_only.OR.p%Ntl/100.EQ.mod(p%Ntl,100)) THEN
1240 IF (p%Ntl.GT.0.AND.switch.NE.restart_only)dname=dname(1:len(TRIM(dname))-2)
1241 memord = p%MemoryOrder
1242 IF ( p%Type .EQ. 'r' ) THEN
1243 CALL wrf_ext_write_field ( &
1244 fid , & ! DataHandle
1245 current_date(1:19) , & ! DateStr
1246 TRIM(dname) , & ! Data Name
1247 p%rfield_2d , & ! Field
1248 WRF_FLOAT , & ! FieldType
1250 grid%domdesc , & ! Comm
1251 grid%bdy_mask , & ! bdy_mask
1253 TRIM(memord) , & ! MemoryOrder
1254 TRIM(p%Stagger) , & ! Stagger
1255 TRIM(p%dimname1) , & ! Dimname 1
1256 TRIM(p%dimname2) , & ! Dimname 2
1257 TRIM(p%dimname3) , & ! Dimname 3
1258 TRIM(p%Description) , & ! Desc
1259 TRIM(p%Units) , & ! Units
1260 "<stdin>" // ' writing 2d real ' // TRIM(p%VarName) , & ! Debug message
1261 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1262 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1263 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1265 ELSE IF ( p%Type .EQ. 'd' ) THEN
1266 CALL wrf_ext_write_field ( &
1267 fid , & ! DataHandle
1268 current_date(1:19) , & ! DateStr
1269 TRIM(dname) , & ! Data Name
1270 p%dfield_2d , & ! Field
1271 WRF_DOUBLE , & ! FieldType
1273 grid%domdesc , & ! Comm
1274 grid%bdy_mask , & ! bdy_mask
1276 TRIM(memord) , & ! MemoryOrder
1277 TRIM(p%Stagger) , & ! Stagger
1278 TRIM(p%dimname1) , & ! Dimname 1
1279 TRIM(p%dimname2) , & ! Dimname 2
1280 TRIM(p%dimname3) , & ! Dimname 3
1281 TRIM(p%Description) , & ! Desc
1282 TRIM(p%Units) , & ! Units
1283 "<stdin>" // ' writing 2d double ' // TRIM(p%VarName) , & ! Debug message
1284 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1285 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1286 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1288 ELSE IF ( p%Type .EQ. 'i' ) THEN
1289 CALL wrf_ext_write_field ( &
1290 fid , & ! DataHandle
1291 current_date(1:19) , & ! DateStr
1292 TRIM(dname) , & ! Data Name
1293 p%ifield_2d , & ! Field
1294 WRF_INTEGER , & ! FieldType
1296 grid%domdesc , & ! Comm
1297 grid%bdy_mask , & ! bdy_mask
1299 TRIM(memord) , & ! MemoryOrder
1300 TRIM(p%Stagger) , & ! Stagger
1301 TRIM(p%dimname1) , & ! Dimname 1
1302 TRIM(p%dimname2) , & ! Dimname 2
1303 TRIM(p%dimname3) , & ! Dimname 3
1304 TRIM(p%Description) , & ! Desc
1305 TRIM(p%Units) , & ! Units
1306 "<stdin>" // ' writing 2d integer ' // TRIM(p%VarName) , & ! Debug message
1307 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1308 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1309 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1311 ELSE IF ( p%Type .EQ. 'l' ) THEN
1312 CALL wrf_ext_write_field ( &
1313 fid , & ! DataHandle
1314 current_date(1:19) , & ! DateStr
1315 TRIM(dname) , & ! Data Name
1316 p%lfield_2d , & ! Field
1317 WRF_LOGICAL , & ! FieldType
1319 grid%domdesc , & ! Comm
1320 grid%bdy_mask , & ! bdy_mask
1322 TRIM(memord) , & ! MemoryOrder
1323 TRIM(p%Stagger) , & ! Stagger
1324 TRIM(p%dimname1) , & ! Dimname 1
1325 TRIM(p%dimname2) , & ! Dimname 2
1326 TRIM(p%dimname3) , & ! Dimname 3
1327 TRIM(p%Description) , & ! Desc
1328 TRIM(p%Units) , & ! Units
1329 "<stdin>" // ' writing 2d logical ' // TRIM(p%VarName) , & ! Debug message
1330 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1331 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1332 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1338 ELSE IF ( p%Ndim .EQ. 3 ) THEN
1339 IF ((p%Restart.AND.switch.EQ.restart_only).OR.on_stream(p%streams,newswitch)) THEN
1340 IF ( in_use_for_config(grid%id,TRIM(p%VarName)) .AND. &
1341 ( .NOT. p%subgrid_x .OR. (p%subgrid_x .AND. grid%sr_x .GT. 0) ) .AND. &
1342 ( .NOT. p%subgrid_y .OR. (p%subgrid_y .AND. grid%sr_y .GT. 0) ) &
1344 IF (switch.EQ.restart_only.OR.p%Ntl/100.EQ.mod(p%Ntl,100)) THEN
1346 IF (p%Ntl.GT.0.AND.switch.NE.restart_only)dname=dname(1:len(TRIM(dname))-2)
1347 memord = p%MemoryOrder
1348 IF ( p%Type .EQ. 'r' ) THEN
1349 CALL wrf_ext_write_field ( &
1350 fid , & ! DataHandle
1351 current_date(1:19) , & ! DateStr
1352 TRIM(dname) , & ! Data Name
1353 p%rfield_3d , & ! Field
1354 WRF_FLOAT , & ! FieldType
1356 grid%domdesc , & ! Comm
1357 grid%bdy_mask , & ! bdy_mask
1359 TRIM(memord) , & ! MemoryOrder
1360 TRIM(p%Stagger) , & ! Stagger
1361 TRIM(p%dimname1) , & ! Dimname 1
1362 TRIM(p%dimname2) , & ! Dimname 2
1363 TRIM(p%dimname3) , & ! Dimname 3
1364 TRIM(p%Description) , & ! Desc
1365 TRIM(p%Units) , & ! Units
1366 "<stdin>" // ' writing 3d real ' // TRIM(p%VarName) , & ! Debug message
1367 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1368 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1369 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1371 ELSE IF ( p%Type .EQ. 'd' ) THEN
1372 CALL wrf_ext_write_field ( &
1373 fid , & ! DataHandle
1374 current_date(1:19) , & ! DateStr
1375 TRIM(dname) , & ! Data Name
1376 p%dfield_3d , & ! Field
1377 WRF_DOUBLE , & ! FieldType
1379 grid%domdesc , & ! Comm
1380 grid%bdy_mask , & ! bdy_mask
1382 TRIM(memord) , & ! MemoryOrder
1383 TRIM(p%Stagger) , & ! Stagger
1384 TRIM(p%dimname1) , & ! Dimname 1
1385 TRIM(p%dimname2) , & ! Dimname 2
1386 TRIM(p%dimname3) , & ! Dimname 3
1387 TRIM(p%Description) , & ! Desc
1388 TRIM(p%Units) , & ! Units
1389 "<stdin>" // ' writing 3d double ' // TRIM(p%VarName) , & ! Debug message
1390 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1391 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1392 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1394 ELSE IF ( p%Type .EQ. 'i' ) THEN
1395 CALL wrf_ext_write_field ( &
1396 fid , & ! DataHandle
1397 current_date(1:19) , & ! DateStr
1398 TRIM(dname) , & ! Data Name
1399 p%ifield_3d , & ! Field
1400 WRF_INTEGER , & ! FieldType
1402 grid%domdesc , & ! Comm
1403 grid%bdy_mask , & ! bdy_mask
1405 TRIM(memord) , & ! MemoryOrder
1406 TRIM(p%Stagger) , & ! Stagger
1407 TRIM(p%dimname1) , & ! Dimname 1
1408 TRIM(p%dimname2) , & ! Dimname 2
1409 TRIM(p%dimname3) , & ! Dimname 3
1410 TRIM(p%Description) , & ! Desc
1411 TRIM(p%Units) , & ! Units
1412 "<stdin>" // ' writing 3d integer ' // TRIM(p%VarName) , & ! Debug message
1413 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1414 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1415 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1417 ! NOTE no io on logical arrays greater than 2d
1422 ELSE IF ( p%Ndim .EQ. 4 .AND. p%scalar_array ) THEN
1423 IF (switch.EQ.restart_only.OR.p%Ntl/100.EQ.mod(p%Ntl,100)) THEN
1424 ! Use a different write routine, wrf_ext_write_field_arr, and pass in the
1425 ! tracer indeces so that p%rfield_4d can be passsed in without arguments,
1426 ! avoiding the possiblity of a copy-in/copy-out problem for some compilers.
1428 DO itrace = PARAM_FIRST_SCALAR , p%num_table(grid%id)
1429 IF ((p%Restart.AND.switch.EQ.restart_only).OR.on_stream(p%streams_table(grid%id,itrace)%stream,newswitch)) THEN
1430 dname = p%dname_table( grid%id, itrace )
1431 IF (p%Ntl.GT.0.AND.switch.NE.restart_only)dname=dname(1:len(TRIM(dname))-2)
1432 memord = p%MemoryOrder
1433 IF ( p%Type .EQ. 'r' ) THEN
1434 CALL wrf_ext_write_field_arr ( &
1435 fid , & ! DataHandle
1436 current_date(1:19) , & ! DateStr
1437 TRIM(p%dname_table( grid%id, itrace )) , & ! Data Name
1438 p%rfield_4d , & ! Field
1439 itrace, 1, 1, 1 , & ! see comment above
1440 1, 1, 1 , & ! see comment above
1442 WRF_FLOAT , & ! FieldType
1444 grid%domdesc , & ! Comm
1445 grid%bdy_mask , & ! bdy_mask
1447 TRIM(memord) , & ! MemoryOrder
1448 TRIM(p%Stagger) , & ! Stagger
1449 TRIM(p%dimname1) , & ! Dimname 1
1450 TRIM(p%dimname2) , & ! Dimname 2
1451 TRIM(p%dimname3) , & ! Dimname 3
1452 TRIM(p%desc_table( grid%id, itrace)) , & ! Desc
1453 TRIM(p%units_table( grid%id, itrace)) , & ! Units
1454 "<stdin>" // ' writing 4d real ' // TRIM(p%dname_table(grid%id,itrace)) , & ! Debug message
1455 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1456 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1457 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1459 ELSE IF ( p%Type .EQ. 'd' ) THEN
1460 CALL wrf_ext_write_field_arr ( &
1461 fid , & ! DataHandle
1462 current_date(1:19) , & ! DateStr
1463 TRIM(p%dname_table( grid%id, itrace )) , & ! Data Name
1464 p%dfield_4d , & ! Field
1465 itrace, 1, 1, 1 , & ! see comment above
1466 1, 1, 1 , & ! see comment above
1468 WRF_DOUBLE , & ! FieldType
1470 grid%domdesc , & ! Comm
1471 grid%bdy_mask , & ! bdy_mask
1473 TRIM(memord) , & ! MemoryOrder
1474 TRIM(p%Stagger) , & ! Stagger
1475 TRIM(p%dimname1) , & ! Dimname 1
1476 TRIM(p%dimname2) , & ! Dimname 2
1477 TRIM(p%dimname3) , & ! Dimname 3
1478 TRIM(p%desc_table( grid%id, itrace)) , & ! Desc
1479 TRIM(p%units_table( grid%id, itrace)) , & ! Units
1480 "<stdin>" // ' writing 4d double ' // TRIM(p%dname_table(grid%id,itrace)) , & ! Debug message
1481 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1482 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1483 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1485 ELSE IF ( p%Type .EQ. 'i' ) THEN
1486 CALL wrf_ext_write_field_arr ( &
1487 fid , & ! DataHandle
1488 current_date(1:19) , & ! DateStr
1489 TRIM(p%dname_table( grid%id, itrace )) , & ! Data Name
1490 p%ifield_4d , & ! Field
1491 itrace, 1, 1, 1 , & ! see comment above
1492 1, 1, 1 , & ! see comment above
1494 WRF_INTEGER , & ! FieldType
1496 grid%domdesc , & ! Comm
1497 grid%bdy_mask , & ! bdy_mask
1499 TRIM(memord) , & ! MemoryOrder
1500 TRIM(p%Stagger) , & ! Stagger
1501 TRIM(p%dimname1) , & ! Dimname 1
1502 TRIM(p%dimname2) , & ! Dimname 2
1503 TRIM(p%dimname3) , & ! Dimname 3
1504 TRIM(p%desc_table( grid%id, itrace)) , & ! Desc
1505 TRIM(p%units_table( grid%id, itrace)) , & ! Units
1506 "<stdin>" // ' writing 4d integer ' // TRIM(p%dname_table(grid%id,itrace)) , & ! Debug message
1507 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1508 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1509 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1513 ENDDO ! loop over tracers
1514 ENDIF ! if-then-else over dim
1520 IF ( switch .EQ. boundary_only ) THEN
1521 CALL wrf_debug ( 300 , 'output_wrf: calling code in wrf_bdyout.inc' )
1522 CALL wrf_bdyout( fid , grid , config_flags, switch, dryrun, ierr )
1526 IF ( switch .EQ. history_only ) THEN
1528 current_date = current_date_save
1532 #if ( (EM_CORE == 1) && (DA_CORE != 1) )
1533 grid%save_topo_from_real = save_topo_orig
1536 IF ( .NOT. dryrun ) THEN
1537 CALL wrf_debug ( 300 , 'output_wrf: calling wrf_iosync ' )
1538 CALL wrf_iosync ( fid , ierr )
1539 CALL wrf_debug ( 300 , 'output_wrf: back from wrf_iosync ' )
1541 ! If output_ready_flag is set:
1542 ! Write wrfoutReady file if finished dumping
1543 ! history file, unless we're quilting, in which
1544 ! case this file would get dumped before history
1545 ! file was completely written. When quilting
1546 ! this file is written after the file handler
1547 ! is closed in the quilt() subroutine instead of
1548 ! here. (This is diagnosed by checking whether
1549 ! nio_tasks_in_group is zero) GAC 20140321
1551 IF ( switch .EQ. history_only .AND. config_flags%output_ready_flag ) THEN
1552 WRITE ( wrf_err_message , FMT='(I2.2)' ) grid%id
1553 CALL get_nio_tasks_in_group ( grid%id, nio_tasks_per_group )
1554 IF ( nio_tasks_per_group .EQ. 0 ) THEN
1555 OPEN ( UNIT = 99 , &
1556 FILE = 'wrfoutReady_d' // wrf_err_message(1:2) // '_' // TRIM(current_date) , &
1557 STATUS = 'UNKNOWN' , &
1558 ACCESS = 'SEQUENTIAL' )
1564 WRITE(wrf_err_message,*)'output_wrf: end, fid = ',fid
1565 CALL wrf_debug( 300 , wrf_err_message )
1568 END SUBROUTINE output_wrf
1570 SUBROUTINE traverse_statevars_debug (s,l)
1575 TYPE( fieldlist ), POINTER :: p
1576 p => head_grid%head_statevars%next
1577 ! write(0,*)'traverse_statevars_debug called ',TRIM(s),' ',l
1578 DO WHILE ( ASSOCIATED( p ) )
1579 ! IF ( p%Ndim .EQ. 4 .AND. p%scalar_array ) THEN
1580 ! DO itrace = PARAM_FIRST_SCALAR , p%num_table(1)
1581 !write(0,*)TRIM(s),l, itrace, p%streams_table(1,itrace)%stream
1584 ! if ( TRIM(p%VarName) .EQ. 'store_rand' .OR. TRIM(p%VarName) .EQ. 'STORE_RAND' ) then
1585 ! write(0,*)'traverse_statevars_debug sees ',TRIM(p%VarName),' >',p%Type,'<'
1590 END SUBROUTINE traverse_statevars_debug