Ignore:
Timestamp:
Aug 23, 2019 4:06:14 PM (5 years ago)
Author:
suehring
Message:

Enable limitation of Obukhov length so that it does not become zero; to read input data from netcdf in init_3d_model use provided module variables instead of defining local ones; tests updated because changes in Obukhov lengths causes small differences during the initial phase of the run

File:
1 edited

Legend:

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

    r4185 r4186  
    2525! -----------------
    2626! $Id$
     27! Design change, use variables defined in netcdf_data_input_mod to read netcd
     28! variables rather than define local ones.
     29!
     30! 4185 2019-08-23 13:49:38Z oliver.maas
    2731! For initializing_actions = ' cyclic_fill':
    2832! Overwrite u_init, v_init, pt_init, q_init and s_init with the
     
    160164               input_file_static,                                              &
    161165               netcdf_data_input_init_3d,                                      &
     166               num_var_pids,                                                   &
    162167               open_read_file,                                                 &
    163                real_2d
     168               pids_id,                                                        &
     169               real_2d,                                                        &
     170               vars_pids
    164171               
    165172    USE nesting_offl_mod,                                                      &
     
    213220
    214221    IMPLICIT NONE
    215 
    216     CHARACTER(LEN=50), DIMENSION(:), ALLOCATABLE ::  vars_pids_static  !< variable names in static input file
    217222   
    218223    INTEGER(iwp) ::  i                    !< grid index in x direction
     
    223228    INTEGER(iwp) ::  l                    !< running index over surface orientation   
    224229    INTEGER(iwp) ::  m                    !< index of surface element in surface data type   
    225     INTEGER(iwp) ::  num_vars_pids_static !< number of variables in static input file
    226230    INTEGER(iwp) ::  nz_u_shift           !< topography-top index on u-grid, used to vertically shift initial profiles
    227231    INTEGER(iwp) ::  nz_v_shift           !< topography-top index on v-grid, used to vertically shift initial profiles
     
    233237    INTEGER(iwp) ::  nz_s_shift_l         !< topography-top index on scalar-grid, used to vertically shift initial profiles
    234238    INTEGER(iwp) ::  nzt_l                !< index of top PE boundary for multigrid level
    235     INTEGER(iwp) ::  pids_static_id       !< file id for static input file
    236239    INTEGER(iwp) ::  sr                   !< index of statistic region
    237240
     
    15411544       CALL open_read_file( TRIM( input_file_static ) //                    &
    15421545                            TRIM( coupling_char ),                          &
    1543                             pids_static_id )
     1546                            pids_id )
    15441547                           
    1545        CALL inquire_num_variables( pids_static_id, num_vars_pids_static )
     1548       CALL inquire_num_variables( pids_id, num_var_pids )
    15461549!
    15471550!--    Allocate memory to store variable names and read them
    1548        ALLOCATE( vars_pids_static(1:num_vars_pids_static) )
    1549        CALL inquire_variable_names( pids_static_id, vars_pids_static )
     1551       ALLOCATE( vars_pids(1:num_var_pids) )
     1552       CALL inquire_variable_names( pids_id, vars_pids )
    15501553!
    15511554!--    Input roughness length.
    1552        IF ( check_existence( vars_pids_static, 'z0' ) )  THEN
     1555       IF ( check_existence( vars_pids, 'z0' ) )  THEN
    15531556!
    15541557!--       Read _FillValue attribute
    1555           CALL get_attribute( pids_static_id, char_fill, tmp_2d%fill,          &
     1558          CALL get_attribute( pids_id, char_fill, tmp_2d%fill,          &
    15561559                              .FALSE., 'z0' )                                 
    15571560!                                                                             
    15581561!--       Read variable                                                       
    1559           CALL get_variable( pids_static_id, 'z0', tmp_2d%var,                 &
     1562          CALL get_variable( pids_id, 'z0', tmp_2d%var,                 &
    15601563                             nxl, nxr, nys, nyn )                             
    15611564!                                                                             
     
    15921595!
    15931596!--    Finally, close the input file.
    1594        CALL close_input_file( pids_static_id )
     1597       CALL close_input_file( pids_id )
    15951598#endif
    15961599       DEALLOCATE( tmp_2d%var )
Note: See TracChangeset for help on using the changeset viewer.