Ignore:
Timestamp:
Aug 24, 2007 3:10:38 PM (17 years ago)
Author:
letzel
Message:
  • Improved coupler: evaporation - salinity-flux coupling for humidity = .T.,

avoid MPI hangs when coupled runs terminate, add DOC/app/chapter_3.8;

  • Optional calculation of km and kh from initial TKE e_init;
  • Default initialization of km,kh = 0.00001 for ocean = .T.;
  • Allow data_output_pr= q, wq, w"q", w*q* for humidity = .T.;
  • Bugfix: Rayleigh damping for ocean fixed.
File:
1 edited

Legend:

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

    r106 r108  
    99! Bugfix: Error message concerning output of particle concentration (pc)
    1010! modified
     11! More checks and more default values for coupled runs
     12! allow data_output_pr= q, wq, w"q", w*q* for humidity = .T. (instead of
     13! cloud_physics = .T.)
     14! Rayleigh damping for ocean fixed.
    1115!
    1216! Former revisions:
     
    7680    CHARACTER (LEN=100) ::  action
    7781
    78     INTEGER ::  i, ilen, intervals, iter, j, k, nnxh, nnyh, position, prec
     82    INTEGER ::  i, ilen, intervals, iremote = 0, iter, j, k, nnxh, nnyh, &
     83         position, prec
    7984    LOGICAL ::  found, ldum
    80     REAL    ::  gradient, maxn, maxp
    81 
     85    REAL    ::  gradient, maxn, maxp, remote = 0.0
    8286
    8387!
     
    103107       CALL local_stop
    104108    ENDIF
     109
     110!
     111!-- Check dt_coupling, restart_time, dt_restart, end_time, dx, dy, nx and ny
     112    IF ( coupling_mode /= 'uncoupled' )  THEN
     113       IF ( dt_coupling == 9999999.9 )  THEN
     114          IF ( myid == 0 )  THEN
     115             PRINT*, '+++ check_parameters:'
     116             PRINT*, '    dt_coupling is not set but required for coupling ', &
     117                  'mode: ', TRIM( coupling_mode )
     118          ENDIF
     119          CALL local_stop
     120       ENDIF
     121#if defined( __parallel )  &&  defined( __mpi2 )
     122       CALL MPI_SEND( dt_coupling, 1, MPI_REAL, myid, 11, comm_inter, ierr )
     123       CALL MPI_RECV( remote, 1, MPI_REAL, myid, 11, comm_inter, status, ierr )
     124       IF ( dt_coupling /= remote )  THEN
     125          IF ( myid == 0 )  THEN
     126             PRINT*, '+++ check_parameters:'
     127             PRINT*, '    TRIM( coupling_mode ): dt_coupling = ', dt_coupling
     128             PRINT*, '    is not equal to dt_coupling_remote = ', remote
     129          ENDIF
     130          CALL local_stop
     131       ENDIF
     132       CALL MPI_SEND( restart_time, 1, MPI_REAL, myid, 12, comm_inter, ierr )
     133       CALL MPI_RECV( remote, 1, MPI_REAL, myid, 12, comm_inter, status, ierr )
     134       IF ( restart_time /= remote )  THEN
     135          IF ( myid == 0 )  THEN
     136             PRINT*, '+++ check_parameters:'
     137             PRINT*, '    TRIM( coupling_mode ): restart_time = ', restart_time
     138             PRINT*, '    is not equal to restart_time_remote = ', remote
     139          ENDIF
     140          CALL local_stop
     141       ENDIF
     142       CALL MPI_SEND( dt_restart, 1, MPI_REAL, myid, 13, comm_inter, ierr )
     143       CALL MPI_RECV( remote, 1, MPI_REAL, myid, 13, comm_inter, status, ierr )
     144       IF ( dt_restart /= remote )  THEN
     145          IF ( myid == 0 )  THEN
     146             PRINT*, '+++ check_parameters:'
     147             PRINT*, '    TRIM( coupling_mode ): dt_restart = ', dt_restart
     148             PRINT*, '    is not equal to dt_restart_remote = ', remote
     149          ENDIF
     150          CALL local_stop
     151       ENDIF
     152       CALL MPI_SEND( end_time, 1, MPI_REAL, myid, 14, comm_inter, ierr )
     153       CALL MPI_RECV( remote, 1, MPI_REAL, myid, 14, comm_inter, status, ierr )
     154       IF ( end_time /= remote )  THEN
     155          IF ( myid == 0 )  THEN
     156             PRINT*, '+++ check_parameters:'
     157             PRINT*, '    TRIM( coupling_mode ): end_time = ', end_time
     158             PRINT*, '    is not equal to end_time_remote = ', remote
     159          ENDIF
     160          CALL local_stop
     161       ENDIF
     162       CALL MPI_SEND( dx, 1, MPI_REAL, myid, 15, comm_inter, ierr )
     163       CALL MPI_RECV( remote, 1, MPI_REAL, myid, 15, comm_inter, status, ierr )
     164       IF ( dx /= remote )  THEN
     165          IF ( myid == 0 )  THEN
     166             PRINT*, '+++ check_parameters:'
     167             PRINT*, '    TRIM( coupling_mode ): dx = ', dx
     168             PRINT*, '    is not equal to dx_remote = ', remote
     169          ENDIF
     170          CALL local_stop
     171       ENDIF
     172       CALL MPI_SEND( dy, 1, MPI_REAL, myid, 16, comm_inter, ierr )
     173       CALL MPI_RECV( remote, 1, MPI_REAL, myid, 16, comm_inter, status, ierr )
     174       IF ( dy /= remote )  THEN
     175          IF ( myid == 0 )  THEN
     176             PRINT*, '+++ check_parameters:'
     177             PRINT*, '    TRIM( coupling_mode ): dy = ', dy
     178             PRINT*, '    is not equal to dy_remote = ', remote
     179          ENDIF
     180          CALL local_stop
     181       ENDIF
     182       CALL MPI_SEND( nx, 1, MPI_INTEGER, myid, 17, comm_inter, ierr )
     183       CALL MPI_RECV( iremote, 1, MPI_INTEGER, myid, 17, comm_inter, status, &
     184            ierr )
     185       IF ( nx /= iremote )  THEN
     186          IF ( myid == 0 )  THEN
     187             PRINT*, '+++ check_parameters:'
     188             PRINT*, '    TRIM( coupling_mode ): nx = ', nx
     189             PRINT*, '    is not equal to nx_remote = ', iremote
     190          ENDIF
     191          CALL local_stop
     192       ENDIF
     193       CALL MPI_SEND( ny, 1, MPI_INTEGER, myid, 18, comm_inter, ierr )
     194       CALL MPI_RECV( iremote, 1, MPI_INTEGER, myid, 18, comm_inter, status, &
     195            ierr )
     196       IF ( ny /= iremote )  THEN
     197          IF ( myid == 0 )  THEN
     198             PRINT*, '+++ check_parameters:'
     199             PRINT*, '    TRIM( coupling_mode ): ny = ', ny
     200             PRINT*, '    is not equal to ny_remote = ', iremote
     201          ENDIF
     202          CALL local_stop
     203       ENDIF
     204#endif
     205    ENDIF
     206
     207#if defined( __parallel )  &&  defined( __mpi2 )
     208!
     209!-- Exchange via intercommunicator
     210    IF ( coupling_mode == 'atmosphere_to_ocean' )  THEN
     211       CALL MPI_SEND( humidity, &
     212            1, MPI_LOGICAL, myid, 19, comm_inter, ierr )
     213    ELSEIF ( coupling_mode == 'ocean_to_atmosphere' )  THEN
     214       CALL MPI_RECV( humidity_remote, &
     215            1, MPI_LOGICAL, myid, 19, comm_inter, status, ierr )
     216    ENDIF
     217#endif
     218
    105219
    106220!
     
    821935
    822936!
    823 !-- Ocean version is using flux boundary conditions at the top
    824     IF ( ocean )  use_top_fluxes = .TRUE.
     937!-- Ocean version must use flux boundary conditions at the top
     938    IF ( ocean .AND. .NOT. use_top_fluxes )  THEN
     939       IF ( myid == 0 )  PRINT*, '+++ check_parameters: use_top_fluxes ',&
     940                                    'must be .TRUE. in ocean version'
     941       CALL local_stop
     942    ENDIF
    825943
    826944!
     
    12561374       CALL local_stop
    12571375    ENDIF
    1258     IF ( bc_uv_t == 'dirichlet' )  THEN
    1259        ibc_uv_t = 0
    1260     ELSEIF ( bc_uv_t == 'neumann' )  THEN
     1376    IF ( coupling_mode == 'ocean_to_atmosphere' )  THEN
     1377       bc_uv_t = 'neumann'
    12611378       ibc_uv_t = 1
    12621379    ELSE
    1263        IF ( myid == 0 )  THEN
    1264           PRINT*, '+++ check_parameters:'
    1265           PRINT*, '    unknown boundary condition: bc_uv_t = ', bc_uv_t
    1266        ENDIF
    1267        CALL local_stop
     1380       IF ( bc_uv_t == 'dirichlet' )  THEN
     1381          ibc_uv_t = 0
     1382       ELSEIF ( bc_uv_t == 'neumann' )  THEN
     1383          ibc_uv_t = 1
     1384       ELSE
     1385          IF ( myid == 0 )  THEN
     1386             PRINT*, '+++ check_parameters:'
     1387             PRINT*, '    unknown boundary condition: bc_uv_t = ', bc_uv_t
     1388          ENDIF
     1389          CALL local_stop
     1390       ENDIF
    12681391    ENDIF
    12691392
     
    12891412
    12901413    IF ( rayleigh_damping_height == -1.0 )  THEN
    1291        rayleigh_damping_height = 0.66666666666 * zu(nzt)
     1414       IF ( .NOT. ocean )  THEN
     1415          rayleigh_damping_height = 0.66666666666 * zu(nzt)
     1416       ELSE
     1417          rayleigh_damping_height = 0.66666666666 * zu(nzb)
     1418       ENDIF
    12921419    ELSE
    1293        IF ( rayleigh_damping_height < 0.0  .OR. &
    1294             rayleigh_damping_height > zu(nzt) )  THEN
    1295           IF ( myid == 0 )  THEN
    1296              PRINT*, '+++ check_parameters:'
    1297              PRINT*, '    rayleigh_damping_height = ', rayleigh_damping_height,&
    1298                           ' out of range [0.0,', zu(nzt), ']'
    1299           ENDIF
    1300           CALL local_stop
     1420       IF ( .NOT. ocean )  THEN
     1421          IF ( rayleigh_damping_height < 0.0  .OR. &
     1422               rayleigh_damping_height > zu(nzt) )  THEN
     1423             IF ( myid == 0 )  THEN
     1424                PRINT*, '+++ check_parameters:'
     1425                PRINT*, '    rayleigh_damping_height = ', rayleigh_damping_height,&
     1426                     ' out of range [0.0,', zu(nzt), ']'
     1427             ENDIF
     1428             CALL local_stop
     1429          ENDIF
     1430       ELSE
     1431          IF ( rayleigh_damping_height > 0.0  .OR. &
     1432               rayleigh_damping_height < zu(nzb) )  THEN
     1433             IF ( myid == 0 )  THEN
     1434                PRINT*, '+++ check_parameters:'
     1435                PRINT*, '    rayleigh_damping_height = ', rayleigh_damping_height,&
     1436                     ' out of range [0.0,', zu(nzb), ']'
     1437             ENDIF
     1438             CALL local_stop
     1439          ENDIF
    13011440       ENDIF
    13021441    ENDIF
     
    16951834
    16961835          CASE ( 'q', '#q' )
    1697              IF ( .NOT. cloud_physics )  THEN
     1836             IF ( .NOT. humidity )  THEN
    16981837                IF ( myid == 0 )  THEN
    16991838                   PRINT*, '+++ check_parameters:  data_output_pr = ', &
    17001839                           data_output_pr(i),                          &
    1701                            '    is not implemented for cloud_physics = FALSE'
     1840                           '    is not implemented for humidity = FALSE'
    17021841                ENDIF
    17031842                CALL local_stop
     
    18041943
    18051944          CASE ( 'w"q"' )
    1806              IF ( .NOT. cloud_physics ) THEN
     1945             IF ( .NOT. humidity ) THEN
    18071946                IF ( myid == 0 )  THEN
    18081947                   PRINT*, '+++ check_parameters:  data_output_pr = ', &
    18091948                           data_output_pr(i),                          &
    1810                            '    is not implemented for cloud_physics = FALSE'
     1949                           '    is not implemented for humidity = FALSE'
    18111950                ENDIF
    18121951                CALL local_stop
     
    18181957
    18191958          CASE ( 'w*q*' )
    1820              IF ( .NOT. cloud_physics ) THEN
     1959             IF ( .NOT. humidity ) THEN
    18211960                IF ( myid == 0 )  THEN
    18221961                   PRINT*, '+++ check_parameters:  data_output_pr = ', &
    18231962                           data_output_pr(i),                          &
    1824                            '    is not implemented for cloud_physics = FALSE'
     1963                           '    is not implemented for humidity = FALSE'
    18251964                ENDIF
    18261965                CALL local_stop
     
    18321971
    18331972          CASE ( 'wq' )
    1834              IF ( .NOT. cloud_physics ) THEN
     1973             IF ( .NOT. humidity ) THEN
    18351974                IF ( myid == 0 )  THEN
    18361975                   PRINT*, '+++ check_parameters:  data_output_pr = ', &
    18371976                           data_output_pr(i),                          &
    1838                            '    is not implemented for cloud_physics = FALSE'
     1977                           '    is not implemented for humidity = FALSE'
    18391978                ENDIF
    18401979                CALL local_stop
Note: See TracChangeset for help on using the changeset viewer.