Changeset 1239


Ignore:
Timestamp:
Oct 29, 2013 10:11:53 AM (8 years ago)
Author:
heinze
Message:

routines for nudging and large scale forcing from external file added

Location:
palm/trunk/SOURCE
Files:
2 added
15 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/Makefile

    r1213 r1239  
    2020# Current revisions:
    2121# ------------------
    22 #
     22# +nudging, ls_forcing
    2323#
    2424# Former revisions:
     
    158158        lpm_set_attributes.f90 lpm_sort_arrays.f90 \
    159159        lpm_write_exchange_statistics.f90 lpm_write_restart_file.f90 \
    160         message.f90 microphysics.f90 modules.f90 netcdf.f90 package_parin.f90 \
    161         palm.f90 parin.f90 plant_canopy_model.f90 poisfft.f90 \
     160        ls_forcing.f90 \
     161        message.f90 microphysics.f90 modules.f90 netcdf.f90 nudging.f90 \
     162        package_parin.f90 palm.f90 parin.f90 plant_canopy_model.f90 poisfft.f90 \
    162163        poismg.f90 prandtl_fluxes.f90 pres.f90 print_1d.f90 \
    163164        production_e.f90 prognostic_equations.f90 random_function.f90 \
     
    303304lpm_write_exchange_statistics.o: modules.o
    304305lpm_write_restart_file.o: modules.o
     306ls_forcing.o: modules.o
    305307message.o: modules.o
    306308microphysics.o: modules.o
    307309modules.o: modules.f90
    308310netcdf.o: modules.o
     311nudging.o: modules.o
    309312package_parin.o: modules.o
    310 palm.o: modules.o
     313palm.o: modules.o nudging.o ls_forcing.o
    311314parin.o: modules.o
    312315plant_canopy_model.o: modules.o
    313316poisfft.o: modules.o fft_xy.o tridia_solver.o
    314317poismg.o: modules.o
    315 prandtl_fluxes.o: modules.o
     318prandtl_fluxes.o: modules.o ls_forcing.o
    316319pres.o: modules.o poisfft.o
    317320print_1d.o: modules.o
     
    322325        diffusion_e.o diffusion_s.o diffusion_u.o diffusion_v.o diffusion_w.o \
    323326        eqn_state_seawater.o impact_of_latent_heat.o microphysics.o \
    324         plant_canopy_model.o production_e.o subsidence.o user_actions.o
     327        nudging.o plant_canopy_model.o production_e.o subsidence.o user_actions.o
    325328random_gauss.o: random_function.o
    326329read_3d_binary.o: modules.o random_function.o
     
    336339temperton_fft.o: modules.o
    337340time_integration.o: modules.o advec_ws.o buoyancy.o interaction_droplets_ptq.o \
    338         production_e.o prognostic_equations.o user_actions.o
     341        ls_forcing.o production_e.o prognostic_equations.o user_actions.o
    339342timestep.o: modules.o
    340343timestep_scheme_steering.o: modules.o
  • palm/trunk/SOURCE/boundary_conds.f90

    r1160 r1239  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! Adjust ug and vg at each timestep in case of large_scale_forcing
    2323
    2424! Former revisions:
     
    147147        u_p(nzt+1,:,:) = u_init(nzt+1)
    148148        v_p(nzt+1,:,:) = v_init(nzt+1)
     149        IF ( large_scale_forcing) THEN
     150           u_p(nzt+1,:,:) = ug(nzt+1)
     151           v_p(nzt+1,:,:) = vg(nzt+1)
     152        END IF
    149153       !$acc end kernels
    150154    ELSE
  • palm/trunk/SOURCE/buoyancy.f90

    r1182 r1239  
    2020! Currrent revisions:
    2121! ------------------
     22! Generalize calc_mean_profile for wider use: use additional steering
     23! character loc
    2224!
    2325!
     
    344346
    345347
    346     SUBROUTINE calc_mean_profile( var, pr )
     348    SUBROUTINE calc_mean_profile( var, pr, loc )
    347349
    348350!------------------------------------------------------------------------------!
     
    363365
    364366       INTEGER ::  i, j, k, omp_get_thread_num, pr, tn
     367       CHARACTER (LEN=*) ::  loc
    365368#if defined( __nopointer )
    366369       REAL, DIMENSION(:,:,:) ::  var
     
    414417       ENDIF
    415418
    416        ref_state(:)  = hom(:,1,pr,0)   ! this is used in the buoyancy term
     419       SELECT CASE ( loc )
     420
     421          CASE ( 'time_int' )
     422
     423             ref_state(:)  = hom(:,1,pr,0)   ! this is used in the buoyancy term
     424
     425
     426          CASE ( 'nudging' )
     427             !nothing to be done
     428
     429
     430          CASE DEFAULT
     431             message_string = 'unknown location "' // loc // '"'
     432             CALL message( 'calc_mean_profile', 'PA0379', 1, 2, 0, 6, 0 )
     433
     434       END SELECT
     435
     436
    417437
    418438    END SUBROUTINE calc_mean_profile
  • palm/trunk/SOURCE/check_parameters.f90

    r1237 r1239  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! profiles of ug and vg added
     23! checks for nudging and large scale forcing from external file
    2324!
    2425! Former revisions:
     
    311312    USE statistics
    312313    USE subsidence_mod
     314    USE statistics
    313315    USE transpose_indices
    314316
     
    16061608    ENDIF
    16071609
    1608     IF ( surface_heatflux == 9999999.9 )  constant_heatflux     = .FALSE.
     1610    IF (myid == 0 )THEN
     1611      PRINT*, "vorher surface_heatflux: ", surface_heatflux
     1612    END IF
     1613
     1614    IF ( surface_heatflux == 9999999.9  .AND.  .NOT. large_scale_forcing )  THEN
     1615        constant_heatflux     = .FALSE.
     1616    ELSE
     1617        constant_heatflux     = .TRUE.
     1618        IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN
     1619           surface_heatflux      = shf_surf(1)
     1620        ENDIF
     1621    ENDIF
     1622
     1623    IF (myid == 0 )THEN
     1624      PRINT*, "nachher surface_heatflux: ", surface_heatflux
     1625    END IF
     1626
    16091627    IF ( top_heatflux     == 9999999.9 )  constant_top_heatflux = .FALSE.
    16101628
     
    17261744       ENDIF
    17271745
    1728        IF ( surface_waterflux == 9999999.9 )  constant_waterflux = .FALSE.
     1746       IF ( surface_waterflux == 9999999.9  .AND.  &
     1747                             .NOT. large_scale_forcing )  THEN
     1748           constant_waterflux     = .FALSE.
     1749       ELSE
     1750           constant_waterflux     = .TRUE.
     1751           IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN
     1752              surface_waterflux      = qsws_surf(1)
     1753           ENDIF
     1754       ENDIF
    17291755
    17301756!
     
    26662692             ENDIF
    26672693
     2694          CASE ( 'ug' )
     2695             dopr_index(i) = 78
     2696             dopr_unit(i)  = 'm/s'
     2697             hom(:,2,78,:) = SPREAD( zu, 2, statistic_regions+1 )
     2698
     2699          CASE ( 'vg' )
     2700             dopr_index(i) = 79
     2701             dopr_unit(i)  = 'm/s'
     2702             hom(:,2,79,:) = SPREAD( zu, 2, statistic_regions+1 )
     2703
    26682704          CASE DEFAULT
    26692705
     
    35973633
    35983634!
     3635!-- Check nudging and large scale forcing from external file
     3636    IF ( nudging .AND. ( .NOT. large_scale_forcing ) )  THEN
     3637       message_string = 'Nudging requires large_scale_forcing = .T.. &'// &
     3638                        'Surface fluxes and geostrophic wind should be &'// &
     3639                        'prescribed in file LSF_DATA'
     3640       CALL message( 'check_parameters', 'PA0374', 1, 2, 0, 6, 0 )
     3641    ENDIF
     3642
     3643    IF ( large_scale_forcing .AND. ( bc_lr /= 'cyclic'  .OR. &
     3644                                    bc_ns /= 'cyclic' ) )  THEN
     3645       message_string = 'Non-cyclic lateral boundaries do not allow for &' // &
     3646                        'the usage of large scale forcing from external file.'
     3647       CALL message( 'check_parameters', 'PA0375', 1, 2, 0, 6, 0 )
     3648     ENDIF
     3649
     3650    IF ( large_scale_forcing .AND. ( .NOT. humidity ) )  THEN
     3651       message_string = 'The usage of large scale forcing from external &'//&
     3652                        'file LSF_DATA requires humidity = .T..'
     3653       CALL message( 'check_parameters', 'PA0376', 1, 2, 0, 6, 0 )
     3654     ENDIF
     3655
     3656    IF ( large_scale_forcing .AND. topography /= 'flat' )  THEN
     3657       message_string = 'The usage of large scale forcing from external &'//&
     3658                        'file LSF_DATA is not implemented for non-flat topography'
     3659       CALL message( 'check_parameters', 'PA0377', 1, 2, 0, 6, 0 )
     3660    ENDIF
     3661
     3662    IF ( large_scale_forcing .AND.  ocean  )  THEN
     3663       message_string = 'The usage of large scale forcing from external &'//&
     3664                        'file LSF_DATA is not implemented for ocean runs'
     3665       CALL message( 'check_parameters', 'PA0378', 1, 2, 0, 6, 0 )
     3666    ENDIF
     3667!
    35993668!-- Check &userpar parameters
    36003669    CALL user_check_parameters
  • palm/trunk/SOURCE/flow_statistics.f90

    r1222 r1239  
    2121! Current revisions:
    2222! -----------------
    23 !
     23! Output of ug and vg
    2424!
    2525! Former revisions:
     
    563563          ENDDO
    564564       ENDIF
     565
    565566!
    566567!--    Horizontally averaged profiles of the vertical fluxes
     
    886887
    887888       ENDIF
    888 
    889889
    890890!
     
    11561156       hom(:,1,76,sr) = sums(:,76)     ! prr (precipitation rate)
    11571157                                       ! 77 is initial density profile
     1158       hom(:,1,78,sr) = ug             ! ug
     1159       hom(:,1,79,sr) = vg             ! vg
    11581160
    11591161       hom(:,1,pr_palm-1,sr) = sums(:,pr_palm-1)
     
    27742776       hom(:,1,76,sr) = sums(:,76)     ! prr (precipitation rate)
    27752777                                       ! 77 is initial density profile
     2778       hom(:,1,78,sr) = ug             ! ug
     2779       hom(:,1,79,sr) = vg             ! vg
    27762780
    27772781       hom(:,1,pr_palm-1,sr) = sums(:,pr_palm-1)
  • palm/trunk/SOURCE/header.f90

    r1217 r1239  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! output for nudging + large scale forcing from external file
    2323!
    2424! Former revisions:
     
    428428        WRITE ( io, 154 )
    429429    ENDIF
     430    IF ( nudging )  THEN
     431        WRITE ( io, 155 )
     432        WRITE ( io, 156 )
     433    ENDIF
     434    IF ( large_scale_forcing )  THEN
     435        WRITE ( io, 157 )
     436        WRITE ( io, 158 )
     437    ENDIF
    430438    WRITE ( io, 99 )
    431439
     
    706714       WRITE ( io, 303 )
    707715       IF ( constant_heatflux )  THEN
    708           WRITE ( io, 306 )  surface_heatflux
     716          IF ( large_scale_forcing .AND. lsf_surf ) THEN
     717             WRITE ( io, 306 )  shf(0,0)
     718          ELSE
     719             WRITE ( io, 306 )  surface_heatflux
     720          ENDIF
    709721          IF ( random_heatflux )  WRITE ( io, 307 )
    710722       ENDIF
    711723       IF ( humidity  .AND.  constant_waterflux )  THEN
    712           WRITE ( io, 311 ) surface_waterflux
     724          IF ( large_scale_forcing .AND. lsf_surf ) THEN
     725             WRITE ( io, 311 ) qsws(0,0)
     726          ELSE
     727             WRITE ( io, 311 ) surface_waterflux
     728          ENDIF
    713729       ENDIF
    714730       IF ( passive_scalar  .AND.  constant_waterflux )  THEN
     
    12881304    ENDDO
    12891305
    1290     WRITE ( io, 423 )  TRIM( coordinates ), TRIM( ugcomponent ), &
    1291                        TRIM( gradients ), TRIM( slices )
     1306    IF ( .NOT. large_scale_forcing ) THEN
     1307       WRITE ( io, 423 )  TRIM( coordinates ), TRIM( ugcomponent ), &
     1308                          TRIM( gradients ), TRIM( slices )
     1309    ELSE
     1310       WRITE ( io, 429 )
     1311    ENDIF
    12921312
    12931313!-- Profile of the geostrophic wind (component vg)
     
    13201340    ENDDO
    13211341
    1322     WRITE ( io, 424 )  TRIM( coordinates ), TRIM( vgcomponent ), &
    1323                        TRIM( gradients ), TRIM( slices )
     1342    IF ( .NOT. large_scale_forcing ) THEN
     1343       WRITE ( io, 424 )  TRIM( coordinates ), TRIM( vgcomponent ), &
     1344                          TRIM( gradients ), TRIM( slices )
     1345    ENDIF
    13241346
    13251347!
     
    13571379    ENDDO
    13581380
    1359     WRITE ( io, 420 )  TRIM( coordinates ), TRIM( temperatures ), &
    1360                        TRIM( gradients ), TRIM( slices )
     1381    IF ( .NOT. nudging ) THEN
     1382       WRITE ( io, 420 )  TRIM( coordinates ), TRIM( temperatures ), &
     1383                          TRIM( gradients ), TRIM( slices )
     1384    ELSE
     1385       WRITE ( io, 428 )
     1386    ENDIF
    13611387
    13621388!
     
    13921418
    13931419       IF ( humidity )  THEN
    1394           WRITE ( io, 421 )  TRIM( coordinates ), TRIM( temperatures ), &
    1395                              TRIM( gradients ), TRIM( slices )
     1420          IF ( .NOT. nudging ) THEN
     1421             WRITE ( io, 421 )  TRIM( coordinates ), TRIM( temperatures ), &
     1422                                TRIM( gradients ), TRIM( slices )
     1423          ENDIF
    13961424       ELSE
    13971425          WRITE ( io, 422 )  TRIM( coordinates ), TRIM( temperatures ), &
     
    17051733                  'prognostic equation for')
    17061734154 FORMAT ('     the potential temperature')
     1735155 FORMAT (' --> Nudging is used - initial profiles for u, v, pt and q ',&
     1736                  'correspond to the')
     1737156 FORMAT ('     first profiles in NUDGING_DATA')
     1738157 FORMAT (' --> Large scale forcing from external file (LSF_DATA) is used: ')
     1739158 FORMAT ('     prescribed surfaces fluxes and geostrophic wind components')
    17071740200 FORMAT (//' Run time and time step information:'/ &
    17081741             ' ----------------------------------'/)
     
    19571990427 FORMAT (/'    Initial wind profiles (u,v) are interpolated from given'// &
    19581991                  ' profiles')
     1992428 FORMAT (/'    Initial profiles (u, v, pt, q) are taken from file '/ &
     1993             '    NUDGING_DATA')
     1994429 FORMAT (/'    Geostrophic wind profiles (ug, vg) are are taken from file '/ &
     1995             '    LSF_DATA_DATA')
    19591996430 FORMAT (//' Cloud physics quantities / methods:'/ &
    19601997              ' ----------------------------------'/)
  • palm/trunk/SOURCE/init_3d_model.f90

    r1222 r1239  
    2323! Current revisions:
    2424! ------------------
    25 !
     25! Overwrite initial profiles in case of nudging
     26! Inititialize shf and qsws in case of large_scale_forcing
    2627!
    2728! Former revisions:
     
    260261    USE indices
    261262    USE interfaces
     263    USE ls_forcing_mod
    262264    USE model_1d
    263265    USE netcdf_control
     
    780782       ELSEIF ( INDEX(initializing_actions, 'set_constant_profiles') /= 0 ) &
    781783       THEN
     784
     785!
     786!--       Overwrite initial profiles in case of nudging
     787          IF ( nudging ) THEN
     788             pt_init = ptnudge(:,1)
     789             u_init  = unudge(:,1)
     790             v_init  = vnudge(:,1)
     791             IF ( humidity  .OR.  passive_scalar )  THEN
     792                q_init = qnudge(:,1)
     793             ENDIF
     794
     795             WRITE( message_string, * ) 'Initial profiles of u, v and ', &
     796                 'scalars from NUDGING_DATA are used.'
     797             CALL message( 'init_3d_model', 'PA0370', 0, 0, 0, 6, 0 )
     798          ENDIF
     799
    782800!
    783801!--       Use constructed initial profiles (velocity constant with height,
     
    873891          IF ( sloping_surface )  CALL init_slope
    874892
     893          IF(myid==0) THEN
     894            PRINT*,"initial profiles from init_3d_model"
     895            DO k=nzb, nzt+1
     896                PRINT*, k, u(k,0,0), v(k,0,0), pt(k,0,0), q(k,0,0)
     897            ENDDO
     898          ENDIF
     899
    875900       ELSEIF ( INDEX(initializing_actions, 'by_user') /= 0 ) &
    876901       THEN
     
    948973             ELSE
    949974                shf = surface_heatflux
     975!
     976!--             Initialize shf with data from external file LSF_DATA
     977                IF ( large_scale_forcing .AND. lsf_surf ) THEN
     978                   CALL ls_forcing_surf ( simulated_time )
     979                ENDIF
     980
    950981!
    951982!--             Over topography surface_heatflux is replaced by wall_heatflux(0)
  • palm/trunk/SOURCE/microphysics.f90

    r1116 r1239  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! hyp and rho have to be calculated at each time step if data from external
     23! file LSF_DATA are used
    2324!
    2425! Former revisions:
     
    103104
    104105       USE arrays_3d
    105        USE control_parameters
     106       USE cloud_parameters
     107       USE control_parameters
     108       USE grid_variables
    106109       USE indices
    107110       USE statistics
     
    296299       USE cloud_parameters
    297300       USE control_parameters
     301       USE grid_variables
     302       USE indices
    298303       USE statistics
    299304
    300305       IMPLICIT NONE
    301306
    302        INTEGER ::  i, j
     307       INTEGER ::  i, j, k
     308       REAL    ::  t_surface
     309
     310       IF ( large_scale_forcing .AND. lsf_surf ) THEN
     311!
     312!--       Calculate:
     313!--       pt / t : ratio of potential and actual temperature (pt_d_t)
     314!--       t / pt : ratio of actual and potential temperature (t_d_pt)
     315!--       p_0(z) : vertical profile of the hydrostatic pressure (hyp)
     316          t_surface = pt_surface * ( surface_pressure / 1000.0 )**0.286
     317          DO  k = nzb, nzt+1
     318             hyp(k)    = surface_pressure * 100.0 * &
     319                         ( (t_surface - g/cp * zu(k)) / t_surface )**(1.0/0.286)
     320             pt_d_t(k) = ( 100000.0 / hyp(k) )**0.286
     321             t_d_pt(k) = 1.0 / pt_d_t(k)
     322             hyrho(k)  = hyp(k) / ( r_d * t_d_pt(k) * pt_init(k) )       
     323          ENDDO
     324!
     325!--       Compute reference density
     326          rho_surface = surface_pressure * 100.0 / ( r_d * t_surface )
     327       ENDIF
     328
    303329
    304330       dt_micro = dt_3d * weight_pres(intermediate_timestep_count)
  • palm/trunk/SOURCE/modules.f90

    r1222 r1239  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! Usage of nudging enabled
     23! +nudging, ntnudge, ptnudge, qnudge, tnudge, unudge, vnudge, wnudge
     24! increase pr_palm from 80 to 90 to allow for more standard profiles
     25!
     26! Enable prescribed time depenend surface fluxes and geostrophic wind read in
     27! from external file LSF_DATA
     28! +large_scale_forcing, lsf_surf, lsf_vert, nlsf, time_surf, shf_surf, qsws_surf,
     29!  pt_surf, q_surf, p_surf, time_vert, ug_vert, vg_vert, wsubs_vert
    2330!
    2431! Former revisions:
     
    434441          c_u_m, c_u_m_l, c_v_m, c_v_m_l, c_w_m, c_w_m_l, ddzu, ddzu_pres,     &
    435442          dd2zu, dzu, ddzw, dzw, hyp, inflow_damping_factor, lad, l_grid,      &
    436           nc_1d, nr_1d, ptdf_x, ptdf_y, pt_1d, pt_init, q_1d, q_init, qc_1d,   &
    437           qr_1d, rdf, rdf_sc, ref_state, sa_init, ug, u_init,                  &
    438           u_nzb_p1_for_vfc, vg, v_init, v_nzb_p1_for_vfc, w_subs, zu, zw
     443          nc_1d, nr_1d, ptdf_x, ptdf_y, p_surf, pt_surf, pt_1d, pt_init,       &
     444          qsws_surf, q_1d, q_init, q_surf, qc_1d, qr_1d, rdf, rdf_sc,          &
     445          ref_state, sa_init, shf_surf, timenudge, time_surf, time_vert, ug,   &
     446          u_init, u_nzb_p1_for_vfc, vg, v_init, v_nzb_p1_for_vfc, w_subs, zu, zw
    439447
    440448    REAL, DIMENSION(:,:), ALLOCATABLE ::                                       &
     
    443451          flux_s_e, flux_s_nr, flux_s_pt, flux_s_q, flux_s_qr, flux_s_sa,      &
    444452          flux_s_u, flux_s_v, flux_s_w, f1_mg, f2_mg, f3_mg,                   &
    445           mean_inflow_profiles, nrs, nrsws, nrswst, pt_slope_ref, qs, qsws,    &
    446           qswst, qswst_remote, qrs, qrsws, qrswst, rif, saswsb, saswst, shf,   &
    447           total_2d_a, total_2d_o, ts, tswst, us, usws, uswst, vsws, vswst, z0, &
    448           z0h
     453          mean_inflow_profiles, nrs, nrsws, nrswst, ptnudge, pt_slope_ref,     &
     454          qnudge, qs, qsws, qswst, qswst_remote, qrs, qrsws, qrswst, rif,      &
     455          saswsb, saswst, shf, tnudge, total_2d_a, total_2d_o, ts, tswst,      &
     456          ug_vert, unudge, us, usws, uswst, vnudge, vg_vert, vsws, vswst,      &
     457          wnudge, wsubs_vert, z0, z0h
    449458
    450459    REAL, DIMENSION(:,:,:), ALLOCATABLE ::                                     &
     
    478487    REAL, DIMENSION(:,:,:), ALLOCATABLE :: var_x, var_y, var_z, gamma_x,       &
    479488                                           gamma_y, gamma_z
     489
    480490
    481491    SAVE
     
    715725                maximum_parallel_io_streams = -1, max_pr_user = 0, &
    716726                mgcycles = 0, mg_cycles = -1, mg_switch_to_pe0_level = 0, mid, &
    717                 netcdf_data_format = 2, ngsrb = 2, nr_timesteps_this_run = 0, &
     727                nlsf = 1000, ntnudge = 100, netcdf_data_format = 2, ngsrb = 2, &
     728                nr_timesteps_this_run = 0, &
    718729                nsor = 20, nsor_ini = 100, n_sor, normalizing_region = 0, &
    719730                nz_do3d = -9999, pch_index = 0, prt_time_count = 0, &
     
    772783                inflow_l = .FALSE., inflow_n = .FALSE., &
    773784                inflow_r = .FALSE., inflow_s = .FALSE., &
    774                 iso2d_output = .FALSE., large_scale_subsidence = .FALSE., &
     785                iso2d_output = .FALSE., large_scale_forcing = .FALSE., &
     786                large_scale_subsidence = .FALSE., lsf_surf = .TRUE., &
     787                lsf_vert = .TRUE., lptnudge = .FALSE., lqnudge = .FALSE., &
     788                lunudge = .FALSE., lvnudge = .FALSE., lwnudge = .FALSE., &
    775789                masking_method = .FALSE., mg_switch_to_pe0 = .FALSE., &
    776                 netcdf_output = .FALSE., neutral = .FALSE., ocean = .FALSE., &
    777                 on_device = .FALSE., &
     790                netcdf_output = .FALSE., neutral = .FALSE., nudging = .FALSE., &
     791                ocean = .FALSE., on_device = .FALSE., &
    778792                outflow_l = .FALSE., outflow_n = .FALSE., outflow_r = .FALSE., &
    779793                outflow_s = .FALSE., passive_scalar = .FALSE., &
     
    16611675
    16621676    CHARACTER (LEN=40) ::  region(0:9)
    1663     INTEGER ::  pr_palm = 80, statistic_regions = 0
     1677    INTEGER ::  pr_palm = 90, statistic_regions = 0
    16641678    INTEGER ::  u_max_ijk(3), v_max_ijk(3), w_max_ijk(3)
    16651679    LOGICAL ::  flow_statistics_called = .FALSE.
  • palm/trunk/SOURCE/palm.f90

    r1222 r1239  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! initialization of nudging and large scale forcing from external file
    2323!
    2424! Former revisions:
     
    110110    USE indices
    111111    USE interfaces
     112    USE ls_forcing_mod
    112113    USE model_1d
     114    USE nudge_mod
    113115    USE particle_attributes
    114116    USE pegrid
     
    217219
    218220!
     221!-- Initialize Nudging if required
     222    IF ( nudging )  THEN
     223       CALL init_nudge
     224    ENDIF
     225
     226!
     227!-- Initialize reading of large scale forcing from external file - if required
     228    IF ( large_scale_forcing )  THEN
     229       CALL init_ls_forcing
     230    ENDIF
     231
     232!
    219233!-- Check control parameters and deduce further quantities
    220234    CALL check_parameters
    221 
    222235
    223236!
  • palm/trunk/SOURCE/parin.f90

    r1217 r1239  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! +nudging
     23! +large_scale_forcing
    2324!
    2425! Former revisions:
     
    239240             initializing_actions, km_constant, lad_surface, &
    240241             lad_vertical_gradient, lad_vertical_gradient_level, &
     242             large_scale_forcing, &
    241243             leaf_surface_concentration, limiter_sedimentation, &
    242244             loop_optimization, masking_method, mg_cycles, &
    243245             mg_switch_to_pe0_level, mixing_length_1d, momentum_advec, &
    244246             nc_const, netcdf_precision, neutral, ngsrb, &
    245              nsor, nsor_ini, nx, ny, nz, ocean, omega, omega_sor, &
     247             nsor, nsor_ini, nudging, nx, ny, nz, ocean, omega, omega_sor, &
    246248             passive_scalar, pch_index, phi, plant_canopy, prandtl_layer, &
    247249             prandtl_number, precipitation, psolver, pt_damping_factor, &
  • palm/trunk/SOURCE/prognostic_equations.f90

    r1182 r1239  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! usage of nudging enabled (not for accelerator version so far)
    2323!
    2424! Former revisions:
     
    182182    USE impact_of_latent_heat_mod
    183183    USE microphysics_mod
     184    USE nudge_mod
    184185    USE plant_canopy_model_mod
    185186    USE production_e_mod
     
    285286             ENDIF
    286287
     288!
     289!--          Nudging
     290             IF ( nudging )  CALL nudge( i, j, simulated_time, 'u' )
     291
    287292             CALL user_actions( i, j, 'u-tendency' )
    288293!
     
    340345             ENDIF
    341346
     347!
     348!--          Nudging
     349             IF ( nudging )  CALL nudge( i, j, simulated_time, 'v' )
     350
    342351             CALL user_actions( i, j, 'v-tendency' )
    343352!
     
    471480                CALL subsidence( i, j, tend, pt, pt_init )
    472481             ENDIF
     482
     483!
     484!--          Nudging
     485             IF ( nudging )  CALL nudge( i, j, simulated_time, 'pt' )
    473486
    474487             CALL user_actions( i, j, 'pt-tendency' )
     
    594607                CALL subsidence( i, j, tend, q, q_init )
    595608             ENDIF
     609
     610!
     611!--          Nudging
     612             IF ( nudging )  CALL nudge( i, j, simulated_time, 'q' )
    596613
    597614             CALL user_actions( i, j, 'q-tendency' )
     
    847864    ENDIF
    848865
     866!
     867!-- Nudging
     868    IF ( nudging )  CALL nudge( simulated_time, 'u' )
     869
    849870    CALL user_actions( 'u-tendency' )
    850871
     
    919940    ENDIF
    920941
     942!
     943!-- Nudging
     944    IF ( nudging )  CALL nudge( simulated_time, 'v' )
     945
    921946    CALL user_actions( 'v-tendency' )
    922947
     
    10921117          CALL subsidence( tend, pt, pt_init )
    10931118       ENDIF
     1119
     1120!
     1121!--    Nudging
     1122       IF ( nudging )  CALL nudge( simulated_time, 'pt' )
    10941123
    10951124       CALL user_actions( 'pt-tendency' )
     
    12781307         CALL subsidence( tend, q, q_init )
    12791308       ENDIF
     1309
     1310!
     1311!--    Nudging
     1312       IF ( nudging )  CALL nudge( simulated_time, 'q' )
    12801313
    12811314       CALL user_actions( 'q-tendency' )
  • palm/trunk/SOURCE/read_var_list.f90

    r1196 r1239  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! +nudging
     23! +large_scale_forcing
    2324!
    2425! Former revisions:
     
    448449          CASE ( 'lad_vertical_gradient_level_in' )
    449450             READ ( 13 )  lad_vertical_gradient_level_ind
     451          CASE ( 'large_scale_forcing' )
     452             READ ( 13 )  large_scale_forcing
    450453           CASE ( 'large_scale_subsidence' )
    451454             READ ( 13 )  large_scale_subsidence
     
    483486          CASE ( 'nsor_ini' )
    484487             READ ( 13 )  nsor_ini
     488          CASE ( 'nudging' )
     489             READ ( 13 )  nudging
    485490          CASE ( 'nx' )
    486491             READ ( 13 )  nx
  • palm/trunk/SOURCE/time_integration.f90

    r1222 r1239  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! Generalize calc_mean_profile for wider use
     23! Determine shf and qsws in dependence on data from LSF_DATA
     24! Determine ug and vg in dependence on data from LSF_DATA
    2325!
    2426! Former revisions:
     
    165167    USE interaction_droplets_ptq_mod
    166168    USE interfaces
     169    USE ls_forcing_mod
    167170    USE particle_attributes
    168171    USE pegrid
     
    223226
    224227!
     228!--    Determine ug, vg and w_subs in dependence on data from external file
     229!--    LSF_DATA
     230       IF ( large_scale_forcing .AND. lsf_vert ) THEN
     231           CALL ls_forcing_vert ( simulated_time )
     232       ENDIF
     233
     234!
    225235!--    Execute the user-defined actions
    226236       CALL user_actions( 'before_timestep' )
     
    248258!--          buoyancy terms (WARNING: only the respective last call of
    249259!--          calc_mean_profile defines the reference state!)
    250              IF ( .NOT. neutral )  CALL calc_mean_profile( pt, 4 )
    251              IF ( ocean         )  CALL calc_mean_profile( rho, 64 )
    252              IF ( humidity      )  CALL calc_mean_profile( vpt, 44 )
     260             IF ( .NOT. neutral )  CALL calc_mean_profile( pt, 4, 'time_int' )
     261             IF ( ocean         )  CALL calc_mean_profile( rho, 64, 'time_int' )
     262             IF ( humidity      )  CALL calc_mean_profile( vpt, 44, 'time_int' )
    253263          ENDIF
    254264
     
    566576                CALL cpu_log( log_point(19), 'prandtl_fluxes', 'stop' )
    567577             ENDIF
     578
     579!
     580!--          Determine shf and qsws in dependence on data from external file
     581!--          LSF_DATA
     582             IF ( ( large_scale_forcing .AND. lsf_surf ) .AND. &
     583                 intermediate_timestep_count == intermediate_timestep_count_max )&
     584             THEN
     585                CALL ls_forcing_surf ( simulated_time )
     586             ENDIF
     587
    568588!
    569589!--          Compute the diffusion coefficients
  • palm/trunk/SOURCE/write_var_list.f90

    r1182 r1239  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! +nudging
     23! +large_scale_forcing
    2324!
    2425! Former revisions:
     
    365366    WRITE ( 14 )  'lad_vertical_gradient_level_in'
    366367    WRITE ( 14 )  lad_vertical_gradient_level_ind
     368    WRITE ( 14 )  'large_scale_forcing           '
     369    WRITE ( 14 )  large_scale_forcing
    367370    WRITE ( 14 )  'large_scale_subsidence        '
    368371    WRITE ( 14 )  large_scale_subsidence
     
    399402    WRITE ( 14 )  'nsor_ini                      '
    400403    WRITE ( 14 )  nsor_ini
     404    WRITE ( 14 )  'nudging                       '
     405    WRITE ( 14 )  nudging
    401406    WRITE ( 14 )  'nx                            '
    402407    WRITE ( 14 )  nx
Note: See TracChangeset for help on using the changeset viewer.