Changeset 4046 for palm/trunk
- Timestamp:
- Jun 21, 2019 5:32:04 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/netcdf_interface_mod.f90
r4039 r4046 25 25 ! ----------------- 26 26 ! $Id$ 27 ! removal of special treatment for usm_define_netcdf_grid call 28 ! 29 ! 4039 2019-06-18 10:32:41Z suehring 27 30 ! Rename subroutines in module for diagnostic quantities 28 ! 31 ! 29 32 ! 4029 2019-06-14 14:04:35Z raasch 30 33 ! netcdf variable NF90_NOFILL is used as argument instead of "1" in calls to NF90_DEF_VAR_FILL 31 ! 34 ! 32 35 ! 3995 2019-05-22 18:59:54Z suehring 33 36 ! output of turbulence intensity added 34 ! 37 ! 35 38 ! 3994 2019-05-22 18:08:09Z suehring 36 39 ! remove origin time from time unit, compose origin_time_string within 37 40 ! subroutine netcdf_create_global_atts 38 ! 41 ! 39 42 ! 3954 2019-05-06 12:49:42Z gronemeier 40 43 ! bugfix: corrected format for date_time_string 41 ! 44 ! 42 45 ! 3953 2019-05-06 12:11:55Z gronemeier 43 46 ! bugfix: set origin_time and starting point of time coordinate according to 44 47 ! day_of_year_init and time_utc_init 45 ! 48 ! 46 49 ! 3942 2019-04-30 13:08:30Z kanani 47 50 ! Add specifier to netcdf_handle_error to simplify identification of attribute 48 51 ! causing the error 49 ! 52 ! 50 53 ! 3766 2019-02-26 16:23:41Z raasch 51 54 ! bugfix in im_define_netcdf_grid argument list 52 ! 55 ! 53 56 ! 3745 2019-02-15 18:57:56Z suehring 54 57 ! Add indoor model 55 ! 58 ! 56 59 ! 3744 2019-02-15 18:38:58Z suehring 57 60 ! Bugfix: - initialize return values to ensure they are set before returning 58 61 ! (routine define_geo_coordinates) 59 62 ! - change order of dimensions for some variables 60 ! 63 ! 61 64 ! 3727 2019-02-08 14:52:10Z gronemeier 62 65 ! make several routines publicly available 63 ! 66 ! 64 67 ! 3701 2019-01-26 18:57:21Z knoop 65 68 ! Statement added to prevent compiler warning about unused variable 66 ! 69 ! 67 70 ! 3655 2019-01-07 16:51:22Z knoop 68 ! Move the control parameter "salsa" from salsa_mod to control_parameters 71 ! Move the control parameter "salsa" from salsa_mod to control_parameters 69 72 ! (M. Kurppa) 70 ! 73 ! 71 74 ! 3582 2018-11-29 19:16:36Z suehring 72 75 ! dom_dwd_user, Schrempf: 73 76 ! Remove uv exposure model code, this is now part of biometeorology_mod 74 ! 77 ! 75 78 ! 3529 2018-11-15 21:03:15Z gronemeier 76 79 ! - set time units … … 79 82 ! - move definition of UTM and geographic coordinates into subroutine 80 83 ! - change fill_value 81 ! 84 ! 82 85 ! 3525 2018-11-14 16:06:14Z kanani 83 86 ! Changes related to clean-up of biometeorology (dom_dwd_user) 84 ! 87 ! 85 88 ! 3485 2018-11-03 17:09:40Z gronemeier 86 89 ! Write geographic coordinates as global attributes to file. 87 ! 90 ! 88 91 ! 3467 2018-10-30 19:05:21Z suehring 89 92 ! - Salsa implemented 90 93 ! - Bugfix convert_utm_to... 91 ! 94 ! 92 95 ! 3464 2018-10-30 18:08:55Z kanani 93 96 ! - Add variable crs to output files … … 95 98 ! - Add latitude/longitude coordinates. For 3d and xy output, lon and lat are 96 99 ! only written if parallel output is used. 97 ! 100 ! 98 101 ! 3459 2018-10-30 15:04:11Z gronemeier 99 102 ! Adjustment of biometeorology calls 100 ! 103 ! 101 104 ! 3435 2018-10-26 18:25:44Z gronemeier 102 105 ! Bugfix: corrected order of calls to define_netcdf_grid for masked output 103 106 ! Add vertical dimensions to masked output in case of terrain-following output 104 ! 107 ! 105 108 ! 3421 2018-10-24 18:39:32Z gronemeier 106 109 ! Bugfix: move ocean output variables to ocean_mod 107 110 ! Renamed output variables 108 111 ! Add UTM coordinates to mask, 3d, xy, xz, yz output 109 ! 112 ! 110 113 ! 3337 2018-10-12 15:17:09Z kanani 111 114 ! (from branch resler) 112 115 ! Add biometeorology 113 ! 116 ! 114 117 ! 3294 2018-10-01 02:37:10Z raasch 115 118 ! changes concerning modularization of ocean option 116 ! 119 ! 117 120 ! 3274 2018-09-24 15:42:55Z knoop 118 121 ! Modularization of all bulk cloud physics code components 119 ! 122 ! 120 123 ! 3241 2018-09-12 15:02:00Z raasch 121 124 ! unused variables removed 122 ! 125 ! 123 126 ! 3235 2018-09-07 14:06:15Z sward 124 127 ! Changed MAS output dimension id_dim_agtnum to be of defined size and no longer 125 128 ! unlimited. Also changed some MAS output variables to be of type float 126 ! 129 ! 127 130 ! 3198 2018-08-15 09:23:10Z sward 128 131 ! Redefined MAS limited time dimension to fit usage of multi_agent_system_end 129 ! 132 ! 130 133 ! 3187 2018-07-31 10:32:34Z sward 131 134 ! Changed agent output to precision NF90_DOUBLE 132 ! 135 ! 133 136 ! 3165 2018-07-24 13:12:42Z sward 134 137 ! Added agent ID output 135 ! 138 ! 136 139 ! 3159 2018-07-20 11:20:01Z sward 137 140 ! Added multi agent system 138 ! 141 ! 139 142 ! 3049 2018-05-29 13:52:36Z Giersch 140 143 ! Error messages revised 141 ! 144 ! 142 145 ! 3045 2018-05-28 07:55:41Z Giersch 143 146 ! Error messages revised, code adjusted to PALMs coding standards, CASE pt_ext 144 147 ! pt_new disabled, comment revised 145 ! 148 ! 146 149 ! 3004 2018-04-27 12:33:25Z Giersch 147 150 ! .NOT. found in if-query added to account for variables found in tcm 148 ! 151 ! 149 152 ! 2964 2018-04-12 16:04:03Z Giersch 150 153 ! Calculation of fixed number of output time levels for parallel netcdf output 151 154 ! has been moved completely to check_parameters 152 ! 155 ! 153 156 ! 2932 2018-03-26 09:39:22Z maronga 154 157 ! Renamed inipar to initialization_parameters. 155 ! 158 ! 156 159 ! 2817 2018-02-19 16:32:21Z knoop 157 160 ! Preliminary gust module interface implemented 158 ! 161 ! 159 162 ! 2769 2018-01-25 09:22:24Z raasch 160 163 ! bugfix for calculating number of required output time levels in case of output 161 164 ! at the beginning of a restart run 162 ! 165 ! 163 166 ! 2766 2018-01-22 17:17:47Z kanani 164 167 ! Removed preprocessor directive __chem 165 ! 168 ! 166 169 ! 2746 2018-01-15 12:06:04Z suehring 167 170 ! Move flag plant canopy to modules 168 ! 171 ! 169 172 ! 2718 2018-01-02 08:49:38Z maronga 170 173 ! Corrected "Former revisions" section … … 181 184 ! upper bounds of cross section and 3d output changed from nx+1,ny+1 to nx,ny 182 185 ! no output of ghost layer data any more 183 ! 186 ! 184 187 ! 2302 2017-07-03 14:07:20Z suehring 185 188 ! Reading of 3D topography using NetCDF data type NC_BYTE 186 ! 189 ! 187 190 ! 2292 2017-06-20 09:51:42Z schwenkel 188 ! Implementation of new microphysic scheme: cloud_scheme = 'morrison' 189 ! includes two more prognostic equations for cloud drop concentration (nc) 190 ! and cloud water content (qc). 191 ! 191 ! Implementation of new microphysic scheme: cloud_scheme = 'morrison' 192 ! includes two more prognostic equations for cloud drop concentration (nc) 193 ! and cloud water content (qc). 194 ! 192 195 ! 2270 2017-06-09 12:18:47Z maronga 193 196 ! Removed 2 timeseries (shf_eb + qsws_eb). Removed _eb suffixes 194 ! 197 ! 195 198 ! 2265 2017-06-08 16:58:28Z schwenkel 196 199 ! Unused variables removed. 197 ! 200 ! 198 201 ! 2239 2017-06-01 12:04:51Z suehring 199 202 ! Bugfix xy-output of land-surface variables 200 ! 203 ! 201 204 ! 2233 2017-05-30 18:08:54Z suehring 202 205 ! 203 206 ! 2232 2017-05-30 17:47:52Z suehring 204 207 ! Adjustments to new topography and surface concept 205 ! 208 ! 206 209 ! Topograpyh height arrays (zu_s_inner, zw_w_inner) are defined locally, output 207 ! only if parallel netcdf. 208 ! 209 ! Build interface for topography input: 210 ! only if parallel netcdf. 211 ! 212 ! Build interface for topography input: 210 213 ! - open file in read-only mode 211 214 ! - read global attributes … … 216 219 ! 2209 2017-04-19 09:34:46Z kanani 217 220 ! Added support for plant canopy model output 218 ! 221 ! 219 222 ! 2189 2017-03-21 09:29:52Z raasch 220 223 ! bugfix: rho renamed rho_ocean for the cross section output … … 226 229 ! 2040 2016-10-26 16:58:09Z gronemeier 227 230 ! Increased number of possible statistic_regions to 99 228 ! 231 ! 229 232 ! 2037 2016-10-26 11:15:40Z knoop 230 233 ! Anelastic approximation implemented 231 ! 234 ! 232 235 ! 2031 2016-10-21 15:11:58Z knoop 233 236 ! renamed variable rho to rho_ocean 234 ! 237 ! 235 238 ! 2011 2016-09-19 17:29:57Z kanani 236 239 ! Flag urban_surface is now defined in module control_parameters, 237 240 ! changed prefix for urban surface model output to "usm_", 238 241 ! introduced control parameter varnamelength for LEN of trimvar. 239 ! 242 ! 240 243 ! 2007 2016-08-24 15:47:17Z kanani 241 ! Added support for new urban surface model (temporary modifications of 244 ! Added support for new urban surface model (temporary modifications of 242 245 ! SELECT CASE ( ) necessary, see variable trimvar), 243 246 ! increased DIMENSION of do2d_unit, do3d_unit, id_var_do2d, id_var_do3d, 244 247 ! increased LEN of char_cross_profiles, var_list, var_list_old 245 ! 248 ! 246 249 ! 2000 2016-08-20 18:09:15Z knoop 247 250 ! Forced header and separation lines into 80 columns 248 ! 251 ! 249 252 ! 1990 2016-08-12 09:54:36Z gronemeier 250 253 ! Bugfix: variable list was not written for time series output 251 ! 254 ! 252 255 ! 1980 2016-07-29 15:51:57Z suehring 253 256 ! Bugfix, in order to steer user-defined output, setting flag found explicitly 254 257 ! to .F. 255 ! 258 ! 256 259 ! 1976 2016-07-27 13:28:04Z maronga 257 ! Removed remaining 2D land surface quantities. Definition of radiation 260 ! Removed remaining 2D land surface quantities. Definition of radiation 258 261 ! quantities is now done directly in the respective module 259 ! 262 ! 260 263 ! 1972 2016-07-26 07:52:02Z maronga 261 264 ! Bugfix: wrong units for lsm quantities. 262 265 ! Definition of grids for land surface quantities is now done directly in the 263 266 ! respective module. 264 ! 267 ! 265 268 ! 1960 2016-07-12 16:34:24Z suehring 266 ! Additional labels and units for timeseries output of passive scalar-related 269 ! Additional labels and units for timeseries output of passive scalar-related 267 270 ! quantities 268 ! 271 ! 269 272 ! 1957 2016-07-07 10:43:48Z suehring 270 273 ! flight module added … … 272 275 ! 1850 2016-04-08 13:29:27Z maronga 273 276 ! Module renamed 274 ! 275 ! 277 ! 278 ! 276 279 ! 1833 2016-04-07 14:23:03Z raasch 277 280 ! spectrum renamed spectra_mod … … 289 292 ! 1745 2016-02-05 13:06:51Z gronemeier 290 293 ! Bugfix: recalculating ntdim_3d, ntdim_2d_xy/xz/yz when checking the 291 ! extensibility of an existing file (only when using parallel NetCDF). 292 ! 294 ! extensibility of an existing file (only when using parallel NetCDF). 295 ! 293 296 ! 1691 2015-10-26 16:17:44Z maronga 294 ! Added output of radiative heating rates for RRTMG. Corrected output of 297 ! Added output of radiative heating rates for RRTMG. Corrected output of 295 298 ! radiative fluxes 296 ! 299 ! 297 300 ! 1682 2015-10-07 23:56:08Z knoop 298 ! Code annotations made doxygen readable 299 ! 301 ! Code annotations made doxygen readable 302 ! 300 303 ! 1596 2015-05-21 09:34:28Z gronemeier 301 304 ! Bugfix in masked data output. Read 'zu_3d' when trying to extend masked data 302 ! 305 ! 303 306 ! 1551 2015-03-03 14:18:16Z maronga 304 307 ! Added support for land surface model and radiation model output. In the course 305 308 ! of this action a new vertical grid zs (soil) was introduced. 306 ! 309 ! 307 310 ! 1353 2014-04-08 15:21:23Z heinze 308 311 ! REAL constants provided with KIND-attribute … … 346 349 ! 992 2012-09-05 15:08:26Z hoffmann 347 350 ! Removal of the informative messages PA0352 and PA0353. 348 ! 351 ! 349 352 ! 983 2012-08-21 14:17:57Z hoffmann 350 353 ! Bugfix in cross_profiles. … … 355 358 ! 959 2012-07-24 13:13:41Z hoffmann 356 359 ! Bugfix in cross_profiles. It is not allowed to arrange more than 100 357 ! profiles with cross_profiles. 360 ! profiles with cross_profiles. 358 361 ! 359 362 ! 951 2012-07-19 14:22:52Z hoffmann … … 460 463 'rad_net ', 'rad_lw_in ', 'rad_lw_out ', & 461 464 'rad_sw_in ', 'rad_sw_out ', 'rrtm_aldif ', & 462 'rrtm_aldir ', 'rrtm_asdif ', 'rrtm_asdir ', & 465 'rrtm_aldir ', 'rrtm_asdif ', 'rrtm_asdir ', & 463 466 ( 'unknown ', i9 = 1, dots_max-40 ) /) 464 467 … … 566 569 INTEGER(iwp), DIMENSION(11) :: nc_precision 567 570 INTEGER(iwp), DIMENSION(dopr_norm_num) :: id_var_norm_dopr 568 571 569 572 INTEGER(iwp), DIMENSION(fl_max) :: id_dim_x_fl, id_dim_y_fl, id_dim_z_fl 570 573 INTEGER(iwp), DIMENSION(fl_max) :: id_var_x_fl, id_var_y_fl, id_var_z_fl 571 574 572 575 CHARACTER (LEN=20), DIMENSION(fl_max*var_fl_max) :: dofl_label 573 CHARACTER (LEN=20), DIMENSION(fl_max*var_fl_max) :: dofl_unit 576 CHARACTER (LEN=20), DIMENSION(fl_max*var_fl_max) :: dofl_unit 574 577 CHARACTER (LEN=20), DIMENSION(fl_max) :: dofl_dim_label_x 575 578 CHARACTER (LEN=20), DIMENSION(fl_max) :: dofl_dim_label_y 576 579 CHARACTER (LEN=20), DIMENSION(fl_max) :: dofl_dim_label_z 577 580 578 INTEGER(iwp), DIMENSION(fl_max*var_fl_max) :: id_var_dofl 581 INTEGER(iwp), DIMENSION(fl_max*var_fl_max) :: id_var_dofl 579 582 580 583 INTEGER(iwp), DIMENSION(dopts_num,0:10) :: id_var_dopts … … 668 671 669 672 SUBROUTINE netcdf_define_header( callmode, extend, av ) 670 673 671 674 #if defined( __netcdf ) 672 675 … … 678 681 679 682 USE chemistry_model_mod, & 680 ONLY: chem_define_netcdf_grid 683 ONLY: chem_define_netcdf_grid 681 684 682 685 USE basic_constants_and_equations_mod, & … … 702 705 urban_surface 703 706 704 USE diagnostic_output_quantities_mod, & 705 ONLY: doq_define_netcdf_grid 707 USE diagnostic_output_quantities_mod, & 708 ONLY: doq_define_netcdf_grid 706 709 707 710 USE grid_variables, & … … 718 721 USE indoor_model_mod, & 719 722 ONLY: im_define_netcdf_grid 720 723 721 724 USE land_surface_model_mod, & 722 725 ONLY: lsm_define_netcdf_grid, nzb_soil, nzt_soil, nzs, zs … … 737 740 738 741 USE radiation_model_mod, & 739 ONLY: radiation, radiation_define_netcdf_grid 740 742 ONLY: radiation, radiation_define_netcdf_grid 743 741 744 USE salsa_mod, & 742 ONLY: salsa_define_netcdf_grid 745 ONLY: salsa_define_netcdf_grid 743 746 744 747 USE spectra_mod, & … … 894 897 CASE DEFAULT 895 898 WRITE ( message_string, * ) 'unknown variable in ' // & 896 'initialization_parameters ', & 899 'initialization_parameters ', & 897 900 'assignment: netcdf_precision(', i, ')="', & 898 901 TRIM( netcdf_precision(i) ),'"' … … 945 948 946 949 ! 947 !-- Select the mode to be processed. Possibilities are 3d, ma (mask), xy, xz, 948 !-- yz, pr (profiles), ps (particle timeseries), fl (flight data), ts 950 !-- Select the mode to be processed. Possibilities are 3d, ma (mask), xy, xz, 951 !-- yz, pr (profiles), ps (particle timeseries), fl (flight data), ts 949 952 !-- (timeseries) or sp (spectra) 950 953 SELECT CASE ( mode ) … … 953 956 954 957 ! 955 !-- decompose actual parameter file_id (=formal parameter av) into 958 !-- decompose actual parameter file_id (=formal parameter av) into 956 959 !-- mid and av 957 960 file_id = av … … 1087 1090 'meters', 'zu(nzb_s_inner)', 488, 489, & 1088 1091 490 ) 1089 ! 1092 ! 1090 1093 !-- Define zwwi = zw(nzb_w_inner) 1091 1094 CALL netcdf_create_var( id_set_mask(mid,av), & … … 1095 1098 'meters', 'zw(nzb_w_inner)', 491, 492, & 1096 1099 493 ) 1097 ENDIF 1098 1100 ENDIF 1101 1099 1102 IF ( land_surface ) THEN 1100 1103 ! … … 1115 1118 1116 1119 DO WHILE ( domask(mid,av,i)(1:1) /= ' ' ) 1117 ! 1118 !-- Temporary solution to account for data output within the new urban 1119 !-- surface model (urban_surface_mod.f90), see also SELECT CASE ( trimvar ) 1120 1120 1121 trimvar = TRIM( domask(mid,av,i) ) 1121 IF ( urban_surface .AND. trimvar(1:4) == 'usm_' ) THEN1122 trimvar = 'usm_output'1123 ENDIF1124 1122 ! 1125 1123 !-- Check for the grid … … 1157 1155 grid_z = 'zw' 1158 1156 1159 !1160 !-- Block of urban surface model outputs1161 CASE ( 'usm_output' )1162 1163 CALL usm_define_netcdf_grid( domask( mid,av,i), found, &1164 grid_x, grid_y, grid_z )1165 1157 1166 1158 CASE DEFAULT 1167 1159 ! 1168 !-- Check for quantities defined in other modules 1169 CALL tcm_define_netcdf_grid( domask( mid,av,i), found, & 1170 grid_x, grid_y, grid_z ) 1160 !-- Check for quantities defined in other modules 1161 CALL tcm_define_netcdf_grid( trimvar, found, grid_x, grid_y, grid_z ) 1171 1162 1172 1163 IF ( .NOT. found .AND. air_chemistry ) THEN 1173 CALL chem_define_netcdf_grid( domask(mid,av,i), found, & 1174 grid_x, grid_y, grid_z ) 1164 CALL chem_define_netcdf_grid( trimvar, found, grid_x, grid_y, grid_z ) 1175 1165 ENDIF 1176 1166 1177 1167 IF ( .NOT. found ) & 1178 CALL doq_define_netcdf_grid( domask(mid,av,i), found, & 1179 grid_x, grid_y, grid_z ) 1180 1168 CALL doq_define_netcdf_grid( trimvar, found, grid_x, grid_y, grid_z ) 1169 1181 1170 IF ( .NOT. found .AND. gust_module_enabled ) THEN 1182 CALL gust_define_netcdf_grid( domask(mid,av,i), found, & 1183 grid_x, grid_y, grid_z ) 1171 CALL gust_define_netcdf_grid( trimvar, found, grid_x, grid_y, grid_z ) 1184 1172 ENDIF 1185 1173 1186 IF ( land_surface ) THEN 1187 CALL lsm_define_netcdf_grid( domask(mid,av,i), found, & 1188 grid_x, grid_y, grid_z ) 1174 IF ( .NOT. found .AND. land_surface ) THEN 1175 CALL lsm_define_netcdf_grid( trimvar, found, grid_x, grid_y, grid_z ) 1189 1176 ENDIF 1190 1177 1191 1178 IF ( .NOT. found .AND. ocean_mode ) THEN 1192 CALL ocean_define_netcdf_grid( domask(mid,av,i), found, & 1193 grid_x, grid_y, grid_z ) 1179 CALL ocean_define_netcdf_grid( trimvar, found, grid_x, grid_y, grid_z ) 1194 1180 ENDIF 1195 1181 1196 1182 IF ( .NOT. found .AND. plant_canopy ) THEN 1197 CALL pcm_define_netcdf_grid( domask(mid,av,i), found, & 1198 grid_x, grid_y, grid_z ) 1183 CALL pcm_define_netcdf_grid( trimvar, found, grid_x, grid_y, grid_z ) 1199 1184 ENDIF 1200 1185 1201 1186 IF ( .NOT. found .AND. radiation ) THEN 1202 CALL radiation_define_netcdf_grid( domask(mid,av,i), & 1203 found, grid_x, grid_y,& 1204 grid_z ) 1187 CALL radiation_define_netcdf_grid( trimvar, found, grid_x, grid_y, grid_z ) 1205 1188 ENDIF 1206 1189 ! 1207 1190 !-- Check for SALSA quantities 1208 1191 IF ( .NOT. found .AND. salsa ) THEN 1209 CALL salsa_define_netcdf_grid( domask(mid,av,i), found, & 1210 grid_x, grid_y, grid_z ) 1211 ENDIF 1192 CALL salsa_define_netcdf_grid( trimvar, found, grid_x, grid_y, grid_z ) 1193 ENDIF 1194 1195 IF ( .NOT. found .AND. urban_surface ) THEN 1196 CALL usm_define_netcdf_grid( trimvar, found, grid_x, grid_y, grid_z ) 1197 ENDIF 1212 1198 ! 1213 1199 !-- Now check for user-defined quantities 1214 1200 IF ( .NOT. found .AND. user_module_enabled ) THEN 1215 CALL user_define_netcdf_grid( domask(mid,av,i), found, & 1216 grid_x, grid_y, grid_z ) 1201 CALL user_define_netcdf_grid( trimvar, found, grid_x, grid_y, grid_z ) 1217 1202 ENDIF 1218 1203 1219 1204 IF ( .NOT. found ) THEN 1220 WRITE ( message_string, * ) 'no grid defined for', & 1221 ' variable ', TRIM( domask(mid,av,i) ) 1222 CALL message( 'define_netcdf_header', 'PA0244', 0, 1, 0, & 1223 6, 0 ) 1205 WRITE ( message_string, * ) 'no grid defined for variable ', TRIM( trimvar ) 1206 CALL message( 'define_netcdf_header', 'PA0244', 0, 1, 0, 6, 0 ) 1224 1207 ENDIF 1225 1208 … … 1329 1312 ALLOCATE( netcdf_data(mask_size(mid,1)) ) 1330 1313 DO k = 0, 2 1331 ! 1314 ! 1332 1315 !-- Scalar grid points 1333 1316 IF ( k == 0 ) THEN 1334 1317 shift_x = 0.5 1335 ! 1318 ! 1336 1319 !-- u grid points 1337 1320 ELSEIF ( k == 1 ) THEN 1338 1321 shift_x = 0.0 1339 ! 1322 ! 1340 1323 !-- v grid points 1341 1324 ELSEIF ( k == 2 ) THEN … … 1392 1375 1393 1376 DO k = 0, 2 1394 ! 1377 ! 1395 1378 !-- Scalar grid points 1396 1379 IF ( k == 0 ) THEN 1397 1380 shift_x = 0.5 ; shift_y = 0.5 1398 ! 1381 ! 1399 1382 !-- u grid points 1400 1383 ELSEIF ( k == 1 ) THEN 1401 1384 shift_x = 0.0 ; shift_y = 0.5 1402 ! 1385 ! 1403 1386 !-- v grid points 1404 1387 ELSEIF ( k == 2 ) THEN … … 1428 1411 ENDDO 1429 1412 ENDDO 1430 1413 1431 1414 nc_stat = NF90_PUT_VAR( id_set_mask(mid,av), & 1432 1415 id_var_nutm_mask(k,mid,av), & … … 1435 1418 mask_size(mid,2) /) ) 1436 1419 CALL netcdf_handle_error( 'netcdf_define_header', 556 ) 1437 1420 1438 1421 ENDDO 1439 1422 DEALLOCATE( netcdf_data_2d ) … … 1447 1430 1448 1431 DO k = 0, 2 1449 ! 1432 ! 1450 1433 !-- Scalar grid points 1451 1434 IF ( k == 0 ) THEN 1452 1435 shift_x = 0.5 ; shift_y = 0.5 1453 ! 1436 ! 1454 1437 !-- u grid points 1455 1438 ELSEIF ( k == 1 ) THEN 1456 1439 shift_x = 0.0 ; shift_y = 0.5 1457 ! 1440 ! 1458 1441 !-- v grid points 1459 1442 ELSEIF ( k == 2 ) THEN … … 1590 1573 1591 1574 ! 1592 !-- decompose actual parameter file_id (=formal parameter av) into 1575 !-- decompose actual parameter file_id (=formal parameter av) into 1593 1576 !-- mid and av 1594 1577 file_id = av … … 1714 1697 ! 1715 1698 !-- Update the title attribute on file 1716 !-- In order to avoid 'data mode' errors if updated attributes are larger 1717 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 1718 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 1719 !-- performance loss due to data copying; an alternative strategy would be 1699 !-- In order to avoid 'data mode' errors if updated attributes are larger 1700 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 1701 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 1702 !-- performance loss due to data copying; an alternative strategy would be 1720 1703 !-- to ensure equal attribute size in a job chain. Maybe revise later. 1721 1704 IF ( av == 0 ) THEN … … 1839 1822 id_var_zusi_3d(av), 'meters', & 1840 1823 'zu(nzb_s_inner)', 413, 414, 415 ) 1841 ! 1824 ! 1842 1825 !-- Define zwwi = zw(nzb_w_inner) 1843 1826 CALL netcdf_create_var( id_set_3d(av), (/ id_dim_x_3d(av), & … … 1846 1829 'zw(nzb_w_inner)', 416, 417, 418 ) 1847 1830 1848 ENDIF 1831 ENDIF 1849 1832 1850 1833 IF ( land_surface ) THEN … … 1866 1849 DO WHILE ( do3d(av,i)(1:1) /= ' ' ) 1867 1850 ! 1868 !-- Temporary solution to account for data output within the new urban 1851 !-- Temporary solution to account for data output within the new urban 1869 1852 !-- surface model (urban_surface_mod.f90), see also SELECT CASE ( trimvar ) 1870 1853 trimvar = TRIM( do3d(av,i) ) … … 1907 1890 grid_z = 'zw' 1908 1891 1909 ! 1910 !-- Block of urban surface model outputs 1892 ! 1893 !-- Block of urban surface model outputs 1911 1894 CASE ( 'usm_output' ) 1912 1895 CALL usm_define_netcdf_grid( do3d(av,i), found, & … … 1952 1935 ENDIF 1953 1936 ! 1954 !-- Check for indoor model quantities 1955 IF ( .NOT. found .AND. indoor_model ) THEN 1937 !-- Check for indoor model quantities 1938 IF ( .NOT. found .AND. indoor_model ) THEN 1956 1939 CALL im_define_netcdf_grid( do3d(av,i), found, & 1957 1940 grid_x, grid_y, grid_z ) … … 1966 1949 1967 1950 ! 1968 !-- Check for chemistry quantities 1951 !-- Check for chemistry quantities 1969 1952 IF ( .NOT. found .AND. air_chemistry ) THEN 1970 1953 CALL chem_define_netcdf_grid( do3d(av,i), found, & … … 1977 1960 CALL salsa_define_netcdf_grid( do3d(av,i), found, grid_x,& 1978 1961 grid_y, grid_z ) 1979 ENDIF 1980 ! 1962 ENDIF 1963 ! 1981 1964 !-- Check for user-defined quantities 1982 1965 IF ( .NOT. found .AND. user_module_enabled ) THEN … … 1984 1967 grid_y, grid_z ) 1985 1968 ENDIF 1986 1969 1987 1970 IF ( .NOT. found ) & 1988 1971 CALL doq_define_netcdf_grid( do3d(av,i), found, grid_x, & 1989 1972 grid_y, grid_z ) 1990 1973 1991 1974 IF ( .NOT. found ) THEN 1992 1975 WRITE ( message_string, * ) 'no grid defined for varia', & … … 2133 2116 ALLOCATE( netcdf_data(0:nx) ) 2134 2117 DO k = 0, 2 2135 ! 2118 ! 2136 2119 !-- Scalar grid points 2137 2120 IF ( k == 0 ) THEN 2138 2121 shift_x = 0.5 2139 ! 2122 ! 2140 2123 !-- u grid points 2141 2124 ELSEIF ( k == 1 ) THEN 2142 2125 shift_x = 0.0 2143 ! 2126 ! 2144 2127 !-- v grid points 2145 2128 ELSEIF ( k == 2 ) THEN 2146 2129 shift_x = 0.5 2147 2130 ENDIF 2148 2131 2149 2132 DO i = 0, nx 2150 2133 netcdf_data(i) = init_model%origin_x & 2151 2134 + cos_ra * ( i + shift_x ) * dx 2152 2135 ENDDO 2153 2136 2154 2137 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_eutm_3d(k,av),& 2155 2138 netcdf_data, start = (/ 1 /), & … … 2196 2179 cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp ) 2197 2180 sin_ra = SIN( init_model%rotation_angle * pi / 180.0_wp ) 2198 2181 2199 2182 DO k = 0, 2 2200 ! 2183 ! 2201 2184 !-- Scalar grid points 2202 2185 IF ( k == 0 ) THEN 2203 2186 shift_x = 0.5 ; shift_y = 0.5 2204 ! 2187 ! 2205 2188 !-- u grid points 2206 2189 ELSEIF ( k == 1 ) THEN 2207 2190 shift_x = 0.0 ; shift_y = 0.5 2208 ! 2191 ! 2209 2192 !-- v grid points 2210 2193 ELSEIF ( k == 2 ) THEN 2211 2194 shift_x = 0.5 ; shift_y = 0.0 2212 2195 ENDIF 2213 2196 2214 2197 DO j = 0, ny 2215 2198 DO i = 0, nx … … 2219 2202 ENDDO 2220 2203 ENDDO 2221 2204 2222 2205 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_eutm_3d(k,av), & 2223 2206 netcdf_data_2d, start = (/ 1, 1 /), & 2224 2207 count = (/ nx+1, ny+1 /) ) 2225 2208 CALL netcdf_handle_error( 'netcdf_define_header', 555 ) 2226 2209 2227 2210 DO j = 0, ny 2228 2211 DO i = 0, nx … … 2232 2215 ENDDO 2233 2216 ENDDO 2234 2217 2235 2218 nc_stat = NF90_PUT_VAR( id_set_3d(av), id_var_nutm_3d(k,av), & 2236 2219 netcdf_data_2d, start = (/ 1, 1 /), & 2237 2220 count = (/ nx+1, ny+1 /) ) 2238 2221 CALL netcdf_handle_error( 'netcdf_define_header', 556 ) 2239 2222 2240 2223 ENDDO 2241 2224 DEALLOCATE( netcdf_data_2d ) … … 2274 2257 2275 2258 DO k = 0, 2 2276 ! 2259 ! 2277 2260 !-- Scalar grid points 2278 2261 IF ( k == 0 ) THEN 2279 2262 shift_x = 0.5 ; shift_y = 0.5 2280 ! 2263 ! 2281 2264 !-- u grid points 2282 2265 ELSEIF ( k == 1 ) THEN 2283 2266 shift_x = 0.0 ; shift_y = 0.5 2284 ! 2267 ! 2285 2268 !-- v grid points 2286 2269 ELSEIF ( k == 2 ) THEN … … 2534 2517 ! 2535 2518 !-- Update the title attribute on file 2536 !-- In order to avoid 'data mode' errors if updated attributes are larger 2537 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 2538 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 2539 !-- performance loss due to data copying; an alternative strategy would be 2519 !-- In order to avoid 'data mode' errors if updated attributes are larger 2520 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 2521 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 2522 !-- performance loss due to data copying; an alternative strategy would be 2540 2523 !-- to ensure equal attribute size. Maybe revise later. 2541 2524 IF ( av == 0 ) THEN … … 2631 2614 ! CASE ( 'ag_ext' ) 2632 2615 ! !+?agent extend output for restart runs has to be adapted 2633 ! 2616 ! 2634 2617 ! ! 2635 2618 ! !-- Get the id of the time coordinate (unlimited coordinate) and its … … 2639 2622 ! nc_stat = NF90_INQ_VARID( id_set_agt, 'time', id_var_time_agt ) 2640 2623 ! CALL netcdf_handle_error( 'netcdf_define_header', 343 ) 2641 ! 2624 ! 2642 2625 ! nc_stat = NF90_INQUIRE_VARIABLE( id_set_agt, id_var_time_agt, & 2643 2626 ! dimids = id_dim_time_old ) 2644 2627 ! CALL netcdf_handle_error( 'netcdf_define_header', 344 ) 2645 2628 ! id_dim_time_agt = id_dim_time_old(1) 2646 ! 2629 ! 2647 2630 ! nc_stat = NF90_INQUIRE_DIMENSION( id_set_agt, id_dim_time_agt, & 2648 2631 ! len = agt_time_count ) 2649 2632 ! CALL netcdf_handle_error( 'netcdf_define_header', 345 ) 2650 ! 2633 ! 2651 2634 ! nc_stat = NF90_GET_VAR( id_set_agt, id_var_time_agt, & 2652 2635 ! last_time_coordinate, & … … 2654 2637 ! count = (/ 1 /) ) 2655 2638 ! CALL netcdf_handle_error( 'netcdf_define_header', 346 ) 2656 ! 2639 ! 2657 2640 ! IF ( last_time_coordinate(1) >= simulated_time ) THEN 2658 2641 ! message_string = 'netCDF file for agents ' // & … … 2668 2651 ! RETURN 2669 2652 ! ENDIF 2670 ! 2653 ! 2671 2654 ! ! 2672 2655 ! !-- Dataset seems to be extendable. … … 2675 2658 ! id_var_rnoa_agt ) 2676 2659 ! CALL netcdf_handle_error( 'netcdf_define_header', 347 ) 2677 ! 2660 ! 2678 2661 ! DO i = 1, 17 2679 ! 2662 ! 2680 2663 ! nc_stat = NF90_INQ_VARID( id_set_agt, agt_var_names(i), & 2681 2664 ! id_var_prt(i) ) 2682 2665 ! CALL netcdf_handle_error( 'netcdf_define_header', 348 ) 2683 ! 2666 ! 2684 2667 ! ENDDO 2685 ! 2668 ! 2686 2669 ! message_string = 'netCDF file for particles ' // & 2687 2670 ! 'from previous run found.' // & 2688 2671 ! '&This file will be extended.' 2689 2672 ! CALL message( 'define_netcdf_header', 'PA0266', 0, 0, 0, 6, 0 ) 2690 2673 2691 2674 2692 2675 CASE ( 'xy_new' ) … … 2830 2813 id_var_zusi_xy(av), 'meters', & 2831 2814 'zu(nzb_s_inner)', 421, 422, 423 ) 2832 ! 2815 ! 2833 2816 !-- Define zwwi = zw(nzb_w_inner) 2834 2817 CALL netcdf_create_var( id_set_xy(av), (/ id_dim_x_xy(av), & … … 2935 2918 grid_x, grid_y, & 2936 2919 grid_z ) 2937 ENDIF 2920 ENDIF 2938 2921 2939 2922 ! … … 2958 2941 grid_z ) 2959 2942 ENDIF 2960 2943 2961 2944 IF ( .NOT. found ) & 2962 2945 CALL doq_define_netcdf_grid( & … … 3192 3175 ALLOCATE( netcdf_data(0:nx) ) 3193 3176 DO k = 0, 2 3194 ! 3177 ! 3195 3178 !-- Scalar grid points 3196 3179 IF ( k == 0 ) THEN 3197 3180 shift_x = 0.5 3198 ! 3181 ! 3199 3182 !-- u grid points 3200 3183 ELSEIF ( k == 1 ) THEN 3201 3184 shift_x = 0.0 3202 ! 3185 ! 3203 3186 !-- v grid points 3204 3187 ELSEIF ( k == 2 ) THEN 3205 3188 shift_x = 0.5 3206 3189 ENDIF 3207 3190 3208 3191 DO i = 0, nx 3209 3192 netcdf_data(i) = init_model%origin_x & 3210 3193 + cos_ra * ( i + shift_x ) * dx 3211 3194 ENDDO 3212 3195 3213 3196 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_eutm_xy(k,av),& 3214 3197 netcdf_data, start = (/ 1 /), & … … 3255 3238 cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp ) 3256 3239 sin_ra = SIN( init_model%rotation_angle * pi / 180.0_wp ) 3257 3240 3258 3241 DO k = 0, 2 3259 ! 3242 ! 3260 3243 !-- Scalar grid points 3261 3244 IF ( k == 0 ) THEN 3262 3245 shift_x = 0.5 ; shift_y = 0.5 3263 ! 3246 ! 3264 3247 !-- u grid points 3265 3248 ELSEIF ( k == 1 ) THEN 3266 3249 shift_x = 0.0 ; shift_y = 0.5 3267 ! 3250 ! 3268 3251 !-- v grid points 3269 3252 ELSEIF ( k == 2 ) THEN 3270 3253 shift_x = 0.5 ; shift_y = 0.0 3271 3254 ENDIF 3272 3255 3273 3256 DO j = 0, ny 3274 3257 DO i = 0, nx … … 3278 3261 ENDDO 3279 3262 ENDDO 3280 3263 3281 3264 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_eutm_xy(k,av), & 3282 3265 netcdf_data_2d, start = (/ 1, 1 /), & 3283 3266 count = (/ nx+1, ny+1 /) ) 3284 3267 CALL netcdf_handle_error( 'netcdf_define_header', 555 ) 3285 3268 3286 3269 DO j = 0, ny 3287 3270 DO i = 0, nx … … 3291 3274 ENDDO 3292 3275 ENDDO 3293 3276 3294 3277 nc_stat = NF90_PUT_VAR( id_set_xy(av), id_var_nutm_xy(k,av), & 3295 3278 netcdf_data_2d, start = (/ 1, 1 /), & … … 3312 3295 3313 3296 DO k = 0, 2 3314 ! 3297 ! 3315 3298 !-- Scalar grid points 3316 3299 IF ( k == 0 ) THEN 3317 3300 shift_x = 0.5 ; shift_y = 0.5 3318 ! 3301 ! 3319 3302 !-- u grid points 3320 3303 ELSEIF ( k == 1 ) THEN 3321 3304 shift_x = 0.0 ; shift_y = 0.5 3322 ! 3305 ! 3323 3306 !-- v grid points 3324 3307 ELSEIF ( k == 2 ) THEN … … 3357 3340 ENDIF 3358 3341 ! 3359 !-- In case of non-flat topography write height information. Only for 3342 !-- In case of non-flat topography write height information. Only for 3360 3343 !-- parallel netcdf output. 3361 3344 IF ( TRIM( topography ) /= 'flat' .AND. & … … 3622 3605 ! 3623 3606 !-- Update the title attribute on file 3624 !-- In order to avoid 'data mode' errors if updated attributes are larger 3625 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 3626 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 3627 !-- performance loss due to data copying; an alternative strategy would be 3607 !-- In order to avoid 'data mode' errors if updated attributes are larger 3608 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 3609 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 3610 !-- performance loss due to data copying; an alternative strategy would be 3628 3611 !-- to ensure equal attribute size in a job chain. Maybe revise later. 3629 3612 IF ( av == 0 ) THEN … … 3645 3628 '&This file will be extended.' 3646 3629 CALL message( 'define_netcdf_header', 'PA0253', 0, 0, 0, 6, 0 ) 3647 3630 3648 3631 3649 3632 CASE ( 'xz_new' ) … … 3838 3821 CALL salsa_define_netcdf_grid( do2d(av,i), found, & 3839 3822 grid_x, grid_y, grid_z ) 3840 ENDIF 3823 ENDIF 3841 3824 3842 3825 ! … … 3854 3837 grid_z ) 3855 3838 ENDIF 3856 3839 3857 3840 IF ( .NOT. found ) & 3858 3841 CALL doq_define_netcdf_grid( do2d(av,i), found, & … … 3925 3908 ! 3926 3909 !-- Test simulations showed that the output of cross sections 3927 !-- by all PEs in data_output_2d using NF90_COLLECTIVE is 3910 !-- by all PEs in data_output_2d using NF90_COLLECTIVE is 3928 3911 !-- faster than the output by the first row of PEs in 3929 3912 !-- x-direction using NF90_INDEPENDENT. 3930 nc_stat = NF90_VAR_PAR_ACCESS( id_set_xz(av), & 3913 nc_stat = NF90_VAR_PAR_ACCESS( id_set_xz(av), & 3931 3914 id_var_do2d(av,i), & 3932 3915 NF90_COLLECTIVE ) … … 4077 4060 ALLOCATE( netcdf_data(0:nx) ) 4078 4061 DO k = 0, 2 4079 ! 4062 ! 4080 4063 !-- Scalar grid points 4081 4064 IF ( k == 0 ) THEN 4082 4065 shift_x = 0.5 4083 ! 4066 ! 4084 4067 !-- u grid points 4085 4068 ELSEIF ( k == 1 ) THEN 4086 4069 shift_x = 0.0 4087 ! 4070 ! 4088 4071 !-- v grid points 4089 4072 ELSEIF ( k == 2 ) THEN 4090 4073 shift_x = 0.5 4091 4074 ENDIF 4092 4075 4093 4076 DO i = 0, nx 4094 4077 netcdf_data(i) = init_model%origin_x & 4095 4078 + cos_ra * ( i + shift_x ) * dx 4096 4079 ENDDO 4097 4080 4098 4081 nc_stat = NF90_PUT_VAR( id_set_xz(av), id_var_eutm_xz(k,av),& 4099 4082 netcdf_data, start = (/ 1 /), & … … 4144 4127 cos_ra = COS( init_model%rotation_angle * pi / 180.0_wp ) 4145 4128 sin_ra = SIN( init_model%rotation_angle * pi / 180.0_wp ) 4146 4129 4147 4130 DO k = 0, 2 4148 ! 4131 ! 4149 4132 !-- Scalar grid points 4150 4133 IF ( k == 0 ) THEN 4151 4134 shift_x = 0.5 ; shift_y = 0.5 4152 ! 4135 ! 4153 4136 !-- u grid points 4154 4137 ELSEIF ( k == 1 ) THEN 4155 4138 shift_x = 0.0 ; shift_y = 0.5 4156 ! 4139 ! 4157 4140 !-- v grid points 4158 4141 ELSEIF ( k == 2 ) THEN … … 4171 4154 ENDIF 4172 4155 ENDDO 4173 4156 4174 4157 nc_stat = NF90_PUT_VAR( id_set_xz(av), id_var_eutm_xz(k,av), & 4175 4158 netcdf_data_2d, start = (/ 1, 1 /), & 4176 4159 count = (/ nx+1, ns /) ) 4177 4160 CALL netcdf_handle_error( 'netcdf_define_header', 555 ) 4178 4161 4179 4162 DO j = 1, ns 4180 4163 IF( section(j,2) == -1 ) THEN … … 4188 4171 ENDIF 4189 4172 ENDDO 4190 4173 4191 4174 nc_stat = NF90_PUT_VAR( id_set_xz(av), id_var_nutm_xz(k,av), & 4192 4175 netcdf_data_2d, start = (/ 1, 1 /), & 4193 4176 count = (/ nx+1, ns /) ) 4194 4177 CALL netcdf_handle_error( 'netcdf_define_header', 556 ) 4195 4178 4196 4179 ENDDO 4197 4180 DEALLOCATE( netcdf_data_2d ) … … 4205 4188 4206 4189 DO k = 0, 2 4207 ! 4190 ! 4208 4191 !-- Scalar grid points 4209 4192 IF ( k == 0 ) THEN 4210 4193 shift_x = 0.5 ; shift_y = 0.5 4211 ! 4194 ! 4212 4195 !-- u grid points 4213 4196 ELSEIF ( k == 1 ) THEN 4214 4197 shift_x = 0.0 ; shift_y = 0.5 4215 ! 4198 ! 4216 4199 !-- v grid points 4217 4200 ELSEIF ( k == 2 ) THEN … … 4319 4302 TRIM( var ) // ' from previous run found,' // & 4320 4303 '&but this file cannot be extended due to' // & 4321 ' mismatch in number of' // & 4304 ' mismatch in number of' // & 4322 4305 ' cross sections.' // & 4323 4306 '&New file is created instead.' … … 4465 4448 ! 4466 4449 !-- Test simulations showed that the output of cross sections 4467 !-- by all PEs in data_output_2d using NF90_COLLECTIVE is 4450 !-- by all PEs in data_output_2d using NF90_COLLECTIVE is 4468 4451 !-- faster than the output by the first row of PEs in 4469 4452 !-- x-direction using NF90_INDEPENDENT. … … 4484 4467 ! 4485 4468 !-- Update the title attribute on file 4486 !-- In order to avoid 'data mode' errors if updated attributes are larger 4487 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 4488 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 4489 !-- performance loss due to data copying; an alternative strategy would be 4469 !-- In order to avoid 'data mode' errors if updated attributes are larger 4470 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 4471 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 4472 !-- performance loss due to data copying; an alternative strategy would be 4490 4473 !-- to ensure equal attribute size in a job chain. Maybe revise later. 4491 4474 IF ( av == 0 ) THEN … … 4701 4684 CALL salsa_define_netcdf_grid( do2d(av,i), found, & 4702 4685 grid_x, grid_y, grid_z ) 4703 ENDIF 4686 ENDIF 4704 4687 ! 4705 4688 !-- Check for gust module quantities … … 4716 4699 grid_z ) 4717 4700 ENDIF 4718 4701 4719 4702 IF ( .NOT. found ) & 4720 4703 CALL doq_define_netcdf_grid( & … … 4786 4769 ! 4787 4770 !-- Test simulations showed that the output of cross sections 4788 !-- by all PEs in data_output_2d using NF90_COLLECTIVE is 4771 !-- by all PEs in data_output_2d using NF90_COLLECTIVE is 4789 4772 !-- faster than the output by the first row of PEs in 4790 4773 !-- y-direction using NF90_INDEPENDENT. … … 4927 4910 ALLOCATE( netcdf_data(1:ns) ) 4928 4911 DO k = 0, 2 4929 ! 4912 ! 4930 4913 !-- Scalar grid points 4931 4914 IF ( k == 0 ) THEN 4932 4915 shift_x = 0.5 4933 ! 4916 ! 4934 4917 !-- u grid points 4935 4918 ELSEIF ( k == 1 ) THEN 4936 4919 shift_x = 0.0 4937 ! 4920 ! 4938 4921 !-- v grid points 4939 4922 ELSEIF ( k == 2 ) THEN 4940 4923 shift_x = 0.5 4941 4924 ENDIF 4942 4925 4943 4926 DO i = 1, ns 4944 4927 IF( section(i,3) == -1 ) THEN … … 4949 4932 ENDIF 4950 4933 ENDDO 4951 4934 4952 4935 nc_stat = NF90_PUT_VAR( id_set_yz(av), id_var_eutm_yz(k,av),& 4953 4936 netcdf_data, start = (/ 1 /), & … … 4996 4979 4997 4980 DO k = 0, 2 4998 ! 4981 ! 4999 4982 !-- Scalar grid points 5000 4983 IF ( k == 0 ) THEN 5001 4984 shift_x = 0.5 ; shift_y = 0.5 5002 ! 4985 ! 5003 4986 !-- u grid points 5004 4987 ELSEIF ( k == 1 ) THEN 5005 4988 shift_x = 0.0 ; shift_y = 0.5 5006 ! 4989 ! 5007 4990 !-- v grid points 5008 4991 ELSEIF ( k == 2 ) THEN … … 5021 5004 ENDDO 5022 5005 ENDDO 5023 5006 5024 5007 nc_stat = NF90_PUT_VAR( id_set_yz(av), id_var_eutm_yz(k,av), & 5025 5008 netcdf_data_2d, start = (/ 1, 1 /), & 5026 5009 count = (/ ns, ny+1 /) ) 5027 5010 CALL netcdf_handle_error( 'netcdf_define_header', 555 ) 5028 5011 5029 5012 DO j = 0, ny 5030 5013 DO i = 1, ns … … 5043 5026 count = (/ ns, ny+1 /) ) 5044 5027 CALL netcdf_handle_error( 'netcdf_define_header', 556 ) 5045 5028 5046 5029 ENDDO 5047 5030 DEALLOCATE( netcdf_data_2d ) … … 5055 5038 5056 5039 DO k = 0, 2 5057 ! 5040 ! 5058 5041 !-- Scalar grid points 5059 5042 IF ( k == 0 ) THEN 5060 5043 shift_x = 0.5 ; shift_y = 0.5 5061 ! 5044 ! 5062 5045 !-- u grid points 5063 5046 ELSEIF ( k == 1 ) THEN 5064 5047 shift_x = 0.0 ; shift_y = 0.5 5065 ! 5048 ! 5066 5049 !-- v grid points 5067 5050 ELSEIF ( k == 2 ) THEN … … 5136 5119 TRIM( var ) // ' from previous run found,' // & 5137 5120 '&but this file cannot be extended due to' // & 5138 ' variable mismatch.' // & 5121 ' variable mismatch.' // & 5139 5122 '&New file is created instead.' 5140 5123 CALL message( 'define_netcdf_header', 'PA0249', 0, 1, 0, 6, 0 ) … … 5315 5298 ! 5316 5299 !-- Test simulations showed that the output of cross sections 5317 !-- by all PEs in data_output_2d using NF90_COLLECTIVE is 5300 !-- by all PEs in data_output_2d using NF90_COLLECTIVE is 5318 5301 !-- faster than the output by the first row of PEs in 5319 5302 !-- y-direction using NF90_INDEPENDENT. … … 5334 5317 ! 5335 5318 !-- Update the title attribute on file 5336 !-- In order to avoid 'data mode' errors if updated attributes are larger 5337 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 5338 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 5339 !-- performance loss due to data copying; an alternative strategy would be 5319 !-- In order to avoid 'data mode' errors if updated attributes are larger 5320 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 5321 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 5322 !-- performance loss due to data copying; an alternative strategy would be 5340 5323 !-- to ensure equal attribute size in a job chain. Maybe revise later. 5341 5324 IF ( av == 0 ) THEN … … 5378 5361 !-- This information can be used by palmplot. 5379 5362 nc_stat = NF90_PUT_ATT( id_set_pr, NF90_GLOBAL, & 5380 'no_rows', & 5381 profile_rows ) 5363 'no_rows', & 5364 profile_rows ) 5382 5365 CALL netcdf_handle_error( 'netcdf_define_header', 519 ) 5383 5366 5384 5367 nc_stat = NF90_PUT_ATT( id_set_pr, NF90_GLOBAL, & 5385 'no_columns', & 5386 profile_columns ) 5368 'no_columns', & 5369 profile_columns ) 5387 5370 CALL netcdf_handle_error( 'netcdf_define_header', 520 ) 5388 5371 … … 5419 5402 cross_profiles_count = MIN( crmax, k-1 ) 5420 5403 ! 5421 !-- Check if all profiles defined in cross_profiles are defined in 5404 !-- Check if all profiles defined in cross_profiles are defined in 5422 5405 !-- data_output_pr. If not, they will be skipped. 5423 5406 DO i = 1, cross_profiles_count … … 5456 5439 ENDDO 5457 5440 ! 5458 !-- Check if all profiles defined in data_output_pr are defined in 5441 !-- Check if all profiles defined in data_output_pr are defined in 5459 5442 !-- cross_profiles. If not, they will be added to cross_profiles. 5460 5443 DO i = 1, dopr_n … … 5488 5471 5489 5472 ! 5490 !-- Writing cross_profiles to netcdf header. This information can be 5491 !-- used by palmplot. Each profile is separated by ",", each cross is 5473 !-- Writing cross_profiles to netcdf header. This information can be 5474 !-- used by palmplot. Each profile is separated by ",", each cross is 5492 5475 !-- separated by ";". 5493 5476 char_cross_profiles = ';' … … 5708 5691 i = 1 5709 5692 DO i = 1, dopr_n 5710 5693 5711 5694 IF ( statistic_regions == 0 ) THEN 5712 5695 nc_stat = NF90_INQ_VARID( id_set_pr, data_output_pr(i), & … … 5736 5719 ! 5737 5720 !-- Update the title attribute on file 5738 !-- In order to avoid 'data mode' errors if updated attributes are larger 5739 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 5740 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 5741 !-- performance loss due to data copying; an alternative strategy would be 5721 !-- In order to avoid 'data mode' errors if updated attributes are larger 5722 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 5723 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 5724 !-- performance loss due to data copying; an alternative strategy would be 5742 5725 !-- to ensure equal attribute size in a job chain. Maybe revise later. 5743 5726 IF ( averaging_interval_pr == 0.0_wp ) THEN … … 5911 5894 i = 1 5912 5895 DO i = 1, dots_num 5913 5896 5914 5897 IF ( statistic_regions == 0 ) THEN 5915 5898 nc_stat = NF90_INQ_VARID( id_set_ts, dots_label(i), & … … 5930 5913 ! 5931 5914 !-- Update the title attribute on file 5932 !-- In order to avoid 'data mode' errors if updated attributes are larger 5933 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 5934 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 5935 !-- performance loss due to data copying; an alternative strategy would be 5915 !-- In order to avoid 'data mode' errors if updated attributes are larger 5916 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 5917 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 5918 !-- performance loss due to data copying; an alternative strategy would be 5936 5919 !-- to ensure equal attribute size in a job chain. Maybe revise later. 5937 5920 nc_stat = NF90_REDEF( id_set_ts ) … … 6276 6259 'from previous run found,' // & 6277 6260 '&but this file cannot be extended becaus' // & 6278 'e the current output time' // & 6261 'e the current output time' // & 6279 6262 '&is less or equal than the last output t' // & 6280 6263 'ime on this file.' // & … … 6312 6295 ! 6313 6296 !-- Update the title attribute on file 6314 !-- In order to avoid 'data mode' errors if updated attributes are larger 6315 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 6316 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 6317 !-- performance loss due to data copying; an alternative strategy would be 6297 !-- In order to avoid 'data mode' errors if updated attributes are larger 6298 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 6299 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 6300 !-- performance loss due to data copying; an alternative strategy would be 6318 6301 !-- to ensure equal attribute size in a job chain. Maybe revise later. 6319 6302 nc_stat = NF90_REDEF( id_set_sp ) … … 6451 6434 ! '&This file will be extended.' 6452 6435 ! CALL message( 'define_netcdf_header', 'PA0266', 0, 0, 0, 6, 0 ) 6453 6436 6454 6437 6455 6438 … … 6609 6592 i = 1 6610 6593 DO i = 1, dopts_num 6611 6594 6612 6595 DO j = 0, number_of_particle_groups 6613 6596 … … 6632 6615 ! 6633 6616 !-- Update the title attribute on file 6634 !-- In order to avoid 'data mode' errors if updated attributes are larger 6635 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 6636 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 6637 !-- performance loss due to data copying; an alternative strategy would be 6617 !-- In order to avoid 'data mode' errors if updated attributes are larger 6618 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 6619 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 6620 !-- performance loss due to data copying; an alternative strategy would be 6638 6621 !-- to ensure equal attribute size in a job chain. Maybe revise later. 6639 6622 nc_stat = NF90_REDEF( id_set_pts ) … … 6702 6685 6703 6686 k = k + 1 6704 6687 6705 6688 ENDDO 6706 6689 … … 6804 6787 6805 6788 DO i = 1, num_leg * num_var_fl 6806 6789 6807 6790 nc_stat = NF90_INQ_VARID( id_set_fl, dofl_label(i), & 6808 6791 id_var_dofl(i) ) … … 6813 6796 ! 6814 6797 !-- Update the title attribute on file 6815 !-- In order to avoid 'data mode' errors if updated attributes are larger 6816 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 6817 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 6818 !-- performance loss due to data copying; an alternative strategy would be 6798 !-- In order to avoid 'data mode' errors if updated attributes are larger 6799 !-- than their original size, NF90_PUT_ATT is called in 'define mode' 6800 !-- enclosed by NF90_REDEF and NF90_ENDDEF calls. This implies a possible 6801 !-- performance loss due to data copying; an alternative strategy would be 6819 6802 !-- to ensure equal attribute size in a job chain. Maybe revise later. 6820 6803 nc_stat = NF90_REDEF( id_set_fl ) … … 6848 6831 !> for parallel netCDF output support. 6849 6832 !------------------------------------------------------------------------------! 6850 6833 6851 6834 SUBROUTINE netcdf_create_file( filename , id, parallel, errno ) 6852 6835 #if defined( __netcdf ) … … 6960 6943 !> Prints out a text message corresponding to the current status. 6961 6944 !------------------------------------------------------------------------------! 6962 6945 6963 6946 SUBROUTINE netcdf_handle_error( routine_name, errno ) 6964 6947 #if defined( __netcdf ) … … 7037 7020 CHARACTER(LEN=*), INTENT(IN) :: var_name 7038 7021 7039 LOGICAL, OPTIONAL :: fill !< indicates setting of _FillValue attribute 7022 LOGICAL, OPTIONAL :: fill !< indicates setting of _FillValue attribute 7040 7023 7041 7024 INTEGER, INTENT(IN) :: error_no1 … … 7078 7061 ! 7079 7062 !-- Set _FillValue for all variables, except for dimension variables. 7080 !-- Set the fill values accordingly to the corresponding output precision. 7063 !-- Set the fill values accordingly to the corresponding output precision. 7081 7064 IF ( PRESENT( fill ) ) THEN 7082 7065 IF ( var_type == NF90_REAL4 ) THEN … … 7383 7366 7384 7367 INTEGER(iwp) :: j !< loop index 7385 7368 7386 7369 REAL(wp), INTENT(in) :: eutm !< easting (UTM) 7387 7370 REAL(wp), INTENT(out) :: lat !< geographic latitude in degree … … 7572 7555 7573 7556 minute = INT( second / 60.0_wp, KIND=iwp ) 7574 7557 7575 7558 second = second - 60.0_wp * REAL( minute, KIND=wp ) 7576 7559
Note: See TracChangeset
for help on using the changeset viewer.