Personal tools
You are here: Home Data and software SE library release README.sewrite.f
Document Actions

README.sewrite.f

More comments on how to write SE files from fortran stellar evolution codes.

Click here to get the file

Size 4.1 kB - File type text/x-fortran

File contents

In the following the routines sewritefhead and sewritecycle are provided by sewrite.f which makes calls to se library routines. In order to compile you have to add these libraries into your build system. For that add
-I/astro/fherwig/opt/se/include -L/astro/fherwig/opt/se/lib -Wl,-rpath=/astro/fherwig/opt/se/lib -lse
to your compile statement.

1. write the header

content of se.input:
&sehead
        codev='helix.phys.uvic.ca:/astro/fherwig/ARTUR/CODE/EVOL/081003o/evol-o2.exe'
        modname='Set1.1-E0147D1'
        prefix='M5.00Z0.010'
/

   prefix name HAS to be 11 chars long


put this in your fortran code to write the header information:
C *** read se parameters:                                                                    
      open(334,file='se.input')
      read(334,NML=sehead)
      close(334)
      if (len_trim(prefix).ne.11) then
         stop 'prefix in se.input must be 11 char long'
      endif
C *** write in USEEPP format                                                                 
      write(C7MOD,'(I7.7)')MODELL
      prefix=prefix(1:len_trim(prefix))//'.'//C7MOD//'.se.h5'
      call FSE_OPEN(prefix(1:len_trim(prefix)),FID1)
C *** more header information for USEEPP output                                              
      mini             =GMSN
      zini             =Z
      rotini           =0.
      overini          = fvexp
      mass_unit        =1.9891d33
      radius_unit      =1.d0
      rho_unit         =1.d0
      temperature_unit =1.d0
      pressure_unit    =1.d0
      velocity_unit    =1.d0
      dcoeff_unit      =1.d0
C *** ID array for control abundances                                                        
      XDYPS(1,1)=znetw(IPROT)
      XDYPS(1,2)=znetw(IHE4)
      XDYPS(1,3)=znetw(IC12)
      XDYPS(1,4)=znetw(IO16)
      XDYPS(2,1)=anetw(IPROT)
      XDYPS(2,2)=anetw(IHE4)
      XDYPS(2,3)=anetw(IC12)
      XDYPS(2,4)=anetw(IO16)
      XDYPS(3,1)=0.
      XDYPS(3,2)=0.
      XDYPS(3,3)=0.
      XDYPS(3,4)=0.

      call sewritefhead(fid1,modell,nzmod,codev,modname,mini,zini,rotini
     $     ,overini,alphav,oneyear,mass_unit,radius_unit,rho_unit
     $     ,temperature_unit,dcoeff_unit,xdyps,nyps)
      call FSE_CLOSE(FID1)


2. write each cycle"
header information:
C *** SE output cycle attribute                                                              
      call FSE_OPEN(prefix(1:len_trim(prefix)),FID1)
      call FSE_WRITE_DATTR(FID1, MODELL, "logL", H1)
      call FSE_WRITE_DATTR(FID1, MODELL, "logTeff", H2)
      call FSE_WRITE_DATTR(FID1, MODELL, "logg", H3)
      call FSE_WRITE_DATTR(FID1, MODELL, "R_sol", H4)
      call FSE_WRITE_DATTR(FID1, MODELL, "M_H", RMHYD)
      call FSE_WRITE_DATTR(FID1, MODELL, "M_He", RMHE)
      call FSE_WRITE_DATTR(FID1, MODELL, "M_convcore", RMCC)        
      call FSE_WRITE_DATTR(FID1, MODELL, "M_epsH", xm2)
      call FSE_WRITE_DATTR(FID1, MODELL, "M_epsHe", xm2y)
      call FSE_WRITE_DATTR(FID1, MODELL, "epsH", epsma)
      call FSE_WRITE_DATTR(FID1, MODELL, "epsHe", epsmay)
      call FSE_WRITE_DATTR(FID1, MODELL, "L_H", HL)
      call FSE_WRITE_DATTR(FID1, MODELL, "L_He", HEL)
      call FSE_WRITE_DATTR(FID1, MODELL, "L_C", CL)
      call FSE_WRITE_DATTR(FID1, MODELL, "L_grav", GL)
      call FSE_WRITE_DATTR(FID1, MODELL, "L_neutrino", ENL)
      call FSE_WRITE_DATTR(FID1, MODELL, "mass_of_H", XMH)
      call FSE_WRITE_DATTR(FID1, MODELL, "mass_of_He", XMHE)
      call FSE_WRITE_DATTR(FID1, MODELL, "XH_central", X(M))
      call FSE_WRITE_DATTR(FID1, MODELL, "XHe_central", Y(M))
      call FSE_WRITE_DATTR(FID1, MODELL, "XC12_central", XC(M))
      call FSE_WRITE_DATTR(FID1, MODELL, "XO16_central", XO(M))
      call FSE_WRITE_DATTR(FID1, MODELL, "T_central", TZENTR)
      call FSE_WRITE_DATTR(FID1, MODELL, "logRho_central", RHOZEN)
      call FSE_CLOSE(FID1)




C *** write data in                                                                          
      xmm =  (1.D0-DEXP(Q))*GMS
      rse    = 10**(R/UM)
      rhose  = DEXP(RO)
      tse    = DEXP(T)
      pse    = DEXP(P)
      isvthere=0
      vse = 0.
      call sewritecycle(FID1,modell,m,xmm,rse,rhose,tse, pse,vse
     $     ,isvthere,dmisch,konvekt,ypsevol,nyps,age,dzeit,gms)




Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: