subroutine kastprof_fn(tsurf,temp,play,plev) IMPLICIT NONE c creates a kasting temperature profile #include "dimensions.h" #include "dimphys.h" #include "comcstfi.h" REAL play(nlayermx) ! Pressure at the middle of the layers (Pa) REAL plev(nlayermx+1) ! intermediate pressure levels (pa) REAL psurf,tsurf REAL tcond (nlayermx) REAL temp(nlayermx) ! temperature at the middle of the layers real*8 Gamma, dz integer l ! dTdp = (-RT/gp)*Gamma ! ideal gas lapse rate Gamma = -5.0556 ! K / km ! 1st layer dz = (plev(1) - play(1)) * (R * tsurf / (g*play(1))) temp(1)=tsurf+dz*Gamma/1000 ! other layers DO l=2,nlayermx dz = (play(l-1) - play(l)) * (R * temp(l-1) / (g*play(l))) temp(l)=temp(l-1)+dz*Gamma/1000 ! convective lower troposphere ! FORMULE FANALE POUR 100% CO2 tcond(l)=(-3167.8)/(log(.01*play(l))-23.23) if (temp(l) .lt. tcond(l)) temp(l)= tcond(l) ! condensing upper troposphere if (temp(l) .lt. 167.) temp(l)= 167.0 ! isothermal stratosphere ENDDO return end