Changeset 2912 for palm/trunk


Ignore:
Timestamp:
Mar 20, 2018 1:00:05 PM (6 years ago)
Author:
knoop
Message:

Added gust module interface calls to restart data modules

Location:
palm/trunk/SOURCE
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/Makefile

    r2894 r2912  
    13451345        chemistry_model_mod.o \
    13461346        cpulog_mod.o\
     1347        gust_mod.o \
    13471348        land_surface_model_mod.o \
    13481349        microphysics_mod.o \
     
    16731674write_restart_data_mod.o: \
    16741675        chemistry_model_mod.o \
     1676        gust_mod.o \
    16751677        land_surface_model_mod.o \
    16761678        microphysics_mod.o \
  • palm/trunk/SOURCE/gust_mod.f90

    r2821 r2912  
    2424! Former revisions:
    2525! -----------------
    26 !
     26! $Id$
    2727! Initial interface definition
    2828!
     
    6767       gust_data_output_3d, &
    6868       gust_statistics, &
    69        gust_read_restart_data, &
    70        gust_write_restart_data
     69       gust_rrd_global, &
     70       gust_wrd_global, &
     71       gust_rrd_local, &
     72       gust_wrd_local
    7173!
    7274!-- Public parameters, constants and initial values
     
    132134    END INTERFACE gust_statistics
    133135
    134     INTERFACE gust_read_restart_data
    135        MODULE PROCEDURE gust_read_restart_data
    136     END INTERFACE gust_read_restart_data
    137 
    138     INTERFACE gust_write_restart_data
    139        MODULE PROCEDURE gust_write_restart_data
    140     END INTERFACE gust_write_restart_data
     136    INTERFACE gust_rrd_global
     137       MODULE PROCEDURE gust_rrd_global
     138    END INTERFACE gust_rrd_global
     139
     140    INTERFACE gust_wrd_global
     141       MODULE PROCEDURE gust_wrd_global
     142    END INTERFACE gust_wrd_global
     143
     144    INTERFACE gust_rrd_local
     145       MODULE PROCEDURE gust_rrd_local
     146    END INTERFACE gust_rrd_local
     147
     148    INTERFACE gust_wrd_local
     149       MODULE PROCEDURE gust_wrd_local
     150    END INTERFACE gust_wrd_local
    141151
    142152 CONTAINS
     
    447457!> This routine reads the respective restart data for the gust module.
    448458!------------------------------------------------------------------------------!
    449     SUBROUTINE gust_read_restart_data
    450 
    451 
    452        IMPLICIT NONE
    453 
    454 
    455     END SUBROUTINE gust_read_restart_data
     459    SUBROUTINE gust_rrd_global( found )
     460
     461
     462       USE control_parameters,                                                 &
     463           ONLY: length, restart_string
     464
     465
     466       IMPLICIT NONE
     467
     468       LOGICAL, INTENT(OUT)  ::  found
     469
     470
     471       found = .TRUE.
     472
     473
     474       SELECT CASE ( restart_string(1:length) )
     475
     476          CASE ( 'global_paramter' )
     477!             READ ( 13 )  global_parameter
     478
     479          CASE DEFAULT
     480
     481             found = .FALSE.
     482
     483       END SELECT
     484
     485
     486    END SUBROUTINE gust_rrd_global
     487
     488
     489!------------------------------------------------------------------------------!
     490! Description:
     491! ------------
     492!> This routine reads the respective restart data for the gust module.
     493!------------------------------------------------------------------------------!
     494    SUBROUTINE gust_rrd_local( i, k, nxlf, nxlc, nxl_on_file, nxrf, nxrc,      &
     495                               nxr_on_file, nynf, nync, nyn_on_file, nysf,     &
     496                               nysc, nys_on_file, tmp_2d, tmp_3d, found )
     497
     498
     499       USE control_parameters
     500
     501       USE indices
     502
     503       USE kinds
     504
     505       USE pegrid
     506
     507
     508       IMPLICIT NONE
     509
     510       INTEGER(iwp) ::  i               !<
     511       INTEGER(iwp) ::  k               !<
     512       INTEGER(iwp) ::  nxlc            !<
     513       INTEGER(iwp) ::  nxlf            !<
     514       INTEGER(iwp) ::  nxl_on_file     !<
     515       INTEGER(iwp) ::  nxrc            !<
     516       INTEGER(iwp) ::  nxrf            !<
     517       INTEGER(iwp) ::  nxr_on_file     !<
     518       INTEGER(iwp) ::  nync            !<
     519       INTEGER(iwp) ::  nynf            !<
     520       INTEGER(iwp) ::  nyn_on_file     !<
     521       INTEGER(iwp) ::  nysc            !<
     522       INTEGER(iwp) ::  nysf            !<
     523       INTEGER(iwp) ::  nys_on_file     !<
     524
     525       LOGICAL, INTENT(OUT)  ::  found
     526
     527       REAL(wp), DIMENSION(nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) :: tmp_2d   !<
     528       REAL(wp), DIMENSION(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) :: tmp_3d   !<
     529
     530!
     531!-- Here the reading of user-defined restart data follows:
     532!-- Sample for user-defined output
     533
     534
     535       found = .TRUE.
     536
     537
     538       SELECT CASE ( restart_string(1:length) )
     539
     540          CASE ( 'u2_av' )
     541!             IF ( .NOT. ALLOCATED( u2_av ) ) THEN
     542!                  ALLOCATE( u2_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
     543!             ENDIF
     544!             IF ( k == 1 )  READ ( 13 )  tmp_3d
     545!                u2_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =         &
     546!                   tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
     547!
     548          CASE DEFAULT
     549
     550             found = .FALSE.
     551
     552          END SELECT
     553
     554
     555    END SUBROUTINE gust_rrd_local
    456556
    457557
     
    461561!> This routine writes the respective restart data for the gust module.
    462562!------------------------------------------------------------------------------!
    463     SUBROUTINE gust_write_restart_data
    464 
    465 
    466        IMPLICIT NONE
    467 
    468 
    469     END SUBROUTINE gust_write_restart_data
     563    SUBROUTINE gust_wrd_global
     564
     565
     566       IMPLICIT NONE
     567
     568! needs preceeding allocation if array
     569!       CALL wrd_write_string( 'global_parameter' )
     570!       WRITE ( 14 )  global_parameter
     571
     572!       IF ( ALLOCATED( inflow_damping_factor ) )  THEN
     573!          CALL wrd_write_string( 'inflow_damping_factor' )
     574!          WRITE ( 14 )  inflow_damping_factor
     575!       ENDIF
     576
     577
     578    END SUBROUTINE gust_wrd_global
     579
     580
     581!------------------------------------------------------------------------------!
     582! Description:
     583! ------------
     584!> This routine writes the respective restart data for the gust module.
     585!------------------------------------------------------------------------------!
     586    SUBROUTINE gust_wrd_local
     587
     588
     589       IMPLICIT NONE
     590
     591
     592! needs preceeding allocation because sould be array
     593!          IF ( ALLOCATED( u2_av ) )  THEN
     594!             CALL wrd_write_string( 'u2_av' )
     595!             WRITE ( 14 )  u2_av
     596!          ENDIF
     597
     598
     599    END SUBROUTINE gust_wrd_local
    470600
    471601
  • palm/trunk/SOURCE/read_restart_data_mod.f90

    r2894 r2912  
    2525! -----------------
    2626! $Id$
     27! Added gust module interface calls
     28!
     29! 2894 2018-03-15 09:17:58Z Giersch
    2730! Initial revision
    2831!
     
    8184       USE grid_variables,                                                     &
    8285           ONLY:  dx, dy
     86
     87       USE gust_mod,                                                           &
     88           ONLY :  gust_rrd_global
    8389
    8490       USE indices,                                                            &
     
    726732                IF ( .NOT. found ) CALL stg_rrd_global ( found )
    727733
     734                IF ( .NOT. found ) CALL gust_rrd_global( found )
     735
    728736                IF ( .NOT. found ) CALL user_rrd_global( found )
    729737
     
    10051013    USE cpulog,                                                                &
    10061014        ONLY:  cpu_log, log_point_s
     1015
     1016    USE gust_mod,                                                           &
     1017        ONLY :  gust_rrd_local
    10071018
    10081019    USE indices,                                                               &
     
    19811992
    19821993!
     1994!--                Read gust module restart data
     1995                   IF ( .NOT. found ) CALL gust_rrd_local( i, k, nxlf,         &
     1996                                           nxlc, nxl_on_file, nxrf, nxrc,      &
     1997                                           nxr_on_file, nynf, nync,            &
     1998                                           nyn_on_file, nysf, nysc,            &
     1999                                           nys_on_file, tmp_2d, tmp_3d, found )
     2000
     2001!
    19832002!--                Read user-defined restart data
    19842003                   IF ( .NOT. found ) CALL user_rrd_local( i, k, nxlf,         &
  • palm/trunk/SOURCE/write_restart_data_mod.f90

    r2894 r2912  
    2525! -----------------
    2626! $Id$
     27! Added gust module interface calls
     28!
     29! 2894 2018-03-15 09:17:58Z Giersch
    2730! Initial revision
    2831!
     
    8083           ONLY:  dx, dy
    8184
     85       USE gust_mod,                                                           &
     86           ONLY :  gust_module_enabled, gust_wrd_global
     87
    8288       USE indices,                                                            &
    8389           ONLY:  nz, nx, ny
     
    884890!-- If required, write restart data for turbulence generator.
    885891       IF ( syn_turb_gen )  CALL stg_wrd_global
     892!
     893!-- If required, write restart data for gust module.
     894       IF ( gust_module_enabled )  CALL gust_wrd_global
    886895
    887896!
     
    913922       USE chemistry_model_mod,                                                &
    914923           ONLY:  chem_wrd_local
     924
     925       USE gust_mod,                                                           &
     926           ONLY :  gust_module_enabled, gust_wrd_local
    915927               
    916928       USE indices,                                                            &
     
    13691381
    13701382!
     1383!-- If required, write restart data for gust module.
     1384       IF ( gust_module_enabled )  THEN
     1385          CALL gust_wrd_local
     1386       ENDIF
     1387
     1388!
    13711389!-- Write user-related restart data.
    13721390       CALL user_wrd_local
Note: See TracChangeset for help on using the changeset viewer.