Changeset 4273 for palm/trunk/SOURCE
- Timestamp:
- Oct 24, 2019 1:40:54 PM (5 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/chem_modules.f90
r4182 r4273 27 27 ! ----------------- 28 28 ! $Id$ 29 ! Add logical switches nesting_chem and nesting_offline_chem (both .TRUE. 30 ! by default) 31 ! 32 ! 4182 2019-08-22 15:20:23Z scharf 29 33 ! Corrected "Former revisions" section 30 34 ! … … 134 138 LOGICAL :: emissions_anthropogenic = .FALSE. !< namelist parameter: flag for turning on anthropogenic emissions 135 139 LOGICAL :: emission_output_required = .TRUE. !< internal flag for requiring emission outputs 140 LOGICAL :: nesting_chem = .TRUE. !< apply self-nesting for the chemistry model 141 LOGICAL :: nesting_offline_chem = .TRUE. !< apply offline nesting for the chemistry model 136 142 137 143 REAL(wp) :: cs_surface_initial_change(99) = 0.0_wp !< namelist parameter: ...??? -
palm/trunk/SOURCE/chemistry_model_mod.f90
r4272 r4273 27 27 ! ----------------- 28 28 ! $Id$ 29 ! Add logical switches nesting_chem and nesting_offline_chem (both .TRUE. 30 ! by default) 31 ! 32 ! 4272 2019-10-23 15:18:57Z schwenkel 29 33 ! Further modularization of boundary conditions: moved boundary conditions to 30 34 ! respective modules … … 859 863 SUBROUTINE chem_boundary_conds_decycle( cs_3d, cs_pr_init ) 860 864 861 862 INTEGER(iwp) :: boundary !< 863 INTEGER(iwp) :: ee !< 864 INTEGER(iwp) :: copied !< 865 INTEGER(iwp) :: i !< 866 INTEGER(iwp) :: j !< 867 INTEGER(iwp) :: k !< 868 INTEGER(iwp) :: ss !< 869 870 REAL(wp), DIMENSION(nzb:nzt+1) :: cs_pr_init 871 REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) :: cs_3d 872 REAL(wp) :: flag !< flag to mask topography grid points 873 874 875 flag = 0.0_wp 876 ! 877 !-- Left and right boundaries 878 IF ( decycle_chem_lr .AND. bc_lr_cyc ) THEN 879 880 DO boundary = 1, 2 881 882 IF ( decycle_method(boundary) == 'dirichlet' ) THEN 883 ! 884 !-- Initial profile is copied to ghost and first three layers 885 ss = 1 886 ee = 0 887 IF ( boundary == 1 .AND. nxl == 0 ) THEN 888 ss = nxlg 889 ee = nxl-1 890 ELSEIF ( boundary == 2 .AND. nxr == nx ) THEN 891 ss = nxr+1 892 ee = nxrg 893 ENDIF 894 895 DO i = ss, ee 896 DO j = nysg, nyng 897 DO k = nzb+1, nzt 898 flag = MERGE( 1.0_wp, 0.0_wp, & 899 BTEST( wall_flags_0(k,j,i), 0 ) ) 900 cs_3d(k,j,i) = cs_pr_init(k) * flag 901 ENDDO 902 ENDDO 903 ENDDO 904 905 ELSEIF ( decycle_method(boundary) == 'neumann' ) THEN 906 ! 907 !-- The value at the boundary is copied to the ghost layers to simulate 908 !-- an outlet with zero gradient 909 ss = 1 910 ee = 0 911 IF ( boundary == 1 .AND. nxl == 0 ) THEN 912 ss = nxlg 913 ee = nxl-1 914 copied = nxl 915 ELSEIF ( boundary == 2 .AND. nxr == nx ) THEN 916 ss = nxr+1 917 ee = nxrg 918 copied = nxr 919 ENDIF 920 921 DO i = ss, ee 922 DO j = nysg, nyng 923 DO k = nzb+1, nzt 924 flag = MERGE( 1.0_wp, 0.0_wp, & 925 BTEST( wall_flags_0(k,j,i), 0 ) ) 926 cs_3d(k,j,i) = cs_3d(k,j,copied) * flag 927 ENDDO 928 ENDDO 929 ENDDO 930 931 ELSE 932 WRITE(message_string,*) & 933 'unknown decycling method: decycle_method (', & 934 boundary, ') ="' // TRIM( decycle_method(boundary) ) // '"' 935 CALL message( 'chem_boundary_conds_decycle', 'CM0431', & 936 1, 2, 0, 6, 0 ) 937 ENDIF 938 ENDDO 939 ENDIF 940 ! 941 !-- South and north boundaries 942 IF ( decycle_chem_ns .AND. bc_ns_cyc ) THEN 943 944 DO boundary = 3, 4 945 946 IF ( decycle_method(boundary) == 'dirichlet' ) THEN 947 ! 948 !-- Initial profile is copied to ghost and first three layers 949 ss = 1 950 ee = 0 951 IF ( boundary == 3 .AND. nys == 0 ) THEN 952 ss = nysg 953 ee = nys-1 954 ELSEIF ( boundary == 4 .AND. nyn == ny ) THEN 955 ss = nyn+1 956 ee = nyng 957 ENDIF 958 959 DO i = nxlg, nxrg 960 DO j = ss, ee 961 DO k = nzb+1, nzt 962 flag = MERGE( 1.0_wp, 0.0_wp, & 963 BTEST( wall_flags_0(k,j,i), 0 ) ) 964 cs_3d(k,j,i) = cs_pr_init(k) * flag 965 ENDDO 966 ENDDO 967 ENDDO 968 969 970 ELSEIF ( decycle_method(boundary) == 'neumann' ) THEN 971 ! 972 !-- The value at the boundary is copied to the ghost layers to simulate 973 !-- an outlet with zero gradient 974 ss = 1 975 ee = 0 976 IF ( boundary == 3 .AND. nys == 0 ) THEN 977 ss = nysg 978 ee = nys-1 979 copied = nys 980 ELSEIF ( boundary == 4 .AND. nyn == ny ) THEN 981 ss = nyn+1 982 ee = nyng 983 copied = nyn 984 ENDIF 985 986 DO i = nxlg, nxrg 987 DO j = ss, ee 988 DO k = nzb+1, nzt 989 flag = MERGE( 1.0_wp, 0.0_wp, & 990 BTEST( wall_flags_0(k,j,i), 0 ) ) 991 cs_3d(k,j,i) = cs_3d(k,copied,i) * flag 992 ENDDO 993 ENDDO 994 ENDDO 995 996 ELSE 997 WRITE(message_string,*) & 998 'unknown decycling method: decycle_method (', & 999 boundary, ') ="' // TRIM( decycle_method(boundary) ) // '"' 1000 CALL message( 'chem_boundary_conds_decycle', 'CM0432', & 1001 1, 2, 0, 6, 0 ) 1002 ENDIF 1003 ENDDO 1004 ENDIF 865 USE control_parameters, & 866 ONLY: nesting_offline 867 868 INTEGER(iwp) :: boundary !< 869 INTEGER(iwp) :: ee !< 870 INTEGER(iwp) :: copied !< 871 INTEGER(iwp) :: i !< 872 INTEGER(iwp) :: j !< 873 INTEGER(iwp) :: k !< 874 INTEGER(iwp) :: ss !< 875 876 REAL(wp), DIMENSION(nzb:nzt+1) :: cs_pr_init 877 REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) :: cs_3d 878 REAL(wp) :: flag !< flag to mask topography grid points 879 880 881 flag = 0.0_wp 882 ! 883 !-- Skip input if forcing from a larger-scale model is applied 884 IF ( nesting_offline .AND. nesting_offline_chem ) RETURN 885 ! 886 !-- Left and right boundaries 887 IF ( decycle_chem_lr .AND. bc_lr_cyc ) THEN 888 889 DO boundary = 1, 2 890 891 IF ( decycle_method(boundary) == 'dirichlet' ) THEN 892 ! 893 !-- Initial profile is copied to ghost and first three layers 894 ss = 1 895 ee = 0 896 IF ( boundary == 1 .AND. nxl == 0 ) THEN 897 ss = nxlg 898 ee = nxl-1 899 ELSEIF ( boundary == 2 .AND. nxr == nx ) THEN 900 ss = nxr+1 901 ee = nxrg 902 ENDIF 903 904 DO i = ss, ee 905 DO j = nysg, nyng 906 DO k = nzb+1, nzt 907 flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 0 ) ) 908 cs_3d(k,j,i) = cs_pr_init(k) * flag 909 ENDDO 910 ENDDO 911 ENDDO 912 913 ELSEIF ( decycle_method(boundary) == 'neumann' ) THEN 914 ! 915 !-- The value at the boundary is copied to the ghost layers to simulate 916 !-- an outlet with zero gradient 917 ss = 1 918 ee = 0 919 IF ( boundary == 1 .AND. nxl == 0 ) THEN 920 ss = nxlg 921 ee = nxl-1 922 copied = nxl 923 ELSEIF ( boundary == 2 .AND. nxr == nx ) THEN 924 ss = nxr+1 925 ee = nxrg 926 copied = nxr 927 ENDIF 928 929 DO i = ss, ee 930 DO j = nysg, nyng 931 DO k = nzb+1, nzt 932 flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 0 ) ) 933 cs_3d(k,j,i) = cs_3d(k,j,copied) * flag 934 ENDDO 935 ENDDO 936 ENDDO 937 938 ELSE 939 WRITE(message_string,*) & 940 'unknown decycling method: decycle_method (', & 941 boundary, ') ="' // TRIM( decycle_method(boundary) ) // '"' 942 CALL message( 'chem_boundary_conds_decycle', 'CM0431', & 943 1, 2, 0, 6, 0 ) 944 ENDIF 945 ENDDO 946 ENDIF 947 ! 948 !-- South and north boundaries 949 IF ( decycle_chem_ns .AND. bc_ns_cyc ) THEN 950 951 DO boundary = 3, 4 952 953 IF ( decycle_method(boundary) == 'dirichlet' ) THEN 954 ! 955 !-- Initial profile is copied to ghost and first three layers 956 ss = 1 957 ee = 0 958 IF ( boundary == 3 .AND. nys == 0 ) THEN 959 ss = nysg 960 ee = nys-1 961 ELSEIF ( boundary == 4 .AND. nyn == ny ) THEN 962 ss = nyn+1 963 ee = nyng 964 ENDIF 965 966 DO i = nxlg, nxrg 967 DO j = ss, ee 968 DO k = nzb+1, nzt 969 flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 0 ) ) 970 cs_3d(k,j,i) = cs_pr_init(k) * flag 971 ENDDO 972 ENDDO 973 ENDDO 974 975 976 ELSEIF ( decycle_method(boundary) == 'neumann' ) THEN 977 ! 978 !-- The value at the boundary is copied to the ghost layers to simulate 979 !-- an outlet with zero gradient 980 ss = 1 981 ee = 0 982 IF ( boundary == 3 .AND. nys == 0 ) THEN 983 ss = nysg 984 ee = nys-1 985 copied = nys 986 ELSEIF ( boundary == 4 .AND. nyn == ny ) THEN 987 ss = nyn+1 988 ee = nyng 989 copied = nyn 990 ENDIF 991 992 DO i = nxlg, nxrg 993 DO j = ss, ee 994 DO k = nzb+1, nzt 995 flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 0 ) ) 996 cs_3d(k,j,i) = cs_3d(k,copied,i) * flag 997 ENDDO 998 ENDDO 999 ENDDO 1000 1001 ELSE 1002 WRITE(message_string,*) & 1003 'unknown decycling method: decycle_method (', & 1004 boundary, ') ="' // TRIM( decycle_method(boundary) ) // '"' 1005 CALL message( 'chem_boundary_conds_decycle', 'CM0432', & 1006 1, 2, 0, 6, 0 ) 1007 ENDIF 1008 ENDDO 1009 ENDIF 1005 1010 1006 1011 … … 1175 1180 message_string = 'Incorrect chemistry mechanism selected, check spelling in namelist and/or chem_gasphase_mod' 1176 1181 CALL message( 'chem_check_parameters', 'CM0462', 1, 2, 0, 6, 0 ) 1182 ENDIF 1183 ! 1184 !-- If nesting_chem = .F., set top boundary condition to its default value 1185 IF ( .NOT. nesting_chem .AND. ibc_cs_t == 3 ) THEN 1186 ibc_cs_t = 2 1187 bc_cs_t = 'initial_gradient' 1177 1188 ENDIF 1178 1189 ! … … 1681 1692 WRITE ( io, 11 ) docsinit_chr 1682 1693 ENDIF 1694 1695 IF ( nesting_chem ) WRITE( io, 12 ) nesting_chem 1696 IF ( nesting_offline_chem ) WRITE( io, 13 ) nesting_offline_chem 1683 1697 ! 1684 1698 !-- number of variable and fix chemical species and number of reactions … … 1703 1717 10 FORMAT (/' ',A) 1704 1718 11 FORMAT (/' ',A) 1719 12 FORMAT (/' Nesting for chemistry variables: ', L1 ) 1720 13 FORMAT (/' Offline nesting for chemistry variables: ', L1 ) 1705 1721 ! 1706 1722 ! … … 2267 2283 mode_emis, & 2268 2284 my_steps, & 2285 nesting_chem, & 2286 nesting_offline_chem, & 2269 2287 rcntrl, & 2270 2288 side_street_id, & -
palm/trunk/SOURCE/nesting_offl_mod.f90
r4270 r4273 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Add a logical switch nesting_offline_chem 28 ! 29 ! 4270 2019-10-23 10:46:20Z monakurppa 27 30 ! Implement offline nesting for salsa variables. 28 31 ! … … 139 142 ONLY: g, & 140 143 pi 141 144 142 145 USE chem_modules, & 143 ONLY: chem_species 146 ONLY: chem_species, nesting_offline_chem 144 147 145 148 USE control_parameters, & … … 170 173 time_since_reference_point, & 171 174 volume_flow 172 175 173 176 USE cpulog, & 174 177 ONLY: cpu_log, & … … 520 523 .TRUE. ) 521 524 ENDIF 522 523 IF ( air_chemistry ) THEN525 526 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 524 527 DO n = 1, UBOUND(nest_offl%var_names_chem_l, 1) 525 528 IF ( check_existence( nest_offl%var_names, & 526 nest_offl%var_names_chem_l(n) ) ) THEN 529 nest_offl%var_names_chem_l(n) ) ) THEN 527 530 CALL get_variable( pids_id, & 528 531 TRIM( nest_offl%var_names_chem_l(n) ), & … … 594 597 .TRUE. ) 595 598 ENDIF 596 597 IF ( air_chemistry ) THEN599 600 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 598 601 DO n = 1, UBOUND(nest_offl%var_names_chem_r, 1) 599 602 IF ( check_existence( nest_offl%var_names, & 600 nest_offl%var_names_chem_r(n) ) ) THEN 603 nest_offl%var_names_chem_r(n) ) ) THEN 601 604 CALL get_variable( pids_id, & 602 605 TRIM( nest_offl%var_names_chem_r(n) ), & … … 623 626 MERGE( nest_offl%nzu, 0, bc_dirichlet_n ), & ! number of time steps (2 or 0) 624 627 MERGE( 2, 0, bc_dirichlet_n ), & ! parallel IO when compiled accordingly 625 .TRUE. ) 626 628 .TRUE. ) 629 627 630 CALL get_variable( pids_id, 'ls_forcing_north_v', & ! array to be read 628 631 nest_offl%v_north, & ! start index x direction … … 633 636 MERGE( nest_offl%nzu, 0, bc_dirichlet_n ), & ! number of time steps (2 or 0) 634 637 MERGE( 2, 0, bc_dirichlet_n ), & ! parallel IO when compiled accordingly 635 .TRUE. ) 636 638 .TRUE. ) 639 637 640 CALL get_variable( pids_id, 'ls_forcing_north_w', & ! array to be read 638 641 nest_offl%w_north, & ! start index x direction … … 643 646 MERGE( nest_offl%nzw, 0, bc_dirichlet_n ), & ! number of time steps (2 or 0) 644 647 MERGE( 2, 0, bc_dirichlet_n ), & ! parallel IO when compiled accordingly 645 .TRUE. ) 646 647 IF ( .NOT. neutral ) THEN 648 .TRUE. ) 649 650 IF ( .NOT. neutral ) THEN 648 651 CALL get_variable( pids_id, 'ls_forcing_north_pt', & ! array to be read 649 652 nest_offl%pt_north, & ! start index x direction … … 654 657 MERGE( nest_offl%nzu, 0, bc_dirichlet_n ), & ! number of time steps (2 or 0) 655 658 MERGE( 2, 0, bc_dirichlet_n ), & ! parallel IO when compiled accordingly 656 .TRUE. ) 657 ENDIF 658 IF ( humidity ) THEN 659 .TRUE. ) 660 ENDIF 661 IF ( humidity ) THEN 659 662 CALL get_variable( pids_id, 'ls_forcing_north_qv', & ! array to be read 660 663 nest_offl%q_north, & ! start index x direction … … 665 668 MERGE( nest_offl%nzu, 0, bc_dirichlet_n ), & ! number of time steps (2 or 0) 666 669 MERGE( 2, 0, bc_dirichlet_n ), & ! parallel IO when compiled accordingly 667 .TRUE. ) 668 ENDIF 669 670 IF ( air_chemistry ) THEN671 DO n = 1, UBOUND(nest_offl%var_names_chem_n, 1) 670 .TRUE. ) 671 ENDIF 672 673 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 674 DO n = 1, UBOUND(nest_offl%var_names_chem_n, 1) 672 675 IF ( check_existence( nest_offl%var_names, & 673 nest_offl%var_names_chem_n(n) ) ) THEN 676 nest_offl%var_names_chem_n(n) ) ) THEN 674 677 CALL get_variable( pids_id, & 675 678 TRIM( nest_offl%var_names_chem_n(n) ), & … … 696 699 MERGE( nest_offl%nzu, 0, bc_dirichlet_s ), & ! number of time steps (2 or 0) 697 700 MERGE( 2, 0, bc_dirichlet_s ), & ! parallel IO when compiled accordingly 698 .TRUE. ) 699 701 .TRUE. ) 702 700 703 CALL get_variable( pids_id, 'ls_forcing_south_v', & ! array to be read 701 704 nest_offl%v_south, & ! start index x direction … … 706 709 MERGE( nest_offl%nzu, 0, bc_dirichlet_s ), & ! number of time steps (2 or 0) 707 710 MERGE( 2, 0, bc_dirichlet_s ), & ! parallel IO when compiled accordingly 708 .TRUE. ) 709 711 .TRUE. ) 712 710 713 CALL get_variable( pids_id, 'ls_forcing_south_w', & ! array to be read 711 714 nest_offl%w_south, & ! start index x direction … … 716 719 MERGE( nest_offl%nzw, 0, bc_dirichlet_s ), & ! number of time steps (2 or 0) 717 720 MERGE( 2, 0, bc_dirichlet_s ), & ! parallel IO when compiled accordingly 718 .TRUE. ) 719 720 IF ( .NOT. neutral ) THEN 721 .TRUE. ) 722 723 IF ( .NOT. neutral ) THEN 721 724 CALL get_variable( pids_id, 'ls_forcing_south_pt', & ! array to be read 722 725 nest_offl%pt_south, & ! start index x direction … … 727 730 MERGE( nest_offl%nzu, 0, bc_dirichlet_s ), & ! number of time steps (2 or 0) 728 731 MERGE( 2, 0, bc_dirichlet_s ), & ! parallel IO when compiled accordingly 729 .TRUE. ) 730 ENDIF 731 IF ( humidity ) THEN 732 .TRUE. ) 733 ENDIF 734 IF ( humidity ) THEN 732 735 CALL get_variable( pids_id, 'ls_forcing_south_qv', & ! array to be read 733 736 nest_offl%q_south, & ! start index x direction … … 738 741 MERGE( nest_offl%nzu, 0, bc_dirichlet_s ), & ! number of time steps (2 or 0) 739 742 MERGE( 2, 0, bc_dirichlet_s ), & ! parallel IO when compiled accordingly 740 .TRUE. ) 741 ENDIF 742 743 IF ( air_chemistry ) THEN744 DO n = 1, UBOUND(nest_offl%var_names_chem_s, 1) 743 .TRUE. ) 744 ENDIF 745 746 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 747 DO n = 1, UBOUND(nest_offl%var_names_chem_s, 1) 745 748 IF ( check_existence( nest_offl%var_names, & 746 nest_offl%var_names_chem_s(n) ) ) THEN 749 nest_offl%var_names_chem_s(n) ) ) THEN 747 750 CALL get_variable( pids_id, & 748 751 TRIM( nest_offl%var_names_chem_s(n) ), & … … 770 773 nxl+1, nysv, nest_offl%tind+1, & 771 774 nxr-nxl+1, nyn-nysv+1, 2, .TRUE. ) 772 775 773 776 CALL get_variable( pids_id, 'ls_forcing_top_w', & 774 777 nest_offl%w_top(0:1,nys:nyn,nxl:nxr), & 775 778 nxl+1, nys+1, nest_offl%tind+1, & 776 779 nxr-nxl+1, nyn-nys+1, 2, .TRUE. ) 777 780 778 781 IF ( .NOT. neutral ) THEN 779 782 CALL get_variable( pids_id, 'ls_forcing_top_pt', & … … 788 791 nxr-nxl+1, nyn-nys+1, 2, .TRUE. ) 789 792 ENDIF 790 791 IF ( air_chemistry ) THEN793 794 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 792 795 DO n = 1, UBOUND(nest_offl%var_names_chem_t, 1) 793 796 IF ( check_existence( nest_offl%var_names, & 794 nest_offl%var_names_chem_t(n) ) ) THEN 797 nest_offl%var_names_chem_t(n) ) ) THEN 795 798 CALL get_variable( pids_id, & 796 799 TRIM( nest_offl%var_names_chem_t(n) ), & … … 961 964 u_ref = 0.0_wp 962 965 v_ref = 0.0_wp 963 966 964 967 pt_ref_l = 0.0_wp 965 968 q_ref_l = 0.0_wp … … 968 971 ! 969 972 !-- If required, allocate temporary arrays to compute chemistry mean profiles 970 IF ( air_chemistry ) THEN973 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 971 974 ALLOCATE( ref_chem(nzb:nzt+1,1:UBOUND( chem_species, 1 ) ) ) 972 975 ALLOCATE( ref_chem_l(nzb:nzt+1,1:UBOUND( chem_species, 1 ) ) ) … … 1043 1046 ENDDO 1044 1047 ENDIF 1045 1046 IF ( air_chemistry ) THEN1048 1049 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 1047 1050 DO n = 1, UBOUND( chem_species, 1 ) 1048 IF ( nest_offl%chem_from_file_l(n) ) THEN 1051 IF ( nest_offl%chem_from_file_l(n) ) THEN 1049 1052 DO j = nys, nyn 1050 1053 DO k = nzb+1, nzt … … 1121 1124 ENDDO 1122 1125 ENDIF 1123 1124 IF ( air_chemistry ) THEN1126 1127 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 1125 1128 DO n = 1, UBOUND( chem_species, 1 ) 1126 IF ( nest_offl%chem_from_file_r(n) ) THEN 1129 IF ( nest_offl%chem_from_file_r(n) ) THEN 1127 1130 DO j = nys, nyn 1128 1131 DO k = nzb+1, nzt … … 1202 1205 ENDDO 1203 1206 ENDIF 1204 1205 IF ( air_chemistry ) THEN1207 1208 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 1206 1209 DO n = 1, UBOUND( chem_species, 1 ) 1207 IF ( nest_offl%chem_from_file_s(n) ) THEN 1210 IF ( nest_offl%chem_from_file_s(n) ) THEN 1208 1211 DO i = nxl, nxr 1209 1212 DO k = nzb+1, nzt … … 1282 1285 ENDDO 1283 1286 ENDIF 1284 1285 IF ( air_chemistry ) THEN1287 1288 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 1286 1289 DO n = 1, UBOUND( chem_species, 1 ) 1287 IF ( nest_offl%chem_from_file_n(n) ) THEN 1290 IF ( nest_offl%chem_from_file_n(n) ) THEN 1288 1291 DO i = nxl, nxr 1289 1292 DO k = nzb+1, nzt … … 1368 1371 ENDDO 1369 1372 ENDIF 1370 1371 IF ( air_chemistry ) THEN1373 1374 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 1372 1375 DO n = 1, UBOUND( chem_species, 1 ) 1373 IF ( nest_offl%chem_from_file_t(n) ) THEN 1376 IF ( nest_offl%chem_from_file_t(n) ) THEN 1374 1377 DO i = nxl, nxr 1375 1378 DO j = nys, nyn … … 1413 1416 IF ( .NOT. neutral ) CALL exchange_horiz( pt, nbgp ) 1414 1417 IF ( humidity ) CALL exchange_horiz( q, nbgp ) 1415 IF ( air_chemistry ) THEN1418 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 1416 1419 DO n = 1, UBOUND( chem_species, 1 ) 1417 1420 ! … … 1447 1450 comm2d, ierr ) 1448 1451 ENDIF 1449 IF ( air_chemistry ) THEN1452 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 1450 1453 CALL MPI_ALLREDUCE( ref_chem_l, ref_chem, & 1451 1454 ( nzt+1-nzb+1 ) * SIZE( ref_chem(nzb,:) ), & … … 1457 1460 IF ( humidity ) q_ref = q_ref_l 1458 1461 IF ( .NOT. neutral ) pt_ref = pt_ref_l 1459 IF ( air_chemistry ) ref_chem = ref_chem_l1462 IF ( air_chemistry .AND. nesting_offline_chem ) ref_chem = ref_chem_l 1460 1463 #endif 1461 1464 ! … … 1476 1479 ( ny + 1 + nx + 1 ), & 1477 1480 KIND = wp ) 1478 IF ( air_chemistry )&1481 IF ( air_chemistry .AND. nesting_offline_chem ) & 1479 1482 ref_chem(nzb:nzt,:) = ref_chem(nzb:nzt,:) / REAL( 2.0_wp * & 1480 1483 ( ny + 1 + nx + 1 ), & … … 1490 1493 pt_ref(nzt+1) = pt_ref(nzt+1) / REAL( ( ny + 1 ) * ( nx + 1 ), & 1491 1494 KIND = wp ) 1492 IF ( air_chemistry )&1495 IF ( air_chemistry .AND. nesting_offline_chem ) & 1493 1496 ref_chem(nzt+1,:) = ref_chem(nzt+1,:) / & 1494 1497 REAL( ( ny + 1 ) * ( nx + 1 ),KIND = wp ) … … 1508 1511 ENDIF 1509 1512 1510 IF ( air_chemistry ) THEN1513 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 1511 1514 DO n = 1, UBOUND( chem_species, 1 ) 1512 1515 IF ( nest_offl%chem_from_file_t(n) ) THEN … … 1519 1522 1520 1523 IF ( ALLOCATED( ref_chem ) ) DEALLOCATE( ref_chem ) 1521 IF ( ALLOCATED( ref_chem_l ) ) DEALLOCATE( ref_chem_l ) 1524 IF ( ALLOCATED( ref_chem_l ) ) DEALLOCATE( ref_chem_l ) 1522 1525 ! 1523 1526 !-- Further, adjust Rayleigh damping height in case of time-changing conditions. … … 1525 1528 CALL nesting_offl_calc_zi 1526 1529 CALL adjust_sponge_layer 1527 1530 1528 1531 CALL cpu_log( log_point(58), 'offline nesting', 'stop' ) 1529 1532 … … 1893 1896 IF ( humidity ) ALLOCATE( nest_offl%q_left(0:1,nzb+1:nzt,nys:nyn) ) 1894 1897 IF ( .NOT. neutral ) ALLOCATE( nest_offl%pt_left(0:1,nzb+1:nzt,nys:nyn) ) 1895 IF ( air_chemistry ) ALLOCATE( nest_offl%chem_left(0:1,nzb+1:nzt,nys:nyn,&1896 1898 IF ( air_chemistry .AND. nesting_offline_chem ) & 1899 ALLOCATE( nest_offl%chem_left(0:1,nzb+1:nzt,nys:nyn,1:UBOUND( chem_species, 1 )) ) 1897 1900 ELSE 1898 1901 ALLOCATE( nest_offl%u_left(1:1,1:1,1:1) ) … … 1901 1904 IF ( humidity ) ALLOCATE( nest_offl%q_left(1:1,1:1,1:1) ) 1902 1905 IF ( .NOT. neutral ) ALLOCATE( nest_offl%pt_left(1:1,1:1,1:1) ) 1903 IF ( air_chemistry ) ALLOCATE( nest_offl%chem_left(1:1,1:1,1:1,&1904 1906 IF ( air_chemistry .AND. nesting_offline_chem ) & 1907 ALLOCATE( nest_offl%chem_left(1:1,1:1,1:1,1:UBOUND( chem_species, 1 )) ) 1905 1908 ENDIF 1906 1909 IF ( bc_dirichlet_r ) THEN … … 1910 1913 IF ( humidity ) ALLOCATE( nest_offl%q_right(0:1,nzb+1:nzt,nys:nyn) ) 1911 1914 IF ( .NOT. neutral ) ALLOCATE( nest_offl%pt_right(0:1,nzb+1:nzt,nys:nyn) ) 1912 IF ( air_chemistry ) ALLOCATE( nest_offl%chem_right(0:1,nzb+1:nzt,nys:nyn,&1913 1915 IF ( air_chemistry .AND. nesting_offline_chem ) & 1916 ALLOCATE( nest_offl%chem_right(0:1,nzb+1:nzt,nys:nyn,1:UBOUND( chem_species, 1 )) ) 1914 1917 ELSE 1915 1918 ALLOCATE( nest_offl%u_right(1:1,1:1,1:1) ) … … 1918 1921 IF ( humidity ) ALLOCATE( nest_offl%q_right(1:1,1:1,1:1) ) 1919 1922 IF ( .NOT. neutral ) ALLOCATE( nest_offl%pt_right(1:1,1:1,1:1) ) 1920 IF ( air_chemistry ) ALLOCATE( nest_offl%chem_right(1:1,1:1,1:1,&1921 1923 IF ( air_chemistry .AND. nesting_offline_chem ) & 1924 ALLOCATE( nest_offl%chem_right(1:1,1:1,1:1,1:UBOUND( chem_species, 1 )) ) 1922 1925 ENDIF 1923 1926 ! … … 1932 1935 IF ( humidity ) ALLOCATE( nest_offl%q_north(0:1,nzb+1:nzt,nxl:nxr) ) 1933 1936 IF ( .NOT. neutral ) ALLOCATE( nest_offl%pt_north(0:1,nzb+1:nzt,nxl:nxr) ) 1934 IF ( air_chemistry ) ALLOCATE( nest_offl%chem_north(0:1,nzb+1:nzt,nxl:nxr,&1935 1937 IF ( air_chemistry .AND. nesting_offline_chem ) & 1938 ALLOCATE( nest_offl%chem_north(0:1,nzb+1:nzt,nxl:nxr,1:UBOUND( chem_species, 1 )) ) 1936 1939 ELSE 1937 1940 ALLOCATE( nest_offl%u_north(1:1,1:1,1:1) ) … … 1940 1943 IF ( humidity ) ALLOCATE( nest_offl%q_north(1:1,1:1,1:1) ) 1941 1944 IF ( .NOT. neutral ) ALLOCATE( nest_offl%pt_north(1:1,1:1,1:1) ) 1942 IF ( air_chemistry ) ALLOCATE( nest_offl%chem_north(1:1,1:1,1:1,&1943 1945 IF ( air_chemistry .AND. nesting_offline_chem ) & 1946 ALLOCATE( nest_offl%chem_north(1:1,1:1,1:1,1:UBOUND( chem_species, 1 )) ) 1944 1947 ENDIF 1945 1948 IF ( bc_dirichlet_s ) THEN … … 1949 1952 IF ( humidity ) ALLOCATE( nest_offl%q_south(0:1,nzb+1:nzt,nxl:nxr) ) 1950 1953 IF ( .NOT. neutral ) ALLOCATE( nest_offl%pt_south(0:1,nzb+1:nzt,nxl:nxr) ) 1951 IF ( air_chemistry ) ALLOCATE( nest_offl%chem_south(0:1,nzb+1:nzt,nxl:nxr,&1952 1954 IF ( air_chemistry .AND. nesting_offline_chem ) & 1955 ALLOCATE( nest_offl%chem_south(0:1,nzb+1:nzt,nxl:nxr,1:UBOUND( chem_species, 1 )) ) 1953 1956 ELSE 1954 1957 ALLOCATE( nest_offl%u_south(1:1,1:1,1:1) ) … … 1957 1960 IF ( humidity ) ALLOCATE( nest_offl%q_south(1:1,1:1,1:1) ) 1958 1961 IF ( .NOT. neutral ) ALLOCATE( nest_offl%pt_south(1:1,1:1,1:1) ) 1959 IF ( air_chemistry ) ALLOCATE( nest_offl%chem_south(1:1,1:1,1:1,&1960 1962 IF ( air_chemistry .AND. nesting_offline_chem ) & 1963 ALLOCATE( nest_offl%chem_south(1:1,1:1,1:1,1:UBOUND( chem_species, 1 )) ) 1961 1964 ENDIF 1962 1965 ! … … 1969 1972 IF ( humidity ) ALLOCATE( nest_offl%q_top(0:1,nys:nyn,nxl:nxr) ) 1970 1973 IF ( .NOT. neutral ) ALLOCATE( nest_offl%pt_top(0:1,nys:nyn,nxl:nxr) ) 1971 IF ( air_chemistry ) ALLOCATE( nest_offl%chem_top(0:1,nys:nyn,nxl:nxr,&1972 1974 IF ( air_chemistry .AND. nesting_offline_chem ) & 1975 ALLOCATE( nest_offl%chem_top(0:1,nys:nyn,nxl:nxr,1:UBOUND( chem_species, 1 )) ) 1973 1976 ! 1974 1977 !-- For chemical species, create the names of the variables. This is necessary 1975 1978 !-- to identify the respective variable and write it onto the correct array 1976 1979 !-- in the chem_species datatype. 1977 IF ( air_chemistry ) THEN1980 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 1978 1981 ALLOCATE( nest_offl%chem_from_file_l(1:UBOUND( chem_species, 1 )) ) 1979 1982 ALLOCATE( nest_offl%chem_from_file_n(1:UBOUND( chem_species, 1 )) ) … … 1981 1984 ALLOCATE( nest_offl%chem_from_file_s(1:UBOUND( chem_species, 1 )) ) 1982 1985 ALLOCATE( nest_offl%chem_from_file_t(1:UBOUND( chem_species, 1 )) ) 1983 1986 1984 1987 ALLOCATE( nest_offl%var_names_chem_l(1:UBOUND( chem_species, 1 )) ) 1985 1988 ALLOCATE( nest_offl%var_names_chem_n(1:UBOUND( chem_species, 1 )) ) … … 1995 1998 nest_offl%chem_from_file_s(:) = .FALSE. 1996 1999 nest_offl%chem_from_file_t(:) = .FALSE. 1997 2000 1998 2001 DO n = 1, UBOUND( chem_species, 1 ) 1999 2002 nest_offl%var_names_chem_l(n) = nest_offl%char_l // & … … 2054 2057 IF ( humidity ) q(nzb+1:nzt,nys:nyn,-1) = & 2055 2058 nest_offl%q_left(0,nzb+1:nzt,nys:nyn) 2056 IF ( air_chemistry ) THEN2059 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 2057 2060 DO n = 1, UBOUND( chem_species, 1 ) 2058 2061 IF( nest_offl%chem_from_file_l(n) ) THEN … … 2071 2074 IF ( humidity ) q(nzb+1:nzt,nys:nyn,nxr+1) = & 2072 2075 nest_offl%q_right(0,nzb+1:nzt,nys:nyn) 2073 IF ( air_chemistry ) THEN2076 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 2074 2077 DO n = 1, UBOUND( chem_species, 1 ) 2075 2078 IF( nest_offl%chem_from_file_r(n) ) THEN … … 2088 2091 IF ( humidity ) q(nzb+1:nzt,-1,nxl:nxr) = & 2089 2092 nest_offl%q_south(0,nzb+1:nzt,nxl:nxr) 2090 IF ( air_chemistry ) THEN2093 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 2091 2094 DO n = 1, UBOUND( chem_species, 1 ) 2092 2095 IF( nest_offl%chem_from_file_s(n) ) THEN … … 2105 2108 IF ( humidity ) q(nzb+1:nzt,nyn+1,nxl:nxr) = & 2106 2109 nest_offl%q_north(0,nzb+1:nzt,nxl:nxr) 2107 IF ( air_chemistry ) THEN2110 IF ( air_chemistry .AND. nesting_offline_chem ) THEN 2108 2111 DO n = 1, UBOUND( chem_species, 1 ) 2109 2112 IF( nest_offl%chem_from_file_n(n) ) THEN … … 2114 2117 ENDIF 2115 2118 ENDIF 2116 ! 2119 ! 2117 2120 !-- Initialize geostrophic wind components. Actually this is already done in 2118 2121 !-- init_3d_model when initializing_action = 'inifor', however, in speical … … 2121 2124 ug(nzb+1:nzt) = nest_offl%ug(0,nzb+1:nzt) 2122 2125 vg(nzb+1:nzt) = nest_offl%vg(0,nzb+1:nzt) 2123 ! 2126 ! 2124 2127 !-- Set bottom and top boundary condition for geostrophic wind components 2125 2128 ug(nzt+1) = ug(nzt) … … 2127 2130 ug(nzb) = ug(nzb+1) 2128 2131 vg(nzb) = vg(nzb+1) 2129 ENDIF 2132 ENDIF 2130 2133 ! 2131 2134 !-- After boundary data is initialized, mask topography at the -
palm/trunk/SOURCE/pmc_interface_mod.f90
r4260 r4273 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Add a logical switch nesting_chem and rename nest_salsa to nesting_salsa 28 ! 29 ! 4260 2019-10-09 14:04:03Z hellstea 27 30 ! Rest of the possibly round-off-error sensitive grid-line matching tests 28 31 ! changed to round-off-error tolerant forms throughout the module. … … 189 192 190 193 USE chem_modules, & 191 ONLY: chem_species 194 ONLY: chem_species, nesting_chem 192 195 193 196 USE chemistry_model_mod, & … … 248 251 USE salsa_mod, & 249 252 ONLY: aerosol_mass, aerosol_number, gconc_2, mconc_2, nbins_aerosol, & 250 ncomponents_mass, nconc_2, nest _salsa, ngases_salsa, salsa_gas,&251 salsa_gas es_from_chem253 ncomponents_mass, nconc_2, nesting_salsa, ngases_salsa, & 254 salsa_gas, salsa_gases_from_chem 252 255 253 256 USE surface_mod, & … … 1166 1169 ENDIF 1167 1170 1168 IF ( air_chemistry ) THEN1171 IF ( air_chemistry .AND. nesting_chem ) THEN 1169 1172 DO n = 1, nspec 1170 1173 CALL pmc_set_dataarray_name( 'parent', 'chem_' // TRIM( chem_species(n)%name ), & … … 1173 1176 ENDIF 1174 1177 1175 IF ( salsa .AND. nest _salsa ) THEN1178 IF ( salsa .AND. nesting_salsa ) THEN 1176 1179 DO lb = 1, nbins_aerosol 1177 1180 WRITE(salsa_char,'(i0)') lb … … 2310 2313 ! 2311 2314 !-- Chemistry, depends on number of species 2312 IF ( air_chemistry ) pmc_max_array = pmc_max_array + nspec2315 IF ( air_chemistry .AND. nesting_chem ) pmc_max_array = pmc_max_array + nspec 2313 2316 ! 2314 2317 !-- SALSA, depens on the number aerosol size bins and chemical components + 2315 2318 !-- the number of default gases 2316 IF ( salsa .AND. nest _salsa ) pmc_max_array = pmc_max_array + nbins_aerosol +&2317 nbins_aerosol * ncomponents_mass2319 IF ( salsa .AND. nesting_salsa ) pmc_max_array = pmc_max_array + nbins_aerosol + & 2320 nbins_aerosol * ncomponents_mass 2318 2321 IF ( .NOT. salsa_gases_from_chem ) pmc_max_array = pmc_max_array + ngases_salsa 2319 2322 … … 2717 2720 ENDIF 2718 2721 2719 IF ( air_chemistry ) THEN2722 IF ( air_chemistry .AND. nesting_chem ) THEN 2720 2723 DO n = 1, nspec 2721 2724 CALL pmci_interp_1sto_all ( chem_species(n)%conc, chem_spec_c(:,:,:,n), & … … 2724 2727 ENDIF 2725 2728 2726 IF ( salsa .AND. nest _salsa ) THEN2729 IF ( salsa .AND. nesting_salsa ) THEN 2727 2730 DO lb = 1, nbins_aerosol 2728 2731 CALL pmci_interp_1sto_all ( aerosol_number(lb)%conc, aerosol_number_c(:,:,:,lb), & … … 3394 3397 ENDIF 3395 3398 3396 IF ( air_chemistry ) THEN3399 IF ( air_chemistry .AND. nesting_chem ) THEN 3397 3400 DO n = 1, nspec 3398 3401 CALL pmci_interp_1sto_lr( chem_species(n)%conc, chem_spec_c(:,:,:,n), & … … 3401 3404 ENDIF 3402 3405 3403 IF ( salsa .AND. nest _salsa ) THEN3406 IF ( salsa .AND. nesting_salsa ) THEN 3404 3407 DO lb = 1, nbins_aerosol 3405 3408 CALL pmci_interp_1sto_lr( aerosol_number(lb)%conc, aerosol_number_c(:,:,:,lb), & … … 3465 3468 ENDIF 3466 3469 3467 IF ( air_chemistry ) THEN3470 IF ( air_chemistry .AND. nesting_chem ) THEN 3468 3471 DO n = 1, nspec 3469 3472 CALL pmci_interp_1sto_lr( chem_species(n)%conc, chem_spec_c(:,:,:,n), & … … 3472 3475 ENDIF 3473 3476 3474 IF ( salsa .AND. nest _salsa ) THEN3477 IF ( salsa .AND. nesting_salsa ) THEN 3475 3478 DO lb = 1, nbins_aerosol 3476 3479 CALL pmci_interp_1sto_lr( aerosol_number(lb)%conc, aerosol_number_c(:,:,:,lb), & … … 3536 3539 ENDIF 3537 3540 3538 IF ( air_chemistry ) THEN3541 IF ( air_chemistry .AND. nesting_chem ) THEN 3539 3542 DO n = 1, nspec 3540 3543 CALL pmci_interp_1sto_sn( chem_species(n)%conc, chem_spec_c(:,:,:,n), & … … 3543 3546 ENDIF 3544 3547 3545 IF ( salsa .AND. nest _salsa ) THEN3548 IF ( salsa .AND. nesting_salsa ) THEN 3546 3549 DO lb = 1, nbins_aerosol 3547 3550 CALL pmci_interp_1sto_sn( aerosol_number(lb)%conc, aerosol_number_c(:,:,:,lb), & … … 3607 3610 ENDIF 3608 3611 3609 IF ( air_chemistry ) THEN3612 IF ( air_chemistry .AND. nesting_chem ) THEN 3610 3613 DO n = 1, nspec 3611 3614 CALL pmci_interp_1sto_sn( chem_species(n)%conc, chem_spec_c(:,:,:,n), & … … 3614 3617 ENDIF 3615 3618 3616 IF ( salsa .AND. nest _salsa ) THEN3619 IF ( salsa .AND. nesting_salsa ) THEN 3617 3620 DO lb = 1, nbins_aerosol 3618 3621 CALL pmci_interp_1sto_sn( aerosol_number(lb)%conc, aerosol_number_c(:,:,:,lb), & … … 3673 3676 ENDIF 3674 3677 3675 IF ( air_chemistry ) THEN3678 IF ( air_chemistry .AND. nesting_chem ) THEN 3676 3679 DO n = 1, nspec 3677 3680 CALL pmci_interp_1sto_t( chem_species(n)%conc, chem_spec_c(:,:,:,n), & … … 3680 3683 ENDIF 3681 3684 3682 IF ( salsa .AND. nest _salsa ) THEN3685 IF ( salsa .AND. nesting_salsa ) THEN 3683 3686 DO lb = 1, nbins_aerosol 3684 3687 CALL pmci_interp_1sto_t( aerosol_number(lb)%conc, aerosol_number_c(:,:,:,lb), & … … 3764 3767 ENDIF 3765 3768 3766 IF ( air_chemistry ) THEN3769 IF ( air_chemistry .AND. nesting_chem ) THEN 3767 3770 DO n = 1, nspec 3768 3771 CALL pmci_anterp_tophat( chem_species(n)%conc, chem_spec_c(:,:,:,n), & … … 3770 3773 ENDDO 3771 3774 ENDIF 3772 3773 IF ( salsa .AND. nest _salsa ) THEN3775 3776 IF ( salsa .AND. nesting_salsa ) THEN 3774 3777 DO lb = 1, nbins_aerosol 3775 3778 CALL pmci_anterp_tophat( aerosol_number(lb)%conc, aerosol_number_c(:,:,:,lb), & … … 4816 4819 ! 4817 4820 !-- Set Neumann boundary conditions for chemical species 4818 IF ( air_chemistry ) THEN4821 IF ( air_chemistry .AND. nesting_chem ) THEN 4819 4822 IF ( ibc_cs_b == 1 ) THEN 4820 4823 DO n = 1, nspec … … 4836 4839 ! 4837 4840 !-- Set Neumann boundary conditions for aerosols and salsa gases 4838 IF ( salsa .AND. nest _salsa ) THEN4841 IF ( salsa .AND. nesting_salsa ) THEN 4839 4842 IF ( ibc_salsa_b == 1 ) THEN 4840 4843 DO m = 1, bc_h(0)%ns -
palm/trunk/SOURCE/salsa_mod.f90
r4272 r4273 26 26 ! ----------------- 27 27 ! $Id$ 28 ! - Rename nest_salsa to nesting_salsa 29 ! - Correct some errors in boundary condition flags 30 ! - Add a check for not trying to output gas concentrations in salsa if the 31 ! chemistry module is applied 32 ! - Set the default value of nesting_salsa and nesting_offline_salsa to .TRUE. 33 ! 34 ! 4272 2019-10-23 15:18:57Z schwenkel 28 35 ! Further modularization of boundary conditions: moved boundary conditions to 29 36 ! respective modules … … 454 461 LOGICAL :: include_emission = .FALSE. !< Include or not emissions 455 462 LOGICAL :: feedback_to_palm = .FALSE. !< Allow feedback due to condensation of H2O 456 LOGICAL :: nest _salsa = .FALSE.!< Apply nesting for salsa457 LOGICAL :: nesting_offline_salsa = . FALSE.!< Apply offline nesting for salsa463 LOGICAL :: nesting_salsa = .TRUE. !< Apply nesting for salsa 464 LOGICAL :: nesting_offline_salsa = .TRUE. !< Apply offline nesting for salsa 458 465 LOGICAL :: no_insoluble = .FALSE. !< Exclude insoluble chemical components 459 466 LOGICAL :: read_restart_data_salsa = .FALSE. !< Read restart data for salsa … … 652 659 CHARACTER(LEN=15) :: char_t = 'ls_forcing_top_' !< leading substring at top boundary 653 660 654 CHARACTER(LEN=5), DIMENSION(1:ngases_salsa) :: gas_name = (/' h2so4','hno3 ','nh3 ','ocnv ','ocsv'/)661 CHARACTER(LEN=5), DIMENSION(1:ngases_salsa) :: gas_name = (/'H2SO4','HNO3 ','NH3 ','OCNV ','OCSV '/) 655 662 656 663 CHARACTER(LEN=25), DIMENSION(:), ALLOCATABLE :: cc_name !< chemical component name … … 973 980 init_aerosol_type, & 974 981 init_gases_type, & 975 nest _salsa,&982 nesting_salsa, & 976 983 nesting_offline_salsa, & 977 984 salsa_gases_from_chem, & … … 1037 1044 n_lognorm, & 1038 1045 nbin, & 1039 nest _salsa,&1046 nesting_salsa, & 1040 1047 nesting_offline_salsa, & 1041 1048 nf2a, & … … 1102 1109 1103 1110 USE control_parameters, & 1104 ONLY: humidity, initializing_actions1111 ONLY: child_domain, humidity, initializing_actions, nesting_offline 1105 1112 1106 1113 IMPLICIT NONE … … 1111 1118 WRITE( message_string, * ) 'salsa = ', salsa, ' is not allowed with humidity = ', humidity 1112 1119 CALL message( 'salsa_check_parameters', 'PA0594', 1, 2, 0, 6, 0 ) 1120 ENDIF 1121 ! 1122 !-- For nested runs, explicitly set nesting boundary conditions. 1123 IF ( nesting_salsa .AND. child_domain ) bc_salsa_t = 'nested' 1124 ! 1125 !-- Set boundary conditions also in case the model is offline-nested in larger-scale models. 1126 IF ( nesting_offline ) THEN 1127 IF ( nesting_offline_salsa ) THEN 1128 bc_salsa_t = 'nesting_offline' 1129 ELSE 1130 bc_salsa_t = 'neumann' 1131 ENDIF 1113 1132 ENDIF 1114 1133 ! … … 1128 1147 ELSEIF ( bc_salsa_t == 'neumann' ) THEN 1129 1148 ibc_salsa_t = 1 1130 ELSEIF ( bc_salsa_t == ' nested' ) THEN1149 ELSEIF ( bc_salsa_t == 'initial_gradient' ) THEN 1131 1150 ibc_salsa_t = 2 1151 ELSEIF ( bc_salsa_t == 'nested' .OR. bc_salsa_t == 'nesting_offline' ) THEN 1152 ibc_salsa_t = 3 1132 1153 ELSE 1133 1154 message_string = 'unknown boundary condition: bc_salsa_t = "' // TRIM( bc_salsa_t ) // '"' 1134 1155 CALL message( 'salsa_check_parameters', 'PA0596', 1, 2, 0, 6, 0 ) 1135 ENDIF1136 !1137 !-- If nest_salsa = .F., set top boundary to dirichlet1138 IF ( .NOT. nest_salsa .AND. ibc_salsa_t == 2 ) THEN1139 ibc_salsa_t = 01140 bc_salsa_t = 'dirichlet'1141 1156 ENDIF 1142 1157 ! … … 1246 1261 WRITE( io, 19 ) 1247 1262 ENDIF 1248 IF ( nest_salsa ) WRITE( io, 20 ) nest_salsa 1249 WRITE( io, 21 ) salsa_emission_mode 1263 IF ( nesting_salsa ) WRITE( io, 20 ) nesting_salsa 1264 IF ( nesting_offline_salsa ) WRITE( io, 21 ) nesting_offline_salsa 1265 WRITE( io, 22 ) salsa_emission_mode 1250 1266 IF ( salsa_emission_mode == 'uniform' ) THEN 1251 WRITE( io, 2 2) surface_aerosol_flux, aerosol_flux_dpg, aerosol_flux_sigmag, &1267 WRITE( io, 23 ) surface_aerosol_flux, aerosol_flux_dpg, aerosol_flux_sigmag, & 1252 1268 aerosol_flux_mass_fracs_a 1253 1269 ENDIF 1254 1270 IF ( SUM( aerosol_flux_mass_fracs_b ) > 0.0_wp .OR. salsa_emission_mode == 'read_from_file' ) & 1255 1271 THEN 1256 WRITE( io, 2 3)1272 WRITE( io, 24 ) 1257 1273 ENDIF 1258 1274 … … 1297 1313 19 FORMAT (/' Size distribution read from a file.') 1298 1314 20 FORMAT (/' Nesting for salsa variables: ', L1 ) 1299 21 FORMAT (/' Emissions: salsa_emission_mode = ', A ) 1300 22 FORMAT (/' surface_aerosol_flux = ', ES12.4E3, ' #/m**2/s', / & 1315 21 FORMAT (/' Offline nesting for salsa variables: ', L1 ) 1316 22 FORMAT (/' Emissions: salsa_emission_mode = ', A ) 1317 23 FORMAT (/' surface_aerosol_flux = ', ES12.4E3, ' #/m**2/s', / & 1301 1318 ' aerosol_flux_dpg = ', 7(F7.3), ' (m)', / & 1302 1319 ' aerosol_flux_sigmag = ', 7(F7.2), / & 1303 1320 ' aerosol_mass_fracs_a = ', 7(ES12.4E3) ) 1304 2 3FORMAT (/' (currently all emissions are soluble!)')1321 24 FORMAT (/' (currently all emissions are soluble!)') 1305 1322 1306 1323 END SUBROUTINE salsa_header … … 2209 2226 ! 2210 2227 !-- Read vertical profiles of gases: 2211 CALL get_variable( id_dyn, 'init_atmosphere_ h2so4', salsa_gas(1)%init(nzb+1:nzt) )2212 CALL get_variable( id_dyn, 'init_atmosphere_ hno3', salsa_gas(2)%init(nzb+1:nzt) )2213 CALL get_variable( id_dyn, 'init_atmosphere_ nh3', salsa_gas(3)%init(nzb+1:nzt) )2214 CALL get_variable( id_dyn, 'init_atmosphere_ ocnv', salsa_gas(4)%init(nzb+1:nzt) )2215 CALL get_variable( id_dyn, 'init_atmosphere_ ocsv', salsa_gas(5)%init(nzb+1:nzt) )2228 CALL get_variable( id_dyn, 'init_atmosphere_H2SO4', salsa_gas(1)%init(nzb+1:nzt) ) 2229 CALL get_variable( id_dyn, 'init_atmosphere_HNO3', salsa_gas(2)%init(nzb+1:nzt) ) 2230 CALL get_variable( id_dyn, 'init_atmosphere_NH3', salsa_gas(3)%init(nzb+1:nzt) ) 2231 CALL get_variable( id_dyn, 'init_atmosphere_OCNV', salsa_gas(4)%init(nzb+1:nzt) ) 2232 CALL get_variable( id_dyn, 'init_atmosphere_OCSV', salsa_gas(5)%init(nzb+1:nzt) ) 2216 2233 ! 2217 2234 !-- Set Neumann top and surface boundary condition for initial + initialise concentrations … … 8146 8163 8147 8164 IF ( time_since_reference_point >= skip_time_do_salsa ) THEN 8148 8149 8165 ! 8150 8166 !-- Surface conditions: … … 8247 8263 ENDIF 8248 8264 8249 ELSEIF ( ibc_salsa_t == 2 ) THEN ! nested8265 ELSEIF ( ibc_salsa_t == 2 ) THEN ! Initial gradient 8250 8266 8251 8267 DO ib = 1, nbins_aerosol … … 8358 8374 flag = 0.0_wp 8359 8375 ! 8360 !-- Skip input if forcing from larger-scale models is applied.8376 !-- Skip input if forcing from a larger-scale models is applied. 8361 8377 IF ( nesting_offline .AND. nesting_offline_salsa ) RETURN 8362 8378 ! … … 9778 9794 9779 9795 CASE ( 'g_H2SO4', 'g_HNO3', 'g_NH3', 'g_OCNV', 'g_OCSV' ) 9780 IF ( salsa_gases_from_chem) THEN9796 IF ( air_chemistry ) THEN 9781 9797 message_string = 'gases are imported from the chemistry module and thus output '// & 9782 9798 'of "' // TRIM( var ) // '" is not allowed'
Note: See TracChangeset
for help on using the changeset viewer.