Changeset 102 for palm/trunk/SOURCE


Ignore:
Timestamp:
Jul 27, 2007 9:09:17 AM (17 years ago)
Author:
raasch
Message:

preliminary version for coupled runs

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

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/CURRENT_MODIFICATIONS

    r97 r102  
    11New:
    22---
     3Allows runs for a coupled atmosphere-ocean LES,
     4coupling frequency is controlled by new d3par-parameter dt_coupling,
     5the coupling mode (atmosphere_to_ocean or ocean_to_atmosphere) for the
     6respective processes is read from environment variable coupling_mode,
     7which is set by the mpiexec-command,
     8communication between the two models is done using the intercommunicator
     9comm_inter,
     10local files opened by the ocean model get the additional suffic "_O"
     11
     12A momentum flux can be set as top boundary condition using the new
     13inipar parameter top_momentumflux_u|v.
     14
     15boundary_conds, check_open, check_parameters, diffusion_u, diffusion_v, flow_statistics, header, init_pegrid, init_3d_model, modules, palm, parin, prognostic_equations, read_var_list, read_3d_binary, swap_timelevel, time_integration, write_var_list, write_3d_binary
     16
     17New:
     18surface_coupler
    319
    420
  • palm/trunk/SOURCE/Makefile

    r96 r102  
    44# Actual revisions:
    55# -----------------
    6 # +eqn_state_seawater, init_ocean
     6# +surface_coupler
    77#
    88# Former revisions:
    99# -----------------
    1010# $Id$
     11#
     12# 96 2007-06-04 08:07:41Z raasch
     13# +eqn_state_seawater, init_ocean
    1114#
    1215# 82 2007-04-16 15:40:52Z raasch
     
    6164        random_gauss.f90 read_3d_binary.f90 read_var_list.f90 run_control.f90 \
    6265        singleton.f90 sor.f90 spline_x.f90 spline_y.f90 spline_z.f90 \
    63         sum_up_3d_data.f90 swap_timelevel.f90 temperton_fft.f90 \
    64         time_integration.f90 time_to_string.f90 timestep.f90 \
     66        sum_up_3d_data.f90 surface_coupler.f90 swap_timelevel.f90 \
     67        temperton_fft.f90 time_integration.f90 time_to_string.f90 timestep.f90 \
    6568        timestep_scheme_steering.f90 transpose.f90 user_interface.f90 \
    6669        wall_fluxes.f90 write_3d_binary.f90 write_compressed.f90 \
     
    9093        production_e.o prognostic_equations.o random_function.o random_gauss.o \
    9194        read_3d_binary.o read_var_list.o run_control.o singleton.o sor.o \
    92         spline_x.o spline_y.o spline_z.o sum_up_3d_data.o swap_timelevel.o \
    93         temperton_fft.o time_integration.o time_to_string.o timestep.o \
    94         timestep_scheme_steering.o transpose.o user_interface.o \
     95        spline_x.o spline_y.o spline_z.o sum_up_3d_data.o surface_coupler.o \
     96        swap_timelevel.o temperton_fft.o time_integration.o time_to_string.o \
     97        timestep.o timestep_scheme_steering.o transpose.o user_interface.o \
    9598        wall_fluxes.o write_3d_binary.o write_compressed.o write_var_list.o
    9699
     
    221224spline_z.o: modules.o
    222225sum_up_3d_data.o: modules.o
     226surface_coupler.o: modules.o
    223227swap_timelevel.o: modules.o
    224228temperton_fft.o: modules.o
  • palm/trunk/SOURCE/boundary_conds.f90

    r98 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Boundary conditions for temperature adjusted for coupled runs
    77!
    88! Former revisions:
     
    9393
    9494!
    95 !--    Temperature at bottom boundary
     95!--    Temperature at bottom boundary.
     96!--    In case of coupled runs (ibc_pt_b = 2) the temperature is given by
     97!--    the sea surface temperature of the coupled ocean model.
    9698       IF ( ibc_pt_b == 0 )  THEN
    9799          DO  i = nxl-1, nxr+1
     
    100102             ENDDO
    101103          ENDDO
    102        ELSE
     104       ELSEIF ( ibc_pt_b == 1 )  THEN
    103105          DO  i = nxl-1, nxr+1
    104106             DO  j = nys-1, nyn+1
  • palm/trunk/SOURCE/check_open.f90

    r83 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Different filenames are used in case of a coupled simulation,
     7! coupling_char added to all relevant filenames
    78!
    89! Former revisions:
     
    146147       CASE ( 11 )
    147148
    148           OPEN ( 11, FILE='PARIN', FORM='FORMATTED', STATUS='OLD' )
     149          OPEN ( 11, FILE='PARIN'//coupling_char, FORM='FORMATTED', &
     150                     STATUS='OLD' )
    149151
    150152       CASE ( 13 )
    151153
    152154          IF ( myid_char == '' )  THEN
    153              OPEN ( 13, FILE='BININ'//myid_char, FORM='UNFORMATTED', &
    154                         STATUS='OLD' )
    155           ELSE
    156              OPEN ( 13, FILE='BININ/'//myid_char, FORM='UNFORMATTED', &
    157                         STATUS='OLD' )
     155             OPEN ( 13, FILE='BININ'//coupling_char//myid_char, &
     156                        FORM='UNFORMATTED', STATUS='OLD' )
     157          ELSE
     158             OPEN ( 13, FILE='BININ'//coupling_char//'/'//myid_char, &
     159                        FORM='UNFORMATTED', STATUS='OLD' )
    158160          ENDIF
    159161
     
    161163
    162164          IF ( myid_char == '' )  THEN
    163              OPEN ( 14, FILE='BINOUT'//myid_char, FORM='UNFORMATTED', &
    164                         POSITION='APPEND' )
     165             OPEN ( 14, FILE='BINOUT'//coupling_char//myid_char, &
     166                        FORM='UNFORMATTED', POSITION='APPEND' )
    165167          ELSE
    166168             IF ( myid == 0  .AND. .NOT. openfile(file_id)%opened_before )  THEN
    167                 CALL local_system( 'mkdir  BINOUT' )
     169                CALL local_system( 'mkdir  BINOUT' // coupling_char )
    168170             ENDIF
    169171#if defined( __parallel )
     
    173175             CALL MPI_BARRIER( comm2d, ierr )
    174176#endif
    175              OPEN ( 14, FILE='BINOUT/'//myid_char_14, FORM='UNFORMATTED', &
    176                         POSITION='APPEND' )
     177             OPEN ( 14, FILE='BINOUT'//coupling_char//'/'//myid_char_14, &
     178                        FORM='UNFORMATTED', POSITION='APPEND' )
    177179          ENDIF
    178180
    179181       CASE ( 15 )
    180182
    181           OPEN ( 15, FILE='RUN_CONTROL', FORM='FORMATTED' )
     183          OPEN ( 15, FILE='RUN_CONTROL'//coupling_char, FORM='FORMATTED' )
    182184
    183185       CASE ( 16 )
    184186
    185           OPEN ( 16, FILE='LIST_PROFIL', FORM='FORMATTED' )
     187          OPEN ( 16, FILE='LIST_PROFIL'//coupling_char, FORM='FORMATTED' )
    186188
    187189       CASE ( 17 )
    188190
    189           OPEN ( 17, FILE='LIST_PROFIL_1D', FORM='FORMATTED' )
     191          OPEN ( 17, FILE='LIST_PROFIL_1D'//coupling_char, FORM='FORMATTED' )
    190192
    191193       CASE ( 18 )
    192194
    193           OPEN ( 18, FILE='CPU_MEASURES', FORM='FORMATTED' )
     195          OPEN ( 18, FILE='CPU_MEASURES'//coupling_char, FORM='FORMATTED' )
    194196
    195197       CASE ( 19 )
    196198
    197           OPEN ( 19, FILE='HEADER', FORM='FORMATTED' )
     199          OPEN ( 19, FILE='HEADER'//coupling_char, FORM='FORMATTED' )
    198200
    199201       CASE ( 20 )
    200202
    201203          IF ( myid == 0  .AND. .NOT. openfile(file_id)%opened_before )  THEN
    202              CALL local_system( 'mkdir  DATA_LOG' )
     204             CALL local_system( 'mkdir  DATA_LOG' // coupling_char )
    203205          ENDIF
    204206          IF ( myid_char == '' )  THEN
    205              OPEN ( 20, FILE='DATA_LOG/_0000', FORM='UNFORMATTED', &
    206                         POSITION='APPEND' )
     207             OPEN ( 20, FILE='DATA_LOG'//coupling_char//'/_0000', &
     208                        FORM='UNFORMATTED', POSITION='APPEND' )
    207209          ELSE
    208210#if defined( __parallel )
     
    212214             CALL MPI_BARRIER( comm2d, ierr )
    213215#endif
    214              OPEN ( 20, FILE='DATA_LOG/'//myid_char, FORM='UNFORMATTED', &
    215                         POSITION='APPEND' )
     216             OPEN ( 20, FILE='DATA_LOG'//coupling_char//'/'//myid_char, &
     217                        FORM='UNFORMATTED', POSITION='APPEND' )
    216218          ENDIF
    217219
     
    219221
    220222          IF ( data_output_2d_on_each_pe )  THEN
    221              OPEN ( 21, FILE='PLOT2D_XY'//myid_char, FORM='UNFORMATTED', &
    222                         POSITION='APPEND' )
    223           ELSE
    224              OPEN ( 21, FILE='PLOT2D_XY', FORM='UNFORMATTED', &
    225                         POSITION='APPEND' )
     223             OPEN ( 21, FILE='PLOT2D_XY'//coupling_char//myid_char, &
     224                        FORM='UNFORMATTED', POSITION='APPEND' )
     225          ELSE
     226             OPEN ( 21, FILE='PLOT2D_XY'//coupling_char, &
     227                        FORM='UNFORMATTED', POSITION='APPEND' )
    226228          ENDIF
    227229
     
    250252!--          Create output file for local parameters
    251253             IF ( iso2d_output )  THEN
    252                 OPEN ( 27, FILE='PLOT2D_XY_LOCAL', FORM='FORMATTED', &
    253                            DELIM='APOSTROPHE' )
     254                OPEN ( 27, FILE='PLOT2D_XY_LOCAL'//coupling_char, &
     255                           FORM='FORMATTED', DELIM='APOSTROPHE' )
    254256                openfile(27)%opened = .TRUE.
    255257             ENDIF
     
    260262
    261263          IF ( data_output_2d_on_each_pe )  THEN
    262              OPEN ( 22, FILE='PLOT2D_XZ'//myid_char, FORM='UNFORMATTED', &
    263                         POSITION='APPEND' )
    264           ELSE
    265              OPEN ( 22, FILE='PLOT2D_XZ', FORM='UNFORMATTED', &
     264             OPEN ( 22, FILE='PLOT2D_XZ'//coupling_char//myid_char, &
     265                        FORM='UNFORMATTED', POSITION='APPEND' )
     266          ELSE
     267             OPEN ( 22, FILE='PLOT2D_XZ'//coupling_char, FORM='UNFORMATTED', &
    266268                        POSITION='APPEND' )
    267269          ENDIF
     
    289291!
    290292!--          Create output file for local parameters
    291              OPEN ( 28, FILE='PLOT2D_XZ_LOCAL', FORM='FORMATTED', &
    292                         DELIM='APOSTROPHE' )
     293             OPEN ( 28, FILE='PLOT2D_XZ_LOCAL'//coupling_char, &
     294                        FORM='FORMATTED', DELIM='APOSTROPHE' )
    293295             openfile(28)%opened = .TRUE.
    294296
     
    298300
    299301          IF ( data_output_2d_on_each_pe )  THEN
    300              OPEN ( 23, FILE='PLOT2D_YZ'//myid_char, FORM='UNFORMATTED', &
    301                         POSITION='APPEND' )
    302           ELSE
    303              OPEN ( 23, FILE='PLOT2D_YZ', FORM='UNFORMATTED', &
     302             OPEN ( 23, FILE='PLOT2D_YZ'//coupling_char//myid_char, &
     303                        FORM='UNFORMATTED', POSITION='APPEND' )
     304          ELSE
     305             OPEN ( 23, FILE='PLOT2D_YZ'//coupling_char, FORM='UNFORMATTED', &
    304306                        POSITION='APPEND' )
    305307          ENDIF
     
    327329!
    328330!--          Create output file for local parameters
    329              OPEN ( 29, FILE='PLOT2D_YZ_LOCAL', FORM='FORMATTED', &
    330                         DELIM='APOSTROPHE' )
     331             OPEN ( 29, FILE='PLOT2D_YZ_LOCAL'//coupling_char, &
     332                        FORM='FORMATTED', DELIM='APOSTROPHE' )
    331333             openfile(29)%opened = .TRUE.
    332334
     
    335337       CASE ( 30 )
    336338
    337           OPEN ( 30, FILE='PLOT3D_DATA'//myid_char, FORM='UNFORMATTED' )
     339          OPEN ( 30, FILE='PLOT3D_DATA'//coupling_char//myid_char, &
     340                     FORM='UNFORMATTED' )
    338341!
    339342!--       Write coordinate file for AVS
     
    508511             WRITE ( suffix, '(''_'',I1)' )  file_id - 40
    509512          ENDIF
    510           OPEN ( file_id, FILE='PLOT1D_DATA'//TRIM( suffix ), FORM='FORMATTED' )
     513          OPEN ( file_id, FILE='PLOT1D_DATA'//coupling_char//TRIM( suffix ), &
     514                          FORM='FORMATTED' )
    511515!
    512516!--       Write contents comments at the top of the file
     
    521525             WRITE ( suffix, '(''_'',I1)' )  file_id - 50
    522526          ENDIF
    523           OPEN ( file_id, FILE='PLOTTS_DATA'//TRIM( suffix ), FORM='FORMATTED',&
    524                           RECL=496 )
     527          OPEN ( file_id, FILE='PLOTTS_DATA'//coupling_char//TRIM( suffix ), &
     528                          FORM='FORMATTED', RECL=496 )
    525529!
    526530!--       Write PROFIL parameter file for output of time series
     
    539543!
    540544!--       Write RAHMEN parameter
    541           OPEN ( 90, FILE='PLOTTS_PAR'//TRIM( suffix ), FORM='FORMATTED', &
    542                      DELIM='APOSTROPHE' )
     545          OPEN ( 90, FILE='PLOTTS_PAR'//coupling_char//TRIM( suffix ), &
     546                     FORM='FORMATTED', DELIM='APOSTROPHE' )
    543547          WRITE ( 90, RAHMEN )
    544548!
     
    575579
    576580          IF ( myid_char == '' )  THEN
    577              OPEN ( 80, FILE='PARTICLE_INFOS'//myid_char, FORM='FORMATTED', &
    578                         POSITION='APPEND' )
     581             OPEN ( 80, FILE='PARTICLE_INFOS'//coupling_char//myid_char, &
     582                        FORM='FORMATTED', POSITION='APPEND' )
    579583          ELSE
    580584             IF ( myid == 0  .AND.  .NOT. openfile(80)%opened_before )  THEN
    581                 CALL local_system( 'mkdir  PARTICLE_INFOS' )
     585                CALL local_system( 'mkdir  PARTICLE_INFOS' // coupling_char )
    582586             ENDIF
    583587#if defined( __parallel )
     
    592596             ENDIF
    593597#endif
    594              OPEN ( 80, FILE='PARTICLE_INFOS/'//myid_char, FORM='FORMATTED', &
    595                         POSITION='APPEND' )
     598             OPEN ( 80, FILE='PARTICLE_INFOS'//coupling_char//'/'//myid_char, &
     599                        FORM='FORMATTED', POSITION='APPEND' )
    596600          ENDIF
    597601
     
    602606       CASE ( 81 )
    603607
    604              OPEN ( 81, FILE='PLOTSP_X_PAR', FORM='FORMATTED', &
     608             OPEN ( 81, FILE='PLOTSP_X_PAR'//coupling_char, FORM='FORMATTED', &
    605609                        DELIM='APOSTROPHE', RECL=1500, POSITION='APPEND' )
    606610
    607611       CASE ( 82 )
    608612
    609              OPEN ( 82, FILE='PLOTSP_X_DATA', FORM='FORMATTED', &
     613             OPEN ( 82, FILE='PLOTSP_X_DATA'//coupling_char, FORM='FORMATTED', &
    610614                        POSITION = 'APPEND' )
    611615
    612616       CASE ( 83 )
    613617
    614              OPEN ( 83, FILE='PLOTSP_Y_PAR', FORM='FORMATTED', &
     618             OPEN ( 83, FILE='PLOTSP_Y_PAR'//coupling_char, FORM='FORMATTED', &
    615619                        DELIM='APOSTROPHE', RECL=1500, POSITION='APPEND' )
    616620
    617621       CASE ( 84 )
    618622
    619              OPEN ( 84, FILE='PLOTSP_Y_DATA', FORM='FORMATTED', &
     623             OPEN ( 84, FILE='PLOTSP_Y_DATA'//coupling_char, FORM='FORMATTED', &
    620624                        POSITION='APPEND' )
    621625
     
    623627
    624628          IF ( myid_char == '' )  THEN
    625              OPEN ( 85, FILE='PARTICLE_DATA'//myid_char, FORM='UNFORMATTED', &
    626                         POSITION='APPEND' )
     629             OPEN ( 85, FILE='PARTICLE_DATA'//coupling_char//myid_char, &
     630                        FORM='UNFORMATTED', POSITION='APPEND' )
    627631          ELSE
    628632             IF ( myid == 0  .AND.  .NOT. openfile(85)%opened_before )  THEN
    629                 CALL local_system( 'mkdir  PARTICLE_DATA' )
     633                CALL local_system( 'mkdir  PARTICLE_DATA' // coupling_char )
    630634             ENDIF
    631635#if defined( __parallel )
     
    635639             CALL MPI_BARRIER( comm2d, ierr )
    636640#endif
    637              OPEN ( 85, FILE='PARTICLE_DATA/'//myid_char, FORM='UNFORMATTED', &
    638                         POSITION='APPEND' )
     641             OPEN ( 85, FILE='PARTICLE_DATA'//coupling_char//'/'//myid_char, &
     642                        FORM='UNFORMATTED', POSITION='APPEND' )
    639643          ENDIF
    640644
     
    656660!--       Set filename depending on unit number
    657661          IF ( file_id == 101 )  THEN
    658              filename = 'DATA_2D_XY_NETCDF'
     662             filename = 'DATA_2D_XY_NETCDF' // coupling_char
    659663             av = 0
    660664          ELSE
    661              filename = 'DATA_2D_XY_AV_NETCDF'
     665             filename = 'DATA_2D_XY_AV_NETCDF' // coupling_char
    662666             av = 1
    663667          ENDIF
     
    716720!--       Set filename depending on unit number
    717721          IF ( file_id == 102 )  THEN
    718              filename = 'DATA_2D_XZ_NETCDF'
     722             filename = 'DATA_2D_XZ_NETCDF' // coupling_char
    719723             av = 0
    720724          ELSE
    721              filename = 'DATA_2D_XZ_AV_NETCDF'
     725             filename = 'DATA_2D_XZ_AV_NETCDF' // coupling_char
    722726             av = 1
    723727          ENDIF
     
    776780!--       Set filename depending on unit number
    777781          IF ( file_id == 103 )  THEN
    778              filename = 'DATA_2D_YZ_NETCDF'
     782             filename = 'DATA_2D_YZ_NETCDF' // coupling_char
    779783             av = 0
    780784          ELSE
    781              filename = 'DATA_2D_YZ_AV_NETCDF'
     785             filename = 'DATA_2D_YZ_AV_NETCDF' // coupling_char
    782786             av = 1
    783787          ENDIF
     
    834838       CASE ( 104 )
    835839!
     840!--       Set filename
     841          filename = 'DATA_1D_PR_NETCDF' // coupling_char
     842
     843!
    836844!--       Inquire, if there is a NetCDF file from a previuos run. This should
    837845!--       be opened for extension, if its variables match the actual run.
    838           INQUIRE( FILE='DATA_1D_PR_NETCDF', EXIST=netcdf_extend )
     846          INQUIRE( FILE=filename, EXIST=netcdf_extend )
    839847
    840848          IF ( netcdf_extend )  THEN
    841849!
    842850!--          Open an existing NetCDF file for output
    843              nc_stat = NF90_OPEN( 'DATA_1D_PR_NETCDF', NF90_WRITE, id_set_pr )
     851             nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_pr )
    844852             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 29 )
    845853!
     
    854862                nc_stat = NF90_CLOSE( id_set_pr )
    855863                IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 30 )
    856                 CALL local_system( 'rm DATA_1D_PR_NETCDF' )
     864                CALL local_system( 'rm ' // TRIM( filename ) )
    857865             ENDIF
    858866
     
    864872             IF ( netcdf_64bit )  THEN
    865873#if defined( __netcdf_64bit )
    866                 nc_stat = NF90_CREATE( 'DATA_1D_PR_NETCDF',                    &
     874                nc_stat = NF90_CREATE( filename,                               &
    867875                                       OR( NF90_NOCLOBBER, NF90_64BIT_OFFSET ),&
    868876                                       id_set_pr )
     
    870878                IF ( myid == 0 )  PRINT*, '+++ WARNING: NetCDF: no 64-bit ', &
    871879                                               'offset allowed on this machine'
    872                 nc_stat = NF90_CREATE( 'DATA_1D_PR_NETCDF', NF90_NOCLOBBER, &
    873                                        id_set_pr )
     880                nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_pr )
    874881#endif
    875882             ELSE
    876                 nc_stat = NF90_CREATE( 'DATA_1D_PR_NETCDF', NF90_NOCLOBBER, &
    877                                        id_set_pr )
     883                nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_pr )
    878884             ENDIF
    879885             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 31 )
     
    886892       CASE ( 105 )
    887893!
     894!--       Set filename
     895          filename = 'DATA_1D_TS_NETCDF' // coupling_char
     896
     897!
    888898!--       Inquire, if there is a NetCDF file from a previuos run. This should
    889899!--       be opened for extension, if its variables match the actual run.
    890           INQUIRE( FILE='DATA_1D_TS_NETCDF', EXIST=netcdf_extend )
     900          INQUIRE( FILE=filename, EXIST=netcdf_extend )
    891901
    892902          IF ( netcdf_extend )  THEN
    893903!
    894904!--          Open an existing NetCDF file for output
    895              nc_stat = NF90_OPEN( 'DATA_1D_TS_NETCDF', NF90_WRITE, id_set_ts )
     905             nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_ts )
    896906             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 32 )
    897907!
     
    906916                nc_stat = NF90_CLOSE( id_set_ts )
    907917                IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 33 )
    908                 CALL local_system( 'rm DATA_1D_TS_NETCDF' )
     918                CALL local_system( 'rm ' // TRIM( filename ) )
    909919             ENDIF
    910920
     
    916926             IF ( netcdf_64bit )  THEN
    917927#if defined( __netcdf_64bit )
    918                 nc_stat = NF90_CREATE( 'DATA_1D_TS_NETCDF',                    &
     928                nc_stat = NF90_CREATE( filename,                               &
    919929                                       OR( NF90_NOCLOBBER, NF90_64BIT_OFFSET ),&
    920930                                       id_set_ts )
     
    922932                IF ( myid == 0 )  PRINT*, '+++ WARNING: NetCDF: no 64-bit ', &
    923933                                               'offset allowed on this machine'
    924                 nc_stat = NF90_CREATE( 'DATA_1D_TS_NETCDF', NF90_NOCLOBBER, &
    925                                        id_set_ts )
     934                nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_ts )
    926935#endif
    927936             ELSE
    928                 nc_stat = NF90_CREATE( 'DATA_1D_TS_NETCDF', NF90_NOCLOBBER, &
    929                                        id_set_ts )
     937                nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_ts )
    930938             ENDIF
    931939             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 34 )
     
    941949!--       Set filename depending on unit number
    942950          IF ( file_id == 106 )  THEN
    943              filename = 'DATA_3D_NETCDF'
     951             filename = 'DATA_3D_NETCDF' // coupling_char
    944952             av = 0
    945953          ELSE
    946              filename = 'DATA_3D_AV_NETCDF'
     954             filename = 'DATA_3D_AV_NETCDF' // coupling_char
    947955             av = 1
    948956          ENDIF
     
    10001008       CASE ( 107 )
    10011009!
     1010!--       Set filename
     1011          filename = 'DATA_1D_SP_NETCDF' // coupling_char
     1012
     1013!
    10021014!--       Inquire, if there is a NetCDF file from a previuos run. This should
    10031015!--       be opened for extension, if its variables match the actual run.
    1004           INQUIRE( FILE='DATA_1D_SP_NETCDF', EXIST=netcdf_extend )
     1016          INQUIRE( FILE=filename, EXIST=netcdf_extend )
    10051017
    10061018          IF ( netcdf_extend )  THEN
    10071019!
    10081020!--          Open an existing NetCDF file for output
    1009              nc_stat = NF90_OPEN( 'DATA_1D_SP_NETCDF', NF90_WRITE, id_set_sp )
     1021             nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_sp )
    10101022             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 38 )
    10111023!
     
    10201032                nc_stat = NF90_CLOSE( id_set_sp )
    10211033                IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 39 )
    1022                 CALL local_system( 'rm DATA_1D_SP_NETCDF' )
     1034                CALL local_system( 'rm ' // TRIM( filename ) )
    10231035             ENDIF
    10241036
     
    10301042             IF ( netcdf_64bit )  THEN
    10311043#if defined( __netcdf_64bit )
    1032                 nc_stat = NF90_CREATE( 'DATA_1D_SP_NETCDF',                    &
     1044                nc_stat = NF90_CREATE( filename,                               &
    10331045                                       OR( NF90_NOCLOBBER, NF90_64BIT_OFFSET ),&
    10341046                                       id_set_sp )
     
    10361048                IF ( myid == 0 )  PRINT*, '+++ WARNING: NetCDF: no 64-bit ', &
    10371049                                               'offset allowed on this machine'
    1038                 nc_stat = NF90_CREATE( 'DATA_1D_SP_NETCDF', NF90_NOCLOBBER, &
    1039                                        id_set_sp )
     1050                nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_sp )
    10401051#endif
    10411052             ELSE
    1042                 nc_stat = NF90_CREATE( 'DATA_1D_SP_NETCDF', NF90_NOCLOBBER, &
    1043                                        id_set_sp )
     1053                nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_sp )
    10441054             ENDIF
    10451055             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 40 )
     
    10541064
    10551065          IF ( myid_char == '' )  THEN
    1056              filename = 'DATA_PRT_NETCDF'
    1057           ELSE
    1058              filename = 'DATA_PRT_NETCDF/' // myid_char
     1066             filename = 'DATA_PRT_NETCDF' // coupling_char
     1067          ELSE
     1068             filename = 'DATA_PRT_NETCDF' // coupling_char // '/' // myid_char
    10591069          ENDIF
    10601070!
     
    10911101                IF ( myid == 0  .AND. .NOT. openfile(file_id)%opened_before ) &
    10921102                THEN    ! needs modification in case of non-extendable sets
    1093                    CALL local_system( 'mkdir  DATA_PRT_NETCDF/' )
     1103                   CALL local_system( 'mkdir  DATA_PRT_NETCDF' // &
     1104                                       coupling_char // '/' )
    10941105                ENDIF
    10951106#if defined( __parallel )
     
    11261137       CASE ( 109 )
    11271138!
     1139!--       Set filename
     1140          filename = 'DATA_1D_PTS_NETCDF' // coupling_char
     1141
     1142!
    11281143!--       Inquire, if there is a NetCDF file from a previuos run. This should
    11291144!--       be opened for extension, if its variables match the actual run.
    1130           INQUIRE( FILE='DATA_1D_PTS_NETCDF', EXIST=netcdf_extend )
     1145          INQUIRE( FILE=filename, EXIST=netcdf_extend )
    11311146
    11321147          IF ( netcdf_extend )  THEN
    11331148!
    11341149!--          Open an existing NetCDF file for output
    1135              nc_stat = NF90_OPEN( 'DATA_1D_PTS_NETCDF', NF90_WRITE, id_set_pts )
     1150             nc_stat = NF90_OPEN( filename, NF90_WRITE, id_set_pts )
    11361151             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 393 )
    11371152!
     
    11461161                nc_stat = NF90_CLOSE( id_set_pts )
    11471162                IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 394 )
    1148                 CALL local_system( 'rm DATA_1D_PTS_NETCDF' )
     1163                CALL local_system( 'rm ' // TRIM( filename ) )
    11491164             ENDIF
    11501165
     
    11561171             IF ( netcdf_64bit )  THEN
    11571172#if defined( __netcdf_64bit )
    1158                 nc_stat = NF90_CREATE( 'DATA_1D_PTS_NETCDF',                   &
     1173                nc_stat = NF90_CREATE( filename,                               &
    11591174                                       OR( NF90_NOCLOBBER, NF90_64BIT_OFFSET ),&
    11601175                                       id_set_pts )
     
    11621177                IF ( myid == 0 )  PRINT*, '+++ WARNING: NetCDF: no 64-bit ', &
    11631178                                               'offset allowed on this machine'
    1164                 nc_stat = NF90_CREATE( 'DATA_1D_PTS_NETCDF', NF90_NOCLOBBER, &
    1165                                        id_set_pts )
     1179                nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_pts )
    11661180#endif
    11671181             ELSE
    1168                 nc_stat = NF90_CREATE( 'DATA_1D_PTS_NETCDF', NF90_NOCLOBBER, &
    1169                                        id_set_pts )
     1182                nc_stat = NF90_CREATE( filename, NF90_NOCLOBBER, id_set_pts )
    11701183             ENDIF
    11711184             IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 395 )
  • palm/trunk/SOURCE/check_parameters.f90

    r98 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Check coupling_mode and set default (obligatory) values (like boundary
     7! conditions for temperature and fluxes) in case of coupled runs
    78!
    89! Former revisions:
     
    6970    CHARACTER (LEN=8)   ::  date
    7071    CHARACTER (LEN=10)  ::  time
     72    CHARACTER (LEN=40)  ::  coupling_string
    7173    CHARACTER (LEN=100) ::  action
    7274
     
    8587          PRINT*, '    is set before running PALM'
    8688       ENDIF
     89    ENDIF
     90
     91!
     92!-- Check the coupling mode
     93    IF ( coupling_mode /= 'uncoupled'            .AND.  &
     94         coupling_mode /= 'atmosphere_to_ocean'  .AND.  &
     95         coupling_mode /= 'ocean_to_atmosphere' )  THEN
     96       IF ( myid == 0 )  THEN
     97          PRINT*, '+++ check_parameters:'
     98          PRINT*, '    illegal coupling mode: ', TRIM( coupling_mode )
     99       ENDIF
     100       CALL local_stop
    87101    ENDIF
    88102
     
    93107    run_date = date(7:8)//'-'//date(5:6)//'-'//date(3:4)
    94108    run_time = time(1:2)//':'//time(3:4)//':'//time(5:6)
    95 
    96     WRITE ( run_description_header, '(A,2X,A,2X,A,A,A,I2.2,2X,A,A,2X,A,1X,A)' )&
    97               TRIM( version ), TRIM( revision ), &
    98               'run: ', TRIM( run_identifier ), '.', &
    99               runnr, 'host: ', TRIM( host ), run_date, run_time
     109    IF ( coupling_mode == 'uncoupled' )  THEN
     110       coupling_string = ''
     111    ELSEIF ( coupling_mode == 'atmosphere_to_ocean' )  THEN
     112       coupling_string = ' coupled (atmosphere)'
     113    ELSEIF ( coupling_mode == 'ocean_to_atmosphere' )  THEN
     114       coupling_string = ' coupled (ocean)'
     115    ENDIF       
     116
     117    WRITE ( run_description_header,                                        &
     118                             '(A,2X,A,2X,A,A,A,I2.2,A,2X,A,A,2X,A,1X,A)' ) &
     119              TRIM( version ), TRIM( revision ), 'run: ',                  &
     120              TRIM( run_identifier ), '.', runnr, TRIM( coupling_string ), &
     121              'host: ', TRIM( host ), run_date, run_time
    100122
    101123!
     
    10291051!
    10301052!-- Boundary conditions for potential temperature
    1031     IF ( bc_pt_b == 'dirichlet' )  THEN
    1032        ibc_pt_b = 0
    1033     ELSEIF ( bc_pt_b == 'neumann' )  THEN
    1034        ibc_pt_b = 1
     1053    IF ( coupling_mode == 'atmosphere_to_ocean' )  THEN
     1054       ibc_pt_b = 2
    10351055    ELSE
    1036        IF ( myid == 0 )  THEN
    1037           PRINT*, '+++ check_parameters:'
    1038           PRINT*, '    unknown boundary condition: bc_pt_b = ', bc_pt_b
    1039        ENDIF
    1040        CALL local_stop
    1041     ENDIF
     1056       IF ( bc_pt_b == 'dirichlet' )  THEN
     1057          ibc_pt_b = 0
     1058       ELSEIF ( bc_pt_b == 'neumann' )  THEN
     1059          ibc_pt_b = 1
     1060       ELSE
     1061          IF ( myid == 0 )  THEN
     1062             PRINT*, '+++ check_parameters:'
     1063             PRINT*, '    unknown boundary condition: bc_pt_b = ', bc_pt_b
     1064          ENDIF
     1065          CALL local_stop
     1066       ENDIF
     1067    ENDIF
     1068
    10421069    IF ( bc_pt_t == 'dirichlet' )  THEN
    10431070       ibc_pt_t = 0
  • palm/trunk/SOURCE/diffusion_u.f90

    r77 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Momentumflux at top (uswst) included as boundary condition
    77!
    88! Former revisions:
     
    5454! Call for all grid points
    5555!------------------------------------------------------------------------------!
    56     SUBROUTINE diffusion_u( ddzu, ddzw, km, km_damp_y, tend, u, usws, v, w )
     56    SUBROUTINE diffusion_u( ddzu, ddzw, km, km_damp_y, tend, u, usws, uswst, &
     57                            v, w )
    5758
    5859       USE control_parameters
     
    6667       REAL    ::  ddzu(1:nzt+1), ddzw(1:nzt+1), km_damp_y(nys-1:nyn+1)
    6768       REAL    ::  tend(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1)
    68        REAL, DIMENSION(:,:),   POINTER ::  usws
     69       REAL, DIMENSION(:,:),   POINTER ::  usws, uswst
    6970       REAL, DIMENSION(:,:,:), POINTER ::  km, u, v, w
    7071       REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  usvs
     
    155156!--          Compute vertical diffusion. In case of simulating a Prandtl layer,
    156157!--          index k starts at nzb_u_inner+2.
    157              DO  k = nzb_diff_u(j,i), nzt
     158             DO  k = nzb_diff_u(j,i), nzt_diff
    158159!
    159160!--             Interpolate eddy diffusivities on staggered gridpoints
     
    195196                      & + ( kmzp * ( w(k,j,i)   - w(k,j,i-1)   ) * ddx       &
    196197                      &   ) * ddzw(k)                                        &
    197                       & + ( kmzp * ( u(k+1,j,i) - u(k,j,i)   ) * ddzu(k+1)  &
     198                      & + ( kmzp * ( u(k+1,j,i) - u(k,j,i)     ) * ddzu(k+1) &
    198199                      &   + usws(j,i)                                        &
     200                      &   ) * ddzw(k)
     201             ENDIF
     202
     203!
     204!--          Vertical diffusion at the first gridpoint below the top boundary,
     205!--          if the momentum flux at the top is prescribed by the user
     206             IF ( use_top_fluxes )  THEN
     207                k = nzt
     208!
     209!--             Interpolate eddy diffusivities on staggered gridpoints
     210                kmzp = 0.25 * &
     211                       ( km(k,j,i)+km(k+1,j,i)+km(k,j,i-1)+km(k+1,j,i-1) )
     212                kmzm = 0.25 * &
     213                       ( km(k,j,i)+km(k-1,j,i)+km(k,j,i-1)+km(k-1,j,i-1) )
     214
     215                tend(k,j,i) = tend(k,j,i)                                    &
     216                      & - ( kmzm * ( w(k-1,j,i) - w(k-1,j,i-1) ) * ddx       &
     217                      &   ) * ddzw(k)                                        &
     218                      & + ( -uswst(j,i)                                      &
     219                      &   - kmzm * ( u(k,j,i)   - u(k-1,j,i)   ) * ddzu(k)   &
    199220                      &   ) * ddzw(k)
    200221             ENDIF
     
    210231!------------------------------------------------------------------------------!
    211232    SUBROUTINE diffusion_u_ij( i, j, ddzu, ddzw, km, km_damp_y, tend, u, usws, &
    212                                v, w )
     233                               uswst, v, w )
    213234
    214235       USE control_parameters
     
    223244       REAL    ::  tend(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1)
    224245       REAL, DIMENSION(nzb:nzt+1)      ::  usvs
    225        REAL, DIMENSION(:,:),   POINTER ::  usws
     246       REAL, DIMENSION(:,:),   POINTER ::  usws, uswst
    226247       REAL, DIMENSION(:,:,:), POINTER ::  km, u, v, w
    227248
     
    303324!--    Compute vertical diffusion. In case of simulating a Prandtl layer,
    304325!--    index k starts at nzb_u_inner+2.
    305        DO  k = nzb_diff_u(j,i), nzt
     326       DO  k = nzb_diff_u(j,i), nzt_diff
    306327!
    307328!--       Interpolate eddy diffusivities on staggered gridpoints
     
    339360                      & + ( kmzp * ( w(k,j,i)   - w(k,j,i-1)   ) * ddx       &
    340361                      &   ) * ddzw(k)                                        &
    341                       & + ( kmzp * ( u(k+1,j,i) - u(k,j,i)   ) * ddzu(k+1)  &
     362                      & + ( kmzp * ( u(k+1,j,i) - u(k,j,i)     ) * ddzu(k+1) &
    342363                      &   + usws(j,i)                                        &
    343364                      &   ) * ddzw(k)
    344365       ENDIF
    345366
     367!
     368!--    Vertical diffusion at the first gridpoint below the top boundary,
     369!--    if the momentum flux at the top is prescribed by the user
     370       IF ( use_top_fluxes )  THEN
     371          k = nzt
     372!
     373!--       Interpolate eddy diffusivities on staggered gridpoints
     374          kmzp = 0.25 * &
     375                 ( km(k,j,i)+km(k+1,j,i)+km(k,j,i-1)+km(k+1,j,i-1) )
     376          kmzm = 0.25 * &
     377                 ( km(k,j,i)+km(k-1,j,i)+km(k,j,i-1)+km(k-1,j,i-1) )
     378
     379          tend(k,j,i) = tend(k,j,i)                                          &
     380                      & - ( kmzm * ( w(k-1,j,i) - w(k-1,j,i-1) ) * ddx       &
     381                      &   ) * ddzw(k)                                        &
     382                      & + ( -uswst(j,i)                                      &
     383                      &   - kmzm * ( u(k,j,i)   - u(k-1,j,i)   ) * ddzu(k)   &
     384                      &   ) * ddzw(k)
     385       ENDIF
     386
    346387    END SUBROUTINE diffusion_u_ij
    347388
  • palm/trunk/SOURCE/diffusion_v.f90

    r77 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Momentumflux at top (vswst) included as boundary condition
    77!
    88! Former revisions:
     
    5252! Call for all grid points
    5353!------------------------------------------------------------------------------!
    54     SUBROUTINE diffusion_v( ddzu, ddzw, km, km_damp_x, tend, u, v, vsws, w )
     54    SUBROUTINE diffusion_v( ddzu, ddzw, km, km_damp_x, tend, u, v, vsws, &
     55                            vswst, w )
    5556
    5657       USE control_parameters
     
    6465       REAL    ::  ddzu(1:nzt+1), ddzw(1:nzt+1), km_damp_x(nxl-1:nxr+1)
    6566       REAL    ::  tend(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1)
    66        REAL, DIMENSION(:,:),   POINTER ::  vsws
     67       REAL, DIMENSION(:,:),   POINTER ::  vsws, vswst
    6768       REAL, DIMENSION(:,:,:), POINTER ::  km, u, v, w
    6869       REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  vsus
     
    153154!--          Compute vertical diffusion. In case of simulating a Prandtl
    154155!--          layer, index k starts at nzb_v_inner+2.
    155              DO  k = nzb_diff_v(j,i), nzt
     156             DO  k = nzb_diff_v(j,i), nzt_diff
    156157!
    157158!--             Interpolate eddy diffusivities on staggered gridpoints
     
    193194                      & + ( kmzp * ( w(k,j,i) - w(k,j-1,i)     ) * ddy       &
    194195                      &   ) * ddzw(k)                                        &
    195                       & + ( kmzp * ( v(k+1,j,i) - v(k,j,i) ) * ddzu(k+1)    &
     196                      & + ( kmzp * ( v(k+1,j,i) - v(k,j,i)     ) * ddzu(k+1) &
    196197                      &   + vsws(j,i)                                        &
     198                      &   ) * ddzw(k)
     199             ENDIF
     200
     201!
     202!--          Vertical diffusion at the first gridpoint below the top boundary,
     203!--          if the momentum flux at the top is prescribed by the user
     204             IF ( use_top_fluxes )  THEN
     205                k = nzt
     206!
     207!--             Interpolate eddy diffusivities on staggered gridpoints
     208                kmzp = 0.25 * &
     209                       ( km(k,j,i)+km(k+1,j,i)+km(k,j-1,i)+km(k+1,j-1,i) )
     210                kmzm = 0.25 * &
     211                       ( km(k,j,i)+km(k-1,j,i)+km(k,j-1,i)+km(k-1,j-1,i) )
     212
     213                tend(k,j,i) = tend(k,j,i)                                    &
     214                      & - ( kmzm *  ( w(k-1,j,i) - w(k-1,j-1,i) ) * ddy      &
     215                      &   ) * ddzw(k)                                        &
     216                      & + ( -vswst(j,i)                                      &
     217                      &   - kmzm * ( v(k,j,i)   - v(k-1,j,i)    ) * ddzu(k)  &
    197218                      &   ) * ddzw(k)
    198219             ENDIF
     
    208229!------------------------------------------------------------------------------!
    209230    SUBROUTINE diffusion_v_ij( i, j, ddzu, ddzw, km, km_damp_x, tend, u, v, &
    210                                vsws, w )
     231                               vsws, vswst, w )
    211232
    212233       USE control_parameters
     
    221242       REAL    ::  tend(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1)
    222243       REAL, DIMENSION(nzb:nzt+1)      ::  vsus
    223        REAL, DIMENSION(:,:),   POINTER ::  vsws
     244       REAL, DIMENSION(:,:),   POINTER ::  vsws, vswst
    224245       REAL, DIMENSION(:,:,:), POINTER ::  km, u, v, w
    225246
     
    302323!--    Compute vertical diffusion. In case of simulating a Prandtl layer,
    303324!--    index k starts at nzb_v_inner+2.
    304        DO  k = nzb_diff_v(j,i), nzt
     325       DO  k = nzb_diff_v(j,i), nzt_diff
    305326!
    306327!--       Interpolate eddy diffusivities on staggered gridpoints
     
    338359                      & + ( kmzp * ( w(k,j,i) - w(k,j-1,i)     ) * ddy       &
    339360                      &   ) * ddzw(k)                                        &
    340                       & + ( kmzp * ( v(k+1,j,i) - v(k,j,i) ) * ddzu(k+1)    &
     361                      & + ( kmzp * ( v(k+1,j,i) - v(k,j,i)     ) * ddzu(k+1) &
    341362                      &   + vsws(j,i)                                        &
    342363                      &   ) * ddzw(k)
    343364       ENDIF
    344365
     366!
     367!--    Vertical diffusion at the first gridpoint below the top boundary,
     368!--    if the momentum flux at the top is prescribed by the user
     369       IF ( use_top_fluxes )  THEN
     370          k = nzt
     371!
     372!--       Interpolate eddy diffusivities on staggered gridpoints
     373          kmzp = 0.25 * &
     374                 ( km(k,j,i)+km(k+1,j,i)+km(k,j-1,i)+km(k+1,j-1,i) )
     375          kmzm = 0.25 * &
     376                 ( km(k,j,i)+km(k-1,j,i)+km(k,j-1,i)+km(k-1,j-1,i) )
     377
     378          tend(k,j,i) = tend(k,j,i)                                          &
     379                      & - ( kmzm *  ( w(k-1,j,i) - w(k-1,j-1,i) ) * ddy      &
     380                      &   ) * ddzw(k)                                        &
     381                      & + ( -vswst(j,i)                                      &
     382                      &   - kmzm * ( v(k,j,i)   - v(k-1,j,i)    ) * ddzu(k)  &
     383                      &   ) * ddzw(k)
     384       ENDIF
     385
    345386    END SUBROUTINE diffusion_v_ij
    346387
  • palm/trunk/SOURCE/flow_statistics.f90

    r98 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Prescribed momentum fluxes at the top surface are used
    77!
    88! Former revisions:
     
    381381!--          ----  strictly speaking the following k-loop would have to be
    382382!--                split up according to the staggered grid.
    383              DO  k = nzb_diff_s_outer(j,i)-1, nzt
     383             DO  k = nzb_diff_s_outer(j,i)-1, nzt_diff
    384384!
    385385!--             Momentum flux w"u"
     
    398398                                 + ( w(k,j,i)   - w(k,j-1,i) ) * ddy           &
    399399                                                               ) * rmask(j,i,sr)
    400              ENDDO
    401 
    402              DO  k = nzb_diff_s_outer(j,i)-1, nzt_diff
    403400!
    404401!--             Heat flux w"pt"
     
    490487!--          Subgridscale fluxes at the top surface
    491488             IF ( use_top_fluxes )  THEN
     489                sums_l(nzt,12,tn) = sums_l(nzt,12,tn) + &
     490                                    uswst(j,i) * rmask(j,i,sr)    ! w"u"
     491                sums_l(nzt,14,tn) = sums_l(nzt,14,tn) + &
     492                                    vswst(j,i) * rmask(j,i,sr)    ! w"v"
    492493                sums_l(nzt,16,tn) = sums_l(nzt,16,tn) + &
    493494                                    tswst(j,i)  * rmask(j,i,sr)   ! w"pt"
  • palm/trunk/SOURCE/header.f90

    r98 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Output of informations for coupled model runs (boundary conditions etc.)
    77!
    88! Former revisions:
     
    117117    host_chr = host(1:10)
    118118    ver_rev = TRIM( version ) // '  ' // TRIM( revision )
    119     WRITE ( io, 100 )  ver_rev, TRIM( run_classification ), run_date, &
    120                        run_identifier, run_time, runnr, ADJUSTR( host_chr )
     119    WRITE ( io, 100 )  ver_rev, TRIM( run_classification )
     120    IF ( coupling_mode /= 'uncoupled' )  WRITE ( io, 101 )  coupling_mode
     121    WRITE ( io, 102 )  run_date, run_identifier, run_time, runnr, &
     122                       ADJUSTR( host_chr )
    121123#if defined( __parallel )
    122124    IF ( npex == -1  .AND.  pdims(2) /= 1 )  THEN
     
    130132    ENDIF
    131133    IF ( threads_per_task == 1 )  THEN
    132        WRITE ( io, 101 )  numprocs, pdims(1), pdims(2), TRIM( char1 )
     134       WRITE ( io, 103 )  numprocs, pdims(1), pdims(2), TRIM( char1 )
    133135    ELSE
    134        WRITE ( io, 102 )  numprocs*threads_per_task, numprocs, &
     136       WRITE ( io, 104 )  numprocs*threads_per_task, numprocs, &
    135137                          threads_per_task, pdims(1), pdims(2), TRIM( char1 )
    136138    ENDIF
     
    139141         npex == -1  .AND.  pdims(2) == 1 )                      &
    140142    THEN
    141        WRITE ( io, 104 )
     143       WRITE ( io, 106 )
    142144    ELSEIF ( pdims(2) == 1 )  THEN
    143        WRITE ( io, 105 )  'x'
     145       WRITE ( io, 107 )  'x'
    144146    ELSEIF ( pdims(1) == 1 )  THEN
    145        WRITE ( io, 105 )  'y'
    146     ENDIF
    147     IF ( use_seperate_pe_for_dvrp_output )  WRITE ( io, 103 )
     147       WRITE ( io, 107 )  'y'
     148    ENDIF
     149    IF ( use_seperate_pe_for_dvrp_output )  WRITE ( io, 105 )
    148150#endif
    149151    WRITE ( io, 99 )
     
    378380    IF ( ibc_pt_b == 0 )  THEN
    379381       runten = TRIM( runten ) // ' pt(0)   = pt_surface'
    380     ELSE
     382    ELSEIF ( ibc_pt_b == 1 )  THEN
    381383       runten = TRIM( runten ) // ' pt(0)   = pt(1)'
     384    ELSEIF ( ibc_pt_b == 2 )  THEN
     385       runten = TRIM( runten ) // ' pt(0) = from coupled model'
    382386    ENDIF
    383387    IF ( ibc_pt_t == 0 )  THEN
     
    457461    IF ( use_top_fluxes )  THEN
    458462       WRITE ( io, 304 )
    459        IF ( constant_top_heatflux )  THEN
    460           WRITE ( io, 306 )  top_heatflux
     463       IF ( coupling_mode == 'uncoupled' )  THEN
     464          IF ( constant_top_heatflux )  THEN
     465             WRITE ( io, 306 )  top_heatflux
     466          ENDIF
     467       ELSEIF ( coupling_mode == 'ocean_to_atmosphere' )  THEN
     468          WRITE ( io, 316 )
    461469       ENDIF
    462470       IF ( ocean  .AND.  constant_top_salinityflux )  THEN
     
    11931201100 FORMAT (/1X,'*************************',11X,42('-')/        &
    11941202            1X,'* ',A,' *',11X,A/                               &
    1195             1X,'*************************',11X,42('-')//        &
    1196             ' Date:            ',A8,11X,'Run:       ',A20/      &
     1203            1X,'*************************',11X,42('-'))
     1204101 FORMAT (37X,'coupled run: ',A/ &
     1205            37X,42('-'))
     1206102 FORMAT (/' Date:            ',A8,11X,'Run:       ',A20/      &
    11971207            ' Time:            ',A8,11X,'Run-No.:   ',I2.2/     &
    11981208            ' Run on host:   ',A10)
    11991209#if defined( __parallel )
    1200 101 FORMAT (' Number of PEs:',7X,I4,11X,'Processor grid (x,y): (',I3,',',I3, &
     1210103 FORMAT (' Number of PEs:',7X,I4,11X,'Processor grid (x,y): (',I3,',',I3, &
    12011211              ')',1X,A)
    1202 102 FORMAT (' Number of PEs:',7X,I4,11X,'Tasks:',I4,'   threads per task:',I4/ &
     1212104 FORMAT (' Number of PEs:',7X,I4,11X,'Tasks:',I4,'   threads per task:',I4/ &
    12031213              37X,'Processor grid (x,y): (',I3,',',I3,')',1X,A)
    1204 103 FORMAT (37X,'One additional PE is used to handle'/37X,'the dvrp output!')
    1205 104 FORMAT (37X,'A 1d-decomposition along x is forced'/ &
     1214105 FORMAT (37X,'One additional PE is used to handle'/37X,'the dvrp output!')
     1215106 FORMAT (37X,'A 1d-decomposition along x is forced'/ &
    12061216            37X,'because the job is running on an SMP-cluster')
    1207 105 FORMAT (37X,'A 1d-decomposition along ',A,' is used')
     1217107 FORMAT (37X,'A 1d-decomposition along ',A,' is used')
    12081218#endif
    12091219110 FORMAT (/' Numerical Schemes:'/ &
     
    13321342314 FORMAT ('       Predefined scalar value at the surface')
    13331343315 FORMAT ('       Humidity / scalar flux at top surface is 0.0')
     1344316 FORMAT ('       Sensible heatflux and momentum flux from coupled ', &
     1345                    'atmosphere model')
    13341346317 FORMAT (//' Lateral boundaries:'/ &
    13351347            '       left/right:  ',A/    &
  • palm/trunk/SOURCE/init_3d_model.f90

    r98 r102  
    77! Actual revisions:
    88! -----------------
    9 !
     9! Flux initialization in case of coupled runs, +momentum fluxes at top boundary
    1010!
    1111! Former revisions:
     
    102102              ts(nys-1:nyn+1,nxl-1:nxr+1), tswst_1(nys-1:nyn+1,nxl-1:nxr+1),  &
    103103              us(nys-1:nyn+1,nxl-1:nxr+1), usws_1(nys-1:nyn+1,nxl-1:nxr+1),   &
    104               vsws_1(nys-1:nyn+1,nxl-1:nxr+1), z0(nys-1:nyn+1,nxl-1:nxr+1) )
     104              uswst_1(nys-1:nyn+1,nxl-1:nxr+1),                               &
     105              vsws_1(nys-1:nyn+1,nxl-1:nxr+1),                                &
     106              vswst_1(nys-1:nyn+1,nxl-1:nxr+1), z0(nys-1:nyn+1,nxl-1:nxr+1) )
    105107
    106108    IF ( timestep_scheme(1:5) /= 'runge' )  THEN
     
    111113                 tswst_2(nys-1:nyn+1,nxl-1:nxr+1), &
    112114                 usws_2(nys-1:nyn+1,nxl-1:nxr+1),  &
     115                 uswst_2(nys-1:nyn+1,nxl-1:nxr+1), &
     116                 vswst_2(nys-1:nyn+1,nxl-1:nxr+1), &
    113117                 vsws_2(nys-1:nyn+1,nxl-1:nxr+1) )
    114118    ENDIF
     
    260264       tswst_m => tswst_1;  tswst => tswst_2
    261265       usws_m  => usws_1;   usws  => usws_2
     266       uswst_m => uswst_1;  uswst => uswst_2
    262267       vsws_m  => vsws_1;   vsws  => vsws_2
     268       vswst_m => vswst_1;  vswst => vswst_2
    263269       e_m  => e_1;   e  => e_2;   e_p  => e_3;   te_m  => e_3
    264270       kh_m => kh_1;  kh => kh_2
     
    287293       tswst => tswst_1
    288294       usws  => usws_1
     295       uswst => uswst_1
    289296       vsws  => vsws_1
     297       vswst => vswst_1
    290298       e     => e_1;   e_p  => e_2;   te_m  => e_3;   e_m  => e_3
    291299       kh    => kh_1
     
    381389             vsws = 0.0
    382390          ENDIF
     391          uswst = top_momentumflux_u
     392          vswst = top_momentumflux_v
    383393
    384394!
     
    494504                           ! e = (u*/cm)**2 at k=nzb+1
    495505          ENDIF
    496           e    = 0.0
    497           rif  = 0.0
    498           ts   = 0.0
    499           us   = 0.0
    500           usws = 0.0
    501           vsws = 0.0
     506          e     = 0.0
     507          rif   = 0.0
     508          ts    = 0.0
     509          us    = 0.0
     510          usws  = 0.0
     511          uswst = top_momentumflux_u
     512          vsws  = 0.0
     513          vswst = top_momentumflux_v
    502514          IF ( humidity  .OR.  passive_scalar ) qs = 0.0
    503515
     
    617629                saswst = top_salinityflux
    618630             ENDIF
    619          ENDIF
     631          ENDIF
     632
     633!
     634!--       Initialization in case of a coupled model run
     635          IF ( coupling_mode == 'ocean_to_atmosphere' )  THEN
     636             tswst = 0.0
     637             IF ( ASSOCIATED( tswst_m ) )  tswst_m = tswst
     638          ENDIF
    620639
    621640       ENDIF
  • palm/trunk/SOURCE/init_pegrid.f90

    r83 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Intercommunicator (comm_inter) and derived data type (type_xy) for
     7! coupled model runs created
    78!
    89! Former revisions:
     
    480481       CALL MPI_SEND( ibuf, 12, MPI_INTEGER, 0, myid, comm2d, ierr )       
    481482    ENDIF
     483#endif
     484
     485#if defined( __mpi2 )
     486!
     487!-- In case of coupled runs, get the port name on PE0 of the atmosphere model
     488!-- and pass it to PE0 of the ocean model
     489    IF ( myid == 0 )  THEN
     490
     491       IF ( coupling_mode == 'atmosphere_to_ocean' )  THEN
     492
     493          CALL MPI_OPEN_PORT( MPI_INFO_NULL, port_name, ierr )
     494          CALL MPI_PUBLISH_NAME( 'palm_coupler', MPI_INFO_NULL, port_name, &
     495                                 ierr )
     496
     497       ELSEIF ( coupling_mode == 'ocean_to_atmosphere' )  THEN
     498
     499          CALL MPI_LOOKUP_NAME( 'palm_coupler', MPI_INFO_NULL, port_name, ierr )
     500
     501       ENDIF
     502
     503    ENDIF
     504
     505!
     506!-- In case of coupled runs, establish the connection between the atmosphere
     507!-- and the ocean model and define the intercommunicator (comm_inter)
     508    CALL MPI_BARRIER( comm2d, ierr )
     509    IF ( coupling_mode == 'atmosphere_to_ocean' )  THEN
     510
     511       print*, '... before COMM_ACCEPT'
     512       CALL MPI_COMM_ACCEPT( port_name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &
     513                             comm_inter, ierr )
     514       print*, '--- ierr = ', ierr
     515       print*, '--- comm_inter atmosphere = ', comm_inter
     516
     517    ELSEIF ( coupling_mode == 'ocean_to_atmosphere' )  THEN
     518
     519       IF ( myid == 0 )  PRINT*, '*** read: ', port_name, '  ierr = ', ierr
     520       print*, '... before COMM_CONNECT'
     521       CALL MPI_COMM_CONNECT( port_name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &
     522                              comm_inter, ierr )
     523       print*, '--- ierr = ', ierr
     524       print*, '--- comm_inter ocean      = ', comm_inter
     525
     526    ENDIF
     527
     528!
     529!-- In case of coupled runs, create a new MPI derived datatype for the
     530!-- exchange of surface (xy) data .
     531!-- Gridpoint number for the exchange of ghost points (xy-plane)
     532    ngp_xy  = ( nxr - nxl + 3 ) * ( nyn - nys + 3 )
     533
     534!
     535!-- Define a new MPI derived datatype for the exchange of ghost points in
     536!-- y-direction for 2D-arrays (line)
     537    CALL MPI_TYPE_VECTOR( ngp_xy, 1, nzt-nzb+2, MPI_REAL, type_xy, ierr )
     538    CALL MPI_TYPE_COMMIT( type_xy, ierr )
    482539#endif
    483540
  • palm/trunk/SOURCE/modules.f90

    r98 r102  
    55! Actual revisions:
    66! -----------------
    7 !
     7! +comm_inter, coupling_char, coupling_mode, dt_coupling, ngp_xy, port_name,
     8! time_coupling, type_xy, uswst*, vswst*
    89!
    910! Former revisions:
     
    107108    REAL, DIMENSION(:,:), ALLOCATABLE, TARGET ::                               &
    108109          qsws_1, qsws_2, qswst_1, qswst_2, rif_1, rif_2, saswsb_1, saswst_1,  &
    109           shf_1, shf_2, tswst_1, tswst_2, usws_1, usws_2, vsws_1, vsws_2
     110          shf_1, shf_2, tswst_1, tswst_2, usws_1, usws_2, uswst_1, uswst_2,    &
     111          vsws_1, vsws_2, vswst_1, vswst_2
    110112
    111113    REAL, DIMENSION(:,:), POINTER ::                                           &
    112114          qsws, qsws_m, qswst, qswst_m, rif, rif_m, saswsb, saswst, shf,       &
    113           shf_m, tswst, tswst_m, usws, usws_m, vsws, vsws_m
     115          shf_m, tswst, tswst_m, usws, uswst, usws_m, uswst_m, vsws, vswst,    &
     116          vsws_m, vswst_m
    114117
    115118    REAL, DIMENSION(:,:,:), ALLOCATABLE ::                                     &
     
    229232
    230233    CHARACTER (LEN=1)   ::  cycle_mg = 'w', timestep_reason = ' '
     234    CHARACTER (LEN=2)   ::  coupling_char = ''
    231235    CHARACTER (LEN=5)   ::  write_binary = 'false'
    232236    CHARACTER (LEN=6)   ::  grid_matching = 'match'
     
    246250                            bc_sa_t = 'neumann', &
    247251                            bc_uv_b = 'dirichlet', bc_uv_t = 'dirichlet', &
     252                            coupling_mode = 'uncoupled', &
    248253                            dissipation_1d = 'as_in_3d_model', &
    249254                            fft_method = 'system-specific', &
     
    348353             disturbance_level_t = -9999999.9, &
    349354             dt = -1.0, dt_averaging_input = 0.0, &
    350              dt_averaging_input_pr = 9999999.9, dt_data_output = 9999999.9, &
     355             dt_averaging_input_pr = 9999999.9, dt_coupling = 9999999.9, &
     356             dt_data_output = 9999999.9, &
    351357             dt_data_output_av = 9999999.9, dt_disturb = 9999999.9, &
    352358             dt_dopr = 9999999.9, dt_dopr_listing = 9999999.9, &
     
    382388             surface_scalarflux = 0.0, surface_waterflux = 0.0, &
    383389             s_surface = 0.0, s_surface_initial_change = 0.0, &
    384              termination_time_needed = -1.0, time_disturb = 0.0, &
     390             termination_time_needed = -1.0, time_coupling = 0.0, &
     391             time_disturb = 0.0, &
    385392             time_dopr = 0.0, time_dopr_av = 0.0, time_dopr_listing = 0.0, &
    386393             time_dopts = 0.0, time_dosp = 0.0, time_dosp_av = 0.0, &
     
    389396             time_do_sla = 0.0, time_dvrp = 0.0, time_prel = 0.0, &
    390397             time_restart = 9999999.9, time_run_control = 0.0, &
    391              top_heatflux = 9999999.9, top_salinityflux = 9999999.9, &
     398             top_heatflux = 9999999.9, top_momentumflux_u = 0.0, &
     399             top_momentumflux_v = 0.0, top_salinityflux = 9999999.9, &
    392400             ug_surface = 0.0, u_gtrans = 0.0, &
    393401             ups_limit_e = 0.0, ups_limit_pt = 0.0, ups_limit_u = 0.0, &
     
    916924
    917925#if defined( __parallel )
    918     INTEGER ::  comm1dx, comm1dy, comm2d, comm_palm, ierr, myidx, myidy,       &
    919                 ndim = 2, ngp_y, pleft, pnorth, pright, psouth,                &
     926#if defined( __mpi2 )
     927    CHARACTER (LEN=MPI_MAX_PORT_NAME) ::  port_name
     928#endif
     929
     930    INTEGER ::  comm1dx, comm1dy, comm2d, comm_inter, comm_palm, ierr, myidx,  &
     931                myidy, ndim = 2, ngp_xy, ngp_y, pleft, pnorth, pright, psouth, &
    920932                sendrecvcount_xy, sendrecvcount_yz, sendrecvcount_zx,          &
    921933                sendrecvcount_zyd, sendrecvcount_yxd,                          &
    922                 type_x, type_x_int, ibuf(12), pcoord(2), pdims(2),             &
    923                 status(MPI_STATUS_SIZE)
     934                type_x, type_x_int, type_xy
     935
     936    INTEGER ::  ibuf(12), pcoord(2), pdims(2), status(MPI_STATUS_SIZE)
    924937
    925938    INTEGER, DIMENSION(:), ALLOCATABLE ::  ngp_yz, type_xz
  • palm/trunk/SOURCE/palm.f90

    r97 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Get coupling mode from environment variable
    77!
    88! Former revisions:
     
    4343    USE arrays_3d
    4444    USE constants
     45    USE control_parameters
    4546    USE cpulog
    4647    USE dvrp_variables
     
    5354    USE spectrum
    5455    USE statistics
    55     USE control_parameters
    5656
    5757    IMPLICIT NONE
     
    6363    INTEGER           ::  i, run_description_header_i(80)
    6464
    65     version = 'PALM 3.3'
     65    version = 'PALM 3.3a'
    6666
    6767#if defined( __parallel )
     
    7575#endif
    7676
     77#if defined( __mpi2 )
     78!
     79!-- Get information about the coupling mode from the environment variable
     80!-- which has been set by the mpiexec command
     81    CALL local_getenv( 'coupling_mode', 13, coupling_mode, i )
     82    IF ( i == 0 )  coupling_mode = 'uncoupled'
     83    IF ( coupling_mode == 'ocean_to_atmosphere' )  coupling_char = '_O'
     84#endif
     85
    7786!
    7887!-- Initialize measuring of the CPU-time remaining to the run
     
    104113!
    105114!-- Open a file for debug output
    106     OPEN( 9, FILE='DEBUG'//myid_char, FORM='FORMATTED' )
     115    OPEN( 9, FILE='DEBUG'//TRIM( coupling_char )//myid_char, FORM='FORMATTED' )
     116
     117#if defined( __mpi2 )
     118!
     119!-- TEST OUTPUT (TO BE REMOVED)
     120    WRITE(9,*) '*** coupling_mode = "', TRIM( coupling_mode ), '"'
     121    CALL LOCAL_FLUSH( 9 )
     122    print*, '*** PE', myid, '  ', TRIM( coupling_mode )
     123#endif
    107124
    108125!
     
    167184    CALL cpu_log( log_point(4), 'last actions', 'stop' )
    168185
     186#if defined( __mpi2 )
     187!
     188!-- Test exchange via intercommunicator
     189    IF ( coupling_mode == 'atmosphere_to_ocean' )  THEN
     190       i = 12345 + myid
     191       CALL MPI_SEND( i, 1, MPI_INTEGER, myid, 11, comm_inter, ierr )
     192    ELSEIF ( coupling_mode == 'ocean_to_atmosphere' )  THEN
     193       CALL MPI_RECV( i, 1, MPI_INTEGER, myid, 11, comm_inter, status, ierr )
     194       PRINT*, '### myid: ', myid, '   received from atmosphere:  i = ', i
     195    ENDIF
     196#endif
     197
    169198!
    170199!-- Take final CPU-time for CPU-time analysis
  • palm/trunk/SOURCE/parin.f90

    r98 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! +top_momentumflux_u|v in inipar, +dt_coupling in d3par
    77!
    88! Former revisions:
     
    9191             surface_waterflux, s_surface, s_surface_initial_change, &
    9292             s_vertical_gradient, s_vertical_gradient_level, top_heatflux, &
    93              top_salinityflux, timestep_scheme, topography, ug_surface, &
     93             top_momentumflux_u, top_momentumflux_v, top_salinityflux, &
     94             timestep_scheme, topography, ug_surface, &
    9495             ug_vertical_gradient, ug_vertical_gradient_level, ups_limit_e, &
    9596             ups_limit_pt, ups_limit_u, ups_limit_v, ups_limit_w, &
     
    109110                       disturbance_level_t, do2d_at_begin, do3d_at_begin, &
    110111                       do3d_compress, do3d_comp_prec, dt, dt_averaging_input, &
    111                        dt_averaging_input_pr, dt_data_output, &
     112                       dt_averaging_input_pr, dt_coupling, dt_data_output, &
    112113                       dt_data_output_av, dt_disturb, dt_dopr, &
    113114                       dt_dopr_listing, dt_dots, dt_do2d_xy, dt_do2d_xz, &
  • palm/trunk/SOURCE/prognostic_equations.f90

    r98 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! +uswst, vswst as arguments in calls of diffusion_u|v
    77!
    88! Former revisions:
     
    148148          IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN
    149149             CALL diffusion_u( i, j, ddzu, ddzw, km_m, km_damp_y, tend, u_m,   &
    150                                usws_m, v_m, w_m )
     150                               usws_m, uswst_m, v_m, w_m )
    151151          ELSE
    152152             CALL diffusion_u( i, j, ddzu, ddzw, km, km_damp_y, tend, u, usws, &
    153                                v, w )
     153                               uswst, v, w )
    154154          ENDIF
    155155          CALL coriolis( i, j, 1 )
     
    216216          IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN
    217217             CALL diffusion_v( i, j, ddzu, ddzw, km_m, km_damp_x, tend, u_m, &
    218                                v_m, vsws_m, w_m )
     218                               v_m, vsws_m, vswst_m, w_m )
    219219          ELSE
    220220             CALL diffusion_v( i, j, ddzu, ddzw, km, km_damp_x, tend, u, v,  &
    221                                vsws, w )
     221                               vsws, vswst, w )
    222222          ENDIF
    223223          CALL coriolis( i, j, 2 )
     
    817817             THEN
    818818                CALL diffusion_u( i, j, ddzu, ddzw, km_m, km_damp_y, tend,  &
    819                                   u_m, usws_m, v_m, w_m )
     819                                  u_m, usws_m, uswst_m, v_m, w_m )
    820820             ELSE
    821821                CALL diffusion_u( i, j, ddzu, ddzw, km, km_damp_y, tend, u, &
    822                                   usws, v, w )
     822                                  usws, uswst, v, w )
    823823             ENDIF
    824824             CALL coriolis( i, j, 1 )
     
    868868             THEN
    869869                CALL diffusion_v( i, j, ddzu, ddzw, km_m, km_damp_x, tend,     &
    870                                   u_m, v_m, vsws_m, w_m )
     870                                  u_m, v_m, vsws_m, vswst_m, w_m )
    871871             ELSE
    872872                CALL diffusion_v( i, j, ddzu, ddzw, km, km_damp_x, tend, u, v, &
    873                                   vsws, w )
     873                                  vsws, vswst, w )
    874874             ENDIF
    875875             CALL coriolis( i, j, 2 )
     
    12571257    ENDIF
    12581258    IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN
    1259        CALL diffusion_u( ddzu, ddzw, km_m, km_damp_y, tend, u_m, usws_m, v_m, &
    1260                          w_m )
     1259       CALL diffusion_u( ddzu, ddzw, km_m, km_damp_y, tend, u_m, usws_m, &
     1260                         uswst_m, v_m, w_m )
    12611261    ELSE
    1262        CALL diffusion_u( ddzu, ddzw, km, km_damp_y, tend, u, usws, v, w )
     1262       CALL diffusion_u( ddzu, ddzw, km, km_damp_y, tend, u, usws, uswst, v, w )
    12631263    ENDIF
    12641264    CALL coriolis( 1 )
     
    13301330    IF ( tsc(2) == 2.0  .AND.  timestep_scheme(1:8) == 'leapfrog' )  THEN
    13311331       CALL diffusion_v( ddzu, ddzw, km_m, km_damp_x, tend, u_m, v_m, vsws_m, &
    1332                          w_m )
     1332                         vswst_m, w_m )
    13331333    ELSE
    1334        CALL diffusion_v( ddzu, ddzw, km, km_damp_x, tend, u, v, vsws, w )
     1334       CALL diffusion_v( ddzu, ddzw, km, km_damp_x, tend, u, v, vsws, vswst, w )
    13351335    ENDIF
    13361336    CALL coriolis( 2 )
  • palm/trunk/SOURCE/read_3d_binary.f90

    r98 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! +uswst, uswst_m, vswst, vswst_m
    77!
    88! Former revisions:
     
    333333          CASE ( 'usws' )
    334334             READ ( 13 )  usws
     335          CASE ( 'uswst' )
     336             READ ( 13 )  uswst
    335337          CASE ( 'usws_m' )
    336338             READ ( 13 )  usws_m
     339          CASE ( 'uswst_m' )
     340             READ ( 13 )  uswst_m
    337341          CASE ( 'us_av' )
    338342             ALLOCATE( us_av(nys-1:nyn+1,nxl-1:nxr+1) )
     
    366370          CASE ( 'vsws' )
    367371             READ ( 13 )  vsws
     372          CASE ( 'vswst' )
     373             READ ( 13 )  vswst
    368374          CASE ( 'vsws_m' )
    369375             READ ( 13 )  vsws_m
     376          CASE ( 'vswst_m' )
     377             READ ( 13 )  vswst_m
    370378          CASE ( 'w' )
    371379             READ ( 13 )  w
  • palm/trunk/SOURCE/read_var_list.f90

    r98 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! +time_coupling, top_momentumflux_u|v
    77!
    88! Former revisions:
     
    358358          CASE ( 's_vertical_gradient_level' )
    359359             READ ( 13 )  s_vertical_gradient_level
     360          CASE ( 'time_coupling' )
     361             READ ( 13 )  time_coupling
    360362          CASE ( 'time_disturb' )
    361363             READ ( 13 )  time_disturb
     
    396398          CASE ( 'top_heatflux' )
    397399             READ ( 13 )  top_heatflux
     400          CASE ( 'top_momentumflux_u' )
     401             READ ( 13 )  top_momentumflux_u
     402          CASE ( 'top_momentumflux_v' )
     403             READ ( 13 )  top_momentumflux_v
    398404          CASE ( 'top_salinityflux' )
    399405             READ ( 13 )  top_salinityflux
  • palm/trunk/SOURCE/swap_timelevel.f90

    r98 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! swaping of uswst, vswst included
    77!
    88! Former revisions:
     
    136136                ENDIF
    137137                IF ( use_top_fluxes )  THEN
     138                   uswst_m => uswst_1;  uswst => uswst_2
     139                   vswst_m => vswst_1;  vswst => vswst_2
    138140                   tswst_m => tswst_1;  tswst => tswst_2
    139141                   IF ( humidity  .OR.  passive_scalar )  THEN
     
    184186                ENDIF
    185187                IF ( use_top_fluxes )  THEN
    186                    tswst_m  => tswst_2;  tswst => tswst_1
     188                   uswst_m => uswst_2;  uswst => uswst_1
     189                   vswst_m => vswst_2;  vswst => vswst_1
     190                   tswst_m => tswst_2;  tswst => tswst_1
    187191                   IF ( humidity  .OR.  passive_scalar )  THEN
    188192                      qswst_m => qswst_2;  qswst => qswst_1
  • palm/trunk/SOURCE/time_integration.f90

    r98 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Call of new routine surface_coupler
    77!
    88! Former revisions:
     
    303303
    304304!
     305!--    Data exchange between coupled models
     306       IF ( coupling_mode /= 'uncoupled' )  THEN
     307          time_coupling = time_coupling + dt_3d
     308          DO WHILE ( time_coupling >= dt_coupling )
     309             CALL surface_coupler
     310             time_coupling = time_coupling - dt_coupling
     311          ENDDO
     312       ENDIF
     313
     314!
    305315!--    Execute user-defined actions
    306316       CALL user_actions( 'after_integration' )
  • palm/trunk/SOURCE/write_3d_binary.f90

    r98 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! +uswst, uswst_m, vswst, vswst_m
    77!
    88! Former revisions:
     
    201201    WRITE ( 14 )  'us                  ';  WRITE ( 14 )  us
    202202    WRITE ( 14 )  'usws                ';  WRITE ( 14 )  usws
     203    WRITE ( 14 )  'uswst               ';  WRITE ( 14 )  uswst
    203204    IF ( timestep_scheme(1:5) /= 'runge' )  THEN
    204205       WRITE ( 14 )  'usws_m              ';  WRITE ( 14 )  usws_m
     206       WRITE ( 14 )  'uswst_m             ';  WRITE ( 14 )  uswst_m
    205207    ENDIF
    206208    IF ( ALLOCATED( us_av ) )  THEN
     
    236238    ENDIF
    237239    WRITE ( 14 )  'vsws                ';  WRITE ( 14 )  vsws
     240    WRITE ( 14 )  'vswst               ';  WRITE ( 14 )  vswst
    238241    IF ( timestep_scheme(1:5) /= 'runge' )  THEN
    239242       WRITE ( 14 )  'vsws_m              ';  WRITE ( 14 )  vsws_m
     243       WRITE ( 14 )  'vswst_m             ';  WRITE ( 14 )  vswst_m
    240244    ENDIF
    241245    WRITE ( 14 )  'w                   ';  WRITE ( 14 )  w
  • palm/trunk/SOURCE/write_var_list.f90

    r98 r102  
    44! Actual revisions:
    55! -----------------
    6 !
     6! +top_momentumflux_u|v, time_coupling
    77!
    88! Former revisions:
     
    304304    WRITE ( 14 )  's_vertical_gradient_level     '
    305305    WRITE ( 14 )  s_vertical_gradient_level
     306    WRITE ( 14 )  'time_coupling                 '
     307    WRITE ( 14 )  time_coupling
    306308    WRITE ( 14 )  'time_disturb                  '
    307309    WRITE ( 14 )  time_disturb
     
    342344    WRITE ( 14 )  'top_heatflux                  '
    343345    WRITE ( 14 )  top_heatflux
     346    WRITE ( 14 )  'top_momentumflux_u            '
     347    WRITE ( 14 )  top_momentumflux_u
     348    WRITE ( 14 )  'top_momentumflux_v            '
     349    WRITE ( 14 )  top_momentumflux_v
    344350    WRITE ( 14 )  'top_salinityflux              '
    345351    WRITE ( 14 )  top_salinityflux
Note: See TracChangeset for help on using the changeset viewer.