Our site saves small pieces of text information (cookies) on your
device in order to verify your login. These cookies are essential
to provide access to resources on this website and it will not
work properly without.
Learn more

<p>
Hi,
</p>
<p>
I have my 3d (+time = 4d) variable PP (deviation from reference pressure).
<br/>
Now I simple want to compute my pressure on the full levels.
</p>
<p>
from
<span class="caps">
YUSPECIF
</span>
:
</p>
Vertical coordinate: type 2 (Gal-Chen hybrid)
k Z(k) P0(k)
1 25000.0000 28.1726
2 23800.0000 33.9524
[…..]
60 10.0000 998.8149
61 0.0000 1000.0000
Boundary for change from z to terrain-following: vcflat = 11430.0000
Half-level index where levels become flat: k = 15
Exponential profile with asymptotic isothermal stratosphere
Values of the Reference Atmosphere:
Pressure at Sea-Level: 1000.0000
Temperature at Sea-Level: 15.0000
Temp. diff. sea-level-stratosph.: 75.0000
Scale height for temp. decrease: 10000.0000
<p>
from Output constant file (lffd2015123118c.nc)
</p>
vcoord:long_name = “Height-based hybrid Gal-Chen coordinate” ;
vcoord:units = “Pa” ;
vcoord:ivctype = 2 ;
vcoord:irefatm = 2 ;
vcoord:p0sl = 100000. ;
vcoord:t0sl = 288.149993896484 ;
vcoord:dt0lp = 42. ;
vcoord:vcflat = 11430. ;
vcoord:delta_t = 75. ;
vcoord:h_scal = 10000. ;
<p>
As I understand it, I need to compute the reference pressure for every grid point and then just add PP?
<br/>
I must compute the reference pressure on full levels right?
</p>
Step 1: H = (
<span class="caps">
HLL
</span>
[:,:,1:60] +
<span class="caps">
HLL
</span>
[:,:,2:61] ) * 0.5
Step 2: P_ref = specialFunction(H) = “pressure in Height H“
Step 3: P = P_ref + PP
<p>
Is this so far correct?
<br/>
In that case what is this “specialFunction”? (I know it is basically barometric height formula… but which version?)
<br/>
I tried the formula from the
<span class="caps">
COSMO
</span>
Documentation (Part I: Dynamics and Numerics) page 28/29, equation (3.85)
<br/>
p_0(z) = … for both cases beta = 0 and beta = 42
<br/>
but if I test it with the values from
<span class="caps">
YUSPECIF
</span>
I get lower or higher values than there.
</p>
nc = nc_open(file)
vcoord = ncvar_get(nc,“vcoord”)
p0sl = ncatt_get(nc,“vcoord”,“p0sl”)$value
t0sl = ncatt_get(nc,“vcoord”,“t0sl”)$value
dt0lp = ncatt_get(nc,“vcoord”,“dt0lp”)$value
pref1 = p0sl * exp( -t0sl/dt0lp * (1-sqrt(1 – 2 * dt0lp * 9.81 * vcoord / 287.058 / t0sl^2) )
pref2 = p0sl * exp( -9.81 * vcoord / 287.058 / t0sl )
<p>
for 25000m
<br/>
pref1 gives 13 hPa
<br/>
pref2 gives 51 hPa
<br/>
while
<span class="caps">
YUSPECIF
</span>
says 28 hPa
</p>
<p>
Any suggestions?
<br/>
Rolf
</p>
<p>
P.S.: the attribute:units of the variable “vcoord” says “Pa” but its obviously(?) meter
</p>
<p>
edit: I attached the files
</p>

<p>
Hi,
</p>
<p>
I have my 3d (+time = 4d) variable PP (deviation from reference pressure).
<br/>
Now I simple want to compute my pressure on the full levels.
</p>
<p>
from
<span class="caps">
YUSPECIF
</span>
:
</p>
Vertical coordinate: type 2 (Gal-Chen hybrid)
k Z(k) P0(k)
1 25000.0000 28.1726
2 23800.0000 33.9524
[…..]
60 10.0000 998.8149
61 0.0000 1000.0000
Boundary for change from z to terrain-following: vcflat = 11430.0000
Half-level index where levels become flat: k = 15
Exponential profile with asymptotic isothermal stratosphere
Values of the Reference Atmosphere:
Pressure at Sea-Level: 1000.0000
Temperature at Sea-Level: 15.0000
Temp. diff. sea-level-stratosph.: 75.0000
Scale height for temp. decrease: 10000.0000
<p>
from Output constant file (lffd2015123118c.nc)
</p>
vcoord:long_name = “Height-based hybrid Gal-Chen coordinate” ;
vcoord:units = “Pa” ;
vcoord:ivctype = 2 ;
vcoord:irefatm = 2 ;
vcoord:p0sl = 100000. ;
vcoord:t0sl = 288.149993896484 ;
vcoord:dt0lp = 42. ;
vcoord:vcflat = 11430. ;
vcoord:delta_t = 75. ;
vcoord:h_scal = 10000. ;
<p>
As I understand it, I need to compute the reference pressure for every grid point and then just add PP?
<br/>
I must compute the reference pressure on full levels right?
</p>
Step 1: H = (
<span class="caps">
HLL
</span>
[:,:,1:60] +
<span class="caps">
HLL
</span>
[:,:,2:61] ) * 0.5
Step 2: P_ref = specialFunction(H) = “pressure in Height H“
Step 3: P = P_ref + PP
<p>
Is this so far correct?
<br/>
In that case what is this “specialFunction”? (I know it is basically barometric height formula… but which version?)
<br/>
I tried the formula from the
<span class="caps">
COSMO
</span>
Documentation (Part I: Dynamics and Numerics) page 28/29, equation (3.85)
<br/>
p_0(z) = … for both cases beta = 0 and beta = 42
<br/>
but if I test it with the values from
<span class="caps">
YUSPECIF
</span>
I get lower or higher values than there.
</p>
nc = nc_open(file)
vcoord = ncvar_get(nc,“vcoord”)
p0sl = ncatt_get(nc,“vcoord”,“p0sl”)$value
t0sl = ncatt_get(nc,“vcoord”,“t0sl”)$value
dt0lp = ncatt_get(nc,“vcoord”,“dt0lp”)$value
pref1 = p0sl * exp( -t0sl/dt0lp * (1-sqrt(1 – 2 * dt0lp * 9.81 * vcoord / 287.058 / t0sl^2) )
pref2 = p0sl * exp( -9.81 * vcoord / 287.058 / t0sl )
<p>
for 25000m
<br/>
pref1 gives 13 hPa
<br/>
pref2 gives 51 hPa
<br/>
while
<span class="caps">
YUSPECIF
</span>
says 28 hPa
</p>
<p>
Any suggestions?
<br/>
Rolf
</p>
<p>
P.S.: the attribute:units of the variable “vcoord” says “Pa” but its obviously(?) meter
</p>
<p>
edit: I attached the files
</p>

I have my 3d (+time = 4d) variable PP (deviation from reference pressure).
Now I simple want to compute my pressure on the full levels.

from
YUSPECIF
:

Vertical coordinate: type 2 (Gal-Chen hybrid)
k Z(k) P0(k)
1 25000.0000 28.1726
2 23800.0000 33.9524
[…..]
60 10.0000 998.8149
61 0.0000 1000.0000
Boundary for change from z to terrain-following: vcflat = 11430.0000
Half-level index where levels become flat: k = 15
Exponential profile with asymptotic isothermal stratosphere
Values of the Reference Atmosphere:
Pressure at Sea-Level: 1000.0000
Temperature at Sea-Level: 15.0000
Temp. diff. sea-level-stratosph.: 75.0000
Scale height for temp. decrease: 10000.0000

As I understand it, I need to compute the reference pressure for every grid point and then just add PP?
I must compute the reference pressure on full levels right?

Step 1: H = (
HLL
[:,:,1:60] +
HLL
[:,:,2:61] ) * 0.5
Step 2: P_ref = specialFunction(H) = “pressure in Height H“
Step 3: P = P_ref + PP

Is this so far correct?
In that case what is this “specialFunction”? (I know it is basically barometric height formula… but which version?)
I tried the formula from the
COSMO
Documentation (Part I: Dynamics and Numerics) page 28/29, equation (3.85)
p_0(z) = … for both cases beta = 0 and beta = 42
but if I test it with the values from
YUSPECIF
I get lower or higher values than there.

<p>
Hi Rolf,
</p>
<p>
I send you an excel table for the case of 40 levels, which was prepared by H-J and myself in order to analyse the inconsistencies between the grid definitions in
<span class="caps">
COSMO
</span>
. It shows all related quantities of the reference atmosphere and the same values as in
<span class="caps">
YUSPECIF
</span>
.
<br/>
You may adapt it for 60 levels and compare the formula with yours. This should give the correct values.
</p>
<p>
I’m sorry, but I do not have the time at the moment to check it on my own.
</p>
<p>
Regards, Andreas
</p>
<p>
Rolf Zentek wrote:
<br/>
> Hi,
<br/>
>
<br/>
> I have my 3d (+time = 4d) variable PP (deviation from reference pressure).
<br/>
> Now I simple want to compute my pressure on the full levels.
<br/>
>
<br/>
> from YUSPECIF:
<br/>
>
<br/>
> Vertical coordinate: type 2 (Gal-Chen hybrid)
<br/>
> k Z(k) P0(k)
<br/>
> 1 25000.0000 28.1726
<br/>
> 2 23800.0000 33.9524
<br/>
> […..]
<br/>
> 60 10.0000 998.8149
<br/>
> 61 0.0000 1000.0000
<br/>
> Boundary for change from z to terrain-following: vcflat = 11430.0000
<br/>
> Half-level index where levels become flat: k = 15
<br/>
> Exponential profile with asymptotic isothermal stratosphere
<br/>
> Values of the Reference Atmosphere:
<br/>
> Pressure at Sea-Level: 1000.0000
<br/>
> Temperature at Sea-Level: 15.0000
<br/>
> Temp. diff. sea-level-stratosph.: 75.0000
<br/>
> Scale height for temp. decrease: 10000.0000
<br/>
>
<br/>
> from Output constant file (lffd2015123118c.nc)
<br/>
>
<br/>
> vcoord:long_name = “Height-based hybrid Gal-Chen coordinate” ;
<br/>
> vcoord:units = “Pa” ;
<br/>
> vcoord:ivctype = 2 ;
<br/>
> vcoord:irefatm = 2 ;
<br/>
> vcoord:p0sl = 100000. ;
<br/>
> vcoord:t0sl = 288.149993896484 ;
<br/>
> vcoord:dt0lp = 42. ;
<br/>
> vcoord:vcflat = 11430. ;
<br/>
> vcoord:delta_t = 75. ;
<br/>
> vcoord:h_scal = 10000. ;
<br/>
>
<br/>
> As I understand it, I need to compute the reference pressure for every grid point and then just add PP?
<br/>
> I must compute the reference pressure on full levels right?
<br/>
>
<br/>
> Step 1: H = ( HLL[:,:,1:60] + HLL[:,:,2:61] ) * 0.5
<br/>
> Step 2: P_ref = specialFunction(H) = “pressure in Height H“
<br/>
> Step 3: P = P_ref + PP
<br/>
>
<br/>
> Is this so far correct?
<br/>
> In that case what is this “specialFunction”? (I know it is basically barometric height formula… but which version?)
<br/>
> I tried the formula from the COSMO Documentation (Part I: Dynamics and Numerics) page 28/29, equation (3.85)
<br/>
> p_0(z) = … for both cases beta = 0 and beta = 42
<br/>
> but if I test it with the values from YUSPECIF I get lower or higher values than there.
<br/>
>
<br/>
> nc = nc_open(file)
<br/>
> vcoord = ncvar_get(nc,“vcoord”)
<br/>
> p0sl = ncatt_get(nc,“vcoord”,“p0sl”)$value
<br/>
> t0sl = ncatt_get(nc,“vcoord”,“t0sl”)$value
<br/>
> dt0lp = ncatt_get(nc,“vcoord”,“dt0lp”)$value
<br/>
> pref1 = p0sl * exp( -t0sl/dt0lp * (1-sqrt(1 – 2 * dt0lp * 9.81 * vcoord / 287.058 / t0sl^2) )
<br/>
> pref2 = p0sl * exp( -9.81 * vcoord / 287.058 / t0sl )
<br/>
>
<br/>
> for 25000m
<br/>
> pref1 gives 13 hPa
<br/>
> pref2 gives 51 hPa
<br/>
> while YUSPECIF says 28 hPa
<br/>
>
<br/>
> Any suggestions?
<br/>
> Rolf
<br/>
>
<br/>
> P.S.: the attribute:units of the variable “vcoord” says “Pa” but its obviously(?) meter
<br/>
>
<br/>
> edit: I attached the files
</p>

<p>
Hi Rolf,
</p>
<p>
I send you an excel table for the case of 40 levels, which was prepared by H-J and myself in order to analyse the inconsistencies between the grid definitions in
<span class="caps">
COSMO
</span>
. It shows all related quantities of the reference atmosphere and the same values as in
<span class="caps">
YUSPECIF
</span>
.
<br/>
You may adapt it for 60 levels and compare the formula with yours. This should give the correct values.
</p>
<p>
I’m sorry, but I do not have the time at the moment to check it on my own.
</p>
<p>
Regards, Andreas
</p>
<p>
Rolf Zentek wrote:
<br/>
> Hi,
<br/>
>
<br/>
> I have my 3d (+time = 4d) variable PP (deviation from reference pressure).
<br/>
> Now I simple want to compute my pressure on the full levels.
<br/>
>
<br/>
> from YUSPECIF:
<br/>
>
<br/>
> Vertical coordinate: type 2 (Gal-Chen hybrid)
<br/>
> k Z(k) P0(k)
<br/>
> 1 25000.0000 28.1726
<br/>
> 2 23800.0000 33.9524
<br/>
> […..]
<br/>
> 60 10.0000 998.8149
<br/>
> 61 0.0000 1000.0000
<br/>
> Boundary for change from z to terrain-following: vcflat = 11430.0000
<br/>
> Half-level index where levels become flat: k = 15
<br/>
> Exponential profile with asymptotic isothermal stratosphere
<br/>
> Values of the Reference Atmosphere:
<br/>
> Pressure at Sea-Level: 1000.0000
<br/>
> Temperature at Sea-Level: 15.0000
<br/>
> Temp. diff. sea-level-stratosph.: 75.0000
<br/>
> Scale height for temp. decrease: 10000.0000
<br/>
>
<br/>
> from Output constant file (lffd2015123118c.nc)
<br/>
>
<br/>
> vcoord:long_name = “Height-based hybrid Gal-Chen coordinate” ;
<br/>
> vcoord:units = “Pa” ;
<br/>
> vcoord:ivctype = 2 ;
<br/>
> vcoord:irefatm = 2 ;
<br/>
> vcoord:p0sl = 100000. ;
<br/>
> vcoord:t0sl = 288.149993896484 ;
<br/>
> vcoord:dt0lp = 42. ;
<br/>
> vcoord:vcflat = 11430. ;
<br/>
> vcoord:delta_t = 75. ;
<br/>
> vcoord:h_scal = 10000. ;
<br/>
>
<br/>
> As I understand it, I need to compute the reference pressure for every grid point and then just add PP?
<br/>
> I must compute the reference pressure on full levels right?
<br/>
>
<br/>
> Step 1: H = ( HLL[:,:,1:60] + HLL[:,:,2:61] ) * 0.5
<br/>
> Step 2: P_ref = specialFunction(H) = “pressure in Height H“
<br/>
> Step 3: P = P_ref + PP
<br/>
>
<br/>
> Is this so far correct?
<br/>
> In that case what is this “specialFunction”? (I know it is basically barometric height formula… but which version?)
<br/>
> I tried the formula from the COSMO Documentation (Part I: Dynamics and Numerics) page 28/29, equation (3.85)
<br/>
> p_0(z) = … for both cases beta = 0 and beta = 42
<br/>
> but if I test it with the values from YUSPECIF I get lower or higher values than there.
<br/>
>
<br/>
> nc = nc_open(file)
<br/>
> vcoord = ncvar_get(nc,“vcoord”)
<br/>
> p0sl = ncatt_get(nc,“vcoord”,“p0sl”)$value
<br/>
> t0sl = ncatt_get(nc,“vcoord”,“t0sl”)$value
<br/>
> dt0lp = ncatt_get(nc,“vcoord”,“dt0lp”)$value
<br/>
> pref1 = p0sl * exp( -t0sl/dt0lp * (1-sqrt(1 – 2 * dt0lp * 9.81 * vcoord / 287.058 / t0sl^2) )
<br/>
> pref2 = p0sl * exp( -9.81 * vcoord / 287.058 / t0sl )
<br/>
>
<br/>
> for 25000m
<br/>
> pref1 gives 13 hPa
<br/>
> pref2 gives 51 hPa
<br/>
> while YUSPECIF says 28 hPa
<br/>
>
<br/>
> Any suggestions?
<br/>
> Rolf
<br/>
>
<br/>
> P.S.: the attribute:units of the variable “vcoord” says “Pa” but its obviously(?) meter
<br/>
>
<br/>
> edit: I attached the files
</p>

I send you an excel table for the case of 40 levels, which was prepared by H-J and myself in order to analyse the inconsistencies between the grid definitions in
COSMO
. It shows all related quantities of the reference atmosphere and the same values as in
YUSPECIF
.
You may adapt it for 60 levels and compare the formula with yours. This should give the correct values.

I’m sorry, but I do not have the time at the moment to check it on my own.

Regards, Andreas

Rolf Zentek wrote:
> Hi,
>
> I have my 3d (+time = 4d) variable PP (deviation from reference pressure).
> Now I simple want to compute my pressure on the full levels.
>
> from YUSPECIF:
>
> Vertical coordinate: type 2 (Gal-Chen hybrid)
> k Z(k) P0(k)
> 1 25000.0000 28.1726
> 2 23800.0000 33.9524
> […..]
> 60 10.0000 998.8149
> 61 0.0000 1000.0000
> Boundary for change from z to terrain-following: vcflat = 11430.0000
> Half-level index where levels become flat: k = 15
> Exponential profile with asymptotic isothermal stratosphere
> Values of the Reference Atmosphere:
> Pressure at Sea-Level: 1000.0000
> Temperature at Sea-Level: 15.0000
> Temp. diff. sea-level-stratosph.: 75.0000
> Scale height for temp. decrease: 10000.0000
>
> from Output constant file (lffd2015123118c.nc)
>
> vcoord:long_name = “Height-based hybrid Gal-Chen coordinate” ;
> vcoord:units = “Pa” ;
> vcoord:ivctype = 2 ;
> vcoord:irefatm = 2 ;
> vcoord:p0sl = 100000. ;
> vcoord:t0sl = 288.149993896484 ;
> vcoord:dt0lp = 42. ;
> vcoord:vcflat = 11430. ;
> vcoord:delta_t = 75. ;
> vcoord:h_scal = 10000. ;
>
> As I understand it, I need to compute the reference pressure for every grid point and then just add PP?
> I must compute the reference pressure on full levels right?
>
> Step 1: H = ( HLL[:,:,1:60] + HLL[:,:,2:61] ) * 0.5
> Step 2: P_ref = specialFunction(H) = “pressure in Height H“
> Step 3: P = P_ref + PP
>
> Is this so far correct?
> In that case what is this “specialFunction”? (I know it is basically barometric height formula… but which version?)
> I tried the formula from the COSMO Documentation (Part I: Dynamics and Numerics) page 28/29, equation (3.85)
> p_0(z) = … for both cases beta = 0 and beta = 42
> but if I test it with the values from YUSPECIF I get lower or higher values than there.
>
> nc = nc_open(file)
> vcoord = ncvar_get(nc,“vcoord”)
> p0sl = ncatt_get(nc,“vcoord”,“p0sl”)$value
> t0sl = ncatt_get(nc,“vcoord”,“t0sl”)$value
> dt0lp = ncatt_get(nc,“vcoord”,“dt0lp”)$value
> pref1 = p0sl * exp( -t0sl/dt0lp * (1-sqrt(1 – 2 * dt0lp * 9.81 * vcoord / 287.058 / t0sl^2) )
> pref2 = p0sl * exp( -9.81 * vcoord / 287.058 / t0sl )
>
> for 25000m
> pref1 gives 13 hPa
> pref2 gives 51 hPa
> while YUSPECIF says 28 hPa
>
> Any suggestions?
> Rolf
>
> P.S.: the attribute:units of the variable “vcoord” says “Pa” but its obviously(?) meter
>
> edit: I attached the files

<p>
Hey Andreas,
</p>
<p>
I took the first sheet (ivctype_2_Ref_Atmos_alt)
<br/>
and just changed the Value in B5 to 25000 resulting in 13 hPa for J5 (p0_HalfLevel) which uses the same formula as pref1 from my post.
<br/>
But its unequal to the Value from
<span class="caps">
YUSPECIF
</span>
.
</p>
<p>
regards
<br/>
Rolf
</p>

<p>
Hey Andreas,
</p>
<p>
I took the first sheet (ivctype_2_Ref_Atmos_alt)
<br/>
and just changed the Value in B5 to 25000 resulting in 13 hPa for J5 (p0_HalfLevel) which uses the same formula as pref1 from my post.
<br/>
But its unequal to the Value from
<span class="caps">
YUSPECIF
</span>
.
</p>
<p>
regards
<br/>
Rolf
</p>

I took the first sheet (ivctype_2_Ref_Atmos_alt)
and just changed the Value in B5 to 25000 resulting in 13 hPa for J5 (p0_HalfLevel) which uses the same formula as pref1 from my post.
But its unequal to the Value from
YUSPECIF
.

<p>
Hey,
</p>
<p>
does anyone know if
<code>
vgrid_refatm_utils.f90
</code>
is the right file to look at?
</p>
<p>
The
<code>
SUBROUTINE reference_atmosphere
</code>
seems to include both formulas I cited from the documentation.
</p>
<p>
The
<code>
SUBROUTINE reference_atmosphere_2
</code>
seems to include another formulas, which computes approximatly(*) the same values as my
<span class="caps">
YUSPECIF
</span>
.
</p>
<p>
(*) I suppose due to different values of constants?!
</p>
<p>
Here in R-style:
</p>
<pre>
nc = nc_open(file)
vcoord = ncvar_get(nc,"vcoord")
p0sl = ncatt_get(nc,"vcoord","p0sl")$value
t0sl = ncatt_get(nc,"vcoord","t0sl")$value
dt0lp = ncatt_get(nc,"vcoord","dt0lp")$value
delta_t = ncatt_get(nc,"vcoord","delta_t")$value
h_scal = ncatt_get(nc,"vcoord","h_scal")$value
g = 9.80665#9.807
R = 287.05
pref1 = p0sl * exp( -t0sl/dt0lp * (1-sqrt(1 - 2 * dt0lp * g * vcoord / R / t0sl^2) ) )
pref2 = p0sl * exp( -g * vcoord / R / t0sl )
t00 = t0sl - delta_t
pref3 = p0sl * exp( -g*h_scal/ R/t00 * log( (exp(vcoord/h_scal)*t00 + delta_t)/(t00 + delta_t)) )
</pre>
<p>
Can anyone confirm, that for my configuration I need to use
<code>
pref3
</code>
? (or that indeed
<code>
reference_atmosphere_2
</code>
was used)
</p>
<p>
Rolf
</p>

<p>
Hey,
</p>
<p>
does anyone know if
<code>
vgrid_refatm_utils.f90
</code>
is the right file to look at?
</p>
<p>
The
<code>
SUBROUTINE reference_atmosphere
</code>
seems to include both formulas I cited from the documentation.
</p>
<p>
The
<code>
SUBROUTINE reference_atmosphere_2
</code>
seems to include another formulas, which computes approximatly(*) the same values as my
<span class="caps">
YUSPECIF
</span>
.
</p>
<p>
(*) I suppose due to different values of constants?!
</p>
<p>
Here in R-style:
</p>
<pre>
nc = nc_open(file)
vcoord = ncvar_get(nc,"vcoord")
p0sl = ncatt_get(nc,"vcoord","p0sl")$value
t0sl = ncatt_get(nc,"vcoord","t0sl")$value
dt0lp = ncatt_get(nc,"vcoord","dt0lp")$value
delta_t = ncatt_get(nc,"vcoord","delta_t")$value
h_scal = ncatt_get(nc,"vcoord","h_scal")$value
g = 9.80665#9.807
R = 287.05
pref1 = p0sl * exp( -t0sl/dt0lp * (1-sqrt(1 - 2 * dt0lp * g * vcoord / R / t0sl^2) ) )
pref2 = p0sl * exp( -g * vcoord / R / t0sl )
t00 = t0sl - delta_t
pref3 = p0sl * exp( -g*h_scal/ R/t00 * log( (exp(vcoord/h_scal)*t00 + delta_t)/(t00 + delta_t)) )
</pre>
<p>
Can anyone confirm, that for my configuration I need to use
<code>
pref3
</code>
? (or that indeed
<code>
reference_atmosphere_2
</code>
was used)
</p>
<p>
Rolf
</p>

<p>
update / solution:
</p>
<p>
For everyone having the same problem: my
<strong>
INT2LM setting is
<code>
irefatm = 2
</code>
</strong>
</p>
<p>
From looking into the source code it seems to me that that:
<br/>
<code>
reference_atmosphere_2
</code>
and thus
<code>
pref3
</code>
is used because of my INT2LM setting
<code>
irefatm = 2
</code>
</p>
<p>
I think the formula from the excel sheet and from the documentation are for the case
<code>
irefatm = 1
</code>
</p>
<p>
From the documentation I get the same as from the source code:
<br/>
<pre>
The new reference atmosphere is based on the temperature profile t0(z) = (t0sl-delta_t) + delta_t*exp(-z/h_scal), where z = hhl(k) is the height of a model grid point.
</pre>
<br/>
From the source code
<code>
vgrid_refatm_utils.f90
</code>
/
<code>
reference_atmosphere_2
</code>
:
<br/>
<pre>
The base-state pressure at main levels is computed from the analytically integrated hydrostatic equation, assuming that the height at full levels (zhfl) is the arithmetic mean of the adjacent half levels.
</pre>
<br/>
which I interprete to be the equation
<code>
pref3
</code>
with
<code>
(hhl[,,1:60]+hhl[,,2:61])/2
</code>
instead of
<code>
vcoord
</code>
<br/>
When I did the analytical integration of the hydrostatic equation myself I got a different formula than pref3, but they give the same values :D so in short:
</p>
<p>
<strong>
My opionion: If
<code>
irefatm = 2
</code>
then
<code>
p_reference(z) = p0sl * exp( -g*h_scal/ R/t00 * log( (exp(z/h_scal)*t00 + delta_t)/(t00 + delta_t)) )
</code>
</strong>
<br/>
with the values from my earlier posts
</p>

<p>
update / solution:
</p>
<p>
For everyone having the same problem: my
<strong>
INT2LM setting is
<code>
irefatm = 2
</code>
</strong>
</p>
<p>
From looking into the source code it seems to me that that:
<br/>
<code>
reference_atmosphere_2
</code>
and thus
<code>
pref3
</code>
is used because of my INT2LM setting
<code>
irefatm = 2
</code>
</p>
<p>
I think the formula from the excel sheet and from the documentation are for the case
<code>
irefatm = 1
</code>
</p>
<p>
From the documentation I get the same as from the source code:
<br/>
<pre>
The new reference atmosphere is based on the temperature profile t0(z) = (t0sl-delta_t) + delta_t*exp(-z/h_scal), where z = hhl(k) is the height of a model grid point.
</pre>
<br/>
From the source code
<code>
vgrid_refatm_utils.f90
</code>
/
<code>
reference_atmosphere_2
</code>
:
<br/>
<pre>
The base-state pressure at main levels is computed from the analytically integrated hydrostatic equation, assuming that the height at full levels (zhfl) is the arithmetic mean of the adjacent half levels.
</pre>
<br/>
which I interprete to be the equation
<code>
pref3
</code>
with
<code>
(hhl[,,1:60]+hhl[,,2:61])/2
</code>
instead of
<code>
vcoord
</code>
<br/>
When I did the analytical integration of the hydrostatic equation myself I got a different formula than pref3, but they give the same values :D so in short:
</p>
<p>
<strong>
My opionion: If
<code>
irefatm = 2
</code>
then
<code>
p_reference(z) = p0sl * exp( -g*h_scal/ R/t00 * log( (exp(z/h_scal)*t00 + delta_t)/(t00 + delta_t)) )
</code>
</strong>
<br/>
with the values from my earlier posts
</p>

For everyone having the same problem: my
INT2LM setting is
irefatm = 2

From looking into the source code it seems to me that that:
reference_atmosphere_2
and thus
pref3
is used because of my INT2LM setting
irefatm = 2

I think the formula from the excel sheet and from the documentation are for the case
irefatm = 1

From the documentation I get the same as from the source code:

The new reference atmosphere is based on the temperature profile t0(z) = (t0sl-delta_t) + delta_t*exp(-z/h_scal), where z = hhl(k) is the height of a model grid point.

From the source code
vgrid_refatm_utils.f90
/
reference_atmosphere_2
:

The base-state pressure at main levels is computed from the analytically integrated hydrostatic equation, assuming that the height at full levels (zhfl) is the arithmetic mean of the adjacent half levels.

which I interprete to be the equation
pref3
with
(hhl[,,1:60]+hhl[,,2:61])/2
instead of
vcoord
When I did the analytical integration of the hydrostatic equation myself I got a different formula than pref3, but they give the same values :D so in short:

My opionion: If
irefatm = 2
then
p_reference(z) = p0sl * exp( -g*h_scal/ R/t00 * log( (exp(z/h_scal)*t00 + delta_t)/(t00 + delta_t)) )
with the values from my earlier posts

## computing pressure from PP

Hi,

I have my 3d (+time = 4d) variable PP (deviation from reference pressure).

Now I simple want to compute my pressure on the full levels.

from YUSPECIF :

Vertical coordinate: type 2 (Gal-Chen hybrid) k Z(k) P0(k) 1 25000.0000 28.1726 2 23800.0000 33.9524 […..] 60 10.0000 998.8149 61 0.0000 1000.0000 Boundary for change from z to terrain-following: vcflat = 11430.0000 Half-level index where levels become flat: k = 15 Exponential profile with asymptotic isothermal stratosphere Values of the Reference Atmosphere: Pressure at Sea-Level: 1000.0000 Temperature at Sea-Level: 15.0000 Temp. diff. sea-level-stratosph.: 75.0000 Scale height for temp. decrease: 10000.0000from Output constant file (lffd2015123118c.nc)

vcoord:long_name = “Height-based hybrid Gal-Chen coordinate” ; vcoord:units = “Pa” ; vcoord:ivctype = 2 ; vcoord:irefatm = 2 ; vcoord:p0sl = 100000. ; vcoord:t0sl = 288.149993896484 ; vcoord:dt0lp = 42. ; vcoord:vcflat = 11430. ; vcoord:delta_t = 75. ; vcoord:h_scal = 10000. ;As I understand it, I need to compute the reference pressure for every grid point and then just add PP?

Step 1: H = ( HLL [:,:,1:60] + HLL [:,:,2:61] ) * 0.5 Step 2: P_ref = specialFunction(H) = “pressure in Height H“ Step 3: P = P_ref + PPI must compute the reference pressure on full levels right?

Is this so far correct?

nc = nc_open(file) vcoord = ncvar_get(nc,“vcoord”) p0sl = ncatt_get(nc,“vcoord”,“p0sl”)$value t0sl = ncatt_get(nc,“vcoord”,“t0sl”)$value dt0lp = ncatt_get(nc,“vcoord”,“dt0lp”)$value pref1 = p0sl * exp( -t0sl/dt0lp * (1-sqrt(1 – 2 * dt0lp * 9.81 * vcoord / 287.058 / t0sl^2) ) pref2 = p0sl * exp( -9.81 * vcoord / 287.058 / t0sl )In that case what is this “specialFunction”? (I know it is basically barometric height formula… but which version?)

I tried the formula from the COSMO Documentation (Part I: Dynamics and Numerics) page 28/29, equation (3.85)

p_0(z) = … for both cases beta = 0 and beta = 42

but if I test it with the values from YUSPECIF I get lower or higher values than there.

for 25000m

pref1 gives 13 hPa

pref2 gives 51 hPa

while YUSPECIF says 28 hPa

Any suggestions?

Rolf

P.S.: the attribute:units of the variable “vcoord” says “Pa” but its obviously(?) meter

edit: I attached the files

Hi Rolf,

I send you an excel table for the case of 40 levels, which was prepared by H-J and myself in order to analyse the inconsistencies between the grid definitions in COSMO . It shows all related quantities of the reference atmosphere and the same values as in YUSPECIF .

You may adapt it for 60 levels and compare the formula with yours. This should give the correct values.

I’m sorry, but I do not have the time at the moment to check it on my own.

Regards, Andreas

Rolf Zentek wrote:

> Hi,

>

> I have my 3d (+time = 4d) variable PP (deviation from reference pressure).

> Now I simple want to compute my pressure on the full levels.

>

> from YUSPECIF:

>

> Vertical coordinate: type 2 (Gal-Chen hybrid)

> k Z(k) P0(k)

> 1 25000.0000 28.1726

> 2 23800.0000 33.9524

> […..]

> 60 10.0000 998.8149

> 61 0.0000 1000.0000

> Boundary for change from z to terrain-following: vcflat = 11430.0000

> Half-level index where levels become flat: k = 15

> Exponential profile with asymptotic isothermal stratosphere

> Values of the Reference Atmosphere:

> Pressure at Sea-Level: 1000.0000

> Temperature at Sea-Level: 15.0000

> Temp. diff. sea-level-stratosph.: 75.0000

> Scale height for temp. decrease: 10000.0000

>

> from Output constant file (lffd2015123118c.nc)

>

> vcoord:long_name = “Height-based hybrid Gal-Chen coordinate” ;

> vcoord:units = “Pa” ;

> vcoord:ivctype = 2 ;

> vcoord:irefatm = 2 ;

> vcoord:p0sl = 100000. ;

> vcoord:t0sl = 288.149993896484 ;

> vcoord:dt0lp = 42. ;

> vcoord:vcflat = 11430. ;

> vcoord:delta_t = 75. ;

> vcoord:h_scal = 10000. ;

>

> As I understand it, I need to compute the reference pressure for every grid point and then just add PP?

> I must compute the reference pressure on full levels right?

>

> Step 1: H = ( HLL[:,:,1:60] + HLL[:,:,2:61] ) * 0.5

> Step 2: P_ref = specialFunction(H) = “pressure in Height H“

> Step 3: P = P_ref + PP

>

> Is this so far correct?

> In that case what is this “specialFunction”? (I know it is basically barometric height formula… but which version?)

> I tried the formula from the COSMO Documentation (Part I: Dynamics and Numerics) page 28/29, equation (3.85)

> p_0(z) = … for both cases beta = 0 and beta = 42

> but if I test it with the values from YUSPECIF I get lower or higher values than there.

>

> nc = nc_open(file)

> vcoord = ncvar_get(nc,“vcoord”)

> p0sl = ncatt_get(nc,“vcoord”,“p0sl”)$value

> t0sl = ncatt_get(nc,“vcoord”,“t0sl”)$value

> dt0lp = ncatt_get(nc,“vcoord”,“dt0lp”)$value

> pref1 = p0sl * exp( -t0sl/dt0lp * (1-sqrt(1 – 2 * dt0lp * 9.81 * vcoord / 287.058 / t0sl^2) )

> pref2 = p0sl * exp( -9.81 * vcoord / 287.058 / t0sl )

>

> for 25000m

> pref1 gives 13 hPa

> pref2 gives 51 hPa

> while YUSPECIF says 28 hPa

>

> Any suggestions?

> Rolf

>

> P.S.: the attribute:units of the variable “vcoord” says “Pa” but its obviously(?) meter

>

> edit: I attached the files

Hey Andreas,

I took the first sheet (ivctype_2_Ref_Atmos_alt)

and just changed the Value in B5 to 25000 resulting in 13 hPa for J5 (p0_HalfLevel) which uses the same formula as pref1 from my post.

But its unequal to the Value from YUSPECIF .

regards

Rolf

Hey,

does anyone know if

`vgrid_refatm_utils.f90`

is the right file to look at?The

`SUBROUTINE reference_atmosphere`

seems to include both formulas I cited from the documentation.The

`SUBROUTINE reference_atmosphere_2`

seems to include another formulas, which computes approximatly(*) the same values as my YUSPECIF .(*) I suppose due to different values of constants?!

Here in R-style:

Can anyone confirm, that for my configuration I need to use

`pref3`

? (or that indeed`reference_atmosphere_2`

was used)Rolf

update / solution:

For everyone having the same problem: my

INT2LM setting is`irefatm = 2`

From looking into the source code it seems to me that that:

`reference_atmosphere_2`

and thus`pref3`

is used because of my INT2LM setting`irefatm = 2`

I think the formula from the excel sheet and from the documentation are for the case

`irefatm = 1`

From the documentation I get the same as from the source code:

From the source code

`vgrid_refatm_utils.f90`

/`reference_atmosphere_2`

:which I interprete to be the equation

`pref3`

with`(hhl[,,1:60]+hhl[,,2:61])/2`

instead of`vcoord`

When I did the analytical integration of the hydrostatic equation myself I got a different formula than pref3, but they give the same values :D so in short:

My opionion: If`irefatm = 2`

then`p_reference(z) = p0sl * exp( -g*h_scal/ R/t00 * log( (exp(z/h_scal)*t00 + delta_t)/(t00 + delta_t)) )`

with the values from my earlier posts