[1] | 1 | SUBROUTINE data_output_profiles |
---|
| 2 | |
---|
| 3 | !------------------------------------------------------------------------------! |
---|
| 4 | ! Actual revisions: |
---|
| 5 | ! ----------------- |
---|
[90] | 6 | ! |
---|
[1] | 7 | ! |
---|
| 8 | ! Former revisions: |
---|
| 9 | ! ----------------- |
---|
[3] | 10 | ! $Id: data_output_profiles.f90 90 2007-05-30 09:18:47Z letzel $ |
---|
| 11 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
| 12 | ! |
---|
[90] | 13 | ! 87 2007-05-22 15:46:47Z raasch |
---|
| 14 | ! var_hom renamed pr_palm |
---|
| 15 | ! |
---|
[1] | 16 | ! Revision 1.18 2006/08/16 14:27:04 raasch |
---|
| 17 | ! PRINT* statements for testing removed |
---|
| 18 | ! |
---|
| 19 | ! Revision 1.1 1997/09/12 06:28:48 raasch |
---|
| 20 | ! Initial revision |
---|
| 21 | ! |
---|
| 22 | ! |
---|
| 23 | ! Description: |
---|
| 24 | ! ------------ |
---|
| 25 | ! Plot output of 1D-profiles for PROFIL |
---|
| 26 | !------------------------------------------------------------------------------! |
---|
| 27 | |
---|
| 28 | USE control_parameters |
---|
| 29 | USE cpulog |
---|
| 30 | USE indices |
---|
| 31 | USE interfaces |
---|
| 32 | USE netcdf_control |
---|
| 33 | USE pegrid |
---|
| 34 | USE profil_parameter |
---|
| 35 | USE statistics |
---|
| 36 | |
---|
| 37 | IMPLICIT NONE |
---|
| 38 | |
---|
| 39 | |
---|
| 40 | INTEGER :: i, id, ilc, ils, j, k, sr |
---|
| 41 | REAL :: uxma, uxmi |
---|
| 42 | |
---|
| 43 | |
---|
| 44 | ! |
---|
| 45 | !-- If required, compute statistics |
---|
| 46 | IF ( .NOT. flow_statistics_called ) CALL flow_statistics |
---|
| 47 | |
---|
| 48 | ! |
---|
| 49 | !-- Flow_statistics has its own CPU time measurement |
---|
| 50 | CALL cpu_log( log_point(15), 'data_output_profiles', 'start' ) |
---|
| 51 | |
---|
| 52 | ! |
---|
| 53 | !-- If required, compute temporal average |
---|
| 54 | IF ( averaging_interval_pr == 0.0 ) THEN |
---|
| 55 | hom_sum(:,:,:) = hom(:,1,:,:) |
---|
| 56 | ELSE |
---|
| 57 | IF ( average_count_pr > 0 ) THEN |
---|
| 58 | hom_sum = hom_sum / REAL( average_count_pr ) |
---|
| 59 | ELSE |
---|
| 60 | ! |
---|
| 61 | !-- This case may happen if dt_dopr is changed in the d3par-list of |
---|
| 62 | !-- a restart run |
---|
| 63 | RETURN |
---|
| 64 | ENDIF |
---|
| 65 | ENDIF |
---|
| 66 | |
---|
| 67 | |
---|
| 68 | IF ( myid == 0 ) THEN |
---|
| 69 | |
---|
| 70 | ! |
---|
| 71 | !-- Plot-output for each (sub-)region |
---|
| 72 | |
---|
| 73 | ! |
---|
| 74 | !-- Open file for profile output in NetCDF format |
---|
| 75 | IF ( netcdf_output ) THEN |
---|
| 76 | CALL check_open( 104 ) |
---|
| 77 | ENDIF |
---|
| 78 | |
---|
| 79 | ! |
---|
| 80 | !-- Open PROFIL-output files for each (sub-)region |
---|
| 81 | IF ( profil_output ) THEN |
---|
| 82 | DO sr = 0, statistic_regions |
---|
| 83 | CALL check_open( 40 + sr ) |
---|
| 84 | ENDDO |
---|
| 85 | ENDIF |
---|
| 86 | |
---|
| 87 | ! |
---|
| 88 | !-- Increment the counter for number of output times |
---|
| 89 | dopr_time_count = dopr_time_count + 1 |
---|
| 90 | |
---|
| 91 | ! |
---|
| 92 | !-- Re-set to zero the counter for the number of profiles already written |
---|
| 93 | !-- at the current output time into the respective crosses |
---|
| 94 | cross_pnc_local = 0 |
---|
| 95 | |
---|
| 96 | ! |
---|
| 97 | !-- Output of initial profiles |
---|
| 98 | IF ( dopr_time_count == 1 ) THEN |
---|
| 99 | |
---|
| 100 | IF ( netcdf_output ) THEN |
---|
| 101 | #if defined( __netcdf ) |
---|
| 102 | ! |
---|
| 103 | !-- Store initial time (t=0) to time axis |
---|
| 104 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_time_pr, (/ 0.0 /), & |
---|
| 105 | start = (/ 1 /), count = (/ 1 /) ) |
---|
| 106 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 329 ) |
---|
| 107 | |
---|
| 108 | ! |
---|
| 109 | !-- Store normalization factors |
---|
| 110 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(1), & ! wpt0 |
---|
| 111 | (/ hom_sum(nzb,18,normalizing_region) /), & |
---|
| 112 | start = (/ 1 /), count = (/ 1 /) ) |
---|
| 113 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 330 ) |
---|
| 114 | |
---|
| 115 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(2), & ! ws2 |
---|
[87] | 116 | (/ hom_sum(nzb+8,pr_palm,normalizing_region)**2 /), & |
---|
[1] | 117 | start = (/ 1 /), count = (/ 1 /) ) |
---|
| 118 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 331 ) |
---|
| 119 | |
---|
| 120 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(3), & ! tsw2 |
---|
[87] | 121 | (/ hom_sum(nzb+3,pr_palm,normalizing_region)**2 /), & |
---|
[1] | 122 | start = (/ 1 /), count = (/ 1 /) ) |
---|
| 123 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 332 ) |
---|
| 124 | |
---|
| 125 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(4), & ! ws3 |
---|
[87] | 126 | (/ hom_sum(nzb+8,pr_palm,normalizing_region)**3 /), & |
---|
[1] | 127 | start = (/ 1 /), count = (/ 1 /) ) |
---|
| 128 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 333 ) |
---|
| 129 | |
---|
| 130 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(5), & ! ws2tsw |
---|
[87] | 131 | (/ hom_sum(nzb+8,pr_palm,normalizing_region)**3 * & |
---|
| 132 | hom_sum(nzb+3,pr_palm,normalizing_region) /), & |
---|
[1] | 133 | start = (/ 1 /), count = (/ 1 /) ) |
---|
| 134 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 334 ) |
---|
| 135 | |
---|
| 136 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(6), & ! wstsw2 |
---|
[87] | 137 | (/ hom_sum(nzb+8,pr_palm,normalizing_region) * & |
---|
| 138 | hom_sum(nzb+3,pr_palm,normalizing_region)**2 /), & |
---|
[1] | 139 | start = (/ 1 /), count = (/ 1 /) ) |
---|
| 140 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 335 ) |
---|
| 141 | |
---|
| 142 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(7), & ! z_i |
---|
[87] | 143 | (/ hom_sum(nzb+6,pr_palm,normalizing_region) /), & |
---|
[1] | 144 | start = (/ 1 /), count = (/ 1 /) ) |
---|
| 145 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 336 ) |
---|
| 146 | #endif |
---|
| 147 | ENDIF |
---|
| 148 | ! |
---|
| 149 | !-- Loop over all 1D variables |
---|
| 150 | DO i = 1, dopr_n |
---|
| 151 | |
---|
| 152 | IF ( dopr_initial_index(i) /= 0 ) THEN |
---|
| 153 | |
---|
| 154 | ! |
---|
| 155 | !-- Output for the individual (sub-)regions |
---|
| 156 | DO sr = 0, statistic_regions |
---|
| 157 | |
---|
| 158 | IF ( profil_output ) THEN |
---|
| 159 | id = 40 + sr |
---|
| 160 | ! |
---|
| 161 | !-- Write Label-Header |
---|
| 162 | WRITE ( id, 100 ) TRIM( data_output_pr(i) ), '(t=0)' |
---|
| 163 | ! |
---|
| 164 | !-- Write total profile |
---|
| 165 | DO k = nzb, nzt+1 |
---|
| 166 | WRITE ( id, 101 ) hom(k,2,dopr_initial_index(i),sr), & |
---|
| 167 | hom(k,1,dopr_initial_index(i),sr) |
---|
| 168 | ENDDO |
---|
| 169 | ! |
---|
| 170 | !-- Write separation label |
---|
| 171 | WRITE ( id, 102 ) |
---|
| 172 | ENDIF |
---|
| 173 | |
---|
| 174 | IF ( netcdf_output ) THEN |
---|
| 175 | #if defined( __netcdf ) |
---|
| 176 | ! |
---|
| 177 | !-- Write data to netcdf file |
---|
| 178 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_dopr(i,sr), & |
---|
| 179 | hom(nzb:nzt+1,1,dopr_initial_index(i),sr), & |
---|
| 180 | start = (/ 1, 1 /), & |
---|
| 181 | count = (/ nzt-nzb+2, 1 /) ) |
---|
| 182 | IF ( nc_stat /= NF90_NOERR ) & |
---|
| 183 | CALL handle_netcdf_error( 337 ) |
---|
| 184 | #endif |
---|
| 185 | ENDIF |
---|
| 186 | |
---|
| 187 | ENDDO |
---|
| 188 | |
---|
| 189 | IF ( profil_output ) THEN |
---|
| 190 | ! |
---|
| 191 | !-- Determine indices for later NAMELIST-output (s. below) |
---|
| 192 | profile_number = profile_number + 1 |
---|
| 193 | j = dopr_crossindex(i) |
---|
| 194 | IF ( j /= 0 ) THEN |
---|
| 195 | cross_profile_number_count(j) = & |
---|
| 196 | cross_profile_number_count(j) + 1 |
---|
| 197 | k = cross_profile_number_count(j) |
---|
| 198 | cross_profile_numbers(k,j) = profile_number |
---|
| 199 | ! |
---|
| 200 | !-- Initial profiles are always drawn as solid lines in |
---|
| 201 | !-- anti-background colour. |
---|
| 202 | cross_linecolors(k,j) = 1 |
---|
| 203 | cross_linestyles(k,j) = 0 |
---|
| 204 | ! |
---|
| 205 | !-- If required, extend x-value range of the respective |
---|
| 206 | !-- cross, provided it has not been specified in & |
---|
| 207 | !-- check_parameters. Determination over all (sub-)regions. |
---|
| 208 | IF ( cross_uxmin(j) == 0.0 .AND. & |
---|
| 209 | cross_uxmax(j) == 0.0 ) THEN |
---|
| 210 | |
---|
| 211 | DO sr = 0, statistic_regions |
---|
| 212 | |
---|
| 213 | uxmi = & |
---|
| 214 | MINVAL( hom(:nz_do1d,1,dopr_initial_index(i),sr) ) |
---|
| 215 | |
---|
| 216 | uxma = & |
---|
| 217 | MAXVAL( hom(:nz_do1d,1,dopr_initial_index(i),sr) ) |
---|
| 218 | ! |
---|
| 219 | !-- When the value range of the first line in the |
---|
| 220 | !-- corresponding cross is determined, its value range |
---|
| 221 | !-- is simply adopted. |
---|
| 222 | IF ( cross_uxmin_computed(j) > & |
---|
| 223 | cross_uxmax_computed(j) ) THEN |
---|
| 224 | cross_uxmin_computed(j) = uxmi |
---|
| 225 | cross_uxmax_computed(j) = uxma |
---|
| 226 | ELSE |
---|
| 227 | cross_uxmin_computed(j) = & |
---|
| 228 | MIN( cross_uxmin_computed(j), uxmi ) |
---|
| 229 | cross_uxmax_computed(j) = & |
---|
| 230 | MAX( cross_uxmax_computed(j), uxma ) |
---|
| 231 | ENDIF |
---|
| 232 | |
---|
| 233 | ENDDO |
---|
| 234 | |
---|
| 235 | ENDIF |
---|
| 236 | ! |
---|
| 237 | !-- If required, determine and note normalizing factors |
---|
| 238 | SELECT CASE ( cross_normalized_x(j) ) |
---|
| 239 | |
---|
| 240 | CASE ( 'ts2' ) |
---|
| 241 | cross_normx_factor(k,j) = & |
---|
[87] | 242 | ( hom_sum(nzb+3,pr_palm,normalizing_region) )**2 |
---|
[1] | 243 | CASE ( 'wpt0' ) |
---|
| 244 | cross_normx_factor(k,j) = & |
---|
| 245 | hom_sum(nzb,18,normalizing_region) |
---|
| 246 | CASE ( 'wsts2' ) |
---|
| 247 | cross_normx_factor(k,j) = & |
---|
[87] | 248 | hom_sum(nzb+8,pr_palm,normalizing_region) & |
---|
| 249 | * ( hom_sum(nzb+3,pr_palm,normalizing_region) )**2 |
---|
[1] | 250 | CASE ( 'ws2' ) |
---|
| 251 | cross_normx_factor(k,j) = & |
---|
[87] | 252 | ( hom_sum(nzb+8,pr_palm,normalizing_region) )**2 |
---|
[1] | 253 | CASE ( 'ws2ts' ) |
---|
| 254 | cross_normx_factor(k,j) = & |
---|
[87] | 255 | ( hom_sum(nzb+8,pr_palm,normalizing_region) )**2 & |
---|
| 256 | * hom_sum(nzb+3,pr_palm,normalizing_region) |
---|
[1] | 257 | CASE ( 'ws3' ) |
---|
| 258 | cross_normx_factor(k,j) = & |
---|
[87] | 259 | ( hom_sum(nzb+8,pr_palm,normalizing_region) )**3 |
---|
[1] | 260 | |
---|
| 261 | END SELECT |
---|
| 262 | |
---|
| 263 | SELECT CASE ( cross_normalized_y(j) ) |
---|
| 264 | |
---|
| 265 | CASE ( 'z_i' ) |
---|
| 266 | cross_normy_factor(k,j) = & |
---|
[87] | 267 | hom_sum(nzb+6,pr_palm,normalizing_region) |
---|
[1] | 268 | |
---|
| 269 | END SELECT |
---|
| 270 | |
---|
| 271 | ! |
---|
| 272 | !-- Check the normalizing factors for zeros and deactivate |
---|
| 273 | !-- the normalization, if required. |
---|
| 274 | IF ( cross_normx_factor(k,j) == 0.0 .OR. & |
---|
| 275 | cross_normy_factor(k,j) == 0.0 ) THEN |
---|
| 276 | PRINT*,'+++ WARNING data_output_profiles: normalizi', & |
---|
| 277 | 'ng cross ',j, ' is not possible since one o', & |
---|
| 278 | 'f the' |
---|
| 279 | PRINT*,' normalizing factors is ',& |
---|
| 280 | 'zero!' |
---|
| 281 | PRINT*,' cross_normx_factor(',k,',',j,') = ', & |
---|
| 282 | cross_normx_factor(k,j) |
---|
| 283 | PRINT*,' cross_normy_factor(',k,',',j,') = ', & |
---|
| 284 | cross_normy_factor(k,j) |
---|
| 285 | cross_normx_factor(k,j) = 1.0 |
---|
| 286 | cross_normy_factor(k,j) = 1.0 |
---|
| 287 | cross_normalized_x(j) = ' ' |
---|
| 288 | cross_normalized_y(j) = ' ' |
---|
| 289 | ENDIF |
---|
| 290 | |
---|
| 291 | ! |
---|
| 292 | !-- If required, extend normalized x-value range of the |
---|
| 293 | !-- respective cross, provided it has not been specified in |
---|
| 294 | !-- check_parameters. Determination over all (sub-)regions. |
---|
| 295 | IF ( cross_uxmin_normalized(j) == 0.0 .AND. & |
---|
| 296 | cross_uxmax_normalized(j) == 0.0 ) THEN |
---|
| 297 | |
---|
| 298 | DO sr = 0, statistic_regions |
---|
| 299 | |
---|
| 300 | uxmi = MINVAL( hom(:nz_do1d,1, & |
---|
| 301 | dopr_initial_index(i),sr) ) / & |
---|
| 302 | cross_normx_factor(k,j) |
---|
| 303 | uxma = MAXVAL( hom(:nz_do1d,1, & |
---|
| 304 | dopr_initial_index(i),sr) ) / & |
---|
| 305 | cross_normx_factor(k,j) |
---|
| 306 | ! |
---|
| 307 | !-- When the value range of the first line in the |
---|
| 308 | !-- corresponding cross is determined, its value range |
---|
| 309 | !-- is simply adopted. |
---|
| 310 | IF ( cross_uxmin_normalized_computed(j) > & |
---|
| 311 | cross_uxmax_normalized_computed(j) ) THEN |
---|
| 312 | cross_uxmin_normalized_computed(j) = uxmi |
---|
| 313 | cross_uxmax_normalized_computed(j) = uxma |
---|
| 314 | ELSE |
---|
| 315 | cross_uxmin_normalized_computed(j) = & |
---|
| 316 | MIN( cross_uxmin_normalized_computed(j), uxmi ) |
---|
| 317 | cross_uxmax_normalized_computed(j) = & |
---|
| 318 | MAX( cross_uxmax_normalized_computed(j), uxma ) |
---|
| 319 | ENDIF |
---|
| 320 | |
---|
| 321 | ENDDO |
---|
| 322 | |
---|
| 323 | ENDIF |
---|
| 324 | |
---|
| 325 | ENDIF ! Index determination |
---|
| 326 | |
---|
| 327 | ENDIF ! profil output |
---|
| 328 | |
---|
| 329 | ENDIF ! Initial profile available |
---|
| 330 | |
---|
| 331 | ENDDO ! Loop over dopr_n for initial profiles |
---|
| 332 | |
---|
| 333 | IF ( netcdf_output ) dopr_time_count = dopr_time_count + 1 |
---|
| 334 | |
---|
| 335 | ENDIF ! Initial profiles |
---|
| 336 | |
---|
| 337 | IF ( netcdf_output ) THEN |
---|
| 338 | #if defined( __netcdf ) |
---|
| 339 | ! |
---|
| 340 | !-- Store time to time axis |
---|
| 341 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_time_pr, & |
---|
| 342 | (/ simulated_time /), & |
---|
| 343 | start = (/ dopr_time_count /), & |
---|
| 344 | count = (/ 1 /) ) |
---|
| 345 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 338 ) |
---|
| 346 | |
---|
| 347 | ! |
---|
| 348 | !-- Store normalization factors |
---|
| 349 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(1), & ! wpt0 |
---|
| 350 | (/ hom_sum(nzb,18,normalizing_region) /), & |
---|
| 351 | start = (/ dopr_time_count /), & |
---|
| 352 | count = (/ 1 /) ) |
---|
| 353 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 339 ) |
---|
| 354 | |
---|
| 355 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(2), & ! ws2 |
---|
[87] | 356 | (/ hom_sum(nzb+8,pr_palm,normalizing_region)**2 /), & |
---|
[1] | 357 | start = (/ dopr_time_count /), & |
---|
| 358 | count = (/ 1 /) ) |
---|
| 359 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 340 ) |
---|
| 360 | |
---|
| 361 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(3), & ! tsw2 |
---|
[87] | 362 | (/ hom_sum(nzb+3,pr_palm,normalizing_region)**2 /), & |
---|
[1] | 363 | start = (/ dopr_time_count /), & |
---|
| 364 | count = (/ 1 /) ) |
---|
| 365 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 341 ) |
---|
| 366 | |
---|
| 367 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(4), & ! ws3 |
---|
[87] | 368 | (/ hom_sum(nzb+8,pr_palm,normalizing_region)**3 /), & |
---|
[1] | 369 | start = (/ dopr_time_count /), & |
---|
| 370 | count = (/ 1 /) ) |
---|
| 371 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 342 ) |
---|
| 372 | |
---|
| 373 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(5), & ! ws2tsw |
---|
[87] | 374 | (/ hom_sum(nzb+8,pr_palm,normalizing_region)**3 * & |
---|
| 375 | hom_sum(nzb+3,pr_palm,normalizing_region) /), & |
---|
[1] | 376 | start = (/ dopr_time_count /), & |
---|
| 377 | count = (/ 1 /) ) |
---|
| 378 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 343 ) |
---|
| 379 | |
---|
| 380 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(6), & ! wstsw2 |
---|
[87] | 381 | (/ hom_sum(nzb+8,pr_palm,normalizing_region) * & |
---|
| 382 | hom_sum(nzb+3,pr_palm,normalizing_region)**2 /), & |
---|
[1] | 383 | start = (/ dopr_time_count /), & |
---|
| 384 | count = (/ 1 /) ) |
---|
| 385 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 344 ) |
---|
| 386 | |
---|
| 387 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_norm_dopr(7), & ! z_i |
---|
[87] | 388 | (/ hom_sum(nzb+6,pr_palm,normalizing_region) /), & |
---|
[1] | 389 | start = (/ dopr_time_count /), & |
---|
| 390 | count = (/ 1 /) ) |
---|
| 391 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 345 ) |
---|
| 392 | #endif |
---|
| 393 | ENDIF |
---|
| 394 | |
---|
| 395 | ! |
---|
| 396 | !-- Output of the individual (non-initial) profiles |
---|
| 397 | DO i = 1, dopr_n |
---|
| 398 | |
---|
| 399 | ! |
---|
| 400 | !-- Output for the individual (sub-)domains |
---|
| 401 | DO sr = 0, statistic_regions |
---|
| 402 | |
---|
| 403 | IF ( profil_output ) THEN |
---|
| 404 | id = 40 + sr |
---|
| 405 | ! |
---|
| 406 | !-- Write Label-Header |
---|
| 407 | WRITE ( id, 100 ) TRIM( dopr_label(i) ), simulated_time_chr |
---|
| 408 | ! |
---|
| 409 | !-- Output of total profile |
---|
| 410 | DO k = nzb, nzt+1 |
---|
| 411 | WRITE ( id, 101 ) hom(k,2,dopr_index(i),sr), & |
---|
| 412 | hom_sum(k,dopr_index(i),sr) |
---|
| 413 | ENDDO |
---|
| 414 | ! |
---|
| 415 | !-- Write separation label |
---|
| 416 | WRITE ( id, 102 ) |
---|
| 417 | ENDIF |
---|
| 418 | |
---|
| 419 | IF ( netcdf_output ) THEN |
---|
| 420 | #if defined( __netcdf ) |
---|
| 421 | ! |
---|
| 422 | !-- Write data to netcdf file |
---|
| 423 | nc_stat = NF90_PUT_VAR( id_set_pr, id_var_dopr(i,sr), & |
---|
| 424 | hom_sum(nzb:nzt+1,dopr_index(i),sr),& |
---|
| 425 | start = (/ 1, dopr_time_count /), & |
---|
| 426 | count = (/ nzt-nzb+2, 1 /) ) |
---|
| 427 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 346 ) |
---|
| 428 | #endif |
---|
| 429 | ENDIF |
---|
| 430 | |
---|
| 431 | ENDDO |
---|
| 432 | |
---|
| 433 | IF ( profil_output ) THEN |
---|
| 434 | ! |
---|
| 435 | !-- Determine profile number on file and note the data for later |
---|
| 436 | !-- NAMELIST output, if the respective profile is to be drawn by |
---|
| 437 | !-- PROFIL (if it shall not be drawn, the variable dopr_crossindex has |
---|
| 438 | !-- the value 0, otherwise the number of the coordinate cross) |
---|
| 439 | profile_number = profile_number + 1 |
---|
| 440 | j = dopr_crossindex(i) |
---|
| 441 | |
---|
| 442 | IF ( j /= 0 ) THEN |
---|
| 443 | cross_profile_number_count(j) = cross_profile_number_count(j) +1 |
---|
| 444 | k = cross_profile_number_count(j) |
---|
| 445 | cross_pnc_local(j) = cross_pnc_local(j) +1 |
---|
| 446 | cross_profile_numbers(k,j) = profile_number |
---|
| 447 | ilc = MOD( dopr_time_count, 10 ) |
---|
| 448 | IF ( ilc == 0 ) ilc = 10 |
---|
| 449 | cross_linecolors(k,j) = linecolors(ilc) |
---|
| 450 | ils = MOD( cross_pnc_local(j), 11 ) |
---|
| 451 | IF ( ils == 0 ) ils = 11 |
---|
| 452 | cross_linestyles(k,j) = linestyles(ils) |
---|
| 453 | ! |
---|
| 454 | !-- If required, extend x-value range of the respective coordinate |
---|
| 455 | !-- cross, provided it has not been specified in check_parameters. |
---|
| 456 | !-- Determination over all (sub-)regions. |
---|
| 457 | IF ( cross_uxmin(j) == 0.0 .AND. cross_uxmax(j) == 0.0 ) THEN |
---|
| 458 | |
---|
| 459 | DO sr = 0, statistic_regions |
---|
| 460 | |
---|
| 461 | uxmi = MINVAL( hom_sum(:nz_do1d,dopr_index(i),sr) ) |
---|
| 462 | uxma = MAXVAL( hom_sum(:nz_do1d,dopr_index(i),sr) ) |
---|
| 463 | ! |
---|
| 464 | !-- When the value range of the first line in the |
---|
| 465 | !-- corresponding cross is determined, its value range is |
---|
| 466 | !-- simply adopted. |
---|
| 467 | IF ( cross_uxmin_computed(j) > cross_uxmax_computed(j) ) & |
---|
| 468 | THEN |
---|
| 469 | cross_uxmin_computed(j) = uxmi |
---|
| 470 | cross_uxmax_computed(j) = uxma |
---|
| 471 | ELSE |
---|
| 472 | cross_uxmin_computed(j) = & |
---|
| 473 | MIN( cross_uxmin_computed(j), uxmi ) |
---|
| 474 | cross_uxmax_computed(j) = & |
---|
| 475 | MAX( cross_uxmax_computed(j), uxma ) |
---|
| 476 | ENDIF |
---|
| 477 | |
---|
| 478 | ENDDO |
---|
| 479 | |
---|
| 480 | ENDIF |
---|
| 481 | ! |
---|
| 482 | !-- If required, store the normalizing factors |
---|
| 483 | SELECT CASE ( cross_normalized_x(j) ) |
---|
| 484 | |
---|
| 485 | CASE ( 'tsw2' ) |
---|
| 486 | cross_normx_factor(k,j) = & |
---|
[87] | 487 | ( hom_sum(nzb+11,pr_palm,normalizing_region) )**2 |
---|
[1] | 488 | CASE ( 'wpt0' ) |
---|
| 489 | cross_normx_factor(k,j) = & |
---|
| 490 | hom_sum(nzb,18,normalizing_region) |
---|
| 491 | CASE ( 'wstsw2' ) |
---|
| 492 | cross_normx_factor(k,j) = & |
---|
[87] | 493 | hom_sum(nzb+8,pr_palm,normalizing_region) & |
---|
| 494 | * ( hom_sum(nzb+11,pr_palm,normalizing_region) )**2 |
---|
[1] | 495 | CASE ( 'ws2' ) |
---|
| 496 | cross_normx_factor(k,j) = & |
---|
[87] | 497 | ( hom_sum(nzb+8,pr_palm,normalizing_region) )**2 |
---|
[1] | 498 | CASE ( 'ws2tsw' ) |
---|
| 499 | cross_normx_factor(k,j) = & |
---|
[87] | 500 | ( hom_sum(nzb+8,pr_palm,normalizing_region) )**2& |
---|
| 501 | * hom_sum(nzb+11,pr_palm,normalizing_region) |
---|
[1] | 502 | CASE ( 'ws3' ) |
---|
| 503 | cross_normx_factor(k,j) = & |
---|
[87] | 504 | ( hom_sum(nzb+8,pr_palm,normalizing_region) )**3 |
---|
[1] | 505 | |
---|
| 506 | END SELECT |
---|
| 507 | SELECT CASE ( cross_normalized_y(j) ) |
---|
| 508 | |
---|
| 509 | CASE ( 'z_i' ) |
---|
| 510 | cross_normy_factor(k,j) = & |
---|
[87] | 511 | hom_sum(nzb+6,pr_palm,normalizing_region) |
---|
[1] | 512 | |
---|
| 513 | END SELECT |
---|
| 514 | |
---|
| 515 | ! |
---|
| 516 | !-- Check the normalizing factors for zeros and deactivate the |
---|
| 517 | !-- normalization, if required. |
---|
| 518 | IF ( cross_normx_factor(k,j) == 0.0 .OR. & |
---|
| 519 | cross_normy_factor(k,j) == 0.0 ) THEN |
---|
| 520 | PRINT*,'+++ WARNING data_output_profiles: normalizing ',j, & |
---|
| 521 | ' cross is not possible since one of the' |
---|
| 522 | PRINT*,' normalizing factors is zero!' |
---|
| 523 | PRINT*,' cross_normx_factor(',k,',',j,') = ', & |
---|
| 524 | cross_normx_factor(k,j) |
---|
| 525 | PRINT*,' cross_normy_factor(',k,',',j,') = ', & |
---|
| 526 | cross_normy_factor(k,j) |
---|
| 527 | cross_normx_factor(k,j) = 1.0 |
---|
| 528 | cross_normy_factor(k,j) = 1.0 |
---|
| 529 | cross_normalized_x(j) = ' ' |
---|
| 530 | cross_normalized_y(j) = ' ' |
---|
| 531 | ENDIF |
---|
| 532 | |
---|
| 533 | ! |
---|
| 534 | !-- If required, extend normalized x-value range of the respective |
---|
| 535 | !-- cross, provided it has not been specified in check_parameters. |
---|
| 536 | !-- Determination over all (sub-)regions. |
---|
| 537 | IF ( cross_uxmin_normalized(j) == 0.0 .AND. & |
---|
| 538 | cross_uxmax_normalized(j) == 0.0 ) THEN |
---|
| 539 | |
---|
| 540 | DO sr = 0, statistic_regions |
---|
| 541 | |
---|
| 542 | uxmi = MINVAL( hom(:nz_do1d,1,dopr_index(i),sr) ) / & |
---|
| 543 | cross_normx_factor(k,j) |
---|
| 544 | uxma = MAXVAL( hom(:nz_do1d,1,dopr_index(i),sr) ) / & |
---|
| 545 | cross_normx_factor(k,j) |
---|
| 546 | ! |
---|
| 547 | !-- When the value range of the first line in the |
---|
| 548 | !-- corresponding cross is determined, its value range is |
---|
| 549 | !-- simply adopted. |
---|
| 550 | IF ( cross_uxmin_normalized_computed(j) > & |
---|
| 551 | cross_uxmax_normalized_computed(j) ) THEN |
---|
| 552 | cross_uxmin_normalized_computed(j) = uxmi |
---|
| 553 | cross_uxmax_normalized_computed(j) = uxma |
---|
| 554 | ELSE |
---|
| 555 | cross_uxmin_normalized_computed(j) = & |
---|
| 556 | MIN( cross_uxmin_normalized_computed(j), uxmi ) |
---|
| 557 | cross_uxmax_normalized_computed(j) = & |
---|
| 558 | MAX( cross_uxmax_normalized_computed(j), uxma ) |
---|
| 559 | ENDIF |
---|
| 560 | |
---|
| 561 | ENDDO |
---|
| 562 | |
---|
| 563 | ENDIF |
---|
| 564 | |
---|
| 565 | ENDIF ! Index determination |
---|
| 566 | |
---|
| 567 | ENDIF ! profil output |
---|
| 568 | |
---|
| 569 | ENDDO ! Loop over dopr_n |
---|
| 570 | |
---|
| 571 | ENDIF ! Output on PE0 |
---|
| 572 | |
---|
| 573 | ! |
---|
| 574 | !-- If averaging has been done above, the summation counter must be re-set. |
---|
| 575 | IF ( averaging_interval_pr /= 0.0 ) THEN |
---|
| 576 | average_count_pr = 0 |
---|
| 577 | ENDIF |
---|
| 578 | |
---|
| 579 | CALL cpu_log( log_point(15), 'data_output_profiles','stop', 'nobarrier' ) |
---|
| 580 | |
---|
| 581 | ! |
---|
| 582 | !-- Formats |
---|
| 583 | 100 FORMAT ('#1 ',A,1X,A) |
---|
| 584 | 101 FORMAT (E15.7,1X,E15.7) |
---|
| 585 | 102 FORMAT ('NEXT') |
---|
| 586 | |
---|
| 587 | END SUBROUTINE data_output_profiles |
---|