1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2 ! This routine prints out the current value of variables at all specified
3 ! track locations that are within the current patch.
5 ! Jeff Lee -- 25 June 2009
6 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7 SUBROUTINE track_driver( grid )
11 USE module_state_description
12 USE module_scalar_tables
13 USE module_model_constants
19 TYPE (domain), INTENT(INOUT) :: grid
21 LOGICAL, EXTERNAL :: wrf_dm_on_monitor
32 TYPE(WRFU_Time) :: xcurrent_time, track_time_test
33 CHARACTER (LEN=132) :: message
34 CHARACTER (LEN=19) :: xcurrent_timestr
35 CHARACTER (LEN=19) :: chem_name
37 !============================================================================================
39 IF ( grid%track_loc_domain <= 0 ) RETURN ! no valid location
42 IF ( grid%dfi_opt /= DFI_NODFI .AND. grid%dfi_stage /= DFI_FST ) RETURN
45 ! get the next valid track time
47 n = grid%track_next_time
49 IF ( grid%track_next_time > grid%track_loc_domain ) RETURN ! all track locations done
53 CALL wrf_atotime( grid%track_time_domain(n), track_time_test )
55 ! get the current time
57 CALL domain_clock_get( grid, current_time=xcurrent_time, current_timestr=xcurrent_timestr )
59 IF ( track_time_test .NE. xcurrent_time ) RETURN ! track time does not match current time
61 ! track time matches current time
63 write(message,*) 'track_driver: current_time = ',xcurrent_timestr
64 call wrf_message( trim(message) )
66 level = grid%em32-grid%sm32
67 level_stag = grid%em32-grid%sm32+1
69 level_zref = model_config_rec%track_tuv_lev
70 num_tuv = model_config_rec%track_tuv_num
71 num_rad = model_config_rec%track_rad_num
77 IF (grid%sp31 <= ix .AND. ix <= grid%ep31 .AND. &
78 grid%sp33 <= iy .AND. iy <= grid%ep33) THEN
80 !-- output chemical species
83 IF ( model_config_rec%chem_opt(grid%id) > 0 .and. grid%track_chem_num > 0 ) THEN
84 do m= 1,grid%track_chem_num
85 chem_name = TRIM(model_config_rec%track_chem_name(m))
87 if (chem_name .eq. TRIM(chem_dname_table( grid%id, i ))) then
88 grid%track_chem(m,n,grid%sm32:grid%em32-1) = grid%chem(ix,grid%sm32:grid%em32-1,iy,i)
90 ! print*,'track_chem_name,pointer = ',chem_name, i
91 ! print*,'track_chem =',grid%track_chem(m,n,grid%sm32:grid%em32-1)
97 grid%track_o31d (n,grid%sm32:grid%em32-1) = grid%ph_o31d (ix,grid%sm32:grid%em32-1,iy)
98 grid%track_o33p (n,grid%sm32:grid%em32-1) = grid%ph_o33p (ix,grid%sm32:grid%em32-1,iy)
99 grid%track_no2 (n,grid%sm32:grid%em32-1) = grid%ph_no2 (ix,grid%sm32:grid%em32-1,iy)
100 grid%track_hno2 (n,grid%sm32:grid%em32-1) = grid%ph_hno2 (ix,grid%sm32:grid%em32-1,iy)
101 grid%track_hno3 (n,grid%sm32:grid%em32-1) = grid%ph_hno3 (ix,grid%sm32:grid%em32-1,iy)
102 grid%track_h2o2 (n,grid%sm32:grid%em32-1) = grid%ph_h2o2 (ix,grid%sm32:grid%em32-1,iy)
103 grid%track_ch3o2h(n,grid%sm32:grid%em32-1) = grid%ph_ch3o2h(ix,grid%sm32:grid%em32-1,iy)
105 if (model_config_rec%phot_opt(grid%id) == 3) then
107 grid%track_radfld(n,i,1:level_zref) = grid%radfld(ix,1:level_zref,iy,i)
111 grid%track_adjcoe(n,i,1:level_zref) = grid%adjcoe(ix,1:level_zref,iy,i)
112 grid%track_phrate(n,i,1:level_zref) = grid%phrate(ix,1:level_zref,iy,i)
120 grid%track_z(n,grid%sm32:grid%em32-1) = grid%z(ix,grid%sm32:grid%em32-1,iy)
121 grid%track_p(n,grid%sm32:grid%em32-1) = grid%p(ix,grid%sm32:grid%em32-1,iy) + &
122 grid%pb(ix,grid%sm32:grid%em32-1,iy)
123 if ( grid%use_theta_m == 1 ) then
124 grid%track_t(n,grid%sm32:grid%em32-1) = (grid%t_2(ix,grid%sm32:grid%em32-1,iy) + t0 ) * &
125 (grid%track_p(n,grid%sm32:grid%em32-1)/p1000mb)**rcp / &
126 (1.+R_v/R_d*grid%moist(ix,grid%sm32:grid%em32-1,iy,P_QV))
128 grid%track_t(n,grid%sm32:grid%em32-1) = (grid%t_2(ix,grid%sm32:grid%em32-1,iy) + t0 ) * &
129 (grid%track_p(n,grid%sm32:grid%em32-1)/p1000mb)**rcp
131 grid%track_u(n,grid%sm32:grid%em32-1) = (grid%u_2(ix,grid%sm32:grid%em32-1,iy) + &
132 grid%u_2(ix+1,grid%sm32:grid%em32-1,iy) )*0.5
133 grid%track_v(n,grid%sm32:grid%em32-1) = (grid%v_2(ix,grid%sm32:grid%em32-1,iy) + &
134 grid%v_2(ix,grid%sm32:grid%em32-1,iy+1) )*0.5
135 grid%track_w(n,grid%sm32:grid%em32) = grid%w_2(ix,grid%sm32:grid%em32,iy)
136 grid%track_rh(n,grid%sm32:grid%em32-1) = MIN( 1.00,grid%moist(ix,grid%sm32:grid%em32-1,iy,P_QV) / &
137 (3.80*exp(17.27*(grid%track_t(n,grid%sm32:grid%em32-1)-273.)/ &
138 (grid%track_t(n,grid%sm32:grid%em32-1)-36.))/ &
139 (.01*grid%track_p(n,grid%sm32:grid%em32-1))) )
140 grid%track_alt(n,grid%sm32:grid%em32-1) = grid%alt(ix,grid%sm32:grid%em32-1,iy)
141 grid%track_qcloud(n,grid%sm32:grid%em32-1) = grid%moist(ix,grid%sm32:grid%em32-1,iy,P_QC)
142 grid%track_qrain (n,grid%sm32:grid%em32-1) = grid%moist(ix,grid%sm32:grid%em32-1,iy,P_QR)
143 grid%track_qice (n,grid%sm32:grid%em32-1) = grid%moist(ix,grid%sm32:grid%em32-1,iy,P_QI)
144 grid%track_qsnow (n,grid%sm32:grid%em32-1) = grid%moist(ix,grid%sm32:grid%em32-1,iy,P_QS)
145 grid%track_qgraup(n,grid%sm32:grid%em32-1) = grid%moist(ix,grid%sm32:grid%em32-1,iy,P_QG)
146 grid%track_qvapor(n,grid%sm32:grid%em32-1) = grid%moist(ix,grid%sm32:grid%em32-1,iy,P_QV)
148 ! print*,'track_z =',grid%track_z(n,grid%sm32:grid%em32-1)
152 !-- this section must have.
156 #if ( WRF_CHEM == 1 )
158 IF ( model_config_rec%chem_opt(grid%id) > 0 .and. grid%track_chem_num > 0 ) THEN
159 do m= 1,grid%track_chem_num
160 grid%track_chem(m,n,grid%sm32:grid%em32-1) = 1.E30
163 grid%track_o31d (n,grid%sm32:grid%em32-1) = 1.E30
164 grid%track_o33p (n,grid%sm32:grid%em32-1) = 1.E30
165 grid%track_no2 (n,grid%sm32:grid%em32-1) = 1.E30
166 grid%track_hno2 (n,grid%sm32:grid%em32-1) = 1.E30
167 grid%track_hno3 (n,grid%sm32:grid%em32-1) = 1.E30
168 grid%track_h2o2 (n,grid%sm32:grid%em32-1) = 1.E30
169 grid%track_ch3o2h(n,grid%sm32:grid%em32-1) = 1.E30
171 if (model_config_rec%phot_opt(grid%id) == 3) then
172 grid%track_radfld(n,1:num_rad,1:level_zref) = 1.E30
173 grid%track_adjcoe(n,1:num_tuv,1:level_zref) = 1.E30
174 grid%track_phrate(n,1:num_tuv,1:level_zref) = 1.E30
181 grid%track_z (n,grid%sm32:grid%em32-1) = 1.E30
182 grid%track_p (n,grid%sm32:grid%em32-1) = 1.E30
183 grid%track_t (n,grid%sm32:grid%em32-1) = 1.E30
184 grid%track_u (n,grid%sm32:grid%em32-1) = 1.E30
185 grid%track_v (n,grid%sm32:grid%em32-1) = 1.E30
186 grid%track_w (n,grid%sm32:grid%em32) = 1.E30
187 grid%track_rh (n,grid%sm32:grid%em32-1) = 1.E30
188 grid%track_alt (n,grid%sm32:grid%em32-1) = 1.E30
190 grid%track_qcloud(n,grid%sm32:grid%em32-1) = 1.E30
191 grid%track_qrain (n,grid%sm32:grid%em32-1) = 1.E30
192 grid%track_qice (n,grid%sm32:grid%em32-1) = 1.E30
193 grid%track_qsnow (n,grid%sm32:grid%em32-1) = 1.E30
194 grid%track_qgraup(n,grid%sm32:grid%em32-1) = 1.E30
195 grid%track_qvapor(n,grid%sm32:grid%em32-1) = 1.E30
199 !-- write output to file
201 ! write (*,*) 'grid%track_next_time = ', grid%track_next_time
203 if ( grid%track_next_time == grid%track_loc_domain ) then
204 ! write (*,*) 'grid%track_loc_domain = ', grid%track_loc_domain
205 ! write (*,*) 'track_driver: calling write_track'
207 call write_track(grid)
209 write (*,*) 'track_driver: DONE write_track'
212 grid%track_next_time = grid%track_next_time + 1
216 END SUBROUTINE track_driver
219 SUBROUTINE write_track( grid )
229 TYPE (domain), INTENT(INOUT) :: grid
231 LOGICAL, EXTERNAL :: wrf_dm_on_monitor
232 INTEGER, EXTERNAL :: get_unused_unit
237 INTEGER :: level_stag
238 INTEGER :: level_zref
245 CHARACTER (LEN=19) :: track_output
246 CHARACTER (LEN=19) :: chem_name
248 character (len=40) :: description
249 character (len=40) :: units
251 integer, parameter :: DateStrLen = 19
254 integer :: level_stag_dim
255 integer :: level_zref_dim
259 integer :: var_dim(3)
265 REAL, ALLOCATABLE, DIMENSION(:,:) :: track_buf2
266 #if ( WRF_CHEM == 1 )
267 REAL, ALLOCATABLE, DIMENSION(:,:,:) :: track_buf3
271 !====================================================================================
273 !We actually always need to include 'netcdf.inc',
274 !as this routine won't compile without netcdf.
283 IF ( grid%track_loc_domain .LE. 0 ) RETURN
286 IF ( grid%dfi_opt /= DFI_NODFI .AND. grid%dfi_stage /= DFI_FST ) RETURN
289 level = grid%em32 - grid%sm32
290 level_stag = grid%em32 - grid%sm32 + 1
292 level_zref = model_config_rec%track_tuv_lev
293 num_tuv = model_config_rec%track_tuv_num
294 num_rad = model_config_rec%track_rad_num
299 ALLOCATE(track_buf2(grid%track_loc_in, level))
301 !--put z output in grid%track_z(:,:)
303 track_buf2(:,:) = grid%track_z(:,:)
304 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_z(:,:),grid%track_loc_in*level)
306 track_buf2(:,:) = grid%track_p(:,:)
307 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_p(:,:),grid%track_loc_in*level)
309 track_buf2(:,:) = grid%track_t(:,:)
310 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_t(:,:),grid%track_loc_in*level)
312 track_buf2(:,:) = grid%track_u(:,:)
313 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_u(:,:),grid%track_loc_in*level)
315 track_buf2(:,:) = grid%track_v(:,:)
316 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_v(:,:),grid%track_loc_in*level)
318 ! track_buf2(:,:) = grid%track_w(:,:)
319 ! CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_w(:,:),grid%track_loc_in*level)
321 track_buf2(:,:) = grid%track_rh(:,:)
322 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_rh(:,:),grid%track_loc_in*level)
324 track_buf2(:,:) = grid%track_alt(:,:)
325 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_alt(:,:),grid%track_loc_in*level)
327 track_buf2(:,:) = grid%track_qcloud(:,:)
328 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_qcloud(:,:),grid%track_loc_in*level)
330 track_buf2(:,:) = grid%track_qrain(:,:)
331 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_qrain(:,:),grid%track_loc_in*level)
333 track_buf2(:,:) = grid%track_qice(:,:)
334 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_qice(:,:),grid%track_loc_in*level)
336 track_buf2(:,:) = grid%track_qsnow(:,:)
337 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_qsnow(:,:),grid%track_loc_in*level)
339 track_buf2(:,:) = grid%track_qgraup(:,:)
340 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_qgraup(:,:),grid%track_loc_in*level)
342 track_buf2(:,:) = grid%track_qvapor(:,:)
343 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_qvapor(:,:),grid%track_loc_in*level)
345 #if ( WRF_CHEM == 1 )
346 IF (model_config_rec%chem_opt(grid%id) > 0) THEN
348 track_buf2(:,:) = grid%track_o31d(:,:)
349 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_o31d(:,:),grid%track_loc_in*level)
351 track_buf2(:,:) = grid%track_o33p(:,:)
352 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_o33p(:,:),grid%track_loc_in*level)
354 track_buf2(:,:) = grid%track_no2(:,:)
355 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_no2(:,:),grid%track_loc_in*level)
357 track_buf2(:,:) = grid%track_hno2(:,:)
358 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_hno2(:,:),grid%track_loc_in*level)
360 track_buf2(:,:) = grid%track_hno3(:,:)
361 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_hno3(:,:),grid%track_loc_in*level)
363 track_buf2(:,:) = grid%track_h2o2(:,:)
364 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_h2o2(:,:),grid%track_loc_in*level)
366 track_buf2(:,:) = grid%track_ch3o2h(:,:)
367 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_ch3o2h(:,:),grid%track_loc_in*level)
372 DEALLOCATE(track_buf2)
374 ALLOCATE(track_buf2(grid%track_loc_in, level_stag))
376 track_buf2(:,:) = grid%track_w(:,:)
377 CALL wrf_dm_min_reals(track_buf2(:,:),grid%track_w(:,:),grid%track_loc_in*level_stag)
379 DEALLOCATE(track_buf2)
381 #if ( WRF_CHEM == 1 )
383 !--put chem output in grid%track_chem(:,:,:)
385 IF ( model_config_rec%chem_opt(grid%id) > 0 .and. grid%track_chem_num > 0 ) THEN
387 ALLOCATE(track_buf3(grid%track_chem_num, grid%track_loc_in, level))
389 track_buf3(:,:,:) = grid%track_chem(:,:,:)
390 CALL wrf_dm_min_reals(track_buf3(:,:,:),grid%track_chem(:,:,:),grid%track_chem_num*grid%track_loc_in*level)
392 DEALLOCATE(track_buf3)
394 if (model_config_rec%phot_opt(grid%id) == 3) then
396 ALLOCATE(track_buf3(grid%track_loc_in, num_rad, level_zref))
398 track_buf3(:,:,:) = grid%track_radfld(:,:,:)
399 CALL wrf_dm_min_reals(track_buf3(:,:,:),grid%track_radfld(:,:,:),grid%track_loc_in*num_rad*level_zref)
401 DEALLOCATE(track_buf3)
403 ALLOCATE(track_buf3(grid%track_loc_in, num_tuv, level_zref))
405 track_buf3(:,:,:) = grid%track_adjcoe(:,:,:)
406 CALL wrf_dm_min_reals(track_buf3(:,:,:),grid%track_adjcoe(:,:,:),grid%track_loc_in*num_tuv*level_zref)
408 track_buf3(:,:,:) = grid%track_phrate(:,:,:)
409 CALL wrf_dm_min_reals(track_buf3(:,:,:),grid%track_phrate(:,:,:),grid%track_loc_in*num_tuv*level_zref)
411 DEALLOCATE(track_buf3)
420 IF ( wrf_dm_on_monitor() ) THEN
424 ! ncid = get_unused_unit()
425 ! if ( ncid <= 0 ) then
426 ! call wrf_error_fatal('write_track: ERROR: could not find a free Fortran unit.')
429 !-- get output file name
431 write (track_output,'(A)') trim('wrfout_track_d00')
432 i = len_trim(track_output)
433 write ( track_output(i-1:i), '(I2.2)') grid%id
435 !-- create necdf file
437 astat = NF_CREATE(track_output, NF_CLOBBER, ncid)
438 if (astat .ne. NF_NOERR) then
442 !-- define dimensions
444 astat = NF_DEF_DIM(ncid, 'time' , NF_UNLIMITED , time_dim )
445 astat = NF_DEF_DIM(ncid, 'level' , level , level_dim)
446 astat = NF_DEF_DIM(ncid, 'DateStrLen' , DateStrLen , Times_dim)
447 astat = NF_DEF_DIM(ncid, 'level_stag' , level_stag , level_stag_dim)
449 #if ( WRF_CHEM == 1 )
450 IF ( model_config_rec%chem_opt(grid%id) > 0 .and. model_config_rec%phot_opt(grid%id) == 3 ) THEN
451 astat = NF_DEF_DIM(ncid, 'level_zref' , level_zref , level_zref_dim)
452 astat = NF_DEF_DIM(ncid, 'num_rad' , num_rad , rad_dim)
453 astat = NF_DEF_DIM(ncid, 'num_tuv' , num_tuv , tuv_dim)
457 !-- define Times variable
459 var_dim(1) = Times_dim
460 var_dim(2) = time_dim
462 astat = NF_DEF_VAR(ncid,'Times', NF_CHAR, 2, var_dim(1:2), var_id)
464 !-- define 1-D variables
466 #if ( WRF_CHEM == 1 )
467 IF ( model_config_rec%chem_opt(grid%id) > 0 .and. model_config_rec%phot_opt(grid%id) == 3 ) THEN
469 description = 'Wavelength'
471 astat = NF_DEF_VAR(ncid, 'wc' , NF_REAL, 1, rad_dim, var_id )
472 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
473 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
475 description = 'Reference height'
477 astat = NF_DEF_VAR(ncid, 'zref' , NF_REAL, 1, level_zref_dim, var_id )
478 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
479 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
485 description = 'LATITUDE, SOUTH IS NEGATIVE'
486 units = 'degree_north'
487 astat = NF_DEF_VAR(ncid, 'lat' , NF_REAL, 1, time_dim, var_id )
488 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
489 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
491 description = 'LONGITUDE, WEST IS NEGATIVE'
492 units = 'degree_east'
493 astat = NF_DEF_VAR(ncid, 'lon' , NF_REAL, 1, time_dim, var_id )
494 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
495 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
497 description = 'grid_i, longitude direction '
499 astat = NF_DEF_VAR(ncid, 'grid_i' , NF_INT, 1, time_dim, var_id )
500 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
501 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
503 description = 'grid_j, latitude direction '
505 astat = NF_DEF_VAR(ncid, 'grid_j' , NF_INT, 1, time_dim, var_id )
506 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
507 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
509 description = 'elevation'
511 astat = NF_DEF_VAR(ncid, 'ele' , NF_REAL, 1, time_dim, var_id )
512 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
513 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
515 !-- define 2-D variables
517 var_dim(1) = level_dim
518 var_dim(2) = time_dim
520 description = 'height'
522 astat = NF_DEF_VAR(ncid, 'z', NF_REAL, 2 , var_dim(1:2), var_id )
523 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
524 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
526 description = 'pressure'
528 astat = NF_DEF_VAR(ncid, 'p', NF_REAL, 2 , var_dim(1:2), var_id )
529 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
530 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
532 description = 'temperature'
534 astat = NF_DEF_VAR(ncid, 't', NF_REAL, 2 , var_dim(1:2), var_id )
535 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
536 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
538 description = 'x-wind component'
540 astat = NF_DEF_VAR(ncid, 'u', NF_REAL, 2 , var_dim(1:2), var_id )
541 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
542 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
544 description = 'y-wind component'
546 astat = NF_DEF_VAR(ncid, 'v', NF_REAL, 2 , var_dim(1:2), var_id )
547 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
548 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
550 ! description = 'z-wind component'
552 ! astat = NF_DEF_VAR(ncid, 'w', NF_REAL, 2 , var_dim(1:2), var_id )
553 ! astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
554 ! astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
556 description = 'relative humidity'
558 astat = NF_DEF_VAR(ncid, 'rh', NF_REAL, 2 , var_dim(1:2), var_id )
559 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
560 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
562 description = 'inverse density'
564 astat = NF_DEF_VAR(ncid, 'alt', NF_REAL, 2 , var_dim(1:2), var_id )
565 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
566 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
568 description = 'Cloud water mixing ratio'
570 astat = NF_DEF_VAR(ncid, 'qcloud', NF_REAL, 2 , var_dim(1:2), var_id )
571 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
572 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
574 description = 'Rain water mixing ratio'
576 astat = NF_DEF_VAR(ncid, 'qrain', NF_REAL, 2 , var_dim(1:2), var_id )
577 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
578 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
580 description = 'Ice mixing ratio'
582 astat = NF_DEF_VAR(ncid, 'qice', NF_REAL, 2 , var_dim(1:2), var_id )
583 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
584 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
586 description = 'Snow mixing ratio'
588 astat = NF_DEF_VAR(ncid, 'qsnow', NF_REAL, 2 , var_dim(1:2), var_id )
589 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
590 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
592 description = 'Graupel mixing ratio'
594 astat = NF_DEF_VAR(ncid, 'qgraup', NF_REAL, 2 , var_dim(1:2), var_id )
595 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
596 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
598 description = 'Water vapor mixing ratio'
600 astat = NF_DEF_VAR(ncid, 'qvapor', NF_REAL, 2 , var_dim(1:2), var_id )
601 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
602 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
604 #if ( WRF_CHEM == 1 )
606 IF ( model_config_rec%chem_opt(grid%id) > 0 .and. grid%track_chem_num > 0 ) THEN
609 do m= 1,grid%track_chem_num
610 chem_name = trim(model_config_rec%track_chem_name(m))
611 description = trim(chem_name) // ' concentration'
612 astat = NF_DEF_VAR(ncid, trim(chem_name), NF_REAL, 2, var_dim(1:2), var_id )
613 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
614 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
619 chem_name = 'photr_o31d'
620 description = 'O31D Photolysis Rate'
621 astat = NF_DEF_VAR(ncid, trim(chem_name), NF_REAL, 2, var_dim(1:2), var_id )
622 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
623 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
625 chem_name = 'photr_o33p'
626 description = 'O33P Photolysis Rate'
627 astat = NF_DEF_VAR(ncid, trim(chem_name), NF_REAL, 2, var_dim(1:2), var_id )
628 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
629 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
631 chem_name = 'photr_no2'
632 description = 'NO2 Photolysis Rate'
633 astat = NF_DEF_VAR(ncid, trim(chem_name), NF_REAL, 2, var_dim(1:2), var_id )
634 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
635 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
637 chem_name = 'photr_hno2'
638 description = 'HNO2 Photolysis Rate'
639 astat = NF_DEF_VAR(ncid, trim(chem_name), NF_REAL, 2, var_dim(1:2), var_id )
640 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
641 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
643 chem_name = 'photr_hno3'
644 description = 'HNO3 Photolysis Rate'
645 astat = NF_DEF_VAR(ncid, trim(chem_name), NF_REAL, 2, var_dim(1:2), var_id )
646 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
647 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
649 chem_name = 'photr_h2o2'
650 description = 'H2O2 Photolysis Rate'
651 astat = NF_DEF_VAR(ncid, trim(chem_name), NF_REAL, 2, var_dim(1:2), var_id )
652 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
653 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
655 chem_name = 'photr_ch3o2h'
656 description = 'CH3O2H Photolysis Rate'
657 astat = NF_DEF_VAR(ncid, trim(chem_name), NF_REAL, 2, var_dim(1:2), var_id )
658 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
659 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
661 if (model_config_rec%phot_opt(grid%id) == 3 ) then
665 var_dim(1) = level_zref_dim
667 var_dim(3) = time_dim
669 description = 'radfld'
670 astat = NF_DEF_VAR(ncid, trim(chem_name), NF_REAL, 3, var_dim(1:3), var_id )
671 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
672 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
674 var_dim(1) = level_zref_dim
676 var_dim(3) = time_dim
678 description = 'adjcoe'
679 astat = NF_DEF_VAR(ncid, trim(chem_name), NF_REAL, 3, var_dim(1:3), var_id )
680 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
681 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
683 var_dim(1) = level_zref_dim
685 var_dim(3) = time_dim
687 description = 'phrate'
688 astat = NF_DEF_VAR(ncid, trim(chem_name), NF_REAL, 3, var_dim(1:3), var_id )
689 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
690 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
698 var_dim(1) = level_stag_dim
699 var_dim(2) = time_dim
700 description = 'z-wind component'
702 astat = NF_DEF_VAR(ncid, 'w', NF_REAL, 2 , var_dim(1:2), var_id )
703 astat = NF_PUT_ATT_TEXT(ncid,var_id,'description', len_trim(description),description)
704 astat = NF_PUT_ATT_TEXT(ncid,var_id,'units', len_trim(units), units )
708 astat = NF_ENDDEF(ncid)
710 !-- write Times variable
714 count(1) = DateStrLen
717 astat = NF_INQ_VARID(ncid,'Times',var_id)
718 do m= 1,grid%track_loc_domain
720 astat = NF_PUT_VARA_TEXT(ncid,var_id,start,count,grid%track_time_domain(m))
722 write (*,*) 'var_id,grid%track_time_domain = ', var_id,grid%track_time_domain
724 !-- write 1-D variables
726 #if ( WRF_CHEM == 1 )
727 IF ( model_config_rec%chem_opt(grid%id) > 0 .and. grid%track_chem_num > 0 ) THEN
728 if ( model_config_rec%phot_opt(grid%id) == 3 )then
733 astat = NF_INQ_VARID(ncid,'wc',var_id)
734 astat = NF_PUT_VARA_REAL(ncid,var_id,start(2),count(2),grid%track_wc)
737 count(2) = level_zref
739 astat = NF_INQ_VARID(ncid,'zref',var_id)
740 astat = NF_PUT_VARA_REAL(ncid,var_id,start(2),count(2),grid%track_zref)
749 count(2) = grid%track_loc_domain
751 astat = NF_INQ_VARID(ncid,'lat',var_id)
752 astat = NF_PUT_VARA_REAL(ncid,var_id,start(2),count(2),grid%track_lat_domain)
753 write (*,*) 'var_id,grid%track_lat_domain = ', var_id,grid%track_lat_domain
755 astat = NF_INQ_VARID(ncid,'lon',var_id)
756 astat = NF_PUT_VARA_REAL(ncid,var_id,start(2),count(2),grid%track_lon_domain)
757 write (*,*) 'var_id,grid%track_lon_domain = ', var_id,grid%track_lon_domain
759 astat = NF_INQ_VARID(ncid,'grid_i',var_id)
760 astat = NF_PUT_VARA_INT(ncid,var_id,start(2),count(2),grid%track_i)
762 astat = NF_INQ_VARID(ncid,'grid_j',var_id)
763 astat = NF_PUT_VARA_INT(ncid,var_id,start(2),count(2),grid%track_j)
765 astat = NF_INQ_VARID(ncid,'ele',var_id)
766 astat = NF_PUT_VARA_REAL(ncid,var_id,start(2),count(2),grid%track_ele)
767 write (*,*) 'var_id,grid%track_ele = ', var_id,grid%track_ele
769 !-- write 2-D variables
776 astat = NF_INQ_VARID(ncid,'z',var_id)
777 do m= 1,grid%track_loc_domain
779 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_z(m,:))
782 astat = NF_INQ_VARID(ncid,'p',var_id)
783 do m= 1,grid%track_loc_domain
785 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_p(m,:))
788 astat = NF_INQ_VARID(ncid,'t',var_id)
789 do m= 1,grid%track_loc_domain
791 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_t(m,:))
794 astat = NF_INQ_VARID(ncid,'u',var_id)
795 do m= 1,grid%track_loc_domain
797 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_u(m,:))
800 astat = NF_INQ_VARID(ncid,'v',var_id)
801 do m= 1,grid%track_loc_domain
803 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_v(m,:))
806 ! astat = NF_INQ_VARID(ncid,'w',var_id)
807 ! do m= 1,grid%track_loc_domain
809 ! astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_w(m,:))
812 astat = NF_INQ_VARID(ncid,'rh',var_id)
813 do m= 1,grid%track_loc_domain
815 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_rh(m,:))
818 astat = NF_INQ_VARID(ncid,'alt',var_id)
819 do m= 1,grid%track_loc_domain
821 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_alt(m,:))
824 astat = NF_INQ_VARID(ncid,'qcloud',var_id)
825 do m= 1,grid%track_loc_domain
827 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_qcloud(m,:))
830 astat = NF_INQ_VARID(ncid,'qrain',var_id)
831 do m= 1,grid%track_loc_domain
833 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_qrain(m,:))
836 astat = NF_INQ_VARID(ncid,'qice',var_id)
837 do m= 1,grid%track_loc_domain
839 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_qice(m,:))
842 astat = NF_INQ_VARID(ncid,'qsnow',var_id)
843 do m= 1,grid%track_loc_domain
845 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_qsnow(m,:))
848 astat = NF_INQ_VARID(ncid,'qgraup',var_id)
849 do m= 1,grid%track_loc_domain
851 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_qgraup(m,:))
854 astat = NF_INQ_VARID(ncid,'qvapor',var_id)
855 do m= 1,grid%track_loc_domain
857 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_qvapor(m,:))
860 #if ( WRF_CHEM == 1 )
862 IF ( model_config_rec%chem_opt(grid%id) > 0 .and. grid%track_chem_num > 0 ) THEN
864 do n= 1,grid%track_chem_num
865 chem_name = trim(model_config_rec%track_chem_name(n))
866 astat = NF_INQ_VARID(ncid,trim(chem_name),var_id)
868 do m= 1,grid%track_loc_domain
870 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_chem(n,m,:))
873 ! write (*,*) 'n, var_id, chem_name = ', n, var_id, trim(chem_name)
877 astat = NF_INQ_VARID(ncid,'photr_o31d',var_id)
878 do m= 1,grid%track_loc_domain
880 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_o31d(m,:))
883 astat = NF_INQ_VARID(ncid,'photr_o33p',var_id)
884 do m= 1,grid%track_loc_domain
886 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_o33p(m,:))
889 astat = NF_INQ_VARID(ncid,'photr_no2',var_id)
890 do m= 1,grid%track_loc_domain
892 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_no2(m,:))
895 astat = NF_INQ_VARID(ncid,'photr_hno2',var_id)
896 do m= 1,grid%track_loc_domain
898 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_hno2(m,:))
901 astat = NF_INQ_VARID(ncid,'photr_hno3',var_id)
902 do m= 1,grid%track_loc_domain
904 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_hno3(m,:))
907 astat = NF_INQ_VARID(ncid,'photr_h2o2',var_id)
908 do m= 1,grid%track_loc_domain
910 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_h2o2(m,:))
913 astat = NF_INQ_VARID(ncid,'photr_ch3o2h',var_id)
914 do m= 1,grid%track_loc_domain
916 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_ch3o2h(m,:))
919 if (model_config_rec%phot_opt(grid%id) == 3 ) then
924 count(1) = level_zref
928 astat = NF_INQ_VARID(ncid,'radfld',var_id)
929 do m= 1,grid%track_loc_domain
933 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:3),count(1:3),grid%track_radfld(m,n,:))
937 astat = NF_INQ_VARID(ncid,'adjcoe',var_id)
938 do m= 1,grid%track_loc_domain
942 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:3),count(1:3),grid%track_adjcoe(m,n,:))
946 astat = NF_INQ_VARID(ncid,'phrate',var_id)
947 do m= 1,grid%track_loc_domain
951 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:3),count(1:3),grid%track_phrate(m,n,:))
963 count(1) = level_stag
966 astat = NF_INQ_VARID(ncid,'w',var_id)
967 do m= 1,grid%track_loc_domain
969 astat = NF_PUT_VARA_REAL(ncid,var_id,start(1:2),count(1:2),grid%track_w(m,:))
972 !-- close output unit
974 astat = NF_CLOSE(ncid)
978 grid%track_next_time = 1
981 END SUBROUTINE write_track
983 SUBROUTINE calc_track_locations( grid )
993 TYPE (domain), INTENT(INOUT) :: grid
996 LOGICAL, EXTERNAL :: wrf_dm_on_monitor
999 INTEGER :: track_loc_temp
1000 INTEGER :: i, k, iunit
1001 REAL :: track_rx, track_ry
1002 REAL :: known_lat, known_lon
1003 CHARACTER (LEN=132) :: message
1004 TYPE (PROJ_INFO) :: track_proj
1005 TYPE (grid_config_rec_type) :: config_flags
1007 INTEGER :: ids, ide, jds, jde, kds, kde, &
1008 ims, ime, jms, jme, kms, kme, &
1009 ips, ipe, jps, jpe, kps, kpe, &
1010 imsx, imex, jmsx, jmex, kmsx, kmex, &
1011 ipsx, ipex, jpsx, jpex, kpsx, kpex, &
1012 imsy, imey, jmsy, jmey, kmsy, kmey, &
1013 ipsy, ipey, jpsy, jpey, kpsy, kpey
1015 IF ( grid%track_loc <= 0 ) then
1019 #if ( DA_CORE != 1 )
1020 IF ( grid%dfi_stage == DFI_FST ) THEN
1022 CALL get_ijk_from_grid ( grid , &
1023 ids, ide, jds, jde, kds, kde, &
1024 ims, ime, jms, jme, kms, kme, &
1025 ips, ipe, jps, jpe, kps, kpe, &
1026 imsx, imex, jmsx, jmex, kmsx, kmex, &
1027 ipsx, ipex, jpsx, jpex, kpsx, kpex, &
1028 imsy, imey, jmsy, jmey, kmsy, kmey, &
1029 ipsy, ipey, jpsy, jpey, kpsy, kpey )
1031 CALL model_to_grid_config_rec ( grid%id , model_config_rec , config_flags )
1033 ! Set up map transformation structure
1034 CALL map_init(track_proj)
1036 IF (ips <= 1 .AND. 1 <= ipe .AND. &
1037 jps <= 1 .AND. 1 <= jpe) THEN
1038 known_lat = grid%xlat(1,1)
1039 known_lon = grid%xlong(1,1)
1044 known_lat = wrf_dm_min_real(known_lat)
1045 known_lon = wrf_dm_min_real(known_lon)
1048 IF (config_flags%map_proj == PROJ_MERC) THEN
1049 CALL map_set(PROJ_MERC, track_proj, &
1050 truelat1 = config_flags%truelat1, &
1055 dx = config_flags%dx)
1058 ELSE IF (config_flags%map_proj == PROJ_LC) THEN
1059 CALL map_set(PROJ_LC, track_proj, &
1060 truelat1 = config_flags%truelat1, &
1061 truelat2 = config_flags%truelat2, &
1062 stdlon = config_flags%stand_lon, &
1067 dx = config_flags%dx)
1069 ! Polar stereographic
1070 ELSE IF (config_flags%map_proj == PROJ_PS) THEN
1071 CALL map_set(PROJ_PS, track_proj, &
1072 truelat1 = config_flags%truelat1, &
1073 stdlon = config_flags%stand_lon, &
1078 dx = config_flags%dx)
1080 ! Cassini (global ARW)
1081 ELSE IF (config_flags%map_proj == PROJ_CASSINI) THEN
1082 CALL map_set(PROJ_CASSINI, track_proj, &
1083 latinc = grid%dy*360.0/(2.0*EARTH_RADIUS_M*PI), &
1084 loninc = grid%dx*360.0/(2.0*EARTH_RADIUS_M*PI), &
1087 ! We still need to get POLE_LAT and POLE_LON metadata variables before
1088 ! this will work for rotated poles.
1093 stdlon = config_flags%stand_lon)
1095 ! Rotated latitude-longitude
1096 ELSE IF (config_flags%map_proj == PROJ_ROTLL) THEN
1097 CALL map_set(PROJ_ROTLL, track_proj, &
1098 ! I have no idea how this should work for NMM nested domains
1099 ixdim = grid%e_we-1, &
1100 jydim = grid%e_sn-1, &
1101 phi = real(grid%e_sn-2)*grid%dy/2.0, &
1102 lambda = real(grid%e_we-2)*grid%dx, &
1103 lat1 = config_flags%cen_lat, &
1104 lon1 = config_flags%cen_lon, &
1111 IF (.NOT. grid%track_have_calculated) THEN
1112 grid%track_have_calculated = .TRUE.
1113 WRITE(message, '(A46,I3)') 'Computing track locations inside model domain ', grid%id
1114 CALL wrf_message(message)
1116 !--------------------------------------------------------
1118 !--------------------------------------------------------
1120 grid%track_next_time = 1
1121 !--------------------------------------------------------
1122 ! Determine track locations inside model domain and the corresponding model grid
1123 !--------------------------------------------------------
1125 DO k = 1,grid%track_loc
1126 CALL latlon_to_ij(track_proj, grid%track_lat_in(k), grid%track_lon_in(k), track_rx, track_ry)
1127 track_loc_temp = track_loc_temp + 1
1128 !--------------------------------------------------------
1129 ! found the corresponding model grid
1130 !--------------------------------------------------------
1131 grid%track_i(track_loc_temp) = NINT(track_rx)
1132 grid%track_j(track_loc_temp) = NINT(track_ry)
1133 !--------------------------------------------------------
1134 ! found the corresponding track time
1135 !--------------------------------------------------------
1136 grid%track_time_domain(track_loc_temp) = grid%track_time_in(k)
1137 !--------------------------------------------------------
1138 ! Is point outside of domain (or on the edge of domain)? -- don't count
1139 !--------------------------------------------------------
1140 IF (grid%track_i(track_loc_temp) < ids .OR. grid%track_i(track_loc_temp) > ide .OR. &
1141 grid%track_j(track_loc_temp) < jds .OR. grid%track_j(track_loc_temp) > jde) THEN
1142 track_loc_temp = track_loc_temp - 1
1146 !--------------------------------------------------------
1147 ! put the total valid track locations into grid%track_loc_domain
1148 !--------------------------------------------------------
1149 grid%track_loc_domain = track_loc_temp
1150 !--------------------------------------------------------
1151 ! found the corresponding model lat and lon and elevation
1152 !--------------------------------------------------------
1153 DO k = 1,grid%track_loc_domain
1154 !--------------------------------------------------------
1155 ! If location is outside of patch, we need to get lat/lon of track grid cell from another patch
1156 !--------------------------------------------------------
1157 IF (grid%track_i(k) < ips .OR. grid%track_i(k) > ipe .OR. &
1158 grid%track_j(k) < jps .OR. grid%track_j(k) > jpe) THEN
1159 grid%track_lat_domain(k) = 1.E30
1160 grid%track_lon_domain(k) = 1.E30
1161 grid%track_ele(k) = 1.E30
1163 grid%track_lat_domain(k) = grid%xlat(grid%track_i(k),grid%track_j(k))
1164 grid%track_lon_domain(k) = grid%xlong(grid%track_i(k),grid%track_j(k))
1165 grid%track_ele(k) = grid%ht(grid%track_i(k),grid%track_j(k))
1169 grid%track_ele(k) = wrf_dm_min_real(grid%track_ele(k))
1170 grid%track_lat_domain(k) = wrf_dm_min_real(grid%track_lat_domain(k))
1171 grid%track_lon_domain(k) = wrf_dm_min_real(grid%track_lon_domain(k))
1173 call wrf_dm_bcast_string(grid%track_time_domain(k), 19)
1177 write(message,*) 'calc_track_locations: valid track locations in the model domain ', grid%track_loc_domain
1178 call wrf_message( trim(message) )
1181 #if ( DA_CORE != 1 )
1186 END SUBROUTINE calc_track_locations