Changeset 2766 for palm/trunk/SOURCE/surface_mod.f90
- Timestamp:
- Jan 22, 2018 5:17:47 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/surface_mod.f90
r2759 r2766 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Removed preprocessor directive __chem 29 ! 30 ! 2759 2018-01-17 16:24:59Z suehring 28 31 ! Bugfix, consider density in vertical fluxes of passive scalar as well as 29 32 ! chemical species. … … 123 126 rho_air, rho_air_zw, zu, zw, waterflux_input_conversion 124 127 125 #if defined( __chem )126 128 USE chem_modules 127 #endif128 129 129 130 USE control_parameters … … 968 969 ! 969 970 !-- Scaling parameter (cs*) and surface flux of chemical species 970 #if defined ( __chem )971 971 IF ( air_chemistry ) THEN 972 972 ALLOCATE ( surfaces%css(1:nvar,1:surfaces%ns) ) 973 973 ALLOCATE ( surfaces%cssws(1:nvar,1:surfaces%ns) ) 974 974 ENDIF 975 #endif976 975 ! 977 976 !-- Arrays for storing potential temperature and … … 1052 1051 ! 1053 1052 !-- Chemical species flux 1054 #if defined( __chem )1055 1053 IF ( air_chemistry ) THEN 1056 1054 ALLOCATE ( surfaces%cssws(1:nvar,1:surfaces%ns) ) 1057 1055 ENDIF 1058 #endif1059 1056 ! 1060 1057 !-- … … 1167 1164 ! 1168 1165 !-- Scaling parameter (cs*) and surface flux of chemical species 1169 #if defined( __chem )1170 1166 IF ( air_chemistry ) THEN 1171 1167 ALLOCATE ( surfaces%css(1:nvar,1:surfaces%ns) ) 1172 1168 ALLOCATE ( surfaces%cssws(1:nvar,1:surfaces%ns) ) 1173 1169 ENDIF 1174 #endif1175 1170 ! 1176 1171 !-- Arrays for storing potential temperature and … … 1737 1732 IF ( passive_scalar ) surf%ss(num_h) = 0.0_wp 1738 1733 1739 #if defined( __chem )1740 1734 DO lsp = 1, nvar 1741 1735 IF ( air_chemistry ) surf%css(lsp,num_h) = 0.0_wp 1742 1736 ENDDO 1743 #endif1744 1737 ! 1745 1738 !-- Set initial value for surface temperature … … 1819 1812 ENDIF 1820 1813 1821 #if defined( __chem )1822 1814 IF ( air_chemistry ) THEN 1823 1815 lsp_pr = 1 … … 1849 1841 ENDDO 1850 1842 ENDIF 1851 #endif1852 1843 1853 1844 IF ( ocean ) THEN … … 1920 1911 ! 1921 1912 !-- Prescribe top chemical species' flux 1922 #if defined( __chem )1923 1913 DO lsp = 1, nvar 1924 1914 IF ( air_chemistry .AND. constant_top_csflux(lsp) ) THEN … … 1926 1916 ENDIF 1927 1917 ENDDO 1928 #endif1929 1918 ! 1930 1919 !-- Prescribe top salinity flux … … 2063 2052 ENDIF 2064 2053 2065 #if defined( __chem )2066 2054 IF ( air_chemistry ) THEN 2067 2055 DO lsp = 1, nvar … … 2070 2058 ENDDO 2071 2059 ENDIF 2072 #endif2073 2060 2074 2061 ! … … 2271 2258 IF ( ALLOCATED( surf_def_h(l)%ssws ) ) & 2272 2259 surf_h(l)%ssws(mm(l)) = surf_def_h(l)%ssws(m) 2273 #if defined( __chem )2274 2260 IF ( ALLOCATED( surf_def_h(l)%css ) ) THEN 2275 2261 DO lsp = 1,nvar … … 2282 2268 ENDDO 2283 2269 ENDIF 2284 #endif2285 2270 IF ( ALLOCATED( surf_def_h(l)%ncsws ) ) & 2286 2271 surf_h(l)%ncsws(mm(l)) = surf_def_h(l)%ncsws(m) … … 2328 2313 IF ( ALLOCATED( surf_lsm_h%ssws ) ) & 2329 2314 surf_h(0)%ssws(mm(0)) = surf_lsm_h%ssws(m) 2330 #if defined( __chem )2331 2315 IF ( ALLOCATED( surf_lsm_h%css ) ) THEN 2332 2316 DO lsp = 1, nvar … … 2339 2323 ENDDO 2340 2324 ENDIF 2341 #endif2342 2325 IF ( ALLOCATED( surf_lsm_h%ncsws ) ) & 2343 2326 surf_h(0)%ncsws(mm(0)) = surf_lsm_h%ncsws(m) … … 2385 2368 IF ( ALLOCATED( surf_usm_h%ssws ) ) & 2386 2369 surf_h(0)%ssws(mm(0)) = surf_usm_h%ssws(m) 2387 #if defined( __chem )2388 2370 IF ( ALLOCATED( surf_usm_h%css ) ) THEN 2389 2371 DO lsp = 1, nvar … … 2396 2378 ENDDO 2397 2379 ENDIF 2398 #endif2399 2380 IF ( ALLOCATED( surf_usm_h%ncsws ) ) & 2400 2381 surf_h(0)%ncsws(mm(0)) = surf_usm_h%ncsws(m) … … 2474 2455 IF ( ALLOCATED( surf_def_v(l)%ssws ) ) & 2475 2456 surf_v(l)%ssws(mm(l)) = surf_def_v(l)%ssws(m) 2476 #if defined( __chem )2477 2457 IF ( ALLOCATED( surf_def_v(l)%css ) ) THEN 2478 2458 DO lsp = 1, nvar … … 2485 2465 ENDDO 2486 2466 ENDIF 2487 #endif2488 2467 IF ( ALLOCATED( surf_def_v(l)%ncsws ) ) & 2489 2468 surf_v(l)%ncsws(mm(l)) = surf_def_v(l)%ncsws(m) … … 2536 2515 IF ( ALLOCATED( surf_lsm_v(l)%ssws ) ) & 2537 2516 surf_v(l)%ssws(mm(l)) = surf_lsm_v(l)%ssws(m) 2538 #if defined( __chem )2539 2517 IF ( ALLOCATED( surf_lsm_v(l)%css ) ) THEN 2540 2518 DO lsp = 1, nvar … … 2547 2525 ENDDO 2548 2526 ENDIF 2549 #endif2550 2527 IF ( ALLOCATED( surf_lsm_v(l)%ncsws ) ) & 2551 2528 surf_v(l)%ncsws(mm(l)) = surf_lsm_v(l)%ncsws(m) … … 2598 2575 IF ( ALLOCATED( surf_usm_v(l)%ssws ) ) & 2599 2576 surf_v(l)%ssws(mm(l)) = surf_usm_v(l)%ssws(m) 2600 #if defined( __chem )2601 2577 IF ( ALLOCATED( surf_usm_v(l)%css ) ) THEN 2602 2578 DO lsp = 1, nvar … … 2609 2585 ENDDO 2610 2586 ENDIF 2611 #endif2612 2587 IF ( ALLOCATED( surf_usm_v(l)%ncsws ) ) & 2613 2588 surf_v(l)%ncsws(mm(l)) = surf_usm_v(l)%ncsws(m) … … 2717 2692 WRITE ( 14 ) surf_h(l)%ssws 2718 2693 ENDIF 2719 #if defined ( __chem )2720 2694 WRITE ( 14 ) 'surf_h(' // dum // ')%css ' 2721 2695 IF ( ALLOCATED ( surf_h(l)%css ) ) THEN … … 2726 2700 WRITE ( 14 ) surf_h(l)%cssws 2727 2701 ENDIF 2728 #endif2729 2702 WRITE ( 14 ) 'surf_h(' // dum // ')%qcsws ' 2730 2703 IF ( ALLOCATED ( surf_h(l)%qcsws ) ) THEN … … 2814 2787 WRITE ( 14 ) surf_v(l)%ssws 2815 2788 ENDIF 2816 #if defined( __chem )2817 2789 WRITE ( 14 ) 'surf_v(' // dum // ')%css ' 2818 2790 IF ( ALLOCATED ( surf_v(l)%css ) ) THEN … … 2823 2795 WRITE ( 14 ) surf_v(l)%cssws 2824 2796 ENDIF 2825 #endif2826 2797 WRITE ( 14 ) 'surf_v(' // dum // ')%qcsws ' 2827 2798 IF ( ALLOCATED ( surf_v(l)%qcsws ) ) THEN … … 3059 3030 IF ( ALLOCATED( surf_h(0)%ssws ) .AND. kk == 1 ) & 3060 3031 READ ( 13 ) surf_h(0)%ssws 3061 #if defined( __chem )3062 3032 CASE ( 'surf_h(0)%css' ) 3063 3033 IF ( ALLOCATED( surf_h(0)%css ) .AND. kk == 1 ) & … … 3066 3036 IF ( ALLOCATED( surf_h(0)%cssws ) .AND. kk == 1 ) & 3067 3037 READ ( 13 ) surf_h(0)%cssws 3068 #endif3069 3038 CASE ( 'surf_h(0)%qcsws' ) 3070 3039 IF ( ALLOCATED( surf_h(0)%qcsws ) .AND. kk == 1 ) & … … 3138 3107 IF ( ALLOCATED( surf_h(1)%ssws ) .AND. kk == 1 ) & 3139 3108 READ ( 13 ) surf_h(1)%ssws 3140 #if defined( __chem )3141 3109 CASE ( 'surf_h(1)%css' ) 3142 3110 IF ( ALLOCATED( surf_h(1)%css ) .AND. kk == 1 ) & … … 3145 3113 IF ( ALLOCATED( surf_h(1)%cssws ) .AND. kk == 1 ) & 3146 3114 READ ( 13 ) surf_h(1)%cssws 3147 #endif3148 3115 CASE ( 'surf_h(1)%qcsws' ) 3149 3116 IF ( ALLOCATED( surf_h(1)%qcsws ) .AND. kk == 1 ) & … … 3214 3181 IF ( ALLOCATED( surf_h(2)%ssws ) .AND. kk == 1 ) & 3215 3182 READ ( 13 ) surf_h(2)%ssws 3216 #if defined( __chem )3217 3183 CASE ( 'surf_h(2)%css' ) 3218 3184 IF ( ALLOCATED( surf_h(2)%css ) .AND. kk == 1 ) & … … 3221 3187 IF ( ALLOCATED( surf_h(2)%cssws ) .AND. kk == 1 ) & 3222 3188 READ ( 13 ) surf_h(2)%cssws 3223 #endif3224 3189 CASE ( 'surf_h(2)%qcsws' ) 3225 3190 IF ( ALLOCATED( surf_h(2)%qcsws ) .AND. kk == 1 ) & … … 3289 3254 IF ( ALLOCATED( surf_v(0)%ssws ) .AND. kk == 1 ) & 3290 3255 READ ( 13 ) surf_v(0)%ssws 3291 #if defined( __chem )3292 3256 CASE ( 'surf_v(0)%css' ) 3293 3257 IF ( ALLOCATED( surf_v(0)%css ) .AND. kk == 1 ) & … … 3296 3260 IF ( ALLOCATED( surf_v(0)%cssws ) .AND. kk == 1 ) & 3297 3261 READ ( 13 ) surf_v(0)%cssws 3298 #endif3299 3262 CASE ( 'surf_v(0)%qcsws' ) 3300 3263 IF ( ALLOCATED( surf_v(0)%qcsws ) .AND. kk == 1 ) & … … 3371 3334 IF ( ALLOCATED( surf_v(1)%ssws ) .AND. kk == 1 ) & 3372 3335 READ ( 13 ) surf_v(1)%ssws 3373 #if defined( __chem )3374 3336 CASE ( 'surf_v(1)%css' ) 3375 3337 IF ( ALLOCATED( surf_v(1)%css ) .AND. kk == 1 ) & … … 3378 3340 IF ( ALLOCATED( surf_v(1)%cssws ) .AND. kk == 1 ) & 3379 3341 READ ( 13 ) surf_v(1)%cssws 3380 #endif3381 3342 CASE ( 'surf_v(1)%qcsws' ) 3382 3343 IF ( ALLOCATED( surf_v(1)%qcsws ) .AND. kk == 1 ) & … … 3453 3414 IF ( ALLOCATED( surf_v(2)%ssws ) .AND. kk == 1 ) & 3454 3415 READ ( 13 ) surf_v(2)%ssws 3455 #if defined( __chem )3456 3416 CASE ( 'surf_v(2)%css' ) 3457 3417 IF ( ALLOCATED( surf_v(2)%css ) .AND. kk == 1 ) & … … 3460 3420 IF ( ALLOCATED( surf_v(2)%cssws ) .AND. kk == 1 ) & 3461 3421 READ ( 13 ) surf_v(2)%cssws 3462 #endif3463 3422 CASE ( 'surf_v(2)%qcsws' ) 3464 3423 IF ( ALLOCATED( surf_v(2)%qcsws ) .AND. kk == 1 ) & … … 3535 3494 IF ( ALLOCATED( surf_v(3)%ssws ) .AND. kk == 1 ) & 3536 3495 READ ( 13 ) surf_v(3)%ssws 3537 #if defined( __chem )3538 3496 CASE ( 'surf_v(3)%css' ) 3539 3497 IF ( ALLOCATED( surf_v(3)%css ) .AND. kk == 1 ) & … … 3542 3500 IF ( ALLOCATED( surf_v(3)%cssws ) .AND. kk == 1 ) & 3543 3501 READ ( 13 ) surf_v(3)%cssws 3544 #endif3545 3502 CASE ( 'surf_v(3)%qcsws' ) 3546 3503 IF ( ALLOCATED( surf_v(3)%qcsws ) .AND. kk == 1 ) & … … 3762 3719 ENDIF 3763 3720 3764 #if defined( __chem )3765 3721 IF ( INDEX( TRIM( field_chr ), '%css' ) /= 0 ) THEN 3766 3722 IF ( ALLOCATED( surf_target%css ) .AND. & … … 3779 3735 ENDIF 3780 3736 ENDIF 3781 #endif3782 3737 3783 3738 IF ( INDEX( TRIM( field_chr ), '%qcs' ) /= 0 ) THEN
Note: See TracChangeset
for help on using the changeset viewer.