Skip to content

Transcribe of gaussj_g#48

Open
ChristopherBignamini wants to merge 219 commits into
brittonsmith:gen2024from
ChristopherBignamini:gen2024_transcribe_gaussj
Open

Transcribe of gaussj_g#48
ChristopherBignamini wants to merge 219 commits into
brittonsmith:gen2024from
ChristopherBignamini:gen2024_transcribe_gaussj

Conversation

@ChristopherBignamini

Copy link
Copy Markdown

C++ translation, without licensing issues, of the gaussj_g subroutine. Implementation is quite basic and while it passes Grackle test it could have numerical issues in case of bad conditioned matrices.

mabruzzo and others added 30 commits December 26, 2024 17:52
Unlike other cases where we replaced ``logical`` with ``MASK_TYPE``,
I replaced it with ``integer*8`` for the sake of consistency with the
grackle-project#160 PR (I plan to use the transcription of
interpolators_g.F from that PR in the future).
A handful of c functions had a `[-Wreturn-type]` compiler warning where
a function was supposed to return a value but had at least 1 control
flow branch where we didn't return anything.

Also fixed a spot in `c_local_example` where we were passing a
`chemistry_data**` ptr to `local_free_chemistry_data` rather than a
`chemistry_data*` ptr.
To aide with transcription to C/C++ I made the following tweaks to
`calc_grain_size_increment_1d.F`:
- Within `calc_grain_size_increment_1d`, I broke lines similar to
    `SN_i(nSN) =  1; SN_metal(:,nSN) = metal_loc(:,j,k)`
  into 2 separate lines.
  - Prior to this commit, there were essentially 2 statements on each
    of these lines (the statements are delimited by `;`)
  - The transcription routines can't currently handle cases like this
    (it assumes that there is only 1 statement on each line)
  - I made changes like this in 12 locations.
- I inserted `#include "grackle_fortran_types.def"` into
  `solve_cubic_equation` to declare the ``pi_val`` macro inside of the
  subroutine's parameter declarations.
  - This is a convention followed by nearly every subroutine
    declaration in Fortran and it simplifies the process of
    transcription.
  - A standard Fortran compiler does not technically require this change
    since the header is already included within the body of different
    subroutine earlier in the file and the macro definition carries over
    from there.
`make dep` previously didn't work correctly with some of the C++ files
(I think because I changed the suffix of the names of some headers)
This is the last commit in a sequence where we were refactoring the
local variable declarations. The routine should now work properly with
OpenMP, but we can't test that since OpenMP-support was broken in
earlier commits to the gen2024 branch (before we began the
transcription).

More simplifications can certainly be made, but it is worth holding off
on that until after we have transcribed more of Grackle.
this parallel clause is used when converting from comoving to proper
this parallel clause is used when converting from proper to comoving
Removed unused local variables from `calc_tdust_3d_g` that followed the
naming scheme used in solve_rate_cool for tracking the mass density for
the mass densities of various metal species used in dust chemistry.

There was logic to convert between proper and comoving units for each of
these variables, but they were not actually used for anything (which is
a good thing since they were never initialized).

These variable declarations were probably blindly copied from somewhere
else and were never removed.
Removed unused local variables from `calc_tdust_3d_g` that followed the
naming scheme used in solve_rate_cool for tracking the mass density for
tracking the mass densities of various metal species used in metal
chemistry.

There was logic to convert between proper and comoving units for each of
these variables, but they were not actually used for anything (which is
a good thing since they were never initialized).

These variable declarations were probably blindly copied from somewhere
else and were never removed.
mabruzzo and others added 28 commits February 21, 2025 10:28
The main goal is to construct an instance of `InternalGrUnits` that will
be passed into `calc_tdust_3d_g`, once it is transcribed.
`local_calculate_cooling_time`, `local_calculate_temperature`, and
`local_solve_chemistry` similarly pass instances of `InternalGrUnits`
into functions that have already been transcribed from Fortran.

When I added `#include "internal_units.h"`, I decided to also replace 2
existing include directives with `#include "grackle.h"`
- this is a convention I have been moving us towards (it lets us avoid
  multiple copies of some function declarations and we will be moving
  the replaced headers in future releases)
- I removed all the declarations now made redundant by "grackle.h"

