Changeset 3637 for palm/trunk/SOURCE


Ignore:
Timestamp:
Dec 20, 2018 1:51:36 AM (5 years ago)
Author:
knoop
Message:

M Makefile

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

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/Makefile

    r3634 r3637  
    2525# -----------------
    2626# $Id$
     27# Implementation of the PALM module interface
     28#
     29# 3634 2018-12-18 12:31:28Z knoop
    2730# OpenACC port for SPEC
    2831#
     
    623626        bulk_cloud_model_mod.f90 \
    624627        model_1d_mod.f90 \
     628        module_interface.f90 \
    625629        mod_kinds.f90 \
    626630        mod_particle_attributes.f90 \
     
    785789        modules.o
    786790average_3d_data.o: \
    787         biometeorology_mod.o \
    788         bulk_cloud_model_mod.o \
    789         chemistry_model_mod.o \
    790791        cpulog_mod.o \
    791792        exchange_horiz_2d.o \
    792         gust_mod.o \
    793         land_surface_model_mod.o \
    794         mod_kinds.o \
    795         modules.o \
    796         ocean_mod.o \
    797         radiation_model_mod.o \
    798         salsa_mod.o \
    799         turbulence_closure_mod.o \
    800         urban_surface_mod.o
     793        mod_kinds.o \
     794        module_interface.o \
     795        modules.o \
     796        turbulence_closure_mod.o
    801797basic_constants_and_equations_mod.o: \
    802798        mod_kinds.o
     
    843839check_parameters.o: \
    844840        basic_constants_and_equations_mod.o \
    845         biometeorology_mod.o \
    846         bulk_cloud_model_mod.o \
    847841        chemistry_model_mod.o \
    848842        chem_emissions_mod.o \
    849         gust_mod.o \
    850843        init_vertical_profiles.o \
    851         land_surface_model_mod.o \
    852         large_scale_forcing_nudging_mod.o \
    853844        model_1d_mod.o \
    854         mod_kinds.o \
    855         modules.o \
    856         nesting_offl_mod.o \
     845        module_interface.o \
     846        mod_kinds.o \
     847        modules.o \
    857848        netcdf_data_input_mod.o \
    858849        netcdf_interface_mod.o \
    859         ocean_mod.o \
    860         plant_canopy_model_mod.o \
    861850        pmc_interface_mod.o \
    862         radiation_model_mod.o \
    863         salsa_mod.o \
    864         spectra_mod.o \
    865851        subsidence_mod.o \
    866         surface_output_mod.o \
    867         synthetic_turbulence_generator_mod.o \
    868852        turbulence_closure_mod.o \
    869         urban_surface_mod.o \
    870         vertical_nesting_mod.o \
    871         wind_turbine_model_mod.o
     853        vertical_nesting_mod.o
    872854chem_emissions_mod.o: \
    873855        chem_gasphase_mod.o \
     
    978960data_output_2d.o: \
    979961        basic_constants_and_equations_mod.o \
    980         biometeorology_mod.o \
    981         bulk_cloud_model_mod.o \
    982         chemistry_model_mod.o\
    983         cpulog_mod.o \
    984         gust_mod.o \
     962        bulk_cloud_model_mod.o \
     963        cpulog_mod.o \
    985964        land_surface_model_mod.o \
    986965        mod_kinds.o \
    987966        mod_particle_attributes.o \
    988         modules.o \
    989         netcdf_interface_mod.o \
    990         ocean_mod.o \
    991         radiation_model_mod.o \
    992         salsa_mod.o \
     967        module_interface.o \
     968        modules.o \
     969        netcdf_interface_mod.o \
    993970        surface_mod.o \
    994971        urban_surface_mod.o
    995972data_output_3d.o: \
    996973        basic_constants_and_equations_mod.o \
    997         biometeorology_mod.o \
    998         bulk_cloud_model_mod.o \
    999         chemistry_model_mod.o \
    1000         cpulog_mod.o \
    1001         gust_mod.o \
     974        bulk_cloud_model_mod.o \
     975        cpulog_mod.o \
    1002976        land_surface_model_mod.o \
    1003977        mod_kinds.o \
    1004978        mod_particle_attributes.o \
    1005         modules.o \
    1006         netcdf_interface_mod.o \
    1007         ocean_mod.o \
    1008         salsa_mod.o \
     979        module_interface.o \
     980        modules.o \
     981        netcdf_interface_mod.o \
     982        radiation_model_mod.o \
    1009983        turbulence_closure_mod.o \
    1010984        urban_surface_mod.o
     
    10581032        basic_constants_and_equations_mod.o \
    10591033        bulk_cloud_model_mod.o \
    1060         chemistry_model_mod.o \
    1061         cpulog_mod.o \
    1062         gust_mod.o \
     1034        chem_modules.o \
     1035        cpulog_mod.o \
    10631036        land_surface_model_mod.o \
    10641037        large_scale_forcing_nudging_mod.o \
    10651038        mod_kinds.o \
     1039        module_interface.o \
    10661040        modules.o \
    10671041        netcdf_interface_mod.o \
     
    10761050header.o: \
    10771051        basic_constants_and_equations_mod.o \
    1078         biometeorology_mod.o \
    1079         bulk_cloud_model_mod.o \
    1080         chemistry_model_mod.o \
     1052        bulk_cloud_model_mod.o \
    10811053        cpulog_mod.o \
    10821054        date_and_time_mod.o \
    1083         gust_mod.o \
    1084         land_surface_model_mod.o \
    1085         large_scale_forcing_nudging_mod.o \
    10861055        model_1d_mod.o \
    1087         mod_kinds.o \
    1088         modules.o \
    1089         netcdf_interface_mod.o \
    1090         nesting_offl_mod.o \
     1056        module_interface.o \
     1057        mod_kinds.o \
     1058        modules.o \
     1059        netcdf_interface_mod.o \
    10911060        ocean_mod.o \
    10921061        plant_canopy_model_mod.o \
    10931062        pmc_handle_communicator_mod.o \
    10941063        pmc_interface_mod.o \
    1095         radiation_model_mod.o \
    1096         salsa_mod.o \
    1097         spectra_mod.o \
    10981064        subsidence_mod.o \
    1099         surface_mod.o \
    1100         virtual_flight_mod.o
     1065        surface_mod.o
    11011066indoor_model_mod.o: \
    11021067        cpulog_mod.o \
     
    13551320        modules.o \
    13561321        time_to_string.o
     1322module_interface.o: \
     1323        mod_kinds.o \
     1324        modules.o \
     1325        biometeorology_mod.o \
     1326        bulk_cloud_model_mod.o \
     1327        chemistry_model_mod.o \
     1328        gust_mod.o \
     1329        indoor_model_mod.o \
     1330        land_surface_model_mod.o \
     1331        large_scale_forcing_nudging_mod.o \
     1332        multi_agent_system_mod.o \
     1333        nesting_offl_mod.o \
     1334        ocean_mod.o \
     1335        plant_canopy_model_mod.o \
     1336        radiation_model_mod.o \
     1337        salsa_mod.o \
     1338        spectra_mod.o \
     1339        surface_output_mod.o \
     1340        synthetic_turbulence_generator_mod.o \
     1341        urban_surface_mod.o \
     1342        user_read_restart_data_mod.o \
     1343        user_write_restart_data_mod.o \
     1344        virtual_flight_mod.o \
     1345        virtual_measurement_mod.o \
     1346        wind_turbine_model_mod.o
    13571347modules.o: \
    13581348        mod_kinds.o
     
    14361426        write_restart_data_mod.o
    14371427parin.o: \
    1438         biometeorology_mod.o \
    1439         bulk_cloud_model_mod.o \
    1440         chemistry_model_mod.o \
    14411428        chem_modules.o \
    14421429        cpulog_mod.o \
    14431430        date_and_time_mod.o \
    1444         gust_mod.o \
    1445         indoor_model_mod.o \
    1446         land_surface_model_mod.o \
    14471431        model_1d_mod.o \
    14481432        mod_kinds.o \
    14491433        modules.o \
    1450         multi_agent_system_mod.o \
    1451         nesting_offl_mod.o \
    1452         netcdf_interface_mod.o \
    1453         ocean_mod.o \
    1454         plant_canopy_model_mod.o \
     1434        netcdf_interface_mod.o \
    14551435        pmc_interface_mod.o \
    14561436        progress_bar_mod.o \
    1457         radiation_model_mod.o \
    14581437        read_restart_data_mod.o \
    1459         salsa_mod.o \
    1460         spectra_mod.o \
    1461         surface_output_mod.o \
    1462         synthetic_turbulence_generator_mod.o \
    14631438        turbulence_closure_mod.o \
    1464         vertical_nesting_mod.o \
    1465         virtual_flight_mod.o \
    1466         virtual_measurement_mod.o \
    1467         wind_turbine_model_mod.o
     1439        vertical_nesting_mod.o
    14681440plant_canopy_model_mod.o: \
    14691441        bulk_cloud_model_mod.o \
     
    16011573        modules.o
    16021574read_restart_data_mod.o: \
    1603         bulk_cloud_model_mod.o \
    1604         chemistry_model_mod.o \
     1575        chem_modules.o \
    16051576        cpulog_mod.o \
    16061577        date_and_time_mod.o \
    1607         gust_mod.o \
    1608         land_surface_model_mod.o \
    1609         modules.o \
    16101578        mod_kinds.o \
    16111579        model_1d_mod.o \
     1580        module_interface.o \
     1581        modules.o \
    16121582        netcdf_interface_mod.o \
    16131583        radiation_model_mod.o \
    16141584        random_function_mod.o\
    16151585        random_generator_parallel_mod.o \
    1616         salsa_mod.o \
    16171586        spectra_mod.o \
    16181587        surface_mod.o \
    1619         synthetic_turbulence_generator_mod.o \
    1620         urban_surface_mod.o \
    1621         user_read_restart_data_mod.o \
    1622         vertical_nesting_mod.o \
    1623         virtual_flight_mod.o \
    1624         wind_turbine_model_mod.o
     1588        vertical_nesting_mod.o
    16251589run_control.o: \
    16261590        cpulog_mod.o \
     
    16611625sum_up_3d_data.o: \
    16621626        basic_constants_and_equations_mod.o \
    1663         biometeorology_mod.o \
    1664         bulk_cloud_model_mod.o \
    1665         chemistry_model_mod.o \
    1666         cpulog_mod.o \
    1667         gust_mod.o \
    1668         land_surface_model_mod.o \
    1669         mod_kinds.o \
    1670         modules.o \
    1671         radiation_model_mod.o \
    1672         salsa_mod.o \
     1627        bulk_cloud_model_mod.o \
     1628        cpulog_mod.o \
     1629        mod_kinds.o \
     1630        module_interface.o \
     1631        modules.o \
    16731632        surface_mod.o \
    16741633        turbulence_closure_mod.o \
     
    17001659        surface_mod.o
    17011660swap_timelevel.o: \
    1702         bulk_cloud_model_mod.o \
    1703         chemistry_model_mod.o \
    1704         cpulog_mod.o \
    1705         gust_mod.o \
    1706         land_surface_model_mod.o \
    1707         mod_kinds.o \
    1708         modules.o \
    1709         ocean_mod.o \
     1661        cpulog_mod.o \
     1662        mod_kinds.o \
     1663        module_interface.o \
     1664        modules.o \
    17101665        pmc_interface_mod.o \
    1711         salsa_mod.o \
    1712         turbulence_closure_mod.o \
    1713         urban_surface_mod.o
     1666        turbulence_closure_mod.o
    17141667synthetic_turbulence_generator_mod.o: \
    17151668        basic_constants_and_equations_mod.o \
     
    19921945        mod_kinds.o
    19931946write_restart_data_mod.o: \
    1994         bulk_cloud_model_mod.o \
    1995         chemistry_model_mod.o \
    19961947        date_and_time_mod.o \
    1997         gust_mod.o \
    1998         land_surface_model_mod.o \
    19991948        mod_kinds.o \
    20001949        mod_particle_attributes.o \
    20011950        model_1d_mod.o \
    2002         modules.o \
    2003         netcdf_interface_mod.o \
    2004         ocean_mod.o \
     1951        module_interface.o \
     1952        modules.o \
     1953        netcdf_interface_mod.o \
    20051954        radiation_model_mod.o \
    20061955        random_function_mod.o \
    20071956        random_generator_parallel_mod.o \
    2008         spectra_mod.o surface_mod.o \
    2009         synthetic_turbulence_generator_mod.o \
    2010         urban_surface_mod.o \
    2011         user_write_restart_data_mod.o \
    2012         vertical_nesting_mod.o \
    2013         virtual_flight_mod.o \
    2014         wind_turbine_model_mod.o
     1957        spectra_mod.o \
     1958        surface_mod.o \
     1959        vertical_nesting_mod.o
  • palm/trunk/SOURCE/average_3d_data.f90

    r3597 r3637  
    2525! -----------------
    2626! $Id$
     27! Implementation of the PALM module interface
     28!
     29! 3597 2018-12-04 08:40:18Z maronga
    2730! Added theta_2m
    2831!
     
    173176    USE averaging
    174177
    175     USE biometeorology_mod,                                                    &
    176         ONLY:  bio_3d_data_averaging
    177 
    178     USE bulk_cloud_model_mod,                                                  &
    179         ONLY:  bulk_cloud_model, bcm_3d_data_averaging
    180 
    181     USE chemistry_model_mod,                                                   &
    182         ONLY:  chem_3d_data_averaging
    183 
    184178    USE control_parameters,                                                    &
    185         ONLY:  air_chemistry, average_count_3d, biometeorology, doav, doav_n,  &
    186                land_surface, ocean_mode, salsa, urban_surface, varnamelength
     179        ONLY:  average_count_3d, doav, doav_n, varnamelength
    187180
    188181    USE cpulog,                                                                &
    189182        ONLY:  cpu_log, log_point
    190183
    191     USE gust_mod,                                                              &
    192         ONLY:  gust_3d_data_averaging, gust_module_enabled
    193 
    194184    USE indices,                                                               &
    195185        ONLY:  nbgp, nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt
     
    197187    USE kinds
    198188
    199     USE land_surface_model_mod,                                                &
    200         ONLY:  lsm_3d_data_averaging
    201 
    202     USE ocean_mod,                                                             &
    203         ONLY:  ocean_3d_data_averaging
    204 
    205     USE radiation_model_mod,                                                   &
    206         ONLY:  radiation, radiation_3d_data_averaging
    207            
    208     USE salsa_mod,                                                             &
    209         ONLY:  salsa_3d_data_averaging
     189    USE module_interface,                                                      &
     190        ONLY:  module_interface_3d_data_averaging
    210191
    211192    USE turbulence_closure_mod,                                                &
    212193        ONLY:  tcm_3d_data_averaging
    213 
    214     USE urban_surface_mod,                                                     &
    215         ONLY:  usm_average_3d_data
    216194
    217195
     
    573551
    574552          CASE DEFAULT
    575 !
    576 !--          Averaging of data from other modules
    577              IF ( air_chemistry .AND. &
    578                   (trimvar(1:3) == 'kc_' .OR. trimvar(1:3) == 'em_')  )  THEN
    579                 CALL chem_3d_data_averaging( 'average', doav(ii) )
    580              ENDIF
    581 
    582              IF ( bulk_cloud_model )  THEN
    583                 CALL bcm_3d_data_averaging( 'average', doav(ii) )
    584              ENDIF
    585 
    586              IF ( gust_module_enabled )  THEN
    587                 CALL gust_3d_data_averaging( 'average', doav(ii) )
    588              ENDIF
    589 
    590              IF ( land_surface )  THEN
    591                 CALL lsm_3d_data_averaging( 'average', doav(ii) )
    592              ENDIF
    593 
    594              IF ( ocean_mode )  THEN
    595                 CALL ocean_3d_data_averaging( 'average', doav(ii) )
    596              ENDIF
    597 
    598              IF ( radiation )  THEN
    599                 CALL radiation_3d_data_averaging( 'average', doav(ii) )
    600              ENDIF
    601              
    602              IF ( salsa )  THEN
    603                 CALL salsa_3d_data_averaging( 'average', doav(ii) )
    604              ENDIF             
    605 
    606              IF ( biometeorology )  THEN
    607                 CALL bio_3d_data_averaging( 'average', doav(ii) )
    608              ENDIF
    609 
    610              CALL tcm_3d_data_averaging( 'average', doav(ii) )
    611 
    612              IF ( urban_surface  .AND.  trimvar(1:4) == 'usm_' )  THEN
    613                 CALL usm_average_3d_data( 'average', doav(ii) )
    614              ENDIF
    615 
    616 !
    617 !--          User-defined quantities
    618              CALL user_3d_data_averaging( 'average', doav(ii) )
     553
     554!
     555!--          Averaging of data from turbulence closure module
     556             CALL tcm_3d_data_averaging( 'average', trimvar )
     557!
     558!--          Averaging of data from all other modules
     559             CALL module_interface_3d_data_averaging( 'average', trimvar )
    619560
    620561       END SELECT
  • palm/trunk/SOURCE/check_parameters.f90

    r3597 r3637  
    2525! -----------------
    2626! $Id$
     27! Implementation of the PALM module interface
     28!
     29! 3597 2018-12-04 08:40:18Z maronga
    2730! Added checks for theta_2m
    2831!
     
    748751    USE basic_constants_and_equations_mod
    749752
    750     USE biometeorology_mod,                                                    &
    751         ONLY:  bio_check_data_output, bio_check_parameters
    752 
    753753    USE bulk_cloud_model_mod,                                                  &
    754         ONLY:  bulk_cloud_model, bcm_check_parameters, bcm_check_data_output,  &
    755                bcm_check_data_output_pr
    756 
    757     USE chem_emissions_mod,                                                    &
    758         ONLY:  chem_emissions_check_parameters
     754        ONLY:  bulk_cloud_model
    759755
    760756    USE chem_modules
    761757
    762758    USE chemistry_model_mod,                                                   &
    763         ONLY:  chem_boundary_conds, chem_check_data_output,                    &
    764                chem_check_data_output_pr, chem_check_parameters, chem_species
     759        ONLY:  chem_boundary_conds
    765760
    766761    USE control_parameters
     
    770765    USE grid_variables
    771766
    772     USE gust_mod,                                                              &
    773         ONLY: gust_check_data_output, gust_check_data_output_pr,               &
    774               gust_check_parameters, gust_module_enabled
    775 
    776767    USE kinds
    777768
    778769    USE indices
    779 
    780     USE land_surface_model_mod,                                                &
    781         ONLY: lsm_check_data_output, lsm_check_data_output_pr,                 &
    782               lsm_check_parameters
    783 
    784     USE lsf_nudging_mod,                                                       &
    785         ONLY:  lsf_nudging_check_parameters, lsf_nudging_check_data_output_pr
    786770
    787771    USE model_1d_mod,                                                          &
    788772        ONLY:  damp_level_1d, damp_level_ind_1d
    789773
    790     USE nesting_offl_mod,                                                      &
    791         ONLY:  nesting_offl_check_parameters
    792        
     774    USE module_interface,                                                      &
     775        ONLY:  module_interface_check_parameters,                              &
     776               module_interface_check_data_output_pr,                          &
     777               module_interface_check_data_output
     778
    793779    USE netcdf_data_input_mod,                                                 &
    794780        ONLY:  init_model, input_pids_static, netcdf_data_input_check_dynamic, &
     
    800786               waterflux_output_unit, momentumflux_output_unit
    801787
    802     USE ocean_mod,                                                             &
    803         ONLY:  ocean_check_data_output, ocean_check_data_output_pr,            &
    804                ocean_check_parameters
    805 
    806788    USE particle_attributes
    807789
    808790    USE pegrid
    809 
    810     USE plant_canopy_model_mod,                                                &
    811         ONLY:  pcm_check_data_output, pcm_check_parameters
    812791
    813792    USE pmc_interface,                                                         &
     
    816795    USE profil_parameter
    817796
    818     USE radiation_model_mod,                                                   &
    819         ONLY:  radiation, radiation_check_data_output,                         &
    820                radiation_check_data_output_pr, radiation_check_parameters
    821                            
    822     USE salsa_mod,                                                             &
    823         ONLY:  salsa_check_data_output, salsa_check_parameters       
    824 
    825     USE spectra_mod,                                                           &
    826         ONLY:  calculate_spectra, spectra_check_parameters
    827 
    828797    USE statistics
    829798
    830799    USE subsidence_mod
    831800
    832     USE surface_output_mod,                                                    &
    833         ONLY:  surface_output_check_parameters
    834 
    835     USE synthetic_turbulence_generator_mod,                                    &
    836         ONLY:  stg_check_parameters
    837 
    838801    USE transpose_indices
    839802
    840803    USE turbulence_closure_mod,                                                &
    841         ONLY:  tcm_check_data_output, tcm_check_parameters
    842 
    843     USE urban_surface_mod,                                                     &
    844         ONLY:  usm_check_data_output, usm_check_parameters
    845 
    846     USE wind_turbine_model_mod,                                                &
    847         ONLY:  wtm_check_parameters
     804        ONLY:  tcm_check_parameters,                                           &
     805               tcm_check_data_output
    848806
    849807    USE vertical_nesting_mod,                                                  &
    850         ONLY:  vnested, vnest_check_parameters
     808        ONLY:  vnested,                                                        &
     809               vnest_check_parameters
    851810
    852811
     
    15251484
    15261485!
    1527 !-- Check the module settings:
    1528 !-- tcm_check_parameters must be called at first
     1486!-- tcm_check_parameters must be called before all other module calls
    15291487    CALL tcm_check_parameters
    15301488
    1531     IF ( biometeorology )       CALL bio_check_parameters
    1532     IF ( bulk_cloud_model )     CALL bcm_check_parameters
    1533     IF ( air_chemistry )        CALL chem_check_parameters
    1534 !   IF ( air_chemistry )        CALL chem_emissions_check_parameters   ! forkel preliminary
    1535     IF ( gust_module_enabled )  CALL gust_check_parameters
    1536     IF ( large_scale_forcing  .OR.  nudging )                                  &
    1537                                 CALL lsf_nudging_check_parameters
    1538     IF ( land_surface )         CALL lsm_check_parameters
    1539     IF ( nesting_offline )      CALL nesting_offl_check_parameters   
    1540     IF ( ocean_mode )           CALL ocean_check_parameters
    1541     IF ( plant_canopy )         CALL pcm_check_parameters
    1542     IF ( radiation )            CALL radiation_check_parameters
    1543     IF ( calculate_spectra )    CALL spectra_check_parameters
    1544                                 CALL stg_check_parameters
    1545     IF ( urban_surface )        CALL usm_check_parameters
    1546     IF ( wind_turbine )         CALL wtm_check_parameters
    1547 !
    1548 !-- Checks for surface data output
    1549     IF ( surface_data_output )  CALL surface_output_check_parameters
    1550 !   
    1551 !-- When SALSA is used, perform additional checks
    1552     IF ( salsa )  CALL salsa_check_parameters     
     1489!-- Check the module settings
     1490    CALL module_interface_check_parameters
    15531491
    15541492!
     
    15621500       IF ( humidity       )  q_init  = q_surface
    15631501       IF ( passive_scalar )  s_init  = s_surface
    1564 !
    1565 !--    TODO
    1566 !--    Russo: Is done in chem_init and would overwrite what is done there
    1567 !--    --> kanani: Revise
    1568 !      IF ( air_chemistry )  THEN
    1569 !        DO lsp = 1, nvar
    1570 !           chem_species(lsp)%conc_pr_init = cs_surface(lsp)     
    1571 !        ENDDO
    1572 !      ENDIF
    1573 !
     1502
    15741503!--
    15751504!--    If required, compute initial profile of the geostrophic wind
     
    29602889!
    29612890!--          Check for other modules
    2962              IF ( unit == 'illegal' .AND.  bulk_cloud_model )  THEN
    2963                 CALL bcm_check_data_output_pr( data_output_pr(i), i, unit,     &
    2964                                                dopr_unit(i) )
    2965              ENDIF
    2966 
    2967              IF ( unit == 'illegal' .AND.  air_chemistry )  THEN
    2968                 CALL chem_check_data_output_pr( data_output_pr(i), i, unit,    &
    2969                                                 dopr_unit(i) )
    2970              ENDIF
    2971 
    2972              IF ( unit == 'illegal'  .AND.  gust_module_enabled  )  THEN
    2973                 CALL gust_check_data_output_pr( data_output_pr(i), i, unit,    &
    2974                                                 dopr_unit(i) )
    2975              ENDIF
    2976 
    2977              IF ( unit == 'illegal' )  THEN
    2978                 CALL lsf_nudging_check_data_output_pr( data_output_pr(i), i,   &
    2979                                                        unit, dopr_unit(i) )
    2980              ENDIF
    2981 
    2982              IF ( unit == 'illegal' )  THEN
    2983                 CALL lsm_check_data_output_pr( data_output_pr(i), i, unit,        &
    2984                                             dopr_unit(i) )
    2985              ENDIF
    2986              IF ( unit == 'illegal' )  THEN
    2987                 CALL ocean_check_data_output_pr( data_output_pr(i), i, unit,   &
    2988                                                  dopr_unit(i) )
    2989              ENDIF
    2990 
    2991              IF ( unit == 'illegal' )  THEN
    2992                 CALL radiation_check_data_output_pr( data_output_pr(i), i,     &
    2993                                                      unit, dopr_unit(i) )
    2994              ENDIF
    2995 
    2996 !
    2997 !--          Finally, check for user defined quantities
    2998              IF ( unit == 'illegal' )  THEN
    2999                 unit = ''
    3000                 CALL user_check_data_output_pr( data_output_pr(i), i, unit )
    3001              ENDIF
     2891             CALL module_interface_check_data_output_pr( data_output_pr(i), i, &
     2892                                                         unit, dopr_unit(i) )
    30022893
    30032894!
     
    32243115
    32253116             CALL tcm_check_data_output( var, unit )
    3226 
    32273117!
    32283118!--          Check for other modules
    3229              IF ( unit == 'illegal'  .AND.  bulk_cloud_model  )  THEN
    3230                 CALL bcm_check_data_output( var, unit )
    3231              ENDIF
    3232 
    3233              IF ( unit == 'illegal'  .AND.  air_chemistry                      &
    3234                   .AND.  (var(1:3) == 'kc_' .OR. var(1:3) == 'em_') )  THEN
    3235                 CALL chem_check_data_output( var, unit, i, ilen, k )
    3236              ENDIF
    3237 
    3238              IF ( unit == 'illegal' )  THEN
    3239                 CALL lsm_check_data_output ( var, unit, i, ilen, k )
    3240              ENDIF
    3241 
    3242              IF ( unit == 'illegal'  .AND.  gust_module_enabled  )  THEN
    3243                 CALL gust_check_data_output ( var, unit )
    3244              ENDIF
    3245 
    3246              IF ( unit == 'illegal'  .AND.  biometeorology )  THEN
    3247                 CALL bio_check_data_output( var, unit, i, ilen, k )
    3248              ENDIF
    3249 
    3250              IF ( unit == 'illegal'  .AND.  ocean_mode )  THEN
    3251                 CALL ocean_check_data_output( var, unit )
    3252              ENDIF
    3253 
    3254              IF ( unit == 'illegal'  .AND.  plant_canopy                       &
    3255                                      .AND.  var(1:4) == 'pcm_' )  THEN
    3256                 CALL pcm_check_data_output( var, unit )
    3257              ENDIF
    3258 
    3259              IF ( unit == 'illegal' )  THEN
    3260                 CALL radiation_check_data_output( var, unit, i, ilen, k )
    3261              ENDIF
    3262 
    3263              IF ( unit == 'illegal' .AND. salsa ) THEN
    3264                  CALL salsa_check_data_output( var, unit )
    3265              ENDIF   
    3266 
    3267              IF ( unit == 'illegal'  .AND.  urban_surface                      &
    3268                                      .AND.  var(1:4) == 'usm_' )  THEN
    3269                  CALL usm_check_data_output( var, unit )
    3270              ENDIF
    3271 !
    3272 !--          Finally, check for user-defined quantities
    3273              IF ( unit == 'illegal' )  THEN
    3274                 unit = ''
    3275                 CALL user_check_data_output( var, unit )
    3276              ENDIF
     3119             CALL module_interface_check_data_output( var, unit, i, ilen, k )
    32773120
    32783121             IF ( unit == 'illegal' )  THEN
     
    39863829
    39873830    CALL location_message( 'finished', .TRUE. )
    3988 !
    3989 !-- Check &userpar parameters
    3990     CALL user_check_parameters
    39913831
    39923832 CONTAINS
  • palm/trunk/SOURCE/chemistry_model_mod.f90

    r3636 r3637  
    2727! -----------------
    2828! $Id$
     29! Implementation of the PALM module interface
     30!
     31! 3636 2018-12-19 13:48:34Z raasch
    2932! nopointer option removed
    3033!
     
    588591    INTEGER(iwp) :: lsp                 !< running index for chem spcs
    589592
     593    IF ( (variable(1:3) == 'kc_' .OR. variable(1:3) == 'em_')  )  THEN
    590594
    591595    IF ( mode == 'allocate' )  THEN
     
    662666          ENDIF
    663667       ENDDO
     668
     669    ENDIF
    664670
    665671    ENDIF
  • palm/trunk/SOURCE/data_output_2d.f90

    r3597 r3637  
    2525! -----------------
    2626! $Id$
     27! Implementation of the PALM module interface
     28!
     29! 3597 2018-12-04 08:40:18Z maronga
    2730! Added theta_2m
    2831!
     
    284287        ONLY:  c_p, lv_d_cp, l_v
    285288
    286     USE biometeorology_mod,                                                    &
    287         ONLY:  bio_data_output_2d
    288 
    289289    USE bulk_cloud_model_mod,                                                  &
    290         ONLY:  bulk_cloud_model, bcm_data_output_2d
    291 
    292     USE chemistry_model_mod,                                                   &
    293         ONLY:  chem_data_output_2d
     290        ONLY:  bulk_cloud_model
    294291
    295292    USE control_parameters,                                                    &
    296         ONLY:  air_chemistry, biometeorology, data_output_2d_on_each_pe,       &
     293        ONLY:  data_output_2d_on_each_pe,                                      &
    297294               data_output_xy, data_output_xz, data_output_yz, do2d,           &
    298295               do2d_xy_last_time, do2d_xy_time_count,                          &
    299296               do2d_xz_last_time, do2d_xz_time_count,                          &
    300297               do2d_yz_last_time, do2d_yz_time_count,                          &
    301                ibc_uv_b, io_blocks, io_group, land_surface, message_string,    &
     298               ibc_uv_b, io_blocks, io_group, message_string,                  &
    302299               ntdim_2d_xy, ntdim_2d_xz, ntdim_2d_yz,                          &
    303                ocean_mode, psolver, salsa, section, simulated_time,            &
     300               psolver, section, simulated_time,                               &
    304301               time_since_reference_point
    305302
    306303    USE cpulog,                                                                &
    307         ONLY:  cpu_log, log_point
    308        
    309     USE gust_mod,                                                              &
    310         ONLY:  gust_data_output_2d, gust_module_enabled
     304        ONLY:  cpu_log, log_point
    311305
    312306    USE indices,                                                               &
     
    317311
    318312    USE land_surface_model_mod,                                                &
    319         ONLY:  lsm_data_output_2d, zs
     313        ONLY:  zs
     314
     315    USE module_interface,                                                      &
     316        ONLY:  module_interface_data_output_2d
    320317
    321318#if defined( __netcdf )
     
    327324               id_var_time_xy, id_var_time_xz, id_var_time_yz, nc_stat,        &
    328325               netcdf_data_format, netcdf_handle_error
    329 
    330     USE ocean_mod,                                                             &
    331         ONLY:  ocean_data_output_2d
    332326
    333327    USE particle_attributes,                                                   &
     
    336330   
    337331    USE pegrid
    338 
    339     USE radiation_model_mod,                                                   &
    340         ONLY:  radiation, radiation_data_output_2d
    341    
    342     USE salsa_mod,                                                             &
    343         ONLY:  salsa_data_output_2d   
    344332
    345333    USE surface_mod,                                                           &
     
    13621350!
    13631351!--             Quantities of other modules
    1364                 IF ( .NOT. found  .AND.  bulk_cloud_model )  THEN
    1365                    CALL bcm_data_output_2d( av, do2d(av,ivar), found, grid, mode,&
    1366                                             local_pf, two_d, nzb_do, nzt_do )
    1367                 ENDIF
    1368 
    1369                 IF ( .NOT. found  .AND.  gust_module_enabled )  THEN
    1370                    CALL gust_data_output_2d( av, do2d(av,ivar), found, grid,     &
    1371                                              local_pf, two_d, nzb_do, nzt_do )
    1372                 ENDIF
    1373 
    1374                 IF ( .NOT. found  .AND.  biometeorology )  THEN
    1375                    CALL bio_data_output_2d( av, do2d(av,ivar), found, grid,      &
    1376                                             local_pf, two_d, nzb_do, nzt_do )
    1377                 ENDIF
    1378 
    1379                 IF ( .NOT. found  .AND.  land_surface )  THEN
    1380                    CALL lsm_data_output_2d( av, do2d(av,ivar), found, grid, mode,&
    1381                                             local_pf, two_d, nzb_do, nzt_do )
    1382                 ENDIF
    1383 
    1384                 IF ( .NOT. found  .AND.  ocean_mode )  THEN
    1385                    CALL ocean_data_output_2d( av, do2d(av,ivar), found, grid,    &
    1386                                               mode, local_pf, nzb_do, nzt_do )
    1387                 ENDIF
    1388 
    1389                 IF ( .NOT. found  .AND.  radiation )  THEN
    1390                    CALL radiation_data_output_2d( av, do2d(av,ivar), found, grid,&
    1391                                                   mode, local_pf, two_d,       &
    1392                                                   nzb_do, nzt_do  )
    1393                 ENDIF
    1394                
    1395                 IF ( .NOT. found  .AND.  salsa )  THEN
    1396                    CALL salsa_data_output_2d( av, do2d(av,ivar), found, grid,  &
    1397                                               mode, local_pf, two_d, nzb_do,   &
    1398                                               nzt_do)
    1399                 ENDIF                 
    1400 
    1401                 IF ( .NOT. found  .AND.  air_chemistry )  THEN
    1402                    CALL chem_data_output_2d( av, do2d(av,ivar), found, grid, mode, &
    1403                                              local_pf, two_d, nzb_do, nzt_do, fill_value )
    1404                 ENDIF
    1405 !
    1406 !--             User defined quantities
    14071352                IF ( .NOT. found )  THEN
    1408                    CALL user_data_output_2d( av, do2d(av,ivar), found, grid,     &
    1409                                              local_pf, two_d, nzb_do, nzt_do )
     1353                   CALL module_interface_data_output_2d(                       &
     1354                           av, do2d(av,ivar), found, grid, mode,               &
     1355                           local_pf, two_d, nzb_do, nzt_do,                    &
     1356                           fill_value                                          &
     1357                        )
    14101358                ENDIF
    14111359
  • palm/trunk/SOURCE/data_output_3d.f90

    r3589 r3637  
    2525! -----------------
    2626! $Id$
     27! Implementation of the PALM module interface
     28!
     29! 3589 2018-11-30 15:09:51Z suehring
    2730! Move the control parameter "salsa" from salsa_mod to control_parameters
    2831! (M. Kurppa)
     
    245248        ONLY:  lv_d_cp
    246249
    247     USE biometeorology_mod,                                                    &
    248         ONLY:  bio_data_output_3d
    249 
    250250    USE bulk_cloud_model_mod,                                                  &
    251         ONLY:  bulk_cloud_model, bcm_data_output_3d
    252 
    253     USE chemistry_model_mod,                                                   &
    254         ONLY:  chem_data_output_3d
     251        ONLY:  bulk_cloud_model
    255252
    256253    USE control_parameters,                                                    &
     
    263260    USE cpulog,                                                                &
    264261        ONLY:  log_point, cpu_log
    265 
    266     USE gust_mod,                                                              &
    267         ONLY: gust_data_output_3d, gust_module_enabled
    268262
    269263#if defined( __parallel )
     
    282276        ONLY: lsm_data_output_3d, nzb_soil, nzt_soil
    283277
     278    USE module_interface,                                                      &
     279        ONLY:  module_interface_data_output_3d
     280
    284281#if defined( __netcdf )
    285282    USE NETCDF
     
    289286        ONLY:  fill_value, id_set_3d, id_var_do3d, id_var_time_3d, nc_stat,    &
    290287               netcdf_data_format, netcdf_handle_error
    291        
    292     USE ocean_mod,                                                             &
    293         ONLY:  ocean_data_output_3d
    294288
    295289    USE particle_attributes,                                                   &
    296290        ONLY:  grid_particles, number_of_particles, particles,                 &
    297291               particle_advection_start, prt_count
    298        
     292
    299293    USE pegrid
    300294
    301     USE plant_canopy_model_mod,                                                &
    302         ONLY:  pcm_data_output_3d
    303        
    304295    USE radiation_model_mod,                                                   &
    305         ONLY:  nzub, nzut, radiation, radiation_data_output_3d
    306                
    307     USE salsa_mod,                                                             &
    308         ONLY:  salsa_data_output_3d     
     296        ONLY:  nzub, nzut
    309297
    310298    USE turbulence_closure_mod,                                                &
     
    399387
    400388!
    401 !--    Temporary solution to account for data output within the new urban
     389!--    Initiate found flag and resorting flag
     390       found = .FALSE.
     391       resorted = .FALSE.
     392!
     393!--    Temporary solution to account for data output within the new urban
    402394!--    surface model (urban_surface_mod.f90), see also SELECT CASE ( trimvar ).
    403395!--    Store the array chosen on the temporary array.
     396       nzb_do   = nzb
     397       nzt_do   = nz_do3d
     398
    404399       trimvar = TRIM( do3d(av,ivar) )
    405        IF ( urban_surface  .AND.  trimvar(1:4) == 'usm_' )  THEN
    406           trimvar = 'usm_output'
    407           resorted = .TRUE.
    408           nzb_do   = nzub
    409           nzt_do   = nzut
    410        ELSE
    411           resorted = .FALSE.
    412           nzb_do   = nzb
    413           nzt_do   = nz_do3d
    414        ENDIF
    415 !
    416 !--    Set flag to steer output of radiation, land-surface, or user-defined
    417 !--    quantities
    418        found = .FALSE.
    419400!
    420401!--    Allocate a temporary array with the desired output dimensions.
     
    715696                to_be_resorted => w_av
    716697             ENDIF
    717 !             
    718 !--       Block of urban surface model outputs   
    719           CASE ( 'usm_output' )
    720              CALL usm_data_output_3d( av, do3d(av,ivar), found, local_pf,        &
    721                                          nzb_do, nzt_do )
    722698
    723699          CASE DEFAULT
    724700
    725 !
    726 !--          Quantities of other modules
    727              IF ( .NOT. found  .AND.  bulk_cloud_model )  THEN
    728                 CALL bcm_data_output_3d( av, do3d(av,ivar), found, local_pf,     &
     701             IF ( .NOT. found )  THEN
     702                CALL tcm_data_output_3d( av, trimvar, found, local_pf,   &
    729703                                         nzb_do, nzt_do )
    730704                resorted = .TRUE.
    731705             ENDIF
    732706
    733              IF ( .NOT. found  .AND.  air_chemistry )  THEN
    734                 CALL chem_data_output_3d( av, do3d(av,ivar), found,              &
    735                                           local_pf, fill_value, nzb_do, nzt_do )
    736                 resorted = .TRUE.
    737              ENDIF
    738 
    739              IF ( .NOT. found  .AND.  gust_module_enabled )  THEN
    740                 CALL gust_data_output_3d( av, do3d(av,ivar), found, local_pf,    &
    741                                           nzb_do, nzt_do )
    742                 resorted = .TRUE.
    743              ENDIF
    744 
    745              IF ( .NOT. found  .AND.  land_surface )  THEN
    746 !
    747 !--             For soil model quantities, it is required to re-allocate local_pf
    748                 nzb_do = nzb_soil
    749                 nzt_do = nzt_soil
     707!
     708!--          Quantities of other modules
     709             IF ( .NOT. found )  THEN
     710                CALL module_interface_data_output_3d(                          &
     711                        av, trimvar, found, local_pf,                          &
     712                        fill_value, resorted, nzb_do, nzt_do                   &
     713                     )
     714             ENDIF
     715
     716!
     717!--          Temporary workaround: ToDo: refactor local_pf allocation
     718             IF ( .NOT. found  .AND.  urban_surface  .AND.  trimvar(1:4) == 'usm_' )  THEN
     719!
     720!--             For urban model quantities, it is required to re-allocate local_pf
     721                nzb_do = nzub
     722                nzt_do = nzut
    750723
    751724                DEALLOCATE ( local_pf )
     
    753726                local_pf = fill_value
    754727
    755                 CALL lsm_data_output_3d( av, do3d(av,ivar), found, local_pf )
     728                CALL usm_data_output_3d( av, trimvar, found, local_pf,         &
     729                                         nzb_do, nzt_do )
    756730                resorted = .TRUE.
    757731
     
    763737
    764738                   DEALLOCATE ( local_pf )
    765                    ALLOCATE( local_pf(nxl:nxr,nys:nyn,nzb_do:nzt_do) )                 
    766                 ENDIF
    767 
    768              ENDIF
    769 
    770              IF ( .NOT. found  .AND.  ocean_mode )  THEN
    771                 CALL ocean_data_output_3d( av, do3d(av,ivar), found, local_pf,   &
    772                                            nzb_do, nzt_do )
     739                   ALLOCATE( local_pf(nxl:nxr,nys:nyn,nzb_do:nzt_do) )
     740                ENDIF
     741
     742             ENDIF
     743
     744!
     745!--          Temporary workaround: ToDo: refactor local_pf allocation
     746             IF ( .NOT. found  .AND.  land_surface )  THEN
     747!
     748!--             For soil model quantities, it is required to re-allocate local_pf
     749                nzb_do = nzb_soil
     750                nzt_do = nzt_soil
     751
     752                DEALLOCATE ( local_pf )
     753                ALLOCATE( local_pf(nxl:nxr,nys:nyn,nzb_do:nzt_do) )
     754                local_pf = fill_value
     755
     756                CALL lsm_data_output_3d( av, trimvar, found, local_pf )
    773757                resorted = .TRUE.
    774              ENDIF
    775 
    776              IF ( .NOT. found  .AND.  plant_canopy )  THEN
    777                 CALL pcm_data_output_3d( av, do3d(av,ivar), found, local_pf,     &
    778                                          fill_value, nzb_do, nzt_do )
    779                 resorted = .TRUE.
    780              ENDIF
    781 
    782              IF ( .NOT. found  .AND.  radiation )  THEN
    783                 CALL radiation_data_output_3d( av, do3d(av,ivar), found,         &
    784                                                local_pf, nzb_do, nzt_do )
    785                 resorted = .TRUE.
    786              ENDIF
    787 
    788              IF ( .NOT. found )  THEN
    789                 CALL tcm_data_output_3d( av, do3d(av,ivar), found, local_pf,     &
    790                                          nzb_do, nzt_do )
    791                 resorted = .TRUE.
    792              ENDIF
    793              
    794 !
    795 !--          SALSA output
    796              IF ( .NOT. found  .AND.  salsa )  THEN
    797                 CALL salsa_data_output_3d( av, do3d(av,ivar), found, local_pf, &
    798                                            nzb_do, nzt_do )
    799                 resorted = .TRUE.
    800              ENDIF                 
    801 
    802              IF ( .NOT. found  .AND.  biometeorology )  THEN
    803                  CALL bio_data_output_3d( av, do3d(av,ivar), found, local_pf,    &
    804                                           nzb_do, nzt_do )
    805              ENDIF
    806 
    807 !
    808 !--          User defined quantities
    809              IF ( .NOT. found )  THEN
    810                 CALL user_data_output_3d( av, do3d(av,ivar), found, local_pf,    &
    811                                           nzb_do, nzt_do )
    812                 resorted = .TRUE.
     758
     759!
     760!--             If no soil model variable was found, re-allocate local_pf
     761                IF ( .NOT. found )  THEN
     762                   nzb_do = nzb
     763                   nzt_do = nz_do3d
     764
     765                   DEALLOCATE ( local_pf )
     766                   ALLOCATE( local_pf(nxl:nxr,nys:nyn,nzb_do:nzt_do) )
     767                ENDIF
     768
    813769             ENDIF
    814770
  • palm/trunk/SOURCE/flow_statistics.f90

    r3458 r3637  
    2525! -----------------
    2626! $Id$
     27! Implementation of the PALM module interface
     28!
     29! 3458 2018-10-30 14:51:23Z kanani
    2730! from chemistry branch r3443, basit:
    2831! bug fixed in chemistry profiles
     
    309312        ONLY:  g, lv_d_cp
    310313
     314    USE bulk_cloud_model_mod,                                                  &
     315        ONLY: bulk_cloud_model, microphysics_morrison, microphysics_seifert
    311316
    312317    USE chem_modules,                                                          &
    313318        ONLY:  max_pr_cs
    314 
    315     USE chemistry_model_mod,                                                   &
    316         ONLY:  chem_species, chem_statistics
    317319
    318320    USE control_parameters,                                                    &
     
    330332    USE grid_variables,                                                        &
    331333        ONLY:   ddx, ddy
    332 
    333     USE gust_mod,                                                              &
    334         ONLY:  gust_module_enabled, gust_statistics
    335334       
    336335    USE indices,                                                               &
     
    340339       
    341340    USE kinds
    342 
    343     USE bulk_cloud_model_mod,                                                  &
    344         ONLY: bulk_cloud_model, microphysics_morrison, microphysics_seifert
    345341   
    346342    USE land_surface_model_mod,                                                &
     
    349345    USE lsf_nudging_mod,                                                       &
    350346        ONLY:   td_lsa_lpt, td_lsa_q, td_sub_lpt, td_sub_q, time_vert
     347
     348    USE module_interface,                                                      &
     349        ONLY:  module_interface_statistics
    351350
    352351    USE netcdf_interface,                                                      &
     
    17951794          ENDDO
    17961795       ENDIF
    1797 !
    1798 !--    Calculate the gust module profiles
    1799        IF ( gust_module_enabled )  THEN
    1800           CALL gust_statistics( 'profiles', sr, tn, dots_max )
    1801        ENDIF
    1802 !
    1803 !--    Calculate the chemistry module profiles
    1804        IF ( air_chemistry ) THEN
    1805           CALL chem_statistics( 'profiles', sr, tn )
    1806        ENDIF
    1807 !
    1808 !--    Calculate the user-defined profiles
    1809        CALL user_statistics( 'profiles', sr, tn )
    1810        !$OMP END PARALLEL
     1796
     1797!
     1798!--    Calculate the profiles for all other modules
     1799       CALL module_interface_statistics( 'profiles', sr, tn, dots_max )
    18111800
    18121801!
     
    22682257
    22692258!
    2270 !--    Calculate additional statistics provided by the gust module
    2271        IF ( gust_module_enabled )  THEN
    2272           CALL gust_statistics( 'time_series', sr, 0, dots_max )
    2273        ENDIF
    2274 
    2275 !
    2276 !--    Calculate additional statistics provided by the user interface
    2277        CALL user_statistics( 'time_series', sr, 0 )
     2259!--    Calculate additional statistics provided by other modules
     2260       CALL module_interface_statistics( 'time_series', sr, 0, dots_max )
    22782261
    22792262    ENDDO    ! loop of the subregions
  • palm/trunk/SOURCE/header.f90

    r3589 r3637  
    2525! -----------------
    2626! $Id$
     27! Implementation of the PALM module interface
     28!
     29! 3589 2018-11-30 15:09:51Z suehring
    2730! Move the control parameter "salsa" from salsa_mod to control_parameters
    2831! (M. Kurppa)
     
    420423        ONLY:  g, kappa, l_v
    421424
    422     USE biometeorology_mod,                                                    &
    423         ONLY:  bio_header
    424 
    425425    USE bulk_cloud_model_mod,                                                  &
    426         ONLY:  bulk_cloud_model, bcm_header
    427 
    428     USE chemistry_model_mod,                                                   &
    429         ONLY:  chem_header
     426        ONLY:  bulk_cloud_model
    430427
    431428    USE control_parameters
     
    439436    USE dvrp_variables,                                                        &
    440437        ONLY:  use_seperate_pe_for_dvrp_output
    441        
    442     USE flight_mod,                                                            &
    443         ONLY:  flight_header
    444        
     438
    445439    USE grid_variables,                                                        &
    446440        ONLY:  dx, dy
    447 
    448     USE gust_mod,                                                              &
    449         ONLY: gust_header, gust_module_enabled
    450441
    451442    USE indices,                                                               &
    452443        ONLY:  mg_loc_ind, nnx, nny, nnz, nx, ny, nxl_mg, nxr_mg, nyn_mg,      &
    453444               nys_mg, nzt, nzt_mg
    454        
     445
    455446    USE kinds
    456  
    457     USE land_surface_model_mod,                                                &
    458         ONLY: lsm_header
    459 
    460     USE lsf_nudging_mod,                                                       &
    461         ONLY:  lsf_nudging_header
    462447
    463448    USE model_1d_mod,                                                          &
    464449        ONLY:  damp_level_ind_1d, dt_pr_1d, dt_run_control_1d, end_time_1d
    465450
     451    USE module_interface,                                                      &
     452        ONLY:  module_interface_header
     453
    466454    USE netcdf_interface,                                                      &
    467455        ONLY:  netcdf_data_format, netcdf_data_format_string, netcdf_deflate
    468456
    469     USE nesting_offl_mod,                                                      &
    470         ONLY:  nesting_offl_header
    471 
    472457    USE ocean_mod,                                                             &
    473         ONLY:  ibc_sa_t, ocean_header, prho_reference, sa_surface,             &
     458        ONLY:  ibc_sa_t, prho_reference, sa_surface,                           &
    474459               sa_vertical_gradient, sa_vertical_gradient_level,               &
    475460               sa_vertical_gradient_level_ind
     
    487472               total_number_of_particles, use_sgs_for_particles,               &
    488473               vertical_particle_advection, write_particle_statistics
    489        
     474
    490475    USE pegrid
    491 
    492     USE plant_canopy_model_mod,                                                &
    493         ONLY:  pcm_header
    494476
    495477#if defined( __parallel )
     
    501483        ONLY:  nested_run, nesting_datatransfer_mode, nesting_mode
    502484
    503     USE radiation_model_mod,                                                   &
    504         ONLY:  radiation, radiation_header
    505                
    506     USE salsa_mod,                                                             &
    507         ONLY:  salsa_header       
    508    
    509     USE spectra_mod,                                                           &
    510         ONLY:  calculate_spectra, spectra_header
    511 
    512485    USE surface_mod,                                                           &
    513486        ONLY:  surf_def_h, get_topography_top_index_ji
    514 
    515     USE synthetic_turbulence_generator_mod,                                    &
    516         ONLY:  stg_header
    517487
    518488    USE turbulence_closure_mod,                                                &
     
    935905
    936906!
    937 !-- Large scale forcing and nudging
    938     IF ( large_scale_forcing )  CALL lsf_nudging_header( io )
    939 
    940 !
    941 !-- Offline nesting
    942     IF ( nesting_offline )  CALL nesting_offl_header( io )
    943 
    944 !
    945907!-- Profile for the large scale vertial velocity
    946908!-- Building output strings, starting with surface value
     
    11611123       ENDIF
    11621124    ENDIF
    1163 
    1164 !
    1165 !-- Header information from other modules
    1166     IF ( biometeorology      )  CALL bio_header ( io )
    1167     IF ( gust_module_enabled )  CALL gust_header( io )
    1168     IF ( land_surface        )  CALL lsm_header( io )
    1169     IF ( ocean_mode          )  CALL ocean_header( io )
    1170     IF ( plant_canopy        )  CALL pcm_header( io )
    1171     IF ( radiation           )  CALL radiation_header( io )
    1172     IF ( syn_turb_gen        )  CALL stg_header( io )
    1173 
    1174     IF ( air_chemistry )  CALL chem_header ( io )
    11751125!
    11761126!-- Boundary conditions
     
    19241874    ENDIF
    19251875#endif
    1926 !
    1927 !-- Output of virtual flight information
    1928     IF ( virtual_flight )  CALL flight_header( io )
    1929 
    1930 !
    1931 !-- Output of spectra related quantities
    1932     IF ( calculate_spectra )  CALL spectra_header( io )
     1876
    19331877
    19341878    WRITE ( io, 99 )
     
    19581902       ENDIF
    19591903    ENDIF
    1960 
    1961 !
    1962 !-- Output of microphysics information
    1963     IF ( bulk_cloud_model )  CALL bcm_header( io )
    19641904
    19651905!
     
    20832023       ENDIF
    20842024    ENDIF
    2085    
    2086 !
    2087 !-- SALSA information
    2088     IF ( salsa )  CALL salsa_header( io )
    2089 
    2090 !
    2091 !-- User-defined information
    2092     CALL user_header( io )
     2025
     2026!
     2027!-- Header information from other modules
     2028    CALL module_interface_header( io )
     2029
    20932030
    20942031    WRITE ( io, 99 )
  • palm/trunk/SOURCE/parin.f90

    r3569 r3637  
    2525! -----------------
    2626! $Id$
     27! Implementation of the PALM module interface
     28!
     29! 3569 2018-11-27 17:03:40Z kanani
    2730! dom_dwd_user, Schrempf:
    2831! Remove uv exposure model code, this is now part of biometeorology_mod.
     
    468471               ug, u_init, v_init, vg
    469472
    470     USE biometeorology_mod,                                                    &
    471         ONLY:  bio_parin
    472 
    473     USE bulk_cloud_model_mod,                                                  &
    474         ONLY:  bcm_parin
    475 
    476     USE chemistry_model_mod,                                                   &
    477         ONLY:  chem_parin
    478 
    479473    USE chem_modules
    480474
     
    490484        ONLY:  local_dvrserver_running
    491485
    492     USE flight_mod,                                                            &
    493         ONLY:  flight_parin
    494 
    495486    USE grid_variables,                                                        &
    496487        ONLY:  dx, dy
    497488
    498     USE gust_mod,                                                              &
    499         ONLY: gust_parin
    500 
    501489    USE indices,                                                               &
    502490        ONLY:  nx, ny, nz
    503491
    504     USE indoor_model_mod,                                                      &
    505         ONLY:  im_parin
    506 
    507492    USE kinds
    508 
    509     USE land_surface_model_mod,                                                &
    510         ONLY: lsm_parin
    511493
    512494    USE model_1d_mod,                                                          &
    513495        ONLY:  damp_level_1d, dt_pr_1d, dt_run_control_1d, end_time_1d
    514496
    515     USE multi_agent_system_mod,                                                &
    516         ONLY:  mas_parin
    517 
    518     USE nesting_offl_mod,                                                      &
    519         ONLY:  nesting_offl_parin
    520        
     497    USE module_interface,                                                      &
     498        ONLY:  module_interface_parin
     499
    521500    USE netcdf_interface,                                                      &
    522501        ONLY:  netcdf_data_format, netcdf_deflate, netcdf_precision
    523502
    524     USE ocean_mod,                                                             &
    525         ONLY:  ocean_parin
    526 
    527503    USE pegrid
    528 
    529     USE plant_canopy_model_mod,                                                &
    530          ONLY: pcm_parin
    531504
    532505    USE pmc_interface,                                                         &
     
    539512        ONLY :  progress_bar_disabled
    540513
    541     USE radiation_model_mod,                                                   &
    542         ONLY: radiation_parin
    543 
    544514    USE read_restart_data_mod,                                                 &
    545         ONLY:  rrd_global 
    546              
    547     USE salsa_mod,                                                             &
    548         ONLY: salsa_parin         
    549 
    550     USE spectra_mod,                                                           &
    551         ONLY :  spectra_parin
     515        ONLY:  rrd_global
    552516
    553517    USE statistics,                                                            &
    554518        ONLY:  hom, hom_sum, pr_palm, region, statistic_regions
    555519
    556     USE surface_output_mod,                                                    &
    557         ONLY:  surface_output_parin
    558 
    559     USE synthetic_turbulence_generator_mod,                                    &
    560         ONLY:  stg_parin
    561 
    562520    USE turbulence_closure_mod,                                                &
    563521        ONLY:  rans_const_c, rans_const_sigma
    564522
    565     USE urban_surface_mod,                                                     &
    566         ONLY: usm_parin
    567 
    568523    USE vertical_nesting_mod,                                                  &
    569524        ONLY:  vnest_start_time
    570        
    571     USE virtual_measurement_mod,                                               &
    572         ONLY:  vm_parin
    573 
    574     USE wind_turbine_model_mod,                                                &
    575         ONLY:  wtm_parin
    576525
    577526
     
    917866!
    918867!--       Check for module namelists and read them
    919           CALL bio_parin
    920           CALL lsm_parin
    921           CALL bcm_parin
    922           CALL surface_output_parin
    923           CALL usm_parin
    924           CALL spectra_parin
    925           CALL radiation_parin
    926           CALL gust_parin
    927           CALL mas_parin
    928           CALL nesting_offl_parin
    929           CALL ocean_parin
    930           CALL pcm_parin
    931           CALL package_parin
    932           CALL wtm_parin
    933           CALL flight_parin
    934           CALL stg_parin
    935           CALL chem_parin
    936           CALL im_parin
    937           CALL salsa_parin
    938           CALL vm_parin
    939 !
    940 !--       Read user-defined variables
    941           CALL user_parin
     868          CALL module_interface_parin
    942869
    943870!
  • palm/trunk/SOURCE/read_restart_data_mod.f90

    r3589 r3637  
    2525! -----------------
    2626! $Id$
     27! Implementation of the PALM module interface
     28!
     29! 3589 2018-11-30 15:09:51Z suehring
    2730! Move the control parameter "salsa" from salsa_mod to control_parameters
    2831! (M. Kurppa)
     
    8891
    8992
    90     USE control_parameters
     93    USE arrays_3d,                                                             &
     94        ONLY:  inflow_damping_factor, mean_inflow_profiles, pt_init,           &
     95               q_init, ref_state, sa_init, s_init, u_init, ug, v_init, vg,     &
     96               e, kh, km, p, pt, q, ql, s, u, u_m_l, u_m_n, u_m_r, u_m_s,      &
     97               v, v_m_l, v_m_n, v_m_r, v_m_s, vpt, w, w_m_l, w_m_n, w_m_r, w_m_s
     98
     99    USE averaging
    91100
    92101    USE chem_modules,                                                                              &
    93102       ONLY: max_pr_cs
     103
     104    USE control_parameters
     105
     106    USE cpulog,                                                                &
     107        ONLY:  cpu_log, log_point_s
     108
     109    USE date_and_time_mod,                                                     &
     110        ONLY:  day_of_year_init, time_utc_init
     111
     112    USE grid_variables,                                                        &
     113        ONLY:  dx, dy
     114
     115    USE indices,                                                               &
     116        ONLY:  nbgp, nx, nxl, nxlg, nxr, nxrg, nx_on_file, ny, nys, nysg, nyn, &
     117               nyng, ny_on_file, nz, nzb, nzt
     118
     119    USE kinds
     120
     121    USE model_1d_mod,                                                          &
     122        ONLY:  damp_level_1d, dt_pr_1d, dt_run_control_1d, end_time_1d
     123
     124    USE module_interface,                                                      &
     125        ONLY:  module_interface_rrd_global,                                    &
     126               module_interface_rrd_local
     127
     128    USE netcdf_interface,                                                      &
     129        ONLY:  netcdf_precision, output_for_t0
     130
     131    USE particle_attributes,                                                   &
     132        ONLY:  curvature_solution_effects, iran_part
     133
     134    USE pegrid
     135
     136    USE radiation_model_mod,                                                   &
     137        ONLY:  time_radiation
     138
     139    USE random_function_mod,                                                   &
     140        ONLY:  random_iv, random_iy
     141
     142    USE random_generator_parallel,                                             &
     143        ONLY:  id_random_array, seq_random_array
     144
     145    USE spectra_mod,                                                           &
     146        ONLY:  average_count_sp, spectrum_x, spectrum_y
     147
     148    USE surface_mod,                                                           &
     149        ONLY :  surface_rrd_local
     150
     151    USE statistics,                                                            &
     152        ONLY:  statistic_regions, hom, hom_sum, pr_palm, u_max, u_max_ijk,     &
     153               v_max, v_max_ijk, w_max, w_max_ijk, z_i
     154
     155    USE vertical_nesting_mod,                                                  &
     156        ONLY:  vnest_init
    94157
    95158
     
    127190    SUBROUTINE rrd_global
    128191
    129 
    130        USE arrays_3d,                                                          &
    131            ONLY:  inflow_damping_factor, mean_inflow_profiles, pt_init,        &
    132                   q_init, ref_state, sa_init, s_init, u_init, ug, v_init, vg
    133 
    134        USE bulk_cloud_model_mod,                                               &
    135            ONLY:  bcm_rrd_global
    136 
    137        USE date_and_time_mod,                                                  &
    138            ONLY:  day_of_year_init, time_utc_init
    139 
    140        USE flight_mod,                                                         &
    141            ONLY: flight_rrd_global
    142 
    143        USE grid_variables,                                                     &
    144            ONLY:  dx, dy
    145 
    146        USE gust_mod,                                                           &
    147            ONLY :  gust_rrd_global
    148 
    149        USE indices,                                                            &
    150            ONLY:  nz, nx, nx_on_file, ny, ny_on_file
    151 
    152        USE model_1d_mod,                                                       &
    153            ONLY:  damp_level_1d, dt_pr_1d, dt_run_control_1d, end_time_1d
    154 
    155        USE netcdf_interface,                                                   &
    156            ONLY:  netcdf_precision, output_for_t0
    157 
    158        USE ocean_mod,                                                          &
    159            ONLY:  ocean_rrd_global
    160 
    161        USE particle_attributes,                                                &
    162            ONLY:  curvature_solution_effects
    163 
    164        USE pegrid
    165 
    166        USE radiation_model_mod,                                                &
    167            ONLY:  time_radiation
    168 
    169        USE spectra_mod,                                                        &
    170            ONLY:  average_count_sp, spectrum_x, spectrum_y
    171 
    172        USE statistics,                                                         &
    173            ONLY:  statistic_regions, hom, hom_sum, pr_palm, u_max, u_max_ijk,  &
    174                   v_max, v_max_ijk, w_max, w_max_ijk, z_i
    175 
    176        USE synthetic_turbulence_generator_mod,                                 &
    177            ONLY: stg_rrd_global
    178 
    179        USE user_read_restart_data_mod,                                         &
    180            ONLY:  user_rrd_global
    181 
    182        USE vertical_nesting_mod,                                               &
    183            ONLY:  vnest_init
    184 
    185        USE wind_turbine_model_mod,                                             &
    186            ONLY: wtm_rrd_global
    187 
    188 
    189        IMPLICIT NONE
    190192
    191193       CHARACTER (LEN=10) ::  binary_version_global, version_on_file
     
    772774!
    773775!--             Read global variables from of other modules
    774                 IF ( .NOT. found )  CALL bcm_rrd_global( found )
    775                 IF ( .NOT. found )  CALL flight_rrd_global( found )
    776                 IF ( .NOT. found )  CALL gust_rrd_global( found )
    777                 IF ( .NOT. found )  CALL ocean_rrd_global( found )
    778                 IF ( .NOT. found )  CALL stg_rrd_global ( found )
    779                 IF ( .NOT. found )  CALL wtm_rrd_global( found )
    780 !
    781 !--             Read user-defined global variables
    782                 IF ( .NOT. found )  CALL user_rrd_global( found )
     776                CALL module_interface_rrd_global( restart_string(1:length), found )
    783777
    784778                IF ( .NOT. found )  THEN
     
    818812    SUBROUTINE rrd_read_parts_of_global
    819813
    820 
    821        USE arrays_3d,                                                          &
    822            ONLY:  ref_state
    823 
    824        USE indices,                                                            &
    825            ONLY:  nz, nx_on_file, ny_on_file
    826 
    827        USE kinds
    828 
    829        USE pegrid
    830 
    831        USE statistics,                                                         &
    832            ONLY:  statistic_regions, hom, hom_sum, pr_palm
    833 
    834        IMPLICIT NONE
    835814
    836815       CHARACTER (LEN=10) ::  version_on_file
     
    959938                   WRITE( message_string, * ) 'inflow profiles not ',          &
    960939                                  'temporally averaged. &Averaging will be ',  &
    961                                   'done now using', average_count_pr,          & 
     940                                  'done now using', average_count_pr,          &
    962941                                  ' samples.'
    963942                   CALL message( 'rrd_read_parts_of_global', 'PA0309',         &
     
    10431022!> (binary format).
    10441023!------------------------------------------------------------------------------!
    1045  SUBROUTINE rrd_local
    1046  
    1047 
    1048     USE arrays_3d,                                                             &
    1049         ONLY:  e, kh, km, p, pt, q, ql, s, u, u_m_l, u_m_n, u_m_r, u_m_s,      &
    1050                v, v_m_l, v_m_n, v_m_r, v_m_s, vpt, w, w_m_l, w_m_n, w_m_r, w_m_s
    1051 
    1052     USE bulk_cloud_model_mod,                                                  &
    1053         ONLY :  bcm_rrd_local
    1054 
    1055     USE averaging
    1056 
    1057     USE chemistry_model_mod,                                                   &
    1058         ONLY:  chem_rrd_local
    1059 
    1060     USE cpulog,                                                                &
    1061         ONLY:  cpu_log, log_point_s
    1062 
    1063     USE gust_mod,                                                              &
    1064         ONLY :  gust_rrd_local
    1065 
    1066     USE indices,                                                               &
    1067         ONLY:  nbgp, nx, nxl, nxlg, nxr, nxrg, nx_on_file, ny, nys, nysg, nyn, &
    1068                nyng, ny_on_file, nzb, nzt
    1069 
    1070     USE kinds
    1071 
    1072     USE land_surface_model_mod,                                                &
    1073         ONLY:  lsm_rrd_local
    1074 
    1075     USE ocean_mod,                                                             &
    1076         ONLY:  ocean_rrd_local
    1077 
    1078     USE particle_attributes,                                                   &
    1079         ONLY:  iran_part
    1080 
    1081     USE pegrid
    1082 
    1083     USE radiation_model_mod,                                                   &
    1084         ONLY: radiation_rrd_local
    1085 
    1086     USE random_function_mod,                                                   &
    1087         ONLY:  random_iv, random_iy
    1088 
    1089     USE random_generator_parallel,                                             &
    1090         ONLY:  id_random_array, seq_random_array
    1091    
    1092     USE salsa_mod,                                                             &
    1093         ONLY:  salsa_rrd_local
    1094 
    1095     USE surface_mod,                                                           &
    1096         ONLY :  surface_rrd_local
    1097        
    1098     USE urban_surface_mod,                                                     &
    1099         ONLY:  usm_rrd_local
    1100 
    1101     USE user_read_restart_data_mod,                                            &
    1102         ONLY:  user_rrd_local
    1103  
    1104 
    1105     IMPLICIT NONE
     1024 SUBROUTINE rrd_local
     1025
    11061026
    11071027    CHARACTER (LEN=7)  ::  myid_char_save
     
    18661786
    18671787!
    1868 !--                Read restart data of other modules
    1869                    IF ( .NOT. found ) CALL bcm_rrd_local( i, k, nxlf,          &
    1870                                            nxlc, nxl_on_file, nxrf, nxrc,      &
    1871                                            nxr_on_file, nynf, nync,            &
    1872                                            nyn_on_file, nysf, nysc,            &
    1873                                            nys_on_file, tmp_2d, tmp_3d, found )
    1874 
    1875                    IF ( .NOT. found ) CALL chem_rrd_local( i, k, nxlf,         &
    1876                                            nxlc, nxl_on_file, nxrf, nxrc,      &
    1877                                            nxr_on_file, nynf, nync,            &
    1878                                            nyn_on_file, nysf, nysc,            &
    1879                                            nys_on_file, tmp_3d, found )
    1880 
    1881                    IF ( .NOT. found ) CALL gust_rrd_local( i, k, nxlf,         &
    1882                                            nxlc, nxl_on_file, nxrf, nxrc,      &
    1883                                            nxr_on_file, nynf, nync,            &
    1884                                            nyn_on_file, nysf, nysc,            &
    1885                                            nys_on_file, tmp_2d, tmp_3d, found )
    1886 
    1887                    IF ( .NOT. found ) CALL lsm_rrd_local( i, k, nxlf,          &
    1888                                            nxlc, nxl_on_file, nxrf, nxrc,      &
    1889                                            nxr_on_file, nynf, nync,            &
    1890                                            nyn_on_file, nysf, nysc,            &
    1891                                            nys_on_file, tmp_2d, found )
    1892 
    1893                    IF ( .NOT. found ) CALL ocean_rrd_local( i, k, nxlf,        &
    1894                                            nxlc, nxl_on_file, nxrf, nxrc,      &
    1895                                            nxr_on_file, nynf, nync,            &
    1896                                            nyn_on_file, nysf, nysc,            &
    1897                                            nys_on_file, tmp_2d, tmp_3d, found )
    1898 
    1899                    IF ( .NOT. found ) CALL radiation_rrd_local( i, k, nxlf,    &
    1900                                            nxlc, nxl_on_file, nxrf, nxrc,      &
    1901                                            nxr_on_file, nynf, nync,            &
    1902                                            nyn_on_file, nysf, nysc,            &
    1903                                            nys_on_file, tmp_2d, tmp_3d, found )
    1904 
     1788!--                Read restart data of surfaces
    19051789                   IF ( .NOT. found ) CALL surface_rrd_local( i, k, nxlf,      &
    1906                                            nxlc, nxl_on_file, nxrf, nxrc,      &
    1907                                            nxr_on_file, nynf, nync,            &
    1908                                            nyn_on_file, nysf, nysc,            &
    1909                                            nys_on_file, found )
    1910 
    1911                    IF ( .NOT. found ) CALL usm_rrd_local( i, k, nxlf,          &
    19121790                                           nxlc, nxl_on_file, nxrf, nxrc,      &
    19131791                                           nxr_on_file, nynf, nync,            &
     
    19151793                                           nys_on_file, found )
    19161794
    1917                    IF ( .NOT. found  .AND.  salsa )  CALL salsa_rrd_local( i,  &
    1918                                            k, nxlf, nxlc, nxl_on_file, nxrf,   &
    1919                                            nxrc, nxr_on_file, nynf, nync,      &
    1920                                            nyn_on_file, nysf, nysc,            &
    1921                                            nys_on_file, tmp_3d, found )                                       
    1922 
    1923 !
    1924 !--                Read user-defined restart data
    1925                    IF ( .NOT. found ) CALL user_rrd_local( i, k, nxlf,         &
    1926                                            nxlc, nxl_on_file, nxrf, nxrc,      &
    1927                                            nxr_on_file, nynf, nync,            &
    1928                                            nyn_on_file, nysf, nysc,            &
    1929                                            nys_on_file, tmp_3d, found )
     1795!
     1796!--                Read restart data of other modules
     1797                   IF ( .NOT. found ) CALL module_interface_rrd_local(         &
     1798                                           restart_string(1:length), i, k,     &
     1799                                           nxlf, nxlc, nxl_on_file,            &
     1800                                           nxrf, nxrc, nxr_on_file,            &
     1801                                           nynf, nync, nyn_on_file,            &
     1802                                           nysf, nysc, nys_on_file,            &
     1803                                           tmp_2d, tmp_3d, found )
    19301804
    19311805
     
    19941868
    19951869
    1996        IMPLICIT NONE
    1997 
    19981870       CHARACTER (LEN=1) ::  cdum
    19991871
     
    20051877
    20061878          READ ( 13 )  cdum
    2007           READ ( 13 )  length 
     1879          READ ( 13 )  length
    20081880          READ ( 13 )  restart_string(1:length)
    20091881
  • palm/trunk/SOURCE/salsa_mod.f90

    r3636 r3637  
    2626! -----------------
    2727! $Id$
     28! Implementation of the PALM module interface
     29!
     30! 3636 2018-12-19 13:48:34Z raasch
    2831! nopointer option removed
    2932!
     
    9194
    9295    USE control_parameters
    93        
     96
    9497    USE indices,                                                               &
    9598        ONLY:  nbgp, nx, nxl, nxlg, nxr, nxrg, ny, nyn, nyng, nys, nysg, nzb,  &
     
    19561959    INTEGER(iwp) ::  g  !<
    19571960
     1961    IF ( simulated_time >= time_since_reference_point )  THEN
    19581962
    19591963    SELECT CASE ( mod_count )
     
    20102014
    20112015    END SELECT
     2016
     2017    ENDIF
    20122018
    20132019 END SUBROUTINE salsa_swap_timelevel
  • palm/trunk/SOURCE/sum_up_3d_data.f90

    r3597 r3637  
    2525! -----------------
    2626! $Id$
     27! Implementation of the PALM module interface
     28!
     29! 3597 2018-12-04 08:40:18Z maronga
    2730! Added output of theta_2m
    2831!
     
    259262        ONLY:  c_p, lv_d_cp, l_v
    260263
    261     USE biometeorology_mod,                                                    &
    262         ONLY:  bio_3d_data_averaging
    263 
    264264    USE bulk_cloud_model_mod,                                                  &
    265         ONLY:  bulk_cloud_model, bcm_3d_data_averaging
    266 
    267     USE chemistry_model_mod,                                                   &
    268         ONLY:  chem_3d_data_averaging
     265        ONLY:  bulk_cloud_model
    269266
    270267    USE control_parameters,                                                    &
    271         ONLY:  air_chemistry, average_count_3d, biometeorology, doav, doav_n,  &
    272                land_surface, ocean_mode, rho_surface, salsa, urban_surface,    &
     268        ONLY:  average_count_3d, doav, doav_n, rho_surface, urban_surface,     &
    273269               varnamelength
    274270
     
    276272        ONLY:  cpu_log, log_point
    277273
    278     USE gust_mod,                                                              &
    279         ONLY:  gust_3d_data_averaging, gust_module_enabled
    280 
    281274    USE indices,                                                               &
    282275        ONLY:  nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt
     
    284277    USE kinds
    285278
    286     USE land_surface_model_mod,                                                &
    287         ONLY:  lsm_3d_data_averaging
    288 
    289     USE ocean_mod,                                                             &
    290         ONLY:  ocean_3d_data_averaging
     279    USE module_interface,                                                      &
     280        ONLY:  module_interface_3d_data_averaging
    291281
    292282    USE particle_attributes,                                                   &
    293283        ONLY:  grid_particles, number_of_particles, particles, prt_count
    294 
    295     USE radiation_model_mod,                                                   &
    296         ONLY:  radiation, radiation_3d_data_averaging
    297          
    298     USE salsa_mod,                                                             &
    299         ONLY:  salsa_3d_data_averaging         
    300284
    301285    USE surface_mod,                                                           &
     
    307291
    308292    USE urban_surface_mod,                                                     &
    309         ONLY:  usm_average_3d_data
     293        ONLY:  usm_3d_data_averaging
    310294
    311295
     
    535519
    536520!
    537 !--             Allocating and initializing data arrays for other modules
    538 
    539                 IF ( air_chemistry  .AND. &
    540                      (trimvar(1:3) == 'kc_' .OR. trimvar(1:3) == 'em_') )  THEN
    541                    CALL chem_3d_data_averaging( 'allocate', doav(ii) )
    542                 ENDIF
    543 
    544                 IF ( bulk_cloud_model )  THEN
    545                    CALL bcm_3d_data_averaging( 'allocate', doav(ii) )
    546                 ENDIF
    547 
    548                 IF ( gust_module_enabled )  THEN
    549                    CALL gust_3d_data_averaging( 'allocate', doav(ii) )
    550                 ENDIF
    551 
    552                 IF ( biometeorology )  THEN
    553                    CALL bio_3d_data_averaging( 'allocate', doav(ii) )
    554                 ENDIF
    555 
    556                 IF ( land_surface )  THEN
    557                    CALL lsm_3d_data_averaging( 'allocate', doav(ii) )
    558                 ENDIF
    559 
    560                 IF ( ocean_mode )  THEN
    561                    CALL ocean_3d_data_averaging( 'allocate', doav(ii) )
    562                 ENDIF
    563 
    564                 IF ( radiation )  THEN
    565                    CALL radiation_3d_data_averaging( 'allocate', doav(ii) )
    566                 ENDIF
    567 
    568                 IF ( salsa )  THEN
    569                    CALL salsa_3d_data_averaging( 'allocate', doav(ii) )
    570                 ENDIF               
    571 
    572                 CALL tcm_3d_data_averaging( 'allocate', doav(ii) )
    573 
    574                 IF ( urban_surface  .AND.  trimvar(1:4) == 'usm_' )  THEN
    575                    CALL usm_average_3d_data( 'allocate', doav(ii) )
    576                 ENDIF
    577 
    578 !
    579 !--             User-defined quantities
    580                 CALL user_3d_data_averaging( 'allocate', doav(ii) )
     521!--             Allocating and initializing data arrays for turbulence closure module
     522                CALL tcm_3d_data_averaging( 'allocate', trimvar )
     523
     524!
     525!--             Allocating and initializing data arrays for all other modules
     526                CALL module_interface_3d_data_averaging( 'allocate', trimvar )
     527
    581528
    582529          END SELECT
     
    11831130
    11841131          CASE DEFAULT
    1185 !
    1186 !--          Summing up data from other modules
    1187              IF ( bulk_cloud_model )  THEN
    1188                 CALL bcm_3d_data_averaging( 'sum', doav(ii) )
    1189              ENDIF
    1190 
    1191              IF ( air_chemistry  .AND. &
    1192                   (trimvar(1:3) == 'kc_' .OR. trimvar(1:3) == 'em_') )  THEN
    1193                 CALL chem_3d_data_averaging( 'sum',doav(ii) )
    1194              ENDIF
    1195 
    1196              IF ( gust_module_enabled )  THEN
    1197                 CALL gust_3d_data_averaging( 'sum', doav(ii) )
    1198              ENDIF
    1199 
    1200              IF ( biometeorology )  THEN
    1201                 CALL bio_3d_data_averaging( 'sum', doav(ii) )
    1202              ENDIF
    1203 
    1204              IF ( land_surface )  THEN
    1205                 CALL lsm_3d_data_averaging( 'sum', doav(ii) )
    1206              ENDIF
    1207 
    1208              IF ( ocean_mode )  THEN
    1209                 CALL ocean_3d_data_averaging( 'sum', doav(ii) )
    1210              ENDIF
    1211 
    1212              IF ( radiation )  THEN
    1213                 CALL radiation_3d_data_averaging( 'sum', doav(ii) )
    1214              ENDIF
    1215 
    1216              IF ( salsa )  THEN
    1217                 CALL salsa_3d_data_averaging( 'sum', doav(ii) )
    1218              ENDIF                 
    1219 
    1220              CALL tcm_3d_data_averaging( 'sum', doav(ii) )
    12211132
    12221133!--          In case of urban surface variables it should be always checked
    12231134!--          if respective arrays are allocated, at least in case of a restart
    12241135!--          run, as averaged usm arrays are not read from file at the moment.
    1225              IF ( urban_surface  .AND.  trimvar(1:4) == 'usm_' )  THEN
    1226                 CALL usm_average_3d_data( 'allocate', doav(ii) )
    1227                 CALL usm_average_3d_data( 'sum', doav(ii) )
    1228              ENDIF
    1229 
    1230 !
    1231 !--          User-defined quantities
    1232              CALL user_3d_data_averaging( 'sum', doav(ii) )
     1136             IF ( urban_surface )  THEN
     1137                CALL usm_3d_data_averaging( 'allocate', trimvar )
     1138             ENDIF
     1139
     1140!
     1141!--          Summing up data from turbulence closure module
     1142             CALL tcm_3d_data_averaging( 'sum', trimvar )
     1143
     1144!
     1145!--          Summing up data from all other modules
     1146             CALL module_interface_3d_data_averaging( 'sum', trimvar )
     1147
    12331148
    12341149       END SELECT
  • palm/trunk/SOURCE/swap_timelevel.f90

    r3636 r3637  
    2525! -----------------
    2626! $Id$
     27! Implementation of the PALM module interface
     28!
     29! 3636 2018-12-19 13:48:34Z raasch
    2730! nopointer option removed
    2831!
     
    151154               v, v_1, v_2, v_p, w, w_1, w_2, w_p
    152155
    153     USE bulk_cloud_model_mod,                                                  &
    154         ONLY:  bulk_cloud_model, bcm_swap_timelevel
    155 
    156     USE chemistry_model_mod,                                                   &
    157         ONLY:  chem_swap_timelevel
    158 
    159156    USE cpulog,                                                                &
    160157        ONLY: cpu_log, log_point
    161158
    162159    USE control_parameters,                                                    &
    163         ONLY:  air_chemistry, humidity, land_surface, neutral, ocean_mode,     &
    164                passive_scalar, simulated_time, timestep_count, urban_surface,  &
    165                time_since_reference_point, salsa
    166 
    167     USE gust_mod,                                                              &
    168         ONLY: gust_module_enabled, gust_swap_timelevel
    169 
    170     USE land_surface_model_mod,                                                &
    171         ONLY: lsm_swap_timelevel
    172 
    173     USE ocean_mod,                                                             &
    174         ONLY:  ocean_swap_timelevel
     160        ONLY:  humidity, neutral, passive_scalar, timestep_count
     161
     162    USE kinds
     163
     164    USE module_interface,                                                      &
     165        ONLY:  module_interface_swap_timelevel
    175166
    176167    USE pmc_interface,                                                         &
    177168        ONLY: nested_run, pmci_set_swaplevel
    178          
    179     USE salsa_mod,                                                             &
    180         ONLY:  salsa_swap_timelevel, skip_time_do_salsa             
    181169
    182170    USE turbulence_closure_mod,                                                &
    183171        ONLY:  tcm_swap_timelevel
    184172
    185     USE urban_surface_mod,                                                     &
    186         ONLY:  usm_swap_timelevel
    187 
    188173
    189174    IMPLICIT NONE
    190175
    191     INTEGER ::  swap_level  !> swap_level for steering the pmc data transfer
     176    INTEGER(iwp) ::  swap_level  !> swap_level for steering the pmc data transfer
    192177
    193178!
     
    237222    END SELECT
    238223
    239     IF ( humidity  .AND.  bulk_cloud_model )  THEN
    240        CALL bcm_swap_timelevel( MOD( timestep_count, 2) )
    241     ENDIF
    242 
    243     IF ( air_chemistry )  CALL chem_swap_timelevel( MOD( timestep_count, 2) )
    244 
    245     IF ( gust_module_enabled )  THEN
    246        CALL gust_swap_timelevel( MOD( timestep_count, 2) )
    247     ENDIF
    248 
    249     IF ( land_surface )  THEN
    250        CALL lsm_swap_timelevel( MOD( timestep_count, 2) )
    251     ENDIF
    252 
    253     IF ( ocean_mode )  THEN
    254        CALL ocean_swap_timelevel( MOD( timestep_count, 2 ) )
    255     ENDIF
    256    
    257     IF ( salsa  .AND.  simulated_time >= time_since_reference_point )  THEN
    258        CALL salsa_swap_timelevel(  MOD( timestep_count, 2 ) )
    259     ENDIF     
    260 
     224!
     225!-- Set the swap level the turbulence closure module
    261226    CALL tcm_swap_timelevel( MOD( timestep_count, 2) )
    262227
    263     IF ( urban_surface )  THEN
    264        CALL usm_swap_timelevel( MOD( timestep_count, 2) )
    265     ENDIF
     228!
     229!-- Set the swap level for all other modules
     230    CALL module_interface_swap_timelevel( MOD( timestep_count, 2) )
    266231
    267232!
  • palm/trunk/SOURCE/urban_surface_mod.f90

    r3636 r3637  
    2828! -----------------
    2929! $Id$
     30! Implementation of the PALM module interface
     31!
     32! 3636 2018-12-19 13:48:34Z raasch
    3033! nopointer option removed
    3134!
     
    5255!
    5356! 3449 2018-10-29 19:36:56Z suehring
    54 ! Bugfix: Fix average arrays allocations in usm_average_3d_data (J.Resler)
     57! Bugfix: Fix average arrays allocations in usm_3d_data_averaging (J.Resler)
    5558! Bugfix: Fix reading wall temperatures (J.Resler)
    5659! Bugfix: Fix treating of outputs for wall temperature and sky view factors (J.Resler)
     
    182185! 2906 2018-03-19 08:56:40Z Giersch
    183186! Local variable ids has to be initialized with a value of -1 in
    184 ! usm_average_3d_data
     187! usm_3d_data_averaging
    185188!
    186189! 2894 2018-03-15 09:17:58Z Giersch
     
    11251128    END INTERFACE usm_allocate_surface
    11261129
    1127     INTERFACE usm_average_3d_data
    1128        MODULE PROCEDURE usm_average_3d_data
    1129     END INTERFACE usm_average_3d_data
     1130    INTERFACE usm_3d_data_averaging
     1131       MODULE PROCEDURE usm_3d_data_averaging
     1132    END INTERFACE usm_3d_data_averaging
    11301133
    11311134   
     
    11381141           usm_rrd_local,                                                      &
    11391142           usm_surface_energy_balance, usm_material_heat_model,                &
    1140            usm_swap_timelevel, usm_check_data_output, usm_average_3d_data,     &
     1143           usm_swap_timelevel, usm_check_data_output, usm_3d_data_averaging,   &
    11411144           usm_data_output_3d, usm_define_netcdf_grid, usm_parin,              &
    11421145           usm_wrd_local, usm_allocate_surface
     
    15631566!> the array necessary for storing the average.
    15641567!------------------------------------------------------------------------------!
    1565     SUBROUTINE usm_average_3d_data( mode, variable )
     1568    SUBROUTINE usm_3d_data_averaging( mode, variable )
    15661569
    15671570        IMPLICIT NONE
     
    15751578        CHARACTER(LEN=6), DIMENSION(0:nd-1), PARAMETER     :: dirname = (/ '_roof ', '_south', '_north', '_west ', '_east ' /)
    15761579        INTEGER(iwp), DIMENSION(0:nd-1), PARAMETER         :: dirint = (/ iup_u, isouth_u, inorth_u, iwest_u, ieast_u /)
     1580
     1581        IF ( variable(1:4) == 'usm_' )  THEN  ! is such a check really rquired?
    15771582
    15781583!--     find the real name of the variable
     
    24472452        ENDIF
    24482453
    2449     END SUBROUTINE usm_average_3d_data
     2454        ENDIF
     2455
     2456    END SUBROUTINE usm_3d_data_averaging
    24502457
    24512458
  • palm/trunk/SOURCE/write_restart_data_mod.f90

    r3589 r3637  
    2525! -----------------
    2626! $Id$
     27! Implementation of the PALM module interface
     28!
     29! 3589 2018-11-30 15:09:51Z suehring
    2730! Move the control parameter "salsa" from salsa_mod to control_parameters
    2831! (M. Kurppa)
     
    6972
    7073
     74    USE arrays_3d,                                                          &
     75        ONLY:  inflow_damping_factor, mean_inflow_profiles, pt_init,        &
     76               q_init, ref_state, s_init, u_init, ug, v_init, vg,           &
     77               e, kh, km, p, pt, q, ql, s, u, u_m_l, u_m_n, u_m_r,          &
     78               u_m_s, v, v_m_l, v_m_n, v_m_r, v_m_s, vpt, w, w_m_l, w_m_n,  &
     79               w_m_r, w_m_s
     80
     81    USE averaging
     82
    7183    USE control_parameters
    72  
    73     USE kinds     
     84
     85    USE date_and_time_mod,                                                     &
     86        ONLY:  day_of_year_init, time_utc_init
     87
     88    USE grid_variables,                                                        &
     89        ONLY:  dx, dy
     90
     91    USE indices,                                                               &
     92        ONLY:  nx, nxl, nxr, ny, nys, nyn, nz, nzb, nzt
     93
     94    USE kinds
     95
     96    USE model_1d_mod,                                                          &
     97        ONLY:  damp_level_1d, dt_pr_1d, dt_run_control_1d, end_time_1d
     98
     99    USE module_interface,                                                      &
     100        ONLY:  module_interface_wrd_global,                                    &
     101               module_interface_wrd_local
     102
     103    USE netcdf_interface,                                                      &
     104        ONLY:  netcdf_precision, output_for_t0
     105
     106    USE particle_attributes,                                                   &
     107        ONLY:  curvature_solution_effects, iran_part
    74108
    75109    USE pegrid,                                                                &
    76         ONLY:  myid, numprocs
    77      
     110        ONLY:  collective_wait, hor_index_bounds, myid, numprocs
     111
     112    USE radiation_model_mod,                                                   &
     113        ONLY:  time_radiation
     114
     115    USE random_function_mod,                                                   &
     116        ONLY:  random_iv, random_iy
     117
     118    USE random_generator_parallel,                                             &
     119        ONLY:  id_random_array, seq_random_array
     120
     121    USE spectra_mod,                                                           &
     122        ONLY:  average_count_sp, spectrum_x, spectrum_y
     123
     124    USE statistics,                                                            &
     125        ONLY:  statistic_regions, hom, hom_sum, u_max, u_max_ijk, v_max,       &
     126               v_max_ijk, w_max, w_max_ijk, z_i
     127
     128    USE surface_mod,                                                           &
     129        ONLY :  surface_wrd_local
     130
     131    USE vertical_nesting_mod,                                                  &
     132        ONLY:  vnest_init
     133
    78134
    79135    IMPLICIT NONE
     
    103159    SUBROUTINE wrd_global
    104160
    105 
    106        USE arrays_3d,                                                          &
    107            ONLY:  inflow_damping_factor, mean_inflow_profiles, pt_init,        &
    108                   q_init, ref_state, s_init, u_init, ug, v_init, vg
    109 
    110        USE bulk_cloud_model_mod,                                               &
    111            ONLY:  bulk_cloud_model, bcm_wrd_global
    112 
    113        USE date_and_time_mod,                                                  &
    114            ONLY:  day_of_year_init, time_utc_init
    115 
    116        USE flight_mod,                                                         &
    117            ONLY:  flight_wrd_global
    118 
    119        USE grid_variables,                                                     &
    120            ONLY:  dx, dy
    121 
    122        USE gust_mod,                                                           &
    123            ONLY :  gust_module_enabled, gust_wrd_global
    124 
    125        USE indices,                                                            &
    126            ONLY:  nx, ny, nz
    127 
    128        USE model_1d_mod,                                                       &
    129            ONLY:  damp_level_1d, dt_pr_1d, dt_run_control_1d, end_time_1d
    130 
    131        USE netcdf_interface,                                                   &
    132            ONLY:  netcdf_precision, output_for_t0
    133 
    134        USE ocean_mod,                                                          &
    135            ONLY:  ocean_wrd_global
    136 
    137        USE particle_attributes,                                                &
    138            ONLY:  curvature_solution_effects
    139 
    140        USE pegrid,                                                             &
    141            ONLY:  hor_index_bounds, collective_wait                               
    142 
    143        USE radiation_model_mod,                                                &
    144            ONLY:  time_radiation
    145 
    146        USE spectra_mod,                                                        &
    147            ONLY:  average_count_sp, spectrum_x, spectrum_y
    148 
    149        USE synthetic_turbulence_generator_mod,                                 &
    150            ONLY:  stg_wrd_global
    151 
    152        USE statistics,                                                         &
    153            ONLY:  statistic_regions, hom, hom_sum, u_max, u_max_ijk, v_max,    &
    154                   v_max_ijk, w_max, w_max_ijk, z_i
    155 
    156        USE user_write_restart_data_mod,                                        &
    157            ONLY:  user_wrd_global
    158 
    159        USE vertical_nesting_mod,                                               &
    160            ONLY:  vnest_init
    161 
    162        USE wind_turbine_model_mod,                                             &
    163            ONLY:  wtm_wrd_global
    164      
    165 
    166        IMPLICIT NONE
    167161
    168162       CHARACTER (LEN=10)  ::  binary_version_global   !<
     
    886880!
    887881!--    Write restart data of the other modules
    888 !--    The order of the calls can be different as in read_restart_data_mod where
    889 !--    the restart data will be read
    890        IF ( bulk_cloud_model )     CALL bcm_wrd_global
    891        IF ( virtual_flight )       CALL flight_wrd_global
    892        IF ( gust_module_enabled )  CALL gust_wrd_global
    893        IF ( ocean_mode )           CALL ocean_wrd_global
    894        IF ( syn_turb_gen )         CALL stg_wrd_global
    895        IF ( wind_turbine )         CALL wtm_wrd_global
    896 !
    897 !--    Write restart data of the user-interface
    898        CALL user_wrd_global
     882       CALL module_interface_wrd_global
    899883
    900884
     
    910894!------------------------------------------------------------------------------!
    911895    SUBROUTINE wrd_local
    912  
    913 
    914        USE arrays_3d,                                                          &
    915            ONLY:  e, kh, km, p, pt, q, ql, s, u, u_m_l, u_m_n, u_m_r,          &
    916                   u_m_s, v, v_m_l, v_m_n, v_m_r, v_m_s, vpt, w, w_m_l, w_m_n,  &
    917                   w_m_r, w_m_s
    918        
    919        USE averaging
    920 
    921        USE bulk_cloud_model_mod,                                               &
    922            ONLY:  bulk_cloud_model, bcm_wrd_local
    923 
    924        USE chemistry_model_mod,                                                &
    925            ONLY:  chem_wrd_local
    926 
    927        USE gust_mod,                                                           &
    928            ONLY :  gust_module_enabled, gust_wrd_local
    929                
    930        USE indices,                                                            &
    931            ONLY:  nxl, nxr, nys, nyn, nzb, nzt
    932 
    933        USE land_surface_model_mod,                                             &
    934            ONLY:  lsm_wrd_local
    935 
    936        USE ocean_mod,                                                          &
    937            ONLY:  ocean_wrd_local
    938 
    939        USE particle_attributes,                                                &
    940            ONLY:  iran_part
    941 
    942        USE radiation_model_mod,                                                &
    943            ONLY:  radiation, radiation_wrd_local
    944    
    945        USE random_function_mod,                                                &
    946            ONLY:  random_iv, random_iy
    947 
    948        USE random_generator_parallel,                                          &
    949            ONLY:  id_random_array, seq_random_array
    950              
    951        USE salsa_mod,                                                          &
    952            ONLY:  salsa_wrd_local         
    953 
    954        USE surface_mod,                                                        &
    955            ONLY :  surface_wrd_local
    956 
    957        USE urban_surface_mod,                                                  &
    958            ONLY:  usm_wrd_local   
    959 
    960        USE user_write_restart_data_mod,                                        &
    961            ONLY:  user_wrd_local
    962 
    963 
    964        IMPLICIT NONE
     896
    965897
    966898       CHARACTER (LEN=10) ::  binary_version_local   !<
    967 
    968899
    969900!
     
    12711202       ENDIF
    12721203
     1204
     1205       CALL surface_wrd_local
     1206
    12731207!
    12741208!--    Write restart data of other modules
    1275        IF ( bulk_cloud_model )     CALL bcm_wrd_local
    1276        IF ( air_chemistry )        CALL chem_wrd_local
    1277        IF ( gust_module_enabled )  CALL gust_wrd_local
    1278        IF ( land_surface )         CALL lsm_wrd_local
    1279        IF ( ocean_mode )           CALL ocean_wrd_local
    1280        IF ( radiation )            CALL radiation_wrd_local
    1281        IF ( salsa )                CALL salsa_wrd_local
    1282        CALL surface_wrd_local
    1283        IF ( urban_surface )        CALL usm_wrd_local
    1284 
    1285 !
    1286 !--    Write user-defined restart data
    1287        CALL user_wrd_local
     1209       CALL module_interface_wrd_local
    12881210
    12891211!
Note: See TracChangeset for help on using the changeset viewer.