get_ncfile_dimension Subroutine

public subroutine get_ncfile_dimension(filename, nlon, nlat, tdim, key_lon, key_lat, key_time, rc)

Uses

    • netcdf
  • proc~~get_ncfile_dimension~~UsesGraph proc~get_ncfile_dimension get_ncfile_dimension netcdf netcdf proc~get_ncfile_dimension->netcdf

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename
integer, intent(out), optional :: nlon
integer, intent(out), optional :: nlat
integer, intent(out), optional :: tdim
character(len=*), intent(in), optional :: key_lon
character(len=*), intent(in), optional :: key_lat
character(len=*), intent(in), optional :: key_time
integer, intent(out), optional :: rc

Calls

proc~~get_ncfile_dimension~~CallsGraph proc~get_ncfile_dimension get_ncfile_dimension nf90_close nf90_close proc~get_ncfile_dimension->nf90_close nf90_inq_dimid nf90_inq_dimid proc~get_ncfile_dimension->nf90_inq_dimid nf90_inquire_dimension nf90_inquire_dimension proc~get_ncfile_dimension->nf90_inquire_dimension nf90_open nf90_open proc~get_ncfile_dimension->nf90_open proc~check_nc_status check_nc_status proc~get_ncfile_dimension->proc~check_nc_status proc~mapl_return MAPL_Return proc~get_ncfile_dimension->proc~mapl_return proc~mapl_verify MAPL_Verify proc~get_ncfile_dimension->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_ncfile_dimension~~CalledByGraph proc~get_ncfile_dimension get_ncfile_dimension proc~read_m_files_4_swath read_M_files_4_swath proc~read_m_files_4_swath->proc~get_ncfile_dimension

Source Code

  subroutine get_ncfile_dimension(filename, nlon, nlat, tdim, key_lon, key_lat, key_time, rc)
    use netcdf
    implicit none
    character(len=*), intent(in) :: filename
    integer, optional,intent(out) :: nlat, nlon, tdim
    character(len=*), optional, intent(in)  :: key_lon, key_lat, key_time
    integer, optional, intent(out) :: rc
    integer :: ncid , dimid
    integer :: status
    character(len=ESMF_MAXSTR) :: lon_name, lat_name, time_name

    call check_nc_status(nf90_open(trim(fileName), NF90_NOWRITE, ncid), _RC)
    if(present(key_lon)) then
       lon_name=trim(key_lon)
       call check_nc_status(nf90_inq_dimid(ncid, trim(lon_name), dimid), _RC)
       call check_nc_status(nf90_inquire_dimension(ncid, dimid, len=nlon), _RC)
    endif

    if(present(key_lat)) then
       lat_name=trim(key_lat)
       call check_nc_status(nf90_inq_dimid(ncid, trim(lat_name), dimid), _RC)
       call check_nc_status(nf90_inquire_dimension(ncid, dimid, len=nlat), _RC)
    endif

    if(present(key_time)) then
       time_name=trim(key_time)
       call check_nc_status(nf90_inq_dimid(ncid, trim(time_name), dimid), _RC)
       call check_nc_status(nf90_inquire_dimension(ncid, dimid, len=tdim), _RC)
    endif
    call check_nc_status(nf90_close(ncid), _RC)

    _RETURN(_SUCCESS)

  end subroutine get_ncfile_dimension