I also removed both `#include "phys_constants.h"` and `#include <omp.h>`
since they are entirely unnecessary (as far as I can tell, they have
never, ever been used!)
I essentially started to use ``grackle_index_helper`` & ``idx_range``:
- I localized declarations of variables that are provided by these types
- loops over ``i`` now access bounds from ``idx_range.i_start`` and
  ``idx_range.i_stop``
As per usual, we aggregate all of the scratch buffers for temporarily
storing grain temperatures within a `GrainSpeciesCollection` type.

The first 3 parts of this commit were manual:
- I removed the declarations of tSiM, tFeM, ... tH2Oice vectors
- I inserted the declaration/allocation of the grain_temperatures
  scratch buffer collection
- I called the function to free the memory associated with
  grain_temperatures

The 4th and final part of this commit was accomplished with the commnd:

```
$ sed -f cleanup_tgrain.sed -i \.backup calc_tdust_3d.C
```

This command replaced ``calc_tdust_3d.C`` and stored a backup at
``calc_tdust_3d.C.backup``.

The command made use of the ``cleanup_tgrain.sed`` script that
contained a bunch of sed commands. The contents of this file are shown
down below:

```
s/tSiM\.data()/grain_temperatures\.data[OnlyGrainSpLUT::SiM_dust]/g
s/tFeM\.data()/grain_temperatures\.data[OnlyGrainSpLUT::FeM_dust]/g
s/tMg2SiO4\.data()/grain_temperatures.data[OnlyGrainSpLUT::Mg2SiO4_dust]/g
s/tMgSiO3\.data()/grain_temperatures.data[OnlyGrainSpLUT::MgSiO3_dust]/g
s/tFe3O4\.data()/grain_temperatures.data[OnlyGrainSpLUT::Fe3O4_dust]/g
s/tAC\.data()/grain_temperatures.data[OnlyGrainSpLUT::AC_dust]/g
s/tSiO2D\.data()/grain_temperatures.data[OnlyGrainSpLUT::SiO2_dust]/g
s/tMgO\.data()/grain_temperatures.data[OnlyGrainSpLUT::MgO_dust]/g
s/tFeS\.data()/grain_temperatures.data[OnlyGrainSpLUT::FeS_dust]/g
s/tAl2O3\.data()/grain_temperatures.data[OnlyGrainSpLUT::Al2O3_dust]/g
s/treforg\.data()/grain_temperatures.data[OnlyGrainSpLUT::ref_org_dust]/g
s/tvolorg\.data()/grain_temperatures.data[OnlyGrainSpLUT::vol_org_dust]/g
s/tH2Oice\.data()/grain_temperatures.data[OnlyGrainSpLUT::H2O_ice_dust]/g

s/tSiM[[:space:]]*\[/grain_temperatures\.data[OnlyGrainSpLUT::SiM_dust][/g
s/tFeM[[:space:]]*\[/grain_temperatures\.data[OnlyGrainSpLUT::FeM_dust][/g
s/tMg2SiO4[[:space:]]*\[/grain_temperatures.data[OnlyGrainSpLUT::Mg2SiO4_dust][/g
s/tMgSiO3[[:space:]]*\[/grain_temperatures.data[OnlyGrainSpLUT::MgSiO3_dust][/g
s/tFe3O4[[:space:]]*\[/grain_temperatures.data[OnlyGrainSpLUT::Fe3O4_dust][/g
s/tAC[[:space:]]*\[/grain_temperatures.data[OnlyGrainSpLUT::AC_dust][/g
s/tSiO2D[[:space:]]*\[/grain_temperatures.data[OnlyGrainSpLUT::SiO2_dust][/g
s/tMgO[[:space:]]*\[/grain_temperatures.data[OnlyGrainSpLUT::MgO_dust][/g
s/tFeS[[:space:]]*\[/grain_temperatures.data[OnlyGrainSpLUT::FeS_dust][/g
s/tAl2O3[[:space:]]*\[/grain_temperatures.data[OnlyGrainSpLUT::Al2O3_dust][/g
s/treforg[[:space:]]*\[/grain_temperatures.data[OnlyGrainSpLUT::ref_org_dust][/g
s/tvolorg[[:space:]]*\[/grain_temperatures.data[OnlyGrainSpLUT::vol_org_dust][/g
s/tH2Oice[[:space:]]*\[/grain_temperatures.data[OnlyGrainSpLUT::H2O_ice_dust][/g
```
We aggregate all of the scratch buffers for temporarily storing the
"geometric cross section per unit gas mass" within as members of the
`InternalDustPropBuf` type. Most of these buffers are stored within a
member of type `GrainSpeciesCollection` called
`grain_sigma_per_gas_mass`.

