# need information about the prsgrd.F pressure gradient routine

**URL:** <https://forum.croco-ocean.org/t/need-information-about-the-prsgrd-f-pressure-gradient-routine/304>\
**Category:** dynamics-numerics-params\
**Tags:** physics-params, dynamics-numerics\
**Created:** [August 17, 2021, 2:46pm UTC](https://forum.croco-ocean.org/t/need-information-about-the-prsgrd-f-pressure-gradient-routine/304 "2021-08-17T14:46:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonaljit](https://forum.croco-ocean.org/letter_avatar_proxy/v4/letter/s/3ec8ea/32.png) [@sonaljit](https://forum.croco-ocean.org/u/sonaljit)\
**Post date:** [August 17, 2021, 2:46pm UTC](https://forum.croco-ocean.org/t/need-information-about-the-prsgrd-f-pressure-gradient-routine/304/1 "2021-08-17T14:46:04Z")

</div>

Hi all.  
I have a specific question about the prsgrd.F routine in the CROCO code that computes the pressure gradients.

From line numbers 195 to 213, they are calculating the variable P(i,j,k). I wanted to know if P is the total pressure or only the baroclinic pressure? Also, is the dimension of P given as z_rho_g (depth_density_gravity) or only z\*g? I am copying the code from the prsgrd.F routine below.

194 do i=IstrU-1,Iend

195 P(i,j,N)=g_z\_w(i,j,N) + GRho_( rho(i,j,N)  
196 & +0.5\*(rho(i,j,N)-rho(i,j,N-1))_(z\_w(i,j,N)-z\_r(i,j,N))  
197 & /(z\_r(i,j,N)-z\_r(i,j,N-1)) )_(z\_w(i,j,N)-z\_r(i,j,N))  
198 # ifdef POT\_TIDES  
199 P(i,j,N) = P(i,j,N) - g_Ptide(i,j)  
200 # endif  
201 # ifdef READ\_PATM  
202 P(i,j,N) = P(i,j,N) + patm2d(i,j)/rho0  
203 # endif  
204 enddo  
205 do k=N-1,1,-1  
206 do i=IstrU-1,Iend  
207 P(i,j,k)=P(i,j,k+1)+HalfGRho_( (rho(i,j,k+1)+rho(i,j,k))  
208 & _(z\_r(i,j,k+1)-z\_r(i,j,k))  
209 & -OneFifth_( (dR(i,k+1)-dR(i,k))_( z\_r(i,j,k+1)-z\_r(i,j,k)  
210 & -OneTwelfth_(dZ(i,k+1)+dZ(i,k)) )  
211 & -(dZ(i,k+1)-dZ(i,k))_( rho(i,j,k+1)-rho(i,j,k)  
212 & -OneTwelfth_(dR(i,k+1)+dR(i,k)) )  
213 & ))

Thanks.  
Sonaljit.
