Changeset 4897 for palm/trunk/SOURCE/chemistry_model_mod.f90
- Timestamp:
- Mar 4, 2021 9:08:58 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/chemistry_model_mod.f90
r4895 r4897 26 26 ! ----------------- 27 27 ! $Id$ 28 ! Few informative messages removed, small changes in comments and chemistry header 29 ! 30 ! 31 ! 4895 2021-03-03 15:39:08Z suehring 28 32 ! Remove offset in terrain-following masked output 29 33 ! … … 309 313 !> @todo Adjust chem_rrd_local to CASE structure of others modules. It is not allowed to use the 310 314 !> chemistry model in a precursor run and additionally not using it in a main run 311 !> @todo Implement turbulent inflow of chem spcs in inflow_turbulence. 312 !> @todo Separate boundary conditions for each chem spcs to be implemented 313 !> @todo Currently only total concentration are calculated. Resolved, parameterized and chemistry 314 !> fluxes although partially and some completely coded but are not operational/activated in 315 !> this version. bK. 316 !> @todo slight differences in passive scalar and chem spcs when chem reactions turned off. Need to 317 !> be fixed. bK 318 !> @todo chemistry error messages 315 !> @todo Implement turbulent inflow of chem spcs in inflow_turbulence. Do we need this? Not done for salsa either. 319 316 ! 320 317 !--------------------------------------------------------------------------------------------------! … … 369 366 message_string, & 370 367 monotonic_limiter_z, & 368 nesting_offline, & 371 369 omega, & 372 370 restart_data_format_output, & … … 799 797 !-- Boundary condtions for chemical species at horizontal walls 800 798 DO lsp = 1, nspec 801 802 IF ( ibc_cs_b == 0 ) THEN 799 ! 800 !-- Surface conditions: 801 IF ( ibc_cs_b == 0 ) THEN ! Dirichlet 802 ! 803 !-- Run loop over all non-natural and natural walls. Note, in wall-datatype the k 804 !-- coordinate belongs to the atmospheric grid point, therefore, set s_p at k-1 803 805 DO l = 0, 1 804 806 !$OMP PARALLEL DO PRIVATE( i, j, k ) … … 812 814 ENDDO 813 815 814 ELSEIF ( ibc_cs_b == 1 ) THEN 815 ! 816 !-- In boundary_conds there is som extra loop over m here for passive tracer 817 !> TODO: clarify the meaning of the above comment. Explain in more detail or remove it. (Siggi) 816 ELSEIF ( ibc_cs_b == 1 ) THEN ! Neumann 817 ! 818 818 DO l = 0, 1 819 819 !$OMP PARALLEL DO PRIVATE( i, j, k ) … … 830 830 831 831 ! 832 !-- Top boundary conditions for chemical species - Should this not be done for all species? 833 !> TODO: This question also needs to be clarified. I guess it can be removed because the loop 834 !> already runs over all species? (Siggi) 832 !-- Top boundary conditions for chemical species 835 833 DO lsp = 1, nspec 836 834 IF ( ibc_cs_t == 0 ) THEN … … 1241 1239 1242 1240 ! 1243 !-- Check for chemical reactions status1244 IF ( chem_gasphase_on ) THEN1245 message_string = 'Chemical reactions: ON'1246 CALL message( 'chem_check_parameters', 'PA0517', 0, 0, 0, 6, 0 )1247 ELSEIF ( .NOT. ( chem_gasphase_on ) ) THEN1248 message_string = 'Chemical reactions: OFF'1249 CALL message( 'chem_check_parameters', 'PA0517', 0, 0, 0, 6, 0 )1250 ENDIF1251 !1252 1241 !-- Check for chemistry time-step 1253 1242 IF ( call_chem_at_all_substeps ) THEN 1254 message_string = 'Chemistry is calculated at all meteorology time-step' 1243 message_string = & 1244 'Warning: call_chem_at_all_substeps shoukld only be used for test purposes! ' 1255 1245 CALL message( 'chem_check_parameters', 'PA0522', 0, 0, 0, 6, 0 ) 1256 ELSEIF ( .NOT. ( call_chem_at_all_substeps ) ) THEN1257 message_string = 'Sub-time-steps are skipped for chemistry time-steps'1258 CALL message( 'chem_check_parameters', 'PA0518', 0, 0, 0, 6, 0 )1259 1246 ENDIF 1260 1247 ! … … 1405 1392 !-- chem_check_parameters is called before the array chem_species is allocated! 1406 1393 !-- temporary switch of this part of the check 1407 ! RETURN !bK commented1408 1394 !> TODO: this workaround definitely needs to be removed from here!!! 1409 1395 CALL chem_init_internal … … 1868 1854 ENDIF 1869 1855 ! 1870 !-- Chemistry time-step1871 WRITE ( io, 4 ) cs_time_step1872 !1873 1856 !-- Emission mode info 1857 WRITE ( io, 4 ) emiss_read_legacy_mode 1874 1858 !-- At the moment the evaluation is done with both emiss_lod and mode_emis but once salsa has been 1875 1859 !-- migrated to emiss_lod the .OR. mode_emis conditions can be removed (ecc 20190513) … … 1922 1906 1923 1907 IF ( nesting_chem ) WRITE( io, 12 ) nesting_chem 1924 IF ( nesting_offline_chem ) WRITE( io, 13 ) nesting_offline_chem1908 IF ( nesting_offline_chem .AND. nesting_offline ) WRITE( io, 13 ) nesting_offline_chem 1925 1909 1926 1910 WRITE( io, 14 ) TRIM( bc_cs_b ), TRIM( bc_cs_t ), TRIM( bc_cs_s ), TRIM( bc_cs_n ), & … … 1930 1914 !-- Number of variable and fix chemical species and number of reactions 1931 1915 cs_fixed = nspec - nvar 1932 WRITE ( io, * ) ' --> Chemical Mechanism : ', cs_mech 1933 WRITE ( io, * ) ' --> Chemical species, variable: ', nvar 1934 WRITE ( io, * ) ' --> Chemical species, fixed : ', cs_fixed 1935 WRITE ( io, * ) ' --> Total number of reactions : ', nreact 1916 WRITE ( io, * ) ' --> Chemical Mechanism : ', cs_mech 1917 WRITE ( io, * ) ' --> Chemical species, variable : ', nvar 1918 WRITE ( io, * ) ' --> Chemical species, fixed : ', cs_fixed 1919 WRITE ( io, * ) ' --> Total number of reactions : ', nreact 1920 WRITE ( io, * ) ' --> Gas phase chemistry solver : ', icntrl(3) 1921 WRITE ( io, * ) ' --> Vector length (vector mode if > 1): ', vl_dim 1936 1922 1937 1923 … … 1939 1925 2 FORMAT (' --> Chemical reactions are turned on') 1940 1926 3 FORMAT (' --> Chemical reactions are turned off') 1941 4 FORMAT (' --> Time-step for chemical species: ',F6.2, ' s') 1927 4 FORMAT (' --> Legacy emission read mode: ',L3,/, & 1928 ' All emissions data will be loaded prior to start of simulation') 1942 1929 5 FORMAT (' --> Emission mode = DEFAULT ') 1943 6 FORMAT (' --> Emission mode = PARAMETERIZED ')1944 7 FORMAT (' --> Emission mode = PRE-PROCESSED ')1930 6 FORMAT (' --> Emission mode = PARAMETERIZED (LOD 0)') 1931 7 FORMAT (' --> Emission mode = PRE-PROCESSED (LOD 2)') 1945 1932 8 FORMAT (' --> Photolysis scheme used = simple ') 1946 1933 9 FORMAT (' --> Photolysis scheme used = constant ') 1947 1934 10 FORMAT (/' ',A) 1948 1935 11 FORMAT (/' ',A) 1949 12 FORMAT (/' Nesting for chemistry variables: ', L1 )1950 13 FORMAT (/' Offline nesting for chemistry variables: ', L1 )1951 14 FORMAT (/' Boundary conditions for chemical species:', / &1952 ' bottom/top: ',A10,' / ',A10, / &1953 ' north/south: ',A10,' / ',A10, / &1954 ' left/right: ',A10,' / ',A10)1936 12 FORMAT (/' Self nesting for chemistry variables (if nested_run): ', L1 ) 1937 13 FORMAT (/' Offline nesting for chemistry variables : ', L1 ) 1938 14 FORMAT (/' Boundary conditions for chemical species:', / & 1939 ' bottom/top: ',A10,' / ',A10, / & 1940 ' north/south: ',A10,' / ',A10, / & 1941 ' left/right: ',A10,' / ',A10) 1955 1942 1956 1943 END SUBROUTINE chem_header … … 2126 2113 2127 2114 ! 2128 !-- For some passive scalars decycling may be enabled. This case, the lateral boundary conditions2129 !-- are non-cyclic for these scalars (chemical species and aerosols), while the other scalars may2130 !-- have cyclic boundary conditions. However, large gradients near the boundaries may produce2131 !-- stationary numericaloscillations near the lateral boundaries when a higher-order scheme is2115 !-- For chemistry variables lateral boundary conditions can be set non-cyclic while 2116 !-- the other scalars may have cyclic boundary conditions. 2117 !-- However, large gradients near the boundaries may produce stationary numerical 2118 !-- oscillations near the lateral boundaries when a higher-order scheme is 2132 2119 !-- applied near these boundaries. 2133 2120 !-- To get rid-off this, set-up additional flags that control the order of the scalar advection 2134 !-- scheme near the lateral boundaries for passive scalars with decycling.2121 !-- scheme near the lateral boundaries for passive scalars with non-cyclic bcs 2135 2122 IF ( scalar_advec == 'ws-scheme' ) THEN 2136 2123 ALLOCATE( cs_advc_flags_s(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 2137 2124 ! 2138 !-- In case of decyling, set Neumann boundary conditions for wall_flags_total_0 bit 31 instead of 2139 !-- cyclic boundary conditions. 2140 !-- Bit 31 is used to identify extended degradation zones (please see following comment). 2125 !-- In case of non-cyclic boundary conditions set wall_flags_total_0 bit 31 2126 !-- Bit 31 is used to identify extended degradation zones. 2141 2127 !-- Note, since several also other modules like Salsa or other future one may access this bit but 2142 2128 !-- may have other boundary conditions, the original value of wall_flags_total_0 bit 31 must not … … 2613 2599 2614 2600 ! 2615 ! For reference (ecc)2616 ! IF ( (mode_emis /= 'PARAMETERIZED') .AND. ( mode_emis /= 'DEFAULT' ) .AND. ( mode_emis /= 'PRE-PROCESSED' ) ) THEN2617 ! message_string = 'Incorrect mode_emiss option select. Please check spelling'2618 ! CALL message( 'chem_parin', 'PA0731', 1, 2, 0, 6, 0 )2619 ! ENDIF2620 2621 !2622 2601 !-- Conflict resolution for emiss_lod and mode_emis 2623 2602 !-- 1) if emiss_lod is defined, have mode_emis assume same setting as emiss_lod … … 2629 2608 2630 2609 SELECT CASE ( emiss_lod ) 2610 ! 2611 !-- Synchronize mode_emis to defined emiss_lod (mode_emis will be depreciated in future releases) 2631 2612 CASE (0) !- parameterized mode 2632 2613 mode_emis = 'PARAMETERIZED' … … 2636 2617 mode_emis = 'PRE-PROCESSED' 2637 2618 END SELECT 2638 2639 message_string = 'Synchronizing mode_emis to defined emiss_lod&' // &2640 'NOTE - mode_emis will be depreciated in future releases&' // &2641 'please use emiss_lod to define emission mode'2642 CALL message( 'chem_parin', 'PA0733', 0, 0, 0, 6, 0 )2643 2619 2644 2620 ELSE ! if emiss_lod is not set … … 2742 2718 END IF 2743 2719 2744 !2745 !-- todo: remove or replace by "CALL message" mechanism (kanani)2746 ! write(text,*) 'gas_phase chemistry: solver_type = ',TRIM( solver_type )2747 !kk Has to be changed to right calling sequence2748 ! IF(myid == 0) THEN2749 ! write(9,*) ' '2750 ! write(9,*) 'kpp setup '2751 ! write(9,*) ' '2752 ! write(9,*) ' gas_phase chemistry: solver_type = ',TRIM( solver_type )2753 ! write(9,*) ' '2754 ! write(9,*) ' Hstart = ',rcntrl(3)2755 ! write(9,*) ' FacMin = ',rcntrl(4)2756 ! write(9,*) ' FacMax = ',rcntrl(5)2757 ! write(9,*) ' '2758 ! IF(vl_dim > 1) THEN2759 ! write(9,*) ' Vector mode vektor length = ',vl_dim2760 ! ELSE2761 ! write(9,*) ' Scalar mode'2762 ! ENDIF2763 ! write(9,*) ' '2764 ! END IF2765 2766 2720 RETURN 2767 2721 … … 2893 2847 ! 2894 2848 !-- Calculation of chemical reactions and deposition. 2895 !-- !> TODO 2896 !-- WARNING: time measurements within i,j loops degrade performance because cpu-log routine is 2897 !-- called extremely often. Furthermore, because of that, the counter for this measurement 2898 !-- will get an extremely huge value, too. 2899 !-- Should be removed, because in other _ij routines no measurements are done because of 2900 !-- the reasons given above. 2849 !-- It would have been nice to have time measurements for chemistry and deposition here. 2850 !-- Unfortunately measurements within i,j loops degrade performance ince they are calles so often 2851 !-- and the counter for this measurement gets extremely huge values. Therefore, no measurements here. 2901 2852 IF ( intermediate_timestep_count == 1 .OR. call_chem_at_all_substeps ) THEN 2902 2853 2903 2854 IF ( chem_gasphase_on ) THEN 2904 2855 !$OMP MASTER 2905 CALL cpu_log( log_point_s(19), 'chem.reactions', 'start' )2906 2856 !$OMP END MASTER 2907 2857 CALL chem_integrate( i, j ) 2908 2858 !$OMP MASTER 2909 CALL cpu_log( log_point_s(19), 'chem.reactions', 'stop' )2910 2859 !$OMP END MASTER 2911 2860 ENDIF … … 2913 2862 IF ( deposition_dry ) THEN 2914 2863 !$OMP MASTER 2915 CALL cpu_log( log_point_s(24), 'chem.deposition', 'start' )2916 2864 !$OMP END MASTER 2917 2865 CALL chem_depo( i, j ) 2918 2866 !$OMP MASTER 2919 CALL cpu_log( log_point_s(24), 'chem.deposition', 'stop' )2920 2867 !$OMP END MASTER 2921 2868 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.