- Timestamp:
- Jul 9, 2020 3:01:00 PM (4 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/surface_layer_fluxes_mod.f90
r4593 r4594 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Include k index in OMP PRIVATE statements 28 ! 29 ! 4593 2020-07-09 12:48:18Z suehring 27 30 ! - Pre-calculate ln(z/z0) at each timestep in order to reduce the number of log-calculations 28 31 ! - Bugfix - add missing density to fluxes of passive-scalars, chemistry and cloud-phyiscal … … 1301 1304 !-- Compute u* at downward-facing surfaces. This case, do not consider any stability. 1302 1305 ELSE 1303 !$OMP PARALLEL 1306 !$OMP PARALLEL DO 1304 1307 !$ACC PARALLEL LOOP & 1305 1308 !$ACC PRESENT(surf) … … 1836 1839 !$OMP PARALLEL DO PRIVATE( k ) 1837 1840 DO m = 1, surf%ns 1838 k 1841 k = surf%k(m) 1839 1842 surf%qsws(m) = -surf%qs(m) * surf%us(m) * rho_air_zw(k-1) 1840 1843 ENDDO … … 1843 1846 !-- Compute the vertical scalar flux 1844 1847 IF ( .NOT. constant_scalarflux .AND. passive_scalar .AND. .NOT. downward ) THEN 1845 !$OMP PARALLEL DO 1846 DO m = 1, surf%ns 1848 !$OMP PARALLEL DO PRIVATE( k ) 1849 DO m = 1, surf%ns 1850 k = surf%k(m) 1847 1851 surf%ssws(m) = -surf%ss(m) * surf%us(m) * rho_air_zw(k-1) 1848 1852 ENDDO … … 1852 1856 DO lsp = 1, nvar 1853 1857 IF ( .NOT. constant_csflux(lsp) .AND. air_chemistry .AND. .NOT. downward ) THEN 1854 !$OMP PARALLEL DO 1858 !$OMP PARALLEL DO PRIVATE( k ) 1855 1859 DO m = 1, surf%ns 1860 k = surf%k(m) 1856 1861 surf%cssws(lsp,m) = -surf%css(lsp,m) * surf%us(m) * rho_air_zw(k-1) 1857 1862 ENDDO … … 1862 1867 !-- Compute (turbulent) fluxes of cloud water content and cloud drop conc. 1863 1868 IF ( bulk_cloud_model .AND. microphysics_morrison .AND. .NOT. downward) THEN 1864 !$OMP PARALLEL DO 1865 DO m = 1, surf%ns 1869 !$OMP PARALLEL DO PRIVATE( k ) 1870 DO m = 1, surf%ns 1871 k = surf%k(m) 1866 1872 surf%qcsws(m) = -surf%qcs(m) * surf%us(m) * rho_air_zw(k-1) 1867 1873 surf%ncsws(m) = -surf%ncs(m) * surf%us(m) * rho_air_zw(k-1) … … 1871 1877 !-- Compute (turbulent) fluxes of rain water content and rain drop conc. 1872 1878 IF ( bulk_cloud_model .AND. microphysics_seifert .AND. .NOT. downward) THEN 1873 !$OMP PARALLEL DO 1874 DO m = 1, surf%ns 1879 !$OMP PARALLEL DO PRIVATE( k ) 1880 DO m = 1, surf%ns 1881 k = surf%k(m) 1875 1882 surf%qrsws(m) = -surf%qrs(m) * surf%us(m) * rho_air_zw(k-1) 1876 1883 surf%nrsws(m) = -surf%nrs(m) * surf%us(m) * rho_air_zw(k-1) -
palm/trunk/SOURCE/surface_mod.f90
r4593 r4594 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Bugfix, add acc directives for scalar-roughness length 28 ! 29 ! 4593 2020-07-09 12:48:18Z suehring 27 30 ! Add arrays for pre-calculated ln(z/z0) 28 31 ! … … 1542 1545 !$ACC DELETE(surfaces%ln_z_z0q(1:surfaces%ns)) & 1543 1546 !$ACC DELETE(surfaces%z0(1:surfaces%ns)) & 1547 !$ACC DELETE(surfaces%z0h(1:surfaces%ns)) & 1548 !$ACC DELETE(surfaces%z0q(1:surfaces%ns)) & 1544 1549 !$ACC COPYOUT(surfaces%us(1:surfaces%ns)) & 1545 1550 !$ACC COPYOUT(surfaces%ol(1:surfaces%ns)) & … … 1586 1591 !$ACC COPYIN(surfaces%ln_z_z0q(1:surfaces%ns)) & 1587 1592 !$ACC COPYIN(surfaces%z0(1:surfaces%ns)) & 1593 !$ACC COPYIN(surfaces%z0h(1:surfaces%ns)) & 1594 !$ACC COPYIN(surfaces%z0q(1:surfaces%ns)) & 1588 1595 !$ACC COPYIN(surfaces%us(1:surfaces%ns)) & 1589 1596 !$ACC COPYIN(surfaces%ol(1:surfaces%ns)) & … … 2099 2106 !$ACC DELETE(surfaces%ln_z_z0q(1:surfaces%ns) ) & 2100 2107 !$ACC DELETE(surfaces%z0(1:surfaces%ns)) & 2108 !$ACC DELETE(surfaces%z0h(1:surfaces%ns)) & 2109 !$ACC DELETE(surfaces%z0q(1:surfaces%ns)) & 2101 2110 !$ACC DELETE(surfaces%rib(1:surfaces%ns)) & 2102 2111 !$ACC DELETE(surfaces%mom_flux_uv(1:surfaces%ns)) & … … 2134 2143 !$ACC COPYIN(surfaces%ln_z_z0q(1:surfaces%ns) ) & 2135 2144 !$ACC COPYIN(surfaces%z0(1:surfaces%ns)) & 2145 !$ACC COPYIN(surfaces%z0h(1:surfaces%ns)) & 2146 !$ACC COPYIN(surfaces%z0q(1:surfaces%ns)) & 2136 2147 !$ACC COPYIN(surfaces%rib(1:surfaces%ns)) & 2137 2148 !$ACC COPYIN(surfaces%mom_flux_uv(1:surfaces%ns)) & … … 5570 5581 CONTAINS 5571 5582 5572 SUBROUTINE restore_surface_elements( surf_target, surf_file )5573 5574 IMPLICIT NONE5575 5576 INTEGER(iwp) :: lsp !< running index chemical species5577 5578 TYPE(surf_type) :: surf_target !< target surface type5579 TYPE(surf_type) :: surf_file !< surface type on file5580 5581 5582 IF ( ALLOCATED( surf_target%us ) .AND. ALLOCATED( surf_file%us ) ) THEN5583 surf_target%us = surf_file%us5584 ENDIF5585 5586 IF ( ALLOCATED( surf_target%ol ) .AND. ALLOCATED( surf_file%ol ) ) &5587 surf_target%ol = surf_file%ol5588 5589 IF ( ALLOCATED( surf_target%pt_surface ) .AND. ALLOCATED( surf_file%pt_surface ) ) &5590 surf_target%pt_surface = surf_file%pt_surface5591 5592 IF ( ALLOCATED( surf_target%q_surface ) .AND. ALLOCATED( surf_file%q_surface ) ) &5593 surf_target%q_surface = surf_file%q_surface5594 5595 IF ( ALLOCATED( surf_target%vpt_surface ) .AND. ALLOCATED( surf_file%vpt_surface ) ) &5596 surf_target%vpt_surface = surf_file%vpt_surface5597 5598 IF ( ALLOCATED( surf_target%usws ) .AND. ALLOCATED( surf_file%usws ) ) &5599 surf_target%usws = surf_file%usws5600 5601 IF ( ALLOCATED( surf_target%vsws ) .AND. ALLOCATED( surf_file%vsws ) ) &5602 surf_target%vsws = surf_file%vsws5603 5604 IF ( ALLOCATED( surf_target%ts ) .AND. ALLOCATED( surf_file%ts ) ) &5605 surf_target%ts = surf_file%ts5606 5607 IF ( ALLOCATED( surf_target%shf ) .AND. ALLOCATED( surf_file%shf ) ) &5608 surf_target%shf = surf_file%shf5609 5610 IF ( ALLOCATED( surf_target%qs ) .AND. ALLOCATED( surf_file%qs ) ) &5611 surf_target%qs = surf_file%qs5612 5613 IF ( ALLOCATED( surf_target%qsws ) .AND. ALLOCATED( surf_file%qsws ) ) &5614 surf_target%qsws = surf_file%qsws5615 5616 IF ( ALLOCATED( surf_target%ss ) .AND. ALLOCATED( surf_file%ss ) ) &5617 surf_target%ss = surf_file%ss5618 5619 IF ( ALLOCATED( surf_target%ssws ) .AND. ALLOCATED( surf_file%ssws ) ) &5620 surf_target%ssws = surf_file%ssws5621 5622 IF ( ALLOCATED( surf_target%css ) .AND. ALLOCATED( surf_file%css ) ) THEN5623 DO lsp = 1, nvar5624 surf_target%css(lsp,:) = surf_file%css(lsp,:)5625 ENDDO5626 ENDIF5627 5628 IF ( ALLOCATED( surf_target%cssws ) .AND. ALLOCATED( surf_file%cssws ) ) THEN5629 DO lsp = 1, nvar5630 surf_target%cssws(lsp,:) = surf_file%cssws(lsp,:)5631 ENDDO5632 ENDIF5633 IF ( ALLOCATED( surf_target%qcs ) .AND. ALLOCATED( surf_file%qcs ) ) &5634 surf_target%qcs = surf_file%qcs5635 IF ( ALLOCATED( surf_target%qcsws ) .AND. ALLOCATED( surf_file%qcsws ) ) &5636 surf_target%qcsws = surf_file%qcsws5637 IF ( ALLOCATED( surf_target%ncs ) .AND. ALLOCATED( surf_file%ncs ) ) &5638 surf_target%ncs = surf_file%ncs5639 IF ( ALLOCATED( surf_target%ncsws ) .AND. ALLOCATED( surf_file%ncsws ) ) &5640 surf_target%ncsws = surf_file%ncsws5641 IF ( ALLOCATED( surf_target%qrs ) .AND. ALLOCATED( surf_file%qrs ) ) &5642 surf_target%qrs = surf_file%qrs5643 IF ( ALLOCATED( surf_target%qrsws ) .AND. ALLOCATED( surf_file%qrsws ) ) &5644 surf_target%qrsws = surf_file%qrsws5645 IF ( ALLOCATED( surf_target%nrs ) .AND. ALLOCATED( surf_file%nrs ) ) &5646 surf_target%nrs = surf_file%nrs5647 5648 IF ( ALLOCATED( surf_target%nrsws ) .AND. ALLOCATED( surf_file%nrsws ) ) &5649 surf_target%nrsws = surf_file%nrsws5650 IF ( ALLOCATED( surf_target%sasws ) .AND. ALLOCATED( surf_file%sasws ) ) &5651 surf_target%sasws = surf_file%sasws5652 IF ( ALLOCATED( surf_target%mom_flux_uv ) .AND. ALLOCATED( surf_file%mom_flux_uv ) ) &5653 surf_target%mom_flux_uv = surf_file%mom_flux_uv5654 IF ( ALLOCATED( surf_target%mom_flux_w ) .AND. ALLOCATED( surf_file%mom_flux_w ) ) &5655 surf_target%mom_flux_w = surf_file%mom_flux_w5656 IF ( ALLOCATED( surf_target%mom_flux_tke ) .AND. ALLOCATED( surf_file%mom_flux_tke ) ) &5657 surf_target%mom_flux_tke(0:1,:) = surf_file%mom_flux_tke(0:1,:)5658 5659 5660 END SUBROUTINE restore_surface_elements5583 ! SUBROUTINE restore_surface_elements( surf_target, surf_file ) 5584 ! 5585 ! IMPLICIT NONE 5586 ! 5587 ! INTEGER(iwp) :: lsp !< running index chemical species 5588 ! 5589 ! TYPE(surf_type) :: surf_target !< target surface type 5590 ! TYPE(surf_type) :: surf_file !< surface type on file 5591 ! 5592 ! 5593 ! IF ( ALLOCATED( surf_target%us ) .AND. ALLOCATED( surf_file%us ) ) THEN 5594 ! surf_target%us = surf_file%us 5595 ! ENDIF 5596 ! 5597 ! IF ( ALLOCATED( surf_target%ol ) .AND. ALLOCATED( surf_file%ol ) ) & 5598 ! surf_target%ol = surf_file%ol 5599 ! 5600 ! IF ( ALLOCATED( surf_target%pt_surface ) .AND. ALLOCATED( surf_file%pt_surface ) ) & 5601 ! surf_target%pt_surface = surf_file%pt_surface 5602 ! 5603 ! IF ( ALLOCATED( surf_target%q_surface ) .AND. ALLOCATED( surf_file%q_surface ) ) & 5604 ! surf_target%q_surface = surf_file%q_surface 5605 ! 5606 ! IF ( ALLOCATED( surf_target%vpt_surface ) .AND. ALLOCATED( surf_file%vpt_surface ) ) & 5607 ! surf_target%vpt_surface = surf_file%vpt_surface 5608 ! 5609 ! IF ( ALLOCATED( surf_target%usws ) .AND. ALLOCATED( surf_file%usws ) ) & 5610 ! surf_target%usws = surf_file%usws 5611 ! 5612 ! IF ( ALLOCATED( surf_target%vsws ) .AND. ALLOCATED( surf_file%vsws ) ) & 5613 ! surf_target%vsws = surf_file%vsws 5614 ! 5615 ! IF ( ALLOCATED( surf_target%ts ) .AND. ALLOCATED( surf_file%ts ) ) & 5616 ! surf_target%ts = surf_file%ts 5617 ! 5618 ! IF ( ALLOCATED( surf_target%shf ) .AND. ALLOCATED( surf_file%shf ) ) & 5619 ! surf_target%shf = surf_file%shf 5620 ! 5621 ! IF ( ALLOCATED( surf_target%qs ) .AND. ALLOCATED( surf_file%qs ) ) & 5622 ! surf_target%qs = surf_file%qs 5623 ! 5624 ! IF ( ALLOCATED( surf_target%qsws ) .AND. ALLOCATED( surf_file%qsws ) ) & 5625 ! surf_target%qsws = surf_file%qsws 5626 ! 5627 ! IF ( ALLOCATED( surf_target%ss ) .AND. ALLOCATED( surf_file%ss ) ) & 5628 ! surf_target%ss = surf_file%ss 5629 ! 5630 ! IF ( ALLOCATED( surf_target%ssws ) .AND. ALLOCATED( surf_file%ssws ) ) & 5631 ! surf_target%ssws = surf_file%ssws 5632 ! 5633 ! IF ( ALLOCATED( surf_target%css ) .AND. ALLOCATED( surf_file%css ) ) THEN 5634 ! DO lsp = 1, nvar 5635 ! surf_target%css(lsp,:) = surf_file%css(lsp,:) 5636 ! ENDDO 5637 ! ENDIF 5638 ! 5639 ! IF ( ALLOCATED( surf_target%cssws ) .AND. ALLOCATED( surf_file%cssws ) ) THEN 5640 ! DO lsp = 1, nvar 5641 ! surf_target%cssws(lsp,:) = surf_file%cssws(lsp,:) 5642 ! ENDDO 5643 ! ENDIF 5644 ! IF ( ALLOCATED( surf_target%qcs ) .AND. ALLOCATED( surf_file%qcs ) ) & 5645 ! surf_target%qcs = surf_file%qcs 5646 ! IF ( ALLOCATED( surf_target%qcsws ) .AND. ALLOCATED( surf_file%qcsws ) ) & 5647 ! surf_target%qcsws = surf_file%qcsws 5648 ! IF ( ALLOCATED( surf_target%ncs ) .AND. ALLOCATED( surf_file%ncs ) ) & 5649 ! surf_target%ncs = surf_file%ncs 5650 ! IF ( ALLOCATED( surf_target%ncsws ) .AND. ALLOCATED( surf_file%ncsws ) ) & 5651 ! surf_target%ncsws = surf_file%ncsws 5652 ! IF ( ALLOCATED( surf_target%qrs ) .AND. ALLOCATED( surf_file%qrs ) ) & 5653 ! surf_target%qrs = surf_file%qrs 5654 ! IF ( ALLOCATED( surf_target%qrsws ) .AND. ALLOCATED( surf_file%qrsws ) ) & 5655 ! surf_target%qrsws = surf_file%qrsws 5656 ! IF ( ALLOCATED( surf_target%nrs ) .AND. ALLOCATED( surf_file%nrs ) ) & 5657 ! surf_target%nrs = surf_file%nrs 5658 ! 5659 ! IF ( ALLOCATED( surf_target%nrsws ) .AND. ALLOCATED( surf_file%nrsws ) ) & 5660 ! surf_target%nrsws = surf_file%nrsws 5661 ! IF ( ALLOCATED( surf_target%sasws ) .AND. ALLOCATED( surf_file%sasws ) ) & 5662 ! surf_target%sasws = surf_file%sasws 5663 ! IF ( ALLOCATED( surf_target%mom_flux_uv ) .AND. ALLOCATED( surf_file%mom_flux_uv ) ) & 5664 ! surf_target%mom_flux_uv = surf_file%mom_flux_uv 5665 ! IF ( ALLOCATED( surf_target%mom_flux_w ) .AND. ALLOCATED( surf_file%mom_flux_w ) ) & 5666 ! surf_target%mom_flux_w = surf_file%mom_flux_w 5667 ! IF ( ALLOCATED( surf_target%mom_flux_tke ) .AND. ALLOCATED( surf_file%mom_flux_tke ) ) & 5668 ! surf_target%mom_flux_tke(0:1,:) = surf_file%mom_flux_tke(0:1,:) 5669 ! 5670 ! 5671 ! END SUBROUTINE restore_surface_elements 5661 5672 5662 5673 END SUBROUTINE surface_rrd_local_mpi
Note: See TracChangeset
for help on using the changeset viewer.