• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gyrokinetics / gs2 / 2021218321

04 Sep 2025 07:44AM UTC coverage: 10.606% (+0.03%) from 10.577%
2021218321

push

gitlab-ci

David Dickinson
Merged in feature/move_more_initialisation_to_init_levels (pull request #1161)

4710 of 44407 relevant lines covered (10.61%)

125698.1 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/gs2_metadata.fpp
1
#include "unused_dummy.inc"
2
!> Write some standard metadata to a netCDF file
3
!>
4
!> Standalone module to avoid circular dependencies
5
module gs2_metadata
6
  implicit none
7
contains
8
  !> Add some standard metadata as global attributes to the file:
9
  !>
10
  !> - title: description of file
11
  !> - software_name: GS2
12
  !> - software_version: <current version>
13
  !> - netcdf_version: version of netCDF used
14
  !> - date_created: date/time of this simulation
15
  !> - id: UUID of this simulation
16
  !> - comment: human-friendly description of run
17
  !> - Conventions: URL of GS2 website
18
  !>
19
  !> Uses [[standard_header_type]] to get the UUID and date-time consistent
20
  !> across the simulation
21
  subroutine create_metadata(file_id, title, header, comments)
×
22
#ifdef NETCDF
23
    use netcdf, only : NF90_GLOBAL, nf90_inq_libvers
24
    use netcdf_utils, only: ensure_netcdf_var_exists, netcdf_error, ensure_netcdf_dim_exists, ensure_netcdf_att_exists
25
    use git_version_mod, only : get_git_version
26
#endif
27
    use standard_header, only : standard_header_type
28
    !> NetCDF ID of the file
29
    integer, intent(in) :: file_id
30
    !> Brief description of the file contents
31
    character(len=*), intent(in) :: title
32
    !> Pre-generated header with UUID and date information
33
    type(standard_header_type), optional, intent(in) :: header
34
    !> Comments on this file, for example a human-friendly description
35
    character(len=*), optional, intent(in) :: comments
36
#ifdef NETCDF
37
    type(standard_header_type) :: local_header
×
38

39
    if (present(header)) then
×
40
      local_header = header
×
41
    else
42
      local_header = standard_header_type()
×
43
    end if
44

45
    call ensure_netcdf_att_exists(file_id, NF90_GLOBAL, "title", trim(title))
×
46
    call ensure_netcdf_att_exists(file_id, NF90_GLOBAL, "software_name", "GS2")
×
47
    call ensure_netcdf_att_exists(file_id, NF90_GLOBAL, "software_version", trim(get_git_version()))
×
48
    call ensure_netcdf_att_exists(file_id, NF90_GLOBAL, "netcdf_version", trim(nf90_inq_libvers()))
×
49
    call ensure_netcdf_att_exists(file_id, NF90_GLOBAL, "date_created", trim(local_header%date_time))
×
50
    call ensure_netcdf_att_exists(file_id, NF90_GLOBAL, "id", trim(local_header%run_uuid))
×
51
    call ensure_netcdf_att_exists(file_id, NF90_GLOBAL, "Conventions", "https://gyrokinetics.gitlab.io/gs2/")
×
52
    call ensure_netcdf_att_exists(file_id, NF90_GLOBAL, "references", "https://doi.org/10.5281/zenodo.2551066")
×
53
    if (present(comments)) then
×
54
       call ensure_netcdf_att_exists(file_id, NF90_GLOBAL, "comment", trim(comments))
×
55
    end if
56
#else
57
   UNUSED_DUMMY(file_id) ; UNUSED_DUMMY(title) ; UNUSED_DUMMY(header) ; UNUSED_DUMMY(comments)
58
#endif
59
  end subroutine create_metadata
×
60
end module gs2_metadata
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc