Skip to content

Instantly share code, notes, and snippets.

@jkrall
Last active September 4, 2015 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkrall/5ccbb89e2fbfb0455d5b to your computer and use it in GitHub Desktop.
Save jkrall/5ccbb89e2fbfb0455d5b to your computer and use it in GitHub Desktop.
FILE: ObserverResultClass.f03, LINE: 9950
Arrays that should be the same size are not.
Size of number of segments not equal to the number of nodes.
!--------------------------------------------------------------------------------------
! The observer is defined here as a curved line of nodes (structured). The input file
! defines the number of frame changes and the surface definition. For this example,
! the line is a structured mesh of 21 node points organized as a circular arc that is
! moving at 68.6 m/s in the x direction.
!---------------------------------------------------------------------------------------
&ObserverPointCloudNamelist
! This is the number of frame changes from the ground frame to the frame of reference
! where the line is defined. For this example, the frame change will be a constant
! velocity of 68.6 m/s.
nFrameChanges = 0
/
&PointCloudNamelist
! This is the coordinate type of the location of the observer. Options are
! SPHERICAL and CARTESIAN. In Cartesian coordinates the location is the X, Y, Z
! location of the observer in the observer frame. In spherical, it is the THETA,
! PHI, R position.
strCoordinateType = "CARTESIAN"
! The units of the length parameters in the location vector of the observer.
! This includes X, Y, and Z when the coordinate type is Cartesian and R when the
! coordinate type is spherical. Options are ’METER’, ’FEET’, and ’INCHES’. See
! User’s Manual for other options.
strLengthUnitType = "FEET"
nNodes = 23
/
91.7263344563119, -37.246202050797194, 0
84.59142418314794, -51.43239207607143, 0
78.85646188439543, -59.855312371375106, 0
67.01072099858342, -72.8736116248537, 0
59.44160230726253, -79.16878119022196, 0
47.844955942245235, -86.67098817300177, 0
36.12280164942436, -92.1745257703903, 0
25.122036513895765, -95.7595075248118, 0
12.236546197308767, -98.24086185066338, 0
0.0, -99.0, 0
-12.407990122866133, -98.2193554301333, 0
-23.446976460496245, -96.18336287976697, 0
-35.31706193264291, -92.48624295778193, 0
-47.69361373606982, -86.75436132434248, 0
-59.164889550576596, -79.37578878013164, 0
-68.5221742131703, -71.45426258173784, 0
-77.04607170407607, -62.16834270728445, 0
-85.56320539341677, -49.79897471639325, 0
-90.51114156819212, -40.10901709120638, 0
132.86834808565155, -80.78522189726371, 0
42.29571209157397, -25.716196038035715, 0
-0.21554542680983224, -24.69905949968503, 0
-170.95231902014075, -99.8964695153739, 0
@LeonardLopes
Copy link

Joshua,
Are you seeing that error on the export or on the create? I have been able to reproduce an error with the following user code, can you confirm this is the error you are seeing? You will have to compile the macros with the user code.
Len

!------------------------------------------------------------------------------------------
! This is an example that shows the user how to use the Observer API to create an 
! Observer.
!------------------------------------------------------------------------------------------
program CreatePointCloud

  implicit none

  ! Every code that uses this API must include the interface file. The Observer API
  ! contains the definitions of the functions and the enumerators available.
  include "ANOPP2.api.f90"
  ! Include the anopp2 macro file as well so we can use the observer macro that creates a
  ! dummy result in the observer data structure.
  include "ANOPP2.macro.f90"

  integer   (4)  :: intTag
  character (26) :: strConfigFile = 'pointcloud.config'
  integer   (4)  :: nNodes
  integer   (4), dimension (:), pointer :: intResultTags => NULL ()
  real      (4), dimension (1) :: fltSegmentTimes = [0.0]
  logical   (4), dimension (2) :: blnIncludesFlightEffects = [.true., .true.]

  ! Initialize the API.
  call a2f_exec_init_api ()

  ! Create an Observer based on the values specified in 'Sphere.config' file and retrieve
  ! a tag.
  print*, a2f_obs_create (intTag, strConfigFile)

  ! Retrieve the number of nodes from te observer point cloud.
  print*, a2f_obs_number_of_nodes (intTag, nNodes)

  ! Create a new result in the observer data structure which will be initialized
  ! to some dummy values so we can export and visually inspect the results.
  print*, a2f_obs_new_results (intTag, 1, ['EMPTY'], intResultTags)

  ! Use the dummy result macro in the observer api to create empty values for
  ! all nodes and the one segment.
  print*, a2f_obs_macro_dummy_result                                        &
            (intTag, intResultTags(1), a2_aa_octave, a2_aa_absolute_levels, &
             fltSegmentTimes, a2_aa_std_center_frequencies, blnIncludesFlightEffects)

  ! Now that we have empty results in the observer data structure, export the observer
  ! point cloud so we can visually inspect the results.
  print*, a2f_obs_export                                                               &
            (intTag, intResultTags(1), 'empty.pointcloud.dat', a2_aa_octave, a2_local, &
             a2_formatted, a2_tecplot)

end program CreatePointCloud

@LeonardLopes
Copy link

The above code now runs as expected with 1.1.1; however, now I am getting a 'not implemented' error because the metric is a2_aa_octave. Is that the metric you are working with?

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