subroutine simpleprof_fn(tsurf,temp,popsk,ISR,psurf) ! creates a kasting temperature profile use radcommon_h, only: sigma implicit none #include "dimensions.h" #include "dimphys.h" #include "comcstfi.h" #include "callkeys.h" ! REAL play(nlayermx) ! Pressure at the middle of the layers (Pa) ! REAL plev(nlayermx+1) ! intermediate pressure levels (pa) REAL psurf,tsurf REAL temp(nlayermx) ! temperature at the middle of the layers real ISR, ALB real popsk(nlayermx) ! this is dodgy as in rest of code, zpopsk(ngridmx,nlayermx) ! but kastprof requires 1D, so its ok I guess integer l,iter if(startype.eq.1)then ALB=0.2+0.1*log10(psurf/100000.) else ALB=0.15 end if Tstrat=((1-ALB)*ISR/(2*sigma))**0.25 ! skin temperature (gray approx.) !Tstrat=60. ! minimum possible given H2-H2 CIA print*,'psurf',psurf/100000. print*,'ALB',ALB print*,'Tstrat=',Tstrat if(ngridmx.gt.1)then print*,'DO NOT RUN KASTPROF IN 3D!!!' call abort end if ! 1st, we make pot. temperature constant everywhere do l=1,nlayermx temp(l)=tsurf*popsk(l) enddo if(1.eq.1)then do l=1,nlayermx-1 if (temp(l) .le. Tstrat)then temp(l) = Tstrat endif enddo temp(nlayermx) = Tstrat endif return end subroutine simpleprof_fn