Changeset 3873 for palm


Ignore:
Timestamp:
Apr 8, 2019 3:44:30 PM (5 years ago)
Author:
knoop
Message:

Moved ocean_mode specific code from advec_ws to ocean_mod + implemented ocean_actions

Location:
palm/trunk/SOURCE
Files:
3 edited

Legend:

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

    r3872 r3873  
    2525! -----------------
    2626! $Id$
     27! Moved ocean_mode specific code to ocean_mod
     28!
     29! 3872 2019-04-08 15:03:06Z knoop
    2730! Moved all USE statements to module level + removed salsa dependency
    2831!
     
    287290
    288291    USE control_parameters,                                                    &
    289         ONLY:  humidity, loop_optimization, passive_scalar, ocean_mode,        &
     292        ONLY:  humidity, loop_optimization, passive_scalar,                    &
    290293               rans_tke_e, ws_scheme_mom, ws_scheme_sca,                       &
    291294               momentum_advec, scalar_advec,                                   &
     
    409412             ALLOCATE( sums_wsss_ws_l(nzb:nzt+1,0:threads_per_task-1) )
    410413             sums_wsss_ws_l = 0.0_wp
    411           ENDIF
    412 
    413           IF ( ocean_mode )  THEN
    414              ALLOCATE( sums_wssas_ws_l(nzb:nzt+1,0:threads_per_task-1) )
    415              sums_wssas_ws_l = 0.0_wp
    416414          ENDIF
    417415
     
    472470                ALLOCATE( flux_l_s(nzb+1:nzt,nys:nyn,0:threads_per_task-1),    &
    473471                          diss_l_s(nzb+1:nzt,nys:nyn,0:threads_per_task-1) )
    474              ENDIF
    475 
    476              IF ( ocean_mode )  THEN
    477                 ALLOCATE( flux_s_sa(nzb+1:nzt,0:threads_per_task-1),           &
    478                           diss_s_sa(nzb+1:nzt,0:threads_per_task-1) )
    479                 ALLOCATE( flux_l_sa(nzb+1:nzt,nys:nyn,0:threads_per_task-1),   &
    480                           diss_l_sa(nzb+1:nzt,nys:nyn,0:threads_per_task-1) )
    481472             ENDIF
    482473
     
    11121103          IF ( humidity       )  sums_wsqs_ws_l = 0.0_wp
    11131104          IF ( passive_scalar )  sums_wsss_ws_l = 0.0_wp
    1114           IF ( ocean_mode )  sums_wssas_ws_l = 0.0_wp
    11151105
    11161106       ENDIF
  • palm/trunk/SOURCE/module_interface.f90

    r3871 r3873  
    245245               ocean_init,                                                     &
    246246               ocean_header,                                                   &
     247               ocean_actions,                                                  &
    247248               ocean_prognostic_equations,                                     &
    248249               ocean_swap_timelevel,                                           &
     
    881882    IF ( bulk_cloud_model    )  CALL bcm_actions( location )
    882883    IF ( gust_module_enabled )  CALL gust_actions( location )
     884    IF ( ocean_mode          )  CALL ocean_actions( location )
    883885    IF ( salsa               )  CALL salsa_actions( location )
    884886    IF ( user_module_enabled )  CALL user_actions( location )
     
    903905    IF ( bulk_cloud_model    )  CALL bcm_actions( i, j, location )
    904906    IF ( gust_module_enabled )  CALL gust_actions( i, j, location )
     907    IF ( ocean_mode          )  CALL ocean_actions( i, j, location )
    905908    IF ( salsa               )  CALL salsa_actions( i, j, location )
    906909    IF ( user_module_enabled )  CALL user_actions( i, j, location )
  • palm/trunk/SOURCE/ocean_mod.f90

    r3767 r3873  
    2525! -----------------
    2626! $Id$
     27! implemented ocean_actions
     28!
     29! 3767 2019-02-27 08:18:02Z raasch
    2730! unused variable for file index and tmp_2d removed from rrd-subroutine parameter
    2831! list
     
    7780    USE arrays_3d,                                                             &
    7881        ONLY:  prho, prho_1, rho_ocean, rho_1, sa, sa_init, sa_1, sa_2, sa_3,  &
    79                sa_p, tsa_m
     82               sa_p, tsa_m, flux_l_sa, flux_s_sa, diss_l_sa, diss_s_sa
    8083
    8184    USE control_parameters,                                                    &
    8285        ONLY:  atmos_ocean_sign, bottom_salinityflux,                          &
    8386               constant_top_salinityflux, ocean_mode, top_salinityflux,        &
    84                wall_salinityflux
     87               wall_salinityflux, loop_optimization, ws_scheme_sca
    8588
    8689    USE kinds
     90
     91    USE pegrid,                                                                &
     92        ONLY:  threads_per_task
     93
     94    USE statistics,                                                            &
     95        ONLY:  sums_wssas_ws_l
    8796
    8897
     
    187196    END INTERFACE ocean_parin
    188197
     198    INTERFACE ocean_actions
     199       MODULE PROCEDURE ocean_actions
     200       MODULE PROCEDURE ocean_actions_ij
     201    END INTERFACE ocean_actions
     202
    189203    INTERFACE ocean_prognostic_equations
    190204       MODULE PROCEDURE ocean_prognostic_equations
     
    229243!
    230244!-- Add INTERFACES that must be available to other modules (alphabetical order)
    231     PUBLIC eqn_state_seawater, ocean_check_data_output,                        &
     245    PUBLIC eqn_state_seawater, ocean_actions, ocean_check_data_output,         &
    232246           ocean_check_data_output_pr, ocean_check_parameters,                 &
    233247           ocean_data_output_2d, ocean_data_output_3d,                         &
     
    11771191
    11781192    USE indices,                                                               &
    1179         ONLY:  nxlg, nxrg, nyng, nysg, nzb, nzt
     1193        ONLY:  nxlg, nxrg, nyn, nyng, nys, nysg, nzb, nzt
    11801194
    11811195    IMPLICIT NONE
     
    11881202    IF (  salinity )  THEN
    11891203       ALLOCATE( sa_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
     1204    ENDIF
     1205
     1206    IF ( ws_scheme_sca )  THEN
     1207       ALLOCATE( sums_wssas_ws_l(nzb:nzt+1,0:threads_per_task-1) )
     1208       sums_wssas_ws_l = 0.0_wp
     1209    ENDIF
     1210
     1211    IF ( loop_optimization /= 'vector' )  THEN
     1212
     1213       IF ( ws_scheme_sca )  THEN
     1214          ALLOCATE( flux_s_sa(nzb+1:nzt,0:threads_per_task-1) )
     1215          ALLOCATE( diss_s_sa(nzb+1:nzt,0:threads_per_task-1) )
     1216          ALLOCATE( flux_l_sa(nzb+1:nzt,nys:nyn,0:threads_per_task-1) )
     1217          ALLOCATE( diss_l_sa(nzb+1:nzt,nys:nyn,0:threads_per_task-1) )
     1218       ENDIF
     1219
    11901220    ENDIF
    11911221
     
    14691499
    14701500 END SUBROUTINE ocean_init
     1501
     1502
     1503!------------------------------------------------------------------------------!
     1504! Description:
     1505! ------------
     1506!> Call for all grid points
     1507!------------------------------------------------------------------------------!
     1508 SUBROUTINE ocean_actions( location )
     1509
     1510
     1511    CHARACTER (LEN=*), INTENT(IN) ::  location !< call location string
     1512
     1513    SELECT CASE ( location )
     1514
     1515       CASE ( 'before_timestep' )
     1516
     1517          IF ( ws_scheme_sca )  THEN
     1518             sums_wssas_ws_l = 0.0_wp
     1519          ENDIF
     1520
     1521       CASE DEFAULT
     1522          CONTINUE
     1523
     1524    END SELECT
     1525
     1526 END SUBROUTINE ocean_actions
     1527
     1528
     1529!------------------------------------------------------------------------------!
     1530! Description:
     1531! ------------
     1532!> Call for grid points i,j
     1533!------------------------------------------------------------------------------!
     1534 SUBROUTINE ocean_actions_ij( i, j, location )
     1535
     1536
     1537    INTEGER(iwp),      INTENT(IN) ::  i         !< grid index in x-direction
     1538    INTEGER(iwp),      INTENT(IN) ::  j         !< grid index in y-direction
     1539    CHARACTER (LEN=*), INTENT(IN) ::  location  !< call location string
     1540    INTEGER(iwp)  ::  dummy  !< call location string
     1541
     1542    IF ( ocean_mode )   dummy = i + j
     1543
     1544    SELECT CASE ( location )
     1545
     1546       CASE ( 'before_timestep' )
     1547
     1548          IF ( ws_scheme_sca )  THEN
     1549             sums_wssas_ws_l = 0.0_wp
     1550          ENDIF
     1551
     1552       CASE DEFAULT
     1553          CONTINUE
     1554
     1555    END SELECT
     1556
     1557 END SUBROUTINE ocean_actions_ij
    14711558
    14721559
Note: See TracChangeset for help on using the changeset viewer.