Changeset 4806


Ignore:
Timestamp:
Dec 2, 2020 9:00:32 PM (3 years ago)
Author:
gronemeier
Message:

bugfix:

  • biometeorology_mod:
    • add checks for setup of UV exposure (only workaround!)
    • corrected formatting errors
  • netcdf_data_input_mod:
    • deactivated reading of building_obstruction_full due to improper implementation
Location:
palm/trunk/SOURCE
Files:
2 edited

Legend:

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

    r4768 r4806  
    2121! Current revisions:
    2222! ------------------
    23 !
     23! Add checks for setup of UV exposure (only workaround!); corrected formatting errors.
    2424!
    2525! Former revisions:
     
    3434! Enable restart via mpi-IO. Therefore, allocated array mrt_av_grid as 3D array instead of an
    3535! 1D array.
    36 ! 
     36!
    3737! 4577 2020-06-25 09:53:58Z raasch
    3838! further re-formatting concerning Fortran parameter variables
     
    147147!> @todo uv_vitd3dose-->new output type necessary (cumulative)
    148148!> @todo consider upwelling radiation in UV
     149!> @todo re-design module to work with PALM's module interface and reduce number of workarounds
    149150!>
    150151!> @note nothing now
    151152!>
    152 !> @bug  no known bugs by now
     153!> @bug  checks for proper parameter settings and required input data are missing. Currently
     154!<       implemented only by a workaround!
    153155!--------------------------------------------------------------------------------------------------!
    154156 MODULE biometeorology_mod
     
    164166
    165167    USE control_parameters,                                                                        &
    166         ONLY:  average_count_3d, biometeorology,                                                   &
     168        ONLY:  average_count_3d,                                                                   &
     169               biometeorology,                                                                     &
    167170               debug_output,                                                                       &
    168                dz, dz_stretch_factor,                                                              &
    169                dz_stretch_level, humidity, initializing_actions, nz_do3d,                          &
    170                restart_data_format_output, surface_pressure
     171               dz,                                                                                 &
     172               dz_stretch_factor,                                                                  &
     173               dz_stretch_level,                                                                   &
     174               humidity,                                                                           &
     175               initializing_actions, message_string,                                               &
     176               nz_do3d,                                                                            &
     177               restart_data_format_output,                                                         &
     178               surface_pressure
    171179
    172180    USE grid_variables,                                                                            &
     
    180188
    181189    USE netcdf_data_input_mod,                                                                     &
    182         ONLY: building_obstruction_f, netcdf_data_input_uvem, uvem_integration_f,                  &
    183               uvem_irradiance_f, uvem_projarea_f, uvem_radiance_f
     190        ONLY: building_obstruction_f,                                                              &
     191              input_file_uvem,                                                                     &
     192              input_pids_uvem,                                                                     &
     193              netcdf_data_input_uvem,                                                              &
     194              uvem_integration_f,                                                                  &
     195              uvem_irradiance_f,                                                                   &
     196              uvem_projarea_f,                                                                     &
     197              uvem_radiance_f
    184198
    185199    USE palm_date_time_mod,                                                                        &
     
    741755
    742756!
    743 !--     No averaging for UVEM SINce we are calculating a dose (only sum is calculated and saved to
     757!--     No averaging for UVEM since we are calculating a dose (only sum is calculated and saved to
    744758!--     av.nc file)
    745759        END SELECT
     
    777791!--    Arrays for time-averaged thermal indices are also allocated here because they are not running
    778792!--    through the standard averaging procedure in bio_3d_data_averaging as the values of the
    779 !--    averaged thermal indices are derived in a SINgle step based on priorly averaged arrays (see
     793!--    averaged thermal indices are derived in a single step based on priorly averaged arrays (see
    780794!--    bio_calculate_thermal_index_maps).
    781795       CASE ( 'bio_mrt', 'bio_mrt*' )
     
    843857
    844858       CASE ( 'uvem_vitd3*' )
    845 !           IF ( .NOT. uv_exposure )  THEN
    846 !              message_string = 'output of "' // TRIM( var ) // '" requi' //                      &
    847 !                       'res a namelist &uvexposure_par'
    848 !              CALL message( 'uvem_check_data_output', 'UV0001', 1, 2, 0, 6, 0 )
    849 !           ENDIF
     859          IF ( .NOT. uv_exposure )  THEN
     860             message_string = 'output of "' // TRIM( var ) // '" requires uv_exposure = .TRUE.' // &
     861                              '&in namelist "biometeorology_parameters"'
     862             CALL message( 'uvem_check_data_output', 'PA0512', 1, 2, 0, 6, 0 )
     863          ENDIF
    850864          IF ( k == 0  .OR.  data_output(i)(ilen-2:ilen) /= '_xy' )  THEN
    851865             message_string = 'illegal value for data_output: "' //                                &
     
    861875
    862876       CASE ( 'uvem_vitd3dose*' )
    863 !           IF (  .NOT.  uv_exposure )  THEN
    864 !              message_string = 'output of "' // TRIM( var ) // '" requi' //    &
    865 !                       'res  a namelist &uvexposure_par'
    866 !              CALL message( 'uvem_check_data_output', 'UV0001', 1, 2, 0, 6, 0 )
    867 !           ENDIF
     877          IF (  .NOT.  uv_exposure )  THEN
     878             message_string = 'output of "' // TRIM( var ) // '" requires uv_exposure = .TRUE.' // &
     879                              '&in namelist "biometeorology_parameters"'
     880             CALL message( 'uvem_check_data_output', 'PA0512', 1, 2, 0, 6, 0 )
     881          ENDIF
    868882          IF ( k == 0  .OR.  data_output(i)(ilen-2:ilen) /= '_xy' )  THEN
    869883             message_string = 'illegal value for data_output: "' //                                &
     
    922936    IMPLICIT NONE
    923937
     938!
     939!-- Check settings for UV exposure part
     940    IF ( uv_exposure )  THEN
     941
     942!
     943!--    Input file not present
     944       IF ( .NOT. input_pids_uvem )  THEN
     945          WRITE( message_string, * ) 'uv_exposure = .TRUE. but input file "' //                    &
     946                                     TRIM( input_file_uvem ) // '" is not present.&' //            &
     947                                     'Calculating UV exposure impossible.'
     948          CALL message( 'bio_check_parameters', 'PA0513', 1, 2, 0, 6, 0 )
     949       ELSE
     950
     951!
     952!--       Required variables not given in input file
     953          IF ( .NOT. uvem_integration_f%from_file  .OR.  .NOT. uvem_irradiance_f%from_file  .OR.   &
     954               .NOT. uvem_projarea_f%from_file  .OR.  .NOT. uvem_radiance_f%from_file )  THEN
     955             WRITE( message_string, * ) 'uv_exposure = .TRUE. but one or more required input ' //  &
     956                                        'varaibles are not present in file "' //                   &
     957                                        TRIM( input_file_uvem ) // '".&' //                        &
     958                                        'Calculating UV exposure impossible.'
     959             CALL message( 'bio_check_parameters', 'PA0514', 1, 2, 0, 6, 0 )
     960          ENDIF
     961
     962!
     963!--       Obstruction requested but not given
     964          IF ( consider_obstructions  .AND.  .NOT. building_obstruction_f%from_file )  THEN
     965             WRITE( message_string, * ) 'consider_obstructions = .TRUE. but varaible ' //          &
     966                                        '"obstruction" is not present in file "' //                &
     967                                        TRIM( input_file_uvem ) // '".&' //                        &
     968                                        'Calculating UV exposure impossible.'
     969             CALL message( 'bio_check_parameters', 'PA0515', 1, 2, 0, 6, 0 )
     970          ENDIF
     971       ENDIF
     972    ENDIF
    924973
    925974 END SUBROUTINE bio_check_parameters
     
    12881337    IF ( uv_exposure )  CALL netcdf_data_input_uvem
    12891338
     1339!
     1340!-- Check parameters
     1341!-- WARNING This is a WORKAROUND! Due to the design of the module, checks are called at this point
     1342!-- rather than within module_interface_check_parameters.
     1343    CALL bio_check_parameters
     1344
    12901345    IF ( debug_output )  CALL debug_message( 'bio_init', 'end' )
    12911346
     
    18961951
    18971952    REAL(wp), INTENT ( IN )  ::  age     !< Age of agent                     (y)
    1898     REAL(wp), INTENT ( IN )  ::  dt      !< Time past SINce last calculation (s)
     1953    REAL(wp), INTENT ( IN )  ::  dt      !< Time past since last calculation (s)
    18991954    REAL(wp), INTENT ( IN )  ::  height  !< Height of agent                  (m)
    19001955    REAL(wp), INTENT ( IN )  ::  pair    !< Air pressure                     (hPa)
     
    26152670          ELSE
    26162671!
    2617 !--          Never get here in x_ridder: SINgularity in y
     2672!--          Never get here in x_ridder: singularity in y
    26182673             nerr    = -1_iwp
    26192674             clo_res = x_ridder
     
    43254380
    43264381    USE control_parameters,                                                                        &
    4327        ONLY:  latitude, longitude, time_SINce_reference_point
     4382       ONLY:  latitude, longitude, time_since_reference_point
    43284383
    43294384    IMPLICIT NONE
     
    43454400
    43464401
    4347     CALL get_date_time( time_SINce_reference_point, day_of_year = day_of_year,                     &
     4402    CALL get_date_time( time_since_reference_point, day_of_year = day_of_year,                     &
    43484403                        second_of_day = second_of_day )
    43494404    dtor = pi / 180.0_wp
  • palm/trunk/SOURCE/netcdf_data_input_mod.f90

    r4767 r4806  
    1919! Current revisions:
    2020! -----------------
    21 !
     21! Deactivated reading of building_obstruction_full due to improper implementation (conflicts with
     22! building_obstruction_f and it is also not used anywhere else in the code).
    2223!
    2324! Former revisions:
     
    628629!-- Define 3D variables of type NC_BYTE
    629630    TYPE(int_3d_8bit)  ::  building_obstruction_f    !< input variable for building obstruction
    630     TYPE(int_3d_8bit)  ::  building_obstruction_full !< input variable for building obstruction
     631    ! TYPE(int_3d_8bit)  ::  building_obstruction_full !< input variable for building obstruction
    631632!
    632633!-- Define 2D variables of type NC_INT
     
    20942095!
    20952096!--    Read building obstruction
    2096        IF ( check_existence( var_names, 'obstruction' ) )  THEN
    2097           building_obstruction_full%from_file = .TRUE.
    2098 !
    2099 !--       Input 3D uvem building obstruction
    2100           ALLOCATE( building_obstruction_full%var_3d(0:44,0:2,0:2) )
    2101           CALL get_variable( id_uvem, 'obstruction', building_obstruction_full%var_3d, 0, 2, 0, 2, &
    2102                              0, 44 )
    2103        ELSE
    2104           building_obstruction_full%from_file = .FALSE.
    2105        ENDIF
     2097!      @bug This part is deactivated due to improper implementation: conflicts with
     2098!           building_obstruction_f and it is also not used anywhere else in the code
     2099!        IF ( check_existence( var_names, 'obstruction' ) )  THEN
     2100!           building_obstruction_full%from_file = .TRUE.
     2101! !
     2102! !--       Input 3D uvem building obstruction
     2103!           ALLOCATE( building_obstruction_full%var_3d(0:44,0:2,0:2) )
     2104!           CALL get_variable( id_uvem, 'obstruction', building_obstruction_full%var_3d, &
     2105!                              0, 2, 0, 2, 0, 44 )
     2106!        ELSE
     2107!           building_obstruction_full%from_file = .FALSE.
     2108!        ENDIF
    21062109!
    21072110       IF ( check_existence( var_names, 'obstruction' ) )  THEN
Note: See TracChangeset for help on using the changeset viewer.