[Dart-dev] DART/branches Revision: 12334

dart at ucar.edu dart at ucar.edu
Tue Jan 16 13:36:53 MST 2018


nancy at ucar.edu
2018-01-16 13:36:51 -0700 (Tue, 16 Jan 2018)
133
get rid of the p_mid array - the previous code had
an out-of-array reference and was taking x=log(x)
without x being initialized.  




Modified: DART/branches/recam/models/cam-fv/model_mod.f90
===================================================================
--- DART/branches/recam/models/cam-fv/model_mod.f90	2018-01-16 19:55:10 UTC (rev 12333)
+++ DART/branches/recam/models/cam-fv/model_mod.f90	2018-01-16 20:36:51 UTC (rev 12334)
@@ -2677,7 +2677,6 @@
 ! an array now: real(r8), parameter :: rbyg=r/g0
 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
 
 ! cam uses a uniform gas constant value, but high top
@@ -2694,13 +2693,13 @@
 ! the pressure at nlevels+1 is the pressure of the 
 ! actual surface interface, not a midpoint!!
 
-call cam_p_col_midpts(p_surf, nlevels, p_mid)
+call cam_p_col_midpts(p_surf, nlevels, pm_ln)
    
-p_mid(nlevels+1) = p_surf * grid_data%hybi%vals(nlevels+1)   ! surface interface
+pm_ln(nlevels+1) = p_surf * grid_data%hybi%vals(nlevels+1)   ! surface interface
    
-where      (p_mid >  0.0_r8) 
+where (pm_ln >  0.0_r8) 
    pm_ln = log(pm_ln) 
-else where (p_mid <= 0.0_r8)
+else where (pm_ln <= 0.0_r8)
    pm_ln = 0
 end where
 


More information about the Dart-dev mailing list