Changeset 1992 for palm


Ignore:
Timestamp:
Aug 12, 2016 3:14:59 PM (8 years ago)
Author:
suehring
Message:

Prescribing scalar flux at model top; several bugfixes concering data output of scalars and output of flight data

Location:
palm/trunk/SOURCE
Files:
11 edited

Legend:

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

    r1961 r1992  
    1919! Current revisions:
    2020! -----------------
    21 !
     21! Adjustments for top boundary condition for passive scalar
    2222!
    2323! Former revisions:
     
    259259    ELSEIF ( ibc_pt_t == 2 )  THEN
    260260       !$acc kernels present( dzu, pt_p )
    261         pt_p(nzt+1,:,:) = pt_p(nzt,:,:)   + bc_pt_t_val * dzu(nzt+1)
     261        pt_p(nzt+1,:,:) = pt_p(nzt,:,:) + bc_pt_t_val * dzu(nzt+1)
    262262       !$acc end kernels
    263263    ENDIF
     
    327327          q_p(nzt+1,:,:) = q(nzt+1,:,:)
    328328       ELSEIF ( ibc_q_t == 1 ) THEN
    329           q_p(nzt+1,:,:) = q_p(nzt,:,:)   + bc_q_t_val * dzu(nzt+1)
     329          q_p(nzt+1,:,:) = q_p(nzt,:,:) + bc_q_t_val * dzu(nzt+1)
    330330       ENDIF
    331331
     
    366366       ENDIF
    367367!
    368 !--    Top boundary
    369        IF ( ibc_s_t == 0 ) THEN
     368!--    Top boundary condition
     369       IF ( ibc_s_t == 0 )  THEN
    370370          s_p(nzt+1,:,:) = s(nzt+1,:,:)
    371        ELSEIF ( ibc_s_t == 1 ) THEN
    372           s_p(nzt+1,:,:) = s_p(nzt,:,:)   + bc_s_t_val * dzu(nzt+1)
     371       ELSEIF ( ibc_s_t == 1 )  THEN
     372          s_p(nzt+1,:,:) = s_p(nzt,:,:)
     373       ELSEIF ( ibc_s_t == 2 )  THEN
     374          s_p(nzt+1,:,:) = s_p(nzt,:,:) + bc_s_t_val * dzu(nzt+1)
    373375       ENDIF
    374376
  • palm/trunk/SOURCE/check_parameters.f90

    r1985 r1992  
    1919! Current revisions:
    2020! -----------------
    21 !
     21! New checks for top_scalarflux
     22! Bugfixes concerning data output of profiles in case of passive_scalar
    2223!
    2324! Former revisions:
     
    17061707          message_string = 'boundary condition: bc_sa_t = "' //                &
    17071708                           TRIM( bc_sa_t ) // '" is not allowed with ' //      &
    1708                            'constant_top_salinityflux = .TRUE.'
     1709                           'top_salinityflux /= 0.0'
    17091710          CALL message( 'check_parameters', 'PA0070', 1, 2, 0, 6, 0 )
    17101711       ENDIF
     
    17491750       CALL check_bc_scalars( 's', bc_s_b, ibc_s_b, 'PA0073', 'PA0074',        &
    17501751                              constant_scalarflux, s_surface_initial_change )
     1752
     1753       IF ( top_scalarflux == 9999999.9_wp )  constant_top_scalarflux = .FALSE.
     1754!
     1755!--    A fixed scalar concentration at the top implies Dirichlet boundary
     1756!--    condition for scalar. Hence, in this case specification of a constant
     1757!--    scalar flux is forbidden.
     1758       IF ( ( ibc_s_t == 0 .OR. ibc_s_t == 2 )  .AND.  constant_top_scalarflux &
     1759               .AND.  top_scalarflux /= 0.0_wp )  THEN
     1760          message_string = 'boundary condition: bc_s_t = "' //                 &
     1761                           TRIM( bc_sa_t ) // '" is not allowed with ' //      &
     1762                           'top_scalarflux /= 0.0'
     1763          CALL message( 'check_parameters', 'PA0441', 1, 2, 0, 6, 0 )
     1764       ENDIF
    17511765    ENDIF
    17521766!
     
    22102224                CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 )
    22112225             ELSE
    2212                 dopr_index(i) = 41
     2226                dopr_index(i) = 117
    22132227                dopr_unit(i)  = 'kg/m3'
    2214                 hom(:,2,41,:) = SPREAD( zu, 2, statistic_regions+1 )
     2228                hom(:,2,117,:) = SPREAD( zu, 2, statistic_regions+1 )
    22152229                IF ( data_output_pr(i)(1:1) == '#' )  THEN
    2216                    dopr_initial_index(i) = 26
    2217                    hom(:,2,26,:)         = SPREAD( zu, 2, statistic_regions+1 )
    2218                    hom(nzb,2,26,:)       = 0.0_wp    ! because zu(nzb) is negative
     2230                   dopr_initial_index(i) = 117
     2231                   hom(:,2,117,:)        = SPREAD( zu, 2, statistic_regions+1 )
     2232                   hom(nzb,2,117,:)      = 0.0_wp    ! because zu(nzb) is negative
    22192233                   data_output_pr(i)     = data_output_pr(i)(2:)
    22202234                ENDIF
     
    23312345                CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 )
    23322346             ELSE
    2333                 dopr_index(i) = 48
     2347                dopr_index(i) = 119
    23342348                dopr_unit(i)  = 'kg/m3 m/s'
    2335                 hom(:,2,48,:) = SPREAD( zw, 2, statistic_regions+1 )
     2349                hom(:,2,119,:) = SPREAD( zw, 2, statistic_regions+1 )
    23362350             ENDIF
    23372351
     
    23432357                CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 )
    23442358             ELSE
    2345                 dopr_index(i) = 49
     2359                dopr_index(i) = 116
    23462360                dopr_unit(i)  = 'kg/m3 m/s'
    2347                 hom(:,2,49,:) = SPREAD( zw, 2, statistic_regions+1 )
     2361                hom(:,2,116,:) = SPREAD( zw, 2, statistic_regions+1 )
    23482362             ENDIF
    23492363
     
    23552369                CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 )
    23562370             ELSE
    2357                 dopr_index(i) = 50
     2371                dopr_index(i) = 120
    23582372                dopr_unit(i)  = 'kg/m3 m/s'
    2359                 hom(:,2,50,:) = SPREAD( zw, 2, statistic_regions+1 )
     2373                hom(:,2,120,:) = SPREAD( zw, 2, statistic_regions+1 )
    23602374             ENDIF
    23612375
     
    39163930       ELSEIF ( bc_t == 'neumann' )  THEN
    39173931          ibc_t = 1
     3932       ELSEIF ( bc_t == 'initial_gradient' )  THEN
     3933          ibc_t = 2
    39183934       ELSEIF ( bc_t == 'nested' )  THEN
    39193935          ibc_t = 3
  • palm/trunk/SOURCE/close_file.f90

    r1818 r1992  
    1919! Current revisions:
    2020! -----------------
    21 !
     21! -Close file containing flight data
     22! -Some tabs removed.
    2223!
    2324! Former revisions:
     
    8586    USE netcdf_interface,                                                      &
    8687        ONLY:  id_set_mask, id_set_pr, id_set_prt, id_set_pts, id_set_sp,      &
    87                id_set_ts, id_set_xy, id_set_xz, id_set_yz, id_set_3d, nc_stat, &
    88                netcdf_data_format, netcdf_handle_error
     88               id_set_ts, id_set_xy, id_set_xz, id_set_yz, id_set_3d,         &
     89               id_set_fl, nc_stat, netcdf_data_format, netcdf_handle_error
    8990               
    9091    USE pegrid                                           
     
    223224                ENDIF
    224225
     226             CASE ( 199 )
     227
     228                IF ( myid == 0  .OR.  netcdf_data_format > 4 )  THEN
     229                   nc_stat = NF90_CLOSE( id_set_fl )
     230                   CALL netcdf_handle_error( 'close_file', 353 )
     231                ENDIF
     232
    225233             CASE ( 201:200+2*max_masks )
    226              
     234
    227235                IF ( myid == 0  .OR.  netcdf_data_format > 4 )  THEN
    228236!
     
    237245                   nc_stat = NF90_CLOSE( id_set_mask(mid,av) )
    238246                   CALL netcdf_handle_error( 'close_file', 459 )
    239                
     247
    240248                ENDIF
    241249
  • palm/trunk/SOURCE/header.f90

    r1961 r1992  
    1919! Current revisions:
    2020! -----------------
    21 !
     21! Adapted for top_scalarflux
    2222!
    2323! Former revisions:
     
    10171017
    10181018       ELSE
    1019           r_lower = 'q(0)     = q(1)'
     1019          r_lower = 'q(0)      = q(1)'
    10201020       ENDIF
    10211021       IF ( ibc_q_t == 0 )  THEN
    1022           r_upper =  'q(nzt = q_top'
     1022          r_upper =  'q(nzt+1) = q_top'
    10231023       ELSE
    1024           r_upper =  'q(nzt)   = q(nzt-1) + dq/dz'
     1024          r_upper =  'q(nzt+1) = q(nzt) + dq/dz'
    10251025       ENDIF
    10261026       WRITE ( io, 301 ) 'q', r_lower, r_upper
     
    10291029    IF ( passive_scalar )  THEN
    10301030       IF ( ibc_s_b == 0 )  THEN
    1031           r_lower = 's(0)     = s_surface'
     1031          r_lower = 's(0)      = s_surface'
    10321032       ELSE
    1033           r_lower = 's(0)     = s(1)'
     1033          r_lower = 's(0)      = s(1)'
    10341034       ENDIF
    10351035       IF ( ibc_s_t == 0 )  THEN
    1036           r_upper =  's(nzt)   = s_top'
    1037        ELSE
    1038           r_upper =  's(nzt)   = s(nzt-1) + ds/dz'
     1036          r_upper =  's(nzt+1) = s_top'
     1037       ELSEIF ( ibc_s_t == 1 )  THEN
     1038          r_upper =  's(nzt+1) = s(nzt)'
     1039       ELSEIF ( ibc_s_t == 2 )  THEN
     1040          r_upper =  's(nzt+1) = s(nzt) + ds/dz'
    10391041       ENDIF
    10401042       WRITE ( io, 301 ) 's', r_lower, r_upper
     
    10731075          WRITE ( io, 316 )
    10741076       ENDIF
    1075        IF ( ocean  .AND.  constant_top_salinityflux )  THEN
     1077       IF ( ocean  .AND.  constant_top_salinityflux )                          &
    10761078          WRITE ( io, 309 )  top_salinityflux
    1077        ENDIF
    10781079       IF ( humidity       )  WRITE ( io, 315 )
    1079        IF ( passive_scalar )  WRITE ( io, 315 )
     1080       IF ( passive_scalar .AND.  constant_top_scalarflux )                    &
     1081          WRITE ( io, 302 ) top_scalarflux
    10801082    ENDIF
    10811083
     
    20332035313 FORMAT ('       Predefined constant scalar flux: ',E10.3,' kg/(m**2 s)')
    20342036314 FORMAT ('       Predefined scalar value at the surface')
    2035 315 FORMAT ('       Humidity / scalar flux at top surface is 0.0')
     2037302 FORMAT ('       Predefined constant scalarflux:   ',F9.6,' kg/(m**2 s)')
     2038315 FORMAT ('       Humidity flux at top surface is 0.0')
    20362039316 FORMAT ('       Sensible heatflux and momentum flux from coupled ', &
    20372040                    'atmosphere model')
  • palm/trunk/SOURCE/init_3d_model.f90

    r1961 r1992  
    1919! Current revisions:
    2020! ------------------
    21 !
     21! Initializaton of scalarflux at model top
     22! Bugfixes in initialization of surface and top salinity flux, top scalar and
     23! humidity fluxes
    2224!
    2325! Former revisions:
     
    12051207                ENDIF
    12061208             ENDIF
    1207           ENDIF         
     1209          ENDIF   
     1210!
     1211!--       Initialize near-surface salinity flux
     1212          IF ( ocean )  saswsb = bottom_salinityflux
    12081213
    12091214       ENDIF
     
    12141219!--    The latent flux is zero in this case!
    12151220       IF ( use_top_fluxes )  THEN
    1216 
    1217           IF ( constant_top_heatflux )  THEN
    1218 !
    1219 !--          Heat flux is prescribed
    1220              tswst = top_heatflux
    1221 
    1222              IF ( humidity )  THEN
    1223                 qswst = 0.0_wp
    1224                 IF ( cloud_physics  .AND.  microphysics_seifert ) THEN
    1225                    nrswst = 0.0_wp
    1226                    qrswst = 0.0_wp
    1227                 ENDIF
     1221!
     1222!--       Prescribe to heat flux
     1223          IF ( constant_top_heatflux )  tswst = top_heatflux
     1224!
     1225!--       Prescribe zero latent flux at the top     
     1226          IF ( humidity )  THEN
     1227             qswst = 0.0_wp
     1228             IF ( cloud_physics  .AND.  microphysics_seifert ) THEN
     1229                nrswst = 0.0_wp
     1230                qrswst = 0.0_wp
    12281231             ENDIF
    1229              IF ( passive_scalar )  sswst = 0.0_wp
    1230 
    1231              IF ( ocean )  THEN
    1232                 saswsb = bottom_salinityflux
    1233                 saswst = top_salinityflux
    1234              ENDIF
    1235           ENDIF
    1236 
     1232          ENDIF
     1233!
     1234!--       Prescribe top scalar flux
     1235          IF ( passive_scalar .AND. constant_top_scalarflux )                  &
     1236             sswst = top_scalarflux
     1237!
     1238!--       Prescribe top salinity flux
     1239          IF ( ocean .AND. constant_top_salinityflux)                          &
     1240             saswst = top_salinityflux
    12371241!
    12381242!--       Initialization in case of a coupled model run
  • palm/trunk/SOURCE/modules.f90

    r1969 r1992  
    1919! Current revisions:
    2020! ------------------
    21 !
     21! +constant_top_scalarflux, top_scalarflux
     22! default of bc_s_t adjusted
    2223!
    2324! Former revisions:
     
    603604                             bc_pt_t = 'initial_gradient', &
    604605                             bc_q_b = 'dirichlet', bc_q_t = 'neumann', &
    605                              bc_s_b = 'dirichlet', bc_s_t = 'neumann', &
     606                             bc_s_b = 'dirichlet', bc_s_t = 'initial_gradient', &
    606607                             bc_sa_t = 'neumann', &
    607608                             bc_uv_b = 'dirichlet', bc_uv_t = 'dirichlet', &
     
    701702                constant_top_momentumflux = .FALSE., &
    702703                constant_top_salinityflux = .TRUE., &
     704                constant_top_scalarflux = .TRUE., &
    703705                constant_scalarflux = .TRUE., &             
    704706                constant_waterflux = .TRUE., create_disturbances = .TRUE., &
     
    818820                 top_momentumflux_u = 9999999.9_wp, &
    819821                 top_momentumflux_v = 9999999.9_wp, top_salinityflux = 9999999.9_wp, &
     822                 top_scalarflux = 9999999.9_wp, &
    820823                 ug_surface = 0.0_wp, u_bulk = 0.0_wp, u_gtrans = 0.0_wp, &
    821824                 vg_surface = 0.0_wp, vpt_reference = 9999999.9_wp, &
  • palm/trunk/SOURCE/parin.f90

    r1961 r1992  
    1919! Current revisions:
    2020! -----------------
    21 !
     21! +top_scalarflux
    2222!
    2323! Former revisions:
     
    340340             topography, topography_grid_convention, top_heatflux,             &
    341341             top_momentumflux_u, top_momentumflux_v, top_salinityflux,         &
    342              transpose_compute_overlap, turbulent_inflow,                      &
     342             top_scalarflux, transpose_compute_overlap, turbulent_inflow,      &
    343343             use_subsidence_tendencies, ug_surface, ug_vertical_gradient,      &
    344344             ug_vertical_gradient_level, use_surface_fluxes, use_cmax,         &
  • palm/trunk/SOURCE/read_var_list.f90

    r1961 r1992  
    1919! Current revisions:
    2020! ------------------
    21 !
     21! top_scalarflux added
    2222!
    2323! Former revisions:
     
    689689          CASE ( 'top_salinityflux' )
    690690             READ ( 13 )  top_salinityflux
     691          CASE ( 'top_scalarflux' )
     692             READ ( 13 )  top_scalarflux
    691693          CASE ( 'tsc' )
    692694             READ ( 13 )  tsc
  • palm/trunk/SOURCE/sum_up_3d_data.f90

    r1977 r1992  
    1919! Current revisions:
    2020! -----------------
    21 !
     21! Bugfix in summation of passive scalar
    2222!
    2323! Former revisions:
     
    110110    USE arrays_3d,                                                             &
    111111        ONLY:  dzw, e, nr, ol, p, pt, precipitation_rate, q, qc, ql, ql_c,     &
    112                ql_v, qr, qsws, rho, sa, shf, ssws, ts, u, us, v, vpt, w, z0,   &
     112               ql_v, qr, qsws, rho, s, sa, shf, ssws, ts, u, us, v, vpt, w, z0,&
    113113               z0h, z0q
    114114
     
    619619                DO  j = nysg, nyng
    620620                   DO  k = nzb, nzt+1
    621                       s_av(k,j,i) = s_av(k,j,i) + q(k,j,i)
     621                      s_av(k,j,i) = s_av(k,j,i) + s(k,j,i)
    622622                   ENDDO
    623623                ENDDO
  • palm/trunk/SOURCE/surface_layer_fluxes_mod.f90

    r1961 r1992  
    1919! Current revisions:
    2020! ------------------
    21 !
     21! Minor bug, declaration of look-up index as INTEGER
    2222!
    2323! Former revisions:
     
    179179    IMPLICIT NONE
    180180
    181     INTEGER(iwp) ::  i            !< loop index x direction
    182     INTEGER(iwp) ::  j            !< loop index y direction
    183     INTEGER(iwp) ::  k            !< loop index z direction
     181    INTEGER(iwp) ::  i              !< loop index x direction
     182    INTEGER(iwp) ::  j              !< loop index y direction
     183    INTEGER(iwp) ::  k              !< loop index z direction
     184    INTEGER(iwp) ::  l_bnd  = 7500  !< Lookup table index of the last time step
    184185
    185186    INTEGER(iwp), PARAMETER     :: num_steps = 15000  !< number of steps in the lookup table
     
    195196
    196197    REAL(wp)     ::  e_s,               & !< Saturation water vapor pressure
    197                      l_bnd  = 7500,     & !< Lookup table index of the last time step
    198198                     ol_max = 1.0E6_wp, & !< Maximum Obukhov length
    199199                     rib_max,           & !< Maximum Richardson number in lookup table
  • palm/trunk/SOURCE/write_var_list.f90

    r1960 r1992  
    1919! Current revisions:
    2020! -----------------
    21 !
     21! top scalarflux added
    2222!
    2323! Former revisions:
     
    600600    WRITE ( 14 )  'top_salinityflux              '
    601601    WRITE ( 14 )  top_salinityflux
     602    WRITE ( 14 )  'top_scalarflux                '
     603    WRITE ( 14 )  top_scalarflux
    602604    WRITE ( 14 )  'tsc                           '
    603605    WRITE ( 14 )  tsc
Note: See TracChangeset for help on using the changeset viewer.