avbp2prissma.f [SRC] [CPP] [JOB] [SCAN]
TOOLS / AVBP2PRISSMA



   1 |       program avbp2prissma
   2 | 
   3 | *     ===============================================================
   4 | *     Copyright (c) CERFACS (all rights reserved)
   5 | *     ===============================================================
   6 | 
   7 | c ******************************************************************
   8 | c *
   9 | c *     Extract a solution from AVBP to initialisze PRISSMA 
  10 | c *
  11 | c *     author: D. Poitoui (april 2010)
  12 | c *
  13 | c ******************************************************************
  14 | 
  15 |         use avbp_solution
  16 |         use avbp_mesh
  17 |         use avbp_coor
  18 |         use avbp_ms
  19 |         use avbp_ifp
  20 |         use avbp_premix
  21 |         use avbp_species
  22 | 
  23 |         implicit none
  24 | 
  25 |         integer          :: i, n
  26 |         character*80     :: namefile, path, propfile, kextfile 
  27 |         double precision :: soot, kabs, kscat
  28 |         double precision, dimension(:,:), allocatable :: Xspec_dom
  29 | 
  30 | c       read choices file
  31 | 
  32 |         open(unit=1,file='avbp2prissma.choices',form='formatted')
  33 |         read(1,*) solutfile
  34 |         read(1,*) meshfile
  35 |         read(1,*) premixfile
  36 |         read(1,*) speciesfile
  37 |         read(1,*) ifpfile
  38 |         read(1,*) path
  39 |         close(1)
  40 | 
  41 |         propfile   = path(1:len_trim(path))//'/Properties.txt'
  42 |         kextfile   = path(1:len_trim(path))//'/K_Extinction.txt'
  43 | 
  44 | c       read data from AVBP files
  45 | 
  46 |         call readcoor
  47 |  
  48 |         call readsolution
  49 | 
  50 |         call readspecies
  51 |         call createmsmemory
  52 |         call ms_convert_chem
  53 |         call ms_compute_variables
  54 | 
  55 | c       convert mass fractions into molar fractions
  56 | 
  57 |         allocate(Xspec_dom(1:5,1:sol_nnode)) 
  58 | c       print*
  59 | c       print*, "Warning : input_species.dat must be ordered like"
  60 | c       print*, "input_premix.dat"
  61 | c       print*
  62 |         Xspec_dom = 0. 
  63 |  
  64 |         do i=1,sol_neqs
  65 |           select case (trim(premix_species(i)))
  66 |             case ('H2O')
  67 |               n = 1
  68 |             case ('CO2')
  69 |               n = 2
  70 |             case ('CO')
  71 |               n = 3
  72 |             case ('O2')
  73 |               n = 4
  74 |             case ('N2')
  75 |               n = 5
  76 |             case default
  77 |               n = 0
  78 |           end select
  79 | 
  80 |           if (n.ne.0) then
  81 |             Xspec_dom(n,:) = (ms_Yspec(i,:)*ms_Wmean(:))/ms_mol_mass(i)
  82 | !           print*, ms_Yspec(i,1)
  83 | !           print*, ms_Wmean(1)
  84 | !           print*, ms_mol_mass(i)
  85 | !           print*, Xspec_dom(n,1)
  86 |             print*, trim(premix_species(i)),n,'Max =',                  &
  87 |      &              maxval(Xspec_dom(n,:))
  88 |           endif
  89 | 
  90 |         enddo
  91 | 
  92 | !       print*, coor(:,coor_nnode), ":", ms_Yspec(:,coor_nnode)
  93 | 
  94 |         open(unit=2,file=propfile,form='formatted')
  95 |         open(unit=3,file=kextfile,form='formatted')
  96 | 
  97 |           do n=1, coor_nnode
  98 | 
  99 | !           soot = ms_tempe(n)/maxval(ms_tempe)
 100 |             soot  = 0.d0
 101 |             kabs  = 0.d0
 102 |             kscat = 0.d0
 103 |  
 104 |             ms_press(n) = ms_press(n) / 101325.
 105 | 
 106 |             write(2,*) n,ms_tempe(n),ms_press(n),                       &
 107 |      &                  (Xspec_dom(i,n),i=1,5), soot
 108 | 
 109 |             write(3,*) n, kabs, kscat
 110 | 
 111 |           enddo
 112 | 
 113 |         close(2)
 114 |         close(3)
 115 |         call destroymsmemory
 116 | 
 117 |       end
 118 | 
 119 | 


avbp2prissma.f could be called by:
avbp2prissma.f [TOOLS/AVBP2PRISSMA] - 1
avbp2prissma [TOOLS/SCRIPTS] - 22 - 26 - 28