Changeset 3467


Ignore:
Timestamp:
Oct 30, 2018 7:05:21 PM (5 years ago)
Author:
suehring
Message:

Branch salsa @3446 re-integrated into trunk

Location:
palm/trunk
Files:
29 edited
3 copied

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/.palm.iofiles

    r3421 r3467  
    1111PIDS_STATIC              inopt:tr   d3#:d3r  $base_data/$run_identifier/INPUT          _static*
    1212PIDS_DYNAMIC             inopt:tr   d3#:d3r  $base_data/$run_identifier/INPUT          _dynamic*
     13PIDS_SALSA               inopt:tr   d3#:d3r  $base_data/$run_identifier/INPUT          _salsa*
     14PIDS_CHEM                inopt:tr   d3#:d3r  $base_data/$run_identifier/INPUT          _chemistry*
    1315rrtmg_lw.nc              inopt:tr   d3#:d3r  $base_data/$run_identifier/INPUT          _rlw
    1416rrtmg_sw.nc              inopt:tr   d3#:d3r  $base_data/$run_identifier/INPUT          _rsw
  • palm/trunk/SOURCE

  • palm/trunk/SOURCE/Makefile

    r3458 r3467  
    2525# -----------------
    2626# $Id$
     27# Implementation of a new aerosol module salsa.
     28#
     29#
     30# 3458 2018-10-30 14:51:23Z kanani
    2731# from chemistry branch r3443, banzhafs, Russo, forkel, basit:
    2832# radiation_model_mod added to chemistry_model_mod
     
    628632        read_restart_data_mod.f90 \
    629633        run_control.f90 \
     634        salsa_mod.f90 \
     635        salsa_util_mod.f90 \
    630636        set_slicer_attributes_dvrp.f90 \
    631637        singleton_mod.f90 \
     
    693699
    694700CC = cc
    695 CFLAGS = -O
     701CFLAGS = -O 
    696702
    697703F90 =
     
    703709# The following line is needed for palm_simple_install, don't remove it!
    704710#to_be_replaced_by_include
    705 
    706711
    707712.SUFFIXES:
     
    746751        bulk_cloud_model_mod.o \
    747752        mod_kinds.o \
    748         modules.o
     753        modules.o \
     754        salsa_util_mod.o
    749755advec_w_pw.o: \
    750756        mod_kinds.o \
     
    765771        ocean_mod.o \
    766772        radiation_model_mod.o \
     773        salsa_mod.o \
    767774        turbulence_closure_mod.o \
    768775        urban_surface_mod.o
     
    793800        modules.o \
    794801        pmc_interface_mod.o \
     802        salsa_mod.o \
    795803        surface_mod.o \
    796804        turbulence_closure_mod.o
     
    837845        pmc_interface_mod.o \
    838846        radiation_model_mod.o \
     847        salsa_mod.o \
    839848        spectra_mod.o \
    840849        subsidence_mod.o \
     
    853862        modules.o \
    854863        netcdf_data_input_mod.o \
     864        salsa_mod.o \
    855865        surface_mod.o
    856866chemistry_model_mod.o: \
     
    916926        modules.o \
    917927        netcdf_interface_mod.o \
     928        salsa_mod.o \
    918929        surface_mod.o
    919930data_output_profiles.o: \
     
    960971        ocean_mod.o \
    961972        radiation_model_mod.o \
     973        salsa_mod.o \
    962974        surface_mod.o \
    963975        urban_surface_mod.o \
     
    976988        netcdf_interface_mod.o \
    977989        ocean_mod.o \
     990        salsa_mod.o \
    978991        turbulence_closure_mod.o \
    979992        urban_surface_mod.o
     
    10621075        pmc_interface_mod.o \
    10631076        radiation_model_mod.o \
     1077        salsa_mod.o \
    10641078        spectra_mod.o \
    10651079        subsidence_mod.o \
     
    10971111        random_generator_parallel_mod.o \
    10981112        read_restart_data_mod.o \
     1113        salsa_mod.o \
    10991114        surface_layer_fluxes_mod.o \
    11001115        surface_mod.o \
     
    11311146        modules.o \
    11321147        netcdf_interface_mod.o \
    1133         radiation_model_mod.o
     1148        radiation_model_mod.o \
     1149        salsa_mod.o
    11341150init_pegrid.o: \
    11351151        mod_kinds.o \
     
    13431359        ocean_mod.o \
    13441360        radiation_model_mod.o \
     1361        salsa_mod.o \
    13451362        spectra_mod.o \
    13461363        turbulence_closure_mod.o \
     
    13861403        pmc_interface_mod.o \
    13871404        pmc_particle_interface.o \
     1405        salsa_mod.o \
    13881406        surface_layer_fluxes_mod.o \
    13891407        time_to_string.o \
     
    14101428        radiation_model_mod.o \
    14111429        read_restart_data_mod.o \
     1430        salsa_mod.o \
    14121431        spectra_mod.o \
    14131432        surface_output_mod.o \
     
    14441463        pmc_mpi_wrapper_mod.o \
    14451464        pmc_parent_mod.o \
     1465        salsa_mod.o \
    14461466        surface_mod.o
    14471467pmc_child_mod.o: \
     
    15221542        plant_canopy_model_mod.o \
    15231543        radiation_model_mod.o \
     1544        salsa_mod.o \
    15241545        subsidence_mod.o \
    15251546        surface_mod.o \
     
    15641585        random_function_mod.o\
    15651586        random_generator_parallel_mod.o \
     1587        salsa_mod.o \
    15661588        spectra_mod.o \
    15671589        surface_mod.o \
     
    15761598        mod_kinds.o \
    15771599        modules.o
     1600salsa_mod.o: \
     1601        modules.o \
     1602        mod_kinds.o \
     1603        advec_ws.o \
     1604        advec_s_pw.o \
     1605        advec_s_up.o \
     1606        chemistry_model_mod.o \
     1607        diffusion_s.o \
     1608        netcdf_data_input_mod.o \
     1609        plant_canopy_model_mod.o \
     1610        salsa_util_mod.o \
     1611        surface_mod.o \
     1612        netcdf_data_input_mod.o
     1613salsa_util_mod.o: \
     1614        mod_kinds.o \
     1615        modules.o
    15781616set_slicer_attributes_dvrp.o: \
    15791617        mod_kinds.o \
     
    16031641        modules.o \
    16041642        radiation_model_mod.o \
     1643        salsa_mod.o \
    16051644        surface_mod.o \
    16061645        turbulence_closure_mod.o \
     
    16421681        ocean_mod.o \
    16431682        pmc_interface_mod.o \
     1683        salsa_mod.o \
    16441684        turbulence_closure_mod.o \
    16451685        urban_surface_mod.o
     
    16811721        progress_bar_mod.o \
    16821722        radiation_model_mod.o \
     1723        salsa_mod.o \
    16831724        spectra_mod.o \
    16841725        surface_layer_fluxes_mod.o \
  • palm/trunk/SOURCE/advec_ws.f90

    r3302 r3467  
    2525! -----------------
    2626! $Id$
     27! Implementation of a new aerosol module salsa.
     28!
     29! 3302 2018-10-03 02:39:40Z raasch
    2730! Stokes drift velocity added in scalar advection
    2831!
     
    4750! 2731 2018-01-09 17:44:02Z suehring
    4851! Enable loop vectorization by splitting the k-loop
    49 ! 
     52!
    5053! 2718 2018-01-02 08:49:38Z maronga
    5154! Corrected "Former revisions" section
     
    315318       USE pegrid
    316319
     320       USE salsa_util_mod,                                                     &
     321           ONLY:  sums_salsa_ws_l   
     322       
    317323       USE statistics,                                                         &
    318324           ONLY:  sums_us2_ws_l, sums_vs2_ws_l, sums_ws2_ws_l, sums_wsncs_ws_l,&
     
    381387             ALLOCATE( sums_wssas_ws_l(nzb:nzt+1,0:threads_per_task-1) )
    382388             sums_wssas_ws_l = 0.0_wp
    383           ENDIF
     389          ENDIF       
     390!         
     391!--       Mona: Now always allocated
     392          ALLOCATE( sums_salsa_ws_l(nzb:nzt+1,0:threads_per_task-1) )
     393          sums_salsa_ws_l = 0.0_wp         
    384394
    385395       ENDIF
     
    10961106                  ws_scheme_sca
    10971107
    1098        USE kinds
     1108       USE kinds 
    10991109
    11001110       USE bulk_cloud_model_mod,                                               &
    11011111           ONLY: bulk_cloud_model, microphysics_morrison, microphysics_seifert
    11021112
     1113       USE salsa_util_mod,                                                     &
     1114           ONLY:  sums_salsa_ws_l           
     1115           
    11031116       USE statistics,                                                         &
    11041117           ONLY:  sums_us2_ws_l, sums_vs2_ws_l, sums_ws2_ws_l, sums_wsncs_ws_l,&
    11051118                  sums_wsnrs_ws_l, sums_wspts_ws_l, sums_wsqcs_ws_l,           &
    11061119                  sums_wsqrs_ws_l, sums_wsqs_ws_l, sums_wsss_ws_l,             &
    1107                   sums_wssas_ws_l, sums_wsus_ws_l, sums_wsvs_ws_l     
     1120                  sums_wssas_ws_l, sums_wsus_ws_l, sums_wsvs_ws_l
    11081121                   
    11091122
     
    11341147          ENDIF
    11351148          IF ( ocean_mode )  sums_wssas_ws_l = 0.0_wp
    1136 
     1149       
     1150          sums_salsa_ws_l = 0.0_wp
     1151         
     1152         
    11371153       ENDIF
    11381154
     
    11671183       USE pegrid
    11681184
     1185       USE salsa_util_mod,                                                     &
     1186           ONLY:  sums_salsa_ws_l   
     1187
    11691188       USE statistics,                                                         &
    11701189           ONLY:  hom, sums_wsncs_ws_l, sums_wsnrs_ws_l, sums_wspts_ws_l,      &
    11711190                  sums_wsqcs_ws_l,  sums_wsqrs_ws_l, sums_wsqs_ws_l,           &
    1172                   sums_wssas_ws_l, sums_wsss_ws_l, weight_substep   
     1191                  sums_wssas_ws_l, sums_wsss_ws_l, weight_substep
    11731192                 
    11741193
     
    17041723                    ) * weight_substep(intermediate_timestep_count)
    17051724             ENDDO
     1725                 
     1726         CASE ( 'aerosol_mass', 'aerosol_number', 'salsa_gas' )
     1727         
     1728             DO  k = nzb, nzt
     1729                sums_salsa_ws_l(k,tn)  = sums_salsa_ws_l(k,tn) +               &
     1730                    ( flux_t(k) / ( w(k,j,i) + SIGN( 1.0E-20_wp, w(k,j,i) ) )  &
     1731                                * ( w(k,j,i) - hom(k,1,3,0)                 )  &
     1732                    + diss_t(k) / ( ABS(w(k,j,i)) + 1.0E-20_wp              )  &
     1733                                *   ABS( w(k,j,i) - hom(k,1,3,0)            )  &
     1734                    ) * weight_substep(intermediate_timestep_count)
     1735             ENDDO             
    17061736
    17071737!          CASE ( 'kc' )
     
    32113241           
    32123242       USE kinds
     3243       
     3244       USE salsa_util_mod,                                                     &
     3245           ONLY:  sums_salsa_ws_l     
    32133246       
    32143247       USE statistics,                                                         &
     
    37313764                                *   ABS(w(k,j,i) - hom(k,1,3,0)             )  &
    37323765                            ) * weight_substep(intermediate_timestep_count)
    3733                     ENDDO   
     3766                    ENDDO 
     3767     
     3768                 CASE ( 'aerosol_mass', 'aerosol_number', 'salsa_gas' )
     3769                     DO  k = nzb, nzt
     3770                        sums_salsa_ws_l(k,tn)  = sums_salsa_ws_l(k,tn)         &
     3771                          + ( flux_t(k)                                        &
     3772                                / ( w(k,j,i) + SIGN( 1.0E-20_wp, w(k,j,i) ) )  &
     3773                                * ( w(k,j,i) - hom(k,1,3,0)                 )  &
     3774                            + diss_t(k)                                        &
     3775                                / ( ABS(w(k,j,i)) + 1.0E-20_wp              )  &
     3776                                *   ABS(w(k,j,i) - hom(k,1,3,0)             )  &
     3777                            ) * weight_substep(intermediate_timestep_count)
     3778                     ENDDO                   
    37343779                                   
    37353780
  • palm/trunk/SOURCE/average_3d_data.f90

    r3448 r3467  
    2525! -----------------
    2626! $Id$
     27! Implementation of a new aerosol module salsa.
     28!
     29! 3448 2018-10-29 18:14:31Z kanani
    2730! Adjustment of biometeorology calls
    2831!
     
    7174! Implementation of new microphysic scheme: cloud_scheme = 'morrison'
    7275! includes two more prognostic equations for cloud drop concentration (nc) 
    73 ! and cloud water content (qc).
     76! and cloud water content (qc).  
    7477!
    7578! 2233 2017-05-30 18:08:54Z suehring
     
    188191    USE radiation_model_mod,                                                   &
    189192        ONLY:  radiation, radiation_3d_data_averaging
     193           
     194    USE salsa_mod,                                                             &
     195        ONLY:  salsa, salsa_3d_data_averaging
    190196
    191197    USE turbulence_closure_mod,                                                &
     
    569575                CALL radiation_3d_data_averaging( 'average', doav(ii) )
    570576             ENDIF
     577             
     578             IF ( salsa )  THEN
     579                CALL salsa_3d_data_averaging( 'average', doav(ii) )
     580             ENDIF             
    571581
    572582             IF ( biometeorology )  THEN
  • palm/trunk/SOURCE/boundary_conds.f90

    r3347 r3467  
    2525! -----------------
    2626! $Id$
     27! Implementation of a new aerosol module salsa.
     28!
     29! 3347 2018-10-15 14:21:08Z suehring
    2730! Bugfix in setting boundary conditions in offline nesting
    2831!
     
    240243    USE pmc_interface,                                                         &
    241244        ONLY : nesting_mode, rans_mode_parent
     245 
     246    USE salsa_mod,                                                             &
     247        ONLY:  salsa, salsa_boundary_conds       
    242248
    243249    USE surface_mod,                                                           &
     
    13731379
    13741380    ENDIF
     1381   
     1382    IF ( salsa )  THEN
     1383       CALL salsa_boundary_conds
     1384    ENDIF
    13751385
    13761386 END SUBROUTINE boundary_conds
  • palm/trunk/SOURCE/check_parameters.f90

    r3454 r3467  
    2020! Current revisions:
    2121! -----------------
    22 !
     22!
     23! 2017-10-10 11:29:14Z monakurppa
     24! Implementation of a new aerosol module salsa.
    2325!
    2426! Former revisions:
     
    781783        ONLY:  radiation, radiation_check_data_output,                         &
    782784               radiation_check_data_output_pr, radiation_check_parameters
     785                           
     786    USE salsa_mod,                                                             &
     787        ONLY:  salsa, salsa_check_data_output, salsa_check_parameters       
    783788
    784789    USE spectra_mod,                                                           &
     
    15141519!-- Checks for surface data output
    15151520    IF ( surface_data_output )  CALL surface_output_check_parameters
     1521!   
     1522!-- When SALSA is used, perform additional checks
     1523    IF ( salsa )  CALL salsa_check_parameters     
    15161524
    15171525!
     
    32143222             ENDIF
    32153223
     3224             IF ( unit == 'illegal' .AND. salsa ) THEN
     3225                 CALL salsa_check_data_output( var, unit )
     3226             ENDIF   
     3227
    32163228             IF ( unit == 'illegal'  .AND.  urban_surface                      &
    32173229                                     .AND.  var(1:4) == 'usm_' )  THEN
  • palm/trunk/SOURCE/chem_emissions_mod.f90

    r3458 r3467  
    2727! -----------------
    2828! $Id$
     29! Enabled PARAMETRIZED mode for default surfaces when LSM is not applied but
     30! salsa is used
     31!
     32! 3458 2018-10-30 14:51:23Z kanani
    2933! from chemistry branch r3443, banzhafs, Russo:
    3034! Additional correction for index of input file of pre-processed mode
     
    885889   USE indices,                                                               &
    886890       ONLY: nnx,nny,nnz
     891   USE salsa_mod,                                                             &
     892       ONLY:  salsa
    887893   USE surface_mod,                                                           &
    888894       ONLY:  surf_lsm_h,surf_def_h,surf_usm_h
     
    13661372
    13671373       !> Streets are lsm surfaces, hence, no usm surface treatment required
    1368              IF (surf_lsm_h%ns .GT. 0) THEN
     1374             IF (surf_lsm_h%ns .GT. 0 ) THEN
    13691375                DO  m = 1, surf_lsm_h%ns
    13701376                   i = surf_lsm_h%i(m)
     
    14421448                   !> If no street type is defined, then assign null emissions to all the species
    14431449                      surf_lsm_h%cssws(:,m) = 0.0_wp
     1450
     1451                   ENDIF
     1452
     1453                ENDDO
     1454             ELSEIF ( salsa ) THEN
     1455                DO  m = 1, surf_def_h(0)%ns
     1456                   i = surf_def_h(0)%i(m)
     1457                   j = surf_def_h(0)%j(m)
     1458                   k = surf_def_h(0)%k(m)
     1459
     1460
     1461                   IF ( street_type_f%var(j,i) >= main_street_id  .AND.        &
     1462                        street_type_f%var(j,i) < max_street_id )               &
     1463                   THEN
     1464
     1465                      !> Cycle over already matched species
     1466                      DO  ispec=1,nspec_out
     1467
     1468                         !> PMs are already in mass units:micrograms: have to be converted to kilograms
     1469                         IF ( TRIM(spc_names(match_spec_model(ispec)))=="PM1"       &
     1470                              .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM25" &
     1471                              .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM10")&
     1472                         THEN
     1473                                 
     1474                            surf_def_h(0)%cssws(match_spec_model(ispec),m) =   &
     1475                                  emiss_factor_main(match_spec_input(ispec)) * &
     1476                                  emis_distribution(1,j,i,ispec) * rho_air(k) /&
     1477                                  time_factor(1)
     1478                         ELSE
     1479
     1480                         !> Other Species: inputs are micromoles: have to be converted             
     1481                            surf_def_h(0)%cssws(match_spec_model(ispec),m) =   &
     1482                               emiss_factor_main(match_spec_input(ispec)) *    &
     1483                               emis_distribution(1,j,i,ispec) *                &
     1484                               conv_to_ratio(k,j,i) *  rho_air(k) / time_factor(1)
     1485                         ENDIF
     1486                      ENDDO
     1487
     1488                   ELSEIF ( street_type_f%var(j,i) >= side_street_id  .AND.    &
     1489                            street_type_f%var(j,i) < main_street_id )          &
     1490                   THEN
     1491
     1492                   !> Cycle over already matched species
     1493                      DO  ispec=1,nspec_out
     1494
     1495                         !> PMs are already in mass units: micrograms
     1496                         IF ( TRIM(spc_names(match_spec_model(ispec)))=="PM1"   &
     1497                              .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM25" &
     1498                              .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM10")&
     1499                         THEN
     1500
     1501                            surf_def_h(0)%cssws(match_spec_model(ispec),m) =   &
     1502                               emiss_factor_side(match_spec_input(ispec)) *    &
     1503                               emis_distribution(1,j,i,ispec) * rho_air(k) /   &
     1504                               time_factor(1) 
     1505                         ELSE
     1506               
     1507                            surf_def_h(0)%cssws(match_spec_model(ispec),m) =   &
     1508                               emiss_factor_side(match_spec_input(ispec)) *    &
     1509                               emis_distribution(1,j,i,ispec) *                &
     1510                               conv_to_ratio(k,j,i) * rho_air(k) / time_factor(1)
     1511                         ENDIF
     1512
     1513                      ENDDO
     1514
     1515                   ELSE
     1516
     1517                   !> If no street type is defined, then assign null emissions to all the species
     1518                      surf_def_h(0)%cssws(:,m) = 0.0_wp
    14441519
    14451520                   ENDIF
  • palm/trunk/SOURCE/data_output_2d.f90

    r3448 r3467  
    2525! -----------------
    2626! $Id$
     27! Implementation of a new aerosol module salsa.
     28!
     29! 3448 2018-10-29 18:14:31Z kanani
    2730! Add biometeorology
    2831!
     
    314317    USE radiation_model_mod,                                                   &
    315318        ONLY:  radiation, radiation_data_output_2d
     319   
     320    USE salsa_mod,                                                             &
     321        ONLY:  salsa, salsa_data_output_2d   
    316322
    317323    USE surface_mod,                                                           &
     
    13381344                                                  nzb_do, nzt_do  )
    13391345                ENDIF
    1340 
    1341                 IF ( .NOT. found )  THEN
    1342                    CALL tcm_data_output_2d( av, do2d(av,if), found, grid, mode,&
    1343                                              local_pf, nzb_do, nzt_do )
    1344                 ENDIF
     1346               
     1347                IF ( .NOT. found  .AND.  salsa )  THEN
     1348                   CALL salsa_data_output_2d( av, do2d(av,if), found, grid,    &
     1349                                              mode, local_pf, two_d )
     1350                ENDIF                 
    13451351
    13461352                IF ( .NOT. found  .AND.  uv_exposure )  THEN
  • palm/trunk/SOURCE/data_output_3d.f90

    r3448 r3467  
    2525! -----------------
    2626! $Id$
     27! Implementation of a new aerosol module salsa.
     28!
     29! 3448 2018-10-29 18:14:31Z kanani
    2730! Adjustment of biometeorology calls
    2831!
     
    291294    USE radiation_model_mod,                                                   &
    292295        ONLY:  nzub, nzut, radiation, radiation_data_output_3d
     296               
     297    USE salsa_mod,                                                             &
     298        ONLY:  salsa, salsa_data_output_3d     
    293299
    294300    USE turbulence_closure_mod,                                                &
     
    775781                resorted = .TRUE.
    776782             ENDIF
     783             
     784!
     785!--          SALSA output
     786             IF ( .NOT. found  .AND.  salsa )  THEN
     787                CALL salsa_data_output_3d( av, do3d(av,if), found, local_pf )
     788                resorted = .TRUE.
     789             ENDIF                 
    777790
    778791             IF ( .NOT. found  .AND.  biometeorology )  THEN
  • palm/trunk/SOURCE/data_output_mask.f90

    r3435 r3467  
    2525! -----------------
    2626! $Id$
     27! Implementation of a new aerosol module salsa.
     28!
     29! 3435 2018-10-26 18:25:44Z gronemeier
    2730! Add terrain-following output
    2831!
     
    186189        ONLY:  radiation, radiation_data_output_mask
    187190
     191    USE salsa_mod,                                                             &
     192        ONLY:  salsa, salsa_data_output_mask     
     193       
    188194    USE surface_mod,                                                           &
    189         ONLY :  surf_def_h, surf_lsm_h, surf_usm_h, get_topography_top_index_ji
     195        ONLY :  surf_def_h, surf_lsm_h, surf_usm_h, get_topography_top_index_ji     
    190196
    191197    IMPLICIT NONE
     
    665671             ENDIF
    666672!
     673!--          SALSA quantities
     674             IF (  salsa )  THEN
     675                CALL salsa_data_output_mask( av, domask(mid,av,ivar), found,   &
     676                                             local_pf )
     677             ENDIF         
     678!
    667679!--          User defined quantity
    668680             IF ( .NOT. found )  THEN
  • palm/trunk/SOURCE/date_and_time_mod.f90

    r3458 r3467  
    2525! -----------------
    2626! $Id$
     27! Tabs removed
     28!
     29! 3458 2018-10-30 14:51:23Z kanani
    2730! from chemistry branch r3443, banzhafs:
    2831! Added initial hour_of_day, hour_of_year, day_of_year and month_of_year to
     
    563566    ELSE
    564567
    565         DO i_mon=1,index_mm
     568    DO i_mon=1,index_mm
    566569       
    567             sum_dd=sum_dd+days(i_mon)
    568 
    569         ENDDO
     570       sum_dd=sum_dd+days(i_mon)
     571
     572    ENDDO
    570573     
    571574    index_hh=(sum_dd*nhour)+(index_dd*nhour)+(hh)
  • palm/trunk/SOURCE/header.f90

    r3448 r3467  
    2525! -----------------
    2626! $Id$
     27! Implementation of a new aerosol module salsa.
     28!
     29! 3448 2018-10-29 18:14:31Z kanani
    2730! Add biometeorology
    2831!
     
    484487    USE radiation_model_mod,                                                   &
    485488        ONLY:  radiation, radiation_header
     489               
     490    USE salsa_mod,                                                             &
     491        ONLY:  salsa, salsa_header       
    486492   
    487493    USE spectra_mod,                                                           &
     
    20612067       ENDIF
    20622068    ENDIF
     2069   
     2070!
     2071!-- SALSA information
     2072    IF ( salsa )  CALL salsa_header( io )
    20632073
    20642074!
  • palm/trunk/SOURCE/init_3d_model.f90

    r3458 r3467  
    2525! -----------------
    2626! $Id$
     27! Implementation of a new aerosol module salsa.
     28!
     29! 3458 2018-10-30 14:51:23Z kanani
    2730! from chemistry branch r3443, basit:
    2831! bug fixed in sums and sums_l for chemistry profile output
     
    618621    USE random_generator_parallel,                                             &
    619622        ONLY:  init_parallel_random_generator
    620 
     623       
    621624    USE read_restart_data_mod,                                                 &
    622         ONLY:  rrd_read_parts_of_global, rrd_local                                     
     625        ONLY:  rrd_read_parts_of_global, rrd_local   
     626             
     627    USE salsa_mod,                                                             &
     628        ONLY:  salsa, salsa_init, salsa_init_arrays     
    623629   
    624630    USE statistics,                                                            &
     
    10651071    IF ( land_surface        )  CALL lsm_init_arrays
    10661072    IF ( ocean_mode          )  CALL ocean_init_arrays
     1073    IF ( salsa               )  CALL salsa_init_arrays
    10671074    IF ( wind_turbine        )  CALL wtm_init_arrays
    10681075    IF ( uv_exposure         )  CALL uvem_init_arrays
     
    24132420
    24142421!
     2422!-- If required, initialize quantities needed in SALSA
     2423    IF ( salsa )  THEN
     2424       CALL location_message( 'initializing SALSA model', .TRUE. )
     2425       CALL salsa_init
     2426       CALL location_message( 'finished', .TRUE. )
     2427    ENDIF
     2428
     2429!
    24152430!-- If required, initialize quantities needed for the gust module
    24162431    IF ( gust_module_enabled )  THEN
  • palm/trunk/SOURCE/init_masks.f90

    r3435 r3467  
    2525! -----------------
    2626! $Id$
     27! Implementation of a new aerosol module salsa.
     28!
     29! 3435 2018-10-26 18:25:44Z gronemeier
    2730! Add checks for chemistry and radiation model
    2831! Set indices for terrain-following masked output
     
    180183        ONLY:  particle_advection
    181184
    182     USE pegrid
     185    USE pegrid 
    183186
    184187    USE radiation_model_mod,                                                   &
    185188        ONLY:  radiation, radiation_check_data_output
     189       
     190    USE salsa_mod,                                                             &
     191        ONLY:  salsa, salsa_check_data_output
    186192
    187193    IMPLICIT NONE
     
    477483             
    478484                CALL user_check_data_output( var, unit )
     485                           
     486                IF ( salsa )  THEN
     487                   CALL salsa_check_data_output( var, unit )
     488                ENDIF               
    479489
    480490                IF ( unit == 'illegal'  .AND.  air_chemistry                   &
  • palm/trunk/SOURCE/lpm_pack_arrays.f90

    r3241 r3467  
    354354    END SUBROUTINE lpm_sort_timeloop_done
    355355
    356 
    357356 END MODULE lpm_pack_and_sort_mod
  • palm/trunk/SOURCE/modules.f90

    r3448 r3467  
    21392139    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  sums_l              !< subdomain sum (_l) gathered for various quantities
    21402140    REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  sums_l_l            !< subdomain sum (_l) of mixing length from diffusivities
    2141 
     2141   
    21422142    REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::  hom  !< horizontal mean of various quantities (profiles/timeseries)
    21432143
  • palm/trunk/SOURCE/netcdf_data_input_mod.f90

    r3464 r3467  
    2525! -----------------
    2626! $Id$
     27! Salsa implemented
     28!
     29! 3464 2018-10-30 18:08:55Z kanani
    2730! Define coordinate reference system (crs) and read from input dataset
    2831! Revise default values for reference coordinates
     
    776779!-- Public subroutines
    777780    PUBLIC netcdf_data_input_check_dynamic, netcdf_data_input_check_static,    &
    778            netcdf_data_input_chemistry_data, netcdf_data_input_inquire_file,                                     &
     781           netcdf_data_input_chemistry_data, netcdf_data_input_inquire_file,   &
    779782           netcdf_data_input_init, netcdf_data_input_init_lsm,                 &
    780783           netcdf_data_input_init_3d,                                          &
    781784           netcdf_data_input_interpolate, netcdf_data_input_offline_nesting,   &
    782            netcdf_data_input_surface_data, netcdf_data_input_topo
     785           netcdf_data_input_surface_data, netcdf_data_input_topo,             &
     786           get_attribute, get_dimension_length, get_variable, open_read_file
    783787
    784788 CONTAINS
  • palm/trunk/SOURCE/netcdf_interface_mod.f90

    r3464 r3467  
    2525! -----------------
    2626! $Id$
     27! - Salsa implemented
     28! - Bugfix convert_utm_to...
     29!
     30! 3464 2018-10-30 18:08:55Z kanani
    2731! - Add variable crs to output files
    2832! - Add long_name to UTM coordinates
     
    103107! 2718 2018-01-02 08:49:38Z maronga
    104108! Corrected "Former revisions" section
    105 ! 
     109!
    106110! 2696 2017-12-14 17:12:51Z kanani
    107111! Change in file header (GPL part)
     
    659663
    660664    USE radiation_model_mod,                                                   &
    661         ONLY: radiation, radiation_define_netcdf_grid
     665        ONLY: radiation, radiation_define_netcdf_grid     
     666     
     667    USE salsa_mod,                                                             &
     668        ONLY:  salsa, salsa_define_netcdf_grid             
    662669
    663670    USE spectra_mod,                                                           &
     
    11641171                CASE DEFAULT
    11651172!
    1166 !--                Check for quantities defined in other modules
     1173!--                Check for quantities defined in other modules                                                       
    11671174                   CALL tcm_define_netcdf_grid( domask( mid,av,i), found,      &
    11681175                                                        grid_x, grid_y, grid_z )
     
    11981205                                                         grid_z )
    11991206                   ENDIF
     1207!
     1208!--                Check for SALSA quantities
     1209                   IF ( .NOT. found  .AND.  salsa )  THEN
     1210                      CALL salsa_define_netcdf_grid( domask(mid,av,i), found,  &
     1211                                                     grid_x, grid_y, grid_z )
     1212                   ENDIF                 
    12001213!
    12011214!--                Now check for user-defined quantities
     
    20342047                   ENDIF
    20352048
     2049!
     2050!--                Check for SALSA quantities
     2051                   IF ( .NOT. found  .AND.  salsa )  THEN
     2052                      CALL salsa_define_netcdf_grid( do3d(av,i), found, grid_x,&
     2053                                                     grid_y, grid_z )
     2054                   ENDIF                 
     2055                   
    20362056!--                Check for user-defined quantities
    20372057                   IF ( .NOT. found )  THEN
     
    30573077                                                         grid_z )
    30583078                         ENDIF
     3079                         
     3080!
     3081!--                      Check for SALSA quantities
     3082                         IF ( .NOT. found  .AND.  salsa )  THEN
     3083                            CALL salsa_define_netcdf_grid( do2d(av,i), found,  &
     3084                                                           grid_x, grid_y,     &
     3085                                                           grid_z )
     3086                         ENDIF                       
    30593087
    30603088!
     
    40374065                                                            grid_z )
    40384066                      ENDIF
     4067                     
     4068!
     4069!--                   Check for SALSA quantities
     4070                      IF ( .NOT. found  .AND.  salsa )  THEN
     4071                         CALL salsa_define_netcdf_grid( do2d(av,i), found,     &
     4072                                                        grid_x, grid_y, grid_z )
     4073                      ENDIF                         
    40394074
    40404075!
     
    49705005                                                            grid_z )
    49715006                      ENDIF
    4972 
     5007                     
     5008!
     5009!--                   Check for SALSA quantities
     5010                      IF ( .NOT. found  .AND.  salsa )  THEN
     5011                         CALL salsa_define_netcdf_grid( do2d(av,i), found,     &
     5012                                                        grid_x, grid_y, grid_z )
     5013                      ENDIF                           
    49735014!
    49745015!--                   Check for gust module quantities
     
    72317272
    72327273       WRITE( message_identifier, '(''NC'',I4.4)' )  errno
     7274
    72337275       message_string = TRIM( NF90_STRERROR( nc_stat ) )
    72347276
     
    74357477    IMPLICIT NONE
    74367478
     7479    INTEGER(iwp) ::  j   !< loop index
     7480   
    74377481    REAL(wp), INTENT(in)  ::  eutm !< easting (UTM)
    74387482    REAL(wp), INTENT(out) ::  lat  !< geographic latitude in degree
     
    74477491    REAL(wp) ::  eta         !<
    74487492    REAL(wp) ::  eta_s       !<
    7449     REAL(wp) ::  j           !< loop index
    74507493    REAL(wp) ::  n           !< 3rd flattening
    74517494    REAL(wp) ::  n2          !< n^2
  • palm/trunk/SOURCE/parin.f90

    r3448 r3467  
    2525! -----------------
    2626! $Id$
     27! Implementation of a new aerosol module salsa.
     28!
     29! 3448 2018-10-29 18:14:31Z kanani
    2730! Add biometeorology
    2831!
     
    520523
    521524    USE read_restart_data_mod,                                                 &
    522         ONLY:  rrd_global     
     525        ONLY:  rrd_global 
     526             
     527    USE salsa_mod,                                                             &
     528        ONLY: salsa_parin         
    523529
    524530    USE spectra_mod,                                                           &
     
    912918          CALL uvem_parin
    913919!
     920!--       Check if SALSA processes should be carried out and read &salsa_par
     921!--       if required
     922          CALL salsa_parin         
     923!
    914924!--       Read user-defined variables
    915925          CALL user_parin
  • palm/trunk/SOURCE/plant_canopy_model_mod.f90

    r3449 r3467  
    299299!
    300300!-- Public variables and constants
    301     PUBLIC pc_heating_rate, pc_transpiration_rate, pc_latent_rate,             &
    302             canopy_mode, cthf, dt_plant_canopy, lad, lad_s, pch_index,         &
    303             plant_canopy_transpiration
     301    PUBLIC cdc, pc_heating_rate, pc_transpiration_rate, pc_latent_rate,       &
     302           canopy_mode, cthf, dt_plant_canopy, lad, lad_s, pch_index,         &
     303           plant_canopy_transpiration
    304304
    305305    INTERFACE pcm_calc_transpiration_rate
  • palm/trunk/SOURCE/prognostic_equations.f90

    r3458 r3467  
    2525! -----------------
    2626! $Id$
     27! Implementation of a new aerosol module salsa.
     28! Remove cpu-logs from i,j loop in cache version.
     29!
     30! 3458 2018-10-30 14:51:23Z kanani
    2731! remove duplicate USE chem_modules
    2832! from chemistry branch r3443, banzhafs, basit:
     
    368372               timestep_scheme, tsc, use_subsidence_tendencies,                &
    369373               use_upstream_for_tke, wind_turbine, ws_scheme_mom,              &
    370                ws_scheme_sca, urban_surface, land_surface
     374               ws_scheme_sca, urban_surface, land_surface,                     &
     375               time_since_reference_point
    371376
    372377    USE coriolis_mod,                                                          &
     
    407412        ONLY:  radiation, radiation_tendency,                                  &
    408413               skip_time_do_radiation
    409 
     414                         
     415    USE salsa_mod,                                                             &
     416        ONLY:  aerosol_mass, aerosol_number, dt_salsa, last_salsa_time, nbins, &
     417               ncc_tot, ngast, salsa, salsa_boundary_conds, salsa_diagnostics, &
     418               salsa_driver, salsa_gas, salsa_gases_from_chem, salsa_tendency, &
     419               skip_time_do_salsa
     420               
     421    USE salsa_util_mod,                                                        &
     422        ONLY:  sums_salsa_ws_l                             
     423   
    410424    USE statistics,                                                            &
    411425        ONLY:  hom
     
    460474
    461475    IMPLICIT NONE
    462 
     476   
     477    INTEGER(iwp) ::  b                   !< index for aerosol size bins (salsa)
     478    INTEGER(iwp) ::  c                   !< index for chemical compounds (salsa)
     479    INTEGER(iwp) ::  g                   !< index for gaseous compounds (salsa)
    463480    INTEGER(iwp) ::  i                   !<
    464481    INTEGER(iwp) ::  i_omp_start         !<
     
    523540             lsp_usr = lsp_usr +1
    524541          ENDDO
    525          
     542
     543
    526544       ENDDO
    527545       CALL cpu_log( log_point_s(84), 'chemistry exch-horiz ', 'stop' )
     
    530548
    531549    ENDIF       
     550
     551!
     552!-- Run SALSA and aerosol dynamic processes. SALSA is run with a longer time
     553!-- step. The exchange of ghost points is required after this update of the
     554!-- concentrations of aerosol number and mass
     555    IF ( salsa )  THEN
     556       
     557       IF ( time_since_reference_point >= skip_time_do_salsa )  THEN                 
     558          IF ( ( time_since_reference_point - last_salsa_time ) >= dt_salsa )  &
     559          THEN
     560             CALL cpu_log( log_point_s(90), 'salsa processes ', 'start' )
     561             !$OMP PARALLEL PRIVATE (i,j,b,c,g)
     562             !$OMP DO
     563!
     564!--          Call salsa processes
     565             DO  i = nxl, nxr
     566                DO  j = nys, nyn
     567                   CALL salsa_diagnostics( i, j )
     568                   CALL salsa_driver( i, j, 3 )
     569                   CALL salsa_diagnostics( i, j )
     570                ENDDO
     571             ENDDO
     572             
     573             CALL cpu_log( log_point_s(90), 'salsa processes ', 'stop' )
     574             
     575             CALL cpu_log( log_point_s(91), 'salsa exch-horiz ', 'start' )
     576!
     577!--          Exchange ghost points and decycle if needed.
     578             DO  b = 1, nbins
     579                CALL exchange_horiz( aerosol_number(b)%conc, nbgp )
     580                CALL salsa_boundary_conds( aerosol_number(b)%conc_p,           &
     581                                           aerosol_number(b)%init )
     582                DO  c = 1, ncc_tot
     583                   CALL exchange_horiz( aerosol_mass((c-1)*nbins+b)%conc, nbgp )
     584                   CALL salsa_boundary_conds(                                  &
     585                                           aerosol_mass((c-1)*nbins+b)%conc_p, &
     586                                           aerosol_mass((c-1)*nbins+b)%init )
     587                ENDDO
     588             ENDDO
     589             
     590             IF ( .NOT. salsa_gases_from_chem )  THEN
     591                DO  g = 1, ngast
     592                   CALL exchange_horiz( salsa_gas(g)%conc, nbgp )
     593                   CALL salsa_boundary_conds( salsa_gas(g)%conc_p,             &
     594                                              salsa_gas(g)%init )
     595                ENDDO
     596             ENDIF
     597             CALL cpu_log( log_point_s(91), 'salsa exch-horiz ', 'stop' )
     598             
     599             !$OMP END PARALLEL
     600             last_salsa_time = time_since_reference_point
     601             
     602          ENDIF
     603         
     604       ENDIF
     605       
     606    ENDIF
    532607
    533608!
     
    549624!
    550625!-- Loop over all prognostic equations
    551     !$OMP PARALLEL PRIVATE (i,i_omp_start,j,k,loop_start,tn)
     626!-- b, c ang g added for SALSA
     627    !$OMP PARALLEL PRIVATE (i,i_omp_start,j,k,loop_start,tn,b,c,g)
    552628
    553629    !$  tn = omp_get_thread_num()
     
    13101386          IF ( air_chemistry )  THEN
    13111387             !> TODO: remove time measurement since it slows down performance because it will be called extremely often
    1312              CALL cpu_log( log_point(83), '(chem advec+diff+prog)', 'start' )
    13131388!
    13141389!--          Loop over chemical species
     
    13241399                                     chem_species(lsp)%diss_l_cs )       
    13251400             ENDDO
    1326 
    1327              CALL cpu_log( log_point(83), '(chem advec+diff+prog)', 'stop' )             
     1401         
    13281402          ENDIF   ! Chemical equations
    13291403!
     
    13321406             CALL ocean_prognostic_equations( i, j, i_omp_start, tn )
    13331407          ENDIF
     1408       
     1409          IF ( salsa )  THEN
     1410!
     1411!--          Loop over aerosol size bins: number and mass bins
     1412             IF ( time_since_reference_point >= skip_time_do_salsa )  THEN
     1413             
     1414                DO  b = 1, nbins               
     1415                   sums_salsa_ws_l = aerosol_number(b)%sums_ws_l
     1416                   CALL salsa_tendency( 'aerosol_number',                      &
     1417                                         aerosol_number(b)%conc_p,             &
     1418                                         aerosol_number(b)%conc,               &
     1419                                         aerosol_number(b)%tconc_m,            &
     1420                                         i, j, i_omp_start, tn, b, b,          &
     1421                                         aerosol_number(b)%flux_s,             &
     1422                                         aerosol_number(b)%diss_s,             &
     1423                                         aerosol_number(b)%flux_l,             &
     1424                                         aerosol_number(b)%diss_l,             &
     1425                                         aerosol_number(b)%init )
     1426                   aerosol_number(b)%sums_ws_l = sums_salsa_ws_l
     1427                   DO  c = 1, ncc_tot
     1428                      sums_salsa_ws_l = aerosol_mass((c-1)*nbins+b)%sums_ws_l
     1429                      CALL salsa_tendency( 'aerosol_mass',                     &
     1430                                            aerosol_mass((c-1)*nbins+b)%conc_p,&
     1431                                            aerosol_mass((c-1)*nbins+b)%conc,  &
     1432                                            aerosol_mass((c-1)*nbins+b)%tconc_m,&
     1433                                            i, j, i_omp_start, tn, b, c,       &
     1434                                            aerosol_mass((c-1)*nbins+b)%flux_s,&
     1435                                            aerosol_mass((c-1)*nbins+b)%diss_s,&
     1436                                            aerosol_mass((c-1)*nbins+b)%flux_l,&
     1437                                            aerosol_mass((c-1)*nbins+b)%diss_l,&
     1438                                            aerosol_mass((c-1)*nbins+b)%init )
     1439                      aerosol_mass((c-1)*nbins+b)%sums_ws_l = sums_salsa_ws_l
     1440                   ENDDO
     1441                ENDDO
     1442                IF ( .NOT. salsa_gases_from_chem )  THEN
     1443                   DO  g = 1, ngast
     1444                      sums_salsa_ws_l = salsa_gas(g)%sums_ws_l
     1445                      CALL salsa_tendency( 'salsa_gas', salsa_gas(g)%conc_p,   &
     1446                                      salsa_gas(g)%conc, salsa_gas(g)%tconc_m, &
     1447                                      i, j, i_omp_start, tn, g, g,             &
     1448                                      salsa_gas(g)%flux_s, salsa_gas(g)%diss_s,&
     1449                                      salsa_gas(g)%flux_l, salsa_gas(g)%diss_l,&
     1450                                      salsa_gas(g)%init )
     1451                      salsa_gas(g)%sums_ws_l = sums_salsa_ws_l
     1452                   ENDDO
     1453                ENDIF
     1454             
     1455             ENDIF
     1456             
     1457          ENDIF       
    13341458
    13351459       ENDDO  ! loop over j
     
    13551479    IMPLICIT NONE
    13561480
     1481    INTEGER(iwp) ::  b     !< index for aerosol size bins (salsa)
     1482    INTEGER(iwp) ::  c     !< index for chemical compounds (salsa)
     1483    INTEGER(iwp) ::  g     !< index for gaseous compounds (salsa)
    13571484    INTEGER(iwp) ::  i     !<
    13581485    INTEGER(iwp) ::  j     !<
     
    13621489    REAL(wp)     ::  sbt  !<
    13631490
     1491!
     1492!-- Run SALSA and aerosol dynamic processes. SALSA is run with a longer time
     1493!-- step. The exchange of ghost points is required after this update of the
     1494!-- concentrations of aerosol number and mass
     1495    IF ( salsa )  THEN
     1496       
     1497       IF ( time_since_reference_point >= skip_time_do_salsa )  THEN
     1498       
     1499          IF ( ( time_since_reference_point - last_salsa_time ) >= dt_salsa )  &
     1500          THEN
     1501         
     1502             CALL cpu_log( log_point_s(90), 'salsa processes ', 'start' )
     1503             !$OMP PARALLEL PRIVATE (i,j,b,c,g)
     1504             !$OMP DO
     1505!
     1506!--          Call salsa processes
     1507             DO  i = nxl, nxr
     1508                DO  j = nys, nyn
     1509                   CALL salsa_diagnostics( i, j )
     1510                   CALL salsa_driver( i, j, 3 )
     1511                   CALL salsa_diagnostics( i, j )
     1512                ENDDO
     1513             ENDDO
     1514             
     1515             CALL cpu_log( log_point_s(90), 'salsa processes ', 'stop' )
     1516             
     1517             CALL cpu_log( log_point_s(91), 'salsa exch-horiz ', 'start' )
     1518!
     1519!--          Exchange ghost points and decycle if needed.
     1520             DO  b = 1, nbins
     1521                CALL exchange_horiz( aerosol_number(b)%conc, nbgp )
     1522                CALL salsa_boundary_conds( aerosol_number(b)%conc_p,           &
     1523                                           aerosol_number(b)%init )
     1524                DO  c = 1, ncc_tot
     1525                   CALL exchange_horiz( aerosol_mass((c-1)*nbins+b)%conc, nbgp )
     1526                   CALL salsa_boundary_conds(                                  &
     1527                                           aerosol_mass((c-1)*nbins+b)%conc_p, &
     1528                                           aerosol_mass((c-1)*nbins+b)%init )
     1529                ENDDO
     1530             ENDDO
     1531             
     1532             IF ( .NOT. salsa_gases_from_chem )  THEN
     1533                DO  g = 1, ngast
     1534                   CALL exchange_horiz( salsa_gas(g)%conc, nbgp )
     1535                   CALL salsa_boundary_conds( salsa_gas(g)%conc_p,             &
     1536                                              salsa_gas(g)%init )
     1537                ENDDO
     1538             ENDIF
     1539             CALL cpu_log( log_point_s(91), 'salsa exch-horiz ', 'stop' )
     1540             
     1541             !$OMP END PARALLEL
     1542             last_salsa_time = time_since_reference_point
     1543             
     1544          ENDIF
     1545         
     1546       ENDIF
     1547       
     1548    ENDIF
    13641549
    13651550!
     
    23922577       CALL cpu_log( log_point(83), '(chem advec+diff+prog)', 'stop' )             
    23932578    ENDIF   ! Chemicals equations
     2579       
     2580    IF ( salsa )  THEN
     2581       CALL cpu_log( log_point_s(92), 'salsa advec+diff+prog ', 'start' )
     2582!
     2583!--          Loop over aerosol size bins: number and mass bins
     2584       IF ( time_since_reference_point >= skip_time_do_salsa )  THEN
     2585       
     2586          DO  b = 1, nbins               
     2587             sums_salsa_ws_l = aerosol_number(b)%sums_ws_l
     2588             CALL salsa_tendency( 'aerosol_number', aerosol_number(b)%conc_p,  &
     2589                                   aerosol_number(b)%conc,                     &
     2590                                   aerosol_number(b)%tconc_m,                  &
     2591                                   b, b, aerosol_number(b)%init )
     2592             aerosol_number(b)%sums_ws_l = sums_salsa_ws_l
     2593             DO  c = 1, ncc_tot
     2594                sums_salsa_ws_l = aerosol_mass((c-1)*nbins+b)%sums_ws_l
     2595                CALL salsa_tendency( 'aerosol_mass',                           &
     2596                                      aerosol_mass((c-1)*nbins+b)%conc_p,      &
     2597                                      aerosol_mass((c-1)*nbins+b)%conc,        &
     2598                                      aerosol_mass((c-1)*nbins+b)%tconc_m,     &
     2599                                      b, c, aerosol_mass((c-1)*nbins+b)%init )
     2600                aerosol_mass((c-1)*nbins+b)%sums_ws_l = sums_salsa_ws_l
     2601             ENDDO
     2602          ENDDO
     2603          IF ( .NOT. salsa_gases_from_chem )  THEN
     2604             DO  g = 1, ngast
     2605                sums_salsa_ws_l = salsa_gas(g)%sums_ws_l
     2606                CALL salsa_tendency( 'salsa_gas', salsa_gas(g)%conc_p,         &
     2607                                      salsa_gas(g)%conc, salsa_gas(g)%tconc_m, &
     2608                                      g, g, salsa_gas(g)%init )
     2609                salsa_gas(g)%sums_ws_l = sums_salsa_ws_l
     2610             ENDDO
     2611          ENDIF
     2612       
     2613       ENDIF
     2614       
     2615       CALL cpu_log( log_point_s(92), 'salsa advec+diff+prog ', 'stop' )
     2616    ENDIF 
    23942617
    23952618!
  • palm/trunk/SOURCE/read_restart_data_mod.f90

    r3355 r3467  
    10851085    USE random_generator_parallel,                                             &
    10861086        ONLY:  id_random_array, seq_random_array
     1087   
     1088    USE salsa_mod,                                                             &
     1089        ONLY:  salsa, salsa_rrd_local
    10871090
    10881091    USE surface_mod,                                                           &
     
    19071910                                           nyn_on_file, nysf, nysc,            &
    19081911                                           nys_on_file, found )
     1912!
     1913!--                Read salsa restart data
     1914                   IF ( .NOT. found  .AND.  salsa )  THEN
     1915                      CALL salsa_rrd_local
     1916                   ENDIF                                               
    19091917
    19101918!
  • palm/trunk/SOURCE/sum_up_3d_data.f90

    r3448 r3467  
    2525! -----------------
    2626! $Id$
     27! Implementation of a new aerosol module salsa.
     28!
     29! 3448 2018-10-29 18:14:31Z kanani
    2730! Adjustment of biometeorology calls
    2831!
     
    275278    USE radiation_model_mod,                                                   &
    276279        ONLY:  radiation, radiation_3d_data_averaging
     280         
     281    USE salsa_mod,                                                             &
     282        ONLY:  salsa, salsa_3d_data_averaging         
    277283
    278284    USE surface_mod,                                                           &
     
    539545                   CALL radiation_3d_data_averaging( 'allocate', doav(ii) )
    540546                ENDIF
     547               
     548!
     549!--             SALSA quantity
     550                IF ( salsa )  THEN
     551                   CALL salsa_3d_data_averaging( 'allocate', doav(ii) )
     552                ENDIF               
    541553
    542554                CALL tcm_3d_data_averaging( 'allocate', doav(ii) )
     
    11871199                CALL radiation_3d_data_averaging( 'sum', doav(ii) )
    11881200             ENDIF
     1201             
     1202!
     1203!--          SALSA quantity
     1204             IF ( salsa )  THEN
     1205                CALL salsa_3d_data_averaging( 'sum', doav(ii) )
     1206             ENDIF                 
    11891207
    11901208             CALL tcm_3d_data_averaging( 'sum', doav(ii) )
  • palm/trunk/SOURCE/surface_mod.f90

    r3444 r3467  
    175175! 2547 2017-10-16 12:41:56Z schwenkel
    176176! extended by cloud_droplets option
     177!
     178! 2526 2017-10-10 11:29:14Z monakurppa
     179! Implementation of a new aerosol module salsa: new surface fluxes for aerosols
     180! and gases.
    177181!
    178182! 2508 2017-10-02 08:57:09Z suehring
     
    322326       REAL(wp), DIMENSION(:), ALLOCATABLE ::  nrsws     !< surface flux nr
    323327       REAL(wp), DIMENSION(:), ALLOCATABLE ::  sasws     !< surface flux salinity
     328!--    Added for SALSA:
     329       REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  answs   !< surface flux aerosol number: dim 1: flux, dim 2: bin
     330       REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  amsws   !< surface flux aerosol mass:   dim 1: flux, dim 2: bin
     331       REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  gtsws   !< surface flux gesous tracers: dim 1: flux, dim 2: gas
    324332       
    325333       REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  cssws   !< surface flux chemical species
     
    522530       REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_liq_eb_av       !< average of qsws_liq_eb
    523531       REAL(wp), DIMENSION(:), ALLOCATABLE ::  t_surf_wall_av        !< average of wall surface temperature (K)
     532       REAL(wp), DIMENSION(:), ALLOCATABLE ::  t_surf_av        !< average of wall surface temperature (K)
    524533       REAL(wp), DIMENSION(:), ALLOCATABLE ::  t_surf_window_av !< average of window surface temperature (K)
    525534       REAL(wp), DIMENSION(:), ALLOCATABLE ::  t_surf_green_av  !< average of green wall surface temperature (K)
  • palm/trunk/SOURCE/swap_timelevel.f90

    r3303 r3467  
    2525! -----------------
    2626! $Id$
     27! Implementation of a new aerosol module salsa.
     28!
     29! 3303 2018-10-03 12:04:15Z raasch
    2730! bugfix for swapping in case of ocean mode
    2831!
     
    158161    USE control_parameters,                                                    &
    159162        ONLY:  air_chemistry, humidity, land_surface, neutral, ocean_mode,     &
    160                passive_scalar, timestep_count, urban_surface
     163               passive_scalar, simulated_time, timestep_count, urban_surface,  &
     164               time_since_reference_point
    161165
    162166    USE gust_mod,                                                              &
     
    176180    USE pmc_interface,                                                         &
    177181        ONLY: nested_run, pmci_set_swaplevel
     182         
     183    USE salsa_mod,                                                             &
     184        ONLY:  salsa, salsa_swap_timelevel, skip_time_do_salsa             
    178185
    179186    USE turbulence_closure_mod,                                                &
     
    285292       CALL ocean_swap_timelevel( MOD( timestep_count, 2 ) )
    286293    ENDIF
     294   
     295    IF ( salsa  .AND.  simulated_time >= time_since_reference_point )  THEN
     296       CALL salsa_swap_timelevel(  MOD( timestep_count, 2 ) )
     297    ENDIF 
    287298
    288299    CALL tcm_swap_timelevel( MOD( timestep_count, 2) )
  • palm/trunk/SOURCE/time_integration.f90

    r3448 r3467  
    2525! -----------------
    2626! $Id$
     27! Implementation of a new aerosol module salsa.
     28!
     29! 3448 2018-10-29 18:14:31Z kanani
    2730! Add biometeorology
    2831!
     
    549552               stg_adjust, stg_main, time_stg_adjust, time_stg_call,           &
    550553               use_syn_turb_gen
     554         
     555    USE salsa_mod,                                                             &
     556        ONLY: aerosol_number, aerosol_mass, nbins, ncc_tot, ngast, salsa,      &
     557              salsa_boundary_conds, salsa_gas, salsa_gases_from_chem,          &
     558              skip_time_do_salsa           
    551559
    552560    USE user_actions_mod,                                                      &
     
    571579
    572580    CHARACTER (LEN=9) ::  time_to_string   !<
    573 
    574     INTEGER(iwp)      ::  lsp       !<
     581   
     582    INTEGER(iwp)      ::  b !< index for aerosol size bins   
     583    INTEGER(iwp)      ::  c !< index for chemical compounds in aerosol size bins
     584    INTEGER(iwp)      ::  g !< index for gaseous compounds
     585    INTEGER(iwp)      ::  lsp
    575586    INTEGER(iwp)      ::  lsp_usr   !<
    576587    INTEGER(iwp)      ::  n         !< loop counter for chemistry species
     
    694705          CALL cpu_log( log_point(55), 'wind_turbine', 'stop' )
    695706
    696        ENDIF      
     707       ENDIF   
    697708       
    698709!
     
    852863          ENDIF
    853864
     865          IF ( salsa  .AND.  time_since_reference_point >= skip_time_do_salsa )&
     866          THEN
     867             CALL cpu_log( log_point_s(91), 'salsa exch-horiz ', 'start' )
     868             DO  b = 1, nbins
     869                CALL exchange_horiz( aerosol_number(b)%conc_p, nbgp )
     870                CALL cpu_log( log_point_s(93), 'salsa decycle', 'start' )
     871                CALL salsa_boundary_conds( aerosol_number(b)%conc_p,           &
     872                                           aerosol_number(b)%init )
     873                CALL cpu_log( log_point_s(93), 'salsa decycle', 'stop' )
     874                DO  c = 1, ncc_tot
     875                   CALL exchange_horiz( aerosol_mass((c-1)*nbins+b)%conc_p,    &
     876                                        nbgp )
     877                   CALL cpu_log( log_point_s(93), 'salsa decycle', 'start' )
     878                   CALL salsa_boundary_conds( aerosol_mass((c-1)*nbins+b)%conc_p,&
     879                                              aerosol_mass((c-1)*nbins+b)%init )
     880                   CALL cpu_log( log_point_s(93), 'salsa decycle', 'stop' )
     881                ENDDO
     882             ENDDO
     883             IF ( .NOT. salsa_gases_from_chem )  THEN
     884                DO  g = 1, ngast
     885                   CALL exchange_horiz( salsa_gas(g)%conc_p, nbgp )
     886                   CALL cpu_log( log_point_s(93), 'salsa decycle', 'start' )
     887                   CALL salsa_boundary_conds( salsa_gas(g)%conc_p,             &
     888                                              salsa_gas(g)%init )
     889                   CALL cpu_log( log_point_s(93), 'salsa decycle', 'stop' )
     890             ENDDO
     891             ENDIF
     892             CALL cpu_log( log_point_s(91), 'salsa exch-horiz ', 'stop' )
     893          ENDIF         
     894
    854895          CALL cpu_log( log_point(26), 'exchange-horiz-progn', 'stop' )
    855896
     
    906947                ENDIF
    907948
    908                 IF ( passive_scalar )  CALL exchange_horiz( s, nbgp )
     949                IF ( passive_scalar )  CALL exchange_horiz( s, nbgp ) 
     950               
    909951                IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e, nbgp )
    910952
     
    926968!--          Correct the w top-BC in nest domains to ensure mass conservation.
    927969!--          This action must never be done for the root domain. Vertical
    928 !--          nesting implies mass conservation.
    929970!--          Commented out April 18, 2018 as seemingly unnecessary.
    930971!--          Will later be completely removed.
     
    12481289          time_dopr       = time_dopr        + dt_3d
    12491290       ENDIF
    1250        time_dopr_listing          = time_dopr_listing        + dt_3d
     1291       time_dopr_listing  = time_dopr_listing + dt_3d
    12511292       time_run_control   = time_run_control + dt_3d
    12521293!
  • palm/trunk/SOURCE/time_integration_spinup.f90

    • Property svn:mergeinfo deleted
  • palm/trunk/SOURCE/write_restart_data_mod.f90

    r3355 r3467  
    2525! -----------------
    2626! $Id$
     27! Implementation of a new aerosol module salsa.
     28!
     29! 3355 2018-10-16 14:03:34Z knoop
    2730! changes concerning modularization of ocean option
    2831!
     
    940943       USE random_generator_parallel,                                          &
    941944           ONLY:  id_random_array, seq_random_array
     945             
     946       USE salsa_mod,                                                          &
     947           ONLY:  salsa, salsa_wrd_local         
    942948
    943949       USE surface_mod,                                                        &
     
    12691275       CALL surface_wrd_local
    12701276       IF ( radiation )            CALL radiation_wrd_local
     1277       IF ( salsa )                CALL salsa_wrd_local
    12711278       IF ( urban_surface )        CALL usm_wrd_local
    12721279
Note: See TracChangeset for help on using the changeset viewer.