Changeset 3637 for palm/trunk/SOURCE/data_output_3d.f90
- Timestamp:
- Dec 20, 2018 1:51:36 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/data_output_3d.f90
r3589 r3637 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Implementation of the PALM module interface 28 ! 29 ! 3589 2018-11-30 15:09:51Z suehring 27 30 ! Move the control parameter "salsa" from salsa_mod to control_parameters 28 31 ! (M. Kurppa) … … 245 248 ONLY: lv_d_cp 246 249 247 USE biometeorology_mod, &248 ONLY: bio_data_output_3d249 250 250 USE bulk_cloud_model_mod, & 251 ONLY: bulk_cloud_model, bcm_data_output_3d 252 253 USE chemistry_model_mod, & 254 ONLY: chem_data_output_3d 251 ONLY: bulk_cloud_model 255 252 256 253 USE control_parameters, & … … 263 260 USE cpulog, & 264 261 ONLY: log_point, cpu_log 265 266 USE gust_mod, &267 ONLY: gust_data_output_3d, gust_module_enabled268 262 269 263 #if defined( __parallel ) … … 282 276 ONLY: lsm_data_output_3d, nzb_soil, nzt_soil 283 277 278 USE module_interface, & 279 ONLY: module_interface_data_output_3d 280 284 281 #if defined( __netcdf ) 285 282 USE NETCDF … … 289 286 ONLY: fill_value, id_set_3d, id_var_do3d, id_var_time_3d, nc_stat, & 290 287 netcdf_data_format, netcdf_handle_error 291 292 USE ocean_mod, &293 ONLY: ocean_data_output_3d294 288 295 289 USE particle_attributes, & 296 290 ONLY: grid_particles, number_of_particles, particles, & 297 291 particle_advection_start, prt_count 298 292 299 293 USE pegrid 300 294 301 USE plant_canopy_model_mod, &302 ONLY: pcm_data_output_3d303 304 295 USE radiation_model_mod, & 305 ONLY: nzub, nzut, radiation, radiation_data_output_3d 306 307 USE salsa_mod, & 308 ONLY: salsa_data_output_3d 296 ONLY: nzub, nzut 309 297 310 298 USE turbulence_closure_mod, & … … 399 387 400 388 ! 401 !-- Temporary solution to account for data output within the new urban 389 !-- Initiate found flag and resorting flag 390 found = .FALSE. 391 resorted = .FALSE. 392 ! 393 !-- Temporary solution to account for data output within the new urban 402 394 !-- surface model (urban_surface_mod.f90), see also SELECT CASE ( trimvar ). 403 395 !-- Store the array chosen on the temporary array. 396 nzb_do = nzb 397 nzt_do = nz_do3d 398 404 399 trimvar = TRIM( do3d(av,ivar) ) 405 IF ( urban_surface .AND. trimvar(1:4) == 'usm_' ) THEN406 trimvar = 'usm_output'407 resorted = .TRUE.408 nzb_do = nzub409 nzt_do = nzut410 ELSE411 resorted = .FALSE.412 nzb_do = nzb413 nzt_do = nz_do3d414 ENDIF415 !416 !-- Set flag to steer output of radiation, land-surface, or user-defined417 !-- quantities418 found = .FALSE.419 400 ! 420 401 !-- Allocate a temporary array with the desired output dimensions. … … 715 696 to_be_resorted => w_av 716 697 ENDIF 717 !718 !-- Block of urban surface model outputs719 CASE ( 'usm_output' )720 CALL usm_data_output_3d( av, do3d(av,ivar), found, local_pf, &721 nzb_do, nzt_do )722 698 723 699 CASE DEFAULT 724 700 725 ! 726 !-- Quantities of other modules 727 IF ( .NOT. found .AND. bulk_cloud_model ) THEN 728 CALL bcm_data_output_3d( av, do3d(av,ivar), found, local_pf, & 701 IF ( .NOT. found ) THEN 702 CALL tcm_data_output_3d( av, trimvar, found, local_pf, & 729 703 nzb_do, nzt_do ) 730 704 resorted = .TRUE. 731 705 ENDIF 732 706 733 IF ( .NOT. found .AND. air_chemistry ) THEN 734 CALL chem_data_output_3d( av, do3d(av,ivar), found, & 735 local_pf, fill_value, nzb_do, nzt_do ) 736 resorted = .TRUE. 737 ENDIF 738 739 IF ( .NOT. found .AND. gust_module_enabled ) THEN 740 CALL gust_data_output_3d( av, do3d(av,ivar), found, local_pf, & 741 nzb_do, nzt_do ) 742 resorted = .TRUE. 743 ENDIF 744 745 IF ( .NOT. found .AND. land_surface ) THEN 746 ! 747 !-- For soil model quantities, it is required to re-allocate local_pf 748 nzb_do = nzb_soil 749 nzt_do = nzt_soil 707 ! 708 !-- Quantities of other modules 709 IF ( .NOT. found ) THEN 710 CALL module_interface_data_output_3d( & 711 av, trimvar, found, local_pf, & 712 fill_value, resorted, nzb_do, nzt_do & 713 ) 714 ENDIF 715 716 ! 717 !-- Temporary workaround: ToDo: refactor local_pf allocation 718 IF ( .NOT. found .AND. urban_surface .AND. trimvar(1:4) == 'usm_' ) THEN 719 ! 720 !-- For urban model quantities, it is required to re-allocate local_pf 721 nzb_do = nzub 722 nzt_do = nzut 750 723 751 724 DEALLOCATE ( local_pf ) … … 753 726 local_pf = fill_value 754 727 755 CALL lsm_data_output_3d( av, do3d(av,ivar), found, local_pf ) 728 CALL usm_data_output_3d( av, trimvar, found, local_pf, & 729 nzb_do, nzt_do ) 756 730 resorted = .TRUE. 757 731 … … 763 737 764 738 DEALLOCATE ( local_pf ) 765 ALLOCATE( local_pf(nxl:nxr,nys:nyn,nzb_do:nzt_do) ) 766 ENDIF 767 768 ENDIF 769 770 IF ( .NOT. found .AND. ocean_mode ) THEN 771 CALL ocean_data_output_3d( av, do3d(av,ivar), found, local_pf, & 772 nzb_do, nzt_do ) 739 ALLOCATE( local_pf(nxl:nxr,nys:nyn,nzb_do:nzt_do) ) 740 ENDIF 741 742 ENDIF 743 744 ! 745 !-- Temporary workaround: ToDo: refactor local_pf allocation 746 IF ( .NOT. found .AND. land_surface ) THEN 747 ! 748 !-- For soil model quantities, it is required to re-allocate local_pf 749 nzb_do = nzb_soil 750 nzt_do = nzt_soil 751 752 DEALLOCATE ( local_pf ) 753 ALLOCATE( local_pf(nxl:nxr,nys:nyn,nzb_do:nzt_do) ) 754 local_pf = fill_value 755 756 CALL lsm_data_output_3d( av, trimvar, found, local_pf ) 773 757 resorted = .TRUE. 774 ENDIF 775 776 IF ( .NOT. found .AND. plant_canopy ) THEN 777 CALL pcm_data_output_3d( av, do3d(av,ivar), found, local_pf, & 778 fill_value, nzb_do, nzt_do ) 779 resorted = .TRUE. 780 ENDIF 781 782 IF ( .NOT. found .AND. radiation ) THEN 783 CALL radiation_data_output_3d( av, do3d(av,ivar), found, & 784 local_pf, nzb_do, nzt_do ) 785 resorted = .TRUE. 786 ENDIF 787 788 IF ( .NOT. found ) THEN 789 CALL tcm_data_output_3d( av, do3d(av,ivar), found, local_pf, & 790 nzb_do, nzt_do ) 791 resorted = .TRUE. 792 ENDIF 793 794 ! 795 !-- SALSA output 796 IF ( .NOT. found .AND. salsa ) THEN 797 CALL salsa_data_output_3d( av, do3d(av,ivar), found, local_pf, & 798 nzb_do, nzt_do ) 799 resorted = .TRUE. 800 ENDIF 801 802 IF ( .NOT. found .AND. biometeorology ) THEN 803 CALL bio_data_output_3d( av, do3d(av,ivar), found, local_pf, & 804 nzb_do, nzt_do ) 805 ENDIF 806 807 ! 808 !-- User defined quantities 809 IF ( .NOT. found ) THEN 810 CALL user_data_output_3d( av, do3d(av,ivar), found, local_pf, & 811 nzb_do, nzt_do ) 812 resorted = .TRUE. 758 759 ! 760 !-- If no soil model variable was found, re-allocate local_pf 761 IF ( .NOT. found ) THEN 762 nzb_do = nzb 763 nzt_do = nz_do3d 764 765 DEALLOCATE ( local_pf ) 766 ALLOCATE( local_pf(nxl:nxr,nys:nyn,nzb_do:nzt_do) ) 767 ENDIF 768 813 769 ENDIF 814 770
Note: See TracChangeset
for help on using the changeset viewer.