c*********************************************************************** c mzescape_normaliz.f c*********************************************************************** c c program for correcting some strange values and for normalizing c the atmospheric escape functions computed by mzescape_15um.f c possibilities according to istyle (see mzescape_15um.f). c subroutine mzescape_normaliz ( taustar, istyle ) c dic 99 malv first version c jul 2011 malv+fgg Adapted to LMD-MGCM c*********************************************************************** implicit none include 'nltedefs.h' c arguments real*8 taustar(nl) ! o integer istyle ! i c local variables and constants integer i, imaximum real*8 maximum c*********************************************************************** ! ! correcting strange values at top, eliminating local maxima, etc... ! taustar(nl) = taustar(nl-1) if ( istyle .eq. 1 ) then imaximum = nl maximum = taustar(nl) do i=1,nl-1 if (taustar(i).gt.maximum) taustar(i) = taustar(nl) enddo elseif ( istyle .eq. 2 ) then imaximum = nl maximum = taustar(nl) do i=nl-1,1,-1 if (taustar(i).gt.maximum) then maximum = taustar(i) imaximum = i endif enddo do i=imaximum,nl if (taustar(i).lt.maximum) taustar(i) = maximum enddo endif ! ! normalizing ! do i=1,nl taustar(i) = taustar(i) / maximum enddo c end return end