[Dart-dev] DART/branches Revision: 12286

dart at ucar.edu dart at ucar.edu
Fri Jan 5 14:47:27 MST 2018


nancy at ucar.edu
2018-01-05 14:47:24 -0700 (Fri, 05 Jan 2018)
95
warning - has lots of print statements and has hardcoded values
in the height converter, too.




Modified: DART/branches/recam/models/cam-fv/model_mod.f90
===================================================================
--- DART/branches/recam/models/cam-fv/model_mod.f90	2018-01-04 22:05:06 UTC (rev 12285)
+++ DART/branches/recam/models/cam-fv/model_mod.f90	2018-01-05 21:47:24 UTC (rev 12286)
@@ -113,6 +113,7 @@
 character(len=32)  :: fields_to_perturb(MAX_PERT)     = "QTY_TEMPERATURE"
 real(r8)           :: perturbation_amplitude(MAX_PERT)= 0.00001_r8
 logical            :: using_chemistry                 = .false.
+logical            :: use_old_heights                 = .false.
 
 ! state_variables defines the contents of the state vector.
 ! each line of this input should have the form:
@@ -141,6 +142,7 @@
    custom_routine_to_generate_ensemble, &
    fields_to_perturb,               &
    perturbation_amplitude,          &
+   use_old_heights,                 &
    debug_level
 
 ! global variables
@@ -2587,12 +2589,12 @@
 
 !-----------------------------------------------------------------------
 
-subroutine build_heights(nlevels,p_surf,h_surf,virtual_temp,height_midpts,height_interf,variable_r)
+subroutine build_heights(nlevels,p_surfX,h_surfX,virtual_tempX,height_midpts,height_interf,variable_r)
 
 integer,  intent(in)  :: nlevels                            ! Number of vertical levels
-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(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(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
@@ -2601,21 +2603,20 @@
 !>@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) :: dist_from_interf(nlevels)         ! pressure profile
 real(r8) :: pterm(nlevels)
-real(r8) :: log_points_mid(nlevels+1)
 
 integer  :: i,k,l
-real(r8) :: temp, hprb, log_p_int 
+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) :: const_r_g0(nlevels)      ! rbyg=r/g0
-real(r8) :: midpts(nlevels)          ! midpoints  in column
-real(r8) :: interf(nlevels+1)        ! interfaces in column
-real(r8) :: log_p_midpoints(nlevels) ! log of pressure at layer midpoints
-real(r8) :: log_p_interf(nlevels+1)  ! log of pressure at layer interfaces
-real(r8) :: geo_hgt_intf(nlevels+1)  ! Geopotential height at interfaces, top to bottom
-real(r8) :: pmln(nlevels+1)          ! logs of midpoint pressures
+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??
+
+!>@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)
 
 !state of dry air dry air Air pressure
@@ -2650,10 +2651,50 @@
 hybrid_As(1,2) = 0.0_r8
 hybrid_Bs(1,2) = 1.0_r8
 
+! be very careful about indexing in this array - it seems
+! off by one compared to the hyam()/hybm() arrays.
+pmln(:) = MISSING_R8
+
+print *, 'heights surface p, surface elev hardcoded - remove me!!!'
+print *, 'heights surface p, surface elev hardcoded - remove me!!!'
+print *, 'heights surface p, surface elev hardcoded - remove me!!!'
+p_surf = 100183.18209922672
+h_surf = 329.45914459142108
+!tvX:
+virtual_temp(:) = (/   &
+    219.504545724395342177, &
+    220.755756266998901083, &
+    218.649777340474969378, &
+    218.144545911709940356, &
+    217.728221229954215232, &
+    216.143009218914528446, &
+    214.481037053947034110, &
+    211.658627994532224648, &
+    211.833385313013934592, &
+    212.213164703541366407, &
+    212.615531561483351197, &
+    209.756210669626966592, &
+    209.138904604986379354, &
+    212.498936606159986695, &
+    219.523651584890700406, &
+    229.031103260649530284, &
+    237.766208609568053589, &
+    245.843809142625332242, &


More information about the Dart-dev mailing list