create_grid Subroutine

public subroutine create_grid(this, grid_name, rc)

Type Bound

regrid_support

Arguments

Type IntentOptional Attributes Name
class(regrid_support) :: this
character(len=*), intent(in) :: grid_name
integer, intent(out), optional :: rc

Calls

proc~~create_grid~2~~CallsGraph proc~create_grid~2 regrid_support%create_grid at at proc~create_grid~2->at none~get_dimension FileMetadata%get_dimension proc~create_grid~2->none~get_dimension none~make_grid~4 GridManager%make_grid proc~create_grid~2->none~make_grid~4 proc~create FileMetadataUtils%create proc~create_grid~2->proc~create proc~create_cf create_cf proc~create_grid~2->proc~create_cf proc~get_level_name FileMetadataUtils%get_level_name proc~create_grid~2->proc~get_level_name proc~mapl_return MAPL_Return proc~create_grid~2->proc~mapl_return proc~mapl_verify MAPL_Verify proc~create_grid~2->proc~mapl_verify proc~unpackgridname UnpackGridName proc~create_grid~2->proc~unpackgridname none~get_dimension->at none~get_dimension->proc~mapl_return find find none~get_dimension->find none~make_grid_from_distgrid GridManager%make_grid_from_distGrid none~make_grid~4->none~make_grid_from_distgrid proc~create_cf->proc~mapl_verify interface~mapl_assert MAPL_Assert proc~create_cf->interface~mapl_assert interface~mapl_configsetattribute MAPL_ConfigSetAttribute proc~create_cf->interface~mapl_configsetattribute proc~mapl_configcreate MAPL_ConfigCreate proc~create_cf->proc~mapl_configcreate proc~get_level_name->proc~mapl_return none~begin~52 StringVariableMap%begin proc~get_level_name->none~begin~52 none~get_coordinate_variable FileMetadata%get_coordinate_variable proc~get_level_name->none~get_coordinate_variable none~get_variables FileMetadata%get_variables proc~get_level_name->none~get_variables none~is_attribute_present Variable%is_attribute_present proc~get_level_name->none~is_attribute_present none~key~117 StringVariableMapIterator%key proc~get_level_name->none~key~117 none~next~48 StringVariableMapIterator%next proc~get_level_name->none~next~48 proc~get_variable_attribute FileMetadataUtils%get_variable_attribute proc~get_level_name->proc~get_variable_attribute 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~~create_grid~2~~CalledByGraph proc~create_grid~2 regrid_support%create_grid proc~process_command_line~3 regrid_support%process_command_line proc~process_command_line~3->proc~create_grid~2 proc~main~2 main proc~main~2->proc~process_command_line~3 program~regrid_util Regrid_Util program~regrid_util->proc~main~2

Source Code

    subroutine create_grid(this,grid_name,rc)
    class(regrid_support) :: this
    character(len=*), intent(in) :: grid_name
    integer, optional, intent(out) :: rc

    type (FileMetaDataUtils) :: metadata
    type (FileMetaData) :: basic_metadata
    character(len=:),allocatable :: lev_name
    integer :: im_world,jm_world,lm_world
    type(NetCDF4_FileFormatter) :: formatter
    character(len=:), allocatable :: filename
    character(len=2) :: dateline,pole
    integer :: status
    type(ESMF_CONFIG) :: cfoutput

    filename = this%filenames%at(1)

    call formatter%open(trim(filename),pFIO_Read,_RC)
    basic_metadata=formatter%read(_RC)
    call metadata%create(basic_metadata,trim(filename))

    call formatter%close(_RC)

    lm_world=0
    lev_name=metadata%get_level_name()
    if (trim(lev_name)/='') then
       lm_world = metadata%get_dimension(lev_name,_RC)
    end if
    call UnpackGridName(Grid_name,im_world,jm_world,dateline,pole)

    cfoutput = create_cf(grid_name,im_world,jm_world,this%nx,this%ny,lm_world,this%cs_stretch_param,this%lon_range,this%lat_range,this%tripolar_file_out,_RC)
    this%new_grid=grid_manager%make_grid(cfoutput,prefix=trim(grid_name)//".",_RC)

    _RETURN(_SUCCESS)
    end subroutine create_grid