﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
150	Changes of zzlay	abierjon		"Right now, zzlay is computed at the beginning of physics with the geopotential sent by the dynamics :

{{{
zzlay(ig,l)=pphi(ig,l)/g
}}}

Therefore, it neglects other factors, such as varying g with altitude and varying reduced gas constant with composition, which happen to be impactful at high altitudes (thermosphere).
It thus should be corrected to take these into account, as has been done in Venus physics in r2686, or is done in the utility program zrecast.F90.

Besides, it needs to be updated just like zplay,zplev and zzlev, after the call to co2condens :

{{{
! update surface pressure
DO ig=1,ngrid
  ps(ig) = zplev(ig,1) + pdpsrf(ig)*ptimestep
ENDDO
! update pressure levels
DO l=1,nlayer
 DO ig=1,ngrid
  zplay(ig,l) = aps(l) + bps(l)*ps(ig)
  zplev(ig,l) = ap(l)  + bp(l)*ps(ig)
 ENDDO
ENDDO
zplev(:,nlayer+1) = 0.
! update layers altitude
DO l=2,nlayer
  DO ig=1,ngrid
   z1=(zplay(ig,l-1)+zplev(ig,l))/(zplay(ig,l-1)-zplev(ig,l))
   z2=(zplev(ig,l)+zplay(ig,l))/(zplev(ig,l)-zplay(ig,l))
   zzlev(ig,l)=(z1*zzlay(ig,l-1)+z2*zzlay(ig,l))/(z1+z2)
  ENDDO
ENDDO
}}}
Right now, note that zzlev is thus badly computed as it uses a zzlay value that is not updated.

All of these changes will have an impact on the thermal structure of the thermosphere, which must be well assessed after commiting."	defect	closed	major		MARS GCM		fixed		
