Changeset 1359 for palm/trunk/SOURCE/lpm_data_output_particles.f90
- Timestamp:
- Apr 11, 2014 5:15:14 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/lpm_data_output_particles.f90
r1329 r1359 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! netCDF output currently not available 23 ! output of particle data in binary format adopted to new particle structure 23 24 ! 24 25 ! Former revisions: … … 52 53 ONLY: cpu_log, log_point_s 53 54 55 USE indices, & 56 ONLY: nxl, nxr, nyn, nys, nzb, nzt 57 58 USE kinds 59 54 60 USE netcdf_control 55 61 56 62 USE particle_attributes, & 57 ONLY: maximum_number_of_particles, maximum_number_of_tailpoints, & 58 maximum_number_of_tails, number_of_particles, number_of_tails, & 59 particles, particle_tail_coordinates 63 ONLY: grid_particles, maximum_number_of_particles, & 64 maximum_number_of_tailpoints, maximum_number_of_tails, & 65 number_of_particles, number_of_tails, particles, & 66 particle_tail_coordinates, prt_count 60 67 61 68 IMPLICIT NONE 62 69 70 INTEGER(iwp) :: ip !: 71 INTEGER(iwp) :: jp !: 72 INTEGER(iwp) :: kp !: 63 73 64 74 CALL cpu_log( log_point_s(40), 'lpm_data_output', 'start' ) … … 69 79 CALL check_open( 85 ) 70 80 71 WRITE ( 85 ) simulated_time, maximum_number_of_particles, & 72 number_of_particles 73 WRITE ( 85 ) particles 74 WRITE ( 85 ) maximum_number_of_tailpoints, maximum_number_of_tails, & 75 number_of_tails 76 IF ( maximum_number_of_tails > 0 ) THEN 77 WRITE ( 85 ) particle_tail_coordinates, prt_time_count 78 ENDIF 81 WRITE ( 85 ) simulated_time 82 WRITE ( 85 ) prt_count 83 84 DO ip = nxl, nxr 85 DO jp = nys, nyn 86 DO kp = nzb+1, nzt 87 number_of_particles = prt_count(kp,jp,ip) 88 particles => grid_particles(kp,jp,ip)%particles(1:number_of_particles) 89 IF ( number_of_particles <= 0 ) CYCLE 90 WRITE ( 85 ) particles 91 ENDDO 92 ENDDO 93 ENDDO 94 ! 95 !-- particle tails currently not available 96 ! WRITE ( 85 ) maximum_number_of_tailpoints, maximum_number_of_tails, & 97 ! number_of_tails 98 ! IF ( maximum_number_of_tails > 0 ) THEN 99 ! WRITE ( 85 ) particle_tail_coordinates, prt_time_count 100 ! ENDIF 79 101 80 102 CALL close_file( 85 ) … … 82 104 83 105 #if defined( __netcdf ) 84 ! 85 ! -- Output in netCDF format86 CALL check_open( 108 )87 88 ! 89 ! -- Update the NetCDF time axis90 prt_time_count = prt_time_count + 191 92 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_time_prt, &93 (/ simulated_time /), &94 start = (/ prt_time_count /), count = (/ 1 /) )95 CALL handle_netcdf_error( 'lpm_data_output_particles', 1 )96 97 ! 98 ! -- Output the real number of particles used99 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_rnop_prt, &100 (/ number_of_particles /), &101 start = (/ prt_time_count /), count = (/ 1 /) )102 CALL handle_netcdf_error( 'lpm_data_output_particles', 2 )103 104 ! 105 ! -- Output all particle attributes106 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(1), particles%age, &107 start = (/ 1, prt_time_count /), &108 count = (/ maximum_number_of_particles /) )109 CALL handle_netcdf_error( 'lpm_data_output_particles', 3 )110 111 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(2), particles%dvrp_psize,&112 start = (/ 1, prt_time_count /), &113 count = (/ maximum_number_of_particles /) )114 CALL handle_netcdf_error( 'lpm_data_output_particles', 4 )115 116 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(3), particles%origin_x, &117 start = (/ 1, prt_time_count /), &118 count = (/ maximum_number_of_particles /) )119 CALL handle_netcdf_error( 'lpm_data_output_particles', 5 )120 121 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(4), particles%origin_y, &122 start = (/ 1, prt_time_count /), &123 count = (/ maximum_number_of_particles /) )124 CALL handle_netcdf_error( 'lpm_data_output_particles', 6 )125 126 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(5), particles%origin_z, &127 start = (/ 1, prt_time_count /), &128 count = (/ maximum_number_of_particles /) )129 CALL handle_netcdf_error( 'lpm_data_output_particles', 7 )130 131 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(6), particles%radius, &132 start = (/ 1, prt_time_count /), &133 count = (/ maximum_number_of_particles /) )134 CALL handle_netcdf_error( 'lpm_data_output_particles', 8 )135 136 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(7), particles%speed_x, &137 start = (/ 1, prt_time_count /), &138 count = (/ maximum_number_of_particles /) )139 CALL handle_netcdf_error( 'lpm_data_output_particles', 9 )140 141 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(8), particles%speed_y, &142 start = (/ 1, prt_time_count /), &143 count = (/ maximum_number_of_particles /) )144 CALL handle_netcdf_error( 'lpm_data_output_particles', 10 )145 146 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(9), particles%speed_z, &147 start = (/ 1, prt_time_count /), &148 count = (/ maximum_number_of_particles /) )149 CALL handle_netcdf_error( 'lpm_data_output_particles', 11 )150 151 nc_stat = NF90_PUT_VAR( id_set_prt,id_var_prt(10), &152 particles%weight_factor, &153 start = (/ 1, prt_time_count /), &154 count = (/ maximum_number_of_particles /) )155 CALL handle_netcdf_error( 'lpm_data_output_particles', 12 )156 157 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(11), particles%x, &158 start = (/ 1, prt_time_count /), &159 count = (/ maximum_number_of_particles /) )160 CALL handle_netcdf_error( 'lpm_data_output_particles', 13 )161 162 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(12), particles%y, &163 start = (/ 1, prt_time_count /), &164 count = (/ maximum_number_of_particles /) )165 CALL handle_netcdf_error( 'lpm_data_output_particles', 14 )166 167 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(13), particles%z, &168 start = (/ 1, prt_time_count /), &169 count = (/ maximum_number_of_particles /) )170 CALL handle_netcdf_error( 'lpm_data_output_particles', 15 )171 172 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(14), particles%class, &173 start = (/ 1, prt_time_count /), &174 count = (/ maximum_number_of_particles /) )175 CALL handle_netcdf_error( 'lpm_data_output_particles', 16 )176 177 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(15), particles%group, &178 start = (/ 1, prt_time_count /), &179 count = (/ maximum_number_of_particles /) )180 CALL handle_netcdf_error( 'lpm_data_output_particles', 17 )181 182 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(16), &183 particles%tailpoints, &184 start = (/ 1, prt_time_count /), &185 count = (/ maximum_number_of_particles /) )186 CALL handle_netcdf_error( 'lpm_data_output_particles', 18 )187 188 nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(17), particles%tail_id, &189 start = (/ 1, prt_time_count /), &190 count = (/ maximum_number_of_particles /) )191 CALL handle_netcdf_error( 'lpm_data_output_particles', 19 )192 106 ! ! 107 ! !-- Output in netCDF format 108 ! CALL check_open( 108 ) 109 ! 110 ! ! 111 ! !-- Update the NetCDF time axis 112 ! prt_time_count = prt_time_count + 1 113 ! 114 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_time_prt, & 115 ! (/ simulated_time /), & 116 ! start = (/ prt_time_count /), count = (/ 1 /) ) 117 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 1 ) 118 ! 119 ! ! 120 ! !-- Output the real number of particles used 121 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_rnop_prt, & 122 ! (/ number_of_particles /), & 123 ! start = (/ prt_time_count /), count = (/ 1 /) ) 124 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 2 ) 125 ! 126 ! ! 127 ! !-- Output all particle attributes 128 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(1), particles%age, & 129 ! start = (/ 1, prt_time_count /), & 130 ! count = (/ maximum_number_of_particles /) ) 131 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 3 ) 132 ! 133 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(2), particles%dvrp_psize,& 134 ! start = (/ 1, prt_time_count /), & 135 ! count = (/ maximum_number_of_particles /) ) 136 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 4 ) 137 ! 138 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(3), particles%origin_x, & 139 ! start = (/ 1, prt_time_count /), & 140 ! count = (/ maximum_number_of_particles /) ) 141 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 5 ) 142 ! 143 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(4), particles%origin_y, & 144 ! start = (/ 1, prt_time_count /), & 145 ! count = (/ maximum_number_of_particles /) ) 146 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 6 ) 147 ! 148 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(5), particles%origin_z, & 149 ! start = (/ 1, prt_time_count /), & 150 ! count = (/ maximum_number_of_particles /) ) 151 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 7 ) 152 ! 153 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(6), particles%radius, & 154 ! start = (/ 1, prt_time_count /), & 155 ! count = (/ maximum_number_of_particles /) ) 156 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 8 ) 157 ! 158 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(7), particles%speed_x, & 159 ! start = (/ 1, prt_time_count /), & 160 ! count = (/ maximum_number_of_particles /) ) 161 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 9 ) 162 ! 163 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(8), particles%speed_y, & 164 ! start = (/ 1, prt_time_count /), & 165 ! count = (/ maximum_number_of_particles /) ) 166 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 10 ) 167 ! 168 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(9), particles%speed_z, & 169 ! start = (/ 1, prt_time_count /), & 170 ! count = (/ maximum_number_of_particles /) ) 171 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 11 ) 172 ! 173 ! nc_stat = NF90_PUT_VAR( id_set_prt,id_var_prt(10), & 174 ! particles%weight_factor, & 175 ! start = (/ 1, prt_time_count /), & 176 ! count = (/ maximum_number_of_particles /) ) 177 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 12 ) 178 ! 179 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(11), particles%x, & 180 ! start = (/ 1, prt_time_count /), & 181 ! count = (/ maximum_number_of_particles /) ) 182 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 13 ) 183 ! 184 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(12), particles%y, & 185 ! start = (/ 1, prt_time_count /), & 186 ! count = (/ maximum_number_of_particles /) ) 187 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 14 ) 188 ! 189 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(13), particles%z, & 190 ! start = (/ 1, prt_time_count /), & 191 ! count = (/ maximum_number_of_particles /) ) 192 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 15 ) 193 ! 194 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(14), particles%class, & 195 ! start = (/ 1, prt_time_count /), & 196 ! count = (/ maximum_number_of_particles /) ) 197 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 16 ) 198 ! 199 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(15), particles%group, & 200 ! start = (/ 1, prt_time_count /), & 201 ! count = (/ maximum_number_of_particles /) ) 202 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 17 ) 203 ! 204 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(16), & 205 ! particles%tailpoints, & 206 ! start = (/ 1, prt_time_count /), & 207 ! count = (/ maximum_number_of_particles /) ) 208 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 18 ) 209 ! 210 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(17), particles%tail_id, & 211 ! start = (/ 1, prt_time_count /), & 212 ! count = (/ maximum_number_of_particles /) ) 213 ! CALL handle_netcdf_error( 'lpm_data_output_particles', 19 ) 214 ! 193 215 #endif 194 216
Note: See TracChangeset
for help on using the changeset viewer.