The first 4 parts of this commit were manual:
- I removed the declarations of sgSiM, sgFeM, ... sgH2Oice vectors
- I inserted the declaration/allocation of the internal_dust_prop_buf.grain_sigma_per_gas_mass
  scratch buffer collection
- I called the function to free the memory associated with
  internal_dust_prop_buf.grain_sigma_per_gas_mass
- I moved the `sgtot` buffer into `InternalDustPropBuf` and renamed it
  so that it is now the `sigma_per_gas_mass_tot` member

The 5th and final part of this commit was accomplished with the commnd:

```
$ sed -f cleanup_sggrain.sed -i \.backup calc_tdust_3d.C
```

This command replaced ``calc_tdust_3d.C`` and stored a backup at
``calc_tdust_3d.C.backup``.

The command made use of the ``cleanup_sggrain.sed`` script that
contained a bunch of sed commands. The contents of this file are shown
down below:

```
s/sgSiM\.data()/internal_dust_prop_buf.grain_sigma_per_gas_mass\.data[OnlyGrainSpLUT::SiM_dust]/g
s/sgFeM\.data()/internal_dust_prop_buf.grain_sigma_per_gas_mass\.data[OnlyGrainSpLUT::FeM_dust]/g
s/sgMg2SiO4\.data()/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::Mg2SiO4_dust]/g
s/sgMgSiO3\.data()/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::MgSiO3_dust]/g
s/sgFe3O4\.data()/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::Fe3O4_dust]/g
s/sgAC\.data()/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::AC_dust]/g
s/sgSiO2D\.data()/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::SiO2_dust]/g
s/sgMgO\.data()/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::MgO_dust]/g
s/sgFeS\.data()/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::FeS_dust]/g
s/sgAl2O3\.data()/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::Al2O3_dust]/g
s/sgreforg\.data()/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::ref_org_dust]/g
s/sgvolorg\.data()/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::vol_org_dust]/g
s/sgH2Oice\.data()/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::H2O_ice_dust]/g
s/sgtot\.data()/internal_dust_prop_buf.sigma_per_gas_mass_tot/g

s/sgSiM[[:space:]]*\[/internal_dust_prop_buf.grain_sigma_per_gas_mass\.data[OnlyGrainSpLUT::SiM_dust][/g
s/sgFeM[[:space:]]*\[/internal_dust_prop_buf.grain_sigma_per_gas_mass\.data[OnlyGrainSpLUT::FeM_dust][/g
s/sgMg2SiO4[[:space:]]*\[/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::Mg2SiO4_dust][/g
s/sgMgSiO3[[:space:]]*\[/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::MgSiO3_dust][/g
s/sgFe3O4[[:space:]]*\[/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::Fe3O4_dust][/g
s/sgAC[[:space:]]*\[/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::AC_dust][/g
s/sgSiO2D[[:space:]]*\[/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::SiO2_dust][/g
s/sgMgO[[:space:]]*\[/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::MgO_dust][/g
s/sgFeS[[:space:]]*\[/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::FeS_dust][/g
s/sgAl2O3[[:space:]]*\[/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::Al2O3_dust][/g
s/sgreforg[[:space:]]*\[/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::ref_org_dust][/g
s/sgvolorg[[:space:]]*\[/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::vol_org_dust][/g
s/sgH2Oice[[:space:]]*\[/internal_dust_prop_buf.grain_sigma_per_gas_mass.data[OnlyGrainSpLUT::H2O_ice_dust][/g
s/sgtot[[:space:]]*\[/internal_dust_prop_buf.sigma_per_gas_mass_tot[/g
```
We aggregate all of the scratch buffers for storing dynamically computed tables of opacity coefficients at each zone for an IndexRange within members of the `InternalDustPropBuf` type.

