@@ -12,48 +12,56 @@ module fpm_meta_netcdf
12
12
13
13
public :: init_netcdf
14
14
15
- contains
15
+ contains
16
16
17
17
! > Initialize NetCDF metapackage for the current system
18
- subroutine init_netcdf (this ,compiler ,error )
18
+ subroutine init_netcdf (this , compiler , error )
19
19
class(metapackage_t), intent (inout ) :: this
20
20
type (compiler_t), intent (in ) :: compiler
21
21
type (error_t), allocatable , intent (out ) :: error
22
22
23
23
logical :: s
24
24
character (len= :), allocatable :: include_flag, libdir
25
25
26
- include_flag = get_include_flag(compiler," " )
26
+ include_flag = get_include_flag(compiler, " " )
27
27
28
28
! > Cleanup
29
29
call destroy(this)
30
- allocate (this% link_libs(0 ),this% incl_dirs(0 ),this% external_modules(0 ))
31
- this% link_flags = string_t(" " )
32
- this% flags = string_t(" " )
30
+ allocate (this % link_libs(0 ), this % incl_dirs(0 ), this % external_modules(0 ))
31
+ this % link_flags = string_t(" " )
32
+ this % flags = string_t(" " )
33
33
34
34
! > Assert pkg-config is installed
35
- if (.not. assert_pkg_config()) then
35
+ if (.not. assert_pkg_config()) then
36
36
call fatal_error(error, ' netcdf metapackage requires pkg-config' )
37
37
return
38
38
end if
39
39
40
40
if (.not. pkgcfg_has_package(' netcdf' )) then
41
- call fatal_error(error,' pkg-config could not find a suitable netcdf package.' )
41
+ call fatal_error(error, ' pkg-config could not find a suitable netcdf package.' )
42
42
end if
43
43
call add_pkg_config_compile_options(this, ' netcdf' , include_flag, libdir, error)
44
44
if (allocated (error)) return
45
45
46
46
if (.not. pkgcfg_has_package(' netcdf-fortran' )) then
47
47
call fatal_error(error, &
48
- ' pkg-config could not find a suitable netcdf-fortran package.' )
48
+ ' pkg-config could not find a suitable netcdf-fortran package.' )
49
49
end if
50
50
call add_pkg_config_compile_options(this, ' netcdf-fortran' , include_flag, libdir, error)
51
51
if (allocated (error)) return
52
52
53
-
54
53
! > Add NetCDF modules as external
55
- this% has_external_modules = .true.
56
- this% external_modules = [string_t(' netcdf' )]
54
+ this % has_external_modules = .true.
55
+ this % external_modules = [string_t(' netcdf' ), &
56
+ string_t(' netcdf4_f03' ), &
57
+ string_t(' netcdf4_nc_interfaces' ), &
58
+ string_t(' netcdf4_nf_interfaces' ), &
59
+ string_t(' netcdf_f03' ), &
60
+ string_t(' netcdf_fortv2_c_interfaces' ), &
61
+ string_t(' netcdf_nc_data' ), &
62
+ string_t(' netcdf_nc_interfaces' ), &
63
+ string_t(' netcdf_nf_data' ), &
64
+ string_t(' netcdf_nf_interfaces' )]
57
65
58
66
print * , ' NetCDF metapackage initialized successfully.'
59
67
0 commit comments