[Dart-dev] DART/branches Revision: 12329

dart at ucar.edu dart at ucar.edu
Fri Jan 12 16:23:26 MST 2018


hendric at ucar.edu
2018-01-12 16:23:26 -0700 (Fri, 12 Jan 2018)
83

simplifying logic and comments for calculating geopotential height from pressure




Modified: DART/branches/recam/models/cam-fv/model_mod.f90
===================================================================
--- DART/branches/recam/models/cam-fv/model_mod.f90	2018-01-12 23:22:04 UTC (rev 12328)
+++ DART/branches/recam/models/cam-fv/model_mod.f90	2018-01-12 23:23:26 UTC (rev 12329)
@@ -2594,7 +2594,54 @@
 
 end subroutine read_cam_phis_array
 
+!#! !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
+!#! 
+
 !-----------------------------------------------------------------------
+! Purpose:
+!   To compute geopotential height using the CCM2 hybrid coordinate
+!   vertical slice.  Since the vertical integration matrix is a
+!   function of latitude and longitude, it is not explicitly
+!   computed as for sigma coordinates.  The integration algorithm
+!   is derived from Boville's mods in the ibm file hybrid 1mods
+!   (6/17/88).  All vertical slice arrays are oriented top to
+!   bottom as in CCM2.  This field is on full model levels (aka
+!   "midpoints") not half levels.
+!
+! Equation references are to "Hybrid Coordinates for CCM1"
+!    https://opensky.ucar.edu/islandora/object/technotes%3A149/datastream/PDF/view
 
 subroutine build_heights(nlevels,p_surf,h_surf,virtual_temp,height_midpts,height_interf,variable_r)
 
@@ -2608,73 +2655,17 @@
 
 ! 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), 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) !
 
 integer  :: i,k,l
 
 ! 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+1)        ! logs of midpoint pressures plus surface interface pressure
+real(r8) :: pterm(nlevels)   ! vertical scratch space, to improve computational efficiency
+real(r8) :: r_g0_tv(nlevels) ! rbyg=r/g0 * tv
+real(r8) :: p_mid(nlevels)   ! midpoints in column
+real(r8) :: pm_ln(nlevels+1) ! logs of midpoint pressures plus surface interface pressure
 
-!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, &


More information about the Dart-dev mailing list