The buffers (previously called `alSiM`, `alFeM`, ..., `alH2Oice`) are stored within a member of type `GrainSpeciesCollection` called `internal_dust_prop_buf.grain_dyntab_kappa`. It's pretty obvious that this is a significant change in the naming convention. The documentation of the `InternalDustPropBuf` provides significant justification for this -- once you fully understand how the variables get used, it becomes clear that the old naming convention was VERY confusing. (we should maintain this documentation until dust-routines get transcribed!)

The first 4 parts of this commit were manual:
- I removed the declarations of `alSiM`, `alFeM`, ..., `alH2Oice` vectors
- I inserted the declaration/allocation of the `internal_dust_prop_buf.grain_dyntab_kappa`
  scratch buffer collection
- I called the function to free the memory associated with
  `internal_dust_prop_buf.grain_dyntab_kappa`
- I moved the `altot` buffer into `InternalDustPropBuf` and renamed it so that it is now the `dyntab_kappa_tot` member

The 5th and final part of this commit was accomplished with the command:

```
$ sed -f cleanup_algrain.sed -i \.backup calc_tdust_3d.C
```

This command replaced ``calc_tdust_3d.C`` and stored a backup at
``calc_tdust_3d.C.backup``.

The command made use of the ``cleanup_algrain.sed`` script that
contained a bunch of sed commands. The contents of this file are shown
down below:

```
s/alSiM\.data()/internal_dust_prop_buf.grain_dyntab_kappa\.data[OnlyGrainSpLUT::SiM_dust]/g
s/alFeM\.data()/internal_dust_prop_buf.grain_dyntab_kappa\.data[OnlyGrainSpLUT::FeM_dust]/g
s/alMg2SiO4\.data()/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::Mg2SiO4_dust]/g
s/alMgSiO3\.data()/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::MgSiO3_dust]/g
s/alFe3O4\.data()/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::Fe3O4_dust]/g
s/alAC\.data()/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::AC_dust]/g
s/alSiO2D\.data()/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::SiO2_dust]/g
s/alMgO\.data()/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::MgO_dust]/g
s/alFeS\.data()/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::FeS_dust]/g
s/alAl2O3\.data()/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::Al2O3_dust]/g
s/alreforg\.data()/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::ref_org_dust]/g
s/alvolorg\.data()/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::vol_org_dust]/g
s/alH2Oice\.data()/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::H2O_ice_dust]/g
s/altot\.data()/internal_dust_prop_buf.dyntab_kappa_tot/g

s/alSiM[[:space:]]*\[/internal_dust_prop_buf.grain_dyntab_kappa\.data[OnlyGrainSpLUT::SiM_dust][/g
s/alFeM[[:space:]]*\[/internal_dust_prop_buf.grain_dyntab_kappa\.data[OnlyGrainSpLUT::FeM_dust][/g
s/alMg2SiO4[[:space:]]*\[/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::Mg2SiO4_dust][/g
s/alMgSiO3[[:space:]]*\[/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::MgSiO3_dust][/g
s/alFe3O4[[:space:]]*\[/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::Fe3O4_dust][/g
s/alAC[[:space:]]*\[/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::AC_dust][/g
s/alSiO2D[[:space:]]*\[/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::SiO2_dust][/g
s/alMgO[[:space:]]*\[/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::MgO_dust][/g
s/alFeS[[:space:]]*\[/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::FeS_dust][/g
s/alAl2O3[[:space:]]*\[/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::Al2O3_dust][/g
s/alreforg[[:space:]]*\[/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::ref_org_dust][/g
s/alvolorg[[:space:]]*\[/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::vol_org_dust][/g
s/alH2Oice[[:space:]]*\[/internal_dust_prop_buf.grain_dyntab_kappa.data[OnlyGrainSpLUT::H2O_ice_dust][/g
s/altot[[:space:]]*\[/internal_dust_prop_buf.dyntab_kappa_tot/g
```
As is a common convention, we aggregate all of the scratch buffers for temporarily storing grain-related quantity within a `GrainSpeciesCollection` type. In this case we are aggregating buffers used to hold the opacity coefficient

The first 3 parts of this commit were manual:
- I removed the declarations of `kpSiM`, `kpFeM`, ..., `kpH2Oice` vectors
- I inserted the declaration/allocation of the `grain_kappa`
  scratch buffer collection
- I called the function to free the memory associated with
  grain_kappa

