Ignore:
Timestamp:
May 18, 2020 1:45:35 PM (4 years ago)
Author:
eckhard
Message:

inifor: Fix issue where --elevation/-z option was ignored, make it mandatory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/UTIL/inifor/src/inifor_grid.f90

    r4523 r4538  
    2626! -----------------
    2727! $Id$
     28! Modularize setup of PALM origin
     29!
     30!
     31! 4523 2020-05-07 15:58:16Z eckhard
    2832! respect integer working precision (iwp) specified in inifor_defs.f90
    2933!
     
    166170               PIDS_ORIGIN_Z
    167171    USE inifor_io,                                                             &
    168         ONLY:  get_cosmo_grid, get_netcdf_attribute, get_netcdf_dim_vector,    &
    169                get_netcdf_variable, parse_command_line_arguments,              &
    170                get_input_file_list, validate_config
     172        ONLY:  get_cosmo_grid, get_input_file_list, get_netcdf_attribute,      &
     173               get_netcdf_dim_vector, get_netcdf_variable, set_palm_origin,    &
     174               parse_command_line_arguments, validate_config
    171175    USE inifor_transform,                                                      &
    172176        ONLY:  average_2d, rotate_to_cosmo, find_horizontal_neighbours,        &
     
    561565    CALL get_netcdf_variable(cfg%soiltyp_file, cosmo_var, soiltyp)
    562566
    563     message = 'Reading PALM-4U origin from'
    564     IF (TRIM(cfg%static_driver_file) .NE. '')  THEN
    565 
    566        origin_lon = get_netcdf_attribute(cfg%static_driver_file, TRIM( PIDS_ORIGIN_LON ) )
    567        origin_lat = get_netcdf_attribute(cfg%static_driver_file, TRIM( PIDS_ORIGIN_LAT ) )
    568        z0         = get_netcdf_attribute(cfg%static_driver_file, TRIM( PIDS_ORIGIN_Z ) )
    569 
    570 
    571        message = TRIM(message) // " static driver file '"                   &
    572                                // TRIM(cfg%static_driver_file) // "'"
    573 
    574 
    575     ELSE
    576 
    577        origin_lon = longitude
    578        origin_lat = latitude
    579 
    580        message = TRIM(message) // " namlist file '"                         &
    581                                // TRIM(cfg%namelist_file) // "'"
    582 
    583     ENDIF
    584     origin_lon = origin_lon * TO_RADIANS
    585     origin_lat = origin_lat * TO_RADIANS
    586 
    587     CALL report('setup_parameters', message)
    588 
    589     IF ( cfg%z0_is_set .AND. TRIM( cfg%static_driver_file ) .NE. '' )  THEN
    590 
    591        message = 'You specified both --static-driver/-t and --elevation/-z0. ' // &
    592                  'Using the command line value (' // TRIM( real_to_str_f( cfg%z0 ) ) // &
    593                  ') instead of static driver value (' // TRIM( real_to_str_f( z0 ) ) // ').'
    594        CALL warn('setup_parameters', message)
    595 
    596        z0 = cfg%z0
    597 
    598     END IF
    599 
     567    CALL set_palm_origin(cfg, longitude, latitude, origin_lon, origin_lat, z0)
    600568    p0 = cfg%p0
    601569
     
    39803948             CASE DEFAULT
    39813949                message = "Invalid averaging period '" // TRIM(str(dt)) // " hours"
     3950                message = "Invalid averaging period '" // TRIM(str(dt)) // " hours"
    39823951                CALL inifor_abort('preprocess', message)
    39833952
Note: See TracChangeset for help on using the changeset viewer.