get_v1d_netcdf_R8_complete Subroutine

public subroutine get_v1d_netcdf_R8_complete(filename, varname, array, att_name, att_value, group_name, rc)

Uses

    • netcdf
  • proc~~get_v1d_netcdf_r8_complete~~UsesGraph proc~get_v1d_netcdf_r8_complete get_v1d_netcdf_R8_complete netcdf netcdf proc~get_v1d_netcdf_r8_complete->netcdf

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename
character(len=*), intent(in) :: varname
real(kind=REAL64), intent(inout) :: array(:)
character(len=*), intent(in), optional :: att_name
real(kind=REAL64), intent(out), optional :: att_value
character(len=*), intent(out), optional :: group_name
integer, intent(out), optional :: rc

Calls

proc~~get_v1d_netcdf_r8_complete~~CallsGraph proc~get_v1d_netcdf_r8_complete get_v1d_netcdf_R8_complete nf90_close nf90_close proc~get_v1d_netcdf_r8_complete->nf90_close nf90_get_att nf90_get_att proc~get_v1d_netcdf_r8_complete->nf90_get_att nf90_get_var nf90_get_var proc~get_v1d_netcdf_r8_complete->nf90_get_var nf90_inq_ncid nf90_inq_ncid proc~get_v1d_netcdf_r8_complete->nf90_inq_ncid nf90_inq_varid nf90_inq_varid proc~get_v1d_netcdf_r8_complete->nf90_inq_varid nf90_open nf90_open proc~get_v1d_netcdf_r8_complete->nf90_open proc~check_nc_status check_nc_status proc~get_v1d_netcdf_r8_complete->proc~check_nc_status proc~mapl_return MAPL_Return proc~get_v1d_netcdf_r8_complete->proc~mapl_return proc~mapl_verify MAPL_Verify proc~get_v1d_netcdf_r8_complete->proc~mapl_verify proc~check_nc_status->proc~mapl_return interface~mapl_assert MAPL_Assert proc~check_nc_status->interface~mapl_assert nf90_strerror nf90_strerror proc~check_nc_status->nf90_strerror at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Source Code

  subroutine get_v1d_netcdf_R8_complete(filename, varname, array, att_name, att_value, group_name, rc)
    use netcdf
    implicit none
    character(len=*), intent(in) :: filename
    character(len=*), intent(in) :: varname
    real(REAL64), intent(inout) :: array(:)
    character(len=*), optional, intent(in) :: att_name
    real(REAL64), optional, intent(out) :: att_value
    character(len=*), optional, intent(out) :: group_name
    integer, optional, intent(out) :: rc

    integer :: status, iret
    integer :: ncid, ncid_grp, ncid_sv
    integer :: varid
    real(REAL32) :: scale_factor, add_offset

    call check_nc_status(nf90_open(trim(fileName), NF90_NOWRITE, ncid), _RC)
    ncid_sv = ncid
    if(present(group_name)) then
       call check_nc_status(nf90_inq_ncid(ncid, group_name, ncid_grp), _RC)
       ! mod
       ncid = ncid_grp
    end if
    call check_nc_status(nf90_inq_varid(ncid, varname, varid), _RC)
    call check_nc_status(nf90_get_var(ncid, varid, array), _RC)

    iret = nf90_get_att(ncid, varid, 'scale_factor', scale_factor)
    if(iret .eq. 0) array = array * scale_factor
    !
    iret = nf90_get_att(ncid, varid, 'add_offset', add_offset)
    if(iret .eq. 0) array = array + add_offset

    if(present(att_name)) then
       call check_nc_status(nf90_get_att(ncid, varid, att_name, att_value), _RC)
    end if

    call check_nc_status(nf90_close(ncid_sv), _RC)

    _RETURN(_SUCCESS)

  end subroutine get_v1d_netcdf_R8_complete