The 4th and final part of this commit was accomplished with the commnd:

```
$ sed -f cleanup_kpgrain.sed -i \.backup calc_tdust_3d.C
```

This command replaced ``calc_tdust_3d.C`` and stored a backup at
``calc_tdust_3d.C.backup``.

The command made use of the ``cleanup_kpgrain.sed`` script that
contained a bunch of sed commands. The contents of this file are shown
down below:

```
s/kpSiM\.data()/grain_kappa\.data[OnlyGrainSpLUT::SiM_dust]/g
s/kpFeM\.data()/grain_kappa\.data[OnlyGrainSpLUT::FeM_dust]/g
s/kpMg2SiO4\.data()/grain_kappa.data[OnlyGrainSpLUT::Mg2SiO4_dust]/g
s/kpMgSiO3\.data()/grain_kappa.data[OnlyGrainSpLUT::MgSiO3_dust]/g
s/kpFe3O4\.data()/grain_kappa.data[OnlyGrainSpLUT::Fe3O4_dust]/g
s/kpAC\.data()/grain_kappa.data[OnlyGrainSpLUT::AC_dust]/g
s/kpSiO2D\.data()/grain_kappa.data[OnlyGrainSpLUT::SiO2_dust]/g
s/kpMgO\.data()/grain_kappa.data[OnlyGrainSpLUT::MgO_dust]/g
s/kpFeS\.data()/grain_kappa.data[OnlyGrainSpLUT::FeS_dust]/g
s/kpAl2O3\.data()/grain_kappa.data[OnlyGrainSpLUT::Al2O3_dust]/g
s/kpreforg\.data()/grain_kappa.data[OnlyGrainSpLUT::ref_org_dust]/g
s/kpvolorg\.data()/grain_kappa.data[OnlyGrainSpLUT::vol_org_dust]/g
s/kpH2Oice\.data()/grain_kappa.data[OnlyGrainSpLUT::H2O_ice_dust]/g
s/kptot\.data()/kappa_tot\.data()/g

s/kpSiM[[:space:]]*\[/grain_kappa\.data[OnlyGrainSpLUT::SiM_dust][/g
s/kpFeM[[:space:]]*\[/grain_kappa\.data[OnlyGrainSpLUT::FeM_dust][/g
s/kpMg2SiO4[[:space:]]*\[/grain_kappa.data[OnlyGrainSpLUT::Mg2SiO4_dust][/g
s/kpMgSiO3[[:space:]]*\[/grain_kappa.data[OnlyGrainSpLUT::MgSiO3_dust][/g
s/kpFe3O4[[:space:]]*\[/grain_kappa.data[OnlyGrainSpLUT::Fe3O4_dust][/g
s/kpAC[[:space:]]*\[/grain_kappa.data[OnlyGrainSpLUT::AC_dust][/g
s/kpSiO2D[[:space:]]*\[/grain_kappa.data[OnlyGrainSpLUT::SiO2_dust][/g
s/kpMgO[[:space:]]*\[/grain_kappa.data[OnlyGrainSpLUT::MgO_dust][/g
s/kpFeS[[:space:]]*\[/grain_kappa.data[OnlyGrainSpLUT::FeS_dust][/g
s/kpAl2O3[[:space:]]*\[/grain_kappa.data[OnlyGrainSpLUT::Al2O3_dust][/g
s/kpreforg[[:space:]]*\[/grain_kappa.data[OnlyGrainSpLUT::ref_org_dust][/g
s/kpvolorg[[:space:]]*\[/grain_kappa.data[OnlyGrainSpLUT::vol_org_dust][/g
s/kpH2Oice[[:space:]]*\[/grain_kappa.data[OnlyGrainSpLUT::H2O_ice_dust][/g
s/kptot[[:space:]]*\[/kappa_tot[/g
```
As is a common convention, we aggregate all of the scratch buffers for temporarily storing grain-related quantity within a `GrainSpeciesCollection` type. In this case we are aggregating buffers used to hold the gas/grain-species heat transfer rate

The first 3 parts of this commit were manual:
- I removed the declarations of `gasSiM`, `gasFeM`, ... `gasH2Oice` vectors
- I inserted the declaration/allocation of the `gas_grainsp_heatrate`
  scratch buffer collection
