FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout), | dimension(2) | :: | vnm |
subroutine init_vnm (vnm)
# ifdef NETCDF
use mp, only: proc0, broadcast
use neasyf, only: neasyf_open, neasyf_read, neasyf_close
use netcdf_utils, only: kind_nf
# else
use mp, only: mp_abort
# endif
implicit none
real, dimension(2), intent (in out) :: vnm
# ifdef NETCDF
character (run_name_size) :: file_proc
logical :: is_one_file_per_processor
! NetCDF handles
integer(kind_nf) :: ncid
if (proc0) then
is_one_file_per_processor = read_many .or. (.not. has_netcdf_parallel)
file_proc = get_file_proc(is_one_file_per_processor)
ncid = neasyf_open (file_proc, "r")
call neasyf_read(ncid, "vnm1", vnm(1))
call neasyf_read(ncid, "vnm2", vnm(2))
call neasyf_close(ncid)
endif
call broadcast (vnm)
# else
call mp_abort("Cannot load vnm from restart without netcdf.", .true.)
UNUSED_DUMMY(vnm)
# endif
end subroutine init_vnm