get_v2d_netcdf_R8 Subroutine

public subroutine get_v2d_netcdf_R8(filename, name, array, Xdim, Ydim, rc)

Uses

    • netcdf
  • proc~~get_v2d_netcdf_r8~~UsesGraph proc~get_v2d_netcdf_r8 get_v2d_netcdf_R8 netcdf netcdf proc~get_v2d_netcdf_r8->netcdf

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename
character(len=*), intent(in) :: name
real(kind=REAL64), intent(out), dimension(Xdim,Ydim) :: array
integer, intent(in) :: Xdim
integer, intent(in) :: Ydim
integer, intent(out), optional :: rc

Calls

proc~~get_v2d_netcdf_r8~~CallsGraph proc~get_v2d_netcdf_r8 get_v2d_netcdf_R8 nf90_close nf90_close proc~get_v2d_netcdf_r8->nf90_close nf90_get_att nf90_get_att proc~get_v2d_netcdf_r8->nf90_get_att nf90_get_var nf90_get_var proc~get_v2d_netcdf_r8->nf90_get_var nf90_inq_varid nf90_inq_varid proc~get_v2d_netcdf_r8->nf90_inq_varid nf90_open nf90_open proc~get_v2d_netcdf_r8->nf90_open proc~check_nc_status check_nc_status proc~get_v2d_netcdf_r8->proc~check_nc_status proc~mapl_return MAPL_Return proc~get_v2d_netcdf_r8->proc~mapl_return proc~mapl_verify MAPL_Verify proc~get_v2d_netcdf_r8->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

Called by

proc~~get_v2d_netcdf_r8~~CalledByGraph proc~get_v2d_netcdf_r8 get_v2d_netcdf_R8 interface~get_v2d_netcdf get_v2d_netcdf interface~get_v2d_netcdf->proc~get_v2d_netcdf_r8

Source Code

  subroutine get_v2d_netcdf_R8(filename, name, array, Xdim, Ydim, rc)
    use netcdf
    implicit none
    character(len=*), intent(in) :: name, filename
    integer, intent(in) :: Xdim, Ydim
    real(REAL64), dimension(Xdim,Ydim), intent(out) :: array
    integer, optional, intent(out) :: rc
    integer :: status
    integer :: ncid, varid
    real    :: scale_factor, add_offset
    integer :: iret

    call check_nc_status(nf90_open(trim(fileName), NF90_NOWRITE, ncid), _RC)
    call check_nc_status(nf90_inq_varid(ncid, name, 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
    !
    call check_nc_status(nf90_close(ncid), _RC)

    _RETURN(_SUCCESS)

  end subroutine get_v2d_netcdf_R8