Changeset 96


Ignore:
Timestamp:
Jun 4, 2007 8:07:41 AM (17 years ago)
Author:
raasch
Message:

more preliminary uncomplete changes for ocean version

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

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/CURRENT_MODIFICATIONS

    r95 r96  
    44+ inipar-parameters bc_sa_t, bottom_salinityflux, ocean, sa_surface, sa_vertical_gradient, sa_vertical_gradient_level, top_salinityflux
    55
    6 boundary_conds, check_parameters, diffusion_e, flow_statistics, header, init_grid, init_3d_model, modules, parin, prognostic_equations, read_var_list, swap_timelevel, time_integration, user_interface, write_var_list, write_3d_binary
     6average_3d_data, boundary_conds, buoyancy, check_parameters, data_output_2d, data_output_3d, diffusion_e, flow_statistics, header, init_grid, init_3d_model, modules, parin, prognostic_equations, read_var_list, sum_up_3d_data, swap_timelevel, time_integration, user_interface, write_var_list, write_3d_binary
    77
    88New:
     
    1111Changed:
    1212-------
    13 hydro_press renamed hyp
     13hydro_press renamed hyp, routine calc_mean_pt_profile renamed calc_mean_profile
    1414
    15 advec_particles
     15advec_particles, buoyancy, calc_liquid_water_content, init_cloud_physics, modules, prognostic_equations
    1616
    1717
  • palm/trunk/SOURCE/Makefile

    r95 r96  
    209209        buoyancy.o calc_precipitation.o calc_radiation.o coriolis.o \
    210210        diffusion_e.o diffusion_s.o diffusion_u.o diffusion_v.o diffusion_w.o \
    211         impact_of_latent_heat.o production_e.o user_interface.o
     211        eqn_state_seawater.o impact_of_latent_heat.o production_e.o \
     212        user_interface.o
    212213random_gauss.o: random_function.o
    213214read_3d_binary.o: modules.o random_function.o
  • palm/trunk/SOURCE/average_3d_data.f90

    r77 r96  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Averaging of density and salinity
    77!
    88! Former revisions:
     
    166166             ENDDO
    167167             
     168          CASE ( 'rho' )
     169             DO  i = nxl-1, nxr+1
     170                DO  j = nys-1, nyn+1
     171                   DO  k = nzb, nzt+1
     172                      rho_av(k,j,i) = rho_av(k,j,i) / REAL( average_count_3d )
     173                   ENDDO
     174                ENDDO
     175             ENDDO
     176             
    168177          CASE ( 's' )
    169178             DO  i = nxl-1, nxr+1
     
    171180                   DO  k = nzb, nzt+1
    172181                      s_av(k,j,i) = s_av(k,j,i) / REAL( average_count_3d )
     182                   ENDDO
     183                ENDDO
     184             ENDDO
     185             
     186          CASE ( 'sa' )
     187             DO  i = nxl-1, nxr+1
     188                DO  j = nys-1, nyn+1
     189                   DO  k = nzb, nzt+1
     190                      sa_av(k,j,i) = sa_av(k,j,i) / REAL( average_count_3d )
    173191                   ENDDO
    174192                ENDDO
  • palm/trunk/SOURCE/buoyancy.f90

    r77 r96  
    44! Actual revisions:
    55! -----------------
    6 !
     6! calc_mean_pt_profile renamed calc_mean_profile
    77!
    88! Former revisions:
     
    2929
    3030    PRIVATE
    31     PUBLIC buoyancy, calc_mean_pt_profile
     31    PUBLIC buoyancy, calc_mean_profile
    3232
    3333    INTERFACE buoyancy
     
    3636    END INTERFACE buoyancy
    3737
    38     INTERFACE calc_mean_pt_profile
    39        MODULE PROCEDURE calc_mean_pt_profile
    40     END INTERFACE calc_mean_pt_profile
     38    INTERFACE calc_mean_profile
     39       MODULE PROCEDURE calc_mean_profile
     40    END INTERFACE calc_mean_profile
    4141
    4242 CONTAINS
     
    207207
    208208
    209     SUBROUTINE calc_mean_pt_profile( theta, pr )
     209    SUBROUTINE calc_mean_profile( var, pr )
    210210
    211211!------------------------------------------------------------------------------!
     
    224224
    225225       INTEGER ::  i, j, k, omp_get_thread_num, pr, tn
    226        REAL, DIMENSION(:,:,:), POINTER  ::  theta
    227 
    228 !
    229 !--    Computation of the horizontally averaged temperature profile, unless
     226       REAL, DIMENSION(:,:,:), POINTER  ::  var
     227
     228!
     229!--    Computation of the horizontally averaged profile of variable var, unless
    230230!--    already done by the relevant call from flow_statistics. The calculation
    231231!--    is done only for the first respective intermediate timestep in order to
    232232!--    spare communication time and to produce identical model results with jobs
    233233!--    which are calling flow_statistics at different time intervals.
    234 !--    Although this calculation is not required for model runs with a slope,
    235 !--    it is nevertheless also computed.
    236234       IF ( .NOT. flow_statistics_called  .AND. &
    237235            intermediate_timestep_count == 1 )  THEN
    238236
    239237!
    240 !--       Horizontal average of the potential temperature
     238!--       Horizontal average of variable var
    241239          tn           =   0  ! Default thread number in case of one thread
    242240          !$OMP PARALLEL PRIVATE( i, j, k, tn )
     
    247245             DO  j =  nys, nyn
    248246                DO  k = nzb_s_outer(j,i), nzt+1
    249                    sums_l(k,pr,tn) = sums_l(k,pr,tn) + theta(k,j,i)
     247                   sums_l(k,pr,tn) = sums_l(k,pr,tn) + var(k,j,i)
    250248                ENDDO
    251249             ENDDO
     
    272270       ENDIF
    273271
    274     END SUBROUTINE calc_mean_pt_profile
     272    END SUBROUTINE calc_mean_profile
    275273
    276274 END MODULE buoyancy_mod
  • palm/trunk/SOURCE/check_parameters.f90

    r95 r96  
    14851485             hom(:,2,22,:) = SPREAD( zw, 2, statistic_regions+1 )
    14861486
     1487          CASE ( 'sa', '#sa' )
     1488             IF ( .NOT. ocean )  THEN
     1489                IF ( myid == 0 )  THEN
     1490                   PRINT*, '+++ check_parameters:  data_output_pr = ', &
     1491                           data_output_pr(i),                          &
     1492                           '    is not implemented for ocean = FALSE'
     1493                ENDIF
     1494                CALL local_stop
     1495             ELSE
     1496                dopr_index(i) = 23
     1497                dopr_unit(i)  = 'psu'
     1498                hom(:,2,23,:) = SPREAD( zu, 2, statistic_regions+1 )
     1499                IF ( data_output_pr(i)(1:1) == '#' )  THEN
     1500                   dopr_initial_index(i) = 26
     1501                   hom(:,2,26,:)         = SPREAD( zu, 2, statistic_regions+1 )
     1502                   hom(nzb,2,26,:)       = 0.0    ! weil zu(nzb) negativ ist
     1503                   data_output_pr(i)     = data_output_pr(i)(2:)
     1504                ENDIF
     1505             ENDIF
     1506
    14871507          CASE ( 'u*2' )
    14881508             dopr_index(i) = 30
     
    18461866             dopr_unit(i)  = 'K m/s'
    18471867             hom(:,2,63,:) = SPREAD( zu, 2, statistic_regions+1 )
     1868
     1869          CASE ( 'rho' )
     1870             dopr_index(i) = 64
     1871             dopr_unit(i)  = 'kg/m3'
     1872             hom(:,2,64,:) = SPREAD( zu, 2, statistic_regions+1 )
     1873
     1874          CASE ( 'w"sa"' )
     1875             IF ( .NOT. ocean ) THEN
     1876                IF ( myid == 0 )  THEN
     1877                   PRINT*, '+++ check_parameters:  data_output_pr = ', &
     1878                           data_output_pr(i),                          &
     1879                           '    is not implemented for ocean = FALSE'
     1880                ENDIF
     1881                CALL local_stop
     1882             ELSE
     1883                dopr_index(i) = 65
     1884                dopr_unit(i)  = 'psu m/s'
     1885                hom(:,2,65,:) = SPREAD( zw, 2, statistic_regions+1 )
     1886             ENDIF
     1887
     1888          CASE ( 'w*sa*' )
     1889             IF ( .NOT. ocean ) THEN
     1890                IF ( myid == 0 )  THEN
     1891                   PRINT*, '+++ check_parameters:  data_output_pr = ', &
     1892                           data_output_pr(i),                          &
     1893                           '    is not implemented for ocean = FALSE'
     1894                ENDIF
     1895                CALL local_stop
     1896             ELSE
     1897                dopr_index(i) = 66
     1898                dopr_unit(i)  = 'psu m/s'
     1899                hom(:,2,66,:) = SPREAD( zw, 2, statistic_regions+1 )
     1900             ENDIF
     1901
     1902          CASE ( 'wsa' )
     1903             IF ( .NOT. ocean ) THEN
     1904                IF ( myid == 0 )  THEN
     1905                   PRINT*, '+++ check_parameters:  data_output_pr = ', &
     1906                           data_output_pr(i),                          &
     1907                           '    is not implemented for ocean = FALSE'
     1908                ENDIF
     1909                CALL local_stop
     1910             ELSE
     1911                dopr_index(i) = 67
     1912                dopr_unit(i)  = 'psu m/s'
     1913                hom(:,2,67,:) = SPREAD( zw, 2, statistic_regions+1 )
     1914             ENDIF
    18481915
    18491916
     
    20682135             unit = 'kg/kg'
    20692136
     2137          CASE ( 'rho' )
     2138             IF ( .NOT. ocean )  THEN
     2139                IF ( myid == 0 )  THEN
     2140                   PRINT*, '+++ check_parameters: output of "', TRIM( var ), &
     2141                                '" requires ocean = .TRUE.'
     2142                ENDIF
     2143                CALL local_stop
     2144             ENDIF
     2145             unit = 'kg/m3'
     2146
    20702147          CASE ( 's' )
    20712148             IF ( .NOT. passive_scalar )  THEN
     
    20772154             ENDIF
    20782155             unit = 'conc'
     2156
     2157          CASE ( 'sa' )
     2158             IF ( .NOT. ocean )  THEN
     2159                IF ( myid == 0 )  THEN
     2160                   PRINT*, '+++ check_parameters: output of "', TRIM( var ), &
     2161                                '" requires ocean = .TRUE.'
     2162                ENDIF
     2163                CALL local_stop
     2164             ENDIF
     2165             unit = 'psu'
    20792166
    20802167          CASE ( 'u*', 't*', 'lwp*', 'pra*', 'prr*', 'z0*' )
  • palm/trunk/SOURCE/data_output_2d.f90

    r77 r96  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Output of density and salinity
    77!
    88! Former revisions:
     
    370370                IF ( mode == 'xy' )  level_z = zu
    371371
     372             CASE ( 'rho_xy', 'rho_xz', 'rho_yz' )
     373                IF ( av == 0 )  THEN
     374                   to_be_resorted => rho
     375                ELSE
     376                   to_be_resorted => rho_av
     377                ENDIF
     378
    372379             CASE ( 's_xy', 's_xz', 's_yz' )
    373380                IF ( av == 0 )  THEN
     
    375382                ELSE
    376383                   to_be_resorted => q_av
     384                ENDIF
     385
     386             CASE ( 'sa_xy', 'sa_xz', 'sa_yz' )
     387                IF ( av == 0 )  THEN
     388                   to_be_resorted => sa
     389                ELSE
     390                   to_be_resorted => sa_av
    377391                ENDIF
    378392
  • palm/trunk/SOURCE/data_output_3d.f90

    r77 r96  
    44! Actual revisions:
    55! -----------------
    6 !
     6! Output of density and salinity
    77!
    88! Former revisions:
     
    251251             ENDIF
    252252
     253          CASE ( 'rho' )
     254             IF ( av == 0 )  THEN
     255                to_be_resorted => rho
     256             ELSE
     257                to_be_resorted => rho_av
     258             ENDIF
     259             
    253260          CASE ( 's' )
    254261             IF ( av == 0 )  THEN
     
    256263             ELSE
    257264                to_be_resorted => q_av
     265             ENDIF
     266             
     267          CASE ( 'sa' )
     268             IF ( av == 0 )  THEN
     269                to_be_resorted => sa
     270             ELSE
     271                to_be_resorted => sa_av
    258272             ENDIF
    259273             
  • palm/trunk/SOURCE/flow_statistics.f90

    r94 r96  
    44! Actual revisions:
    55! -----------------
    6 ! Calculation of Deardorff velocity scale adjusted to be used with the ocean
     6! Statistics for ocean version (salinity, density) added,
     7! calculation of Deardorff velocity scale adjusted to be used with the ocean
    78! version (HAS STILL TO BE COMPLETED!!!)
    89!
     
    123124          ENDDO
    124125       ENDDO
     126
     127!
     128!--    Horizontally averaged profile of salinity
     129       IF ( ocean )  THEN
     130          !$OMP DO
     131          DO  i = nxl, nxr
     132             DO  j =  nys, nyn
     133                DO  k = nzb_s_outer(j,i), nzt+1
     134                   sums_l(k,23,tn)  = sums_l(k,23,tn) + &
     135                                      sa(k,j,i) * rmask(j,i,sr)
     136                ENDDO
     137             ENDDO
     138          ENDDO
     139       ENDIF
    125140
    126141!
     
    177192             sums_l(:,2,0) = sums_l(:,2,0) + sums_l(:,2,i)
    178193             sums_l(:,4,0) = sums_l(:,4,0) + sums_l(:,4,i)
     194             IF ( ocean )  THEN
     195                sums_l(:,23,0) = sums_l(:,23,0) + sums_l(:,23,i)
     196             ENDIF
    179197             IF ( humidity )  THEN
    180198                sums_l(:,41,0) = sums_l(:,41,0) + sums_l(:,41,i)
     
    200218       CALL MPI_ALLREDUCE( sums_l(nzb,4,0), sums(nzb,4), nzt+2-nzb, MPI_REAL, &
    201219                           MPI_SUM, comm2d, ierr )
     220       IF ( ocean )  THEN
     221          CALL MPI_ALLREDUCE( sums_l(nzb,23,0), sums(nzb,23), nzt+2-nzb, &
     222                              MPI_REAL, MPI_SUM, comm2d, ierr )
     223       ENDIF
    202224       IF ( humidity ) THEN
    203225          CALL MPI_ALLREDUCE( sums_l(nzb,44,0), sums(nzb,44), nzt+2-nzb, &
     
    221243       sums(:,2) = sums_l(:,2,0)
    222244       sums(:,4) = sums_l(:,4,0)
     245       IF ( ocean )  sums(:,23) = sums_l(:,23,0)
    223246       IF ( humidity ) THEN
    224247          sums(:,44) = sums_l(:,44,0)
     
    241264       hom(:,1,2,sr) = sums(:,2)             ! v
    242265       hom(:,1,4,sr) = sums(:,4)             ! pt
     266
     267!
     268!--    Salinity
     269       IF ( ocean )  THEN
     270          sums(:,23) = sums(:,23) / ngp_2dh_outer(:,sr)
     271          hom(:,1,23,sr) = sums(:,23)             ! sa
     272       ENDIF
    243273
    244274!
     
    377407
    378408!
     409!--             Salinity flux w"sa"
     410                IF ( ocean )  THEN
     411                   sums_l(k,65,tn) = sums_l(k,65,tn)                           &
     412                                         - 0.5 * ( kh(k,j,i) + kh(k+1,j,i) )   &
     413                                               * ( sa(k+1,j,i) - sa(k,j,i) )   &
     414                                               * ddzu(k+1) * rmask(j,i,sr)
     415                ENDIF
     416
     417!
    379418!--             Buoyancy flux, water flux (humidity flux) w"q"
    380419                IF ( humidity ) THEN
     
    420459                sums_l(nzb,61,tn) = sums_l(nzb,61,tn) + &
    421460                                    0.0 * rmask(j,i,sr)           ! v"pt"
     461                IF ( ocean )  THEN
     462                   sums_l(nzb,65,tn) = sums_l(nzb,65,tn) + &
     463                                       saswsb(j,i) * rmask(j,i,sr)  ! w"sa"
     464                ENDIF
    422465                IF ( humidity )  THEN
    423466                   sums_l(nzb,48,tn) = sums_l(nzb,48,tn) + &
     
    450493                sums_l(nzt,61,tn) = sums_l(nzt,61,tn) + &
    451494                                    0.0 * rmask(j,i,sr)           ! v"pt"
     495                IF ( ocean )  THEN
     496                   sums_l(nzt,65,tn) = sums_l(nzt,65,tn) + &
     497                                       saswst(j,i) * rmask(j,i,sr)  ! w"sa"
     498                ENDIF
    452499                IF ( humidity )  THEN
    453500                   sums_l(nzt,48,tn) = sums_l(nzt,48,tn) + &
     
    508555                sums_l(k,36,tn) = sums_l(k,36,tn) + pts**2 * w(k,j,i) * &
    509556                                                    rmask(j,i,sr)
     557
     558!
     559!--             Salinity flux and density (density does not belong to here,
     560!--             but so far there is no suitable place to calculate)
     561                IF ( ocean )  THEN
     562                   pts = 0.5 * ( sa(k,j,i)   - hom(k,1,23,sr) + &
     563                                 sa(k+1,j,i) - hom(k+1,1,23,sr) )
     564                   sums_l(k,66,tn) = sums_l(k,66,tn) + pts * w(k,j,i) * &
     565                                                       rmask(j,i,sr)
     566                   sums_l(k,64,tn) = sums_l(k,64,tn) + rho(k,j,i) * &
     567                                                       rmask(j,i,sr)
     568                ENDIF
    510569
    511570!
     
    739798       hom(:,1,21,sr) = sums(:,21)     ! w*pt*BC
    740799       hom(:,1,22,sr) = sums(:,16) + sums(:,21)    ! wptBC
    741                                        ! profiles 23-29 left empty for initial
     800                                       ! profile 24 is initial profile (sa)
     801                                       ! profiles 25-29 left empty for initial
    742802                                       ! profiles
    743803       hom(:,1,30,sr) = sums(:,30)     ! u*2
     
    771831       hom(:,1,62,sr) = sums(:,62)     ! v*pt*
    772832       hom(:,1,63,sr) = sums(:,61) + sums(:,62)    ! vpt_t
     833       hom(:,1,64,sr) = sums(:,64)     ! rho
     834       hom(:,1,65,sr) = sums(:,65)     ! w"sa"
     835       hom(:,1,66,sr) = sums(:,66)     ! w*sa*
     836       hom(:,1,67,sr) = sums(:,65) + sums(:,66)    ! wsa
    773837
    774838       hom(:,1,pr_palm-1,sr) = sums(:,pr_palm-1)
  • palm/trunk/SOURCE/init_3d_model.f90

    r95 r96  
    190190       ALLOCATE( saswsb_1(nys-1:nyn+1,nxl-1:nxr+1), &
    191191                 saswst_1(nys-1:nyn+1,nxl-1:nxr+1) )
    192        ALLOCATE( rho(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1), &
    193                  sa_1(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1), &
    194                  sa_2(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1), &
     192       ALLOCATE( rho_1(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1), &
     193                 sa_1(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1),  &
     194                 sa_2(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1),  &
    195195                 sa_3(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
     196       rho => rho_1  ! routine calc_mean_profile requires density to be a
     197                     ! pointer
    196198    ENDIF
    197199
     
    826828
    827829!
    828 !-- If required, initialize quantities needed for the ocean model
    829     IF ( ocean )  CALL init_ocean
    830 
    831 !
    832830!-- If required, initialize dvrp-software
    833831    IF ( dt_dvrp /= 9999999.9 )  CALL init_dvrp
    834832
    835 !
    836 !-- If required, initialize quantities for handling cloud physics
    837 !-- This routine must be called before init_particles, because
    838 !-- otherwise, array pt_d_t, needed in data_output_dvrp (called by
    839 !-- init_particles) is not defined.
    840     CALL init_cloud_physics
     833    IF ( ocean )  THEN
     834!
     835!--    Initialize quantities needed for the ocean model
     836       CALL init_ocean
     837    ELSE
     838!
     839!--    Initialize quantities for handling cloud physics
     840!--    This routine must be called before init_particles, because
     841!--    otherwise, array pt_d_t, needed in data_output_dvrp (called by
     842!--    init_particles) is not defined.
     843       CALL init_cloud_physics
     844    ENDIF
    841845
    842846!
  • palm/trunk/SOURCE/init_ocean.f90

    r95 r96  
    88! Former revisions:
    99! ------------------
    10 ! $Id:$
     10! $Id$
    1111!
    1212! Initial revision (raasch 01/06/07)
     
    3737!
    3838!-- Calculate initial vertical profile of hydrostatic pressure (in Pa)
     39!-- and the reference density (used later in buoyancy term)
    3940    hyp(nzt+1) = surface_pressure * 100.0
    4041
    4142    hyp(nzt)   = hyp(nzt+1) + rho_surface * g * 0.5 * dzu(nzt+1)
     43    rho_ref    = rho_surface * 0.5 * dzu(nzt+1)
    4244
    4345    DO  k = nzt-1, 0, -1
     
    4648       pt_l = 0.5 * ( pt_init(k) + pt_init(k+1) )
    4749
    48        rho_l = eqn_state_seawater_func( hyp(k+1), pt_l, sa_l )
     50       rho_l   = eqn_state_seawater_func( hyp(k+1), pt_l, sa_l )
    4951
    50        hyp(k) = hyp(k+1) + rho_l * g * dzu(k+1)
     52       hyp(k)  = hyp(k+1) + rho_l * g * dzu(k+1)
     53       rho_ref = rho_ref + rho_l * dzu(k+1)
    5154
    5255    ENDDO
    5356
     57    rho_ref = rho_ref / ( zw(nzt) - zu(nzb) )
     58    print*, '*** rho_ref = ', rho_ref
     59
    5460
    5561 END SUBROUTINE init_ocean
  • palm/trunk/SOURCE/modules.f90

    r95 r96  
    119119    REAL, DIMENSION(:,:,:), ALLOCATABLE, TARGET ::                             &
    120120          e_1, e_2, e_3, kh_1, kh_2, km_1, km_2, p, pt_1, pt_2, pt_3, q_1,     &
    121           q_2, q_3, ql_1, ql_2, rho, sa_1, sa_2, sa_3, u_1, u_2, u_3, v_1,     &
     121          q_2, q_3, ql_1, ql_2, rho_1, sa_1, sa_2, sa_3, u_1, u_2, u_3, v_1,   &
    122122          v_2, v_3, vpt_1, vpt_2, w_1, w_2, w_3
    123123
    124124    REAL, DIMENSION(:,:,:), POINTER ::                                         &
    125125          e, e_m, e_p, kh, kh_m, km, km_m, pt, pt_m, pt_p, q, q_m, q_p, ql,    &
    126           ql_c, sa, sa_p, te_m, tpt_m, tq_m, tsa_m, tu_m, tv_m, tw_m, u, u_m,  &
    127           u_p, v, v_m, v_p, vpt, vpt_m, w, w_m, w_p
     126          ql_c, rho, sa, sa_p, te_m, tpt_m, tq_m, tsa_m, tu_m, tv_m, tw_m, u,  &
     127          u_m, u_p, v, v_m, v_p, vpt, vpt_m, w, w_m, w_p
    128128
    129129    REAL, DIMENSION(:,:,:,:), ALLOCATABLE ::  rif_wall
     
    149149    REAL, DIMENSION(:,:,:), ALLOCATABLE, TARGET :: &
    150150          e_av, p_av, pc_av, pr_av, pt_av, q_av, ql_av, ql_c_av, ql_v_av, &
    151           ql_vp_av, qv_av, s_av, u_av, v_av, vpt_av, w_av
     151          ql_vp_av, qv_av, rho_av, s_av, sa_av, u_av, v_av, vpt_av, w_av
    152152
    153153 END MODULE averaging
  • palm/trunk/SOURCE/prognostic_equations.f90

    r95 r96  
    44! Actual revisions:
    55! -----------------
    6 ! prognostic equation for salinity
    7 ! new argument zw in calls of diffusion_e
     6! prognostic equation for salinity, density is calculated from equation of
     7! state for seawater, +eqn_state_seawater_mod
     8! new argument zw in calls of diffusion_e, calc_mean_pt_profile renamed
     9! calc_mean_profile
    810!
    911! Former revisions:
     
    4143    USE control_parameters
    4244    USE cpulog
     45    USE eqn_state_seawater_mod
    4346    USE grid_variables
    4447    USE indices
     
    107110!-- Calculate those variables needed in the tendency terms which need
    108111!-- global communication
    109     CALL calc_mean_pt_profile( pt, 4 )
    110     IF ( humidity )  CALL calc_mean_pt_profile( vpt, 44 )
     112    CALL calc_mean_profile( pt, 4 )
     113    IF ( ocean    )  CALL calc_mean_profile( rho, 64 )
     114    IF ( humidity )  CALL calc_mean_profile( vpt, 44 )
    111115
    112116!
     
    495499                ENDIF
    496500             ENDIF
     501
     502!
     503!--          Calculate density by the equation of state for seawater
     504             CALL eqn_state_seawater( i, j )
    497505
    498506          ENDDO
     
    758766!-- Calculate those variables needed in the tendency terms which need
    759767!-- global communication
    760     CALL calc_mean_pt_profile( pt, 4 )
    761     IF ( humidity )  CALL calc_mean_pt_profile( vpt, 44 )
     768    CALL calc_mean_profile( pt, 4 )
     769    IF ( ocean    )  CALL calc_mean_profile( rho, 64 )
     770    IF ( humidity )  CALL calc_mean_profile( vpt, 44 )
    762771    IF ( .NOT. constant_diffusion )  CALL production_e_init
    763772
     
    10201029                   ENDIF
    10211030                ENDIF
     1031
     1032!
     1033!--             Calculate density by the equation of state for seawater
     1034                CALL eqn_state_seawater( i, j )
    10221035
    10231036             ENDIF
     
    11781191!-- Calculate those variables needed in the tendency terms which need
    11791192!-- global communication
    1180     CALL calc_mean_pt_profile( pt, 4 )
    1181     IF ( humidity )  CALL calc_mean_pt_profile( vpt, 44 )
     1193    CALL calc_mean_profile( pt, 4 )
     1194    IF ( ocean    )  CALL calc_mean_profile( rho, 64 )
     1195    IF ( humidity )  CALL calc_mean_profile( vpt, 44 )
    11821196
    11831197!
     
    15891603
    15901604       CALL cpu_log( log_point(37), 'sa-equation', 'stop' )
     1605
     1606!
     1607!--    Calculate density by the equation of state for seawater
     1608       CALL cpu_log( log_point(38), 'eqns-seawater', 'start' )
     1609       CALL eqn_state_seawater
     1610       CALL cpu_log( log_point(38), 'eqns-seawater', 'stop' )
    15911611
    15921612    ENDIF
  • palm/trunk/SOURCE/read_3d_binary.f90

    r95 r96  
    44! Actual revisions:
    55! -----------------
    6 ! +sa, saswsb, saswst
     6! +rho_av, sa, sa_av, saswsb, saswst
    77!
    88! Former revisions:
     
    273273             READ ( 13 )  random_iv
    274274             READ ( 13 )  random_iy
     275          CASE ( 'rho_av' )
     276             ALLOCATE( rho_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
     277             READ ( 13 )  rho_av
    275278          CASE ( 'rif' )
    276279             READ ( 13 )  rif
     
    284287          CASE ( 'sa' )
    285288             READ ( 13 )  sa
     289          CASE ( 'sa_av' )
     290             ALLOCATE( sa_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
     291             READ ( 13 )  sa_av
    286292          CASE ( 'saswsb' )
    287293             READ ( 13 )  saswsb
  • palm/trunk/SOURCE/sum_up_3d_data.f90

    r77 r96  
    44! Actual revisions:
    55! -----------------
    6 !
     6! +sum-up of density and salinity
    77!
    88! Former revisions:
     
    132132                qv_av = 0.0
    133133
     134             CASE ( 'rho' )
     135                IF ( .NOT. ALLOCATED( rho_av ) )  THEN
     136                   ALLOCATE( rho_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
     137                ENDIF
     138                rho_av = 0.0
     139
    134140             CASE ( 's' )
    135141                IF ( .NOT. ALLOCATED( s_av ) )  THEN
     
    137143                ENDIF
    138144                s_av = 0.0
     145
     146             CASE ( 'sa' )
     147                IF ( .NOT. ALLOCATED( sa_av ) )  THEN
     148                   ALLOCATE( sa_av(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) )
     149                ENDIF
     150                sa_av = 0.0
    139151
    140152             CASE ( 't*' )
     
    337349             ENDDO
    338350
     351          CASE ( 'rho' )
     352             DO  i = nxl-1, nxr+1
     353                DO  j = nys-1, nyn+1
     354                   DO  k = nzb, nzt+1
     355                      rho_av(k,j,i) = rho_av(k,j,i) + rho(k,j,i)
     356                   ENDDO
     357                ENDDO
     358             ENDDO
     359             
    339360          CASE ( 's' )
    340361             DO  i = nxl-1, nxr+1
     
    342363                   DO  k = nzb, nzt+1
    343364                      s_av(k,j,i) = s_av(k,j,i) + q(k,j,i)
     365                   ENDDO
     366                ENDDO
     367             ENDDO
     368             
     369          CASE ( 'sa' )
     370             DO  i = nxl-1, nxr+1
     371                DO  j = nys-1, nyn+1
     372                   DO  k = nzb, nzt+1
     373                      sa_av(k,j,i) = sa_av(k,j,i) + sa(k,j,i)
    344374                   ENDDO
    345375                ENDDO
  • palm/trunk/SOURCE/write_3d_binary.f90

    r95 r96  
    44! Actual revisions:
    55! -----------------
    6 ! +sa, saswsb, saswst
     6! +rho_av, sa, sa_av, saswsb, saswst
    77!
    88! Former revisions:
     
    133133    ENDIF
    134134    IF ( ocean )  THEN
     135       IF ( ALLOCATED( rho_av ) )  THEN
     136          WRITE ( 14 )  'rho_av              ';  WRITE ( 14 )  rho_av
     137       ENDIF
    135138       WRITE ( 14 )  'sa                  ';  WRITE ( 14 )  sa
     139       IF ( ALLOCATED( sa_av ) )  THEN
     140          WRITE ( 14 )  'sa_av               ';  WRITE ( 14 )  sa_av
     141       ENDIF
    136142       WRITE ( 14 )  'saswsb              ';  WRITE ( 14 )  saswsb
    137143       WRITE ( 14 )  'saswst              ';  WRITE ( 14 )  saswst
Note: See TracChangeset for help on using the changeset viewer.