Ignore:
Timestamp:
May 23, 2019 12:35:57 PM (5 years ago)
Author:
eckhard
Message:

inifor: Read origin_z from static driver if given; alert user to warnings

File:
1 edited

Legend:

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

    r3866 r3997  
    2626! -----------------
    2727! $Id$
     28! Read origin_z from static driver if given on the command line
     29! Warn if origin_z is specified twice (by static driver and --elevation)
     30!
     31!
     32! 3866 2019-04-05 14:25:01Z eckhard
    2833! Use PALM's working precision
    2934! Catch errors while reading namelists
     
    140145               SNAME, LNAME, PATH, FORCING_STEP, WATER_ID, FILL_ITERATIONS,    &
    141146               BETA, P_SL, T_SL, BETA, RD, RV, G, P_REF, RD_PALM, CP_PALM,     &
    142                RHO_L, OMEGA, HECTO, wp, iwp
     147               RHO_L, OMEGA, HECTO, wp, iwp,                                   &
     148               PIDS_ORIGIN_LON,                                                &
     149               PIDS_ORIGIN_LAT,                                                &
     150               PIDS_ORIGIN_Z
    143151    USE inifor_io,                                                             &
    144152        ONLY:  get_cosmo_grid, get_netcdf_attribute, get_netcdf_dim_vector,    &
     
    440448
    441449    output_file%name = cfg%output_file
    442     z0 = cfg%z0
    443     p0 = cfg%p0
    444450
    445451    init_variables_required = .TRUE.
     
    536542    IF (TRIM(cfg%static_driver_file) .NE. '')  THEN
    537543
    538        origin_lon = get_netcdf_attribute(cfg%static_driver_file, 'origin_lon')
    539        origin_lat = get_netcdf_attribute(cfg%static_driver_file, 'origin_lat')
     544       origin_lon = get_netcdf_attribute(cfg%static_driver_file, TRIM( PIDS_ORIGIN_LON ) )
     545       origin_lat = get_netcdf_attribute(cfg%static_driver_file, TRIM( PIDS_ORIGIN_LAT ) )
     546       z0         = get_netcdf_attribute(cfg%static_driver_file, TRIM( PIDS_ORIGIN_Z ) )
     547
    540548
    541549       message = TRIM(message) // " static driver file '"                   &
     
    556564
    557565    CALL report('setup_parameters', message)
     566
     567    IF ( cfg%z0_is_set .AND. TRIM( cfg%static_driver_file ) .NE. '' )  THEN
     568
     569       message = 'You specified both --static-driver/-t and --elevation/-z0. ' // &
     570                 'Using the command line value (' // TRIM( real_to_str_f( cfg%z0 ) ) // &
     571                 ') instead of static driver value (' // TRIM( real_to_str_f( z0 ) ) // ').'
     572       CALL warn('setup_parameters', message)
     573
     574       z0 = cfg%z0
     575
     576    END IF
     577
     578    p0 = cfg%p0
    558579
    559580    CALL log_runtime('time', 'read')
Note: See TracChangeset for help on using the changeset viewer.