Changeset 4362 for palm/trunk/SOURCE/netcdf_data_input_mod.f90
- Timestamp:
- Jan 7, 2020 5:15:02 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/netcdf_data_input_mod.f90
r4360 r4362 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Input of plant canopy variables from static driver moved to plant-canopy 28 ! model 29 ! 30 ! 4360 2020-01-07 11:25:50Z suehring 27 31 ! Correct single message calls, local checks must be given by the respective 28 32 ! mpi rank. … … 576 580 ! 577 581 !-- Define 3D variables of type NC_FLOAT 578 TYPE(real_3d) :: basal_area_density_f !< input variable for basal area density - resolved vegetation579 TYPE(real_3d) :: leaf_area_density_f !< input variable for leaf area density - resolved vegetation580 TYPE(real_3d) :: root_area_density_lad_f !< input variable for root area density - resolved vegetation581 582 TYPE(real_3d) :: root_area_density_lsm_f !< input variable for root area density - parametrized vegetation 582 583 TYPE(real_3d) :: uvem_radiance_f !< input variable for uvem radiance lookup table … … 718 719 !-- Public data structures 719 720 PUBLIC real_1d_3d, & 720 real_2d 721 real_2d, & 722 real_3d 721 723 ! 722 724 !-- Public variables 723 PUBLIC albedo_pars_f, albedo_type_f, b asal_area_density_f, buildings_f,&725 PUBLIC albedo_pars_f, albedo_type_f, buildings_f, & 724 726 building_id_f, building_pars_f, building_surface_pars_f, & 725 727 building_type_f, & … … 733 735 input_pids_static, & 734 736 input_pids_dynamic, input_pids_vm, input_file_vm, & 735 leaf_area_density_f, &736 737 num_var_pids, & 737 738 pavement_pars_f, pavement_subsurface_pars_f, pavement_type_f, & 738 739 pids_id, & 739 root_area_density_l ad_f, root_area_density_lsm_f, soil_pars_f,&740 root_area_density_lsm_f, soil_pars_f, & 740 741 soil_type_f, street_crossing_f, street_type_f, surface_fraction_f, & 741 742 terrain_height_f, vegetation_pars_f, vegetation_type_f, & … … 1720 1721 1721 1722 USE control_parameters, & 1722 ONLY: land_surface, plant_canopy,urban_surface1723 ONLY: land_surface, urban_surface 1723 1724 1724 1725 USE indices, & … … 1742 1743 !-- Measure CPU time 1743 1744 CALL cpu_log( log_point_s(82), 'NetCDF input', 'start' ) 1744 !1745 !-- Read plant canopy variables.1746 IF ( plant_canopy ) THEN1747 #if defined ( __netcdf )1748 !1749 !-- Open file in read-only mode1750 CALL open_read_file( TRIM( input_file_static ) // &1751 TRIM( coupling_char ) , id_surf )1752 !1753 !-- At first, inquire all variable names.1754 !-- This will be used to check whether an optional input variable1755 !-- exist or not.1756 CALL inquire_num_variables( id_surf, num_vars )1757 1758 ALLOCATE( var_names(1:num_vars) )1759 CALL inquire_variable_names( id_surf, var_names )1760 1761 !1762 !-- Read leaf area density - resolved vegetation1763 IF ( check_existence( var_names, 'lad' ) ) THEN1764 leaf_area_density_f%from_file = .TRUE.1765 CALL get_attribute( id_surf, char_fill, &1766 leaf_area_density_f%fill, &1767 .FALSE., 'lad' )1768 !1769 !-- Inquire number of vertical vegetation layer1770 CALL get_dimension_length( id_surf, &1771 leaf_area_density_f%nz, &1772 'zlad' )1773 !1774 !-- Allocate variable for leaf-area density1775 ALLOCATE( leaf_area_density_f%var( 0:leaf_area_density_f%nz-1, &1776 nys:nyn,nxl:nxr) )1777 1778 CALL get_variable( id_surf, 'lad', leaf_area_density_f%var, &1779 nxl, nxr, nys, nyn, &1780 0, leaf_area_density_f%nz-1 )1781 1782 ELSE1783 leaf_area_density_f%from_file = .FALSE.1784 ENDIF1785 1786 !1787 !-- Read basal area density - resolved vegetation1788 IF ( check_existence( var_names, 'bad' ) ) THEN1789 basal_area_density_f%from_file = .TRUE.1790 CALL get_attribute( id_surf, char_fill, &1791 basal_area_density_f%fill, &1792 .FALSE., 'bad' )1793 !1794 !-- Inquire number of vertical vegetation layer1795 CALL get_dimension_length( id_surf, &1796 basal_area_density_f%nz, &1797 'zlad' )1798 !1799 !-- Allocate variable1800 ALLOCATE( basal_area_density_f%var(0:basal_area_density_f%nz-1, &1801 nys:nyn,nxl:nxr) )1802 1803 CALL get_variable( id_surf, 'bad', basal_area_density_f%var, &1804 nxl, nxr, nys, nyn, &1805 0, basal_area_density_f%nz-1 )1806 ELSE1807 basal_area_density_f%from_file = .FALSE.1808 ENDIF1809 1810 !1811 !-- Read root area density - resolved vegetation1812 IF ( check_existence( var_names, 'root_area_dens_r' ) ) THEN1813 root_area_density_lad_f%from_file = .TRUE.1814 CALL get_attribute( id_surf, char_fill, &1815 root_area_density_lad_f%fill, &1816 .FALSE., 'root_area_dens_r' )1817 !1818 !-- Inquire number of vertical soil layers1819 CALL get_dimension_length( id_surf, &1820 root_area_density_lad_f%nz, &1821 'zsoil' )1822 !1823 !-- Allocate variable1824 ALLOCATE( root_area_density_lad_f%var &1825 (0:root_area_density_lad_f%nz-1, &1826 nys:nyn,nxl:nxr) )1827 1828 CALL get_variable( id_surf, 'root_area_dens_r', &1829 root_area_density_lad_f%var, &1830 nxl, nxr, nys, nyn, &1831 0, root_area_density_lad_f%nz-1 )1832 ELSE1833 root_area_density_lad_f%from_file = .FALSE.1834 ENDIF1835 !1836 !-- Finally, close input file1837 CALL close_input_file( id_surf )1838 #endif1839 ENDIF1840 !1841 !-- Deallocate variable list. Will be re-allocated in case further1842 !-- variables are read from file.1843 IF ( ALLOCATED( var_names ) ) DEALLOCATE( var_names )1844 1745 ! 1845 1746 !-- Skip the following if no land-surface or urban-surface module are … … 1879 1780 !-- Read soil type and required attributes 1880 1781 IF ( check_existence( var_names, 'soil_type' ) ) THEN 1881 1782 soil_type_f%from_file = .TRUE. 1882 1783 ! 1883 1784 !-- Note, lod is currently not on file; skip for the moment
Note: See TracChangeset
for help on using the changeset viewer.