- I called the function to free the memory associated with
  `gas_grainsp_heatrate`

The 4th and final part of this commit was accomplished with the commnd:

```
$ sed -f cleanup_gasgrain.sed -i \.backup calc_tdust_3d.C
```

This command replaced ``calc_tdust_3d.C`` and stored a backup at
``calc_tdust_3d.C.backup``.

The command made use of the ``cleanup_kpgrain.sed`` script that
contained a bunch of sed commands. The contents of this file are shown
down below:

```
s/gasSiM\.data()/gas_grainsp_heatrate\.data[OnlyGrainSpLUT::SiM_dust]/g
s/gasFeM\.data()/gas_grainsp_heatrate\.data[OnlyGrainSpLUT::FeM_dust]/g
s/gasMg2SiO4\.data()/gas_grainsp_heatrate.data[OnlyGrainSpLUT::Mg2SiO4_dust]/g
s/gasMgSiO3\.data()/gas_grainsp_heatrate.data[OnlyGrainSpLUT::MgSiO3_dust]/g
s/gasFe3O4\.data()/gas_grainsp_heatrate.data[OnlyGrainSpLUT::Fe3O4_dust]/g
s/gasAC\.data()/gas_grainsp_heatrate.data[OnlyGrainSpLUT::AC_dust]/g
s/gasSiO2D\.data()/gas_grainsp_heatrate.data[OnlyGrainSpLUT::SiO2_dust]/g
s/gasMgO\.data()/gas_grainsp_heatrate.data[OnlyGrainSpLUT::MgO_dust]/g
s/gasFeS\.data()/gas_grainsp_heatrate.data[OnlyGrainSpLUT::FeS_dust]/g
s/gasAl2O3\.data()/gas_grainsp_heatrate.data[OnlyGrainSpLUT::Al2O3_dust]/g
s/gasreforg\.data()/gas_grainsp_heatrate.data[OnlyGrainSpLUT::ref_org_dust]/g
s/gasvolorg\.data()/gas_grainsp_heatrate.data[OnlyGrainSpLUT::vol_org_dust]/g
s/gasH2Oice\.data()/gas_grainsp_heatrate.data[OnlyGrainSpLUT::H2O_ice_dust]/g

s/gasSiM[[:space:]]*\[/gas_grainsp_heatrate\.data[OnlyGrainSpLUT::SiM_dust][/g
s/gasFeM[[:space:]]*\[/gas_grainsp_heatrate\.data[OnlyGrainSpLUT::FeM_dust][/g
s/gasMg2SiO4[[:space:]]*\[/gas_grainsp_heatrate.data[OnlyGrainSpLUT::Mg2SiO4_dust][/g
s/gasMgSiO3[[:space:]]*\[/gas_grainsp_heatrate.data[OnlyGrainSpLUT::MgSiO3_dust][/g
s/gasFe3O4[[:space:]]*\[/gas_grainsp_heatrate.data[OnlyGrainSpLUT::Fe3O4_dust][/g
s/gasAC[[:space:]]*\[/gas_grainsp_heatrate.data[OnlyGrainSpLUT::AC_dust][/g
s/gasSiO2D[[:space:]]*\[/gas_grainsp_heatrate.data[OnlyGrainSpLUT::SiO2_dust][/g
s/gasMgO[[:space:]]*\[/gas_grainsp_heatrate.data[OnlyGrainSpLUT::MgO_dust][/g
s/gasFeS[[:space:]]*\[/gas_grainsp_heatrate.data[OnlyGrainSpLUT::FeS_dust][/g
s/gasAl2O3[[:space:]]*\[/gas_grainsp_heatrate.data[OnlyGrainSpLUT::Al2O3_dust][/g
s/gasreforg[[:space:]]*\[/gas_grainsp_heatrate.data[OnlyGrainSpLUT::ref_org_dust][/g
s/gasvolorg[[:space:]]*\[/gas_grainsp_heatrate.data[OnlyGrainSpLUT::vol_org_dust][/g
s/gasH2Oice[[:space:]]*\[/gas_grainsp_heatrate.data[OnlyGrainSpLUT::H2O_ice_dust][/g
```
@ChristopherBignamini

Copy link
Copy Markdown
Author

Moved to the main grackle repo as PR for the newchem_cpp branch:
#48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants