Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master to Develop #14

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions MachUp.cbp
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="MachUp" />
<Option pch_mode="2" />
<Option compiler="gfortran" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/MachUp" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gfortran" />
<Option parameters="input.json" />
<Compiler>
<Add option="-cpp" />
<Add option="-ffree-line-length-none" />
<Add option="-fdefault-double-8" />
<Add option="-fdefault-real-8" />
<Add option="-g" />
<Add directory="common/obj/Debug" />
</Compiler>
<Linker>
<Add library="common/bin/Debug/libcommon.a" />
</Linker>
</Target>
<Target title="Release">
<Option output="bin/Release/MachUp" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="1" />
<Option compiler="gfortran" />
<Option parameters="input.json" />
<Compiler>
<Add option="-march=corei7" />
<Add option="-fexpensive-optimizations" />
<Add option="-O3" />
<Add option="-cpp" />
<Add option="-ffree-line-length-none" />
<Add option="-fdefault-double-8" />
<Add option="-fdefault-real-8" />
<Add directory="common/obj/Release" />
</Compiler>
<Linker>
<Add option="-static" />
<Add library="common/bin/Release/libcommon.a" />
</Linker>
</Target>
<Target title="Debug_dnad">
<Option output="bin/Debug_dnad/MachUp" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug_dnad/" />
<Option type="1" />
<Option compiler="gfortran" />
<Option parameters="input.json" />
<Compiler>
<Add option="-cpp" />
<Add option="-ffree-line-length-none" />
<Add option="-fdefault-double-8" />
<Add option="-fdefault-real-8" />
<Add option="-g" />
<Add option="-Ddnad" />
<Add option="-Dndv=1" />
<Add directory="common/obj/Debug_dnad" />
</Compiler>
<Linker>
<Add library="common/bin/Debug_dnad/libcommon.a" />
</Linker>
</Target>
<Target title="Release_dnad">
<Option output="bin/Release_dnad/MachUp" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release_dnad/" />
<Option type="1" />
<Option compiler="gfortran" />
<Option parameters="input.json" />
<Compiler>
<Add option="-march=corei7" />
<Add option="-fexpensive-optimizations" />
<Add option="-O3" />
<Add option="-cpp" />
<Add option="-ffree-line-length-none" />
<Add option="-fdefault-double-8" />
<Add option="-fdefault-real-8" />
<Add option="-Ddnad" />
<Add option="-Dndv=3" />
<Add directory="Common/obj/Release_dnad" />
</Compiler>
<Linker>
<Add option="-static" />
<Add library="common/bin/Release_dnad/libcommon.a" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
</Compiler>
<Unit filename="src/loads.f90">
<Option weight="2" />
</Unit>
<Unit filename="src/main.f90">
<Option weight="3" />
</Unit>
<Unit filename="src/plane.f90">
<Option weight="1" />
</Unit>
<Unit filename="src/special_functions.f90">
<Option weight="2" />
</Unit>
<Unit filename="src/view.f90">
<Option weight="2" />
</Unit>
<Unit filename="src/wing.f90">
<Option weight="0" />
</Unit>
<Extensions>
<code_completion />
<envvars />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
37 changes: 37 additions & 0 deletions MachUp.depend
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# depslib dependency file v1.0
1461447781 source:.\src\wing_m.f90

1461858177 source:.\src\plane_m.f90

1461454039 source:.\src\loads_m.f90

1461871718 source:.\src\special_functions_m.f90

1461871718 source:.\src\view_m.f90

1460665600 source:.\src\machup.f90

1479942913 source:.\src\wing.f90

1480801915 source:.\src\plane.f90

1479942913 source:.\src\loads.f90

1479942913 source:.\src\special_functions.f90

1480129483 source:.\src\view.f90

1479942913 source:.\src\main.f90

1519333779 source:.\src\wing.f90

1519333710 source:.\src\plane.f90

1519264399 source:.\src\loads.f90

1519333779 source:.\src\special_functions.f90

1521948505 source:.\src\view.f90

1518914913 source:.\src\main.f90

9 changes: 9 additions & 0 deletions MachUp.workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_workspace_file>
<Workspace title="Workspace">
<Project filename="MachUp.cbp">
<Depends filename="Common/Common.cbp" />
</Project>
<Project filename="Common/Common.cbp" />
</Workspace>
</CodeBlocks_workspace_file>
114 changes: 114 additions & 0 deletions common/Common.cbp
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="common" />
<Option pch_mode="2" />
<Option compiler="gfortran" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/common" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option object_output="obj/Debug/" />
<Option type="2" />
<Option compiler="gfortran" />
<Option createDefFile="1" />
<Compiler>
<Add option="-cpp" />
<Add option="-ffree-line-length-none" />
<Add option="-fdefault-double-8" />
<Add option="-fdefault-real-8" />
<Add option="-Wall" />
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin/Release/common" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option object_output="obj/Release/" />
<Option type="2" />
<Option compiler="gfortran" />
<Option createDefFile="1" />
<Compiler>
<Add option="-O2" />
<Add option="-cpp" />
<Add option="-ffree-line-length-none" />
<Add option="-fdefault-double-8" />
<Add option="-fdefault-real-8" />
<Add option="-Wall" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
<Target title="Debug_dnad">
<Option output="bin/Debug_dnad/common" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option object_output="obj/Debug_dnad/" />
<Option type="2" />
<Option compiler="gfortran" />
<Option createDefFile="1" />
<Compiler>
<Add option="-cpp" />
<Add option="-ffree-line-length-none" />
<Add option="-fdefault-double-8" />
<Add option="-fdefault-real-8" />
<Add option="-Wall" />
<Add option="-g" />
<Add option="-Ddnad" />
<Add option="-Dndv=3" />
</Compiler>
</Target>
<Target title="Release_dnad">
<Option output="bin/Release_dnad/common" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option object_output="obj/Release_dnad/" />
<Option type="2" />
<Option compiler="gfortran" />
<Option createDefFile="1" />
<Compiler>
<Add option="-O2" />
<Add option="-cpp" />
<Add option="-ffree-line-length-none" />
<Add option="-fdefault-double-8" />
<Add option="-fdefault-real-8" />
<Add option="-Wall" />
<Add option="-Ddnad" />
<Add option="-Dndv=3" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Unit filename="airfoil.f90">
<Option weight="3" />
</Unit>
<Unit filename="atmosphere.f90">
<Option weight="3" />
</Unit>
<Unit filename="dataset.f90">
<Option weight="2" />
</Unit>
<Unit filename="dnad.F90">
<Option weight="0" />
</Unit>
<Unit filename="json.f90">
<Option weight="0" />
</Unit>
<Unit filename="math.f90">
<Option weight="1" />
</Unit>
<Unit filename="myjson.f90">
<Option weight="1" />
</Unit>
<Unit filename="section.f90">
<Option weight="4" />
</Unit>
<Extensions>
<code_completion />
<envvars />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
1 change: 1 addition & 0 deletions common/Common.depend
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# depslib dependency file v1.0
14 changes: 8 additions & 6 deletions common/airfoil.f90
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ module airfoil_m
character(20) :: properties_type
integer :: has_data_file
integer :: has_geom_file

real :: aL0
real :: CLa
real :: CmL0
real :: Cma
real :: CD0,CD0L,CD0L2
real :: CLmax

type(dataset_t) :: data2D
type(dataset_t) :: geom
end type airfoil_t

type airfoil_p
type(airfoil_t),pointer :: p
type(airfoil_t),pointer :: p
end type airfoil_p

contains
Expand All @@ -45,11 +45,13 @@ subroutine af_create_geom_from_file(t,DB_Airfoil)
character(200) :: DB_Airfoil
character(100) :: filename

filename = trim(adjustl(DB_Airfoil))//'/'//trim(adjustl(t%name))//'_profile.txt'
call ds_create_from_file(t%geom,filename,2)
if(.not. allocated(t%geom%RawData)) then
filename = trim(adjustl(DB_Airfoil))//'/'//trim(adjustl(t%name))//'_profile.txt'
call ds_create_from_file(t%geom,filename,2)
end if

end subroutine af_create_geom_from_file

!-----------------------------------------------------------------------------------------------------------
real function af_CLa(t,alpha)
type(airfoil_t),pointer :: t
Expand Down
14 changes: 6 additions & 8 deletions common/dataset.f90
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module dataset_m
subroutine ds_allocate(t)
type(dataset_t) :: t

if(allocated(t%RawData)) call ds_deallocate(t)

allocate(t%RawData(t%datasize,t%dim))
allocate(t%Deriv(t%datasize,t%dim))
allocate(t%Xi(t%datasize))
Expand All @@ -55,7 +57,7 @@ subroutine ds_create_from_file(t,filename,dim)

if(index(filename, '.json') .ne. 0) then
!Read as JSON file
call ds_read_json(t,filename,dim)
call ds_read_json(t,filename)
call ds_calc_Xi(t)
else
!Read as text file
Expand Down Expand Up @@ -121,16 +123,11 @@ subroutine ds_read_file(t,filename,dim)
end subroutine ds_read_file

!-----------------------------------------------------------------------------------------------------------
subroutine ds_read_json(t,filename,dim)
subroutine ds_read_json(t,filename)
type(dataset_t), intent(out) :: t
character(len=*), intent(in) :: filename
integer, intent(in) :: dim

integer :: icol, irow
character(len=2) :: row_name, col_name
character(len=7) :: fmt_string
type(json_file) :: json !the JSON structure read from the file
type(json_value), pointer :: json_table, json_row

write(*,*) 'Reading JSON file: ',trim(filename)
call json%load_file(filename = filename); call json_check()
Expand All @@ -148,7 +145,6 @@ subroutine myjson_file_get_dataset(json, name, value)
character(len=*), intent(in) :: name
type(dataset_t), intent(out) :: value

real :: temp
type(json_value), pointer :: json_table, json_row
integer :: irow, icol, ncol
character(len=10) :: row_name, col_name
Expand Down Expand Up @@ -369,6 +365,7 @@ subroutine ds_linear_interpolate(t,value,ans)
y = t%RawData

!find correct interval
ival = 0
if(value < x(2)) then
ival = 1
elseif(value > x(n-1)) then
Expand Down Expand Up @@ -411,6 +408,7 @@ subroutine ds_cubic_interpolate(t,value,flag,ans)
y = t%RawData

!find correct interval
ival = 0
if(value < x(2)) then
ival = 1
elseif(value > x(n-1)) then
Expand Down
Loading