Skip to content

Armadillo#31

Merged
aaronjridley merged 33 commits intodevelopfrom
armadillo
Feb 3, 2021
Merged

Armadillo#31
aaronjridley merged 33 commits intodevelopfrom
armadillo

Conversation

@aaronjridley
Copy link
Contributor

@aaronjridley aaronjridley commented Jan 6, 2021

Description

Addresses #29 (at least partially, issue linked by @aburrell )

This brings in the changes of the code to go from 1d c-native arrays covering all three dimensions (with loops and look ups) to 3d armadillo arrays, which can be addressed directly (i, j, k) or through loop-less array math.

Type of change

  • New feature (non-breaking change that adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Yes, when you compare a 30 minute simulation with the c-native arrays and the armadillo arrays, they are very similar to each other, providing both thermospheric heating and ionization in the right places with the right magnitudes.

Test configuration

  • OSX
  • gcc version 9.3.0
  • Need armadillo and netcdf libraries installed

Checklist:

  • Make sure you are merging into the develop (not master) branch
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • [Sort of] I have commented my code, particularly in hard-to-understand areas
  • [Need to do more] I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • [Sort of] I have added tests that prove my fix is effective or that my feature works
  • [Need to make more unit tests] New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • [N/A] Add a note to CHANGELOG.md, summarizing the changes

Copy link
Contributor

@aburrell aburrell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments, mostly on areas I'd like more comments :P. It'd probably be a good idea to run the files through a linter, too. I've never linted C/C++ code so any of my style suggestions are suspect. I made a few anyway, though, based on the dominant style of the current code.

@aburrell aburrell mentioned this pull request Jan 11, 2021
3 tasks
Copy link
Contributor

@aburrell aburrell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found one small thing and made a suggestion. You can commit that suggestion directly, or edit it and commit it.

I am going to try and run this branch locally to ensure it runs on more than just your computer before approving. May be asking for help :P

const float avogadros_number = 6.02214086e23; //
const float boltzmanns_constant = 1.38064852e-23; // m2 kg /s2 /K
const float mass_proton = 1.6726219e-27; // kg
const float avogadros_number = 6.02214086e23; //
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const float avogadros_number = 6.02214086e23; //
const float avogadros_number = 6.02214086e23; // per mole

@aburrell
Copy link
Contributor

Ok, I tried to compile the code and ran into a BUNCH of errors. If the code is not supposed to compile yet, I am ok approving. Otherwise, I can show you the errors.

@aaronjridley
Copy link
Contributor Author

Ok. This is somewhat weird. I branched off of this branch to make the "indices" branch, and noticed a bunch of complication issues also. I wasn't sure if git got confused or whether I didn't commit things (or did commit things and didn't push them). So, I guess I should (a) check out the armadillo branch, (b) see if I can compile the code, (c) if I can/can't, fix the code, and commit changes, and (d) push the changes back to git hub. Right??????

@aburrell
Copy link
Contributor

Ok @aaronjridley I have been working on this with @Ionospheres and neither of us can get a working executable on the main branch. I am stuck with a compilation error and @Ionospheres fails in a more sinister fashion. So. I think we should perhaps get together and sort this out before changing more code.

@aaronjridley
Copy link
Contributor Author

Ok, if I clone the repository and then checkout the armadillo branch then try to compile, is there where you all are stuck?
git clone https://github.com/AetherModel/Aether
cd Aether
git checkout armadillo
make
right???

@aaronjridley
Copy link
Contributor Author

When I do this, it definitely doesn't compile. Weird. I must have screwed up somewhere. I will fix, then commit and push. Then let you know when I finish this up. Sorry.

@aaronjridley
Copy link
Contributor Author

Ok, the code should compile and run now. I had found all of these bugs in the "indices" branch. Oops. This must have been a mix-up in the commits and pushes and making new branches and stuff. I probably didn't push these or commit them or something and they got overwritten or something. But, it all works.

@aburrell
Copy link
Contributor

I am having issues with netCDF/g++ so @aaronjridley I would recommend asking for a review from someone else. That way we can get this merged in whilst I continue to fix my setup.

@aburrell aburrell requested a review from Ionospheres January 28, 2021 18:16
// Copyright 2020, the Aether Development Team (see doc/dev_team.md for members)
// Full license can be found in License.md

#ifndef AETHER_INCLUDE_CALC_CHEMISTRY_H_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#ifndef AETHER_INCLUDE_CALC_CHEMISTRY_H_
#ifndef INCLUDE_CALC_CHEMISTRY_H_

// Full license can be found in License.md

#ifndef AETHER_INCLUDE_CALC_CHEMISTRY_H_
#define AETHER_INCLUDE_CALC_CHEMISTRY_H_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define AETHER_INCLUDE_CALC_CHEMISTRY_H_
#define INCLUDE_CALC_CHEMISTRY_H_



#endif // AETHER_INCLUDE_CALC_CHEMISTRY_H_
#endif // AETHER_INCLUDE_CALC_CHEMISTRY_H_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#endif // AETHER_INCLUDE_CALC_CHEMISTRY_H_
#endif // INCLUDE_CALC_CHEMISTRY_H_

include/grid.h Outdated
For example:
_s3gc : scalar variable, 3d, include ghost cells, cell centers
_31ne :
_31ne :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would this one be an example of?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also there are _scgc in use later. This would be: scalar variable, cube?, include ghost cells, cell centers ?

include/euv.h Outdated
// Copyright 2020, the Aether Development Team (see doc/dev_team.md for members)
// Full license can be found in License.md

#ifndef AETHER_INCLUDE_EUV_H_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#ifndef AETHER_INCLUDE_EUV_H_
#ifndef INCLUDE_EUV_H_

include/euv.h Outdated
};

#endif // AETHER_INCLUDE_EUV_H_
#endif // AETHER_INCLUDE_EUV_H_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#endif // AETHER_INCLUDE_EUV_H_
#endif // INCLUDE_EUV_H_

Copy link
Contributor

@Ionospheres Ionospheres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My first github review! Sorry for all of the update emails. Angeline showed me how to avoid that next time. Overall code looks good. I've made a few format suggestions so things are consistent between files. Outputs look reasonable given the resolutions, included physics, and the early state the model is in. It would be nice if the output netcdf files were formatted such that they work with panoply to facilitate quick viewing of simulation results. I'll learn how to make a feature request (?) and add that to our to-do list.

@aaronjridley aaronjridley merged commit 21c7929 into develop Feb 3, 2021
@aaronjridley aaronjridley deleted the armadillo branch February 3, 2021 14:11
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.

3 participants