[Dart-dev] DART/branches Revision: 12297
dart at ucar.edu
dart at ucar.edu
Tue Jan 9 11:04:05 MST 2018
nancy at ucar.edu
2018-01-09 11:04:03 -0700 (Tue, 09 Jan 2018)
94
this one computes height columns which are consistent
with the previous version of the code.
Modified: DART/branches/recam/models/cam-fv/model_mod.f90
===================================================================
--- DART/branches/recam/models/cam-fv/model_mod.f90 2018-01-09 17:05:40 UTC (rev 12296)
+++ DART/branches/recam/models/cam-fv/model_mod.f90 2018-01-09 18:04:03 UTC (rev 12297)
@@ -1503,13 +1503,15 @@
real(r8), intent(out) :: pressure_array(n_levels)
integer :: k
+real(r8) :: ref_pressure
! Set midpoint pressures. This array mirrors the order of the
! cam model levels: 1 is the model top, N is the bottom.
+ref_pressure = grid_data%P0%vals(1)
do k=1, n_levels
- pressure_array(k) = grid_data%hyam%vals(k) * grid_data%P0%vals(1) + &
- grid_data%hybm%vals(k) * surface_pressure
+ pressure_array(k) = ref_pressure * grid_data%hyam%vals(k) + &
+ surface_pressure * grid_data%hybm%vals(k)
enddo
end subroutine cam_p_col_midpts
@@ -2589,36 +2591,70 @@
!-----------------------------------------------------------------------
-subroutine build_heights(nlevels,p_surfX,h_surfX,virtual_tempX,height_midpts,height_interf,variable_r)
+subroutine build_heights(nlevels,p_surf,h_surf,virtual_temp,height_midpts,height_interf,variable_r)
integer, intent(in) :: nlevels ! Number of vertical levels
-real(r8), intent(in) :: p_surfX ! Surface pressure (pascals)
-real(r8), intent(in) :: h_surfX ! Surface height (m)
-real(r8), intent(in) :: virtual_tempX( nlevels) ! Virtual Temperature
+real(r8), intent(in) :: p_surf ! Surface pressure (pascals)
+real(r8), intent(in) :: h_surf ! Surface height (m)
+real(r8), intent(in) :: virtual_temp( nlevels) ! Virtual Temperature
real(r8), intent(out) :: height_midpts(nlevels) ! Geopotential height at midpoints, top to bottom
real(r8), intent(out), optional :: height_interf(nlevels+1) ! Geopotential height at interfaces, top to bottom
-real(r8), intent(in), optional :: variable_r( nlevels) ! Dry air gas constant, if varies, top to bottom
+real(r8), intent(in), optional :: variable_r(nlevels) ! Dry air gas constant, if varies, top to bottom
! Local variables
!>@todo have a model constants module?
real(r8), parameter :: const_r = 287.04_r8 ! Different than model_heights ! dry air gas constant.
real(r8), parameter :: g0 = 9.80616_r8 ! Different than model_heights:gph2gmh:G !
-real(r8) :: pterm(nlevels)
integer :: i,k,l
real(r8) :: temp, hprb, log_p_int, r
-real(r8) :: p_surf, h_surf, virtual_temp(nlevels)
! an array now: real(r8), parameter :: rbyg=r/g0
+real(r8) :: pterm(nlevels)
real(r8) :: r_g0_tv(nlevels) ! rbyg=r/g0 * tv
real(r8) :: midpts(nlevels) ! midpoints in column
-real(r8) :: pmln(nlevels) ! logs of midpoint pressures - check K indexing??
+real(r8) :: pmln(nlevels+1) ! logs of midpoint pressures plus surface interface pressure
-!>@todo FIXME i really really want to get rid of these. they make the code very
-!> hard to understand. we have simpler routines to compute the pressures at the
-!> midpoints, and at the interfaces. i think we can substitute those for these.
-real(r8) :: hybrid_As(nlevels+1,2), hybrid_Bs(nlevels+1,2)
+!real(r8) :: p_surf = 100183.18209922672_r8
+!real(r8) :: h_surf = 329.4591445914210794_r8
+!!tvX:
+!real(r8) :: virtual_temp(26) = (/ &
+! 219.504545724395342177_r8, &
+! 220.755756266998901083_r8, &
+! 218.649777340474969378_r8, &
+! 218.144545911709940356_r8, &
+! 217.728221229954215232_r8, &
+! 216.143009218914528446_r8, &
+! 214.481037053947034110_r8, &
+! 211.658627994532224648_r8, &
+! 211.833385313013934592_r8, &
+! 212.213164703541366407_r8, &
+! 212.615531561483351197_r8, &
+! 209.756210669626966592_r8, &
+! 209.138904604986379354_r8, &
+! 212.498936606159986695_r8, &
+! 219.523651584890700406_r8, &
+! 229.031103260649530284_r8, &
+! 237.766208609568053589_r8, &
+! 245.843809142625332242_r8, &
+! 253.456529559321467104_r8, &
+! 258.270814547914710602_r8, &
+! 260.346496319841151035_r8, &
+! 261.759864813262595362_r8, &
+! 262.993454407623175939_r8, &
+! 266.850708906211991689_r8, &
+! 270.064944946168111528_r8, &
+! 271.721653151072075616_r8 /)
+!
+!
+!write(*, 202) 'psurf, hsurf: ', p_surf, h_surf
+
+200 format (I3, 6(1X, F24.16))
+201 format (A, 1X, I3, 6(1X, F24.16))
+202 format (A, 6(1X, F24.16))
+203 format (6(1X, F24.16))
More information about the Dart-dev
mailing list