Changeset 97 for palm/trunk/SOURCE/diffusivities.f90
 Timestamp:
 Jun 21, 2007 8:23:15 AM (16 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

palm/trunk/SOURCE/diffusivities.f90
r94 r97 1 SUBROUTINE diffusivities( theta)1 SUBROUTINE diffusivities( var, var_reference ) 2 2 3 3 !! … … 7 7 ! This is also a bugfix, because the height above the topography is now 8 8 ! used instead of the height above level k=0. 9 ! theta renamed var, dpt_dz renamed dvar_dz, +new argument var_reference 10 ! use_pt_reference renamed use_reference 9 11 ! 10 12 ! Former revisions: … … 41 43 INTEGER :: i, j, k, omp_get_thread_num, sr, tn 42 44 43 REAL :: d pt_dz, l_stable, phi_m = 1.045 REAL :: dvar_dz, l_stable, var_reference 44 46 45 REAL :: theta(nzb:nzt+1,nys1:nyn+1,nxl1:nxr+1) 47 REAL, SAVE :: phi_m = 1.0 48 49 REAL :: var(nzb:nzt+1,nys1:nyn+1,nxl1:nxr+1) 46 50 47 51 REAL, DIMENSION(1:nzt) :: l, ll, sqrt_e … … 58 62 ! 59 63 ! Compute the turbulent diffusion coefficient for momentum 60 !$OMP PARALLEL PRIVATE (d pt_dz,i,j,k,l,ll,l_stable,phi_m,sqrt_e,sr,tn)64 !$OMP PARALLEL PRIVATE (dvar_dz,i,j,k,l,ll,l_stable,phi_m,sqrt_e,sr,tn) 61 65 !$ tn = omp_get_thread_num() 62 66 … … 94 98 ! Determine the mixing length 95 99 DO k = nzb_s_inner(j,i)+1, nzt 96 dpt_dz = ( theta(k+1,j,i)  theta(k1,j,i) ) * dd2zu(k) 97 IF ( dpt_dz > 0.0 ) THEN 98 IF ( use_pt_reference ) THEN 100 dvar_dz = atmos_ocean_sign * & ! inverse effect of pt/rho gradient 101 ( var(k+1,j,i)  var(k1,j,i) ) * dd2zu(k) 102 IF ( dvar_dz > 0.0 ) THEN 103 IF ( use_reference ) THEN 99 104 l_stable = 0.76 * sqrt_e(k) / & 100 SQRT( g / pt_reference * dpt_dz ) + 1E5105 SQRT( g / var_reference * dvar_dz ) + 1E5 101 106 ELSE 102 107 l_stable = 0.76 * sqrt_e(k) / & 103 SQRT( g / theta(k,j,i) * dpt_dz ) + 1E5108 SQRT( g / var(k,j,i) * dvar_dz ) + 1E5 104 109 ENDIF 105 110 ELSE
Note: See TracChangeset
for help on using the changeset viewer.