Changeset 4706 for palm


Ignore:
Timestamp:
Sep 28, 2020 1:15:23 PM (4 years ago)
Author:
suehring
Message:

Revise setting of measurement height above ground for trajectory measurements

File:
1 edited

Legend:

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

    r4695 r4706  
    2525! -----------------
    2626! $Id$
     27! Revise setting of measurement height above ground for trajectory measurements
     28!
     29! 4695 2020-09-24 11:30:03Z suehring
    2730! Introduce additional namelist parameters to further customize sampling in the horizontal and
    2831! vertical surroundings of the original observation coordinates
     
    325328       REAL(wp) ::  origin_y_obs       !< origin of the observation in UTM coordiates in y-direction
    326329
    327        REAL(wp), DIMENSION(:), ALLOCATABLE   ::  depth         !< measurement depth in soil
    328        REAL(wp), DIMENSION(:), ALLOCATABLE   ::  zar           !< measurement height above ground level
     330       REAL(wp), DIMENSION(:), ALLOCATABLE   ::  depth  !< measurement depth in soil
     331       REAL(wp), DIMENSION(:), ALLOCATABLE   ::  zar    !< measurement height above ground level
    329332
    330333       REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  measured_vars       !< measured variables
     
    339342    ! This need to be generalized
    340343    CHARACTER(LEN=10) ::  char_fill = '_FillValue'                 !< attribute name for fill value
     344    CHARACTER(LEN=1)  ::  char_height = "height"                   !< attribute name indicating height above surface (for trajectories only)
    341345    CHARACTER(LEN=9)  ::  char_long = 'long_name'                  !< attribute name for long_name
    342346    CHARACTER(LEN=18) ::  char_mv = "measured_variables"           !< variable name for the array with the measured variable names
     
    822826
    823827    NAMELIST /virtual_measurement_parameters/  dt_virtual_measurement,                             &
     828                                               off_pr,                                             &
     829                                               off_pr_z,                                           &
     830                                               off_tr,                                             &
     831                                               off_tr_z,                                           &
    824832                                               off_ts,                                             &
    825                                                off_pr,                                             &
    826                                                off_tr,                                             &
     833                                               off_ts_z,                                           &
    827834                                               use_virtual_measurement,                            &
    828835                                               vm_time_start
     
    902909    LOGICAL  ::  on_pe  !< flag indicating that the respective measurement coordinate is on subdomain
    903910
    904     REAL(wp) ::  fill_eutm !< _FillValue for coordinate array E_UTM
    905     REAL(wp) ::  fill_nutm !< _FillValue for coordinate array N_UTM
    906     REAL(wp) ::  fill_zar  !< _FillValue for height coordinate
     911    REAL(wp) ::  fill_height !< _FillValue for height coordinate (for trajectories)
     912    REAL(wp) ::  fill_eutm   !< _FillValue for coordinate array E_UTM
     913    REAL(wp) ::  fill_nutm   !< _FillValue for coordinate array N_UTM
     914    REAL(wp) ::  fill_zar    !< _FillValue for zar coordinate
    907915
    908916    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  e_utm      !< easting UTM coordinate, temporary variable
    909917    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  e_utm_tmp  !< EUTM coordinate before rotation
     918    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  height     !< observation height above ground (for trajectories)
    910919    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  n_utm      !< northing UTM coordinate, temporary variable
    911920    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  n_utm_tmp  !< NUTM coordinate before rotation
     
    10521061          ALLOCATE( station_h(1:vmea(l)%n_tr_st,1:dim_ntime)   )
    10531062          ALLOCATE( zar(1:vmea(l)%n_tr_st,1:dim_ntime)         )
     1063          IF ( vmea(l)%trajectory )  ALLOCATE( height(1:vmea(l)%n_tr_st,1:dim_ntime) )
    10541064          e_utm     = 0.0_wp
    10551065          n_utm     = 0.0_wp
    10561066          station_h = 0.0_wp
    10571067          zar       = 0.0_wp
     1068          IF ( vmea(l)%trajectory )  height = 0.0_wp
    10581069
    10591070          ALLOCATE( e_utm_tmp(1:vmea(l)%n_tr_st,1:dim_ntime) )
     
    10621073!--       Read UTM and height coordinates for all trajectories and times. Note, in case
    10631074!--       these obtain any missing values, replace them with default _FillValues.
    1064           CALL inquire_fill_value( pids_id, char_eutm // TRIM( dum ), nofill, fill_eutm )
    1065           CALL inquire_fill_value( pids_id, char_nutm // TRIM( dum ), nofill, fill_nutm )
    1066           CALL inquire_fill_value( pids_id, char_zar // TRIM( dum ), nofill, fill_zar )
     1075          CALL inquire_fill_value( pids_id, char_eutm   // TRIM( dum ), nofill, fill_eutm    )
     1076          CALL inquire_fill_value( pids_id, char_nutm   // TRIM( dum ), nofill, fill_nutm    )
     1077          CALL inquire_fill_value( pids_id, char_zar    // TRIM( dum ), nofill, fill_zar     )
     1078          IF ( vmea(l)%trajectory )                                                                &
     1079             CALL inquire_fill_value( pids_id, char_height // TRIM( dum ), nofill, fill_height  )
    10671080!
    10681081!--       Further line is just to avoid compiler warnings. nofill might be used in future.
     
    10731086!--       UC2-standard.
    10741087          IF ( vmea(l)%trajectory )  THEN
    1075              CALL get_variable( pids_id, char_eutm // TRIM( dum ), e_utm, 0, dim_ntime-1, 0,       &
     1088             CALL get_variable( pids_id, char_eutm   // TRIM( dum ), e_utm,  0, dim_ntime-1, 0,    &
    10761089                                vmea(l)%n_tr_st-1 )
    1077              CALL get_variable( pids_id, char_nutm // TRIM( dum ), n_utm, 0, dim_ntime-1, 0,       &
     1090             CALL get_variable( pids_id, char_nutm   // TRIM( dum ), n_utm,  0, dim_ntime-1, 0,    &
    10781091                                vmea(l)%n_tr_st-1 )
    1079              CALL get_variable( pids_id, char_zar // TRIM( dum ), zar, 0, dim_ntime-1, 0,          &
     1092             CALL get_variable( pids_id, char_zar    // TRIM( dum ), zar,    0, dim_ntime-1, 0,    &
     1093                                vmea(l)%n_tr_st-1 )
     1094             CALL get_variable( pids_id, char_height // TRIM( dum ), height, 0, dim_ntime-1, 0,    &
    10801095                                vmea(l)%n_tr_st-1 )
    10811096          ELSE
    1082              CALL get_variable( pids_id, char_eutm // TRIM( dum ), e_utm(:,1) )
    1083              CALL get_variable( pids_id, char_nutm // TRIM( dum ), n_utm(:,1) )
     1097             CALL get_variable( pids_id, char_eutm      // TRIM( dum ), e_utm(:,1)    )
     1098             CALL get_variable( pids_id, char_nutm      // TRIM( dum ), n_utm(:,1)    )
    10841099             CALL get_variable( pids_id, char_station_h // TRIM( dum ), station_h(:,1) )
    1085              CALL get_variable( pids_id, char_zar // TRIM( dum ), zar(:,1) )
     1100             CALL get_variable( pids_id, char_zar       // TRIM( dum ), zar(:,1)      )
    10861101          ENDIF
    10871102
     
    10891104          n_utm = MERGE( n_utm, vmea(l)%fillout, n_utm /= fill_nutm )
    10901105          zar   = MERGE( zar,   vmea(l)%fillout, zar   /= fill_zar  )
    1091 !
    1092 !--       Compute observation height above ground.
    1093           zar  = zar - station_h
     1106          IF ( vmea(l)%trajectory )                                                                &
     1107             height = MERGE( height, vmea(l)%fillout, height /= fill_height )
     1108!
     1109!--       Compute observation height above ground. Note, for trajectory measurements the height
     1110!--       above the surface is actually stored in 'height'
     1111          IF ( vmea(l)%trajectory )  THEN
     1112             zar      = height
     1113             fill_zar = fill_height
     1114          ELSE
     1115             zar = zar - station_h
     1116          ENDIF
    10941117!
    10951118!--       Based on UTM coordinates, check if the measurement station or parts of the trajectory are
     
    12881311          IF ( ALLOCATED( zar  )      )  DEALLOCATE( vmea(l)%dim_t )
    12891312          IF ( ALLOCATED( zar  )      )  DEALLOCATE( zar  )
     1313          IF ( ALLOCATED( height )    )  DEALLOCATE( height )
    12901314          IF ( ALLOCATED( station_h ) )  DEALLOCATE( station_h )
    12911315
Note: See TracChangeset for help on using the changeset viewer.