Changeset 4544
- Timestamp:
- May 21, 2020 2:43:05 PM (5 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/chem_modules.f90
r4511 r4544 27 27 ! ----------------- 28 28 ! $Id$ 29 ! conc_av changed from pointer to allocatable array 30 ! 31 ! 4511 2020-04-30 12:20:40Z raasch 29 32 ! new variables for explicit settings of lateral boundary conditions introduced 30 33 ! … … 231 234 CHARACTER(LEN=15) :: unit !< unit (ppm for gases, kg m^-3 for aerosol tracers) 232 235 REAL(kind=wp), POINTER, DIMENSION(:,:,:) :: conc !< concentrations of trace gases 233 REAL(kind=wp), POINTER, DIMENSION(:,:,:):: conc_av !< averaged concentrations236 REAL(kind=wp), ALLOCATABLE, DIMENSION(:,:,:) :: conc_av !< averaged concentrations 234 237 REAL(kind=wp), POINTER, DIMENSION(:,:,:) :: conc_p !< conc at prognostic time level 235 238 REAL(kind=wp), POINTER, DIMENSION(:,:,:) :: tconc_m !< weighted tendency of conc for previous sub-timestep (Runge-Kutta) -
palm/trunk/SOURCE/chemistry_model_mod.f90
r4542 r4544 27 27 ! ----------------- 28 28 ! $Id$ 29 ! conc_av changed from pointer to allocatable array, array spec_conc_av removed 30 ! 31 ! 4542 2020-05-19 15:45:12Z raasch 29 32 ! redundant if statement removed 30 33 ! … … 341 344 342 345 USE restart_data_mpi_io_mod, & 343 ONLY: rrd_mpi_io, wrd_mpi_io346 ONLY: rrd_mpi_io, rd_mpi_io_check_array, wrd_mpi_io 344 347 345 348 USE statistics … … 356 359 REAL(kind=wp), ALLOCATABLE, DIMENSION(:,:,:,:), TARGET :: spec_conc_2 !< pointer for swapping of timelevels for conc 357 360 REAL(kind=wp), ALLOCATABLE, DIMENSION(:,:,:,:), TARGET :: spec_conc_3 !< pointer for swapping of timelevels for conc 358 REAL(kind=wp), ALLOCATABLE, DIMENSION(:,:,:,:), TARGET :: spec_conc_av !< averaged concentrations of chemical species359 361 REAL(kind=wp), ALLOCATABLE, DIMENSION(:,:,:,:), TARGET :: freq_1 !< pointer for phtolysis frequncies 360 362 !< (only 1 timelevel required) … … 646 648 IF ( TRIM( variable(1:3) ) == 'kc_' .AND. & 647 649 TRIM( variable(4:) ) == TRIM( chem_species(lsp)%name ) ) THEN 648 chem_species(lsp)%conc_av = 0.0_wp 650 IF ( .NOT. ALLOCATED( chem_species(lsp)%conc_av ) ) THEN 651 ALLOCATE( chem_species(lsp)%conc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 652 chem_species(lsp)%conc_av = 0.0_wp 653 ENDIF 649 654 ENDIF 650 655 ENDDO … … 1951 1956 ALLOCATE( spec_conc_2 (nzb:nzt+1,nysg:nyng,nxlg:nxrg,nspec) ) 1952 1957 ALLOCATE( spec_conc_3 (nzb:nzt+1,nysg:nyng,nxlg:nxrg,nspec) ) 1953 ALLOCATE( spec_conc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg,nspec) )1954 1958 ALLOCATE( phot_frequen(nphot) ) 1955 1959 ALLOCATE( freq_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg,nphot) ) … … 1960 1964 spec_conc_2 (:,:,:,:) = 0.0_wp 1961 1965 spec_conc_3 (:,:,:,:) = 0.0_wp 1962 spec_conc_av(:,:,:,:) = 0.0_wp1963 1966 1964 1967 … … 1969 1972 chem_species(lsp)%conc_p (nzb:nzt+1,nysg:nyng,nxlg:nxrg) => spec_conc_2 (:,:,:,lsp) 1970 1973 chem_species(lsp)%tconc_m(nzb:nzt+1,nysg:nyng,nxlg:nxrg) => spec_conc_3 (:,:,:,lsp) 1971 chem_species(lsp)%conc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) => spec_conc_av(:,:,:,lsp)1972 1974 1973 1975 ALLOCATE (chem_species(lsp)%cssws_av(nysg:nyng,nxlg:nxrg)) … … 3099 3101 ELSEIF (restart_string(1:length) == TRIM( chem_species(lsp)%name ) // '_av' ) THEN 3100 3102 3103 IF ( .NOT. ALLOCATED( chem_species(lsp)%conc_av ) ) THEN 3104 ALLOCATE( chem_species(lsp)%conc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg ) ) 3105 ENDIF 3101 3106 IF ( k == 1 ) READ ( 13 ) tmp_3d 3102 3107 chem_species(lsp)%conc_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & … … 3123 3128 INTEGER(iwp) :: lsp !< 3124 3129 3130 LOGICAL :: array_found !< 3131 3125 3132 3126 3133 DO lsp = 1, nspec 3127 3134 3128 3135 CALL rrd_mpi_io( TRIM( chem_species(lsp)%name ), chem_species(lsp)%conc ) 3129 CALL rrd_mpi_io( TRIM( chem_species(lsp)%name )//'_av', chem_species(lsp)%conc_av ) 3136 3137 CALL rd_mpi_io_check_array( TRIM( chem_species(lsp)%name )//'_av' , found = array_found ) 3138 IF ( array_found ) THEN 3139 IF ( .NOT. ALLOCATED( chem_species(lsp)%conc_av ) ) THEN 3140 ALLOCATE( chem_species(lsp)%conc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 3141 ENDIF 3142 CALL rrd_mpi_io( TRIM( chem_species(lsp)%name )//'_av', chem_species(lsp)%conc_av ) 3143 ENDIF 3130 3144 3131 3145 ENDDO … … 3239 3253 CALL wrd_write_string( TRIM( chem_species(lsp)%name ) ) 3240 3254 WRITE ( 14 ) chem_species(lsp)%conc 3241 CALL wrd_write_string( TRIM( chem_species(lsp)%name )//'_av' ) 3242 WRITE ( 14 ) chem_species(lsp)%conc_av 3255 IF ( ALLOCATED( chem_species(lsp)%conc_av ) ) THEN 3256 CALL wrd_write_string( TRIM( chem_species(lsp)%name )//'_av' ) 3257 WRITE ( 14 ) chem_species(lsp)%conc_av 3258 ENDIF 3243 3259 ENDDO 3244 3260 … … 3247 3263 DO lsp = 1, nspec 3248 3264 CALL wrd_mpi_io( TRIM( chem_species(lsp)%name ), chem_species(lsp)%conc ) 3249 CALL wrd_mpi_io( TRIM( chem_species(lsp)%name ) // '_av', chem_species(lsp)%conc_av ) 3265 IF ( ALLOCATED( chem_species(lsp)%conc_av ) ) THEN 3266 CALL wrd_mpi_io( TRIM( chem_species(lsp)%name ) // '_av', chem_species(lsp)%conc_av ) 3267 ENDIF 3250 3268 ENDDO 3251 3269
Note: See TracChangeset
for help on using the changeset viewer.