Changeset 4586 for palm/trunk/SOURCE/turbulence_closure_mod.f90
- Timestamp:
- Jul 1, 2020 4:16:43 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/turbulence_closure_mod.f90
r4510 r4586 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 23 ! 22 ! 23 ! 24 24 ! Former revisions: 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Renamed rif to richardson_number (Richardson Flux Number to Gradient Richardson Number) 28 ! 29 ! 4510 2020-04-29 14:19:18Z raasch 27 30 ! file re-formatted to follow the PALM coding standard 28 31 ! … … 4010 4013 4011 4014 REAL(wp), DIMENSION(nzb+1:nzt) :: ml_stratification !< mixing length according to stratification 4012 REAL(wp), DIMENSION(nzb+1:nzt) :: ri f !< Richardson fluxnumber4015 REAL(wp), DIMENSION(nzb+1:nzt) :: richardson_number !< gradient Richardson number 4013 4016 4014 4017 REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg), INTENT(IN) :: var !< temperature … … 4111 4114 4112 4115 !$ACC PARALLEL LOOP COLLAPSE(2) PRIVATE(i, j) & 4113 !$ACC PRIVATE(ml_stratification, duv2_dz2, ri f, dvar_dz) &4116 !$ACC PRIVATE(ml_stratification, duv2_dz2, richardson_number, dvar_dz) & 4114 4117 !$ACC PRESENT(diss, e, u, v, var, wall_flags_total_0) & 4115 4118 !$ACC PRESENT(dd2zu, ml_blackadar, delta) … … 4117 4120 DO j = nys, nyn 4118 4121 ! 4119 !-- Calculate Richardson -fluxnumber4122 !-- Calculate Richardson number 4120 4123 IF ( use_single_reference_value ) THEN 4121 4124 … … 4128 4131 + ( ( v(k+1,j,i) - v(k-1,j,i) ) * dd2zu(k) )**2 + 1E-30_wp 4129 4132 4130 rif(k) = MIN( MAX( g / var_reference * dvar_dz / duv2_dz2, -5.0_wp ), 1.0_wp ) 4133 richardson_number(k) = MIN( MAX( g / var_reference * dvar_dz / duv2_dz2, & 4134 -5.0_wp ), & 4135 1.0_wp ) 4131 4136 ENDDO 4132 4137 ELSE … … 4143 4148 + ( ( v(k+1,j,i) - v(k-1,j,i) ) * dd2zu(k) )**2 + 1E-30_wp 4144 4149 4145 rif(k) = MIN( MAX( g / var(k,j,i) * dvar_dz / duv2_dz2, -5.0_wp ), 1.0_wp ) 4150 richardson_number(k) = MIN( MAX( g / var(k,j,i) * dvar_dz / duv2_dz2, & 4151 -5.0_wp ), & 4152 1.0_wp ) 4146 4153 ENDDO 4147 4154 ENDIF … … 4150 4157 !$ACC LOOP PRIVATE(k) 4151 4158 DO k = nzb+1, nzt 4152 IF ( rif(k) >= 0.0_wp ) THEN 4153 ml_stratification(k) = ml_blackadar(k) / ( 1.0_wp + 5.0_wp * rif(k) ) 4159 IF ( richardson_number(k) >= 0.0_wp ) THEN 4160 ml_stratification(k) = ml_blackadar(k) & 4161 / ( 1.0_wp + 5.0_wp * richardson_number(k) ) 4154 4162 ELSE 4155 ml_stratification(k) = ml_blackadar(k) * SQRT( 1.0_wp - 16.0_wp * rif(k) ) 4163 ml_stratification(k) = ml_blackadar(k) & 4164 * SQRT( 1.0_wp - 16.0_wp * richardson_number(k) ) 4156 4165 ENDIF 4157 4166 ENDDO … … 4274 4283 4275 4284 REAL(wp), DIMENSION(nzb+1:nzt) :: ml_stratification !< mixing length according to stratification 4276 REAL(wp), DIMENSION(nzb+1:nzt) :: ri f !< Richardson fluxnumber4285 REAL(wp), DIMENSION(nzb+1:nzt) :: richardson_number !< gradient Richardson number 4277 4286 4278 4287 REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg), INTENT(IN) :: var !< temperature … … 4348 4357 4349 4358 ! 4350 !-- Calculate Richardson -fluxnumber4359 !-- Calculate Richardson number 4351 4360 IF ( use_single_reference_value ) THEN 4352 4361 DO k = nzb+1, nzt … … 4356 4365 + ( ( v(k+1,j,i) - v(k-1,j,i) ) * dd2zu(k) )**2 + 1E-30_wp 4357 4366 4358 rif(k) = MIN( MAX( g / var_reference * dvar_dz / duv2_dz2, -5.0_wp ), 1.0_wp ) 4367 richardson_number(k) = MIN( MAX( g / var_reference * dvar_dz / duv2_dz2, -5.0_wp ), & 4368 1.0_wp ) 4359 4369 ENDDO 4360 4370 ELSE … … 4365 4375 + ( ( v(k+1,j,i) - v(k-1,j,i) ) * dd2zu(k) )**2 + 1E-30_wp 4366 4376 4367 rif(k) = MIN( MAX( g / var(k,j,i) * dvar_dz / duv2_dz2, -5.0_wp ), 1.0_wp ) 4377 richardson_number(k) = MIN( MAX( g / var(k,j,i) * dvar_dz / duv2_dz2, -5.0_wp ), & 4378 1.0_wp ) 4368 4379 ENDDO 4369 4380 ENDIF … … 4371 4382 !-- Calculate diabatic mixing length using Dyer-profile functions 4372 4383 DO k = nzb+1, nzt 4373 IF ( ri f(k) >= 0.0_wp ) THEN4374 ml_stratification(k) = ml_blackadar(k) / ( 1.0_wp + 5.0_wp * ri f(k) )4384 IF ( richardson_number(k) >= 0.0_wp ) THEN 4385 ml_stratification(k) = ml_blackadar(k) / ( 1.0_wp + 5.0_wp * richardson_number(k) ) 4375 4386 ELSE 4376 ml_stratification(k) = ml_blackadar(k) * SQRT( 1.0_wp - 16.0_wp * rif(k) ) 4387 ml_stratification(k) = ml_blackadar(k) & 4388 * SQRT( 1.0_wp - 16.0_wp * richardson_number(k) ) 4377 4389 ENDIF 4378 4390 … … 4772 4784 REAL(wp) :: var_reference !< reference temperature 4773 4785 4774 !DIR$ ATTRIBUTES ALIGN:64:: ml_local_profile, ml_stratification, ri f4786 !DIR$ ATTRIBUTES ALIGN:64:: ml_local_profile, ml_stratification, richardson_number 4775 4787 REAL(wp), DIMENSION(nzb+1:nzt) :: ml_local_profile !< mixing length (all heights) 4776 4788 REAL(wp), DIMENSION(nzb+1:nzt) :: ml_stratification !< mixing length according to stratification 4777 REAL(wp), DIMENSION(nzb+1:nzt) :: ri f !< Richardson fluxnumber4789 REAL(wp), DIMENSION(nzb+1:nzt) :: richardson_number !< gradient Richardson number 4778 4790 4779 4791 REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg), INTENT(IN) :: var !< temperature … … 4937 4949 !$OMP DO 4938 4950 !$ACC PARALLEL LOOP COLLAPSE(2) PRIVATE(i, j) & 4939 !$ACC PRIVATE(dvar_dz, duv2_dz2, ml_stratification, ml_local_profile, ri f) &4951 !$ACC PRIVATE(dvar_dz, duv2_dz2, ml_stratification, ml_local_profile, richardson_number) & 4940 4952 !$ACC PRESENT(wall_flags_total_0, var, dd2zu, e, u, v, delta, ml_blackadar) & 4941 4953 !$ACC PRESENT(kh, km, sums_l_l, rmask) … … 4943 4955 DO j = nysg, nyng 4944 4956 ! 4945 !-- Calculate Richardson -fluxnumber4957 !-- Calculate Richardson number 4946 4958 IF ( use_single_reference_value ) THEN 4947 4959 !$ACC LOOP PRIVATE(k) … … 4953 4965 + ( ( v(k+1,j,i) - v(k-1,j,i) ) * dd2zu(k) )**2 + 1E-30_wp 4954 4966 4955 rif(k) = MIN( MAX( g / var_reference * dvar_dz / duv2_dz2, -5.0_wp ), 1.0_wp ) 4967 richardson_number(k) = MIN( MAX( g / var_reference * dvar_dz / duv2_dz2, & 4968 -5.0_wp ), & 4969 1.0_wp ) 4956 4970 ENDDO 4957 4971 ELSE … … 4964 4978 + ( ( v(k+1,j,i) - v(k-1,j,i) ) * dd2zu(k) )**2 + 1E-30_wp 4965 4979 4966 rif(k) = MIN( MAX( g / var(k,j,i) * dvar_dz / duv2_dz2, -5.0_wp ), 1.0_wp ) 4980 richardson_number(k) = MIN( MAX( g / var(k,j,i) * dvar_dz / duv2_dz2, & 4981 -5.0_wp ), & 4982 1.0_wp ) 4967 4983 ENDDO 4968 4984 ENDIF … … 4972 4988 !$ACC LOOP PRIVATE(k) 4973 4989 DO k = nzb+1, nzt 4974 IF ( rif(k) >= 0.0_wp ) THEN 4975 ml_stratification(k) = ml_blackadar(k) / ( 1.0_wp + 5.0_wp * rif(k) ) 4990 IF ( richardson_number(k) >= 0.0_wp ) THEN 4991 ml_stratification(k) = ml_blackadar(k) & 4992 / ( 1.0_wp + 5.0_wp * richardson_number(k) ) 4976 4993 ELSE 4977 4994 ml_stratification(k) = ml_blackadar(k)
Note: See TracChangeset
for help on using the changeset viewer.