Convert model initialisation routines to python#3586
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3586 +/- ##
==========================================
+ Coverage 31.01% 36.54% +5.53%
==========================================
Files 87 87
Lines 20412 22190 +1778
==========================================
+ Hits 6330 8110 +1780
+ Misses 14082 14080 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
95dcc3a to
1fc5a9d
Compare
7e17115 to
5f1352e
Compare
|
Errors in the TF coil are being caused by setting tfv.poisson_cond_axial = 0.3
tfv.poisson_cond_trans = 0.3The reason PROCESS/source/fortran/tfcoil_variables.f90 Lines 929 to 930 in cb982be If you look around, every other float variable being assigned is followed by a D0 which explicitly sets the value to double precision. Therefore, in the Fortran these variables were being initialised to single precision 0.3 (still being assigned to a double precision variable however). When we set 0.3 across the Python-Fortran interface, it does it to double precision not single precision.
To verify, I changed the Fortran code to poisson_cond_axial = 0.3D0
poisson_cond_trans = 0.3D0and the same errors (differences) occur as in the Python case. |
jonmaddock
left a comment
There was a problem hiding this comment.
Great stuff, just need to resolve conflicts then go for it!
d1c9166 to
56a2173
Compare
|
A similar issue to above is occurring at: PROCESS/source/fortran/pfcoil_variables.f90 Line 521 in f55aca5 When I calculate |
Converts module initialisation (setting of initial defaults) to Python.
In some cases, there was not an obvious places for these functions to live and so I just added to the file that seemed to use the variables the most.
See comment below for the annoying reason there are some slight test changes despite this being a line-for-line port of the code from Fortran to Python.