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_ADIOS2 ) .OR. &
649 ( use_package( io_form ) == IO_PNETCDF ) ) THEN
650 CALL wrf_put_dom_ti_integer ( fid, 'SURFACE_INPUT_SOURCE', surface_input_source , 1 , ierr )
651 CALL wrf_put_dom_ti_integer ( fid, 'SST_UPDATE', sst_update , 1 , ierr )
652 CALL wrf_put_dom_ti_integer ( fid, 'GHG_INPUT', ghg_input , 1 , ierr )
654 CALL wrf_put_dom_ti_integer ( fid, 'GRID_FDDA', grid_fdda , 1 , ierr )
655 CALL wrf_put_dom_ti_integer ( fid, 'GFDDA_INTERVAL_M', gfdda_interval_m , 1 , ierr )
656 CALL wrf_put_dom_ti_integer ( fid, 'GFDDA_END_H', gfdda_end_h , 1 , ierr )
657 CALL wrf_put_dom_ti_integer ( fid, 'GRID_SFDDA', grid_sfdda , 1 , ierr )
658 CALL wrf_put_dom_ti_integer ( fid, 'SGFDDA_INTERVAL_M', sgfdda_interval_m , 1 , ierr )
659 CALL wrf_put_dom_ti_integer ( fid, 'SGFDDA_END_H', sgfdda_end_h , 1 , ierr )
660 CALL wrf_put_dom_ti_integer ( fid, 'HYPSOMETRIC_OPT', hypsometric_opt , 1 , ierr )
661 CALL wrf_put_dom_ti_integer ( fid, 'USE_THETA_M', use_theta_m , 1 , ierr )
662 IF ( switch .EQ. input_only) THEN
663 CALL wrf_put_dom_ti_integer ( fid, 'USE_MAXW_LEVEL', use_maxw_level , 1 , ierr )
664 CALL wrf_put_dom_ti_integer ( fid, 'USE_TROP_LEVEL', use_trop_level , 1 , ierr )
667 CALL wrf_put_dom_ti_integer ( fid, 'GWD_OPT' , ibuf , 1 , ierr )
668 CALL wrf_put_dom_ti_integer ( fid, 'SF_URBAN_PHYSICS', sf_urban_physics , 1 , ierr )
669 CALL wrf_put_dom_ti_integer ( fid, 'SF_SURFACE_MOSAIC', config_flags%sf_surface_mosaic , 1 , ierr )
670 CALL wrf_put_dom_ti_integer ( fid, 'SF_OCEAN_PHYSICS', config_flags%sf_ocean_physics , 1 , ierr )
673 IF ( switch .EQ. history_only ) THEN
674 CALL wrf_put_dom_ti_integer ( fid, 'SHCU_PHYSICS', config_flags%shcu_physics , 1 , ierr )
675 CALL wrf_put_dom_ti_integer ( fid, 'MFSHCONV', config_flags%mfshconv , 1 , ierr )
676 CALL wrf_put_dom_ti_integer ( fid, 'FEEDBACK', feedback , 1 , ierr )
677 CALL wrf_put_dom_ti_integer ( fid, 'SMOOTH_OPTION', smooth_option , 1 , ierr )
678 CALL wrf_put_dom_ti_real ( fid, 'SWRAD_SCAT', swrad_scat , 1 , ierr )
679 CALL wrf_put_dom_ti_integer ( fid, 'W_DAMPING', w_damping , 1 , ierr )
682 CALL wrf_put_dom_ti_real ( fid, 'DT' , dt, 1 , ierr)
683 IF ( grid%use_adaptive_time_step ) THEN
684 CALL wrf_put_dom_ti_real ( fid, 'ADAPT_DT_START' , adapt_dt_start, 1 , ierr)
685 CALL wrf_put_dom_ti_real ( fid, 'ADAPT_DT_MAX' , adapt_dt_max , 1 , ierr)
686 CALL wrf_put_dom_ti_real ( fid, 'ADAPT_DT_MIN' , adapt_dt_min , 1 , ierr)
690 call wrf_put_dom_ti_real ( fid, 'RADT', radt, 1 , ierr)
691 call wrf_put_dom_ti_real ( fid, 'BLDT', bldt, 1 , ierr)
692 call wrf_put_dom_ti_real ( fid, 'CUDT', cudt, 1 , ierr)
693 call wrf_put_dom_ti_integer ( fid, 'AER_OPT' , aer_opt , 1 , ierr)
694 call wrf_put_dom_ti_integer ( fid, 'SWINT_OPT' , swint_opt , 1 , ierr)
695 call wrf_put_dom_ti_integer ( fid, 'AER_TYPE' , aer_type , 1 , ierr )
696 call wrf_put_dom_ti_integer ( fid, 'AER_AOD550_OPT' , aer_aod550_opt , 1 , ierr )
697 call wrf_put_dom_ti_integer ( fid, 'AER_ANGEXP_OPT' , aer_angexp_opt , 1 , ierr )
698 call wrf_put_dom_ti_integer ( fid, 'AER_SSA_OPT' , aer_ssa_opt , 1 , ierr )
699 call wrf_put_dom_ti_integer ( fid, 'AER_ASY_OPT' , aer_asy_opt , 1 , ierr )
700 call wrf_put_dom_ti_real ( fid, 'AER_AOD550_VAL' , aer_aod550_val , 1 , ierr )
701 call wrf_put_dom_ti_real ( fid, 'AER_ANGEXP_VAL' , aer_angexp_val , 1 , ierr )
702 call wrf_put_dom_ti_real ( fid, 'AER_SSA_VAL' , aer_ssa_val , 1 , ierr )
703 call wrf_put_dom_ti_real ( fid, 'AER_ASY_VAL' , aer_asy_val , 1 , ierr )
706 CALL wrf_put_dom_ti_integer ( fid, 'MOIST_ADV_OPT', moist_adv_opt , 1 , ierr )
707 CALL wrf_put_dom_ti_integer ( fid, 'SCALAR_ADV_OPT', scalar_adv_opt , 1 , ierr )
708 CALL wrf_put_dom_ti_integer ( fid, 'TKE_ADV_OPT', tke_adv_opt , 1 , ierr )
709 CALL wrf_put_dom_ti_integer ( fid, 'DIFF_6TH_OPT', diff_6th_opt , 1 , ierr )
710 CALL wrf_put_dom_ti_real ( fid, 'DIFF_6TH_FACTOR', diff_6th_factor , 1 , ierr )
712 IF ( config_flags%topo_wind == 1 ) THEN
713 CALL wrf_put_dom_ti_integer ( fid, 'TOPO_WIND', config_flags%topo_wind , 1 , ierr )
715 IF ( grid_fdda == 1 ) THEN
716 CALL wrf_put_dom_ti_real ( fid, 'FGDT', fgdt , 1 , ierr )
717 CALL wrf_put_dom_ti_real ( fid, 'GUV', guv , 1 , ierr )
718 CALL wrf_put_dom_ti_real ( fid, 'GT', gt , 1 , ierr )
719 CALL wrf_put_dom_ti_real ( fid, 'GQ', gq , 1 , ierr )
720 CALL wrf_put_dom_ti_integer ( fid, 'IF_RAMPING', if_ramping , 1 , ierr )
721 CALL wrf_put_dom_ti_real ( fid, 'DTRAMP_MIN', dtramp_min , 1 , ierr )
724 IF ( grid_fdda == 2 ) THEN
725 CALL wrf_put_dom_ti_real ( fid, 'FGDT', fgdt , 1 , ierr )
726 CALL wrf_put_dom_ti_real ( fid, 'GUV', guv , 1 , ierr )
727 CALL wrf_put_dom_ti_real ( fid, 'GT', gt , 1 , ierr )
728 CALL wrf_put_dom_ti_real ( fid, 'GPH', gph , 1 , ierr )
729 CALL wrf_put_dom_ti_real ( fid, 'GQ', gq , 1 , ierr )
730 CALL wrf_put_dom_ti_integer ( fid, 'IF_RAMPING', if_ramping , 1 , ierr )
731 CALL wrf_put_dom_ti_real ( fid, 'DTRAMP_MIN', dtramp_min , 1 , ierr )
734 IF ( grid_sfdda >= 1 ) THEN
735 CALL wrf_put_dom_ti_real ( fid, 'GUV_SFC', guv_sfc , 1 , ierr )
736 CALL wrf_put_dom_ti_real ( fid, 'GT_SFC', gt_sfc , 1 , ierr )
737 CALL wrf_put_dom_ti_real ( fid, 'GQ_SFC', gq_sfc , 1 , ierr )
738 CALL wrf_put_dom_ti_real ( fid, 'RINBLW', rinblw , 1 , ierr )
741 CALL wrf_put_dom_ti_integer ( fid, 'OBS_NUDGE_OPT', obs_nudge_opt , 1 , ierr )
742 IF ( obs_nudge_opt == 1 ) THEN
743 CALL wrf_put_dom_ti_real ( fid, 'FDDA_END', fdda_end , 1 , ierr )
744 CALL wrf_put_dom_ti_integer ( fid, 'OBS_NUDGE_WIND', obs_nudge_wind , 1 , ierr )
745 CALL wrf_put_dom_ti_real ( fid, 'OBS_COEF_WIND', obs_coef_wind , 1 , ierr )
746 CALL wrf_put_dom_ti_integer ( fid, 'OBS_NUDGE_TEMP', obs_nudge_temp , 1 , ierr )
747 CALL wrf_put_dom_ti_real ( fid, 'OBS_COEF_TEMP', obs_coef_temp , 1 , ierr )
748 CALL wrf_put_dom_ti_integer ( fid, 'OBS_NUDGE_MOIS', obs_nudge_mois , 1 , ierr )
749 CALL wrf_put_dom_ti_real ( fid, 'OBS_COEF_MOIS', obs_coef_mois , 1 , ierr )
750 CALL wrf_put_dom_ti_integer ( fid, 'OBS_NUDGE_PSTR', obs_nudge_pstr , 1 , ierr )
751 CALL wrf_put_dom_ti_real ( fid, 'OBS_COEF_PSTR', obs_coef_pstr , 1 , ierr )
752 CALL wrf_put_dom_ti_integer ( fid, 'OBS_IONF', obs_ionf , 1 , ierr )
753 CALL wrf_put_dom_ti_integer ( fid, 'OBS_IDYNIN', obs_idynin , 1 , ierr )
754 CALL wrf_put_dom_ti_real ( fid, 'OBS_DTRAMP', obs_dtramp , 1 , ierr )
757 CALL wrf_put_dom_ti_real ( fid, 'BUCKET_MM', config_flags%bucket_mm , 1 , ierr )
758 CALL wrf_put_dom_ti_real ( fid, 'BUCKET_J', config_flags%bucket_J , 1 , ierr )
759 CALL wrf_put_dom_ti_real ( fid, 'PREC_ACC_DT', config_flags%prec_acc_dt , 1 , ierr )
760 CALL wrf_put_dom_ti_integer ( fid, 'ISFTCFLX', config_flags%isftcflx , 1 , ierr )
761 CALL wrf_put_dom_ti_integer ( fid, 'ISHALLOW', config_flags%ishallow , 1 , ierr )
762 CALL wrf_put_dom_ti_integer ( fid, 'ISFFLX', config_flags%isfflx , 1 , ierr )
763 CALL wrf_put_dom_ti_integer ( fid, 'ICLOUD', config_flags%icloud , 1 , ierr )
764 CALL wrf_put_dom_ti_integer ( fid, 'ICLOUD_CU', config_flags%icloud_cu , 1 , ierr )
765 CALL wrf_put_dom_ti_integer ( fid, 'TRACER_PBLMIX', tracer_pblmix , 1 , ierr )
766 CALL wrf_put_dom_ti_integer ( fid, 'SCALAR_PBLMIX', scalar_pblmix , 1 , ierr )
767 CALL wrf_put_dom_ti_integer ( fid, 'YSU_TOPDOWN_PBLMIX', ysu_topdown_pblmix , 1 , ierr )
768 CALL wrf_put_dom_ti_integer ( fid, 'GRAV_SETTLING', grav_settling , 1 , ierr )
769 CALL wrf_put_dom_ti_integer ( fid, 'CLDOVRLP', config_flags%cldovrlp , 1 , ierr )
770 CALL wrf_put_dom_ti_integer ( fid, 'IDCOR', config_flags%idcor , 1 , ierr )
774 IF ( sf_surface_physics == 4 ) THEN
775 CALL wrf_put_dom_ti_integer ( fid, 'OPT_SFC', config_flags%opt_sfc , 1 , ierr )
776 CALL wrf_put_dom_ti_integer ( fid, 'DVEG', config_flags%dveg , 1 , ierr )
777 CALL wrf_put_dom_ti_integer ( fid, 'OPT_CRS', config_flags%opt_crs , 1 , ierr )
778 CALL wrf_put_dom_ti_integer ( fid, 'OPT_BTR', config_flags%opt_btr , 1 , ierr )
779 CALL wrf_put_dom_ti_integer ( fid, 'OPT_RUN', config_flags%opt_run , 1 , ierr )
780 CALL wrf_put_dom_ti_integer ( fid, 'OPT_FRZ', config_flags%opt_frz , 1 , ierr )
781 CALL wrf_put_dom_ti_integer ( fid, 'OPT_INF', config_flags%opt_inf , 1 , ierr )
782 CALL wrf_put_dom_ti_integer ( fid, 'OPT_RAD', config_flags%opt_rad , 1 , ierr )
783 CALL wrf_put_dom_ti_integer ( fid, 'OPT_ALB', config_flags%opt_alb , 1 , ierr )
784 CALL wrf_put_dom_ti_integer ( fid, 'OPT_SNF', config_flags%opt_snf , 1 , ierr )
785 CALL wrf_put_dom_ti_integer ( fid, 'OPT_TBOT', config_flags%opt_tbot , 1 , ierr )
786 CALL wrf_put_dom_ti_integer ( fid, 'OPT_STC', config_flags%opt_stc , 1 , ierr )
787 CALL wrf_put_dom_ti_integer ( fid, 'OPT_GLA', config_flags%opt_gla , 1 , ierr )
788 CALL wrf_put_dom_ti_integer ( fid, 'OPT_RSF', config_flags%opt_rsf , 1 , ierr )
789 CALL wrf_put_dom_ti_integer ( fid, 'OPT_SOIL', config_flags%opt_soil , 1 , ierr )
790 CALL wrf_put_dom_ti_integer ( fid, 'OPT_PEDO', config_flags%opt_pedo , 1 , ierr )
791 CALL wrf_put_dom_ti_integer ( fid, 'OPT_CROP', config_flags%opt_crop , 1 , ierr )
792 CALL wrf_put_dom_ti_integer ( fid, 'OPT_IRR', config_flags%opt_irr , 1 , ierr )
793 CALL wrf_put_dom_ti_integer ( fid, 'OPT_IRRM', config_flags%opt_irrm , 1 , ierr )
796 CALL wrf_put_dom_ti_integer ( fid, 'DFI_OPT', config_flags%dfi_opt , 1 , ierr )
797 CALL wrf_put_dom_ti_integer ( fid, 'NTASKS_X', ntasks_x , 1 , ierr )
798 CALL wrf_put_dom_ti_integer ( fid, 'NTASKS_Y', ntasks_y , 1 , ierr )
799 CALL wrf_put_dom_ti_integer ( fid, 'NTASKS_TOTAL', ntasks_x*ntasks_y , 1 , ierr )
803 #if (WRF_CHEM == 1 && WRF_KPP == 1)
804 IF ( switch == auxhist9_only .and. config_flags%irr_opt /= 0 ) THEN
805 CALL nl_get_chemdt( grid%id, chemdt )
806 CALL wrf_put_dom_ti_real( fid, 'CHEMDT' , chemdt, 1 , ierr)
810 #if (EM_CORE == 1) && ( DA_CORE != 1)
811 IF ( ( switch .EQ. input_only ) .OR. &
812 ( switch .EQ. history_only ) .OR. &
813 ( switch .EQ. restart_only ) ) THEN
814 IF ( grid%this_is_an_ideal_run ) THEN
815 CALL wrf_put_dom_ti_char ( fid , 'SIMULATION_INITIALIZATION_TYPE', "IDEALIZED DATA" , ierr )
817 CALL wrf_put_dom_ti_char ( fid , 'SIMULATION_INITIALIZATION_TYPE', "REAL-DATA CASE" , ierr )
823 ! added these fields for use by reassembly programs , 010831, JM
824 ! modified these fields so "patch" == "domain" when multi-file output
825 ! formats are not used. 051018, TBH
827 ibuf(1) = MAX(ips,ids)
828 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = ids
829 CALL wrf_put_dom_ti_integer ( fid , 'WEST-EAST_PATCH_START_UNSTAG' , ibuf , 1 , ierr )
830 ibuf(1) = MIN(ipe,ide-1)
831 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = ide - 1
832 CALL wrf_put_dom_ti_integer ( fid , 'WEST-EAST_PATCH_END_UNSTAG' , ibuf , 1 , ierr )
833 ibuf(1) = MAX(ips,ids)
834 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = ids
835 CALL wrf_put_dom_ti_integer ( fid , 'WEST-EAST_PATCH_START_STAG' , ibuf , 1 , ierr )
836 ibuf(1) = MIN(ipe,ide)
837 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = ide
838 CALL wrf_put_dom_ti_integer ( fid , 'WEST-EAST_PATCH_END_STAG' , ibuf , 1 , ierr )
839 ibuf(1) = MAX(jps,jds)
840 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = jds
841 CALL wrf_put_dom_ti_integer ( fid , 'SOUTH-NORTH_PATCH_START_UNSTAG' , ibuf , 1 , ierr )
842 ibuf(1) = MIN(jpe,jde-1)
843 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = jde - 1
844 CALL wrf_put_dom_ti_integer ( fid , 'SOUTH-NORTH_PATCH_END_UNSTAG' , ibuf , 1 , ierr )
845 ibuf(1) = MAX(jps,jds)
846 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = jds
847 CALL wrf_put_dom_ti_integer ( fid , 'SOUTH-NORTH_PATCH_START_STAG' , ibuf , 1 , ierr )
848 ibuf(1) = MIN(jpe,jde)
849 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = jde
850 CALL wrf_put_dom_ti_integer ( fid , 'SOUTH-NORTH_PATCH_END_STAG' , ibuf , 1 , ierr )
852 ibuf(1) = MAX(kps,kds)
853 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = kds
854 CALL wrf_put_dom_ti_integer ( fid , 'BOTTOM-TOP_PATCH_START_UNSTAG' , ibuf , 1 , ierr )
855 ibuf(1) = MIN(kpe,kde-1)
856 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = kde - 1
857 CALL wrf_put_dom_ti_integer ( fid , 'BOTTOM-TOP_PATCH_END_UNSTAG' , ibuf , 1 , ierr )
858 ibuf(1) = MAX(kps,kds)
859 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = kds
860 CALL wrf_put_dom_ti_integer ( fid , 'BOTTOM-TOP_PATCH_START_STAG' , ibuf , 1 , ierr )
861 ibuf(1) = MIN(kpe,kde)
862 IF ( .NOT. multi_files ( io_form ) ) ibuf(1) = kde
863 CALL wrf_put_dom_ti_integer ( fid , 'BOTTOM-TOP_PATCH_END_STAG' , ibuf , 1 , ierr )
866 CALL wrf_put_dom_ti_integer ( fid , 'GRID_ID' , ibuf , 1 , ierr )
868 CALL wrf_put_dom_ti_integer ( fid , 'PARENT_ID' , ibuf , 1 , ierr )
869 ibuf(1) = i_parent_start
870 CALL wrf_put_dom_ti_integer ( fid , 'I_PARENT_START' , ibuf , 1 , ierr )
871 ibuf(1) = j_parent_start
872 CALL wrf_put_dom_ti_integer ( fid , 'J_PARENT_START' , ibuf , 1 , ierr )
873 ibuf(1) = parent_grid_ratio
874 CALL wrf_put_dom_ti_integer ( fid , 'PARENT_GRID_RATIO' , ibuf , 1 , ierr )
880 CALL wrf_put_dom_ti_real ( fid , 'DX' , config_flags%dx , 1 , ierr )
881 CALL wrf_put_dom_ti_real ( fid , 'DY' , config_flags%dy , 1 , ierr )
883 ! Updated by T. Hutchinson to use adaptive time step.
884 CALL wrf_put_dom_ti_real ( fid , 'DT' , grid%dt , 1 , ierr )
885 ! CALL wrf_put_dom_ti_real ( fid , 'DT' , config%dt , 1 , ierr )
886 CALL wrf_put_dom_ti_real ( fid , 'CEN_LAT' , config_flags%cen_lat , 1 , ierr )
887 CALL wrf_put_dom_ti_real ( fid , 'CEN_LON' , config_flags%cen_lon , 1 , ierr )
888 CALL wrf_put_dom_ti_real ( fid , 'TRUELAT1', config_flags%truelat1, 1 , ierr )
889 CALL wrf_put_dom_ti_real ( fid , 'TRUELAT2', config_flags%truelat2, 1 , ierr )
890 CALL wrf_put_dom_ti_real ( fid , 'MOAD_CEN_LAT', config_flags%moad_cen_lat, 1 , ierr )
891 CALL wrf_put_dom_ti_real ( fid , 'STAND_LON', config_flags%stand_lon, 1 , ierr )
893 CALL wrf_put_dom_ti_real ( fid , 'POLE_LAT', config_flags%pole_lat, 1 , ierr )
894 CALL wrf_put_dom_ti_real ( fid , 'POLE_LON', config_flags%pole_lon, 1 , ierr )
896 IF ( switch .NE. boundary_only .AND. switch .NE. auxinput9_only .AND. switch .NE. auxinput10_only ) THEN
898 ! When writing to restart files, use the values of the instantaneous
899 ! time for determining the values of JULYR, JULDAY, and GMT. If the
900 ! original values in config_flags are used, this assumes that the
901 ! restart simulation will start with an itimestep NE 0. If we use
902 ! the instantaneous time, we can start a restart simulation with a
903 ! different value of delta-t for timestep and still get the clocks
904 ! calendars (and orbital information!) correct.
906 ! Current time is still defined from above call to WRF_UTIL_ClockGet
907 CALL WRFU_TimeGet( currentTime, YY=julyr, dayOfYear=julday, H=p_hr, M=p_min, S=p_sec, MS=p_ms, rc=rc)
908 WRITE(wrf_err_message,*)'output_wrf: julyr,julday,hr,min,sec,ms = ',julyr,julday,p_hr,p_min,p_sec,p_ms
909 CALL wrf_debug( 100 , wrf_err_message )
910 gmt = REAL(p_hr)+REAL(p_min)/60.+REAL(p_sec)/3600.+REAL(p_ms)/3600000.
911 CALL wrf_put_dom_ti_real ( fid , 'GMT' , gmt , 1 , ierr )
912 CALL wrf_put_dom_ti_integer ( fid , 'JULYR' , julyr , 1 , ierr )
913 CALL wrf_put_dom_ti_integer ( fid , 'JULDAY' , julday , 1 , ierr )
915 CALL wrf_put_dom_ti_real ( fid , 'GMT' , config_flags%gmt , 1 , ierr )
916 CALL wrf_put_dom_ti_integer ( fid , 'JULYR' , config_flags%julyr , 1 , ierr )
917 CALL wrf_put_dom_ti_integer ( fid , 'JULDAY' , config_flags%julday , 1 , ierr )
921 CALL wrf_put_dom_ti_integer ( fid , 'MAP_PROJ' , config_flags%map_proj , 1 , ierr )
922 IF ( config_flags%map_proj .EQ. 0 ) THEN
923 CALL wrf_put_dom_ti_char ( fid , 'MAP_PROJ_CHAR' , "Cartesian" , ierr )
924 ELSE IF ( config_flags%map_proj .EQ. 1 ) THEN
925 CALL wrf_put_dom_ti_char ( fid , 'MAP_PROJ_CHAR' , "Lambert Conformal" , ierr )
926 ELSE IF ( config_flags%map_proj .EQ. 2 ) THEN
927 CALL wrf_put_dom_ti_char ( fid , 'MAP_PROJ_CHAR' , "Polar Stereographic" , ierr )
928 ELSE IF ( config_flags%map_proj .EQ. 3 ) THEN
929 CALL wrf_put_dom_ti_char ( fid , 'MAP_PROJ_CHAR' , "Mercator" , ierr )
930 ELSE IF ( config_flags%map_proj .EQ. 6 ) THEN
931 CALL wrf_put_dom_ti_char ( fid , 'MAP_PROJ_CHAR' , "Cylindrical Equidistant" , ierr )
932 ELSE IF ( config_flags%map_proj .EQ. 203 ) THEN
933 CALL wrf_put_dom_ti_char ( fid , 'MAP_PROJ_CHAR' , "NMM Rotated Lat Lon" , ierr )
936 IF(MMINLU(1:4) == 'USGS') THEN
940 IF(MMINLU(1:1) .EQ. " ")THEN
941 CALL wrf_put_dom_ti_char ( fid , 'MMINLU', " " , ierr )
943 CALL wrf_put_dom_ti_char ( fid , 'MMINLU', TRIM(mminlu) , ierr )
945 call wrf_put_dom_ti_integer ( fid , 'NUM_LAND_CAT', config_flags%num_land_cat, 1, ierr)
946 CALL wrf_put_dom_ti_integer ( fid , 'ISWATER' , iswater , 1 , ierr )
947 CALL wrf_put_dom_ti_integer ( fid , 'ISLAKE' , islake , 1 , ierr )
948 ! CALL wrf_put_dom_ti_integer ( fid , 'ISWATER' , config_flags%iswater , 1 , ierr )
949 CALL wrf_put_dom_ti_integer ( fid , 'ISICE' , config_flags%isice , 1 , ierr )
950 CALL wrf_put_dom_ti_integer ( fid , 'ISURBAN' , config_flags%isurban , 1 , ierr )
951 CALL wrf_put_dom_ti_integer ( fid , 'ISOILWATER' , config_flags%isoilwater , 1 , ierr )
952 ! added these fields for restarting of moving nests, JM
953 #if ! defined(EM_CORE)
954 CALL wrf_put_dom_ti_integer ( fid , 'I_PARENT_START' , config_flags%i_parent_start , 1 , ierr )
955 CALL wrf_put_dom_ti_integer ( fid , 'J_PARENT_START' , config_flags%j_parent_start , 1 , ierr )
958 IF ( switch .EQ. boundary_only ) THEN
959 CALL WRFU_TimeIntervalSet( bdy_increment, S=NINT(config_flags%bdyfrq),rc=rc)
960 next_time = currentTime + bdy_increment
961 CALL wrf_timetoa ( next_time, next_datestr )
962 CALL wrf_put_dom_td_char ( fid , 'THISBDYTIME' , current_date(1:19), current_date(1:19), ierr )
963 CALL wrf_put_dom_td_char ( fid , 'NEXTBDYTIME' , current_date(1:19), next_datestr(1:19), ierr )
966 ! Add the hybrid vertical coordinate metadata.
969 CALL wrf_put_dom_ti_integer ( fid , 'HYBRID_OPT', hybrid_opt , 1 , ierr )
970 CALL wrf_put_dom_ti_real ( fid , 'ETAC' , etac , 1 , ierr )
973 ! added grib2-specific metadata: Todd Hutchinson 8/21/2005
974 IF ( use_package( io_form ) == IO_GRIB2 ) THEN
975 CALL wrf_put_dom_ti_integer ( fid , 'BACKGROUND_PROC_ID' , config_flags%background_proc_id , 1 , ierr )
976 CALL wrf_put_dom_ti_integer ( fid , 'FORECAST_PROC_ID' , config_flags%forecast_proc_id , 1 , ierr )
977 CALL wrf_put_dom_ti_integer ( fid , 'PRODUCTION_STATUS' , config_flags%production_status , 1 , ierr )
978 CALL wrf_put_dom_ti_integer ( fid , 'COMPRESSION' , config_flags%compression , 1 , ierr )
981 #if ( (EM_CORE == 1) && (DA_CORE != 1) )
982 save_topo_orig = grid%save_topo_from_real
985 IF ( (first_history .LE. switch .AND. switch .LE. last_history ) .OR. &
986 ( (switch .EQ. input_only) .AND. &
987 (program_name(1:7) .NE. 'REAL_EM') .AND. &
988 (grid%dfi_opt .EQ. DFI_NODFI ) ) .OR. &
989 ( switch .EQ. restart_only ) ) THEN
991 ! This flag sets the switch which defines the topography as the original
992 ! generated by real.exe. The "zero" value means that for the WRF model
993 ! output, the topography has been modified. All output from the ARW
994 ! WRF model has this flag set. However, to allow nests to still be
995 ! instantiated after a parent does IO, and to allow that nest domain
996 ! to have the topo adjusted, we save the incoming value of the save_topo
999 grid%save_topo_from_real=0
1003 IF ( (first_input .LE. switch .AND. switch .LE. last_input) .OR. &
1004 (first_history .LE. switch .AND. switch .LE. last_history ) .OR. &
1005 switch .EQ. restart_only ) THEN
1007 p => grid%head_statevars%next
1008 CALL wrf_start_io_timestep(fid, ierr)
1009 DO WHILE ( ASSOCIATED( p ) )
1010 IF ( p%ProcOrient .NE. 'X' .AND. p%ProcOrient .NE. 'Y' ) THEN ! no I/O for xposed variables
1011 IF ( p%Ndim .EQ. 0 ) THEN
1012 IF ((p%Restart.AND.switch.EQ.restart_only).OR.on_stream(p%streams,newswitch)) THEN
1013 IF ( in_use_for_config(grid%id,TRIM(p%VarName)) ) THEN
1015 IF (p%Ntl.GT.0.AND.switch.NE.restart_only)dname=dname(1:len(TRIM(dname))-2)
1016 memord = p%MemoryOrder
1019 ! CF compliancy would have us put the string "minutes since" // simulation_start_date
1020 ! as the ouput in the units attribute. After the WRF p%Units string has the "minutes since"
1021 ! substring, we wipe out the rest of the string and add the model's original (pre-restart)
1022 ! starting date. This is only for the time variable in WRF (XTIME), which is now considered
1023 ! the time coordinate in netcdf.
1025 IF (TRIM(p%DataName).EQ."XTIME") THEN
1026 WRITE ( simulation_start_date , FMT = '(I4.4,"-",I2.2,"-",I2.2," ",I2.2,":",I2.2,":",I2.2)' ) &
1027 simulation_start_year,simulation_start_month,simulation_start_day,&
1028 simulation_start_hour,simulation_start_minute,simulation_start_second
1029 IF ( TRIM(p%Description(1:14)) .EQ. 'minutes since ' ) THEN
1030 p%Description(15:33) = TRIM(simulation_start_date)
1031 p%Units (15:33) = TRIM(simulation_start_date)
1036 IF ( p%Type .EQ. 'r' ) THEN
1037 CALL wrf_ext_write_field ( &
1038 fid , & ! DataHandle
1039 current_date(1:19) , & ! DateStr
1040 TRIM(p%DataName) , & ! Data Name
1041 p%rfield_0d , & ! Field
1042 WRF_FLOAT , & ! FieldType
1044 grid%domdesc , & ! Comm
1045 grid%bdy_mask , & ! bdy_mask
1047 '0' , & ! MemoryOrder
1052 TRIM(p%Description) , & ! Desc
1053 TRIM(p%Units) , & ! Units
1054 "<stdin>" // ' writing 0d real ' // TRIM(p%VarName) , & ! Debug message
1055 1 , 1 , 1 , 1 , 1 , 1 , &
1056 1 , 1 , 1 , 1 , 1 , 1 , &
1057 1 , 1 , 1 , 1 , 1 , 1 , &
1059 ELSE IF ( p%Type .EQ. 'd' ) THEN
1060 CALL wrf_ext_write_field ( &
1061 fid , & ! DataHandle
1062 current_date(1:19) , & ! DateStr
1063 TRIM(p%DataName) , & ! Data Name
1064 p%dfield_0d , & ! Field
1065 WRF_DOUBLE , & ! FieldType
1067 grid%domdesc , & ! Comm
1068 grid%bdy_mask , & ! bdy_mask
1070 '0' , & ! MemoryOrder
1075 TRIM(p%Description) , & ! Desc
1076 TRIM(p%Units) , & ! Units
1077 "<stdin>" // ' writing 0d double ' // TRIM(p%VarName) , & ! Debug message
1078 1 , 1 , 1 , 1 , 1 , 1 , &
1079 1 , 1 , 1 , 1 , 1 , 1 , &
1080 1 , 1 , 1 , 1 , 1 , 1 , &
1082 ELSE IF ( p%Type .EQ. 'i' ) THEN
1083 CALL wrf_ext_write_field ( &
1084 fid , & ! DataHandle
1085 current_date(1:19) , & ! DateStr
1086 TRIM(p%DataName) , & ! Data Name
1087 p%ifield_0d , & ! Field
1088 WRF_INTEGER , & ! FieldType
1090 grid%domdesc , & ! Comm
1091 grid%bdy_mask , & ! bdy_mask
1093 '0' , & ! MemoryOrder
1098 TRIM(p%Description) , & ! Desc
1099 TRIM(p%Units) , & ! Units
1100 "<stdin>" // ' writing 0d integer ' // TRIM(p%VarName) , & ! Debug message
1101 1 , 1 , 1 , 1 , 1 , 1 , &
1102 1 , 1 , 1 , 1 , 1 , 1 , &
1103 1 , 1 , 1 , 1 , 1 , 1 , &
1105 ELSE IF ( p%Type .EQ. 'l' ) THEN
1106 CALL wrf_ext_write_field ( &
1107 fid , & ! DataHandle
1108 current_date(1:19) , & ! DateStr
1109 TRIM(p%DataName) , & ! Data Name
1110 p%lfield_0d , & ! Field
1111 WRF_LOGICAL , & ! FieldType
1113 grid%domdesc , & ! Comm
1114 grid%bdy_mask , & ! bdy_mask
1116 '0' , & ! MemoryOrder
1121 TRIM(p%Description) , & ! Desc
1122 TRIM(p%Units) , & ! Units
1123 "<stdin>" // ' writing 0d logical ' // TRIM(p%VarName) , & ! Debug message
1124 1 , 1 , 1 , 1 , 1 , 1 , &
1125 1 , 1 , 1 , 1 , 1 , 1 , &
1126 1 , 1 , 1 , 1 , 1 , 1 , &
1131 ELSE IF ( p%Ndim .EQ. 1 ) THEN
1132 IF ((p%Restart.AND.switch.EQ.restart_only).OR.on_stream(p%streams,newswitch)) THEN
1133 IF ( in_use_for_config(grid%id,TRIM(p%VarName)) ) THEN
1134 IF (switch.EQ.restart_only.OR.p%Ntl/100.EQ.mod(p%Ntl,100)) THEN
1136 IF (p%Ntl.GT.0.AND.switch.NE.restart_only)dname=dname(1:len(TRIM(dname))-2)
1137 memord = p%MemoryOrder
1138 IF ( p%Type .EQ. 'r' ) THEN
1139 CALL wrf_ext_write_field ( &
1140 fid , & ! DataHandle
1141 current_date(1:19) , & ! DateStr
1142 TRIM(dname) , & ! Data Name
1143 p%rfield_1d , & ! Field
1144 WRF_FLOAT , & ! FieldType
1146 grid%domdesc , & ! Comm
1147 grid%bdy_mask , & ! bdy_mask
1149 TRIM(memord) , & ! MemoryOrder
1150 TRIM(p%Stagger) , & ! Stagger
1151 TRIM(p%dimname1) , & ! Dimname 1
1152 TRIM(p%dimname2) , & ! Dimname 2
1153 TRIM(p%dimname3) , & ! Dimname 3
1154 TRIM(p%Description) , & ! Desc
1155 TRIM(p%Units) , & ! Units
1156 "<stdin>" // ' writing 1d real ' // TRIM(p%VarName) , & ! Debug message
1157 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1158 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1159 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1161 ELSE IF ( p%Type .EQ. 'd' ) THEN
1162 CALL wrf_ext_write_field ( &
1163 fid , & ! DataHandle
1164 current_date(1:19) , & ! DateStr
1165 TRIM(dname) , & ! Data Name
1166 p%dfield_1d , & ! Field
1167 WRF_DOUBLE , & ! FieldType
1169 grid%domdesc , & ! Comm
1170 grid%bdy_mask , & ! bdy_mask
1172 TRIM(memord) , & ! MemoryOrder
1173 TRIM(p%Stagger) , & ! Stagger
1174 TRIM(p%dimname1) , & ! Dimname 1
1175 TRIM(p%dimname2) , & ! Dimname 2
1176 TRIM(p%dimname3) , & ! Dimname 3
1177 TRIM(p%Description) , & ! Desc
1178 TRIM(p%Units) , & ! Units
1179 "<stdin>" // ' writing 1d double ' // TRIM(p%VarName) , & ! Debug message
1180 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1181 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1182 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1184 ELSE IF ( p%Type .EQ. 'i' ) THEN
1185 CALL wrf_ext_write_field ( &
1186 fid , & ! DataHandle
1187 current_date(1:19) , & ! DateStr
1188 TRIM(dname) , & ! Data Name
1189 p%ifield_1d , & ! Field
1190 WRF_INTEGER , & ! FieldType
1192 grid%domdesc , & ! Comm
1193 grid%bdy_mask , & ! bdy_mask
1195 TRIM(memord) , & ! MemoryOrder
1196 TRIM(p%Stagger) , & ! Stagger
1197 TRIM(p%dimname1) , & ! Dimname 1
1198 TRIM(p%dimname2) , & ! Dimname 2
1199 TRIM(p%dimname3) , & ! Dimname 3
1200 TRIM(p%Description) , & ! Desc
1201 TRIM(p%Units) , & ! Units
1202 "<stdin>" // ' writing 1d integer ' // TRIM(p%VarName) , & ! Debug message
1203 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1204 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1205 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1207 ELSE IF ( p%Type .EQ. 'l' ) THEN
1208 CALL wrf_ext_write_field ( &
1209 fid , & ! DataHandle
1210 current_date(1:19) , & ! DateStr
1211 TRIM(dname) , & ! Data Name
1212 p%lfield_1d , & ! Field
1213 WRF_LOGICAL , & ! FieldType
1215 grid%domdesc , & ! Comm
1216 grid%bdy_mask , & ! bdy_mask
1218 TRIM(memord) , & ! MemoryOrder
1219 TRIM(p%Stagger) , & ! Stagger
1220 TRIM(p%dimname1) , & ! Dimname 1
1221 TRIM(p%dimname2) , & ! Dimname 2
1222 TRIM(p%dimname3) , & ! Dimname 3
1223 TRIM(p%Description) , & ! Desc
1224 TRIM(p%Units) , & ! Units
1225 "<stdin>" // ' writing 1d logical ' // TRIM(p%VarName) , & ! Debug message
1226 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1227 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1228 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1234 ELSE IF ( p%Ndim .EQ. 2 ) THEN
1235 IF ((p%Restart.AND.switch.EQ.restart_only).OR.on_stream(p%streams,newswitch)) THEN
1236 IF ( in_use_for_config(grid%id,TRIM(p%VarName)) .AND. &
1237 ( .NOT. p%subgrid_x .OR. (p%subgrid_x .AND. grid%sr_x .GT. 0) ) .AND. &
1238 ( .NOT. p%subgrid_y .OR. (p%subgrid_y .AND. grid%sr_y .GT. 0) ) &
1240 IF (switch.EQ.restart_only.OR.p%Ntl/100.EQ.mod(p%Ntl,100)) THEN
1242 IF (p%Ntl.GT.0.AND.switch.NE.restart_only)dname=dname(1:len(TRIM(dname))-2)
1243 memord = p%MemoryOrder
1244 IF ( p%Type .EQ. 'r' ) THEN
1245 CALL wrf_ext_write_field ( &
1246 fid , & ! DataHandle
1247 current_date(1:19) , & ! DateStr
1248 TRIM(dname) , & ! Data Name
1249 p%rfield_2d , & ! Field
1250 WRF_FLOAT , & ! FieldType
1252 grid%domdesc , & ! Comm
1253 grid%bdy_mask , & ! bdy_mask
1255 TRIM(memord) , & ! MemoryOrder
1256 TRIM(p%Stagger) , & ! Stagger
1257 TRIM(p%dimname1) , & ! Dimname 1
1258 TRIM(p%dimname2) , & ! Dimname 2
1259 TRIM(p%dimname3) , & ! Dimname 3
1260 TRIM(p%Description) , & ! Desc
1261 TRIM(p%Units) , & ! Units
1262 "<stdin>" // ' writing 2d real ' // TRIM(p%VarName) , & ! Debug message
1263 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1264 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1265 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1267 ELSE IF ( p%Type .EQ. 'd' ) THEN
1268 CALL wrf_ext_write_field ( &
1269 fid , & ! DataHandle
1270 current_date(1:19) , & ! DateStr
1271 TRIM(dname) , & ! Data Name
1272 p%dfield_2d , & ! Field
1273 WRF_DOUBLE , & ! FieldType
1275 grid%domdesc , & ! Comm
1276 grid%bdy_mask , & ! bdy_mask
1278 TRIM(memord) , & ! MemoryOrder
1279 TRIM(p%Stagger) , & ! Stagger
1280 TRIM(p%dimname1) , & ! Dimname 1
1281 TRIM(p%dimname2) , & ! Dimname 2
1282 TRIM(p%dimname3) , & ! Dimname 3
1283 TRIM(p%Description) , & ! Desc
1284 TRIM(p%Units) , & ! Units
1285 "<stdin>" // ' writing 2d double ' // TRIM(p%VarName) , & ! Debug message
1286 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1287 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1288 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1290 ELSE IF ( p%Type .EQ. 'i' ) THEN
1291 CALL wrf_ext_write_field ( &
1292 fid , & ! DataHandle
1293 current_date(1:19) , & ! DateStr
1294 TRIM(dname) , & ! Data Name
1295 p%ifield_2d , & ! Field
1296 WRF_INTEGER , & ! FieldType
1298 grid%domdesc , & ! Comm
1299 grid%bdy_mask , & ! bdy_mask
1301 TRIM(memord) , & ! MemoryOrder
1302 TRIM(p%Stagger) , & ! Stagger
1303 TRIM(p%dimname1) , & ! Dimname 1
1304 TRIM(p%dimname2) , & ! Dimname 2
1305 TRIM(p%dimname3) , & ! Dimname 3
1306 TRIM(p%Description) , & ! Desc
1307 TRIM(p%Units) , & ! Units
1308 "<stdin>" // ' writing 2d integer ' // TRIM(p%VarName) , & ! Debug message
1309 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1310 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1311 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1313 ELSE IF ( p%Type .EQ. 'l' ) THEN
1314 CALL wrf_ext_write_field ( &
1315 fid , & ! DataHandle
1316 current_date(1:19) , & ! DateStr
1317 TRIM(dname) , & ! Data Name
1318 p%lfield_2d , & ! Field
1319 WRF_LOGICAL , & ! FieldType
1321 grid%domdesc , & ! Comm
1322 grid%bdy_mask , & ! bdy_mask
1324 TRIM(memord) , & ! MemoryOrder
1325 TRIM(p%Stagger) , & ! Stagger
1326 TRIM(p%dimname1) , & ! Dimname 1
1327 TRIM(p%dimname2) , & ! Dimname 2
1328 TRIM(p%dimname3) , & ! Dimname 3
1329 TRIM(p%Description) , & ! Desc
1330 TRIM(p%Units) , & ! Units
1331 "<stdin>" // ' writing 2d logical ' // TRIM(p%VarName) , & ! Debug message
1332 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1333 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1334 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1340 ELSE IF ( p%Ndim .EQ. 3 ) THEN
1341 IF ((p%Restart.AND.switch.EQ.restart_only).OR.on_stream(p%streams,newswitch)) THEN
1342 IF ( in_use_for_config(grid%id,TRIM(p%VarName)) .AND. &
1343 ( .NOT. p%subgrid_x .OR. (p%subgrid_x .AND. grid%sr_x .GT. 0) ) .AND. &
1344 ( .NOT. p%subgrid_y .OR. (p%subgrid_y .AND. grid%sr_y .GT. 0) ) &
1346 IF (switch.EQ.restart_only.OR.p%Ntl/100.EQ.mod(p%Ntl,100)) THEN
1348 IF (p%Ntl.GT.0.AND.switch.NE.restart_only)dname=dname(1:len(TRIM(dname))-2)
1349 memord = p%MemoryOrder
1350 IF ( p%Type .EQ. 'r' ) THEN
1351 CALL wrf_ext_write_field ( &
1352 fid , & ! DataHandle
1353 current_date(1:19) , & ! DateStr
1354 TRIM(dname) , & ! Data Name
1355 p%rfield_3d , & ! Field
1356 WRF_FLOAT , & ! FieldType
1358 grid%domdesc , & ! Comm
1359 grid%bdy_mask , & ! bdy_mask
1361 TRIM(memord) , & ! MemoryOrder
1362 TRIM(p%Stagger) , & ! Stagger
1363 TRIM(p%dimname1) , & ! Dimname 1
1364 TRIM(p%dimname2) , & ! Dimname 2
1365 TRIM(p%dimname3) , & ! Dimname 3
1366 TRIM(p%Description) , & ! Desc
1367 TRIM(p%Units) , & ! Units
1368 "<stdin>" // ' writing 3d real ' // TRIM(p%VarName) , & ! Debug message
1369 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1370 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1371 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1373 ELSE IF ( p%Type .EQ. 'd' ) THEN
1374 CALL wrf_ext_write_field ( &
1375 fid , & ! DataHandle
1376 current_date(1:19) , & ! DateStr
1377 TRIM(dname) , & ! Data Name
1378 p%dfield_3d , & ! Field
1379 WRF_DOUBLE , & ! FieldType
1381 grid%domdesc , & ! Comm
1382 grid%bdy_mask , & ! bdy_mask
1384 TRIM(memord) , & ! MemoryOrder
1385 TRIM(p%Stagger) , & ! Stagger
1386 TRIM(p%dimname1) , & ! Dimname 1
1387 TRIM(p%dimname2) , & ! Dimname 2
1388 TRIM(p%dimname3) , & ! Dimname 3
1389 TRIM(p%Description) , & ! Desc
1390 TRIM(p%Units) , & ! Units
1391 "<stdin>" // ' writing 3d double ' // TRIM(p%VarName) , & ! Debug message
1392 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1393 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1394 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1396 ELSE IF ( p%Type .EQ. 'i' ) THEN
1397 CALL wrf_ext_write_field ( &
1398 fid , & ! DataHandle
1399 current_date(1:19) , & ! DateStr
1400 TRIM(dname) , & ! Data Name
1401 p%ifield_3d , & ! Field
1402 WRF_INTEGER , & ! FieldType
1404 grid%domdesc , & ! Comm
1405 grid%bdy_mask , & ! bdy_mask
1407 TRIM(memord) , & ! MemoryOrder
1408 TRIM(p%Stagger) , & ! Stagger
1409 TRIM(p%dimname1) , & ! Dimname 1
1410 TRIM(p%dimname2) , & ! Dimname 2
1411 TRIM(p%dimname3) , & ! Dimname 3
1412 TRIM(p%Description) , & ! Desc
1413 TRIM(p%Units) , & ! Units
1414 "<stdin>" // ' writing 3d integer ' // TRIM(p%VarName) , & ! Debug message
1415 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1416 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1417 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1419 ! NOTE no io on logical arrays greater than 2d
1424 ELSE IF ( p%Ndim .EQ. 4 .AND. p%scalar_array ) THEN
1425 IF (switch.EQ.restart_only.OR.p%Ntl/100.EQ.mod(p%Ntl,100)) THEN
1426 ! Use a different write routine, wrf_ext_write_field_arr, and pass in the
1427 ! tracer indeces so that p%rfield_4d can be passsed in without arguments,
1428 ! avoiding the possiblity of a copy-in/copy-out problem for some compilers.
1430 DO itrace = PARAM_FIRST_SCALAR , p%num_table(grid%id)
1431 IF ((p%Restart.AND.switch.EQ.restart_only).OR.on_stream(p%streams_table(grid%id,itrace)%stream,newswitch)) THEN
1432 dname = p%dname_table( grid%id, itrace )
1433 IF (p%Ntl.GT.0.AND.switch.NE.restart_only)dname=dname(1:len(TRIM(dname))-2)
1434 memord = p%MemoryOrder
1435 IF ( p%Type .EQ. 'r' ) THEN
1436 CALL wrf_ext_write_field_arr ( &
1437 fid , & ! DataHandle
1438 current_date(1:19) , & ! DateStr
1439 TRIM(p%dname_table( grid%id, itrace )) , & ! Data Name
1440 p%rfield_4d , & ! Field
1441 itrace, 1, 1, 1 , & ! see comment above
1442 1, 1, 1 , & ! see comment above
1444 WRF_FLOAT , & ! FieldType
1446 grid%domdesc , & ! Comm
1447 grid%bdy_mask , & ! bdy_mask
1449 TRIM(memord) , & ! MemoryOrder
1450 TRIM(p%Stagger) , & ! Stagger
1451 TRIM(p%dimname1) , & ! Dimname 1
1452 TRIM(p%dimname2) , & ! Dimname 2
1453 TRIM(p%dimname3) , & ! Dimname 3
1454 TRIM(p%desc_table( grid%id, itrace)) , & ! Desc
1455 TRIM(p%units_table( grid%id, itrace)) , & ! Units
1456 "<stdin>" // ' writing 4d real ' // TRIM(p%dname_table(grid%id,itrace)) , & ! Debug message
1457 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1458 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1459 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1461 ELSE IF ( p%Type .EQ. 'd' ) THEN
1462 CALL wrf_ext_write_field_arr ( &
1463 fid , & ! DataHandle
1464 current_date(1:19) , & ! DateStr
1465 TRIM(p%dname_table( grid%id, itrace )) , & ! Data Name
1466 p%dfield_4d , & ! Field
1467 itrace, 1, 1, 1 , & ! see comment above
1468 1, 1, 1 , & ! see comment above
1470 WRF_DOUBLE , & ! FieldType
1472 grid%domdesc , & ! Comm
1473 grid%bdy_mask , & ! bdy_mask
1475 TRIM(memord) , & ! MemoryOrder
1476 TRIM(p%Stagger) , & ! Stagger
1477 TRIM(p%dimname1) , & ! Dimname 1
1478 TRIM(p%dimname2) , & ! Dimname 2
1479 TRIM(p%dimname3) , & ! Dimname 3
1480 TRIM(p%desc_table( grid%id, itrace)) , & ! Desc
1481 TRIM(p%units_table( grid%id, itrace)) , & ! Units
1482 "<stdin>" // ' writing 4d double ' // TRIM(p%dname_table(grid%id,itrace)) , & ! Debug message
1483 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1484 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1485 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1487 ELSE IF ( p%Type .EQ. 'i' ) THEN
1488 CALL wrf_ext_write_field_arr ( &
1489 fid , & ! DataHandle
1490 current_date(1:19) , & ! DateStr
1491 TRIM(p%dname_table( grid%id, itrace )) , & ! Data Name
1492 p%ifield_4d , & ! Field
1493 itrace, 1, 1, 1 , & ! see comment above
1494 1, 1, 1 , & ! see comment above
1496 WRF_INTEGER , & ! FieldType
1498 grid%domdesc , & ! Comm
1499 grid%bdy_mask , & ! bdy_mask
1501 TRIM(memord) , & ! MemoryOrder
1502 TRIM(p%Stagger) , & ! Stagger
1503 TRIM(p%dimname1) , & ! Dimname 1
1504 TRIM(p%dimname2) , & ! Dimname 2
1505 TRIM(p%dimname3) , & ! Dimname 3
1506 TRIM(p%desc_table( grid%id, itrace)) , & ! Desc
1507 TRIM(p%units_table( grid%id, itrace)) , & ! Units
1508 "<stdin>" // ' writing 4d integer ' // TRIM(p%dname_table(grid%id,itrace)) , & ! Debug message
1509 p%sd1 , p%ed1 , p%sd2 , p%ed2 , p%sd3 , p%ed3 , &
1510 p%sm1 , p%em1 , p%sm2 , p%em2 , p%sm3 , p%em3 , &
1511 p%sp1 , p%ep1 , p%sp2 , p%ep2 , p%sp3 , p%ep3 , &
1515 ENDDO ! loop over tracers
1516 ENDIF ! if-then-else over dim
1521 CALL wrf_end_io_timestep(fid, ierr)
1523 IF ( switch .EQ. boundary_only ) THEN
1524 CALL wrf_start_io_timestep(fid, ierr)
1525 CALL wrf_debug ( 300 , 'output_wrf: calling code in wrf_bdyout.inc' )
1526 CALL wrf_bdyout( fid , grid , config_flags, switch, dryrun, ierr )
1527 CALL wrf_end_io_timestep(fid, ierr)
1531 IF ( switch .EQ. history_only ) THEN
1533 current_date = current_date_save
1537 #if ( (EM_CORE == 1) && (DA_CORE != 1) )
1538 grid%save_topo_from_real = save_topo_orig
1541 IF ( .NOT. dryrun ) THEN
1542 CALL wrf_debug ( 300 , 'output_wrf: calling wrf_iosync ' )
1543 CALL wrf_iosync ( fid , ierr )
1544 CALL wrf_debug ( 300 , 'output_wrf: back from wrf_iosync ' )
1546 ! If output_ready_flag is set:
1547 ! Write wrfoutReady file if finished dumping
1548 ! history file, unless we're quilting, in which
1549 ! case this file would get dumped before history
1550 ! file was completely written. When quilting
1551 ! this file is written after the file handler
1552 ! is closed in the quilt() subroutine instead of
1553 ! here. (This is diagnosed by checking whether
1554 ! nio_tasks_in_group is zero) GAC 20140321
1556 IF ( switch .EQ. history_only .AND. config_flags%output_ready_flag ) THEN
1557 WRITE ( wrf_err_message , FMT='(I2.2)' ) grid%id
1558 CALL get_nio_tasks_in_group ( grid%id, nio_tasks_per_group )
1559 IF ( nio_tasks_per_group .EQ. 0 ) THEN
1560 OPEN ( UNIT = 99 , &
1561 FILE = 'wrfoutReady_d' // wrf_err_message(1:2) // '_' // TRIM(current_date) , &
1562 STATUS = 'UNKNOWN' , &
1563 ACCESS = 'SEQUENTIAL' )
1569 WRITE(wrf_err_message,*)'output_wrf: end, fid = ',fid
1570 CALL wrf_debug( 300 , wrf_err_message )
1573 END SUBROUTINE output_wrf
1575 SUBROUTINE traverse_statevars_debug (s,l)
1580 TYPE( fieldlist ), POINTER :: p
1581 p => head_grid%head_statevars%next
1582 ! write(0,*)'traverse_statevars_debug called ',TRIM(s),' ',l
1583 DO WHILE ( ASSOCIATED( p ) )
1584 ! IF ( p%Ndim .EQ. 4 .AND. p%scalar_array ) THEN
1585 ! DO itrace = PARAM_FIRST_SCALAR , p%num_table(1)
1586 !write(0,*)TRIM(s),l, itrace, p%streams_table(1,itrace)%stream
1589 ! if ( TRIM(p%VarName) .EQ. 'store_rand' .OR. TRIM(p%VarName) .EQ. 'STORE_RAND' ) then
1590 ! write(0,*)'traverse_statevars_debug sees ',TRIM(p%VarName),' >',p%Type,'<'
1595 END SUBROUTINE traverse_statevars_debug