From 0cd31073b1b4cffa1ad8f53efa4bdcc3741410fe Mon Sep 17 00:00:00 2001 From: chris.smartt Date: Tue, 22 Oct 2019 15:07:35 +0100 Subject: [PATCH] Fix numbering error for overshields if overshield is not the last defined cable. Update to V4.1.0 --- SOFTWARE_NOTES/known_problems.txt | 5 +++++ SOFTWARE_NOTES/work_log.txt | 4 ++++ SRC/BUNDLE_DOMAIN_CREATION/create_global_domain_structure.F90 | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++------- version_information.inc | 4 ++-- 4 files changed, 61 insertions(+), 9 deletions(-) diff --git a/SOFTWARE_NOTES/known_problems.txt b/SOFTWARE_NOTES/known_problems.txt index 65bb2c2..53e79bc 100644 --- a/SOFTWARE_NOTES/known_problems.txt +++ b/SOFTWARE_NOTES/known_problems.txt @@ -1 +1,6 @@ Record of known problems in SACAMOS + +21/10/2019: A problem has been reported when using overshields. If the overshield is + not the last cable to be defined then the numbering of reference conductors + (shields) in the bundle can be incorrect. Fixed 22/10/2019 CJS. + diff --git a/SOFTWARE_NOTES/work_log.txt b/SOFTWARE_NOTES/work_log.txt index cae536c..0d86ce2 100644 --- a/SOFTWARE_NOTES/work_log.txt +++ b/SOFTWARE_NOTES/work_log.txt @@ -14,3 +14,7 @@ 13th July CJS fix error in creaating circuit symbols: incident field nodes were missing... + +22/10/2019 CJS. Fix numbering error for overshields following a reported error. + Successfully re-run all the automatic test cases and upload the update + to the repository. diff --git a/SRC/BUNDLE_DOMAIN_CREATION/create_global_domain_structure.F90 b/SRC/BUNDLE_DOMAIN_CREATION/create_global_domain_structure.F90 index 3f3cf96..c1a54d3 100644 --- a/SRC/BUNDLE_DOMAIN_CREATION/create_global_domain_structure.F90 +++ b/SRC/BUNDLE_DOMAIN_CREATION/create_global_domain_structure.F90 @@ -73,7 +73,8 @@ ! so that we can work out the is_shield flag properly in all circumstances. ! 18/10/2017 CJS: include 8b. Copy the cable based conductor labels to the bundle structure ! 16/11/2017 CJS Include network synthesis process to replace s-domain transfer functions -! 16/3/2018 CJS add y offset for ML_flex_cable +! 16/3/2018 CJS add y offset for ML_flex_cable +! 22/10/2019 CJS Fix bug with numbering here: overshields were numbered using terminal conductor number not global domain number ! SUBROUTINE create_global_domain_structure(bundle) @@ -110,7 +111,7 @@ USE maths integer :: local_cable_conductor,local_domain_conductor integer :: local_n_domains,local_domain integer :: first_external_domain - integer :: reference_conductor + integer :: reference_conductor,global_reference_conductor integer :: first_external_conductor ! variables for looking at overshields and determining which domain cables are in @@ -354,7 +355,7 @@ USE maths overshield_domain(overshield)=tot_n_domains global_domain_reference_conductor(tot_n_domains)=overshield_reference_terminal_conductor(overshield) - + end if ! this overshield domain is unallocated cable_reference_domain(cable)=overshield_domain(overshield) @@ -623,10 +624,13 @@ USE maths ! 5c. Set the global_domain_conductor_to_terminal_conductor from terminal_conductor_to_global_domain_conductor if (verbose) then + write(*,*)'conductor,terminal_conductor_to_global_domain_conductor(conductor)' + do conductor=1,tot_n_conductors write(*,*)conductor,terminal_conductor_to_global_domain_conductor(conductor) end do + end if ! loop over terminal conductors @@ -634,7 +638,33 @@ USE maths global_domain_conductor_to_terminal_conductor(terminal_conductor_to_global_domain_conductor(conductor))=conductor end do -! 5d. Set the global_domain_reference_conductor information, also flag all the reference conductors in internal domains + if (verbose) then + + write(*,*)'conductor,global_domain_conductor_to_terminal_conductor(conductor)' + + do conductor=1,tot_n_conductors + write(*,*)conductor,global_domain_conductor_to_terminal_conductor(conductor) + end do + + end if + +! 22/10/2019 CJS Fix bug with numbering here: overshields were numbered using terminal conductor number +! not global domain conductor as it should be at this stage +! 5d. Renumber the reference conductors for overshield domains. At the moment these are terminal conductors +! not global domain conductors + + do overshield=1,tot_n_overshields + + domain=overshield_domain(overshield) + + reference_conductor=global_domain_reference_conductor(domain) + + global_reference_conductor=terminal_conductor_to_global_domain_conductor(reference_conductor) + global_domain_reference_conductor(domain)=global_reference_conductor + + end do ! next overshield + +! 5e. Set the global_domain_reference_conductor information, also flag all the reference conductors in internal domains conductor=0 ! this is the external conductor number @@ -669,13 +699,20 @@ USE maths domain=terminal_conductor_to_global_domain(conductor) ! 16/5/2016 this should be the global not the local number... global_domain_reference_conductor(domain)=reference_conductor global_domain_reference_conductor(domain)=bundle%cable(cable)%global_domain_conductor(reference_conductor) - + else -! the reference conductor is defined in terms of the reference domain of the cable + +! the reference conductor is defined in terms of the reference domain of the cable + domain=cable_reference_domain(cable) - reference_conductor=global_domain_reference_conductor(domain) + + global_reference_conductor=global_domain_reference_conductor(domain) + + reference_conductor=global_domain_conductor_to_terminal_conductor(global_reference_conductor) + terminal_conductor_to_reference_global_domain_conductor(conductor)= & terminal_conductor_to_global_domain_conductor(reference_conductor) + reference_conductor=0 end if @@ -1287,17 +1324,23 @@ USE maths ! apart from the shielded twisted pair differential mode exception ! so record this hence set out the inner domain number for shields +write(*,*)'****************************************************************' + do domain=1,bundle%tot_n_domains-1 ! note we exclude the exterior domain here reference_conductor=global_domain_reference_conductor(domain) terminal_conductor=global_domain_conductor_to_terminal_conductor(reference_conductor) + write(*,*)'domain=',domain,' reference_conductor=',reference_conductor,' terminal_conductor=',terminal_conductor + if (.NOT.domain_is_TP_differential_mode(domain)) then bundle%terminal_conductor_is_shield_flag(terminal_conductor)=.TRUE. bundle%terminal_conductor_to_inner_domain(terminal_conductor)=domain end if end do ! next conductor + +write(*,*)'****************************************************************' ! work out the outer domain for each conductor and the associated reference conductor do conductor=1,bundle%tot_n_conductors diff --git a/version_information.inc b/version_information.inc index 6d6c2a3..f5a1f64 100644 --- a/version_information.inc +++ b/version_information.inc @@ -1,2 +1,2 @@ -SPICE_CABLE_MODEL_BUILDER_version="v4.0.0" -SPICE_CABLE_MODEL_BUILDER_date="6th October 2018" +SPICE_CABLE_MODEL_BUILDER_version="v4.1.0" +SPICE_CABLE_MODEL_BUILDER_date="22nd October 2019" -- libgit2 0.21.2