      subroutine set_scoord
      


      use Agrif_Util
#include "Param_BeforeCall_set_scoord.h"
      

        call Sub_Loop_set_scoord( Agrif_tabvars_r(36)%array0, Agrif_tabv
     &ars_r(35)%array0, Agrif_tabvars_i(176)%iarray0, Agrif_tabvars(2)%a
     &rray1, Agrif_tabvars(1)%array1, Agrif_tabvars(3)%array1, Agrif_tab
     &vars_r(24)%array0, Agrif_tabvars_r(23)%array0, Agrif_tabvars(4)%ar
     &ray1, Agrif_tabvars_r(25)%array0, Agrif_tabvars_r(26)%array0)

      end


#include "Sub_Loop_set_scoord.h"
      function CSF (sc, theta_s,theta_b)

      use Agrif_Types, only : Agrif_tabvars

      implicit none

#include "Param_BeforeCall_CSF.h"
      real :: sc
      real :: theta_s
      real :: theta_b
      real :: CSF
                   

                                         
      real :: csrf
      if (theta_s.gt.0.D0) then
        csrf=(1.D0-cosh(theta_s*sc))/(cosh(theta_s)-1.D0)
      else
        csrf=-sc**2
      endif
      if (theta_b.gt.0.D0) then
        CSF=(exp(theta_b*csrf)-1.D0)/(1.D0-exp(-theta_b))
      else
        CSF=csrf
      endif
      return
      end
