[1] | 1 | SUBROUTINE data_output_tseries |
---|
| 2 | |
---|
| 3 | !------------------------------------------------------------------------------! |
---|
| 4 | ! Actual revisions: |
---|
| 5 | ! ----------------- |
---|
| 6 | ! |
---|
| 7 | ! |
---|
| 8 | ! Former revisions: |
---|
| 9 | ! ----------------- |
---|
[3] | 10 | ! $Id: data_output_tseries.f90 4 2007-02-13 11:33:16Z raasch $ |
---|
| 11 | ! RCS Log replace by Id keyword, revision history cleaned up |
---|
| 12 | ! |
---|
[1] | 13 | ! Revision 1.13 2006/03/14 12:42:51 raasch |
---|
| 14 | ! Error removed: NetCDF output only if switched on |
---|
| 15 | ! |
---|
| 16 | ! Revision 1.1 1998/03/03 08:00:13 raasch |
---|
| 17 | ! Initial revision |
---|
| 18 | ! |
---|
| 19 | ! |
---|
| 20 | ! Description: |
---|
| 21 | ! ------------ |
---|
| 22 | ! Time series output for PROFIL. Always all time series are stored. A selection |
---|
| 23 | ! can be applied via the PROFIL-parameters in close_file. |
---|
| 24 | !------------------------------------------------------------------------------! |
---|
| 25 | |
---|
| 26 | USE control_parameters |
---|
| 27 | USE cpulog |
---|
| 28 | USE indices |
---|
| 29 | USE interfaces |
---|
| 30 | USE netcdf_control |
---|
| 31 | USE pegrid |
---|
| 32 | USE profil_parameter |
---|
| 33 | USE statistics |
---|
| 34 | |
---|
| 35 | IMPLICIT NONE |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | INTEGER :: file_id, i, j, sr |
---|
| 39 | REAL :: ts_value(30) |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | ! |
---|
| 43 | !-- If required, compute statistics. |
---|
| 44 | IF ( .NOT. flow_statistics_called ) CALL flow_statistics |
---|
| 45 | |
---|
| 46 | ! |
---|
| 47 | !-- Flow_statistics has its own cpu-time measuring. |
---|
| 48 | CALL cpu_log( log_point(21), 'data_output_tseries', 'start' ) |
---|
| 49 | |
---|
| 50 | IF ( myid == 0 ) THEN |
---|
| 51 | |
---|
| 52 | ! |
---|
| 53 | !-- Open file for time series output in NetCDF format |
---|
| 54 | IF ( netcdf_output ) THEN |
---|
| 55 | dots_time_count = dots_time_count + 1 |
---|
| 56 | CALL check_open( 105 ) |
---|
| 57 | #if defined( __netcdf ) |
---|
| 58 | ! |
---|
| 59 | !-- Update the time series time axis |
---|
| 60 | nc_stat = NF90_PUT_VAR( id_set_ts, id_var_time_ts, & |
---|
| 61 | (/ simulated_time /), & |
---|
| 62 | start = (/ dots_time_count /), & |
---|
| 63 | count = (/ 1 /) ) |
---|
| 64 | IF (nc_stat /= NF90_NOERR) CALL handle_netcdf_error( 350 ) |
---|
| 65 | #endif |
---|
| 66 | ENDIF |
---|
| 67 | |
---|
| 68 | ! |
---|
| 69 | !-- Time series output for the total domain (and each subregion, if |
---|
| 70 | !-- applicable) |
---|
| 71 | DO sr = 0, statistic_regions |
---|
| 72 | ! |
---|
| 73 | !-- Open file for time series output. |
---|
| 74 | IF ( profil_output ) THEN |
---|
| 75 | file_id = 50 + sr |
---|
| 76 | CALL check_open( file_id ) |
---|
| 77 | ENDIF |
---|
| 78 | |
---|
| 79 | ! |
---|
| 80 | !-- Collect and printout all time series quantities in a single line. |
---|
| 81 | ts_value(1) = hom(nzb+4,1,var_hom,sr) ! E |
---|
| 82 | ts_value(2) = hom(nzb+5,1,var_hom,sr) ! E* |
---|
| 83 | ts_value(3) = dt_3d |
---|
| 84 | ts_value(4) = hom(nzb,1,var_hom,sr) ! u* |
---|
| 85 | ts_value(5) = hom(nzb+3,1,var_hom,sr) ! th* |
---|
| 86 | ts_value(6) = u_max |
---|
| 87 | ts_value(7) = v_max |
---|
| 88 | ts_value(8) = w_max |
---|
| 89 | ts_value(9) = hom(nzb+10,1,var_sum,sr) ! new divergence |
---|
| 90 | ts_value(10) = hom(nzb+9,1,var_hom,sr) ! old Divergence |
---|
| 91 | ts_value(11) = hom(nzb+6,1,var_hom,sr) ! z_i(1) |
---|
| 92 | ts_value(12) = hom(nzb+7,1,var_hom,sr) ! z_i(2) |
---|
| 93 | ts_value(13) = hom(nzb+8,1,var_hom,sr) ! w* |
---|
| 94 | ts_value(14) = hom(nzb,1,16,sr) ! w'pt' at k=0 |
---|
| 95 | ts_value(15) = hom(nzb+1,1,16,sr) ! w'pt' at k=1 |
---|
| 96 | ts_value(16) = hom(nzb+1,1,18,sr) ! wpt at k=1 |
---|
| 97 | ts_value(17) = hom(nzb,1,4,sr) ! pt(0) |
---|
| 98 | ts_value(18) = hom(nzb+1,1,4,sr) ! pt(zp) |
---|
| 99 | ts_value(19) = hom(nzb+9,1,var_hom-1,sr) ! splptx |
---|
| 100 | ts_value(20) = hom(nzb+10,1,var_hom-1,sr) ! splpty |
---|
| 101 | ts_value(21) = hom(nzb+11,1,var_hom-1,sr) ! splptz |
---|
| 102 | IF ( ts_value(5) /= 0.0 ) THEN |
---|
| 103 | ts_value(22) = ts_value(4)**2 / & |
---|
| 104 | ( kappa * g * ts_value(5) / ts_value(18) ) ! L |
---|
| 105 | ELSE |
---|
| 106 | ts_value(22) = 10000.0 |
---|
| 107 | ENDIF |
---|
| 108 | |
---|
| 109 | #if defined( __netcdf ) |
---|
| 110 | IF ( netcdf_output ) THEN |
---|
| 111 | DO i = 1, dots_num |
---|
| 112 | nc_stat = NF90_PUT_VAR( id_set_ts, id_var_dots(i,sr), & |
---|
| 113 | (/ ts_value(i) /), & |
---|
| 114 | start = (/ dots_time_count /), & |
---|
| 115 | count = (/ 1 /) ) |
---|
| 116 | IF ( nc_stat /= NF90_NOERR ) CALL handle_netcdf_error( 351 ) |
---|
| 117 | ENDDO |
---|
| 118 | ENDIF |
---|
| 119 | #endif |
---|
| 120 | |
---|
| 121 | IF ( profil_output ) THEN |
---|
| 122 | WRITE ( file_id, 500 ) simulated_time, ts_value(1:22) |
---|
| 123 | ! |
---|
| 124 | !-- y-value range of the crosses to be drawn by PROFIL |
---|
| 125 | !-- If required, enlarge them, provided they have not yet been |
---|
| 126 | !-- specified in |
---|
| 127 | !-- check_parameters |
---|
| 128 | DO i = 1, dots_n |
---|
| 129 | |
---|
| 130 | j = dots_crossindex(i) |
---|
| 131 | |
---|
| 132 | IF ( cross_ts_uymin(j) == 999.999 ) THEN |
---|
| 133 | ! |
---|
| 134 | !-- When the value range of the first line in the corresponding |
---|
| 135 | !-- cross is determined, its value range is simply adopted. |
---|
| 136 | IF ( cross_ts_uymin_computed(j) == 999.999 ) & |
---|
| 137 | THEN |
---|
| 138 | cross_ts_uymin_computed(j) = ts_value(dots_index(i)) |
---|
| 139 | ELSE |
---|
| 140 | cross_ts_uymin_computed(j) = & |
---|
| 141 | MIN(cross_ts_uymin_computed(j),ts_value(dots_index(i))) |
---|
| 142 | ENDIF |
---|
| 143 | ENDIF |
---|
| 144 | |
---|
| 145 | IF ( cross_ts_uymax(j) == 999.999 ) THEN |
---|
| 146 | ! |
---|
| 147 | !-- When the value range of the first line in the corresponding |
---|
| 148 | !-- cross is determined, its value range is simply adopted. |
---|
| 149 | IF ( cross_ts_uymax_computed(j) == 999.999 ) & |
---|
| 150 | THEN |
---|
| 151 | cross_ts_uymax_computed(j) = ts_value(dots_index(i)) |
---|
| 152 | ELSE |
---|
| 153 | cross_ts_uymax_computed(j) = & |
---|
| 154 | MAX(cross_ts_uymax_computed(j),ts_value(dots_index(i))) |
---|
| 155 | ENDIF |
---|
| 156 | ENDIF |
---|
| 157 | |
---|
| 158 | ENDDO |
---|
| 159 | |
---|
| 160 | ENDIF |
---|
| 161 | |
---|
| 162 | ENDDO ! Loop of subregions. |
---|
| 163 | |
---|
| 164 | ENDIF |
---|
| 165 | |
---|
| 166 | |
---|
| 167 | CALL cpu_log( log_point(21), 'data_output_tseries','stop', 'nobarrier' ) |
---|
| 168 | |
---|
| 169 | ! |
---|
| 170 | !-- formats |
---|
| 171 | 500 FORMAT (23(E15.7,1X)) |
---|
| 172 | |
---|
| 173 | END SUBROUTINE data_output_tseries |
---|