Changeset 3613 for palm/trunk/UTIL/inifor/src/inifor_grid.f90
- Timestamp:
- Dec 7, 2018 6:20:37 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/UTIL/inifor/src/inifor_grid.f90
r3557 r3613 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Average initial profiles only over PALM domain region, not the 29 ! geostrophic-wind averaging region 30 ! Fix unintended modification of COSMO heights 31 ! Fix commenting out of setup_volumentric setting 32 ! Moved version output to setup_parameters() 33 ! 34 ! 35 ! 3557 2018-11-22 16:01:22Z eckhard 28 36 ! Updated documentation 29 37 ! … … 150 158 REAL(dp) :: z_top = 0.0_dp !< height of the scalar top boundary [m] 151 159 REAL(dp) :: zw_top = 0.0_dp !< height of the vertical velocity top boundary [m] 152 REAL(dp) :: lonmin = 0.0_dp !< Minimunm longitude of COSMO-DE's rotated-pole grid 153 REAL(dp) :: lonmax = 0.0_dp !< Maximum longitude of COSMO-DE's rotated-pole grid 154 REAL(dp) :: latmin = 0.0_dp !< Minimunm latitude of COSMO-DE's rotated-pole grid 155 REAL(dp) :: latmax = 0.0_dp !< Maximum latitude of COSMO-DE's rotated-pole grid 160 REAL(dp) :: lonmin_cosmo = 0.0_dp !< Minimunm longitude of COSMO-DE's rotated-pole grid [COSMO rotated-pole rad] 161 REAL(dp) :: lonmax_cosmo = 0.0_dp !< Maximum longitude of COSMO-DE's rotated-pole grid [COSMO rotated-pole rad] 162 REAL(dp) :: latmin_cosmo = 0.0_dp !< Minimunm latitude of COSMO-DE's rotated-pole grid [COSMO rotated-pole rad] 163 REAL(dp) :: latmax_cosmo = 0.0_dp !< Maximum latitude of COSMO-DE's rotated-pole grid [COSMO rotated-pole rad] 164 REAL(dp) :: lonmin_palm = 0.0_dp !< Minimunm longitude of PALM grid [COSMO rotated-pole rad] 165 REAL(dp) :: lonmax_palm = 0.0_dp !< Maximum longitude of PALM grid [COSMO rotated-pole rad] 166 REAL(dp) :: latmin_palm = 0.0_dp !< Minimunm latitude of PALM grid [COSMO rotated-pole rad] 167 REAL(dp) :: latmax_palm = 0.0_dp !< Maximum latitude of PALM grid [COSMO rotated-pole rad] 156 168 REAL(dp) :: latitude = 0.0_dp !< geographical latitude of the PALM-4U origin, from inipar namelist [deg] 157 169 REAL(dp) :: longitude = 0.0_dp !< geographical longitude of the PALM-4U origin, from inipar namelist [deg] … … 255 267 TYPE(grid_definition), TARGET :: w_south_intermediate !< intermediate grid for southern w boundary condition 256 268 TYPE(grid_definition), TARGET :: w_top_intermediate !< intermediate grid for top w boundary condition 257 TYPE(grid_definition), TARGET :: north_averaged_scalar_profile !< grid of the northern scalar averaging region 258 TYPE(grid_definition), TARGET :: south_averaged_scalar_profile !< grid of the southern scalar averaging region 259 TYPE(grid_definition), TARGET :: west_averaged_scalar_profile !< grid of the western scalar averaging region 260 TYPE(grid_definition), TARGET :: east_averaged_scalar_profile !< grid of the eastern scalar averaging region 261 TYPE(grid_definition), TARGET :: averaged_scalar_profile !< grid of the central scalar averaging region 262 TYPE(grid_definition), TARGET :: averaged_w_profile !< grid of the central w-velocity averaging region 269 TYPE(grid_definition), TARGET :: north_averaged_scalar_profile !< grid of the northern geostrophic scalar averaging region 270 TYPE(grid_definition), TARGET :: south_averaged_scalar_profile !< grid of the southern geostrophic scalar averaging region 271 TYPE(grid_definition), TARGET :: west_averaged_scalar_profile !< grid of the western geostrophic scalar averaging region 272 TYPE(grid_definition), TARGET :: east_averaged_scalar_profile !< grid of the eastern geostrophic scalar averaging region 273 TYPE(grid_definition), TARGET :: averaged_scalar_profile !< grid of the central geostrophic scalar averaging region 274 TYPE(grid_definition), TARGET :: averaged_w_profile !< grid of the central geostrophic w-velocity averaging region 275 TYPE(grid_definition), TARGET :: averaged_initial_scalar_profile !< averaging grid for initial scalar profiles 276 TYPE(grid_definition), TARGET :: averaged_initial_w_profile !< averaging grid for the initial w profile 263 277 264 278 TYPE(io_group), ALLOCATABLE, TARGET :: io_group_list(:) !< List of I/O groups, which group together output variables that share the same input variable … … 406 420 CALL validate_config( cfg ) 407 421 422 CALL report('main_loop', 'Running INIFOR version ' // VERSION) 408 423 CALL report('setup_parameters', "initialization mode: " // TRIM(cfg % ic_mode)) 409 424 CALL report('setup_parameters', " forcing mode: " // TRIM(cfg % bc_mode)) … … 501 516 ndepths = SIZE(depths) 502 517 503 lonmin = MINVAL(rlon) * TO_RADIANS504 lonmax = MAXVAL(rlon) * TO_RADIANS505 latmin = MINVAL(rlat) * TO_RADIANS506 latmax = MAXVAL(rlat) * TO_RADIANS518 lonmin_cosmo = MINVAL(rlon) * TO_RADIANS 519 lonmax_cosmo = MAXVAL(rlon) * TO_RADIANS 520 latmin_cosmo = MINVAL(rlat) * TO_RADIANS 521 latmax_cosmo = MAXVAL(rlat) * TO_RADIANS 507 522 CALL run_control('time', 'comp') 508 523 … … 691 706 xmin=0.0_dp, xmax=lx, & 692 707 ymin=0.0_dp, ymax=ly, & 693 x0=x0, y0=y0, z0=z0, &708 x0=x0, y0=y0, z0=z0, & 694 709 nx=nx, ny=ny, nz=nz, z=z, zw=zw, ic_mode=cfg % ic_mode) 695 710 … … 697 712 !-- Subtracting 1 because arrays will be allocated with nlon + 1 elements. 698 713 CALL init_grid_definition('cosmo-de', grid=cosmo_grid, & 699 xmin=lonmin , xmax=lonmax,&700 ymin=latmin , ymax=latmax,&701 x0=x0, y0=y0, z0=0.0_dp, &714 xmin=lonmin_cosmo, xmax=lonmax_cosmo, & 715 ymin=latmin_cosmo, ymax=latmax_cosmo, & 716 x0=x0, y0=y0, z0=0.0_dp, & 702 717 nx=nlon-1, ny=nlat-1, nz=nlev-1) 703 718 … … 710 725 xmin=0.0_dp, xmax=lx, & 711 726 ymin=0.0_dp, ymax=ly, & 712 x0=x0, y0=y0, z0=z0, &727 x0=x0, y0=y0, z0=z0, & 713 728 nx=nx, ny=ny, nz=nlev-2) 714 729 … … 1002 1017 ! Section 3: Define profile grids 1003 1018 !------------------------------------------------------------------------------ 1019 1020 lonmin_palm = MINVAL(palm_intermediate % clon) 1021 lonmax_palm = MAXVAL(palm_intermediate % clon) 1022 latmin_palm = MINVAL(palm_intermediate % clat) 1023 latmax_palm = MAXVAL(palm_intermediate % clat) 1024 1025 CALL init_averaging_grid(averaged_initial_scalar_profile, cosmo_grid, & 1026 x = 0.5_dp * lx, y = 0.5_dp * ly, z = z, z0 = z0, & 1027 lonmin = lonmin_palm, lonmax = lonmax_palm, & 1028 latmin = latmin_palm, latmax = latmax_palm, & 1029 kind='scalar') 1030 1031 CALL init_averaging_grid(averaged_initial_w_profile, cosmo_grid, & 1032 x = 0.5_dp * lx, y = 0.5_dp * ly, z = zw, z0 = z0, & 1033 lonmin = lonmin_palm, lonmax = lonmax_palm, & 1034 latmin = latmin_palm, latmax = latmax_palm, & 1035 kind='w') 1004 1036 1005 1037 CALL init_averaging_grid(averaged_scalar_profile, cosmo_grid, & … … 1176 1208 !-- domain volume. Instead we need vertical weights for the intermediate 1177 1209 !-- profile grids, which get computed in setup_averaging(). 1178 !--setup_volumetric = .TRUE.1210 setup_volumetric = .TRUE. 1179 1211 IF (PRESENT(ic_mode)) THEN 1180 1212 IF (TRIM(ic_mode) == 'profile') setup_volumetric = .FALSE. … … 1447 1479 ! Description: 1448 1480 ! ------------ 1449 !> Initializes averagin _grid-type variables.1481 !> Initializes averaging grids 1450 1482 !> 1451 1483 !> Input parameters: … … 1470 1502 !> Output parameters: 1471 1503 !> ------------------ 1472 !> avg_grid : averagin g_grid variable to be initialized.1504 !> avg_grid : averagin grid to be initialized 1473 1505 !------------------------------------------------------------------------------! 1474 1506 SUBROUTINE init_averaging_grid(avg_grid, cosmo_grid, x, y, z, z0, & … … 1479 1511 REAL(dp), INTENT(IN) :: x, y, z0 1480 1512 REAL(dp), INTENT(IN), TARGET :: z(:) 1481 REAL(dp), INTENT(IN) :: lonmin, lonmax, latmin, latmax 1513 REAL(dp), INTENT(IN) :: lonmin !< lower longitude bound of the averaging grid region [COSMO rotated-pole rad] 1514 REAL(dp), INTENT(IN) :: lonmax !< upper longitude bound of the averaging grid region [COSMO rotated-pole rad] 1515 REAL(dp), INTENT(IN) :: latmin !< lower latitude bound of the averaging grid region [COSMO rotated-pole rad] 1516 REAL(dp), INTENT(IN) :: latmax !< lower latitude bound of the averaging grid region [COSMO rotated-pole rad] 1482 1517 1483 1518 CHARACTER(LEN=*), INTENT(IN) :: kind … … 1529 1564 ! 1530 1565 !-- For level-besed averaging, compute average heights 1531 level_based_averaging = .TRUE.1566 level_based_averaging = ( TRIM(cfg % averaging_mode) == 'level' ) 1532 1567 IF (level_based_averaging) THEN 1533 1568 ALLOCATE(avg_grid % h(1,1,SIZE(avg_grid % cosmo_h, 3)) ) 1534 1569 1535 CALL average_2d(avg_grid % cosmo_h, avg_grid % h(1,1,:), 1570 CALL average_2d(avg_grid % cosmo_h, avg_grid % h(1,1,:), & 1536 1571 avg_grid % iii, avg_grid % jjj) 1537 1572 END IF 1538 1573 1539 1574 ! 1540 !-- Copy averaged grid to all COSMO columns, leads to computing the same1541 !-- vertical interpolation weights for all columns and to COSMO grid level1542 !-- based averaging onto the averaged COSMO heights.1543 IF ( TRIM(cfg % averaging_mode) == 'level' ) THEN1544 FORALL( &1545 i=1:SIZE(avg_grid % cosmo_h, 1), &1546 j=1:SIZE(avg_grid % cosmo_h, 2) &1547 ) avg_grid % cosmo_h(i,j,:) = avg_grid % h(1,1,:)1548 END IF1549 1550 !1551 1575 !-- Compute vertical weights and neighbours 1552 CALL find_vertical_neighbours_and_weights_average(avg_grid) 1576 CALL find_vertical_neighbours_and_weights_average( & 1577 avg_grid, level_based_averaging & 1578 ) 1553 1579 1554 1580 END SUBROUTINE init_averaging_grid … … 2433 2459 ) 2434 2460 IF (TRIM(ic_mode) == 'profile') THEN 2435 output_var_table(3) % averaging_grid => averaged_ scalar_profile2461 output_var_table(3) % averaging_grid => averaged_initial_scalar_profile 2436 2462 END IF 2437 2463 … … 2509 2535 ) 2510 2536 IF (TRIM(ic_mode) == 'profile') THEN 2511 output_var_table(9) % averaging_grid => averaged_ scalar_profile2537 output_var_table(9) % averaging_grid => averaged_initial_scalar_profile 2512 2538 END IF 2513 2539 … … 2585 2611 ) 2586 2612 IF (TRIM(ic_mode) == 'profile') THEN 2587 output_var_table(15) % averaging_grid => averaged_ scalar_profile2613 output_var_table(15) % averaging_grid => averaged_initial_scalar_profile 2588 2614 END IF 2589 2615 … … 2661 2687 ) 2662 2688 IF (TRIM(ic_mode) == 'profile') THEN 2663 output_var_table(21) % averaging_grid => averaged_ scalar_profile2689 output_var_table(21) % averaging_grid => averaged_initial_scalar_profile 2664 2690 END IF 2665 2691 … … 2737 2763 ) 2738 2764 IF (TRIM(ic_mode) == 'profile') THEN 2739 output_var_table(27) % averaging_grid => averaged_ w_profile2765 output_var_table(27) % averaging_grid => averaged_initial_w_profile 2740 2766 END IF 2741 2767
Note: See TracChangeset
for help on using the changeset viewer.