Ignore:
Timestamp:
Jan 7, 2020 5:15:02 PM (4 years ago)
Author:
suehring
Message:

Input of plant-canopy variables from static driver moved from netcdf_data_input_mod to plant-canopy model

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/netcdf_data_input_mod.f90

    r4360 r4362  
    2525! -----------------
    2626! $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
    2731! Correct single message calls, local checks must be given by the respective
    2832! mpi rank.
     
    576580!
    577581!-- Define 3D variables of type NC_FLOAT
    578     TYPE(real_3d) ::  basal_area_density_f    !< input variable for basal area density - resolved vegetation
    579     TYPE(real_3d) ::  leaf_area_density_f     !< input variable for leaf area density - resolved vegetation
    580     TYPE(real_3d) ::  root_area_density_lad_f !< input variable for root area density - resolved vegetation
    581582    TYPE(real_3d) ::  root_area_density_lsm_f !< input variable for root area density - parametrized vegetation
    582583    TYPE(real_3d) ::  uvem_radiance_f         !< input variable for uvem radiance lookup table
     
    718719!-- Public data structures
    719720    PUBLIC real_1d_3d,                                                         &
    720            real_2d
     721           real_2d,                                                            &
     722           real_3d
    721723!
    722724!-- Public variables
    723     PUBLIC albedo_pars_f, albedo_type_f, basal_area_density_f, buildings_f,    &
     725    PUBLIC albedo_pars_f, albedo_type_f, buildings_f,                          &
    724726           building_id_f, building_pars_f, building_surface_pars_f,            &
    725727           building_type_f,                                                    &
     
    733735           input_pids_static,                                                  &
    734736           input_pids_dynamic, input_pids_vm, input_file_vm,                   &
    735            leaf_area_density_f,                                                &
    736737           num_var_pids,                                                       &
    737738           pavement_pars_f, pavement_subsurface_pars_f, pavement_type_f,       &
    738739           pids_id,                                                            &
    739            root_area_density_lad_f, root_area_density_lsm_f, soil_pars_f,      &
     740           root_area_density_lsm_f, soil_pars_f,                               &
    740741           soil_type_f, street_crossing_f, street_type_f, surface_fraction_f,  &
    741742           terrain_height_f, vegetation_pars_f, vegetation_type_f,             &
     
    17201721
    17211722       USE control_parameters,                                                 &
    1722            ONLY:  land_surface, plant_canopy, urban_surface
     1723           ONLY:  land_surface, urban_surface
    17231724
    17241725       USE indices,                                                            &
     
    17421743!--    Measure CPU time
    17431744       CALL cpu_log( log_point_s(82), 'NetCDF input', 'start' )
    1744 !
    1745 !--    Read plant canopy variables.
    1746        IF ( plant_canopy )  THEN
    1747 #if defined ( __netcdf )
    1748 !
    1749 !--       Open file in read-only mode
    1750           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 variable
    1755 !--       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 vegetation
    1763           IF ( check_existence( var_names, 'lad' ) )  THEN
    1764              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 layer
    1770              CALL get_dimension_length( id_surf,                               &
    1771                                         leaf_area_density_f%nz,                &
    1772                                         'zlad' )
    1773 !
    1774 !--          Allocate variable for leaf-area density
    1775              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           ELSE
    1783              leaf_area_density_f%from_file = .FALSE.
    1784           ENDIF
    1785 
    1786 !
    1787 !--       Read basal area density - resolved vegetation
    1788           IF ( check_existence( var_names, 'bad' ) )  THEN
    1789              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 layer
    1795              CALL get_dimension_length( id_surf,                               &
    1796                                         basal_area_density_f%nz,               &
    1797                                         'zlad' )
    1798 !
    1799 !--          Allocate variable
    1800              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           ELSE
    1807              basal_area_density_f%from_file = .FALSE.
    1808           ENDIF
    1809 
    1810 !
    1811 !--       Read root area density - resolved vegetation
    1812           IF ( check_existence( var_names, 'root_area_dens_r' ) )  THEN
    1813              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 layers
    1819              CALL get_dimension_length( id_surf,             &
    1820                                                    root_area_density_lad_f%nz, &
    1821                                                   'zsoil' )
    1822 !
    1823 !--          Allocate variable
    1824              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           ELSE
    1833              root_area_density_lad_f%from_file = .FALSE.
    1834           ENDIF
    1835 !
    1836 !--       Finally, close input file
    1837           CALL close_input_file( id_surf )
    1838 #endif
    1839        ENDIF
    1840 !
    1841 !--    Deallocate variable list. Will be re-allocated in case further
    1842 !--    variables are read from file.
    1843        IF ( ALLOCATED( var_names ) )  DEALLOCATE( var_names )
    18441745!
    18451746!--    Skip the following if no land-surface or urban-surface module are
     
    18791780!--    Read soil type and required attributes
    18801781       IF ( check_existence( var_names, 'soil_type' ) )  THEN
    1881              soil_type_f%from_file = .TRUE.
     1782          soil_type_f%from_file = .TRUE.
    18821783!
    18831784!--       Note, lod is currently not on file; skip for the moment
Note: See TracChangeset for help on using the changeset viewer.