Changeset 4675
- Timestamp:
- Sep 11, 2020 10:00:26 AM (4 years ago)
- Location:
- palm/trunk/UTIL/inifor/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/UTIL/inifor/src/inifor.f90
r4659 r4675 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Support for soil profile initialization 29 ! Improved code formatting 30 ! 31 ! 32 ! 4659 2020-08-31 11:21:17Z eckhard 28 33 ! List all warnings after successful run 29 34 ! Only define netCDF variables in enabled IO groups … … 202 207 !-- Set up the tables containing the input and output variables and set 203 208 !-- the corresponding netCDF dimensions for each output variable 204 CALL setup_variable_tables ( cfg%ic_mode )209 CALL setup_variable_tables 205 210 CALL setup_io_groups 206 211 CALL log_runtime( 'time', 'init' ) … … 273 278 CASE( 'init soil' ) 274 279 275 ALLOCATE( output_arr(0:output_var%grid%nx, 276 0:output_var%grid%ny, 280 ALLOCATE( output_arr(0:output_var%grid%nx, & 281 0:output_var%grid%ny, & 277 282 SIZE( output_var%grid%depths )) ) 278 283 279 284 CASE ( 'surface forcing' ) 280 285 281 ALLOCATE( output_arr(0:output_var%grid%nx, 286 ALLOCATE( output_arr(0:output_var%grid%nx, & 282 287 0:output_var%grid%ny, 1) ) 283 288 … … 299 304 CASE ( 'interpolate_3d' ) 300 305 301 ALLOCATE( output_arr(0:output_var%grid % nx, 302 0:output_var%grid % ny, 306 ALLOCATE( output_arr(0:output_var%grid % nx, & 307 0:output_var%grid % ny, & 303 308 1:output_var%grid % nz) ) 304 309 305 310 CALL log_runtime( 'time', 'alloc' ) 306 CALL interpolate_3d( 307 input_buffer(output_var%input_id)%array(:,:,:), 308 output_arr(:,:,:), 309 output_var%intermediate_grid, 311 CALL interpolate_3d( & 312 input_buffer(output_var%input_id)%array(:,:,:), & 313 output_arr(:,:,:), & 314 output_var%intermediate_grid, & 310 315 output_var%grid) 311 316 CALL log_runtime( 'time', 'comp' ) … … 315 320 CASE ( 'average profile' ) 316 321 317 ALLOCATE( output_arr(0:output_var%grid%nx, & 318 0:output_var%grid%ny, & 319 1:output_var%grid%nz) ) 322 ALLOCATE( output_arr(0:0, 0:0, 1:output_var%averaging_grid%nz) ) 320 323 CALL log_runtime( 'time', 'alloc' ) 321 322 CALL interp_average_profile( & 323 input_buffer(output_var%input_id)%array(:,:,:), & 324 output_arr(0,0,:), & 324 CALL interp_average_profile( & 325 input_buffer(output_var%input_id)%array(:,:,:), & 326 output_arr(0,0,:), & 325 327 output_var%averaging_grid ) 326 328 327 IF ( TRIM( output_var%name ) == 329 IF ( TRIM( output_var%name ) == & 328 330 'surface_forcing_surface_pressure' ) THEN 329 331 … … 331 333 output_arr(0,0,1) = p0 332 334 ELSE 333 CALL get_surface_pressure( 334 output_arr(0,0,:), rho_centre, 335 CALL get_surface_pressure( & 336 output_arr(0,0,:), rho_centre, & 335 337 output_var%averaging_grid ) 336 338 ENDIF 337 339 338 340 ENDIF 341 CALL log_runtime( 'time', 'comp' ) 342 343 CASE ( 'average levels' ) 344 345 ALLOCATE( output_arr(0:0, 0:0, 1:output_var%averaging_grid%nz) ) 346 CALL log_runtime( 'time', 'alloc' ) 347 CALL average_profile( & 348 input_buffer(output_var%input_id)%array(:,:,:), & 349 output_arr(0,0,:), & 350 output_var%averaging_grid & 351 ) 339 352 CALL log_runtime( 'time', 'comp' ) 340 353 … … 393 406 SELECT CASE( TRIM( output_var%name ) ) 394 407 395 CASE( 'internal_pressure_north', 396 'internal_pressure_south', 397 'internal_pressure_east', 408 CASE( 'internal_pressure_north', & 409 'internal_pressure_south', & 410 'internal_pressure_east', & 398 411 'internal_pressure_west' ) 399 412 400 CALL average_pressure_perturbation( 401 input_buffer(output_var%input_id) % array(:,:,:),&402 internal_arr(:), 403 cosmo_grid, output_var%averaging_grid 413 CALL average_pressure_perturbation( & 414 input_buffer(output_var%input_id)%array(:,:,:), & 415 internal_arr(:), & 416 cosmo_grid, output_var%averaging_grid & 404 417 ) 405 418 406 419 CASE DEFAULT 407 420 408 CALL average_profile( 409 input_buffer(output_var%input_id) % array(:,:,:),&410 internal_arr(:), 411 output_var%averaging_grid 421 CALL average_profile( & 422 input_buffer(output_var%input_id)%array(:,:,:), & 423 internal_arr(:), & 424 output_var%averaging_grid & 412 425 ) 413 426 414 427 END SELECT 415 428 416 417 !418 !-- Output of geostrophic pressure profiles (with --debug419 !-- option) is currently deactivated, since they are now420 !-- defined on averaged COSMO levels instead of PALM levels421 !-- (requires definiton of COSMO levels in netCDF output.)422 !IF (.TRUE.) THEN423 ! ALLOCATE( output_arr(1,1,1:output_var%grid % nz) )424 ! output_arr(1,1,:) = internal_arr(:)425 !ENDIF426 429 CALL log_runtime( 'time', 'comp' ) 427 430 … … 450 453 ug_cosmo, vg_cosmo ) 451 454 452 CALL interpolate_1d( ug_cosmo, ug_palm, 455 CALL interpolate_1d( ug_cosmo, ug_palm, & 453 456 output_var%grid ) 454 457 455 CALL interpolate_1d( vg_cosmo, vg_palm, 458 CALL interpolate_1d( vg_cosmo, vg_palm, & 456 459 output_var%grid ) 457 460 ENDIF -
palm/trunk/UTIL/inifor/src/inifor_control.f90
r4659 r4675 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Improve visibility of errors by printing them below warnings listing 29 ! 30 ! 31 ! 4659 2020-08-31 11:21:17Z eckhard 28 32 ! List warnings after successful run or abort 29 33 ! Produce failure exit code (1) on program abort for test automation … … 207 211 SUBROUTINE report_warnings() 208 212 209 INTEGER(iwp) :: warning_idx 213 INTEGER(iwp) :: warning_idx 214 CHARACTER (LEN=500) :: warning = '' 210 215 211 216 IF (n_wrngs > 0) THEN 212 message= 'Encountered the following '// TRIM( str( n_wrngs ) ) // " warning(s) during this run:"213 CALL report( 'report_warnings', message)217 warning = 'Encountered the following '// TRIM( str( n_wrngs ) ) // " warning(s) during this run:" 218 CALL report( 'report_warnings', warning) 214 219 215 220 DO warning_idx = 1, n_wrngs … … 233 238 message = TRIM( message ) // "' successfully." 234 239 IF (n_wrngs > 0) THEN 235 message = TRIM( message ) // " Some warnings were encountered ."240 message = TRIM( message ) // " Some warnings were encountered, see above." 236 241 ENDIF 237 242 CALL report( 'main loop', message ) … … 268 273 CHARACTER(LEN=*), INTENT(IN) :: message !< log message 269 274 275 CALL report_warnings 270 276 CALL report( routine, "ERROR: " // TRIM( message ) // " Stopping." ) 271 CALL report_warnings272 277 CALL close_log 273 278 CALL EXIT(1) -
palm/trunk/UTIL/inifor/src/inifor_defs.f90
r4659 r4675 21 21 ! Current revisions: 22 22 ! ----------------- 23 ! 24 ! 23 ! 24 ! 25 25 ! Former revisions: 26 26 ! ----------------- 27 27 ! $Id$ 28 ! New command-line options for soil profile initialization and homogeneous 29 ! boundary conditions 30 ! Improved code formatting 31 ! 32 ! 33 ! 4659 2020-08-31 11:21:17Z eckhard 28 34 ! Bumped version number 29 35 ! … … 177 183 ! 178 184 !-- PALM static driver attribute names (PIDS 1.9) 179 CHARACTER(SNAME), PARAMETER :: PIDS_ORIGIN_LON = 'origin_lon'180 CHARACTER(SNAME), PARAMETER :: PIDS_ORIGIN_LAT = 'origin_lat'181 CHARACTER(SNAME), PARAMETER :: PIDS_ORIGIN_Z = 'origin_z'185 CHARACTER(SNAME), PARAMETER :: PIDS_ORIGIN_LON = 'origin_lon' 186 CHARACTER(SNAME), PARAMETER :: PIDS_ORIGIN_LAT = 'origin_lat' 187 CHARACTER(SNAME), PARAMETER :: PIDS_ORIGIN_Z = 'origin_z' 182 188 183 189 ! 184 190 !-- COSMO netCDF parameters 185 INTEGER, PARAMETER :: NC_DEPTH_DIM_IDX = 3186 CHARACTER(SNAME), PARAMETER :: NC_DEPTH_NAME = 'depth_2'187 CHARACTER(SNAME), PARAMETER :: NC_HHL_NAME = 'HHL'188 CHARACTER(SNAME), PARAMETER :: NC_RLAT_NAME = 'rlat'189 CHARACTER(SNAME), PARAMETER :: NC_RLON_NAME = 'rlon'190 CHARACTER(SNAME), PARAMETER :: NC_ROTATED_POLE_NAME = 'rotated_pole'191 CHARACTER(SNAME), PARAMETER :: NC_POLE_LATITUDE_NAME = 'grid_north_pole_latitude'192 CHARACTER(SNAME), PARAMETER :: NC_POLE_LONGITUDE_NAME = 'grid_north_pole_longitude'191 INTEGER, PARAMETER :: NC_DEPTH_DIM_IDX = 3 192 CHARACTER(SNAME), PARAMETER :: NC_DEPTH_NAME = 'depth_2' 193 CHARACTER(SNAME), PARAMETER :: NC_HHL_NAME = 'HHL' 194 CHARACTER(SNAME), PARAMETER :: NC_RLAT_NAME = 'rlat' 195 CHARACTER(SNAME), PARAMETER :: NC_RLON_NAME = 'rlon' 196 CHARACTER(SNAME), PARAMETER :: NC_ROTATED_POLE_NAME = 'rotated_pole' 197 CHARACTER(SNAME), PARAMETER :: NC_POLE_LATITUDE_NAME = 'grid_north_pole_latitude' 198 CHARACTER(SNAME), PARAMETER :: NC_POLE_LONGITUDE_NAME = 'grid_north_pole_longitude' 193 199 194 200 ! 195 201 !-- INIFOR parameters 202 CHARACTER(LEN=*), PARAMETER :: CFG_INIT_PROFILE = 'profile' 203 CHARACTER(LEN=*), PARAMETER :: CFG_INIT_VOLUME = 'volume' 204 CHARACTER(LEN=*), PARAMETER :: CFG_INIT_SOIL_PROFILE = 'profile' 205 CHARACTER(LEN=*), PARAMETER :: CFG_INIT_SOIL_VOLUME = 'volume' 206 CHARACTER(LEN=*), PARAMETER :: CFG_FORCING_HETERO = 'hetero' 207 CHARACTER(LEN=*), PARAMETER :: CFG_FORCING_HOMO = 'homo' 208 CHARACTER(LEN=*), PARAMETER :: CFG_FORCING_NUDGING = 'nudging' 196 209 INTEGER(iwp), PARAMETER :: FILL_ITERATIONS = 5 !< Number of iterations for extrapolating soil data into COSMO-DE 197 210 !< water cells [-] … … 201 214 ACHAR( 10 ) // ' Copyright 2017-2020 Deutscher Wetterdienst Offenbach' !< Copyright notice 202 215 CHARACTER(LEN=*), PARAMETER :: LOG_FILE_NAME = 'inifor.log' !< Name of INIFOR's log file 203 CHARACTER(LEN=*), PARAMETER :: VERSION = '2. 0.0' !< INIFOR version number216 CHARACTER(LEN=*), PARAMETER :: VERSION = '2.1.0' !< INIFOR version number 204 217 205 218 END MODULE inifor_defs -
palm/trunk/UTIL/inifor/src/inifor_grid.f90
r4659 r4675 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Support for profile initialization of soil and for homogeneous (profile) 29 ! boundary conditions, including respective command-line options 30 ! Improved code formatting 31 ! 32 ! 33 ! 4659 2020-08-31 11:21:17Z eckhard 28 34 ! Only define netCDF variables in enabled IO groups 29 35 ! Added cloud and precipitation quantiteis (cloud water, cloud ice, rain, snow … … 181 187 USE inifor_control 182 188 USE inifor_defs, & 183 ONLY: DATE, EARTH_RADIUS, TO_RADIANS, TO_DEGREES, PI, & 189 ONLY: CFG_INIT_PROFILE, CFG_INIT_SOIL_VOLUME, CFG_INIT_SOIL_PROFILE, & 190 CFG_FORCING_HETERO, CFG_FORCING_HOMO, CFG_FORCING_NUDGING, & 191 DATE, EARTH_RADIUS, TO_RADIANS, TO_DEGREES, PI, & 184 192 SNAME, LNAME, PATH, FORCING_STEP, FILL_ITERATIONS, & 185 193 BETA, P_SL, T_SL, BETA, RD, RV, G, P_REF, RD_PALM, CP_PALM, & … … 297 305 INTEGER(iwp) :: ndepths !< number of COSMO-DE soil layers 298 306 INTEGER(iwp) :: start_hour_flow !< start of flow forcing in number of hours relative to start_date 299 INTEGER(iwp) :: start_hour_soil !< start of soil forcing in number of hours relative to start_date, typically equals start_hour_flow300 307 INTEGER(iwp) :: start_hour_radiation !< start of radiation forcing in number of hours relative to start_date, 0 to 2 hours before start_hour_flow to reconstruct hourly averages from one- to three hourly averages of the input data 301 308 INTEGER(iwp) :: start_hour_precipitation !< start of forcing for precipitaiton forcing in number of hours relative to start_date … … 362 369 TYPE(grid_definition), TARGET :: w_south_intermediate !< intermediate grid for southern w boundary condition 363 370 TYPE(grid_definition), TARGET :: w_top_intermediate !< intermediate grid for top w boundary condition 364 TYPE(grid_definition), TARGET :: north_averaged_scalar_profile !< grid of the northern geostrophic scalar averaging region 365 TYPE(grid_definition), TARGET :: south_averaged_scalar_profile !< grid of the southern geostrophic scalar averaging region 366 TYPE(grid_definition), TARGET :: west_averaged_scalar_profile !< grid of the western geostrophic scalar averaging region 367 TYPE(grid_definition), TARGET :: east_averaged_scalar_profile !< grid of the eastern geostrophic scalar averaging region 368 TYPE(grid_definition), TARGET :: averaged_scalar_profile !< grid of the central geostrophic scalar averaging region 369 TYPE(grid_definition), TARGET :: averaged_w_profile !< grid of the central geostrophic w-velocity averaging region 370 TYPE(grid_definition), TARGET :: averaged_initial_scalar_profile !< averaging grid for initial scalar profiles 371 TYPE(grid_definition), TARGET :: averaged_initial_w_profile !< averaging grid for the initial w profile 371 TYPE(grid_definition), TARGET :: north_geostrophic_scalar_profile!< grid of the northern geostrophic scalar averaging region 372 TYPE(grid_definition), TARGET :: south_geostrophic_scalar_profile!< grid of the southern geostrophic scalar averaging region 373 TYPE(grid_definition), TARGET :: west_geostrophic_scalar_profile !< grid of the western geostrophic scalar averaging region 374 TYPE(grid_definition), TARGET :: east_geostrophic_scalar_profile !< grid of the eastern geostrophic scalar averaging region 375 TYPE(grid_definition), TARGET :: geostrophic_scalar_profile !< grid of the central geostrophic scalar averaging region 376 TYPE(grid_definition), TARGET :: geostrophic_w_profile !< grid of the central geostrophic w-velocity averaging region 377 TYPE(grid_definition), TARGET :: averaged_soil_profile !< averaging grid for initial soil profiles 378 TYPE(grid_definition), TARGET :: averaged_scalar_profile !< averaging grid for initial and boundary condition scalar profiles 379 TYPE(grid_definition), TARGET :: averaged_w_profile !< averaging grid for initial and boundary condition scalar profiles 380 TYPE(grid_definition), TARGET :: averaged_scalar_top_point !< averaging grid for top scalar boundary conditions for homogeneous forcing mode 381 TYPE(grid_definition), TARGET :: averaged_w_top_point !< averaging grid for top w boundary condition for homogeneous forcing mode 372 382 373 383 TYPE(io_group), ALLOCATABLE, TARGET :: io_group_list(:) !< List of I/O groups, which group together output variables that share the same input variable … … 432 442 !-- Parameters for file names 433 443 start_hour_flow = 0 434 start_hour_soil = 0435 444 start_hour_radiation = 0 436 445 start_hour_precipitation = start_hour_flow … … 464 473 cfg%static_driver_file = '' 465 474 cfg%output_file = './palm-4u-input.nc' 466 cfg%ic_mode = 'profile' 467 cfg%bc_mode = 'real' 475 cfg%ic_mode = CFG_INIT_PROFILE 476 cfg%isc_mode = CFG_INIT_SOIL_VOLUME 477 cfg%bc_mode = CFG_FORCING_HETERO 468 478 cfg%averaging_mode = 'level' 469 479 … … 485 495 486 496 init_variables_required = .TRUE. 487 boundary_variables_required = TRIM( cfg%bc_mode ) == 'real' 488 ls_forcing_variables_required = TRIM( cfg%bc_mode ) == 'ideal' 497 boundary_variables_required = ( & 498 ( TRIM( cfg%bc_mode ) == CFG_FORCING_HETERO ) .OR. & 499 ( TRIM( cfg%bc_mode ) == CFG_FORCING_HOMO ) & 500 ) 501 ls_forcing_variables_required = TRIM( cfg%bc_mode ) == CFG_FORCING_NUDGING 489 502 surface_forcing_required = .TRUE. 490 503 … … 503 516 CALL validate_config( cfg ) 504 517 505 CALL report('setup_parameters', "initialization mode: " // TRIM(cfg%ic_mode)) 506 CALL report('setup_parameters', " forcing mode: " // TRIM(cfg%bc_mode)) 507 CALL report('setup_parameters', " averaging mode: " // TRIM(cfg%averaging_mode)) 508 CALL report('setup_parameters', " averaging angle: " // real_to_str(cfg%averaging_angle)) 509 CALL report('setup_parameters', " averaging angle: " // real_to_str(cfg%averaging_angle)) 510 CALL report('setup_parameters', " data path: " // TRIM(cfg%input_path)) 511 CALL report('setup_parameters', " hhl file: " // TRIM(cfg%hhl_file)) 512 CALL report('setup_parameters', " soiltyp file: " // TRIM(cfg%soiltyp_file)) 513 CALL report('setup_parameters', " namelist file: " // TRIM(cfg%namelist_file)) 514 CALL report('setup_parameters', " output data file: " // TRIM(output_file%name)) 518 CALL report('setup_parameters', "atmosphere initialization mode: " // TRIM(cfg%ic_mode)) 519 CALL report('setup_parameters', " soil initialization mode: " // TRIM(cfg%isc_mode)) 520 CALL report('setup_parameters', " forcing mode: " // TRIM(cfg%bc_mode)) 521 CALL report('setup_parameters', " averaging mode: " // TRIM(cfg%averaging_mode)) 522 CALL report('setup_parameters', " averaging angle: " // real_to_str(cfg%averaging_angle)) 523 CALL report('setup_parameters', " averaging angle: " // real_to_str(cfg%averaging_angle)) 524 CALL report('setup_parameters', " data path: " // TRIM(cfg%input_path)) 525 CALL report('setup_parameters', " hhl file: " // TRIM(cfg%hhl_file)) 526 CALL report('setup_parameters', " soiltyp file: " // TRIM(cfg%soiltyp_file)) 527 CALL report('setup_parameters', " namelist file: " // TRIM(cfg%namelist_file)) 528 CALL report('setup_parameters', " output data file: " // TRIM(output_file%name)) 515 529 IF (cfg%process_precipitation ) THEN 516 530 CALL report('setup_parameters', " precipitation: enabled") … … 557 571 cfg%input_path, flow_prefix, flow_suffix, flow_files) 558 572 CALL get_input_file_list( & 559 cfg%start_date, start_hour_ soil, end_hour, step_hour,&573 cfg%start_date, start_hour_flow, start_hour_flow, step_hour, & 560 574 cfg%input_path, soil_prefix, soil_suffix, soil_files) 561 575 CALL get_input_file_list( & … … 1097 1111 ENDIF 1098 1112 1099 1100 CALL init_averaging_grid(averaged_initial_scalar_profile, cosmo_grid, & 1113 CALL init_averaging_grid(averaged_soil_profile, cosmo_grid, & 1114 x = 0.5_wp * lx, y = 0.5_wp * ly, z = depths, z0 = z0, & 1115 lonmin = lonmin_palm, lonmax = lonmax_palm, & 1116 latmin = latmin_palm, latmax = latmax_palm, & 1117 kind='scalar', name='averaged soil profile') 1118 1119 CALL init_averaging_grid(averaged_scalar_profile, cosmo_grid, & 1101 1120 x = 0.5_wp * lx, y = 0.5_wp * ly, z = z, z0 = z0, & 1102 1121 lonmin = lonmin_palm, lonmax = lonmax_palm, & 1103 1122 latmin = latmin_palm, latmax = latmax_palm, & 1104 kind='scalar', name='averaged initial scalar')1105 1106 CALL init_averaging_grid(averaged_ initial_w_profile, cosmo_grid,&1123 kind='scalar', name='averaged scalar profile') 1124 1125 CALL init_averaging_grid(averaged_w_profile, cosmo_grid, & 1107 1126 x = 0.5_wp * lx, y = 0.5_wp * ly, z = zw, z0 = z0, & 1108 1127 lonmin = lonmin_palm, lonmax = lonmax_palm, & 1109 1128 latmin = latmin_palm, latmax = latmax_palm, & 1110 kind='w', name='averaged initial w') 1111 1112 CALL init_averaging_grid(averaged_scalar_profile, cosmo_grid, & 1129 kind='w', name='averaged w profile') 1130 1131 CALL init_averaging_grid(averaged_scalar_top_point, cosmo_grid, & 1132 x = 0.5_wp * lx, y = 0.5_wp * ly, z = z_top, z0 = z0, & 1133 lonmin = lonmin_palm, lonmax = lonmax_palm, & 1134 latmin = latmin_palm, latmax = latmax_palm, & 1135 kind='scalar', name='averaged scalar top point') 1136 1137 CALL init_averaging_grid(averaged_w_top_point, cosmo_grid, & 1138 x = 0.5_wp * lx, y = 0.5_wp * ly, z = zw_top, z0 = z0, & 1139 lonmin = lonmin_palm, lonmax = lonmax_palm, & 1140 latmin = latmin_palm, latmax = latmax_palm, & 1141 kind='w', name='averaged w top point') 1142 1143 CALL init_averaging_grid(geostrophic_scalar_profile, cosmo_grid, & 1113 1144 x = 0.5_wp * lx, y = 0.5_wp * ly, z = z, z0 = z0, & 1114 1145 lonmin = lam_west, lonmax = lam_east, & 1115 1146 latmin = phi_south, latmax = phi_north, & 1116 kind='scalar', name='centre geostrophic scalar ')1117 1118 CALL init_averaging_grid( averaged_w_profile, cosmo_grid, &1147 kind='scalar', name='centre geostrophic scalar profile') 1148 1149 CALL init_averaging_grid(geostrophic_w_profile, cosmo_grid, & 1119 1150 x = 0.5_wp * lx, y = 0.5_wp * ly, z = zw, z0 = z0, & 1120 1151 lonmin = lam_west, lonmax = lam_east, & 1121 1152 latmin = phi_south, latmax = phi_north, & 1122 kind='w', name='centre geostrophic w ')1123 1124 CALL init_averaging_grid(south_ averaged_scalar_profile, cosmo_grid, &1153 kind='w', name='centre geostrophic w profile') 1154 1155 CALL init_averaging_grid(south_geostrophic_scalar_profile, cosmo_grid, & 1125 1156 x = 0.5_wp * lx, y = 0.5_wp * ly, z = z, z0 = z0, & 1126 1157 lonmin = lam_west, lonmax = lam_east, & 1127 1158 latmin = phi_centre - averaging_angle, & 1128 1159 latmax = phi_centre, & 1129 kind='scalar', name='south geostrophic scalar ')1130 1131 CALL init_averaging_grid(north_ averaged_scalar_profile, cosmo_grid, &1160 kind='scalar', name='south geostrophic scalar profile') 1161 1162 CALL init_averaging_grid(north_geostrophic_scalar_profile, cosmo_grid, & 1132 1163 x = 0.5_wp * lx, y = 0.5_wp * ly, z = z, z0 = z0, & 1133 1164 lonmin = lam_west, lonmax = lam_east, & 1134 1165 latmin = phi_centre, & 1135 1166 latmax = phi_centre + averaging_angle, & 1136 kind='scalar', name='north geostrophic scalar ')1137 1138 CALL init_averaging_grid(west_ averaged_scalar_profile, cosmo_grid, &1167 kind='scalar', name='north geostrophic scalar profile') 1168 1169 CALL init_averaging_grid(west_geostrophic_scalar_profile, cosmo_grid, & 1139 1170 x = 0.5_wp * lx, y = 0.5_wp * ly, z = z, z0 = z0, & 1140 1171 lonmin = lam_centre - averaging_angle, & 1141 1172 lonmax = lam_centre, & 1142 1173 latmin = phi_south, latmax = phi_north, & 1143 kind='scalar', name='west geostrophic scalar ')1144 1145 CALL init_averaging_grid(east_ averaged_scalar_profile, cosmo_grid, &1174 kind='scalar', name='west geostrophic scalar profile') 1175 1176 CALL init_averaging_grid(east_geostrophic_scalar_profile, cosmo_grid, & 1146 1177 x = 0.5_wp * lx, y = 0.5_wp * ly, z = z, z0 = z0, & 1147 1178 lonmin = lam_centre, & 1148 1179 lonmax = lam_centre + averaging_angle, & 1149 1180 latmin = phi_south, latmax = phi_north, & 1150 kind='scalar', name='east geostrophic scalar ')1181 kind='scalar', name='east geostrophic scalar profile') 1151 1182 1152 1183 … … 1195 1226 ENDIF 1196 1227 1197 IF (TRIM(cfg%ic_mode) == 'profile') THEN1228 IF (TRIM(cfg%ic_mode) == CFG_INIT_PROFILE) THEN 1198 1229 !TODO: remove this conditional if not needed. 1199 1230 ENDIF … … 1285 1316 setup_volumetric = .TRUE. 1286 1317 IF (PRESENT(ic_mode)) THEN 1287 IF (TRIM(ic_mode) == 'profile') setup_volumetric = .FALSE.1318 IF (TRIM(ic_mode) == CFG_INIT_PROFILE) setup_volumetric = .FALSE. 1288 1319 ENDIF 1289 1320 … … 1374 1405 ! 1375 1406 !-- Allocate neighbour indices and weights 1376 IF (TRIM(ic_mode) .NE. 'profile') THEN1407 IF (TRIM(ic_mode) .NE. CFG_INIT_PROFILE) THEN 1377 1408 ALLOCATE( grid%kk(0:nx, 0:ny, 1:nz, 2) ) 1378 1409 grid%kk(:,:,:,:) = -1 … … 1446 1477 ! 1447 1478 !-- Allocate neighbour indices and weights 1448 IF (TRIM(ic_mode) .NE. 'profile') THEN1479 IF (TRIM(ic_mode) .NE. CFG_INIT_PROFILE) THEN 1449 1480 ALLOCATE( grid%kk(0:nx, 0:ny, 1:nz, 2) ) 1450 1481 grid%kk(:,:,:,:) = -1 … … 1858 1889 IF ( ANY( min_dz_stretch_level_end(1:number_stretch_level_start) > & 1859 1890 dz_stretch_level_end(1:number_stretch_level_start) ) ) THEN 1860 !IF ( ANY( min_dz_stretch_level_end > &1861 ! dz_stretch_level_end ) ) THEN1862 1891 message = 'Each dz_stretch_level_end has to be larger ' // & 1863 1892 'than its corresponding value for ' // & … … 2369 2398 invar%to_be_processed = .FALSE. 2370 2399 outvar%to_be_processed = .FALSE. 2371 message = " Optional output variable '" // TRIM( outvar%name ) // "' was deactivated"// &2372 " because the corresponding input variable was not foundin file '" // TRIM( filename ) // "'."2400 message = "Skipping optional output variable '" // TRIM( outvar%name ) // & 2401 ", corresponding input variable not available in file '" // TRIM( filename ) // "'." 2373 2402 CALL warn( 'validate_io_groups', message ) 2374 2403 ENDIF 2375 2404 ENDIF 2376 2405 2377 !IF ( .NOT.netcdf_variable_present_in_file( invar%name, filename ) ) THEN2378 !-- ! abort due to missing input variable2379 ! message = "The mandatory input variable '" // TRIM( invar%name ) // &2380 ! " was not found in the input file '" // TRIM( filename ) // "'."2381 ! CALL inifor_abort( 'validate_io_groups', message )2382 ! ENDIF2383 !IF ( .NOT.netcdf_variable_present_in_file( invar%name, filename ) ) THEN2384 !-- ! abort due to missing input variable2385 ! message = "The mandatory input variable '" // TRIM( invar%name ) // &2386 ! " was not found in the input file '" // TRIM( filename ) // "'."2387 ! CALL inifor_abort( 'validate_io_groups', message )2388 ! ENDIF2389 !ENDIF2390 2406 !-- outvar loop 2391 2407 ENDDO … … 2493 2509 !> Initializes the variable list. 2494 2510 !------------------------------------------------------------------------------! 2495 SUBROUTINE setup_variable_tables(ic_mode) 2496 CHARACTER(LEN=*), INTENT(IN) :: ic_mode 2497 INTEGER(iwp) :: n_invar = 0 !< number of variables in the input variable table 2498 INTEGER(iwp) :: n_outvar = 0 !< number of variables in the output variable table 2499 TYPE(nc_var), POINTER :: var 2511 SUBROUTINE setup_variable_tables 2512 INTEGER(iwp) :: n_invar = 0 !< number of variables in the input variable table 2513 INTEGER(iwp) :: n_outvar = 0 !< number of variables in the output variable table 2514 TYPE(nc_var), POINTER :: var 2500 2515 2501 2516 IF (TRIM(cfg%start_date) == '') THEN … … 2626 2641 output_file = output_file, & 2627 2642 grid = palm_grid, & 2628 intermediate_grid = palm_intermediate & 2643 intermediate_grid = palm_intermediate, & 2644 is_profile = (TRIM(cfg%isc_mode) == CFG_INIT_SOIL_PROFILE) & 2629 2645 ) 2630 2646 … … 2638 2654 output_file = output_file, & 2639 2655 grid = palm_grid, & 2640 intermediate_grid = palm_intermediate & 2656 intermediate_grid = palm_intermediate, & 2657 is_profile = (TRIM(cfg%isc_mode) == CFG_INIT_SOIL_PROFILE) & 2641 2658 ) 2642 2659 … … 2651 2668 grid = palm_grid, & 2652 2669 intermediate_grid = palm_intermediate, & 2653 is_profile = (TRIM(ic_mode) == 'profile') & 2654 ) 2655 IF (TRIM(ic_mode) == 'profile') THEN 2656 output_var_table(3)%averaging_grid => averaged_initial_scalar_profile 2657 ENDIF 2670 is_profile = (TRIM(cfg%ic_mode) == CFG_INIT_PROFILE) & 2671 ) 2658 2672 2659 2673 output_var_table(4) = init_nc_var( & … … 2666 2680 grid = scalars_west_grid, & 2667 2681 intermediate_grid = scalars_west_intermediate, & 2682 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO), & 2668 2683 output_file = output_file & 2669 2684 ) … … 2678 2693 grid = scalars_east_grid, & 2679 2694 intermediate_grid = scalars_east_intermediate, & 2695 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO), & 2680 2696 output_file = output_file & 2681 2697 ) … … 2690 2706 grid = scalars_north_grid, & 2691 2707 intermediate_grid = scalars_north_intermediate, & 2708 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO), & 2692 2709 output_file = output_file & 2693 2710 ) … … 2702 2719 grid = scalars_south_grid, & 2703 2720 intermediate_grid = scalars_south_intermediate, & 2721 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO), & 2704 2722 output_file = output_file & 2705 2723 ) … … 2714 2732 grid = scalars_top_grid, & 2715 2733 intermediate_grid = scalars_top_intermediate, & 2734 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO), & 2716 2735 output_file = output_file & 2717 2736 ) … … 2727 2746 grid = palm_grid, & 2728 2747 intermediate_grid = palm_intermediate, & 2729 is_profile = (TRIM(ic_mode) == 'profile') & 2730 ) 2731 IF (TRIM(ic_mode) == 'profile') THEN 2732 output_var_table(9)%averaging_grid => averaged_initial_scalar_profile 2733 ENDIF 2748 is_profile = (TRIM(cfg%ic_mode) == CFG_INIT_PROFILE) & 2749 ) 2734 2750 2735 2751 output_var_table(10) = init_nc_var( & … … 2742 2758 output_file = output_file, & 2743 2759 grid = scalars_west_grid, & 2744 intermediate_grid = scalars_west_intermediate & 2760 intermediate_grid = scalars_west_intermediate, & 2761 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2745 2762 ) 2746 2763 … … 2754 2771 output_file = output_file, & 2755 2772 grid = scalars_east_grid, & 2756 intermediate_grid = scalars_east_intermediate & 2773 intermediate_grid = scalars_east_intermediate, & 2774 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2757 2775 ) 2758 2776 … … 2766 2784 output_file = output_file, & 2767 2785 grid = scalars_north_grid, & 2768 intermediate_grid = scalars_north_intermediate & 2786 intermediate_grid = scalars_north_intermediate, & 2787 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2769 2788 ) 2770 2789 … … 2778 2797 output_file = output_file, & 2779 2798 grid = scalars_south_grid, & 2780 intermediate_grid = scalars_south_intermediate & 2799 intermediate_grid = scalars_south_intermediate, & 2800 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2781 2801 ) 2782 2802 … … 2790 2810 output_file = output_file, & 2791 2811 grid = scalars_top_grid, & 2792 intermediate_grid = scalars_top_intermediate & 2812 intermediate_grid = scalars_top_intermediate, & 2813 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2793 2814 ) 2794 2815 … … 2803 2824 grid = u_initial_grid, & 2804 2825 intermediate_grid = u_initial_intermediate, & 2805 is_profile = (TRIM(ic_mode) == 'profile') & 2806 ) 2807 IF (TRIM(ic_mode) == 'profile') THEN 2808 output_var_table(15)%averaging_grid => averaged_initial_scalar_profile 2809 ENDIF 2826 is_profile = (TRIM(cfg%ic_mode) == CFG_INIT_PROFILE) & 2827 ) 2810 2828 2811 2829 output_var_table(16) = init_nc_var( & … … 2818 2836 output_file = output_file, & 2819 2837 grid = u_west_grid, & 2820 intermediate_grid = u_west_intermediate & 2838 intermediate_grid = u_west_intermediate, & 2839 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2821 2840 ) 2822 2841 … … 2830 2849 output_file = output_file, & 2831 2850 grid = u_east_grid, & 2832 intermediate_grid = u_east_intermediate & 2851 intermediate_grid = u_east_intermediate, & 2852 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2833 2853 ) 2834 2854 … … 2842 2862 output_file = output_file, & 2843 2863 grid = u_north_grid, & 2844 intermediate_grid = u_north_intermediate & 2864 intermediate_grid = u_north_intermediate, & 2865 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2845 2866 ) 2846 2867 … … 2854 2875 output_file = output_file, & 2855 2876 grid = u_south_grid, & 2856 intermediate_grid = u_south_intermediate & 2877 intermediate_grid = u_south_intermediate, & 2878 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2857 2879 ) 2858 2880 … … 2866 2888 output_file = output_file, & 2867 2889 grid = u_top_grid, & 2868 intermediate_grid = u_top_intermediate & 2890 intermediate_grid = u_top_intermediate, & 2891 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2869 2892 ) 2870 2893 … … 2879 2902 grid = v_initial_grid, & 2880 2903 intermediate_grid = v_initial_intermediate, & 2881 is_profile = (TRIM(ic_mode) == 'profile') & 2882 ) 2883 IF (TRIM(ic_mode) == 'profile') THEN 2884 output_var_table(21)%averaging_grid => averaged_initial_scalar_profile 2885 ENDIF 2904 is_profile = (TRIM(cfg%ic_mode) == CFG_INIT_PROFILE) & 2905 ) 2886 2906 2887 2907 output_var_table(22) = init_nc_var( & … … 2894 2914 output_file = output_file, & 2895 2915 grid = v_west_grid, & 2896 intermediate_grid = v_west_intermediate & 2916 intermediate_grid = v_west_intermediate, & 2917 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2897 2918 ) 2898 2919 … … 2906 2927 output_file = output_file, & 2907 2928 grid = v_east_grid, & 2908 intermediate_grid = v_east_intermediate & 2929 intermediate_grid = v_east_intermediate, & 2930 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2909 2931 ) 2910 2932 … … 2918 2940 output_file = output_file, & 2919 2941 grid = v_north_grid, & 2920 intermediate_grid = v_north_intermediate & 2942 intermediate_grid = v_north_intermediate, & 2943 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2921 2944 ) 2922 2945 … … 2930 2953 output_file = output_file, & 2931 2954 grid = v_south_grid, & 2932 intermediate_grid = v_south_intermediate & 2955 intermediate_grid = v_south_intermediate, & 2956 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2933 2957 ) 2934 2958 … … 2942 2966 output_file = output_file, & 2943 2967 grid = v_top_grid, & 2944 intermediate_grid = v_top_intermediate & 2968 intermediate_grid = v_top_intermediate, & 2969 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2945 2970 ) 2946 2971 … … 2955 2980 grid = w_initial_grid, & 2956 2981 intermediate_grid = w_initial_intermediate, & 2957 is_profile = (TRIM(ic_mode) == 'profile') & 2958 ) 2959 IF (TRIM(ic_mode) == 'profile') THEN 2960 output_var_table(27)%averaging_grid => averaged_initial_w_profile 2961 ENDIF 2982 is_profile = (TRIM(cfg%ic_mode) == CFG_INIT_PROFILE) & 2983 ) 2962 2984 2963 2985 output_var_table(28) = init_nc_var( & … … 2970 2992 output_file = output_file, & 2971 2993 grid = w_west_grid, & 2972 intermediate_grid = w_west_intermediate & 2994 intermediate_grid = w_west_intermediate, & 2995 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2973 2996 ) 2974 2997 … … 2982 3005 output_file = output_file, & 2983 3006 grid = w_east_grid, & 2984 intermediate_grid = w_east_intermediate & 3007 intermediate_grid = w_east_intermediate, & 3008 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2985 3009 ) 2986 3010 … … 2994 3018 output_file = output_file, & 2995 3019 grid = w_north_grid, & 2996 intermediate_grid = w_north_intermediate & 3020 intermediate_grid = w_north_intermediate, & 3021 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 2997 3022 ) 2998 3023 … … 3006 3031 output_file = output_file, & 3007 3032 grid = w_south_grid, & 3008 intermediate_grid = w_south_intermediate & 3033 intermediate_grid = w_south_intermediate, & 3034 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3009 3035 ) 3010 3036 … … 3018 3044 output_file = output_file, & 3019 3045 grid = w_top_grid, & 3020 intermediate_grid = w_top_intermediate & 3046 intermediate_grid = w_top_intermediate, & 3047 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3021 3048 ) 3022 3049 … … 3143 3170 intermediate_grid = palm_intermediate & 3144 3171 ) 3145 output_var_table(42)%averaging_grid => averaged_scalar_profile3172 output_var_table(42)%averaging_grid => geostrophic_scalar_profile 3146 3173 3147 3174 output_var_table(43) = init_nc_var( & … … 3153 3180 input_id = 1_iwp, & 3154 3181 output_file = output_file, & 3155 grid = averaged_scalar_profile, &3156 intermediate_grid = averaged_scalar_profile &3182 grid = geostrophic_scalar_profile, & 3183 intermediate_grid = geostrophic_scalar_profile & 3157 3184 ) 3158 3185 … … 3165 3192 input_id = 1_iwp, & 3166 3193 output_file = output_file, & 3167 grid = averaged_scalar_profile, &3168 intermediate_grid = averaged_scalar_profile &3194 grid = geostrophic_scalar_profile, & 3195 intermediate_grid = geostrophic_scalar_profile & 3169 3196 ) 3170 3197 … … 3177 3204 input_id = 1_iwp, & 3178 3205 output_file = output_file, & 3179 grid = averaged_scalar_profile, &3180 intermediate_grid = averaged_scalar_profile &3206 grid = geostrophic_scalar_profile, & 3207 intermediate_grid = geostrophic_scalar_profile & 3181 3208 ) 3182 3209 output_var_table(45)%to_be_processed = ls_forcing_variables_required … … 3190 3217 input_id = 1_iwp, & 3191 3218 output_file = output_file, & 3192 grid = averaged_scalar_profile, &3193 intermediate_grid = averaged_scalar_profile &3219 grid = geostrophic_scalar_profile, & 3220 intermediate_grid = geostrophic_scalar_profile & 3194 3221 ) 3195 3222 output_var_table(46)%to_be_processed = ls_forcing_variables_required … … 3203 3230 input_id = 1_iwp, & 3204 3231 output_file = output_file, & 3205 grid = averaged_scalar_profile, &3206 intermediate_grid = averaged_scalar_profile &3232 grid = geostrophic_scalar_profile, & 3233 intermediate_grid = geostrophic_scalar_profile & 3207 3234 ) 3208 3235 output_var_table(47)%to_be_processed = ls_forcing_variables_required … … 3216 3243 input_id = 1_iwp, & 3217 3244 output_file = output_file, & 3218 grid = averaged_w_profile, &3219 intermediate_grid = averaged_w_profile &3245 grid = geostrophic_w_profile, & 3246 intermediate_grid = geostrophic_w_profile & 3220 3247 ) 3221 3248 output_var_table(48)%to_be_processed = ls_forcing_variables_required … … 3230 3257 input_id = 1_iwp, & 3231 3258 output_file = output_file, & 3232 grid = averaged_scalar_profile, &3233 intermediate_grid = averaged_scalar_profile &3259 grid = geostrophic_scalar_profile, & 3260 intermediate_grid = geostrophic_scalar_profile & 3234 3261 ) 3235 3262 output_var_table(49)%to_be_processed = ls_forcing_variables_required … … 3243 3270 input_id = 1_iwp, & 3244 3271 output_file = output_file, & 3245 grid = averaged_scalar_profile, &3246 intermediate_grid = averaged_scalar_profile &3272 grid = geostrophic_scalar_profile, & 3273 intermediate_grid = geostrophic_scalar_profile & 3247 3274 ) 3248 3275 output_var_table(50)%to_be_processed = ls_forcing_variables_required … … 3256 3283 input_id = 1_iwp, & 3257 3284 output_file = output_file, & 3258 grid = averaged_scalar_profile, &3259 intermediate_grid = averaged_scalar_profile &3285 grid = geostrophic_scalar_profile, & 3286 intermediate_grid = geostrophic_scalar_profile & 3260 3287 ) 3261 3288 output_var_table(51)%to_be_processed = ls_forcing_variables_required … … 3269 3296 input_id = 3_iwp, & 3270 3297 output_file = output_file, & 3271 grid = averaged_scalar_profile, &3272 intermediate_grid = averaged_scalar_profile &3298 grid = geostrophic_scalar_profile, & 3299 intermediate_grid = geostrophic_scalar_profile & 3273 3300 ) 3274 3301 output_var_table(52)%to_be_processed = ls_forcing_variables_required … … 3283 3310 input_id = 3_iwp, & 3284 3311 output_file = output_file, & 3285 grid = averaged_scalar_profile, &3286 intermediate_grid = averaged_scalar_profile &3312 grid = geostrophic_scalar_profile, & 3313 intermediate_grid = geostrophic_scalar_profile & 3287 3314 ) 3288 3315 output_var_table(53)%to_be_processed = ls_forcing_variables_required … … 3296 3323 input_id = 3_iwp, & 3297 3324 output_file = output_file, & 3298 grid = averaged_scalar_profile, &3299 intermediate_grid = averaged_scalar_profile &3325 grid = geostrophic_scalar_profile, & 3326 intermediate_grid = geostrophic_scalar_profile & 3300 3327 ) 3301 3328 output_var_table(54)%to_be_processed = ls_forcing_variables_required … … 3309 3336 input_id = 1_iwp, & 3310 3337 output_file = output_file, & 3311 grid = averaged_scalar_profile, &3312 intermediate_grid = averaged_scalar_profile &3338 grid = geostrophic_scalar_profile, & 3339 intermediate_grid = geostrophic_scalar_profile & 3313 3340 ) 3314 3341 output_var_table(55)%to_be_processed = ls_forcing_variables_required … … 3316 3343 3317 3344 output_var_table(56) = init_nc_var( & 3318 name = 'internal_density_centre', 3345 name = 'internal_density_centre', & 3319 3346 std_name = "", & 3320 3347 long_name = "", & … … 3323 3350 input_id = 4_iwp, & 3324 3351 output_file = output_file, & 3325 grid = averaged_scalar_profile, &3326 intermediate_grid = averaged_scalar_profile &3327 ) 3328 output_var_table(56)%averaging_grid => averaged_scalar_profile3352 grid = geostrophic_scalar_profile, & 3353 intermediate_grid = geostrophic_scalar_profile & 3354 ) 3355 output_var_table(56)%averaging_grid => geostrophic_scalar_profile 3329 3356 3330 3357 3331 3358 output_var_table(57) = init_nc_var( & 3332 name = 'internal_density_north', &3359 name = 'internal_density_north', & 3333 3360 std_name = "", & 3334 3361 long_name = "", & … … 3337 3364 input_id = 4_iwp, & 3338 3365 output_file = output_file, & 3339 grid = north_ averaged_scalar_profile, &3340 intermediate_grid = north_ averaged_scalar_profile &3341 ) 3342 output_var_table(57)%averaging_grid => north_ averaged_scalar_profile3366 grid = north_geostrophic_scalar_profile, & 3367 intermediate_grid = north_geostrophic_scalar_profile & 3368 ) 3369 output_var_table(57)%averaging_grid => north_geostrophic_scalar_profile 3343 3370 output_var_table(57)%to_be_processed = .NOT. cfg%ug_defined_by_user 3344 3371 3345 3372 3346 3373 output_var_table(58) = init_nc_var( & 3347 name = 'internal_density_south', &3374 name = 'internal_density_south', & 3348 3375 std_name = "", & 3349 3376 long_name = "", & … … 3352 3379 input_id = 4_iwp, & 3353 3380 output_file = output_file, & 3354 grid = south_ averaged_scalar_profile, &3355 intermediate_grid = south_ averaged_scalar_profile &3356 ) 3357 output_var_table(58)%averaging_grid => south_ averaged_scalar_profile3381 grid = south_geostrophic_scalar_profile, & 3382 intermediate_grid = south_geostrophic_scalar_profile & 3383 ) 3384 output_var_table(58)%averaging_grid => south_geostrophic_scalar_profile 3358 3385 output_var_table(58)%to_be_processed = .NOT. cfg%ug_defined_by_user 3359 3386 3360 3387 3361 3388 output_var_table(59) = init_nc_var( & 3362 name = 'internal_density_east', &3389 name = 'internal_density_east', & 3363 3390 std_name = "", & 3364 3391 long_name = "", & … … 3367 3394 input_id = 4_iwp, & 3368 3395 output_file = output_file, & 3369 grid = east_ averaged_scalar_profile, &3370 intermediate_grid = east_ averaged_scalar_profile &3371 ) 3372 output_var_table(59)%averaging_grid => east_ averaged_scalar_profile3396 grid = east_geostrophic_scalar_profile, & 3397 intermediate_grid = east_geostrophic_scalar_profile & 3398 ) 3399 output_var_table(59)%averaging_grid => east_geostrophic_scalar_profile 3373 3400 output_var_table(59)%to_be_processed = .NOT. cfg%ug_defined_by_user 3374 3401 3375 3402 3376 3403 output_var_table(60) = init_nc_var( & 3377 name = 'internal_density_west', &3404 name = 'internal_density_west', & 3378 3405 std_name = "", & 3379 3406 long_name = "", & … … 3382 3409 input_id = 4_iwp, & 3383 3410 output_file = output_file, & 3384 grid = west_ averaged_scalar_profile, &3385 intermediate_grid = west_ averaged_scalar_profile &3386 ) 3387 output_var_table(60)%averaging_grid => west_ averaged_scalar_profile3411 grid = west_geostrophic_scalar_profile, & 3412 intermediate_grid = west_geostrophic_scalar_profile & 3413 ) 3414 output_var_table(60)%averaging_grid => west_geostrophic_scalar_profile 3388 3415 output_var_table(60)%to_be_processed = .NOT. cfg%ug_defined_by_user 3389 3416 … … 3396 3423 input_id = 2_iwp, & 3397 3424 output_file = output_file, & 3398 grid = north_ averaged_scalar_profile, &3399 intermediate_grid = north_ averaged_scalar_profile &3400 ) 3401 output_var_table(61)%averaging_grid => north_ averaged_scalar_profile3425 grid = north_geostrophic_scalar_profile, & 3426 intermediate_grid = north_geostrophic_scalar_profile & 3427 ) 3428 output_var_table(61)%averaging_grid => north_geostrophic_scalar_profile 3402 3429 output_var_table(61)%to_be_processed = .NOT. cfg%ug_defined_by_user 3403 3430 … … 3411 3438 input_id = 2_iwp, & 3412 3439 output_file = output_file, & 3413 grid = south_ averaged_scalar_profile, &3414 intermediate_grid = south_ averaged_scalar_profile &3415 ) 3416 output_var_table(62)%averaging_grid => south_ averaged_scalar_profile3440 grid = south_geostrophic_scalar_profile, & 3441 intermediate_grid = south_geostrophic_scalar_profile & 3442 ) 3443 output_var_table(62)%averaging_grid => south_geostrophic_scalar_profile 3417 3444 output_var_table(62)%to_be_processed = .NOT. cfg%ug_defined_by_user 3418 3445 … … 3426 3453 input_id = 2_iwp, & 3427 3454 output_file = output_file, & 3428 grid = east_ averaged_scalar_profile, &3429 intermediate_grid = east_ averaged_scalar_profile &3430 ) 3431 output_var_table(63)%averaging_grid => east_ averaged_scalar_profile3455 grid = east_geostrophic_scalar_profile, & 3456 intermediate_grid = east_geostrophic_scalar_profile & 3457 ) 3458 output_var_table(63)%averaging_grid => east_geostrophic_scalar_profile 3432 3459 output_var_table(63)%to_be_processed = .NOT. cfg%ug_defined_by_user 3433 3460 … … 3441 3468 input_id = 2_iwp, & 3442 3469 output_file = output_file, & 3443 grid = west_ averaged_scalar_profile, &3444 intermediate_grid = west_ averaged_scalar_profile &3445 ) 3446 output_var_table(64)%averaging_grid => west_ averaged_scalar_profile3470 grid = west_geostrophic_scalar_profile, & 3471 intermediate_grid = west_geostrophic_scalar_profile & 3472 ) 3473 output_var_table(64)%averaging_grid => west_geostrophic_scalar_profile 3447 3474 output_var_table(64)%to_be_processed = .NOT. cfg%ug_defined_by_user 3448 3475 3449 output_var_table(65) = init_nc_var( 3476 output_var_table(65) = init_nc_var( & 3450 3477 name = 'init_atmosphere_qc', & 3451 3478 std_name = "", & … … 3457 3484 grid = palm_grid, & 3458 3485 intermediate_grid = palm_intermediate, & 3459 is_profile = (TRIM(ic_mode) == 'profile') & 3460 ) 3461 IF (TRIM(ic_mode) == 'profile') THEN 3462 output_var_table(65)%averaging_grid => averaged_initial_scalar_profile 3463 ENDIF 3486 is_profile = (TRIM(cfg%ic_mode) == CFG_INIT_PROFILE) & 3487 ) 3464 3488 output_var_table(65)%is_optional = .TRUE. 3465 3489 … … 3473 3497 output_file = output_file, & 3474 3498 grid = scalars_west_grid, & 3475 intermediate_grid = scalars_west_intermediate & 3499 intermediate_grid = scalars_west_intermediate, & 3500 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3476 3501 ) 3477 3502 output_var_table(66)%is_optional = .TRUE. … … 3486 3511 output_file = output_file, & 3487 3512 grid = scalars_east_grid, & 3488 intermediate_grid = scalars_east_intermediate & 3513 intermediate_grid = scalars_east_intermediate, & 3514 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3489 3515 ) 3490 3516 output_var_table(67)%is_optional = .TRUE. … … 3499 3525 output_file = output_file, & 3500 3526 grid = scalars_north_grid, & 3501 intermediate_grid = scalars_north_intermediate & 3527 intermediate_grid = scalars_north_intermediate, & 3528 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3502 3529 ) 3503 3530 output_var_table(68)%is_optional = .TRUE. … … 3512 3539 output_file = output_file, & 3513 3540 grid = scalars_south_grid, & 3514 intermediate_grid = scalars_south_intermediate & 3541 intermediate_grid = scalars_south_intermediate, & 3542 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3515 3543 ) 3516 3544 output_var_table(69)%is_optional = .TRUE. … … 3525 3553 output_file = output_file, & 3526 3554 grid = scalars_top_grid, & 3527 intermediate_grid = scalars_top_intermediate & 3555 intermediate_grid = scalars_top_intermediate, & 3556 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3528 3557 ) 3529 3558 output_var_table(70)%is_optional = .TRUE. … … 3539 3568 grid = palm_grid, & 3540 3569 intermediate_grid = palm_intermediate, & 3541 is_profile = (TRIM(ic_mode) == 'profile') & 3542 ) 3543 IF (TRIM(ic_mode) == 'profile') THEN 3544 output_var_table(71)%averaging_grid => averaged_initial_scalar_profile 3545 ENDIF 3570 is_profile = (TRIM(cfg%ic_mode) == CFG_INIT_PROFILE) & 3571 ) 3546 3572 output_var_table(71)%is_optional = .TRUE. 3547 3573 … … 3555 3581 output_file = output_file, & 3556 3582 grid = scalars_west_grid, & 3557 intermediate_grid = scalars_west_intermediate & 3583 intermediate_grid = scalars_west_intermediate, & 3584 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3558 3585 ) 3559 3586 output_var_table(72)%is_optional = .TRUE. … … 3568 3595 output_file = output_file, & 3569 3596 grid = scalars_east_grid, & 3570 intermediate_grid = scalars_east_intermediate & 3597 intermediate_grid = scalars_east_intermediate, & 3598 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3571 3599 ) 3572 3600 output_var_table(73)%is_optional = .TRUE. … … 3581 3609 output_file = output_file, & 3582 3610 grid = scalars_north_grid, & 3583 intermediate_grid = scalars_north_intermediate & 3611 intermediate_grid = scalars_north_intermediate, & 3612 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3584 3613 ) 3585 3614 output_var_table(74)%is_optional = .TRUE. … … 3594 3623 output_file = output_file, & 3595 3624 grid = scalars_south_grid, & 3596 intermediate_grid = scalars_south_intermediate & 3625 intermediate_grid = scalars_south_intermediate, & 3626 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3597 3627 ) 3598 3628 output_var_table(75)%is_optional = .TRUE. … … 3607 3637 output_file = output_file, & 3608 3638 grid = scalars_top_grid, & 3609 intermediate_grid = scalars_top_intermediate & 3639 intermediate_grid = scalars_top_intermediate, & 3640 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3610 3641 ) 3611 3642 output_var_table(76)%is_optional = .TRUE. … … 3614 3645 name = 'init_atmosphere_qr', & 3615 3646 std_name = "", & 3616 long_name = "initial rain water mixture fraction", 3647 long_name = "initial rain water mixture fraction", & 3617 3648 units = "kg/kg", & 3618 3649 kind = "init scalar", & … … 3621 3652 grid = palm_grid, & 3622 3653 intermediate_grid = palm_intermediate, & 3623 is_profile = (TRIM(ic_mode) == 'profile') & 3624 ) 3625 IF (TRIM(ic_mode) == 'profile') THEN 3626 output_var_table(77)%averaging_grid => averaged_initial_scalar_profile 3627 ENDIF 3654 is_profile = (TRIM(cfg%ic_mode) == CFG_INIT_PROFILE) & 3655 ) 3628 3656 output_var_table(77)%is_optional = .TRUE. 3629 3657 … … 3637 3665 output_file = output_file, & 3638 3666 grid = scalars_west_grid, & 3639 intermediate_grid = scalars_west_intermediate & 3667 intermediate_grid = scalars_west_intermediate, & 3668 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3640 3669 ) 3641 3670 output_var_table(78)%is_optional = .TRUE. … … 3650 3679 output_file = output_file, & 3651 3680 grid = scalars_east_grid, & 3652 intermediate_grid = scalars_east_intermediate & 3681 intermediate_grid = scalars_east_intermediate, & 3682 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3653 3683 ) 3654 3684 output_var_table(79)%is_optional = .TRUE. … … 3663 3693 output_file = output_file, & 3664 3694 grid = scalars_north_grid, & 3665 intermediate_grid = scalars_north_intermediate & 3695 intermediate_grid = scalars_north_intermediate, & 3696 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3666 3697 ) 3667 3698 output_var_table(80)%is_optional = .TRUE. … … 3676 3707 output_file = output_file, & 3677 3708 grid = scalars_south_grid, & 3678 intermediate_grid = scalars_south_intermediate & 3709 intermediate_grid = scalars_south_intermediate, & 3710 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3679 3711 ) 3680 3712 output_var_table(81)%is_optional = .TRUE. … … 3689 3721 output_file = output_file, & 3690 3722 grid = scalars_top_grid, & 3691 intermediate_grid = scalars_top_intermediate & 3723 intermediate_grid = scalars_top_intermediate, & 3724 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3692 3725 ) 3693 3726 output_var_table(82)%is_optional = .TRUE. … … 3696 3729 name = 'init_atmosphere_qs', & 3697 3730 std_name = "", & 3698 long_name = "initial snow mixture fraction", &3731 long_name = "initial snow mixture fraction", & 3699 3732 units = "kg/kg", & 3700 3733 kind = "init scalar", & … … 3703 3736 grid = palm_grid, & 3704 3737 intermediate_grid = palm_intermediate, & 3705 is_profile = (TRIM(ic_mode) == 'profile') & 3706 ) 3707 IF (TRIM(ic_mode) == 'profile') THEN 3708 output_var_table(83)%averaging_grid => averaged_initial_scalar_profile 3709 ENDIF 3738 is_profile = (TRIM(cfg%ic_mode) == CFG_INIT_PROFILE) & 3739 ) 3710 3740 output_var_table(83)%is_optional = .TRUE. 3711 3741 … … 3719 3749 output_file = output_file, & 3720 3750 grid = scalars_west_grid, & 3721 intermediate_grid = scalars_west_intermediate & 3751 intermediate_grid = scalars_west_intermediate, & 3752 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3722 3753 ) 3723 3754 output_var_table(84)%is_optional = .TRUE. … … 3732 3763 output_file = output_file, & 3733 3764 grid = scalars_east_grid, & 3734 intermediate_grid = scalars_east_intermediate & 3765 intermediate_grid = scalars_east_intermediate, & 3766 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3735 3767 ) 3736 3768 output_var_table(85)%is_optional = .TRUE. … … 3745 3777 output_file = output_file, & 3746 3778 grid = scalars_north_grid, & 3747 intermediate_grid = scalars_north_intermediate & 3779 intermediate_grid = scalars_north_intermediate, & 3780 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3748 3781 ) 3749 3782 output_var_table(86)%is_optional = .TRUE. … … 3758 3791 output_file = output_file, & 3759 3792 grid = scalars_south_grid, & 3760 intermediate_grid = scalars_south_intermediate & 3793 intermediate_grid = scalars_south_intermediate, & 3794 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3761 3795 ) 3762 3796 output_var_table(87)%is_optional = .TRUE. … … 3771 3805 output_file = output_file, & 3772 3806 grid = scalars_top_grid, & 3773 intermediate_grid = scalars_top_intermediate & 3807 intermediate_grid = scalars_top_intermediate, & 3808 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3774 3809 ) 3775 3810 output_var_table(88)%is_optional = .TRUE. … … 3778 3813 name = 'init_atmosphere_qg', & 3779 3814 std_name = "", & 3780 long_name = "initial graupel mixture fraction", &3815 long_name = "initial graupel mixture fraction", & 3781 3816 units = "kg/kg", & 3782 3817 kind = "init scalar", & … … 3785 3820 grid = palm_grid, & 3786 3821 intermediate_grid = palm_intermediate, & 3787 is_profile = (TRIM(ic_mode) == 'profile') & 3788 ) 3789 IF (TRIM(ic_mode) == 'profile') THEN 3790 output_var_table(89)%averaging_grid => averaged_initial_scalar_profile 3791 ENDIF 3822 is_profile = (TRIM(cfg%ic_mode) == CFG_INIT_PROFILE) & 3823 ) 3792 3824 output_var_table(89)%is_optional = .TRUE. 3793 3825 … … 3801 3833 output_file = output_file, & 3802 3834 grid = scalars_west_grid, & 3803 intermediate_grid = scalars_west_intermediate & 3835 intermediate_grid = scalars_west_intermediate, & 3836 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3804 3837 ) 3805 3838 output_var_table(90)%is_optional = .TRUE. … … 3814 3847 output_file = output_file, & 3815 3848 grid = scalars_east_grid, & 3816 intermediate_grid = scalars_east_intermediate & 3849 intermediate_grid = scalars_east_intermediate, & 3850 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3817 3851 ) 3818 3852 output_var_table(91)%is_optional = .TRUE. … … 3827 3861 output_file = output_file, & 3828 3862 grid = scalars_north_grid, & 3829 intermediate_grid = scalars_north_intermediate & 3863 intermediate_grid = scalars_north_intermediate, & 3864 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3830 3865 ) 3831 3866 output_var_table(92)%is_optional = .TRUE. … … 3840 3875 output_file = output_file, & 3841 3876 grid = scalars_south_grid, & 3842 intermediate_grid = scalars_south_intermediate & 3877 intermediate_grid = scalars_south_intermediate, & 3878 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3843 3879 ) 3844 3880 output_var_table(93)%is_optional = .TRUE. … … 3853 3889 output_file = output_file, & 3854 3890 grid = scalars_top_grid, & 3855 intermediate_grid = scalars_top_intermediate & 3891 intermediate_grid = scalars_top_intermediate, & 3892 is_profile = (TRIM(cfg%bc_mode) == CFG_FORCING_HOMO) & 3856 3893 ) 3857 3894 output_var_table(94)%is_optional = .TRUE. … … 3969 4006 var%task = "interpolate_3d" 3970 4007 3971 CASE( 'init scalar profile', 'init u profile', 'init v profile') 4008 CASE( 'init soil profile' ) 4009 var%nt = 1 4010 var%lod = 1 4011 var%ndim = 1 4012 var%dimids(1) = output_file%dimids_soil(3) 4013 var%dimvarids(1) = output_file%dimvarids_soil(3) 4014 var%to_be_processed = init_variables_required 4015 var%is_internal = .FALSE. 4016 var%task = "average levels" 4017 var%averaging_grid => averaged_soil_profile 4018 4019 CASE( 'init scalar profile', 'init u profile', 'init v profile' ) 3972 4020 var%nt = 1 3973 4021 var%lod = 1 … … 3978 4026 var%is_internal = .FALSE. 3979 4027 var%task = "average profile" 4028 var%averaging_grid => averaged_scalar_profile 3980 4029 3981 4030 CASE( 'init w profile') … … 3988 4037 var%is_internal = .FALSE. 3989 4038 var%task = "average profile" 4039 var%averaging_grid => averaged_w_profile 3990 4040 3991 4041 CASE( 'surface forcing' ) 3992 var%lod = -14042 var%lod = 2 3993 4043 var%ndim = 3 3994 4044 var%dimids(3) = output_file%dimid_time … … 4001 4051 4002 4052 CASE( 'left scalar', 'right scalar') 4003 var%lod = -14053 var%lod = 2 4004 4054 var%ndim = 3 4005 4055 var%dimids(3) = output_file%dimid_time … … 4014 4064 4015 4065 CASE( 'north scalar', 'south scalar') 4016 var%lod = -14066 var%lod = 2 4017 4067 var%ndim = 3 4018 4068 var%dimids(3) = output_file%dimid_time … … 4027 4077 4028 4078 CASE( 'top scalar', 'top w' ) 4029 var%lod = -14079 var%lod = 2 4030 4080 var%ndim = 3 4031 4081 var%dimids(3) = output_file%dimid_time … … 4040 4090 4041 4091 CASE( 'left u', 'right u' ) 4042 var%lod = -14092 var%lod = 2 4043 4093 var%ndim = 3 4044 4094 var%dimids(3) = output_file%dimid_time … … 4053 4103 4054 4104 CASE( 'north u', 'south u' ) 4055 var%lod = -14105 var%lod = 2 4056 4106 var%ndim = 3 4057 4107 var%dimids(3) = output_file%dimid_time !t … … 4066 4116 4067 4117 CASE( 'top u' ) 4068 var%lod = -14118 var%lod = 2 4069 4119 var%ndim = 3 4070 4120 var%dimids(3) = output_file%dimid_time !t … … 4079 4129 4080 4130 CASE( 'left v', 'right v' ) 4081 var%lod = -14131 var%lod = 2 4082 4132 var%ndim = 3 4083 4133 var%dimids(3) = output_file%dimid_time … … 4092 4142 4093 4143 CASE( 'north v', 'south v' ) 4094 var%lod = -14144 var%lod = 2 4095 4145 var%ndim = 3 4096 4146 var%dimids(3) = output_file%dimid_time !t … … 4105 4155 4106 4156 CASE( 'top v' ) 4107 var%lod = -14157 var%lod = 2 4108 4158 var%ndim = 3 4109 4159 var%dimids(3) = output_file%dimid_time !t … … 4118 4168 4119 4169 CASE( 'left w', 'right w') 4120 var%lod = -14170 var%lod = 2 4121 4171 var%ndim = 3 4122 4172 var%dimids(3) = output_file%dimid_time … … 4131 4181 4132 4182 CASE( 'north w', 'south w' ) 4133 var%lod = -14183 var%lod = 2 4134 4184 var%ndim = 3 4135 4185 var%dimids(3) = output_file%dimid_time !t … … 4143 4193 var%task = "interpolate_3d" 4144 4194 4195 CASE( 'left scalar profile', 'right scalar profile', & 4196 'north scalar profile', 'south scalar profile', & 4197 'left u profile', 'right u profile', & 4198 'north u profile', 'south u profile', & 4199 'left v profile', 'right v profile', & 4200 'north v profile', 'south v profile' ) 4201 var%lod = 1 4202 var%ndim = 2 4203 var%dimids(2) = output_file%dimid_time !t 4204 var%dimids(1) = output_file%dimids_scl(3) !z 4205 var%dimvarids(2) = output_file%dimvarid_time 4206 var%dimvarids(1) = output_file%dimvarids_scl(3) 4207 var%to_be_processed = boundary_variables_required 4208 var%is_internal = .FALSE. 4209 var%task = "average profile" 4210 var%averaging_grid => averaged_scalar_profile 4211 4212 CASE( 'top scalar profile', 'top u profile', 'top v profile' ) 4213 var%lod = 0 4214 var%ndim = 1 4215 var%dimids(1) = output_file%dimid_time !t 4216 var%dimvarids(1) = output_file%dimvarid_time 4217 var%to_be_processed = boundary_variables_required 4218 var%is_internal = .FALSE. 4219 var%task = "average profile" 4220 var%averaging_grid => averaged_scalar_top_point 4221 4222 CASE( 'left w profile', 'right w profile', & 4223 'north w profile', 'south w profile' ) 4224 var%lod = 1 4225 var%ndim = 2 4226 var%dimids(2) = output_file%dimid_time !t 4227 var%dimids(1) = output_file%dimids_vel(3) !z 4228 var%dimvarids(2) = output_file%dimvarid_time 4229 var%dimvarids(1) = output_file%dimvarids_vel(3) 4230 var%to_be_processed = boundary_variables_required 4231 var%is_internal = .FALSE. 4232 var%task = "average profile" 4233 var%averaging_grid => averaged_w_profile 4234 4235 CASE( 'top w profile' ) 4236 var%lod = 0 4237 var%ndim = 1 4238 var%dimids(1) = output_file%dimid_time !t 4239 var%dimvarids(1) = output_file%dimvarid_time 4240 var%to_be_processed = boundary_variables_required 4241 var%is_internal = .FALSE. 4242 var%task = "average profile" 4243 var%averaging_grid => averaged_w_top_point 4244 4145 4245 CASE( 'time series' ) 4146 4246 var%lod = 0 … … 4153 4253 4154 4254 CASE( 'constant scalar profile' ) 4155 var%lod = -14255 var%lod = 1 4156 4256 var%ndim = 2 4157 4257 var%dimids(2) = output_file%dimid_time !t … … 4164 4264 4165 4265 CASE( 'large-scale scalar forcing' ) 4166 var%lod = -14266 var%lod = 1 4167 4267 var%ndim = 2 4168 4268 var%dimids(2) = output_file%dimid_time !t … … 4175 4275 4176 4276 CASE( 'geostrophic' ) 4177 var%lod = -14277 var%lod = 1 4178 4278 var%ndim = 2 4179 4279 var%dimids(2) = output_file%dimid_time !t … … 4186 4286 4187 4287 CASE( 'large-scale w forcing' ) 4188 var%lod = -14288 var%lod = 1 4189 4289 var%ndim = 2 4190 4290 var%dimids(2) = output_file%dimid_time !t … … 4208 4308 4209 4309 CASE DEFAULT 4210 message = "Variable kind '" // TRIM( kind) // "' not recognized."4310 message = "Variable kind '" // TRIM(out_var_kind) // "' not recognized." 4211 4311 CALL inifor_abort ('init_nc_var', message) 4212 4312 … … 4350 4450 DO i = 1, nx 4351 4451 4352 CALL get_basic_state( cosmo_grid%hfl(i,j,:), BETA, P_SL, T_SL,&4353 RD, G, basic_state_pressure)4452 CALL get_basic_state( cosmo_grid%hfl(i,j,:), BETA, P_SL, T_SL, & 4453 RD, G, basic_state_pressure ) 4354 4454 4355 4455 ! -
palm/trunk/UTIL/inifor/src/inifor_io.f90
r4659 r4675 26 26 ! ----------------- 27 27 ! $Id$ 28 ! New command-line options for soil profile initialization and homogeneous 29 ! boundary conditions 30 ! 31 ! 32 ! 4659 2020-08-31 11:21:17Z eckhard 28 33 ! New command-line option '--precipitation' enables output of precipitation 29 34 ! surface forcing … … 160 165 USE inifor_control 161 166 USE inifor_defs, & 162 ONLY: DATE, SNAME, PATH, PI, TO_RADIANS, TO_DEGREES, VERSION, & 167 ONLY: CFG_INIT_PROFILE, CFG_INIT_VOLUME, & 168 CFG_INIT_SOIL_PROFILE, CFG_INIT_SOIL_VOLUME, & 169 CFG_FORCING_HETERO, CFG_FORCING_HOMO, CFG_FORCING_NUDGING, & 170 DATE, SNAME, PATH, PI, TO_RADIANS, TO_DEGREES, VERSION, & 163 171 NC_DEPTH_DIM_IDX, NC_DEPTH_NAME, NC_HHL_NAME, NC_RLAT_NAME, & 164 172 NC_RLON_NAME, NC_ROTATED_POLE_NAME, NC_POLE_LATITUDE_NAME, & … … 562 570 cfg%namelist_file = TRIM(arg) 563 571 564 CASE( '- mode', '-i', '--init-mode' )572 CASE( '-i', '--init-mode' ) 565 573 CALL get_option_argument( i, arg ) 566 574 cfg%ic_mode = TRIM(arg) 575 576 CASE( '--soil-init-mode' ) 577 CALL get_option_argument( i, arg ) 578 cfg%isc_mode = TRIM(arg) 567 579 568 580 CASE( '-f', '--forcing-mode' ) … … 733 745 734 746 SELECT CASE( TRIM( cfg%ic_mode ) ) 735 CASE( 'profile', 'volume')747 CASE( CFG_INIT_PROFILE, CFG_INIT_VOLUME ) 736 748 CASE DEFAULT 737 749 message = "Initialization mode '" // TRIM( cfg%ic_mode ) //& 738 750 "' is not supported. " //& 739 "Please select either 'profile' or 'volume', " //& 740 "or omit the -i/--init-mode/-mode option entirely, which corresponds "//& 751 "Please select either '" // CFG_INIT_PROFILE //"' or '" // & 752 CFG_INIT_VOLUME //"', " //& 753 "or omit the -i/--init-mode option entirely, which corresponds "//& 741 754 "to the latter." 742 755 CALL inifor_abort( 'validate_config', message ) 743 756 END SELECT 744 757 758 SELECT CASE( TRIM( cfg%isc_mode ) ) 759 CASE( CFG_INIT_SOIL_PROFILE, CFG_INIT_SOIL_VOLUME ) 760 CASE DEFAULT 761 message = "Soil initialization mode '" // TRIM( cfg%isc_mode ) //& 762 "' is not supported. " //& 763 "Please select either '" // CFG_INIT_SOIL_PROFILE //"' or '" // & 764 CFG_INIT_SOIL_VOLUME //"', " //& 765 "or omit the --soil-init-mode option entirely, which corresponds "//& 766 "to the latter." 767 CALL inifor_abort( 'validate_config', message ) 768 END SELECT 769 745 770 SELECT CASE( TRIM(cfg%bc_mode) ) 746 CASE( 'real', 'ideal')771 CASE( CFG_FORCING_HOMO, CFG_FORCING_HETERO, CFG_FORCING_NUDGING ) 747 772 CASE DEFAULT 748 773 message = "Forcing mode '" // TRIM( cfg%bc_mode ) //& 749 774 "' is not supported. " //& 750 "Please select either 'real' or 'ideal', " //& 775 "Please select either '" // CFG_FORCING_NUDGING // & 776 "', '" // CFG_FORCING_HOMO // "', or '" // & 777 CFG_FORCING_HETERO // "' " //& 751 778 "or omit the -f/--forcing-mode option entirely, which corresponds "//& 752 779 "to the latter." … … 1420 1447 LOGICAL :: var_is_time_dependent 1421 1448 1422 var_is_time_dependent = ( &1423 var%dimids( var%ndim ) == output_file%dimid_time &1449 var_is_time_dependent = ( & 1450 var%dimids( var%ndim ) == output_file%dimid_time & 1424 1451 ) 1425 1452 … … 1439 1466 SELECT CASE (TRIM(var%kind)) 1440 1467 1441 CASE ( 'init scalar profile', 'init u profile', 'init v profile',&1442 'init wprofile' )1468 CASE( 'init scalar profile', 'init u profile', 'init v profile', & 1469 'init w profile', 'init soil profile' ) 1443 1470 1444 1471 CALL check(nf90_put_var( ncid, var%varid, array(1,1,:) ) ) 1445 1472 1446 CASE 1473 CASE( 'init soil', 'init scalar', 'init u', 'init v', 'init w' ) 1447 1474 1448 1475 CALL check(nf90_put_var( ncid, var%varid, array(:,:,:) ) ) … … 1457 1484 IF (.NOT. SIZE(array, 2) .EQ. var%dimlen(1)) THEN 1458 1485 PRINT *, "inifor: update_output: Dimension ", 1, " of variable ", & 1459 TRIM(var%name), " (", var%dimlen(1), &1486 TRIM(var%name), " (", var%dimlen(1), & 1460 1487 ") does not match the dimension of the output array (", & 1461 1488 SIZE(array, 2), ")." … … 1477 1504 count=count(1:ndim) ) ) 1478 1505 1479 CASE 1506 CASE( 'left u', 'right u', 'left v', 'right v' ) 1480 1507 1481 1508 CALL check(nf90_put_var( ncid, var%varid, array(1,:,:), & … … 1483 1510 count=count(1:ndim) ) ) 1484 1511 1485 CASE 1512 CASE( 'north u', 'south u', 'north v', 'south v' ) 1486 1513 1487 1514 CALL check(nf90_put_var( ncid, var%varid, array(:,1,:), & … … 1489 1516 count=count(1:ndim) ) ) 1490 1517 1491 CASE 1518 CASE( 'top u', 'top v' ) 1492 1519 1493 1520 CALL check(nf90_put_var( ncid, var%varid, array(:,:,1), & … … 1495 1522 count=count(1:ndim) ) ) 1496 1523 1497 CASE 1524 CASE( 'time series' ) 1498 1525 1499 1526 CALL check(nf90_put_var( ncid, var%varid, array(1,1,1), & 1500 1527 start=start(1:ndim+1) ) ) 1501 1528 1502 CASE ( 'constant scalar profile', 'geostrophic' ) 1529 CASE( 'constant scalar profile', 'geostrophic', & 1530 'left scalar profile', 'right scalar profile', & 1531 'north scalar profile', 'south scalar profile', & 1532 'left u profile', 'right u profile', & 1533 'north u profile', 'south u profile', & 1534 'left v profile', 'right v profile', & 1535 'north v profile', 'south v profile', & 1536 'top scalar profile', 'top u profile', 'top v profile', & 1537 'top w profile', & 1538 'left w profile', 'right w profile', & 1539 'north w profile', 'south w profile' ) 1503 1540 1504 1541 CALL check(nf90_put_var( ncid, var%varid, array(1,1,:), & -
palm/trunk/UTIL/inifor/src/inifor_transform.f90
r4553 r4675 21 21 ! Current revisions: 22 22 ! ----------------- 23 ! 24 ! 23 ! 24 ! 25 25 ! Former revisions: 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Improved code formatting 29 ! 30 ! 31 ! 4553 2020-06-03 16:34:15Z eckhard 28 32 ! Improved code readability and documentation 29 33 ! … … 431 435 432 436 TYPE(grid_definition), INTENT(IN) :: avg_grid 433 REAL(wp), DIMENSION(:,:,:), INTENT(IN) :: source_array 437 REAL(wp), DIMENSION(:,:,:), INTENT(IN) :: source_array 434 438 REAL(wp), DIMENSION(:), INTENT(OUT) :: profile_array 435 439 … … 445 449 "cosmo_pressure(" // TRIM( str( nlev ) ) // & 446 450 "), profile_array(" // TRIM( str( nz ) ) // ")." 447 CALL inifor_abort( 'average_pressure_perturbation', message)451 CALL inifor_abort( 'average_profile', message ) 448 452 ENDIF 449 453 -
palm/trunk/UTIL/inifor/src/inifor_types.f90
r4659 r4675 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Added INIFOR configuration flag for soil profile initialization 29 ! 30 ! 31 ! 4659 2020-08-31 11:21:17Z eckhard 28 32 ! Added flag in support of new command-line option '--precipitation' 29 33 ! Improved code formatting … … 133 137 CHARACTER(LEN=SNAME) :: bc_mode !< destinguishes realistic and idealistic forcing 134 138 CHARACTER(LEN=SNAME) :: ic_mode !< destinguishes volume and profile initialization 139 CHARACTER(LEN=SNAME) :: isc_mode !< destinguishes volume and profile soil initialization 135 140 CHARACTER(LEN=SNAME) :: rotation_method !< selects method for velocity rotation 136 141
Note: See TracChangeset
for help on using the changeset viewer.