Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

put() CPO vs IDS
Code Block
titleITM
linenumberstrue
program diagnostic
    use euitm_schemas
    use euitm_routines
    implicit none

    integer :: idx, i
    type (type_equilibrium) :: cpo ! <= Single object !!!

	! Open a database
    call euitm_create('euitm', 11, 22, -1, -1, idx)





	! CPO structure allocation
	

!SCALARS (!)
	 	cpo%time = VALUE
        cpo%x%y = VALUE
   
    



call euitm_put_slice(idx, 'equilibrium', cpo)
call euitm_deallocate(cpoArray)
    ! Close a pulse file
    call euitm_close(idx)
end program
Code Block
titleIMAS
linenumberstrue
program diagnostic
    use ids_schemas
    use ids_routines
    implicit none

    integer :: idx, i
    type (ids_core_profiles) :: ids ! <= Single object !!!

	! Open a database
    call imas_create('ids', 11, 22, -1, -1, idx)
  
   ! Mandatory to define this property
  ids%ids_properties%homogeneous_time = 1 


allocate(ids%ids_properties%comment(1))
 ids%ids_properties%comment(1) = 'A test ids put using put_slice'
 call ids_put_non_timed(idx,"core_profiles",ids)


 ! IDS structure allocation
allocate(ids%time(1))
allocate(ids%x%y(1))   
 
!SCALARS (!)
    	ids%time(1) = VALUE
        ids%x%y(1) = VALUE


call ids_put_slice(idx, 'core_profiles', ids)
	call ids_deallocate(ids)
! Close a pulse file
    call imas_close(idx)
end program

 

 

 
 

4. Open example file

putSlice() CPO vs IDS
Code Block
titleITM
languagepy
title$TUTORIAL_DIR/ids_basics/python/put_ids_array.py
linenumberstrue
program diagnostic
    use euitm_schemas
    use euitm_routines
    implicit none

    integer :: idx, i, arraySize
    type (type_equilibrium), pointer :: cpoArray(:) ! <= Array !!!

	! Open a database
    call euitm_create('idseuitm', 11, 22, -1, -1, idx)





	! CPO structure allocation
	allocate(cpoArray(10))

!SCALARS (!)
	do i=1, 10
    	cpoArray(i)%time = VALUE
        cpoArray(i)%x%y = VALUE
    enddo
    



call euitm_put(idx, 'equilibrium', idscpoArray)
call euitm_deallocate(cpoArray)
    ! Close a pulse file
    call euitm_close(idx)
end program
Code Block
titleIMAS
languagepy
title$TUTORIAL_DIR/ids_basics/python/put_ids_slices.py
linenumberstrue
program diagnostic
    use ids_schemas
    use ids_routines
    implicit none

    integer :: idx, i
    type (ids_core_profiles) :: ids ! <= Single object !!!


	! Open a database
    call imas_create('ids', 11, 22, -1, -1, idx)
  
   ! Mandatory to define this property
    ids%ids_properties%homogeneous_time = 1 

! IDS structure allocation
allocate(ids%time(10(1))
allocate(ids%x%y(1))

    
 !SCALARS (!)
	do i=1, 10
    	ids%time(i) = VALUE
        ids%x%y(i) = VALUE
    enddo
! VECTORS
    	ids%time = timeVector
        ids%x%y  = valueVector

call ids_put(idx, 'core_profiles', ids)
	call ids_deallocate(ids)
! Close a pulse file
    call imas_close(idx)
end program

...